Imported Upstream version 3.3.0 upstream/3.3.0
authorBdale Garbee <bdale@gag.com>
Sun, 7 Aug 2011 08:04:06 +0000 (02:04 -0600)
committerBdale Garbee <bdale@gag.com>
Sun, 7 Aug 2011 08:04:06 +0000 (02:04 -0600)
341 files changed:
AUTHORS
ChangeLog
FULL_VERSION
Makefile.in
NEWS
ReleaseNotes
VERSION
aclocal.m4
amandad-src/Makefile.am
amandad-src/Makefile.in
amandad-src/amandad.c
amar-src/Makefile.am
amar-src/Makefile.in
amar-src/amar.c
amplot/Makefile.in
amplot/amplot.awk
amplot/amplot.g
application-src/Makefile.am
application-src/Makefile.in
application-src/amgtar.c
application-src/amlog-script.pl
application-src/ampgsql.pl
application-src/amsamba.pl
application-src/amstar.c
application-src/amsuntar.pl
application-src/amzfs-sendrecv.pl
changer-src/Makefile.in
client-src/Makefile.am
client-src/Makefile.in
client-src/amdump_client.pl [new file with mode: 0644]
client-src/client_util.c
client-src/client_util.h
client-src/selfcheck.c
client-src/sendbackup.c
client-src/sendsize.c
common-src/Makefile.am
common-src/Makefile.in
common-src/amfeatures.c
common-src/amfeatures.h
common-src/amflock-test.c
common-src/amflock.c
common-src/amflock.h
common-src/amservice.c [new file with mode: 0644]
common-src/amxml.c
common-src/amxml.h
common-src/bsd-security.c
common-src/conffile.c
common-src/conffile.h
common-src/directtcp.h
common-src/event-test.c
common-src/fileheader-test.c
common-src/hexencode-test.c
common-src/ipc-binary-test.c
common-src/local-security.c
common-src/match-test.c
common-src/match.c
common-src/match.h
common-src/quoting-test.c
common-src/rsh-security.c
common-src/security-util.c
common-src/security-util.h
common-src/sockaddr-util.c
common-src/sockaddr-util.h
common-src/ssh-security.c
common-src/svn-info.h
common-src/testutils.c
config/Makefile.in
config/amanda/as_needed.m4 [new file with mode: 0644]
config/amanda/dumpers.m4
config/amanda/file-list
config/amanda/krb5-security.m4
config/amanda/libs.m4
config/amanda/progs.m4
config/config.h.in
configure
configure.in
device-src/Makefile.am
device-src/Makefile.in
device-src/ndmp-device.c
device-src/property.c
device-src/property.h
device-src/s3-device.c
device-src/s3.c
device-src/s3.h
device-src/vfs-device.c
device-src/vfs-device.h
device-src/xfer-source-recovery.c
example/Makefile.in
example/amanda-client.conf.in
example/amanda.conf.in
example/template.d/advanced.conf.in
gnulib/Makefile.am
gnulib/Makefile.in
gnulib/fsusage.h
gnulib/regenerate/fsusage-no-bool.patch [new file with mode: 0644]
gnulib/regenerate/regenerate
installcheck/Amanda_Changer.pl
installcheck/Amanda_Changer_compat.pl
installcheck/Amanda_Changer_disk.pl
installcheck/Amanda_Changer_multi.pl
installcheck/Amanda_Changer_ndmp.pl
installcheck/Amanda_Changer_null.pl
installcheck/Amanda_Changer_rait.pl
installcheck/Amanda_Changer_robot.pl
installcheck/Amanda_Changer_single.pl
installcheck/Amanda_Config.pl
installcheck/Amanda_DB_Catalog.pl
installcheck/Amanda_Device.pl
installcheck/Amanda_Disklist.pl
installcheck/Amanda_Recovery_Clerk.pl
installcheck/Amanda_Recovery_Scan.pl
installcheck/Amanda_Tapelist.pl
installcheck/Amanda_Taper_Scan.pl
installcheck/Amanda_Taper_Scan_lexical.pl [new file with mode: 0644]
installcheck/Amanda_Taper_Scan_oldest.pl [new file with mode: 0644]
installcheck/Amanda_Taper_Scan_traditional.pl
installcheck/Amanda_Taper_Scribe.pl
installcheck/Amanda_Xfer.pl
installcheck/Installcheck/Config.pm
installcheck/Installcheck/Run.pm
installcheck/Makefile.am
installcheck/Makefile.in
installcheck/amadmin.pl
installcheck/amdevcheck.pl
installcheck/amdump_client.pl [new file with mode: 0644]
installcheck/amlabel.pl
installcheck/amserverconfig.pl
installcheck/amtape.pl
installcheck/amvault.pl
installcheck/gnutar.pl
installcheck/pp-scripts.pl
installcheck/taper.pl
man/Makefile.am
man/Makefile.in
man/amaddclient.8
man/amadmin.8
man/amaespipe.8
man/amanda-applications.7
man/amanda-archive-format.5
man/amanda-auth.7
man/amanda-changers.7
man/amanda-client.conf.5
man/amanda-compatibility.7
man/amanda-devices.7
man/amanda-interactivity.7 [new file with mode: 0644]
man/amanda-match.7
man/amanda-scripts.7
man/amanda-taperscan.7
man/amanda.8
man/amanda.conf.5
man/amarchiver.8
man/amcheck.8
man/amcheckdb.8
man/amcheckdump.8
man/amcleanup.8
man/amcrypt-ossl-asym.8
man/amcrypt-ossl.8
man/amcrypt.8
man/amcryptsimple.8
man/amdevcheck.8
man/amdump.8
man/amdump_client.8 [new file with mode: 0644]
man/amfetchdump.8
man/amflush.8
man/amgetconf.8
man/amgpgcrypt.8
man/amgtar.8
man/amlabel.8
man/amoverview.8
man/ampgsql.8
man/amplot.8
man/amraw.8
man/amrecover.8
man/amreport.8
man/amrestore.8
man/amrmtape.8
man/amsamba.8
man/amserverconfig.8
man/amservice.8
man/amstar.8
man/amstatus.8
man/amsuntar.8
man/amtape.8
man/amtapetype.8
man/amtoc.8
man/amvault.8
man/amzfs-sendrecv.8
man/amzfs-snapshot.8
man/disklist.5
man/script-email.8
man/tapelist.5
man/xml-source/amanda-auth.7.xml
man/xml-source/amanda-changers.7.xml
man/xml-source/amanda-client.conf.5.xml
man/xml-source/amanda-devices.7.xml
man/xml-source/amanda-interactivity.7.xml [new file with mode: 0644]
man/xml-source/amanda-scripts.7.xml
man/xml-source/amanda-taperscan.7.xml
man/xml-source/amanda.8.xml
man/xml-source/amanda.conf.5.xml
man/xml-source/amdump_client.8.xml [new file with mode: 0644]
man/xml-source/amlabel.8.xml
man/xml-source/amoverview.8.xml
man/xml-source/amrecover.8.xml
man/xml-source/amservice.8.xml
man/xml-source/amstar.8.xml
man/xml-source/amsuntar.8.xml
man/xml-source/tapelist.5.xml
ndmp-src/Makefile.am
ndmp-src/Makefile.in
ndmp-src/amndma_tape_simulator.c
ndmp-src/ndma_tape.c
ndmp-src/ndml_chan.c
ndmp-src/ndmlib.h
ndmp-src/ndmpconnobj.c
oldrecover-src/Makefile.in
packaging/Makefile.in
packaging/deb/control
packaging/deb/rules
packaging/rpm/amanda.spec.src
perl/Amanda/Application/Zfs.pm
perl/Amanda/Changer.pm
perl/Amanda/Changer/aggregate.pm [new file with mode: 0644]
perl/Amanda/Changer/disk.pm
perl/Amanda/Changer/rait.pm
perl/Amanda/Changer/robot.pm
perl/Amanda/Config.c
perl/Amanda/Config.pm
perl/Amanda/Config.swg
perl/Amanda/Constants.pm.in
perl/Amanda/DB/Catalog.pm
perl/Amanda/Device.c
perl/Amanda/Device.swg
perl/Amanda/Disklist.c
perl/Amanda/Feature.c
perl/Amanda/Feature.pm
perl/Amanda/Feature.pod
perl/Amanda/Header.c
perl/Amanda/Header.pm
perl/Amanda/Header.swg
perl/Amanda/Interactive.pm [deleted file]
perl/Amanda/Interactive/stdin.pm [deleted file]
perl/Amanda/Interactivity.pm [new file with mode: 0644]
perl/Amanda/Interactivity/email.pm [new file with mode: 0644]
perl/Amanda/Interactivity/stdin.pm [new file with mode: 0644]
perl/Amanda/Interactivity/tty.pm [new file with mode: 0644]
perl/Amanda/Interactivity/tty_email.pm [new file with mode: 0644]
perl/Amanda/Logfile.c
perl/Amanda/Logfile.pm
perl/Amanda/Logfile.swg
perl/Amanda/MainLoop.pm
perl/Amanda/MainLoop.pod
perl/Amanda/MainLoop.swg
perl/Amanda/Recovery/Clerk.pm
perl/Amanda/Recovery/Scan.pm
perl/Amanda/Report.pm
perl/Amanda/ScanInventory.pm [new file with mode: 0644]
perl/Amanda/Script.pm
perl/Amanda/Script_App.pm
perl/Amanda/Tapelist.pm
perl/Amanda/Tapelist.swg
perl/Amanda/Taper/Controller.pm
perl/Amanda/Taper/Protocol.pm
perl/Amanda/Taper/Scan.pm
perl/Amanda/Taper/Scan/lexical.pm [new file with mode: 0644]
perl/Amanda/Taper/Scan/oldest.pm [new file with mode: 0644]
perl/Amanda/Taper/Scan/traditional.pm
perl/Amanda/Taper/Scribe.pm
perl/Amanda/Taper/Worker.pm
perl/Amanda/Util.c
perl/Amanda/Util.pm
perl/Amanda/Util.pod
perl/Amanda/Util.swg
perl/Amanda/Xfer.c
perl/Amanda/Xfer.pm
perl/Amanda/Xfer.pod
perl/Amanda/Xfer.swg
perl/Makefile.am
perl/Makefile.in
perl/amglue/Makefile.in
perl/amglue/directtcp.swg
po/Makefile.in
recover-src/Makefile.in
recover-src/extract_list.c
server-src/Makefile.am
server-src/Makefile.in
server-src/amaddclient.pl
server-src/amadmin.c
server-src/amcheck-device.pl
server-src/amcheck.c
server-src/amcheckdump.pl
server-src/amdump.pl
server-src/amdumpd.pl [new file with mode: 0644]
server-src/amfetchdump.pl
server-src/amidxtaped.pl
server-src/amindexd.c
server-src/amlabel.pl
server-src/amoverview.pl
server-src/amrestore.pl
server-src/amrmtape.pl
server-src/amserverconfig.pl
server-src/amservice.c [deleted file]
server-src/amstatus.pl
server-src/amtape.pl
server-src/amtrmidx.c
server-src/amvault.pl
server-src/chunker.c
server-src/diskfile.c
server-src/diskfile.h
server-src/driver.c
server-src/driverio.c
server-src/dumper.c
server-src/find.c
server-src/find.h
server-src/list_dir.c
server-src/planner.c
server-src/server_util.c
server-src/server_util.h
server-src/tapefile.c
server-src/tapefile.h
server-src/taper.pl
xfer-src/Makefile.am
xfer-src/Makefile.in
xfer-src/dest-buffer.c
xfer-src/dest-directtcp-connect.c
xfer-src/dest-directtcp-listen.c
xfer-src/dest-fd.c
xfer-src/dest-null.c
xfer-src/element-glue.c
xfer-src/filter-process.c
xfer-src/filter-xor.c
xfer-src/source-directtcp-connect.c
xfer-src/source-directtcp-listen.c
xfer-src/source-fd.c
xfer-src/source-pattern.c
xfer-src/source-random.c
xfer-src/xfer-element.c
xfer-src/xfer-element.h
xfer-src/xfer-test.c
xfer-src/xfer.c
xfer-src/xfer.h

diff --git a/AUTHORS b/AUTHORS
index e8d4ec688ef4dc611c66585d21785cad691fbd2a..d4667b49facb3a91af251738df7150258a075e80 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -75,9 +75,10 @@ Ian Turner <ian@zmanda.com>
     Device API
     Contributions made under GPLv2
 
-Dustin J. Mitchell <dustin@zmanda.com>
+Dustin J. Mitchell <dustin@mozilla.com>
     Device API, Changer API, Xfer Architecture, and Perl rewrite
-    Contributions made under GPLv2
+    Contributions before Oct 18, 2010 made under GPLv2
+    Contributions after Oct 18, 2010 made under the UMD license
 
 Nikolas Coukouma <atrus@zmanda.com>
     S3 Device
@@ -114,3 +115,6 @@ Stephen Gelman <ssgelm@gmail.com>
 
 Nikhil Bhupale <nikhilb@zmanda.com>
     Contributions made under GPLv2
+
+Francis Galiegue <fgaliegue@gmail.com>
+    Contributions made under GPLv2
index 741a45759fc3bf14470ae75fb7288ee6843578aa..7a2efcaf4afe192eefa3c7688798b1394cf99f52 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,722 @@
-2010-12-14  Jean-Louis Martineau <martineau@zmanda.com>
-       * VERSION: 3.2.1
+2011-05-31  Jean-Louis Martineau <martineau@zmanda.com>
+       * VERSION: 3.3.0
+
+2011-05-31  Jean-Louis Martineau <martineau@zmanda.com>
+       * configure.in: Move AMANDA_S3_DEVICE to do libcurl detection later.
+
+2011-05-31  Jean-Louis Martineau <martineau@zmanda.com>
+       * NEWS, ReleaseNotes: Update for 3.3.0 release.
+
+2011-05-30  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/list_dir.c: fix add_dir_list_item.
+
+2011-05-27 Dan Locks <dwlocks@zmanda.com>
+       *  packaging/rpm/amanda.spec.src: replace enable-as-needed rpm macro
+          with enable_as_needed.
+
+2011-05-24 Dan Locks <dwlocks@zmanda.com>
+       *  packaging/deb/rules: use --enable-as-needed
+       *  packaging/rpm/amanda.spec.src: use --enable-as-needed except on
+          sles9, where ld does not have the --as-needed flag.
+
+2011-05-24  Jean-Louis Martineau <martineau@zmanda.com>
+       * installcheck/gnutar.pl: Fix gnutar pattern matching for gtar 1.25.
+
+2011-05-24  Jean-Louis Martineau <martineau@zmanda.com>
+       * application-src/ampgsql.pl: Parse and filter stdout/stderr of
+         commands.
+
+2011-01-20  Francis Galiegue <fgaliegue@gmail.com>
+       * server-src/driverio.c: fix non-NULL terminated argument list in
+         vstralloc()
+
+2011-05-18  Jean-Louis Martineau <martineau@zmanda.com>
+       * Fix for default BSDTCP auth.
+
+2011-05-18  Jean-Louis Martineau <martineau@zmanda.com>
+       * amandad-src/amandad.c,
+         common-src/conffile.c: Change default auth to bsdtcp.
+       * NEWS, ReleaseNotes: Change default auth to bsdtcp.
+       * example/amanda-client.conf.in,
+         example/amanda.conf.in: Change default auth to bsdtcp.
+       * man/xml-source/amanda-auth.7.xml,
+         man/xml-source/amanda-client.conf.5.xml,
+         man/xml-source/amanda.conf.5.xml,
+         man/xml-source/amrecover.8.xml: Change default auth to bsdtcp.
+
+2011-05-17  Jean-Louis Martineau <martineau@zmanda.com>
+       * device-src/ndmp-device.c: s/NDMP4_/NDMP9_/g
+
+2011-05-17  Jean-Louis Martineau <martineau@zmanda.com>
+       * man/xml-source/amrecover.8.xml: Add an AUTH section.
+
+2011-05-13  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/Amanda/Taper/Controller.pm, perl/Amanda/Taper/Protocol.pm,
+         perl/Amanda/Taper/Worker.pm: Remove uneeded '#! @PERL@' first line.
+
+2011-05-12  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amdump.pl: s/Catched/Caught/
+
+2011-05-12  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amdump.pl: Trap ctrl-c while backup is running, resume by
+         sending email and log rotation.
+
+2011-05-10  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/Amanda/Taper/Scribe.pm: Call $device->finish() before
+         $device->read_label(), A device must be in ACCESS_NULL for read_label.
+
+2011-05-05  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/conffile.c: Do not crash on unterminated quoted string.
+
+2011-05-05  Jean-Louis Martineau <martineau@zmanda.com>
+       * application-src/amzfs-sendrecv.pl: Implement restore.
+         Generate index with only '/'.
+       * perl/Amanda/Application/Zfs.pm: Add $self->{filesystem} on some
+         command, improve zfs_build_snapshotname.
+       * server-src/list_dir.c (add_dir_list_item): Check if same dump.
+
+2011-05-05  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/local-security.c: Call initgroups before executing amandad
+
+2011-05-05  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/driver.c: Do not count dup to tape when checking space
+         on holdingdisk.
+
+2011-04-29  Jean-Louis Martineau <martineau@zmanda.com>
+       * device-src/s3.c: Do not get "location" if bucket_location is not set.
+
+2011-04-29  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/driver.c: Reply immediately a NO_NEW_TAPE if taper ask
+         REQUEST_NEW_TAPE after it is in TAPER_STATE_DONE.
+
+2011-04-27  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/Amanda/Device.swg: Do not crash if an unknown device-property
+         is set.
+
+2011-04-26  Jean-Louis Martineau <martineau@zmanda.com>
+       * device-src/s3-device.c: Add thread and new properties to identify
+         the device.
+       * device-src/s3.c: New properties to identify the device.
+       * device-src/s3.h: New s3_open prototype.
+       * man/xml-source/amanda-devices.7.xml: Document new properties.
+       * NEWS, ReleaseNotes: Document new features.
+
+2011-04-20  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/planner.c: Improve balancing if some dle have strategy
+         noinc or a smaller dumpcycle.
+
+2011-04-19  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amidxtaped.pl: Do the uncompress if client can't do it.
+
+2011-04-19  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/Amanda/Changer.pm: new changer error: empty.
+       * perl/Amanda/Changer/robot.pm: return empty slot.
+       * perl/Amanda/Taper/Scan/traditional.pm: Handle empty slot.
+
+2011-04-18  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/Amanda/Changer.pm: Check generated label and meta-label.
+
+2011-04-18  Jean-Louis Martineau <martineau@zmanda.com>
+       * man/xml-source/amlabel.8.xml: Improve doc.
+       * server-src/amlabel.pl: Remove spurious print.
+
+2011-04-12  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amadmin.c: Do not free find result string.
+       * server-src/find.c: Use GStringChunk to store all find_dump string.
+
+2011-04-11  Jean-Louis Martineau <martineau@zmanda.com>
+       * configure.in: Use AMANDA_AS_NEEDED.
+       * config/amanda/as_needed.m4: Add --as-needed, set AS_NEEDED_FLAGS.
+       * client-src/Makefile.am, amandad-src/Makefile.am,
+         ndmp-src/Makefile.am, device-src/Makefile.am,
+         application-src/Makefile.am, xfer-src/Makefile.am,
+         server-src/Makefile.am, amar-src/Makefile.am,
+         common-src/Makefile.am: Add AS_NEEDED_FLAGS to many *_LDFLAGS.
+
+2011-04-11  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/Amanda/DB/Catalog.pm: Parse negative kb and orig-kb.
+       * perl/Amanda/Logfile.swg: Do not write negative orig-kb.
+
+2011-04-06  Jean-Louis Martineau <martineau@zmanda.com>
+       * man/xml-source/amanda-devices.7.xml: Typo.
+
+2011-04-06  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/Amanda/Interactivity.pm: Add documentation.
+
+2011-04-06  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/driver.c: Fix Computation of data_lost on current and
+         next tape.
+
+2011-04-01  Jean-Louis Martineau <martineau@zmanda.com>
+       * NEWS, ReleaseNotes: Update for 3.3.0beta1.
+
+2011-04-01  Jean-Louis Martineau <martineau@zmanda.com>
+       * amplot/amplot.awk: Fix for new log format, fix small -t display,
+         fix 'set key' syntax.
+       * amplot/amplot.g: Fix 'set data' and 'plot' syntax.
+
+2011-03-31  Jean-Louis Martineau <martineau@zmanda.com>
+       * VERSION: 3.3.0beta1
+
+2011-03-30  Jean-Louis Martineau <martineau@zmanda.com>
+       * installcheck/taper.pl: Fix installcheck for 'splitting not enabled'.
+
+2011-03-30  Jean-Louis Martineau <martineau@zmanda.com>
+       * VERSION: 3.3.0_beta1
+
+2011-03-30  Jean-Louis Martineau <martineau@zmanda.com>
+       * device-src/vfs-device.c: LEOM property default to TRUE.
+
+2011-03-30  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/Amanda/Taper/Scribe.pm: Log 'splitting not enabled' on write
+         failure.
+
+2011-03-30  Jean-Louis Martineau <martineau@zmanda.com>
+       * NEWS, ReleaseNotes: Update for 3.3.0
+
+2011-03-30  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/conffile.c: Add client-name option to application and
+                                script
+       * common-src/conffile.h: Add client-name option to application and
+                                script
+       * perl/Amanda/Config.swg: Add APPLICATION_CLIENT_NAME and
+                                 PP_SCRIPT_CLIENT_NAME.
+       * common-src/amfeatures.c: Add fe_application_client_name and
+                                  fe_script_client_name.
+       * common-src/amfeatures.h: Add fe_application_client_name and
+                                  fe_script_client_name.
+       * common-src/amxml.c: Pares client_name
+       * common-src/amxml.h: Add application_client_nake in dle_t and
+                             client_name in script_t.
+       * server-src/diskfile.c: Put client-name in xml output.
+       * server-src/amcheck.c: Check client-name and fe_*_client_name.
+       * client-src/client_util.c (merge_properties, merge_dles_properties):
+                                   new function.
+       * client-src/client_util.h (merge_properties, merge_dles_properties):
+                                   new prototype.
+       * client-src/selfcheck.c, client-src/sendbackup.c,
+         client-src/sendsize.c: Call merge_dles_properties to merge properties
+       * man/xml-source/amanda-client.conf.5.xml,
+         man/xml-source/amanda.conf.5.xml: Document client-name.
+       * recover-src/extract_list.c: merge properties.
+       * NEWS: Add new features.
+
+2011-03-28  Jean-Louis Martineau <martineau@zmanda.com>
+       * application-src/amlog-script.pl: Remove warning of unused variable.
+
+2011-03-28  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amcheckdump.pl, server-src/amfetchdump.pl,
+         server-src/amidxtaped.pl, server-src/amrestore.pl: Use int().
+
+2011-03-28  Jean-Louis Martineau <martineau@zmanda.com>
+       * xfer-src/filter-process.c: Call g_critical if pipe() fail.
+
+2011-03-28  Jean-Louis Martineau <martineau@zmanda.com>
+       Change the Amanda:Xfer::Filter::Process api, it always create a pipe
+       for the process stderr, the callers must read from it. Callers can send
+       it to debug file, stderr or to amrecover.
+       * installcheck/Amanda_Xfer.pl: Change for new AXF::Process API.
+       * perl/Amanda/Xfer.pod: Document new AXF::Process API.
+       * perl/Amanda/Xfer.swg: Change for new AXF::Process API.
+       * server-src/amcheckdump.pl, server-src/amfetchdump.pl,
+         server-src/amrestore.pl: Use new AXF::Process API, send it to stderr
+         and debug file.
+       * server-src/amidxtaped.pl: Use new AXF::Process API, send it to debug
+         file and amrecover.
+       * xfer-src/filter-process.c: Remove log_stderr argument of
+         xfer_filter_process, add new get_err_fd method.
+       * xfer-src/xfer-element.h: Change xfer_filter_process prototype.
+
+2011-03-27  Dustin J. Mitchell <dustin@mozilla.com>
+       * perl/Amanda/Util.swg: revert previous patch
+       * gnulib/Makefile.am gnulib/fsusage.h
+         gnulib/regenerate/fsusage-no-bool.patch gnulib/regenerate/regenerate:
+         patch fsusage.h to not use stdbool
+       * device-src/vfs-device.c: don't use 'false' and 'true' (from stdbool)
+
+2011-03-26  Dustin J. Mitchell <dustin@mozilla.com>
+       * perl/Amanda/Util.swg: include fsusage.h early in the generated C
+         to avoid problems with SWIG #undefine-ing 'bool' on Mac OS X with
+         the system-installed Perl
+
+2011-03-25  Jan Görig <jgorig@redhat.com>
+       * config/amanda/krb5-security.m4: fix linking against wrong libraries
+         on systems where krb5 directory is libdir and amanda is installed
+
+2011-03-25  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/driver.c: Fix iteration over a list it modify.
+
+2011-03-22  Jean-Louis Martineau <martineau@zmanda.com>
+       * application-src/amstar.c: read include_list and pass each line as
+         argument for restore operation.
+
+2011-03-22  Jean-Louis Martineau <martineau@zmanda.com>
+       * application-src/amgtar.c: Cast with off_t.
+       * application-src/amstar.c: Cast with off_t.
+
+2011-03-21  Jean-Louis Martineau <martineau@zmanda.com>
+       * application-src/amstar.c: Add ACL property.
+       * man/xml-source/amstar.8.xml: Document ACL property.
+
+2011-03-21  Jean-Louis Martineau <martineau@zmanda.com>
+       * config/amanda/dumpers.m4: Add AMANDA_PROG_SUNTAR, --with-suntar=??
+       * configure.in: Use AMANDA_PROG_SUNTAR.
+       * perl/Amanda/Constants.pm.in: Define $Amanda::Constants::SUNTAR
+       * application-src/amsuntar.pl: Use $Amanda::Constants::SUNTAR,
+                                      Add SUNTAR-PATH property.
+       * man/xml-source/amsuntar.8.xml: Document SUNTAR-PATH property.
+
+2011-03-15  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/find.c: Compute maxparts from the list of part.
+
+2011-03-11  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/Amanda/Taper/Scribe.pm: If leom is supported by device,
+         then the dle can be split.
+       * perl/Amanda/Taper/Worker.pm: Send leom setting to
+         get_splitting_args_from_config.
+       * server-src/planner.c: dle can use more than one tape if allow-split
+         is set, this is to handle leom device where splitsize can be 0.
+
+2011-03-10  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/Amanda/Changer/disk.pm: Use -l to check symlink existance.
+
+2011-03-10  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amadmin.c: export quote host and disk name, import parse
+         quoted host and disk name.
+
+2011-03-09  Jean-Louis Martineau <martineau@zmanda.com>
+        * ReleaseNotes, NEWS: Add changes for 3.2.2 and 3.3.0.
+
+2011-03-08  Jean-Louis Martineau <martineau@zmanda.com>
+       * application-src/amsamba.pl: Use smbclient -TF for restore.
+
+2011-03-07  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amtrmidx.c: Fix memory leak.
+
+2011-03-02  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/amservice.c; Moved from server-src/amservice.c
+       * server-src/amservice.c: Moved to server-src/amservice.c
+       * common-src/Makefile.am: Add amservice
+       * man/Makefile.am: Install amservice man page on client.
+       * server-src/Makefile.am: Remove amservice
+
+2011-03-01  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/Amanda/Changer.pm (make_new_tape_label): Fix if $tle is undef.
+       * perl/Amanda/ScanInventory.pm: Call _user_msg with label argument.
+       * perl/Amanda/Taper/Scan.pm: Document new user_msg_fn argument.
+       * perl/Amanda/Taper/Scan/traditional.pm: Call _user_msg on various
+         tape error.
+       * perl/Amanda/Taper/Scribe.pm (_user_msg_fn): Call
+         scribe_notif_log_info with error message.
+       * perl/Amanda/Taper/Worker.pm: Log error in scribe_notif_new_tape.
+       * installcheck/Installcheck/Config.pm: Add taperscan definition.
+       * installcheck/taper.pl: Test new log.
+
+2011-03-01  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/Amanda/Header.swg: Remove bogus %module.
+
+2011-03-01  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/amfeatures.c: Add fe_amrecover_receive_unfiltered.
+       * common-src/amfeatures.h: Add fe_amrecover_receive_unfiltered.
+       * perl/Amanda/Feature.pod: Add fe_amrecover_receive_unfiltered.
+       * perl/Amanda/Header.swg: Add get_dle method, handle dle_t.
+       * recover-src/extract_list.c: Pipe decompression or decyption.
+       * server-src/amidxtaped.pl: Do not decompress/decrypt if amrecover
+                                   can do it.
+
+2011-02-14  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/driver.c: flush even if flush threshold are not met if
+         it save tape space.
+
+2011-02-03  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/Amanda/Taper/Scribe.pm: get_splitting_args_from_config() always
+         return 'allow_split', get_xfer_dest() take a allow_split param,
+         set $self->{'allow_split'}, Abort a dump on EOM if splitting is
+         not allowed.
+       * perl/Amanda/Taper/Worker.pm: Do not set can_cache_inform if splitting
+         is not allowed.
+       * installcheck/Amanda_Taper_Scribe.pl: Fix for previous change.
+       * installcheck/taper.pl: Test that dump are aborted on EOM.
+
+2011-02-01  Jean-Louis Martineau <martineau@zmanda.com>
+       Patch by Jan Görig
+       * server-src/amrestore.pl: Allow to go to next file with -p.
+
+2011-01-26  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/Amanda/Logfile.swg: "%lld" do not works with perl-5.6.
+
+2011-01-26  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amdumpd.pl: Add CHECK command.
+       * client-src/amdump_client.pl: Add check command.
+       * man/xml-source/amdump_client.8.xml: Document check command.
+
+2011-01-26  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/driver.c: Parse 'bytes' in reply.
+
+2011-01-25  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/driver.c: Fix taperalog *FIT no going to second volume.
+
+2011-01-25  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/Amanda/Logfile.swg: print 'bytes' with 64 bits type.
+
+2011-01-25  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/Amanda/Logfile.swg: kb must be integer.
+
+2011-01-24  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amcheckdump.pl: Do not quit the clerk if it is not defined
+
+2011-01-22  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amdumpd.pl: Execute "$sbindir/amdump"
+
+2011-01-22  Jean-Louis Martineau <martineau@zmanda.com>
+       * installcheck/Amanda_Config.pl: Check recovery-limit, dump-limit,
+         amdump-server, index-server, tape-server.
+       * installcheck/Makefile.am: Add amdump_client.
+       * installcheck/amdump_client.pl: Test new amdump_client program.
+
+2011-01-22  Jean-Louis Martineau <martineau@zmanda.com>
+       * client-src/Makefile.am: Add amdump_client.
+       * client-src/amdump_client.pl: New client program.
+       * common-src/conffile.c: Add amdump-server in client config file.
+       * common-src/conffile.h: Add CNF_AMDUMP_SERVER
+       * perl/Amanda/Config.swg: Add CNF_AMDUMP_SERVER
+       * man/Makefile.am: Add amdump_client.8.
+       * man/xml-source/amdump_client.8.xml: New man page for amdump_client.
+
+2011-01-22  Jean-Louis Martineau <martineau@zmanda.com>
+       * amandad-src/amandad.c: Add SERVICE_AMDUMPD, All service are active
+         by default for rsh, ssh and local auth.
+       * common-src/conffile.c: Add dump-limit dumptype option.
+       * common-src/conffile.h: Add dump-limit dumptype option.
+       * man/xml-source/amanda.conf.5.xml: Document new dump-limit option.
+       * common-src/local-security.c, common-src/rsh-security.c,
+         common-src/ssh-security.c: Do not add the service on the command line
+       * perl/Amanda/Config.swg: swig dump-limt
+       * server-src/Makefile.am: Add amdumpd perl script.
+       * server-src/amadmin.c (disklist_one): Print dump-limit.
+       * server-src/amdumpd.pl: New deamon script.
+       * server-src/amdump.pl: New --from-client option.
+       * server-src/diskfile.h: Add dump_limit in disk_t.
+       * server-src/diskfile.c: Set dump_limit.
+       * server-src/driver.c: New --from-client option.
+       * server-src/planner.c: New --from-client option.
+
+2011-01-22  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/conffile.c: Rename *recovery_limit* *host_limit*,
+         add 'server' in a host-limit.
+       * common-src/conffile.h: Rename.
+       * common-src/local-security.c: Use
+         sec_get_authenticated_peer_name_gethostname.
+       * common-src/security-util.c:
+         New sec_get_authenticated_peer_name_gethostname function to return
+         gethostname.
+       * common-src/security-util.h: New prototype.
+       * man/xml-source/amanda.conf.5.xml: Document 'server' for
+         recovery-limit.
+       * perl/Amanda/Config.swg: Return $Amanda::Config::LIMIT_SAMEHOST
+         same-host, return $Amanda::Config::LIMIT_SERVER for server.
+       * server-src/amidxtaped.pl: Use $Amanda::Config::LIMIT_SAMEHOST and
+         $Amanda::Config::LIMIT_SERVER.
+       * server-src/amindexd.c: Use 'server' value.
+       * installcheck/Amanda_Config.pl: Fix for change.
+
+2011-01-22  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/driver.c: Fix driver doing nothing if taper crash early.
+
+2011-01-20  Francis Galiegue <fgaliegue@gmail.com>
+       * xfer-src/source-pattern.c: remove duplicate test
+
+2011-01-20  Dustin J. Mitchell <dustin@mozilla.com>
+       * man/xml-source/amanda-interactivity.7.xml
+         man/xml-source/amanda-taperscan.7.xml
+         man/xml-source/amanda.conf.5.xml: copyediting
+       * perl/Amanda/Interactivity/tty_email.pm: fix POD to indicate
+         the nature of the class
+
+2011-01-20  Jean-Louis Martineau <martineau@zmanda.com>
+       * man/xml-source/amservice.8.xml: typo, </programlisting> must be at
+         the beginning of a line.
+
+2011-01-20  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amservice.c: Use full_write, check for error.
+
+2011-01-20  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/diskfile.c: Do not report error if a dle is listed twice
+         in argument list.
+       * installcheck/amadmin.pl: Test it.
+
+2011-01-20  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amservice.c: Add -s option.
+       * man/xml-source/amservice.8.xml: Document -s option.
+
+2011-01-20  Jean-Louis Martineau <martineau@zmanda.com>
+       * installcheck/Amanda_Taper_Scan_lexical.pl,
+         installcheck/Amanda_Taper_Scan_oldest.pl: Fix for perl-5.6.
+
+2011-01-20  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/conffile.c: Add interactivity and taperscan section.
+       * common-src/conffile.h: Add interactivity and taperscan section.
+       * perl/Amanda/Config.swg: Add interactivity and taperscan.
+       * example/amanda.conf.in: Add interactivity and taperscan example.
+       * man/Makefile.am: Add new amanda-interactivity.7
+       * man/xml-source/amanda-interactivity.7.xml: Document interactivity.
+       * man/xml-source/amanda-taperscan.7.xml: Document new taperscan.
+       * man/xml-source/amanda.8.xml: Add link to amanda-interactivity man
+                                      page.
+       * man/xml-source/amanda.conf.5.xml: Document interactivity and
+                                           taperscan section.
+       * perl/Amanda/Changer.pm (new): Take tapelist, labelstr, autolabel and
+         meta_autolabel arguments.
+       * perl/Amanda/Changer.pm (volume_is_labelable, make_new_meta_label, 
+         make_new_tape_label, have_inventory: New method.
+       * perl/Amanda/Interactive.pm: Renamed
+       * perl/Amanda/Interactive/stdin.pm: Renamed
+       * perl/Amanda/Interactivity.pm: Copy of Interactive.pm:
+       * perl/Amanda/Interactivity/stdin.pm: Copy of Interactive/stdin.pm.
+       * perl/Amanda/Interactivity/email.pm: New interactivity module.
+       * perl/Amanda/Interactivity/tty.pm: New interactivity module.
+       * perl/Amanda/Interactivity/tty_email.pm: New interactivity module.
+       * perl/Amanda/Recovery/Scan.pm: s/Interactive/Interactivity/.
+       * perl/Amanda/ScanInventory.pm: Base class for scan algorithm.
+       * perl/Amanda/Tapelist.swg (add_tapelabel): Do the add in order.
+       * perl/Amanda/Taper/Controller.pm: Use interactivity and taperscan.
+       * perl/Amanda/Taper/Scan.pm: Allow plugable module.
+       * perl/Amanda/Taper/Scan/lexical.pm: new scan algorithm.
+       * perl/Amanda/Taper/Scan/oldest.pm: new scan algorithm.
+       * perl/Makefile.am: Add new files.
+       * server-src/amcheck-device.pl: Use interactivity and taperscan.
+       * server-src/amcheckdump.pl: Use interactivity and taperscan.
+       * server-src/amfetchdump.pl: Use interactivity and taperscan.
+       * server-src/amidxtaped.pl: Use interactivity and taperscan.
+       * server-src/amtape.pl: Use interactivity and taperscan.
+       * server-src/amvault.pl: Use interactivity and taperscan.
+       * installcheck/Amanda_Changer.pl: Test new methods.
+       * installcheck/Amanda_Changer_compat.pl: Test have_inventory.
+       * installcheck/Amanda_Changer_disk.pl: Test have_inventory.
+       * installcheck/Amanda_Changer_multi.pl: Test have_inventory.
+       * installcheck/Amanda_Changer_ndmp.pl: Test have_inventory.
+       * installcheck/Amanda_Changer_null.pl: Test have_inventory.
+       * installcheck/Amanda_Changer_rait.pl: Test have_inventory.
+       * installcheck/Amanda_Changer_robot.pl: Test have_inventory.
+       * installcheck/Amanda_Config.pl: Test new interactivity and taperscan
+         section.
+       * installcheck/Amanda_Recovery_Scan.pl: s/Interactive/Interactivity/
+       * installcheck/Amanda_Tapelist.pl: test new add_tapelabel behavior.
+       * installcheck/Amanda_Taper_Scan_lexical.pl: Test new module.
+       * installcheck/Amanda_Taper_Scan_oldest.pl: Test new module.
+       * installcheck/Installcheck/Config.pm (add_interactivity,
+         add_taperscan): New methods.
+       * installcheck/Makefile.am: Add new files.
+
+2011-01-17  Francis Galiegue <fgaliegue@gmail.com>
+       * xfer-src/element-glue.c: fix memory leak in read_and_push()
+
+2011-01-16  Francis Galiegue <fgaliegue@gmail.com>
+       * xfer-src/element-glue.c xfer-src/filter-xor.c
+         xfer-src/xfer-element.c xfer-src/xfer-element.h: xfer: rename
+         xfer_element_drain* utility functions - Both functions are used to
+         pulling data from an upstream element, either buffers or reading a
+         file descriptor, until it is "empty". 
+
+2011-01-14  Jean-Louis Martineau <martineau@zmanda.com>
+       * ndmp-src/amndma_tape_simulator.c: Use full_read.
+       * ndmp-src/ndma_tape.c: Use ndmchan_n_avail_record to guarantee space
+         for a record.
+       * ndmp-src/ndml_chan.c (ndmchan_n_avail_record): New function.
+       * ndmp-src/ndmlib.h  (ndmchan_n_avail_record): New prototype.
+
+2011-01-13  Francis Galiegue <fgaliegue@gmail.com>
+       * xfer-src/source-pattern.c: xfer-src/source-pattern.c: externalize
+         pattern copying
+
+2011-01-13  Francis Galiegue <fgaliegue@gmail.com>
+       * xfer-src/element-glue.c: xfer-src/element-glue.c: fix memory leak in
+         pull_buffer_impl()
+
+2011-01-11  Francis Galiegue <fgaliegue@gmail.com>
+       * xfer-src/xfer-element.h: xfer: define XFER_NROPS() and
+         XFER_NTHREADS() macros
+       * xfer-src/dest-buffer.c xfer-src/dest-directtcp-connect.c
+         xfer-src/dest-directtcp-listen.c xfer-src/dest-fd.c
+         xfer-src/dest-null.c xfer-src/element-glue.c xfer-src/filter-process.c
+         xfer-src/filter-xor.c xfer-src/source-directtcp-connect.c
+         xfer-src/source-directtcp-listen.c xfer-src/source-fd.c
+         xfer-src/source-pattern.c xfer-src/source-random.c
+         xfer-src/xfer-test.c: use them
+
+2011-01-11  Francis Galiegue <fgaliegue@gmail.com>
+       * common-src/match.c: match.c: rename ammtch_to_regex() into
+         amglob_to_regex()
+
+2011-01-11  Francis Galiegue <fgaliegue@gmail.com>
+       * common-src/match.c: match.c: rename full_regex_from_expression() to
+         full_amglob_from_expression()
+
+2011-01-11  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/planner.c: Change message of "timeout waiting for REP" to
+         "Some estimate timeout on %s, using server estimate if possible".
+
+2011-01-11  Jean-Louis Martineau <martineau@zmanda.com>
+       * man/xml-source/amanda-scripts.7.xml: Document script output property.
+
+2011-01-10  Francis Galiegue <fgaliegue@gmail.com>
+       * common-src/match.c: match.c: rework regex generation from globs
+
+2011-01-10  Francis Galiegue <fgaliegue@gmail.com>
+       * common-src/match.c: match.c: match_word(): change the way regex
+         begin and end are calculated/copied
+
+2011-01-10  Francis Galiegue <fgaliegue@gmail.com>
+       * common-src/match.c: match.c: better handling of "separator only"
+         globs in match_word()
+
+2011-01-10  Francis Galiegue <fgaliegue@gmail.com>
+       * common-src/match.c: match.c: move glob/disk backslash substitution
+         out of match_word()
+
+2011-01-10  Francis Galiegue <fgaliegue@gmail.com>
+       * common-src/match.c: match.c: factorize regex construction from
+         expression
+
+2011-01-10  Francis Galiegue <fgaliegue@gmail.com>
+       * common-src/match.c: match.c: factorize character escaping in
+         make_exact_*_expression()
+
+2011-01-10  Francis Galiegue <fgaliegue@gmail.com>
+       * common-src/match.c: match.c: factorize regex matching
+       * common-src/match.h: make match and match_no_newline into
+         macros calling do_match
+
+2011-01-10  Francis Galiegue <fgaliegue@gmail.com>
+       * common-src/match.c: match.c: factorize regex compile
+
+2011-01-10  Francis Galiegue <fgaliegue@gmail.com>
+       * common-src/match.c: match.c: match_host(): use g_ascii_strdown() to
+         convert to lowercase
+
+2011-01-10  Francis Galiegue <fgaliegue@gmail.com>
+       * common-src/match.c: match.c: fix '*' and '?' expansion in
+         match_word()
+
+2011-01-10  Francis Galiegue <fgaliegue@gmail.com>
+       * common-src/match.c: match.c: define a macro to recognize regex
+         metacharacters
+
+2011-01-10  Francis Galiegue <fgaliegue@gmail.com>
+       * common-src/match.c: match.c: match_host(): remove unneeded cast
+
+2011-01-10  Francis Galiegue <fgaliegue@gmail.com>
+       * common-src/match.c: match.c: match_word(): rename "i" local variable
+         to "ret"
+
+2011-01-10  Francis Galiegue <fgaliegue@gmail.com>
+       * common-src/match.c: match.c: match_word(): rename two local
+         variables. Rename r to dst, and w to src, in order to clarify their
+         roles.
+
+2011-01-10  Francis Galiegue <fgaliegue@gmail.com>
+       * common-src/match.c: match.c: match_word(): remove unused assignment
+
+2011-01-07  Jean-Louis Martineau <martineau@zmanda.com>
+       * application-src/amgtar.c, application-src/amstar.c: Do not call
+         amname_to_dirname.
+
+2011-01-07  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/bsd-security.c: Check input fd is a socket.
+
+2011-01-07  Dustin J. Mitchell <dustin@mozilla.com>
+       * common-src/testutils.c: use %ju instead of %lu to print big numbers
+
+2011-01-07  Francis Galiegue <fgaliegue@gmail.com>
+       * testutils.c: report time of execution for each test
+
+2011-01-07  Francis Galiegue <fgaliegue@gmail.com>
+       * common-src/testutils.c: add -c <count> option to run tests more than
+         once
+
+2011-01-07  Francis Galiegue <fgaliegue@gmail.com>
+       * testutils.c: create a run_one_test() function The way to run a test
+         is the same, whether we fork() or not. Make that a function.
+
+2011-01-06  Francis Galiegue <fgaliegue@gmail.com>
+       * common-src/testutils.c: testutils.c: externalize test behaviour
+         variables
+
+2011-01-06  Francis Galiegue <fgaliegue@gmail.com>
+       * common-src/amflock-test.c common-src/event-test.c
+         common-src/fileheader-test.c common-src/hexencode-test.c
+         common-src/ipc-binary-test.c common-src/match-test.c
+         common-src/quoting-test.c: Ensure all tests return gbooleans.  Most,
+         if not all, tests returned ints, and quite a few of them returned TRUE
+         or FALSE. While the effect is basically the same as a gboolean, make
+         all tests return a gboolean for coherency, since this is what
+         callinfork() expects anyway.
+       * common-src/testutils.c: Also enforce that callinfork() return that
+         type, which, in turn, allows the "success" local variable in
+         testutil_run_tests() to also be converted.
+
+2011-01-06  Francis Galiegue <fgaliegue@gmail.com>
+       * common-src/testutils.c: convert ints to gbooleans where appropriate;
+         run_all, tu_debugging_enabled and ignore_timeouts are all used as
+         gbooleans in the code even though they are declared as ints. Convert
+         them to booleans, and also change declarations.
+
+2011-01-05  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/Amanda/Xfer.pod: new offset and size arguments of xfer->start.
+       * perl/Amanda/Xfer.swg: Add xfer_element_set_size.
+
+2011-01-04  Jean-Louis Martineau <martineau@zmanda.com>
+       * device-src/xfer-source-recovery.c: Never send more than the number
+         of bytes requested.
+       * perl/Amanda/Xfer.swg (xfer_start): New offset and size arguments.
+       * xfer-src/xfer-element.c: Add set_size method.
+       * xfer-src/xfer-element.h (XferElement): Add size field.
+       * xfer-src/xfer-test.c: Add offset=0 and size=0 to xfer_start call.
+       * xfer-src/xfer.c (xfer_start): Add offset and size arguments. Call
+         xfer_element_set_size for the first element if size is set.
+       * xfer-src/xfer.h (xfer_start): New prototype.
+       * server-src/amfetchdump.pl, server-src/amidxtaped.pl,
+         server-src/amvault.pl: Call xfer->start() with offset and size
+         arguments.
+
+2011-01-04  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/Amanda/Logfile.swg: Print size in bytes for taper log.
+       * server-src/find.h (find_result_t): Add bytes.
+       * server-src/find.c: Parse 'bytes' in 'log' file.
+       * perl/Amanda/Report.pm: Parse 'bytes' in 'log' file.
+       * perl/Amanda/DB/Catalog.pm: Parse 'bytes' in 'log' file.
+       * server-src/amstatus.pl: Parse 'bytes' in 'amdump' log file.
+       * installcheck/Amanda_DB_Catalog.pl: Fix for log file format change.
+       * installcheck/taper.pl: Fix for log file format change.
+
+2011-01-03  Jean-Louis Martineau <martineau@zmanda.com>
+       * example/template.d/advanced.conf.in: Remove dumpuser.
+       * server-src/amaddclient.pl: mkdir -p
+       * server-src/amserverconfig.pl: Print dumpuser, Print the
+         authorized_keys file location based on $amhomedir
+
+2010-12-27 Dan Locks <dwlocks@zmanda.com>
+       *  packaging/deb/rules, packaging/rpm/amanda.spec.src: add missing
+          amservice entry to set perms at install time. Thanks to vpatton for
+          finding this.
+
+2010-12-23  Dustin J. Mitchell <dustin@mozilla.com>
+       * client-src/client_util.c: improve error message when no includes
+         match on disk
+
+2010-12-23  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/Amanda/Script_App.pm: Add FAILURE.
+
+2010-12-21  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/Amanda/Taper/Scribe.pm: Use 'blocksize' to compute the
+         available space.
+
+2010-12-20  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/find.c: Fix parsing 'PARTIAL taper' line with no part.
+       * perl/Amanda/DB/Catalog.pm: Ditto
+
+2010-12-16  Jean-Louis Martineau <martineau@zmanda.com>
+       * amar-src/amar.c: Don't fail on trailing NUL bytes.
 
 2010-12-14  Jean-Louis Martineau <martineau@zmanda.com>
        * common-src/ssh-security.c: Use client_port.
 2010-12-14  Jean-Louis Martineau <martineau@zmanda.com>
        * server-src/amidxtaped.pl: Don't crash if same-host doesn't match.
 
+2010-12-13  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/Amanda/Interactive.pm: rename finished_cb to request_cb.
+       * installcheck/Amanda_Recovery_Scan.pl,
+         perl/Amanda/Interactive/stdin.pm,
+         perl/Amanda/Recovery/Scan.pm, server-src/amcheckdump.pl,
+         server-src/amfetchdump.pl, server-src/amidxtaped.pl,
+         server-src/amvault.pl: s/finished_cb/request_cb/
+
 2010-12-12  Jean-Louis Martineau <martineau@zmanda.com>
        * perl/Amanda/Changer/disk.pm: inventory must return the same as
                                       read_label.
 
 2010-12-11  Daniel Néri <dne@mayonnaise.net>
        * application-src/ampgsql.pl: Don't assume that gtar is configured to
-         use stdin/stdout as default archive.
+         use stdin/stdout as default archive
 
-2010-12-12  Daniel Néri <dne@mayonnaise.net>
+2010-12-11  Daniel Néri <dne@mayonnaise.net>
        * application-src/ampgsql.pl: Use diskname, not devicename, as prefix
          when checking for properties. Now works as documented in the ampgsql
          man page.
 
+2010-12-10 Dan Locks <dwlocks@zmanda.com>
+       *  packaging/deb/control: move gnuplot to Suggests: and swap the order
+
 2010-12-10  David Bogen <bogen@wisc.edu>
        * server-src/amoverview.pl: fix amoverview's argument parsing
 
 2010-12-09  Jean-Louis Martineau <martineau@zmanda.com>
        * device-src/xfer-dest-taper-cacher.c: Print why the malloc failed.
 
-2010-12-08  Dustin J. Mitchell <dustin@zmanda.com>
+2010-12-08  Dustin J. Mitchell <dustin@mozilla.com>
        * common-src/glib-util.c common-src/glib-util.h: do not define
          symbol g_slist_free_full, as it exists in glib-2.27 and higher;
          use slist_free_full, and alias that to g_slist_free_full when
          server-src/cmdline.h server-src/find.c server-src/holding.c
          server-src/planner.c: rename function
 
-2010-12-08  Jean-Louis Martineau <martineau@zmanda.com>
-       * ReleaseNotes, NEWS: Add changes for 3.2.1
-
 2010-12-07 Dan Locks <dwlocks@zmanda.com>
        *  packaging/rpm/amanda.spec.src: remove manual library requires and
           set curl vs libcurl based on distro.
        * server-src/dumper.c: Put error message in separate files to
          reduce the size of the log file.
 
-2010-11-29  Jean-Louis Martineau <martineau@zmanda.com>
-       * man/xml-source/amlabel.8.xml: Typo.
+2010-12-01  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/chunker.c, xfer-src/element-glue.c: Prefer IPV4 over IPV6.
+
+2010-12-01  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/directtcp.h: DirectTCPAddr is a sockaddr_union.
+       * common-src/sockaddr-util.c (str_sockaddr_no_port): new function.
+       * common-src/sockaddr-util.h (str_sockaddr_no_port): New prototype.
+       * perl/amglue/directtcp.swg: Swig new DirectTCPAddr.
+       * server-src/dumper.c: Parse IPV6 in dataport_list.
+       * ndmp-src/ndmpconnobj.c, perl/Amanda/Device.swg,
+         perl/Amanda/Taper/Worker.pm, perl/Amanda/Xfer.swg,
+         server-src/chunker.c, xfer-src/dest-directtcp-connect.c,
+         xfer-src/element-glue.c, xfer-src/source-directtcp-connect.c,
+         xfer-src/source-directtcp-listen.c, xfer-src/xfer-element.h,
+         xfer-src/xfer-test.c: Use new DirectTCPAddr.
+
+2010-11-30  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/conffile.c: Add pre-amcheck, post-amcheck, pre-estimate,
+         post-estimate, pre-backup and post-backup to execute-on of script.
+       * common-src/conffile.h: Add EXECUTE_ON_* constants.
+       * application-src/amlog-script.pl: Add new execute-on.
+       * common-src/amxml.c: Parse new execute-on.
+       * man/xml-source/amanda.conf.5.xml: Document them.
+       * perl/Amanda/Config.swg: Add new EXECUTE_ON_* constants.
+       * perl/Amanda/Script.pm: Add new execute-on.
+       * server-src/amcheck.c: Call run_server_global_scripts.
+       * server-src/diskfile.c (get_hostlist): Return the host list.
+       * server-src/diskfile.h (get_hostlist): Add prototype.
+       * server-src/driver.c: Call run_server_global_scripts.
+       * server-src/planner.c: Call run_server_global_scripts.
+       * server-src/server_util.c (run_server_global_scripts): New function.
+       * server-src/server_util.h (run_server_global_scripts): Prototype.
+
+2010-11-30  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/server_util.c: Search scripts in APPLICATION_DIR,
+         CONFIG_DIR/<conf>/application and CONFIG_DIR/application.
+
+2010-11-30  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/conffile.c: Add SINGLE-EXECUTION in scripts.
+       * common-src/conffile.h: Add pp_script_get_single_execution.
+       * installcheck/pp-scripts.pl: Test single-execution.
+       * man/xml-source/amanda.conf.5.xml: Document single-execution.
+       * perl/Amanda/Config.swg: Add PP_SCRIPT_SINGLE_EXECUTION.
+       * server-src/server_util.c: Add run_server_host_scripts,
+         rename run_server_scripts to run_server_dle_scripts.
+       * server-src/server_util.h: New prototype.
+       * server-src/amcheck.c, server-src/driver.c,
+         server-src/planner.c: Call new functions.
 
 2010-11-26  Jean-Louis Martineau <martineau@zmanda.com>
        * installcheck/amreport.pl: Fix for previous patch.
 2010-11-22  Jean-Louis Martineau <martineau@zmanda.com>
        * device-src/Makefile.am: activate-devpay needs gnulib.
 
+2010-11-18 Dan Locks <dwlocks@zmanda.com>
+       *  packaging/rpm/amanda.spec.src: quote both items in boolean
+          comparison to avoid type mismatch.
+
+2010-11-17  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/conffile.c: Add CONFTYPE_NO_YES_ALL, change type for
+         autoflush.
+       * common-src/conffile.h: Add CONFTYPE_NO_YES_ALL.
+       * man/xml-source/amanda.conf.5.xml: New autoflush option.
+       * perl/Amanda/Config.swg: Add CONFTYPE_NO_YES_ALL.
+       * server-src/amcheck.c: Use new value of autoflush.
+       * server-src/planner.c: Use new value of autoflush.
+
 2010-11-17  Jean-Louis Martineau <martineau@zmanda.com>
        * server-src/driver.c: Correctly handle INPUT-ERROR and TAPE-ERROR.
 
 2010-11-16 Dan Locks <dwlocks@zmanda.com>
        *  packaging/rpm/amanda.spec.src: add rhel6 stanza to distro detection
 
+2010-11-16  Jean-Louis Martineau <martineau@zmanda.com>
+       * installcheck/Amanda_Changer_single.pl: Typo.
+       * server-src/amtape.pl: Typo.
+
 2010-11-16  Jean-Louis Martineau <martineau@zmanda.com>
        * server-src/find.c: Keep the complete error message.
 
+2010-11-16  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/Amanda/Changer/disk.pm: new MOUNT, UMOUNT, UMOUNT-LOCKFILE and
+                                      UMOUNT-IDLE properties.
+       * man/xml-source/amanda-changers.7.xml: Add new chg-disk property.
+       * NEWS: Add new chg-disk property.
+
+2010-11-16  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/Amanda/Changer.pm: Add quit method.
+       * perl/Amanda/Changer/aggregate.pm: Add quit method.
+       * perl/Amanda/Changer/rait.pm: Add quit method.
+       * perl/Amanda/Recovery/Clerk.pm: Call scan quit method.
+       * perl/Amanda/Recovery/Scan.pm: Add quit method.
+       * perl/Amanda/Taper/Controller.pm: Call scan quit method.
+       * perl/Amanda/Taper/Scan.pm: Add quit method.
+       * perl/Amanda/Taper/Scribe.pm: finished_cb to Add scribe_notif_tape_done
+       * server-src/amcheck-device.pl, server-src/amcheckdump.pl,
+         server-src/amidxtaped.pl, server-src/amlabel.pl,
+         server-src/amrestore.pl, server-src/amrmtape.pl,
+         server-src/amtape.pl: Call scan/changer quit method.
+       * server-src/amvault.pl scribe_notif_tape_done with finished_cb.
+       * installcheck/Amanda_Changer.pl,
+         installcheck/Amanda_Changer_compat.pl,
+         installcheck/Amanda_Changer_disk.pl,
+         installcheck/Amanda_Changer_multi.pl,
+         installcheck/Amanda_Changer_ndmp.pl,
+         installcheck/Amanda_Changer_null.pl,
+         installcheck/Amanda_Changer_rait.pl,
+         installcheck/Amanda_Changer_robot.pl,
+         installcheck/Amanda_Changer_single.pl,
+         installcheck/Amanda_Recovery_Clerk.pl,
+         installcheck/Amanda_Recovery_Scan.pl,
+         installcheck/Amanda_Taper_Scan.pl,
+         installcheck/Amanda_Taper_Scan_traditional.pl,
+         installcheck/Amanda_Taper_Scribe.pl,
+         installcheck/amvault.pl: Add call to scan/changer quit method.
+
 2010-11-12  Jean-Louis Martineau <martineau@zmanda.com>
        * server-src/driverio.c: Don't update last_level/consecutive_runs if
          the dump failed.
 
+2010-11-11  Nikhil Bhupale <nikhilb@zmanda.com>
+       * server-src/amtape.pl: Remove call to set_label.
+       * server-src/amrestore.pl: Remove call to set_label.
+
+2010-11-10  Jean-Louis Martineau <martineau@zmanda.com>
+       * config/amanda/progs.m4(AMANDA_PROG_MOUNT, AMANDA_PROG_UMOUNT):
+         find mount and umount binaries
+       * configure.in: Use AMANDA_PROG_MOUNT and AMANDA_PROG_UMOUNT.
+       * perl/Amanda/Constants.pm.in: Define MOUNT and UMOUNT.
+
 2010-11-10  Jean-Louis Martineau <martineau@zmanda.com>
        * device-src/tape-device.c: Accept LEOM property.
 
 2010-11-10  Jean-Louis Martineau <martineau@zmanda.com>
        * perl/Amanda/Changer/robot.pm: Fix use of Amanda::Changer->make_error
 
+2010-11-10  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/amflock.c (lock_wr, lock_rd, lock_locked): New function
+       * common-src/amflock.h: Add their prototype.
+       * perl/Amanda/Util.swg: Swig them.
+       * perl/Amanda/Util.pod: Docuemnt them.
+
+2010-11-10  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/Amanda/Changer.pm: Remove the changer cache.
+       * installcheck/Amanda_Taper_Scan_traditional.pl,
+         installcheck/Amanda_Changer_robot.pl,
+         installcheck/Amanda_Changer_ndmp.pl: Do not reset the changer cache.
+
+2010-11-10  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/Amanda/MainLoop.swg: Add finalize in define_step.
+       * perl/Amanda/MainLoop.pod: Document finalize.
+
+2010-11-10  Jean-Louis Martineau <martineau@zmanda.com>
+       * application-src/amstar.c: Support 'exclude file' and 'exclude list'.
+       * man/xml-source/amstar.8.xml: Document exclude limitation.
+
 2010-11-08  Jean-Louis Martineau <martineau@zmanda.com>
        * server-src/driver.c: Better handling of dump to tape.
          Set force_flush to 0 as soon as the runq is empty.
                                       is a try.
 
 2010-11-05  Jean-Louis Martineau <martineau@zmanda.com>
-       * man/xml-source/tapelist.5.xml: Document BARCODE.
+       * man/xml-source/tapelist.5.xml: Document BARCODE and META.
 
 2010-11-05  Jean-Louis Martineau <martineau@zmanda.com>
        * server-src/amdump.pl: Execute subprocess with the config overwrite.
        * server-src/amvault.pl: Execute subprocess with the config overwrite.
 
 2010-11-04  Jean-Louis Martineau <martineau@zmanda.com>
-       * server-src/amreport.pl: Set date correctly for amvault run.
-       * perl/Amanda/Report/human.pm: Fix warning.
+        * server-src/amreport.pl: Set date correctly for amvault run.
+        * perl/Amanda/Report/human.pm: Fix warning.
 
 2010-11-04  Jean-Louis Martineau <martineau@zmanda.com>
-       * server-src/tapefile.c: Add barcode in tapelist.
-       * server-src/tapefile.h: Add barcode in tapelist.
-       * perl/Amanda/Tapelist.swg: Add barcode in tapelist.
+       * perl/Amanda/Changer/aggregate.pm: New changer.
+       * man/xml-source/amanda-changers.7.xml: Document chg-aggregate.
+       * perl/Makefile.am: Add it.
+       * server-src/amtape.pl: Print better message if inventory is not
+                               implemented.
+
+2010-11-04  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/Amanda/Changer.pm: $o $c $m $b in autolabel.
+       * perl/Amanda/Changer.pm: $o $c in meta-autolabel.
+       * server-src/amlabel.pl: New --barcode option, <label> is no longer
+         required, an autolabel can be generated.
+       * server-src/find.c: Fix for quoted label.
+       * man/xml-source/amanda.conf.5.xml: Document new autolable variable.
+       * man/xml-source/amlabel.8.xml: Document new amlabel features.
+       * installcheck/Amanda_Tapelist.pl: Test it.
+       * installcheck/Installcheck/Run.pm (setup): Argument to set the number
+                                                   of slot.
+       * installcheck/amlabel.pl: Test it.
+
+2010-11-04  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/tapefile.c: Add barcode intapelist.
+       * server-src/tapefile.h: Add barcode intapelist.
+       * perl/Amanda/Tapelist.swg: Add barcode intapelist.
        * perl/Amanda/Taper/Scribe.pm: Set the barcode.
        * server-src/amlabel.pl: Set the barcode.
        * installcheck/Amanda_Tapelist.pl: Test it.
        * installcheck/amlabel.pl: Test it.
 
+2010-11-04  Jean-Louis Martineau <martineau@zmanda.com>
+       * perl/Amanda/Taper/Scan.pm (new): Take a tapelist argument, not a
+                                          filename.
+       * perl/Amanda/Taper/Scan.pm: Remove make_new_tape_label and
+                                    make_new_meta_label methods.
+       * perl/Amanda/Changer.pm (new): Take a tapelist argument.
+       * perl/Amanda/Changer.pm: Add make_new_tape_label and
+         make_new_meta_label methods to Amanda::Changer::Reservation.
+       * installcheck/Amanda_Taper_Scan.pl,
+         installcheck/Amanda_Taper_Scan_traditional.pl,
+         installcheck/amdevcheck.pl, perl/Amanda/Taper/Controller.pm,
+         perl/Amanda/Taper/Scan/traditional.pm, perl/Amanda/Taper/Scribe.pm,
+         server-src/amcheck-device.pl, server-src/amcheckdump.pl,
+         server-src/amidxtaped.pl, server-src/amlabel.pl,
+         server-src/amrestore.pl, server-src/amrmtape.pl,
+         server-src/amtape.pl, server-src/amvault.pl,
+         server-src/taper.pl: Change for new tapelist argument.
+
 2010-11-02  Jean-Louis Martineau <martineau@zmanda.com>
        * common-src/util.c (quote_string_maybe): Don't use match.
        * common-src/util.c (len_quote_string_maybe): New function.
        * common-src/conffile.c: debug-recovery default to 1.
        * man/xml-source/amanda.conf.5.xml: Document it.
 
+2010-11-02  Nikhil Bhupale <nikhilb@zmanda.com>
+       * server-src/amtape.pl: Remove call to set_label.
+       * server-src/amcheck-device.pl: Remove call to set_label.
+2010-10-29  Dustin J. Mitchell <dustin@mozilla.com>
+       * man/xml-source/amanda-changers.7.xml: improve chg-disk properties
+         documentation
+
 2010-10-29  Jean-Louis Martineau <martineau@zmanda.com>
        * server-src/chunker.c: Close listening socket are accepted socket.
        * xfer-src/element-glue.c: Close listening socket are accepted socket.
 2010-10-28  Jean-Louis Martineau <martineau@zmanda.com>
        * client-src/client_util.c: Don't free script->result.
 
+2010-10-27  Jean-Louis Martineau <martineau@zmanda.com>
+       * man/xml-source/amanda.conf.5.xml: What is a meta label.
+
 2010-10-27  Jean-Louis Martineau <martineau@zmanda.com>
        * server-src/dumper.c: Typo.
 
+2010-10-26  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/conffile.c: New meta-autolabel.
+       * common-src/conffile.h: CNF_META_AUTOLABEL.
+       * perl/Amanda/Config.swg: CNF_META_AUTOLABEL.
+       * man/xml-source/amanda.conf.5.xml: Document meta-autolabel
+       * server-src/tapefile.c: Read/write meta-label to tapelist file
+       * server-src/tapefile.h (struct tape_s): Add meta.
+       * perl/Amanda/Tapelist.swg: Read/write meta-label to tapelist file
+       * perl/Amanda/Changer.pm (get_meta_label, set_meta_label): New methods
+         in A::Changer and A::Changer::Reservation.
+       * perl/Amanda/Changer/disk.pm: Keep meta-label in state file.
+       * perl/Amanda/Changer/disk.pm (get_meta_label, set_meta_label):
+         New methods
+       * perl/Amanda/Taper/Scan.pm (make_new_meta_label): New method.
+       * perl/Amanda/Taper/Scribe.pm: get/set meta label.
+       * server-src/amlabel.pl: New --meta and --assign option.
+       * server-src/amtape.pl (inventory): Print meta-label.
+       * man/xml-source/amlabel.8.xml: Document --meta and --assign options.
+       * installcheck/Amanda_Tapelist.pl: Test tapelist with meta-label.
+       * installcheck/amlabel.pl: Check meta.
+
+2010-10-26  Jean-Louis Martineau <martineau@zmanda.com>
+       * man/xml-source/amanda-changers.7.xml: Document new NUM-SLOT,
+         AUTO-CREATE-SLOT and REMOVABLE chg-disk properties.
+       * perl/Amanda/Changer.pm (get_boolean_property) Moved from A::Changer
+         to A::Changer::Config.
+       * perl/Amanda/Changer/disk.pm: New NUM-SLOT, AUTO-CREATE-SLOT and
+         REMOVABLE properties. Use new get_boolean_property.
+       * perl/Amanda/Changer/robot.pm: Use new get_boolean_property.
+
 2010-10-26  Jean-Louis Martineau <martineau@zmanda.com>
        * common-src/fileheader.c (parse_file_header): Print buf.
        * patching file recover-src/extract_list.c: Read header in multiple
 2010-10-19  Jean-Louis Martineau <martineau@zmanda.com>
        * ReleaseNotes NEWS: amdump --no-taper option.
 
-2010-10-18  Jean-Louis Martineau <martineau@zmanda.com>
-       * VERSION: 3.2.0
+2010-10-19  Nikhil Bhupale <nikhilb@zmanda.com>
+       * device-src/vfs-device.h device-src/vfs-device.c:
+         add enforce_max_volume_usage
+       * device-src/s3-device.c: Added support for MAX_VOLUME_USAGE and
+         ENFORCE_MAX_VOLUME_USAGE
+       * device-src/property.h device-src/property.c: Added property
+         ENFORCE_MAX_VOLUME_USAGE
+       * device-src/s3.h device-src/s3.c: Calculate total volume usage for
+         s3 device
+       * installcheck/Amanda_Device.pl: Test it
+       * man/xml-source/amanda-devices.7.xml: Document it
 
 2010-10-18  Jean-Louis Martineau <martineau@zmanda.com>
        * application-src/ampgsql.pl: Give an error if client property
        * common-src/conffile.c (read_size_byte/get_size_byte):
          CNF_DEVICE_OUTPUT_BUFFER_SIZE is in bytes.
 
+2010-10-14  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amtape.pl (inventory): print current slot.
+       * installcheck/amtape.pl: check it.
+
 2010-10-14 Dan Locks <dwlocks@zmanda.com>
        *  packaging/deb/rules, packaging/deb/buildpkg,
           packaging/rpm/amanda.spec.src: remove port range limits for
        * perl/amglue/ghashtable.c: Define PERL_MAGIC_tied.
 
 2010-10-12  Jean-Louis Martineau <martineau@zmanda.com>
-        * device-src/s3-device.c: Don't check 'self->use_ssl && !self->ca_info'.
+       * device-src/s3-device.c: Don't check 'self->use_ssl && !self->ca_info'.
 
 2010-10-12  Dustin J. Mitchell <dustin@zmanda.com>
        * ndmp-src/ndma_comm_session.c: add a g_debug message
        *  config/amanda/progs.m4: add comment about sysloc- and locsys- path,
           make MTX a precious variable.
 
+2010-10-12  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/conffile.c: Set default netusage to 80000 kbps.
+
+2010-10-12  Dustin J. Mitchell <dustin@zmanda.com>
+       * perl/Amanda/Util.pod: fix typo
+       * server-src/amserverconfig.pl: don't specify duplicate 'dumpuser'
+         parameter in amserverconfig (it's also in advanced.conf); use
+         get_fs_usage; include weird size requirements in error message
+       * installcheck/amserverconfig.pl: test for this arrangement (used in
+         the template + custom options case, I think)
+
 2010-10-12  Dustin J. Mitchell <dustin@zmanda.com>
        * ndmp-src/amndmjob_main.c: remove exit on eof thread
        * ndmp-src/ndmjob_main.c: add it here, in the right place
        * perl/Amanda/Recovery/Clerk.pm: remove it when restoring, too
 
 2010-10-08  Dustin J. Mitchell <dustin@zmanda.com>
-       * server-src/amvault.pl: --autolabel any, not --autolabel all
        * installcheck/amvault.pl: update the tests to use --autolabel=any
 
+2010-10-08  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/amvault.pl: --autolabel any, not --autolabel all
+
 2010-10-08  Jean-Louis Martineau <martineau@zmanda.com>
        * device-src/s3-device.c: Don't give an error is ssl_ca_info is set
          and ssl is not used.
        * installcheck/Makefile.am:
          Add installcheck/Amanda_Config_FoldingHash.pl
 
+2010-10-07  Dustin J. Mitchell <dustin@zmanda.com>
+       * man/xml-source/amoverview.8.xml: fix typos in usage
+       * server-src/amoverview.pl: config is mandatory; --config is not
+
 2010-10-07  Jean-Louis Martineau <martineau@zmanda.com>
        * server-src/planner.c: Log packet sent and received.
 
-2010-10-06  Dustin J. Mitchell <dustin@zmanda.com>
-       * VERSION: 3.2.0beta3
+2010-10-07  Dustin J. Mitchell <dustin@zmanda.com>
+       * amandad-src/amandad.c: don't wait 5 seconds if the service has
+         already exited
+
+2010-10-06 Dan Locks <dwlocks@zmanda.com>
+       *  config/amanda/libs.m4: update LIBCURL_CHECK_CONFIG help string,
+          fix AC_PATH_PROG usage.
 
 2010-10-06  Dustin J. Mitchell <dustin@zmanda.com>
        * perl/Makefile.am: only run the threading test after install
 
 2010-10-06  Jean-Louis Martineau <martineau@zmanda.com>
-       * VERSION: 3.2.0beta2
+       * VERSION: 3.3.0alpha
 
 2010-10-06  Dustin J. Mitchell <dustin@zmanda.com>
        * perl/Makefile.am: fix the FreeBSD threading test to actually fail
index e4604e3afd0dd7b7ebf8a8064658da22c365f6ef..15a279981720791464e46ab21ae96b3c1c65c3b6 100644 (file)
@@ -1 +1 @@
-3.2.1
+3.3.0
index f7c87e6f575f155d0e0692d74e0461ea746d9fb6..1f9f408c9e9dcbe2860ccdf8bbbcb938d745222b 100644 (file)
@@ -124,6 +124,7 @@ am__aclocal_m4_deps =  \
        $(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/as_needed.m4 \
        $(top_srcdir)/config/amanda/bsd-security.m4 \
        $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
        $(top_srcdir)/config/amanda/bsdudp-security.m4 \
@@ -371,6 +372,7 @@ APPLICATION_DIR = @APPLICATION_DIR@
 AR = @AR@
 ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
 ASSERTIONS = @ASSERTIONS@
+AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -844,6 +846,7 @@ LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
 MKDIR_P = @MKDIR_P@
+MOUNT = @MOUNT@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
@@ -1041,6 +1044,7 @@ STDBOOL_H = @STDBOOL_H@
 STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
+SUNTAR = @SUNTAR@
 SVN = @SVN@
 SWIG = @SWIG@
 SWIG_LIB = @SWIG_LIB@
@@ -1048,6 +1052,7 @@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TCPPORTRANGE = @TCPPORTRANGE@
 TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
 UDPPORTRANGE = @UDPPORTRANGE@
+UMOUNT = @UMOUNT@
 UNCOMPRESS_OPT = @UNCOMPRESS_OPT@
 UNCOMPRESS_PATH = @UNCOMPRESS_PATH@
 UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
diff --git a/NEWS b/NEWS
index 11c92566b57a8a2fca34666038d7a9f23b0ca1fe..cba8972d752a6c6b72b185a2484c8a009127a2f3 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,85 @@
+Changes in release 3.3.0
+
+   * The default auth is changed to "bsdtcp", if you are using the default bsd
+     then you must add it to your configuration.
+       o in amanda.conf
+       o in amanda-client.conf
+       o in dumptype/disklist
+       o in xinetd (if no '-auth' argument to amandad)
+   * amdump trap crtl-c, it still send the report and do cleanup if you do
+     one crtl-c, do it more than once to abort the run.
+   * s3 device
+       o use multiple threads to speedup the transfer
+       o can connect to eucalytus.
+       o new NB_THREADS_BACKUP property
+       o new NB_THREADS_RECOVERY property
+       o new S3_HOST property
+       o new S3_SERVICE_PATH property
+       o new S3_SUBDOMAIN property
+   * chg-aggregate: new changer that use other changer sequentially.
+   * meta-volume
+   * Add meta label in tapelist file
+   * chg-disk:
+       o support for removable disk
+       o new NUM-SLOT property
+       o new AUTO-CREATE-SLOT property
+       o new REMOVABLE property
+       o new MOUNT property
+       o new UMOUNT property
+       o new UMOUNT-LOCKFILE property
+       o new UMOUNT-IDLE property
+   * new taperscan algorithm:
+       o oldest: this algorithm try to run through the volumes in the oldest
+        order
+       o lexical: this algorithm try to run through the volumes in the natural
+        order
+   * Change in amanda.conf
+       o new meta-autolabel option
+       o autolabel can include org, config, barcode, meta in the label
+       o new client-name option in appication and script.
+   * application and script in amanda-client.conf can be used to set default
+     properties for application or script.
+   * amlabel
+       o The label argument is no longer required, an autolabel can be
+        generated
+       o new --meta option
+       o new --barcode option
+       o new --assign option
+   * amgtar, amstar: The path must be specified, it will not works with a
+     device.
+   * amrecover: decompression and decryption are now done on the client if
+               compression/encryption was done on the client.
+   * amtape: inventory print the current slot
+   * amanda.conf:
+       o autoflush have value "no|yes|all"
+       o script have single-execution setting.
+       o Add pre-amcheck, post-amcheck, pre-estimate, post-estimate, pre-backup
+         and post-backup to execute-on of script.
+       o Add taperscan and interactivity section.
+       o add 'server' value in recovery-limit.
+       o add dump-limit in a dumptype.
+   * amanda-client.conf
+       o add amdump-server setting.
+   * script are searched in $APPLICATION_DIR, $CONFIG_DIR/<conf>/application
+     and $CONFIG_DIR/application
+   * amservice
+       o add -s argument
+       o is also installed on client
+   * new amdumpd server service, if enable, it allow client to start a backup
+     of itself.
+   * new amdump_client program, it is use on client to start a backup of itself
+   * implement restore command amzfs-sendrecv, it can be use with amrecover.
+
+Changes in release 3.2.2
+
+   * Do not restore the NUL padding bytes, some program fail with them.
+   * Fix driver doing nothing if taper crash early.
+   * Fix taperalog *FIT no going to second volume.
+   * Fix amrestore '-p' not going to next file.
+   * flush even if flush threshold are not met if it save tape space.
+   * fix crash in amtrmidx due to memory leak.
+   * amsamba use 'Use smbclient -TF' for restore.
+
 Changes in release 3.2.1
 
    * barcode are added to the tapelist file.
index bab0471665a63685302f60bca4a9fea345371f78..916b0aa69ab42ee078c41ecd7d974d838f37a12b 100644 (file)
@@ -1,3 +1,85 @@
+               Release Notes for amanda-3.3.0
+
+* The default auth is changed to "bsdtcp", if you are using the default bsd
+  then you must add it to your configuration.
+    o in amanda.conf
+    o in amanda-client.conf
+    o in dumptype/disklist
+    o in xinetd (if no '-auth' argument to amandad)
+* amdump trap crtl-c, it still send the report and do cleanup if you do
+  one crtl-c, do it more than once to abort the run.
+* s3 device
+    o use multiple threads to speedup the transfer
+    o can connect to eucalytus.
+    o new NB_THREADS_BACKUP property
+    o new NB_THREADS_RECOVERY property
+    o new S3_HOST property
+    o new S3_SERVICE_PATH property
+    o new S3_SUBDOMAIN property
+* chg-aggregate: new changer that use other changer sequentially.
+* meta-volume
+* Add meta label in tapelist file
+* chg-disk:
+    o support for removable disk
+    o new NUM-SLOT property
+    o new AUTO-CREATE-SLOT property
+    o new REMOVABLE property
+    o new MOUNT property
+    o new UMOUNT property
+    o new UMOUNT-LOCKFILE property
+    o new UMOUNT-IDLE property
+* new taperscan algorithm:
+    o oldest: this algorithm try to run through the volumes in the oldest
+      order
+    o lexical: this algorithm try to run through the volumes in the natural
+      order
+* Change in amanda.conf
+    o new meta-autolabel option
+    o autolabel can include org, config, barcode, meta in the label
+    o new client-name option in appication and script.
+* application and script in amanda-client.conf can be used to set default
+  properties for application or script.
+* amlabel
+    o The label argument is no longer required, an autolabel can be
+      generated
+    o new --meta option
+    o new --barcode option
+    o new --assign option
+* amgtar, amstar: The path must be specified, it will not works with a
+  device.
+* amrecover: decompression and decryption are now done on the client if
+             compression/encryption was done on the client.
+* amtape: inventory print the current slot
+* amanda.conf:
+    o autoflush have value "no|yes|all"
+    o script have single-execution setting.
+    o Add pre-amcheck, post-amcheck, pre-estimate, post-estimate, pre-backup
+      and post-backup to execute-on of script.
+    o Add taperscan and interactivity section.
+    o add 'server' value in recovery-limit.
+    o add dump-limit in a dumptype.
+* amanda-client.conf
+    o add amdump-server setting.
+* script are searched in $APPLICATION_DIR, $CONFIG_DIR/<conf>/application
+  and $CONFIG_DIR/application
+* amservice
+    o add -s argument
+    o is also installed on client
+* new amdumpd server service, if enable, it allow client to start a backup
+  of itself.
+* new amdump_client program, it is use on client to start a backup of itself
+* implement restore command amzfs-sendrecv, it can be use with amrecover.
+
+               Release Notes for amanda-3.2.2
+
+* Do not restore the NUL padding bytes, some program fail with them.
+* Fix driver doing nothing if taper crash early.
+* Fix taperalog *FIT no going to second volume.
+* Fix amrestore '-p' not going to next file.
+* flush even if flush threshold are not met if it save tape space.
+* fix crash in amtrmidx due to memory leak.
+* amsamba use 'Use smbclient -TF' for restore.
+
                Release Notes for amanda-3.2.1
 
 * barcode are added to the tapelist file.
@@ -13,7 +95,6 @@
    o Crash in robot changer.
    o Script output property are not sent to application.
 
-
                Release Notes for amanda-3.2.0
 
 * Support for multiple simultaneous writes to storage devices
diff --git a/VERSION b/VERSION
index e4604e3afd0dd7b7ebf8a8064658da22c365f6ef..15a279981720791464e46ab21ae96b3c1c65c3b6 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-3.2.1
+3.3.0
index 73d98a3312a8423522a9ff984cee243e52e30770..5e62a5341b9a51f666954d23b539aac52c17b732 100644 (file)
@@ -8022,6 +8022,7 @@ 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/as_needed.m4])
 m4_include([config/amanda/bsd-security.m4])
 m4_include([config/amanda/bsdtcp-security.m4])
 m4_include([config/amanda/bsdudp-security.m4])
index 4c86e4b50e23e2b94a4078c503630a045a3c7589..8b73c9cc7601b703e0f23e2a083df7dfd7b28b4f 100644 (file)
@@ -9,7 +9,7 @@ INCLUDES =      -I$(top_builddir)/common-src \
                -I$(top_srcdir)/gnulib
 
 AM_CFLAGS = $(AMANDA_WARNING_CFLAGS)
-AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
+AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS) $(AS_NEEDED_FLAGS)
 
 LINT=$(AMLINT)
 LINTFLAGS=$(AMLINTFLAGS)
@@ -19,7 +19,7 @@ amlib_LTLIBRARIES =       libamandad.la
 amlibexec_PROGRAMS =   amandad
 
 libamandad_la_SOURCES= amandad_util.c
-libamandad_la_LDFLAGS = -release $(VERSION)
+libamandad_la_LDFLAGS = -release $(VERSION) $(AS_NEEDED_FLAGS)
 libamandad_la_LIBADD = ../common-src/libamanda.la
 
 noinst_HEADERS  = amandad.h
index 103bc4d3d394068c93815042c19e832ef5fe74bc..d3e941c70bcd1363db16a7490902457277740e84 100644 (file)
@@ -131,6 +131,7 @@ am__aclocal_m4_deps =  \
        $(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/as_needed.m4 \
        $(top_srcdir)/config/amanda/bsd-security.m4 \
        $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
        $(top_srcdir)/config/amanda/bsdudp-security.m4 \
@@ -351,6 +352,7 @@ APPLICATION_DIR = @APPLICATION_DIR@
 AR = @AR@
 ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
 ASSERTIONS = @ASSERTIONS@
+AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -824,6 +826,7 @@ LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
 MKDIR_P = @MKDIR_P@
+MOUNT = @MOUNT@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
@@ -1021,6 +1024,7 @@ STDBOOL_H = @STDBOOL_H@
 STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
+SUNTAR = @SUNTAR@
 SVN = @SVN@
 SWIG = @SWIG@
 SWIG_LIB = @SWIG_LIB@
@@ -1028,6 +1032,7 @@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TCPPORTRANGE = @TCPPORTRANGE@
 TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
 UDPPORTRANGE = @UDPPORTRANGE@
+UMOUNT = @UMOUNT@
 UNCOMPRESS_OPT = @UNCOMPRESS_OPT@
 UNCOMPRESS_PATH = @UNCOMPRESS_PATH@
 UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
@@ -1167,12 +1172,12 @@ INCLUDES = -I$(top_builddir)/common-src \
                -I$(top_srcdir)/gnulib
 
 AM_CFLAGS = $(AMANDA_WARNING_CFLAGS)
-AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
+AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS) $(AS_NEEDED_FLAGS)
 LINT = $(AMLINT)
 LINTFLAGS = $(AMLINTFLAGS)
 amlib_LTLIBRARIES = libamandad.la
 libamandad_la_SOURCES = amandad_util.c
-libamandad_la_LDFLAGS = -release $(VERSION)
+libamandad_la_LDFLAGS = -release $(VERSION) $(AS_NEEDED_FLAGS)
 libamandad_la_LIBADD = ../common-src/libamanda.la
 noinst_HEADERS = amandad.h
 
index 5c15e0442efbae2afca8eeb3f762f25d442aa190..04774345284227e102734fab93354909e8435c6f 100644 (file)
@@ -81,7 +81,8 @@ typedef enum {
     SERVICE_SENDBACKUP,
     SERVICE_SELFCHECK,
     SERVICE_AMINDEXD,
-    SERVICE_AMIDXTAPED
+    SERVICE_AMIDXTAPED,
+    SERVICE_AMDUMPD
 } service_t;
 
 static struct services {
@@ -94,7 +95,8 @@ static struct services {
    { "sendbackup", 1, SERVICE_SENDBACKUP },
    { "selfcheck", 1, SERVICE_SELFCHECK },
    { "amindexd", 0, SERVICE_AMINDEXD },
-   { "amidxtaped", 0, SERVICE_AMIDXTAPED }
+   { "amidxtaped", 0, SERVICE_AMIDXTAPED },
+   { "amdumpd", 0, SERVICE_AMDUMPD }
 };
 #define        NSERVICES       (int)(sizeof(services) / sizeof(services[0]))
 
@@ -285,6 +287,14 @@ main(
                error(_("no driver for security type '%s'\n"), argv[i]);
                 /*NOTREACHED*/
            }
+           if (strcmp(auth, "local") == 0 ||
+               strcmp(auth, "rsh") == 0 ||
+               strcmp(auth, "ssh") == 0) {
+               int i;
+               for (i=0; i < NSERVICES; i++) {
+                   services[i].active = 1;
+               }
+           }
            continue;
        }
 
@@ -421,13 +431,13 @@ main(
     }
 
     /*
-     * If no security type specified, use BSD
+     * If no security type specified, use BSDTCP
      */
     if (secdrv == NULL) {
-       secdrv = security_getdriver("BSD");
-       auth = "bsd";
+       secdrv = security_getdriver("BSDTCP");
+       auth = "bsdtcp";
        if (secdrv == NULL) {
-           error(_("no driver for default security type 'BSD'\n"));
+           error(_("no driver for default security type 'BSDTCP'\n"));
            /*NOTREACHED*/
        }
     }
@@ -1811,17 +1821,22 @@ service_delete(
     if (as->security_handle != NULL)
        security_close(as->security_handle);
 
+    /* try to kill the process; if this fails, then it's already dead and
+     * likely some of the other zombie cleanup ate its brains, so we don't
+     * bother to waitpid for it */
     assert(as->pid > 0);
-    kill(as->pid, SIGTERM);
     pid = waitpid(as->pid, NULL, WNOHANG);
-    count = 5;
-    while (pid != as->pid && count > 0) {
-       count--;
-       sleep(1);
+    if (pid != as->pid && kill(as->pid, SIGTERM) == 0) {
        pid = waitpid(as->pid, NULL, WNOHANG);
-    }
-    if (pid != as->pid) {
-       g_debug("Process %d failed to exit", (int)as->pid);
+       count = 5;
+       while (pid != as->pid && count > 0) {
+           count--;
+           sleep(1);
+           pid = waitpid(as->pid, NULL, WNOHANG);
+       }
+       if (pid != as->pid) {
+           g_debug("Process %d failed to exit", (int)as->pid);
+       }
     }
 
     serviceq = g_slist_remove(serviceq, (gpointer)as);
index ef66352a75576d8c7cd58335741e91b36d119e65..8d4ce246214488f2fa3f606c6b349a5d84368537 100644 (file)
@@ -9,7 +9,7 @@ INCLUDES =      -I$(top_builddir)/common-src \
                 -I$(top_srcdir)/gnulib
 
 AM_CFLAGS = $(AMANDA_WARNING_CFLAGS)
-AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
+AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS) $(AS_NEEDED_FLAGS)
 
 LINT=@AMLINT@
 LINTFLAGS=@AMLINTFLAGS@
@@ -17,7 +17,7 @@ LINTFLAGS=@AMLINTFLAGS@
 amlib_LTLIBRARIES =     libamar.la
 
 libamar_la_SOURCES = amar.c
-libamar_la_LDFLAGS =  -release $(VERSION)
+libamar_la_LDFLAGS =  -release $(VERSION) $(AS_NEEDED_FLAGS)
 libamar_la_LIBADD = ../common-src/libamanda.la
 
 noinst_HEADERS = \
index 03ad8df1b15bf830cf3122563e036fea04e53ea7..6df5c0ac872b6542c693e129576d299e61e46f0e 100644 (file)
@@ -133,6 +133,7 @@ am__aclocal_m4_deps =  \
        $(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/as_needed.m4 \
        $(top_srcdir)/config/amanda/bsd-security.m4 \
        $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
        $(top_srcdir)/config/amanda/bsdudp-security.m4 \
@@ -359,6 +360,7 @@ APPLICATION_DIR = @APPLICATION_DIR@
 AR = @AR@
 ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
 ASSERTIONS = @ASSERTIONS@
+AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -832,6 +834,7 @@ LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
 MKDIR_P = @MKDIR_P@
+MOUNT = @MOUNT@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
@@ -1029,6 +1032,7 @@ STDBOOL_H = @STDBOOL_H@
 STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
+SUNTAR = @SUNTAR@
 SVN = @SVN@
 SWIG = @SWIG@
 SWIG_LIB = @SWIG_LIB@
@@ -1036,6 +1040,7 @@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TCPPORTRANGE = @TCPPORTRANGE@
 TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
 UDPPORTRANGE = @UDPPORTRANGE@
+UMOUNT = @UMOUNT@
 UNCOMPRESS_OPT = @UNCOMPRESS_OPT@
 UNCOMPRESS_PATH = @UNCOMPRESS_PATH@
 UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
@@ -1175,12 +1180,12 @@ INCLUDES = -I$(top_builddir)/common-src \
                 -I$(top_srcdir)/gnulib
 
 AM_CFLAGS = $(AMANDA_WARNING_CFLAGS)
-AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
+AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS) $(AS_NEEDED_FLAGS)
 LINT = @AMLINT@
 LINTFLAGS = @AMLINTFLAGS@
 amlib_LTLIBRARIES = libamar.la
 libamar_la_SOURCES = amar.c
-libamar_la_LDFLAGS = -release $(VERSION)
+libamar_la_LDFLAGS = -release $(VERSION) $(AS_NEEDED_FLAGS)
 libamar_la_LIBADD = ../common-src/libamanda.la
 noinst_HEADERS = \
        amar.h
index f6577d7d5ff35b911a086805544d802acc5e3362..67cc109ac7e0492df4e3931cda45fedee1640f51 100644 (file)
@@ -902,6 +902,22 @@ amar_read(
                }
 
                if (!datasize) {
+                   unsigned int i, nul_padding = 1;
+                   char *bb;
+                   /* try to detect NULL padding bytes */
+                   if (!buf_atleast(archive, &hp, 512 - RECORD_SIZE)) {
+                       /* close to end of file */
+                       break;
+                   }
+                   bb = buf_ptr(&hp);
+                   /* check all byte == 0 */
+                   for (i=0; i<512 - RECORD_SIZE; i++) {
+                       if (*bb++ != 0)
+                           nul_padding = 0;
+                   }
+                   if (nul_padding) {
+                       break;
+                   }
                    g_set_error(error, amar_error_quark(), EINVAL,
                                "Archive file %d has an empty filename",
                                (int)filenum);
index ec7636ea753187f471e2e9d168a9a5ac7be11948..e9c34f4b8b87fadd4cbc38a7af60b8b5bfd51278 100644 (file)
@@ -200,6 +200,7 @@ am__aclocal_m4_deps =  \
        $(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/as_needed.m4 \
        $(top_srcdir)/config/amanda/bsd-security.m4 \
        $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
        $(top_srcdir)/config/amanda/bsdudp-security.m4 \
@@ -393,6 +394,7 @@ APPLICATION_DIR = @APPLICATION_DIR@
 AR = @AR@
 ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
 ASSERTIONS = @ASSERTIONS@
+AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -866,6 +868,7 @@ LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
 MKDIR_P = @MKDIR_P@
+MOUNT = @MOUNT@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
@@ -1063,6 +1066,7 @@ STDBOOL_H = @STDBOOL_H@
 STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
+SUNTAR = @SUNTAR@
 SVN = @SVN@
 SWIG = @SWIG@
 SWIG_LIB = @SWIG_LIB@
@@ -1070,6 +1074,7 @@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TCPPORTRANGE = @TCPPORTRANGE@
 TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
 UDPPORTRANGE = @UDPPORTRANGE@
+UMOUNT = @UMOUNT@
 UNCOMPRESS_OPT = @UNCOMPRESS_OPT@
 UNCOMPRESS_PATH = @UNCOMPRESS_PATH@
 UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
index 2c4a5ad4aa97fc92036c071967bf21b7addbffa9..f385daeb4f329b19765f7067fd843fdeaeebe65c 100644 (file)
@@ -102,7 +102,7 @@ BEGIN{
                          level[$6]=$14;
                        }
                        else if( $7 == "FILE-WRITE") file_write++;
-                       else if( $7 == "START-TAPER") fil = $8;
+                       else if( $7 == "START-TAPER") fil = $9;
                }
                else if( $2=="finished-cmd") cmd_fin++;
                else if( $2=="started")      forked++;
@@ -132,7 +132,7 @@ BEGIN{
                    print fil, "INFO#", $0;
        }
        else if( $1 == "taper:") {
-               if($3 != "label" && $3 != "end" && $2 != "DONE" && $2 != "pid" && $2 != "slot" && $2 != "reader-side:" && $2 != "page" && $2 != "buffer" && $3 != "at" && $3 != "switching" && $2 != "slot:")
+               if($3 != "label" && $3 != "end" && $2 != "DONE" && $2 != "pid" && $2 != "slot" && $2 != "reader-side:" && $2 != "page" && $2 != "buffer" && $3 != "at" && $3 != "switching" && $2 != "slot:" && $2 != "status")
                    print fil, "INFO#", $0;
        }
        else if( $1 == "FLUSH") {
@@ -363,6 +363,10 @@ function do_result(){              # process lines driver: result
                }
                else if ($7=="TAPER-OK") tape_err=0;
                else if ($7=="PORT")    tape_err=0;
+               else if ($7=="REQUEST-NEW-TAPE")    tape_err=0;
+               else if ($7=="NEW-TAPE")    tape_err=0;
+               else if ($7=="PARTDONE")    tape_err=0;
+               else if ($7=="DUMPER-STATUS")    tape_err=0;
                else print fil, "UNKNOWN STATUS# "$0 ;
        }
        else {                                  # something bad from dumper 
@@ -439,44 +443,46 @@ function print_t(){               # printing out the labels for the graph
        printf "set yrange[0:%d]\n",maxy >"title";
        if( maxtime < tim && extend !=0) {
                printf "set xrange[0:%d]\n", tim+30 >>"title";
-               second_col = tim*0.45;
-               key_col = tim + 10;
-               third_col = tim +13;
+               first_col = 10;
+               second_col = (tim+30) * 0.45;
+               key_col = (tim+30) * 1.042;
+               third_col = (tim+30) * 1.0125;
        }
        else {
                printf "set xrange[0:%d]\n", maxtime >>"title";
-               second_col = (maxtime-10) * 0.45;
+               first_col = maxtime * 0.042
+               second_col = maxtime * 0.45
                key_col = maxtime;
-               third_col = maxtime +3;
+               third_col = maxtime*1.0125;
        }
        label_shift = (7 + int(no_disks/100));
        lab = label_start = maxy+(6*label_shift) ;  # showing 6 labels
-       printf "set key %d, %d\n", key_col, lab+4 >>"title";
-       printf "set label %d \"Amanda Dump %s\" at 10,%d\n", ++label,fil, 
-               lab >"title";
+       printf "set key at %d, %d\n", key_col, lab+4 >>"title";
+       printf "set label %d \"Amanda Dump %s\" at %d,%d\n", ++label,fil, 
+               first_col,lab >"title";
        lab -= label_shift;
-       printf "set label %d \"Bandwidth = %d\" at 10,%d\n",++label,bandw,
-               lab >>"title";
+       printf "set label %d \"Bandwidth = %d\" at %d,%d\n",++label,bandw,
+               first_col,lab >>"title";
 
        lab -= label_shift;
-       printf "set label %d \"Holding disk = %d\" at 10,%d\n",++label,size,
-               lab >>"title";
+       printf "set label %d \"Holding disk = %d\" at %d,%d\n",++label,size,
+               first_col,lab >>"title";
 
        lab -= label_shift;
-       printf "set label %d \"Tape Policy = %s\" at 10,%d\n",++label,policy,
-               lab >>"title";
+       printf "set label %d \"Tape Policy = %s\" at %d,%d\n",++label,policy,
+               first_col,lab >>"title";
 
        lab -= label_shift;
-       printf "set label %d \"Dumpers= %d\" at 10,%d\n",++label,dumpers,
-               lab >>"title";
+       printf "set label %d \"Dumpers= %d\" at %d,%d\n",++label,dumpers,
+               first_col,lab >>"title";
 
        lab -= label_shift;
        if( alg =="drain-ends") 
-               printf "set label %d \"Driver alg = %s At big end %d\" at 10,%d\n",
-                       ++label,alg, big,lab >>"title";
+               printf "set label %d \"Driver alg = %s At big end %d\" at %d,%d\n",
+                       ++label,alg, big,first_col,lab >>"title";
        else #if( alg =="InOrder")  # other special cases
-               printf "set label %d \"Driver alg = %s\" at 10,%d\n",
-                       ++label,alg, lab >>"title";
+               printf "set label %d \"Driver alg = %s\" at %d,%d\n",
+                       ++label,alg,first_col, lab >>"title";
 
        lab = label_start;
        printf "set label %d \"Elapsed Time = %s\" at %d,%d\n",
index 9c5dd9181f3e21c6c464baa875c0792cf17723cd..f280144c30222e8c4c49e3be5a25a14b7409363b 100644 (file)
@@ -32,7 +32,7 @@
 #      Input: the files specified below on the  plot line
 #      Output: a postscript file 
 #
-set data style lines
+set style data lines
 set xrange [0:210]
 set yrange [0:420]
 set xlabel "Minutes"
@@ -59,11 +59,11 @@ set ytics ("0" 0, "20" 15, "40" 30, "60" 45, "80" 60, "100" 75,\
 #set size 0.9,0.9; set term postscript landscape "Times-Roman" 12
 # file title has the parameters that this program needs
 load 'title'
-plot   "run_queue" title "Run Queue" with line 3,\
-       "tape_queue" title "Tape Queue" with line 2,\
-       "finished"  title "Dumps Finished" with line 4,\
-       "bandw_free" title "Bandwidth Allocated" with line 8, \
-       "disk_alloc" title "%Disk Allocated" with line 1, \
-       "tape_wait" title "%Tape Wait" with line 5,\
-       "tape_idle" title "Taper Idle" with line 1,\
-       "dump_idle" title "Dumpers Idle" with line 4
+plot   "run_queue" title "Run Queue" with lines,\
+       "tape_queue" title "Tape Queue" with lines,\
+       "finished"  title "Dumps Finished" with lines,\
+       "bandw_free" title "Bandwidth Allocated" with lines, \
+       "disk_alloc" title "%Disk Allocated" with lines, \
+       "tape_wait" title "%Tape Wait" with lines,\
+       "tape_idle" title "Taper Idle" with lines,\
+       "dump_idle" title "Dumpers Idle" with lines
index c0cc36b7ec57c433dd72ae63f3351f37ac563fd9..28419967bb98f45ad0a1295ad1e7abdcf84f9b3e 100644 (file)
@@ -15,7 +15,7 @@ LINT=$(AMLINT)
 LINTFLAGS=$(AMLINTFLAGS)
 
 AM_CFLAGS = $(AMANDA_WARNING_CFLAGS)
-AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
+AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS) $(AS_NEEDED_FLAGS)
 
 SCRIPTS_PERL = script-email \
             amlog-script \
index ca75937d58118ffbcaeda0bcbc5679a6ba1cf6cb..fdbf7f3c13bd51ff6825b50b02b60046bdd6144c 100644 (file)
@@ -202,6 +202,7 @@ am__aclocal_m4_deps =  \
        $(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/as_needed.m4 \
        $(top_srcdir)/config/amanda/bsd-security.m4 \
        $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
        $(top_srcdir)/config/amanda/bsdudp-security.m4 \
@@ -430,6 +431,7 @@ APPLICATION_DIR = @APPLICATION_DIR@
 AR = @AR@
 ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
 ASSERTIONS = @ASSERTIONS@
+AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -903,6 +905,7 @@ LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
 MKDIR_P = @MKDIR_P@
+MOUNT = @MOUNT@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
@@ -1100,6 +1103,7 @@ STDBOOL_H = @STDBOOL_H@
 STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
+SUNTAR = @SUNTAR@
 SVN = @SVN@
 SWIG = @SWIG@
 SWIG_LIB = @SWIG_LIB@
@@ -1107,6 +1111,7 @@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TCPPORTRANGE = @TCPPORTRANGE@
 TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
 UDPPORTRANGE = @UDPPORTRANGE@
+UMOUNT = @UMOUNT@
 UNCOMPRESS_OPT = @UNCOMPRESS_OPT@
 UNCOMPRESS_PATH = @UNCOMPRESS_PATH@
 UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
@@ -1255,7 +1260,7 @@ INCLUDES = -I$(top_builddir)/common-src \
 LINT = $(AMLINT)
 LINTFLAGS = $(AMLINTFLAGS)
 AM_CFLAGS = $(AMANDA_WARNING_CFLAGS)
-AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
+AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS) $(AS_NEEDED_FLAGS)
 SCRIPTS_PERL = script-email \
             amlog-script \
             ampgsql \
index 95869693fdc48a0c6c728425a95f1e26d5ae55b7..fd13a6c9f66a1c0a5ab110b5a538d2db23c93eb8 100644 (file)
@@ -720,7 +720,7 @@ amgtar_estimate(
        if (gnutar_directory) {
            dirname = gnutar_directory;
        } else {
-           dirname = amname_to_dirname(argument->dle.device);
+           dirname = argument->dle.device;
        }
        amgtar_build_exinclude(&argument->dle, 1,
                               &nb_exclude, &file_exclude,
@@ -968,7 +968,7 @@ amgtar_backup(
                }
            }
            if(rp->typ == DMP_SIZE) {
-               dump_size = (long)((the_num(line, rp->field)* rp->scale+1023.0)/1024.0);
+               dump_size = (off_t)((the_num(line, rp->field)* rp->scale+1023.0)/1024.0);
            }
            switch(rp->typ) {
            case DMP_NORMAL:
@@ -1440,7 +1440,7 @@ GPtrArray *amgtar_build_argv(
     if (gnutar_directory) {
        dirname = gnutar_directory;
     } else {
-       dirname = amname_to_dirname(argument->dle.device);
+       dirname = argument->dle.device;
     }
 
     g_ptr_array_add(argv_ptr, stralloc(gnutar_path));
index 6504cb44e53ca3c965870dada08964465e90fd46..284e68f99aa7abd7e8383ddd709c7244a015656a 100644 (file)
@@ -86,6 +86,13 @@ sub command_support {
 
 #define a execute_on_* function for every execute_on you want the script to do
 #something
+sub command_pre_amcheck {
+   my $self = shift;
+
+   $self->setup();
+   $self->log_data("pre-amcheck");
+}
+
 sub command_pre_dle_amcheck {
    my $self = shift;
 
@@ -100,6 +107,13 @@ sub command_pre_host_amcheck {
    $self->log_data("pre-host-amcheck");
 }
 
+sub command_post_amcheck {
+   my $self = shift;
+
+   $self->setup();
+   $self->log_data("post-amcheck");
+}
+
 sub command_post_dle_amcheck {
    my $self = shift;
 
@@ -114,6 +128,13 @@ sub command_post_host_amcheck {
    $self->log_data("post-host-amcheck");
 }
 
+sub command_pre_estimate {
+   my $self = shift;
+
+   $self->setup();
+   $self->log_data("pre-estimate");
+}
+
 sub command_pre_dle_estimate {
    my $self = shift;
 
@@ -128,6 +149,13 @@ sub command_pre_host_estimate {
    $self->log_data("pre-host-estimate");
 }
 
+sub command_post_estimate {
+   my $self = shift;
+
+   $self->setup();
+   $self->log_data("post-estimate");
+}
+
 sub command_post_dle_estimate {
    my $self = shift;
 
@@ -142,6 +170,13 @@ sub command_post_host_estimate {
    $self->log_data("post-host-estimate");
 }
 
+sub command_pre_backup {
+   my $self = shift;
+
+   $self->setup();
+   $self->log_data("pre-backup");
+}
+
 sub command_pre_dle_backup {
    my $self = shift;
 
@@ -156,6 +191,13 @@ sub command_pre_host_backup {
    $self->log_data("pre-host-backup");
 }
 
+sub command_post_backup {
+   my $self = shift;
+
+   $self->setup();
+   $self->log_data("post-backup");
+}
+
 sub command_post_dle_backup {
    my $self = shift;
 
@@ -210,11 +252,12 @@ sub log_data {
    my($function) = shift;
    my $log;
 
+   my $text = $self->{'text'} || "";
    open($log, ">>$self->{logfile}") ||
        $self->print_to_server_and_die(
                        "Can't open logfile '$self->{logfile}' for append: $!",
                        $Amanda::Script_App::ERROR);
-   print $log "$self->{action} $self->{config} $function $self->{execute_where} $self->{host} $self->{disk} $self->{device} ", join (" ", @{$self->{level}}), " $self->{text}\n";
+   print $log "$self->{action} $self->{config} $function $self->{execute_where} $self->{host} $self->{disk} $self->{device} ", join (" ", @{$self->{level}}), " $text\n";
    close $log;
 }
 
index b11a8a2dd69003b365173ce6b14c2d462ecc43e3..5c930ed323eaf099a202112a8945125de7c64474 100644 (file)
@@ -39,6 +39,7 @@ use Amanda::Config qw( :init :getconf  config_dir_relative string_to_boolean );
 use Amanda::Debug qw( :logging );
 use Amanda::Paths;
 use Amanda::Util qw( :constants :encoding );
+use Amanda::MainLoop qw( :GIOCondition );
 
 my $_DATA_DIR_TAR = "data_dir.tar";
 my $_ARCHIVE_DIR_TAR = "archive_dir.tar";
@@ -208,12 +209,62 @@ sub _run_psql_command {
 
     push @cmd, '--quiet', '--output', '/dev/null', '--command', $cmd, $self->{'props'}->{'pg-db'};
     debug("running " . join(" ", @cmd));
-    my $status = system(@cmd);
+
+    my ($wtr, $rdr);
+    my $err = Symbol::gensym;
+    my $pid = open3($wtr, $rdr, $err, @cmd);
+    close($wtr);
+
+    my $file_to_close = 2;
+    my $psql_stdout_src = Amanda::MainLoop::fd_source($rdr,
+                                               $G_IO_IN|$G_IO_HUP|$G_IO_ERR);
+    my $psql_stderr_src = Amanda::MainLoop::fd_source($err,
+                                               $G_IO_IN|$G_IO_HUP|$G_IO_ERR);
+    $psql_stdout_src->set_callback(sub {
+       my $line = <$rdr>;
+       if (!defined $line) {
+           $file_to_close--;
+           $psql_stdout_src->remove();
+           Amanda::MainLoop::quit() if $file_to_close == 0;
+           return;
+       }
+       chomp $line;
+       debug("psql stdout: $line");
+       if ($line =~ /NOTICE: pg_stop_backup complete, all required WAL segments have been archived/) {
+       } else {
+           $self->print_to_server("psql stdout: $line",
+                                  $Amanda::Script_App::GOOD);
+       }
+    });
+    $psql_stderr_src->set_callback(sub {
+       my $line = <$err>;
+       if (!defined $line) {
+           $file_to_close--;
+           $psql_stderr_src->remove();
+           Amanda::MainLoop::quit() if $file_to_close == 0;
+           return;
+       }
+       chomp $line;
+       debug("psql stderr: $line");
+       if ($line =~ /NOTICE: pg_stop_backup complete, all required WAL segments have been archived/) {
+       } else {
+           $self->print_to_server("psql stderr: $line",
+                                  $Amanda::Script_App::GOOD);
+       }
+    });
+
+    close($wtr);
+    Amanda::MainLoop::run();
+    close($rdr);
+    close($err);
+
+    waitpid $pid, 0;
+    my $status = $?;
 
     $ENV{'PGPASSWORD'} = $orig_pgpassword || '';
     $ENV{'PGPASSFILE'} = $orig_pgpassfile || '';
 
-    return 0 == ($status >>8)
+    return 0 == ($status >> 8)
 }
 
 sub command_selfcheck {
index f4654bdb413b01f75783bac875be6339d304dfba..f05ac08f31ca70c0cf6a34f2a4afd47b81125e76 100644 (file)
@@ -102,6 +102,7 @@ sub new {
 #on exit:
 #  $self->{exclude}
 #  $self->{include}
+#  $self->{include_filename}
 sub validate_inexclude {
     my $self = shift;
 
@@ -128,22 +129,66 @@ sub validate_inexclude {
        }
        close(FF);
     }
-    if ($#{$self->{include_file}} >= 0) {
-       $self->{include} = [ @{$self->{include_file}} ];
-    }
-    foreach my $file (@{$self->{include_list}}) {
-       if (!open(FF, $file)) {
-           if ($self->{action} eq 'check' && !$self->{include_optional}) {
-               $self->print_to_server("Open of '$file' failed: $!",
-                                      $Amanda::Script_App::ERROR);
+
+    if ($self->{action} eq "restore" and defined $self->{'include_list'}) {
+       # put all include in a single file $self->{'include_filename'}
+       $self->{'include_filename'} = "$AMANDA_TMPDIR/amsamba.$$.include";
+       open INC_FILE, ">$self->{'include_filename'}";
+       if ($#{$self->{include_file}} >= 0) {
+           print INC_FILE "$self->{include_file}\n";
+       }
+       foreach my $file (@{$self->{include_list}}) {
+           if (!open(FF, $file)) {
+               if ($self->{action} eq 'check' && !$self->{include_optional}) {
+                   $self->print_to_server("Open of '$file' failed: $!",
+                                          $Amanda::Script_App::ERROR);
+               }
+               next;
            }
-           next;
+           while (<FF>) {
+               print INC_FILE;
+           }
+           close(FF);
        }
-       while (<FF>) {
-           chomp;
-           push @{$self->{include}}, $_;
+
+       # add command line include for amrestore
+       for(my $i=1;defined $ARGV[$i]; $i++) {
+           my $param = $ARGV[$i];
+           $param =~ /^(.*)$/;
+           print INC_FILE "$1\n";
+       }
+
+       close INC_FILE;
+    } else {
+       # put all include in $self->{'include'} they will be added on
+       # command line.
+       if ($#{$self->{include_file}} >= 0) {
+           $self->{include} = [ @{$self->{include_file}} ];
+       }
+
+       foreach my $file (@{$self->{include_list}}) {
+           if (!open(FF, $file)) {
+               if ($self->{action} eq 'check' && !$self->{include_optional}) {
+                   $self->print_to_server("Open of '$file' failed: $!",
+                                          $Amanda::Script_App::ERROR);
+               }
+               next;
+           }
+           while (<FF>) {
+               chomp;
+               push @{$self->{include}}, $_;
+           }
+           close(FF);
+       }
+
+       # add command line include for amrestore
+       if ($self->{action} eq "restore") {
+               for(my $i=1;defined $ARGV[$i]; $i++) {
+               my $param = $ARGV[$i];
+               $param =~ /^(.*)$/;
+               push @{$self->{include}}, $1;
+           }
        }
-       close(FF);
     }
 }
 
@@ -234,7 +279,7 @@ sub findpass {
             $diskname eq $self->{share} ||
             $diskname eq $self->{sambashare})) {
            if (defined $userpasswd && $userpasswd ne "") {
-               $self->{domain} = $domain if ($domain ne "");
+               $self->{domain} = $domain if defined $domain && $domain ne "";
                my ($username, $password) = split('%', $userpasswd, 2);
                $self->{username} = $username;
                $self->{password} = $password;
@@ -692,14 +737,18 @@ sub command_restore {
        if (defined $self->{domain}) {
            push @cmd, "-W", $self->{domain};
        }
-       push @cmd, "-Tx", "-";
-       if ($#{$self->{include}} >= 0) {
-           push @cmd, @{$self->{include}};
-        }
-       for(my $i=1;defined $ARGV[$i]; $i++) {
-           my $param = $ARGV[$i];
-           $param =~ /^(.*)$/;
-           push @cmd, $1;
+       if (defined $self->{'include_filename'}) {
+           push @cmd, "-TFx", "-", "$self->{'include_filename'}";
+       } else {
+           push @cmd, "-Tx", "-";
+           if ($#{$self->{include}} >= 0) {
+               push @cmd, @{$self->{include}};
+            }
+           for(my $i=1;defined $ARGV[$i]; $i++) {
+               my $param = $ARGV[$i];
+               $param =~ /^(.*)$/;
+               push @cmd, $1;
+           }
        }
        my ($parent_rdr, $child_wtr);
        if (defined $self->{password}) {
index bcd9988b267e68dd2ff3b3ce5f2a721f45e8fbda..c676b40498f7722bfac7fd987eef92895de4d73c 100644 (file)
@@ -40,7 +40,8 @@
  * IGNORE
  * STRANGE
  * INCLUDE-LIST                (for restore only)
- * EXCLUDE-LIST                (for restore only)
+ * EXCLUDE-FILE
+ * EXCLUDE-LIST
  * DIRECTORY
  */
 
@@ -131,6 +132,7 @@ static char *star_tardumps;
 static int   star_dle_tardumps;
 static int   star_onefilesystem;
 static int   star_sparse;
+static int   star_acl;
 static char *star_directory;
 static GSList *normal_message = NULL;
 static GSList *ignore_message = NULL;
@@ -159,6 +161,8 @@ static struct option long_options[] = {
     {"exclude-list"    , 1, NULL, 20},
     {"directory"       , 1, NULL, 21},
     {"command-options" , 1, NULL, 22},
+    {"exclude-file"    , 1, NULL, 23},
+    {"acl"             , 1, NULL, 24},
     { NULL, 0, NULL, 0}
 };
 
@@ -181,6 +185,7 @@ main(
     star_dle_tardumps = 0;
     star_onefilesystem = 1;
     star_sparse = 1;
+    star_acl = 1;
     star_directory = NULL;
 
     /* initialize */
@@ -320,6 +325,17 @@ main(
        case 22: argument.command_options =
                        g_slist_append(argument.command_options,
                                       stralloc(optarg));
+       case 23: if (optarg)
+                    argument.dle.exclude_file =
+                        append_sl(argument.dle.exclude_file, optarg);
+                break;
+       case 24: if (optarg && strcasecmp(optarg, "NO") == 0)
+                    star_acl = 0;
+                else if (optarg && strcasecmp(optarg, "YES") == 0)
+                    star_acl = 1;
+                else if (strcasecmp(command, "selfcheck") == 0)
+                    printf(_("ERROR [%s: bad ACL property value (%s)]\n"), get_pname(), optarg);
+                break;
        case ':':
        case '?':
                break;
@@ -417,10 +433,6 @@ amstar_selfcheck(
        argument->dle.include_list->nb_element >= 0) {
        fprintf(stdout, "ERROR include-list not supported for backup\n");
     }
-    if (argument->dle.exclude_list &&
-       argument->dle.exclude_list->nb_element >= 0) {
-       fprintf(stdout, "ERROR exclude-list not supported for backup\n");
-    }
 
     if (!star_path) {
        fprintf(stdout, "ERROR STAR-PATH not defined\n");
@@ -486,10 +498,6 @@ amstar_estimate(
        argument->dle.include_list->nb_element >= 0) {
        fprintf(stderr, "ERROR include-list not supported for backup\n");
     }
-    if (argument->dle.exclude_list &&
-       argument->dle.exclude_list->nb_element >= 0) {
-       fprintf(stderr, "ERROR exclude-list not supported for backup\n");
-    }
 
     if (check_device(argument) == 0) {
        return;
@@ -500,9 +508,9 @@ amstar_estimate(
        char *dirname;
 
        if (star_directory) {
-           dirname = amname_to_dirname(star_directory);
+           dirname = star_directory;
        } else {
-           dirname = amname_to_dirname(argument->dle.device);
+           dirname = argument->dle.device;
        }
        run_calcsize(argument->config, "STAR", argument->dle.disk, dirname,
                     argument->level, NULL, NULL);
@@ -675,10 +683,6 @@ amstar_backup(
        argument->dle.include_list->nb_element >= 0) {
        fprintf(mesgstream, "? include-list not supported for backup\n");
     }
-    if (argument->dle.exclude_list &&
-       argument->dle.exclude_list->nb_element >= 0) {
-       fprintf(mesgstream, "? exclude-list not supported for backup\n");
-    }
 
     level = GPOINTER_TO_INT(argument->level->data);
 
@@ -750,7 +754,7 @@ amstar_backup(
            }
        }
        if (rp->typ == DMP_SIZE) {
-           dump_size = (long)((the_num(line, rp->field)* rp->scale+1023.0)/1024.0);
+           dump_size = (off_t)((the_num(line, rp->field)* rp->scale+1023.0)/1024.0);
        }
        switch (rp->typ) {
            case DMP_IGNORE:
@@ -855,12 +859,23 @@ amstar_restore(
 
     if (argument->dle.include_list &&
        argument->dle.include_list->nb_element == 1) {
-       g_ptr_array_add(argv_ptr,
-                       stralloc2("list=",
-                                 argument->dle.include_list->first->name));
+       FILE *include_list = fopen(argument->dle.include_list->first->name, "r");
+       char  line[2*PATH_MAX+2];
+       while (fgets(line, 2*PATH_MAX, include_list)) {
+           line[strlen(line)-1] = '\0'; /* remove '\n' */
+           if (strncmp(line, "./", 2) == 0)
+               g_ptr_array_add(argv_ptr, stralloc(line+2)); /* remove ./ */
+           else if (strcmp(line, ".") != 0)
+               g_ptr_array_add(argv_ptr, stralloc(line));
+       }
+       fclose(include_list);
+    }
+    for (j=1; j< argument->argc; j++) {
+       if (strncmp(argument->argv[j], "./", 2) == 0)
+           g_ptr_array_add(argv_ptr, stralloc(argument->argv[j]+2));/*remove ./ */
+       else if (strcmp(argument->argv[j], ".") != 0)
+           g_ptr_array_add(argv_ptr, stralloc(argument->argv[j]));
     }
-    for (j=1; j< argument->argc; j++)
-       g_ptr_array_add(argv_ptr, stralloc(argument->argv[j]+2));/*remove ./ */
     g_ptr_array_add(argv_ptr, NULL);
 
     debug_executing(argv_ptr);
@@ -922,9 +937,9 @@ static GPtrArray *amstar_build_argv(
     GSList    *copt;
 
     if (star_directory) {
-       dirname = amname_to_dirname(star_directory);
+       dirname = star_directory;
     } else {
-       dirname = amname_to_dirname(argument->dle.device);
+       dirname = argument->dle.device;
     }
     fsname = vstralloc("fs-name=", dirname, NULL);
     for (s = fsname; *s != '\0'; s++) {
@@ -951,6 +966,7 @@ static GPtrArray *amstar_build_argv(
        g_ptr_array_add(argv_ptr, stralloc("-"));
     }
     g_ptr_array_add(argv_ptr, stralloc("-C"));
+
 #if defined(__CYGWIN__)
     {
        char tmppath[PATH_MAX];
@@ -969,8 +985,10 @@ static GPtrArray *amstar_build_argv(
     g_ptr_array_add(argv_ptr, stralloc2("tardumps=", tardumpfile));
     if (command == CMD_BACKUP)
        g_ptr_array_add(argv_ptr, stralloc("-wtardumps"));
+
     g_ptr_array_add(argv_ptr, stralloc("-xattr"));
-    g_ptr_array_add(argv_ptr, stralloc("-acl"));
+    if (star_acl)
+       g_ptr_array_add(argv_ptr, stralloc("-acl"));
     g_ptr_array_add(argv_ptr, stralloc("H=exustar"));
     g_ptr_array_add(argv_ptr, stralloc("errctl=WARN|SAMEFILE|DIFF|GROW|SHRINK|SPECIALFILE|GETXATTR|BADACL *"));
     if (star_sparse)
@@ -984,13 +1002,60 @@ static GPtrArray *amstar_build_argv(
     if (command == CMD_BACKUP && argument->dle.create_index)
        g_ptr_array_add(argv_ptr, stralloc("-v"));
 
+    if ((argument->dle.exclude_file &&
+        argument->dle.exclude_file->nb_element >= 1) ||
+       (argument->dle.exclude_list &&
+        argument->dle.exclude_list->nb_element >= 1)) {
+       g_ptr_array_add(argv_ptr, stralloc("-match-tree"));
+       g_ptr_array_add(argv_ptr, stralloc("-not"));
+    }
+    if (argument->dle.exclude_file &&
+       argument->dle.exclude_file->nb_element >= 1) {
+       sle_t *excl;
+       for (excl = argument->dle.exclude_file->first; excl != NULL;
+            excl = excl->next) {
+           char *ex;
+           if (strcmp(excl->name, "./") == 0) {
+               ex = g_strdup_printf("pat=%s", excl->name+2);
+           } else {
+               ex = g_strdup_printf("pat=%s", excl->name);
+           }
+           g_ptr_array_add(argv_ptr, ex);
+       }
+    }
+    if (argument->dle.exclude_list &&
+       argument->dle.exclude_list->nb_element >= 1) {
+       sle_t *excl;
+       for (excl = argument->dle.exclude_list->first; excl != NULL;
+            excl = excl->next) {
+           char *exclname = fixup_relative(excl->name, argument->dle.device);
+           FILE *exclude;
+           char *aexc;
+           if ((exclude = fopen(exclname, "r")) != NULL) {
+               while ((aexc = agets(exclude)) != NULL) {
+                   if (aexc[0] != '\0') {
+                       char *ex;
+                       if (strcmp(aexc, "./") == 0) {
+                           ex = g_strdup_printf("pat=%s", aexc+2);
+                       } else {
+                           ex = g_strdup_printf("pat=%s", aexc);
+                       }
+                       g_ptr_array_add(argv_ptr, ex);
+                   }
+                   amfree(aexc);
+               }
+               fclose(exclude);
+           }
+           amfree(exclname);
+       }
+    }
+
     g_ptr_array_add(argv_ptr, stralloc("."));
 
     g_ptr_array_add(argv_ptr, NULL);
 
     amfree(tardumpfile);
     amfree(fsname);
-    amfree(dirname);
 
     return(argv_ptr);
 }
index a2747572a367407b45ed096e52d926c07935fde7..ad32c160278e08befe62448941d765853bb8fb0f 100755 (executable)
@@ -39,10 +39,13 @@ use Amanda::Util qw( :constants );
 
 sub new {
     my $class = shift;
-    my ($config, $host, $disk, $device, $level, $index, $message, $collection, $record, $exclude_list, $exclude_optional,  $include_list, $include_optional, $bsize, $ext_attrib, $ext_header, $ignore, $normal, $strange, $error_exp, $directory) = @_;
+    my ($config, $host, $disk, $device, $level, $index, $message, $collection, $record, $exclude_list, $exclude_optional,  $include_list, $include_optional, $bsize, $ext_attrib, $ext_header, $ignore, $normal, $strange, $error_exp, $directory, $suntar_path) = @_;
     my $self = $class->SUPER::new($config);
 
-    $self->{suntar}            = "/usr/sbin/tar";
+    $self->{suntar}            = $Amanda::Constants::SUNTAR;
+    if (defined $suntar_path) {
+       $self->{suntar}        = $suntar_path;
+    }
     $self->{pfexec}            = "/usr/bin/pfexec";
     $self->{gnutar}            = $Amanda::Constants::GNUTAR;
     $self->{teecount}          = $Amanda::Paths::amlibexecdir."/teecount";
@@ -577,6 +580,7 @@ my @opt_strange;
 my @opt_error;
 my $opt_lang;
 my $opt_directory;
+my $opt_suntar_path;
 
 Getopt::Long::Configure(qw{bundling});
 GetOptions(
@@ -602,12 +606,13 @@ GetOptions(
     'error=s'                => \@opt_error,
     'lang=s'                 => \$opt_lang,
     'directory=s'            => \$opt_directory,
+    'suntar-path=s'          => \$opt_suntar_path,
 ) or usage();
 
 if (defined $opt_lang) {
     $ENV{LANG} = $opt_lang;
 }
 
-my $application = Amanda::Application::Amsuntar->new($opt_config, $opt_host, $opt_disk, $opt_device, $opt_level, $opt_index, $opt_message, $opt_collection, $opt_record, \@opt_exclude_list, $opt_exclude_optional, \@opt_include_list, $opt_include_optional,$opt_bsize,$opt_ext_attrib,$opt_ext_head, \@opt_ignore, \@opt_normal, \@opt_strange, \@opt_error, $opt_directory);
+my $application = Amanda::Application::Amsuntar->new($opt_config, $opt_host, $opt_disk, $opt_device, $opt_level, $opt_index, $opt_message, $opt_collection, $opt_record, \@opt_exclude_list, $opt_exclude_optional, \@opt_include_list, $opt_include_optional,$opt_bsize,$opt_ext_attrib,$opt_ext_head, \@opt_ignore, \@opt_normal, \@opt_strange, \@opt_error, $opt_directory, $opt_suntar_path);
 
 $application->do($ARGV[0]);
index 9d740cb8a7d4a0c4b34b4c565a6c2a85763da67c..cd009933324264d2d8ecdbdb30ad0aaa5cf6a15e 100644 (file)
@@ -90,7 +90,7 @@ sub command_support {
    print "HOST YES\n";
    print "DISK YES\n";
    print "MAX-LEVEL 9\n";
-   print "INDEX-LINE NO\n";
+   print "INDEX-LINE YES\n";
    print "INDEX-XML NO\n";
    print "MESSAGE-LINE YES\n";
    print "MESSAGE-XML NO\n";
@@ -191,7 +191,7 @@ sub command_backup {
       my $refsnapshotname = $self->zfs_find_snapshot_level($level-1);
       debug "Referenced snapshot name: $refsnapshotname|";
       if ($refsnapshotname ne "") {
-        $cmd = "$self->{pfexec_cmd} $self->{zfs_path} send -i $refsnapshotname $self->{filesystem}\@$self->{snapshot} | $Amanda::Paths::amlibexecdir/teecount";
+        $cmd = "$self->{pfexec_cmd} $self->{zfs_path} send -i $self->{filesystem}\@$refsnapshotname $self->{filesystem}\@$self->{snapshot} | $Amanda::Paths::amlibexecdir/teecount";
       } else {
         $self->print_to_server_and_die("cannot backup snapshot '$self->{filesystem}\@$self->{snapshot}': reference snapshot doesn't exists for level $level", $Amanda::Script_App::ERROR);
       }
@@ -203,6 +203,16 @@ sub command_backup {
     $err = Symbol::gensym;
     $pid = open3($wtr, '>&STDOUT', $err, $cmd);
     close $wtr;
+
+    if (defined($self->{index})) {
+       my $indexout;
+       open($indexout, '>&=4') ||
+       $self->print_to_server_and_die("Can't open indexout: $!",
+                                      $Amanda::Script_App::ERROR);
+       print $indexout "/\n";
+       close($indexout);
+    }
+
     $errmsg = <$err>;
     waitpid $pid, 0;
     close $err;
@@ -321,11 +331,40 @@ sub command_index_from_output {
 sub command_index_from_image {
 }
 
-#sub command_restore {
-#    my $self = shift;
-#
-#TODO
-#}
+sub command_restore {
+    my $self = shift;
+
+    my $level = $self->{level}[0];
+    my $device = $self->{device};
+    $device = $self->{directory} if defined $self->{directory};
+    $device =~ s,^/,,;
+    my $current_snapshot = $self->zfs_build_snapshotname($device);
+    $self->{'snapshot'} = $self->zfs_build_snapshotname($device, $level);
+
+    my @cmd = ();
+
+    if ($self->{pfexec_cmd}) {
+       push @cmd, $self->{pfexec_cmd};
+    }
+    push @cmd, $self->{zfs_path};
+    push @cmd, "recv";
+    push @cmd, $device;
+
+    debug("cmd:" . join(" ", @cmd));
+    system @cmd;
+
+    @cmd = ();
+    if ($self->{pfexec_cmd}) {
+       push @cmd, $self->{pfexec_cmd};
+    }
+    push @cmd, $self->{zfs_path};
+    push @cmd, "rename";
+    push @cmd, "$device\@$current_snapshot";
+    push @cmd, "$device\@$self->{'snapshot'}";
+
+    debug("cmd:" . join(" ", @cmd));
+    system @cmd;
+}
 
 sub command_print_command {
 }
index 39e7faa7853369ec4fdb680e2514b46fcab53f83..ce62866a86d935d0c43a8e942c9f53ed866e84b7 100644 (file)
@@ -197,6 +197,7 @@ am__aclocal_m4_deps =  \
        $(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/as_needed.m4 \
        $(top_srcdir)/config/amanda/bsd-security.m4 \
        $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
        $(top_srcdir)/config/amanda/bsdudp-security.m4 \
@@ -391,6 +392,7 @@ APPLICATION_DIR = @APPLICATION_DIR@
 AR = @AR@
 ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
 ASSERTIONS = @ASSERTIONS@
+AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -864,6 +866,7 @@ LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
 MKDIR_P = @MKDIR_P@
+MOUNT = @MOUNT@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
@@ -1061,6 +1064,7 @@ STDBOOL_H = @STDBOOL_H@
 STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
+SUNTAR = @SUNTAR@
 SVN = @SVN@
 SWIG = @SWIG@
 SWIG_LIB = @SWIG_LIB@
@@ -1068,6 +1072,7 @@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TCPPORTRANGE = @TCPPORTRANGE@
 TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
 UDPPORTRANGE = @UDPPORTRANGE@
+UMOUNT = @UMOUNT@
 UNCOMPRESS_OPT = @UNCOMPRESS_OPT@
 UNCOMPRESS_PATH = @UNCOMPRESS_PATH@
 UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
index e7dea7ba74113e894d721fddda44c10bc246aa17..e595b4d1aa6712131ccd1541b4bfc7bee5c1ee1e 100644 (file)
@@ -11,7 +11,7 @@ INCLUDES =    -I$(top_builddir)/common-src \
                -I$(top_srcdir)/gnulib
 
 AM_CFLAGS = $(AMANDA_WARNING_CFLAGS)
-AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
+AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS) $(AS_NEEDED_FLAGS)
 
 LINT=$(AMLINT)
 LINTFLAGS=$(AMLINTFLAGS)
@@ -20,10 +20,14 @@ amlib_LTLIBRARIES = libamclient.la
 
 amlibexec_PROGRAMS =   noop calcsize killpgrp rundump runtar selfcheck sendbackup sendsize
 
-amlibexec_SCRIPTS = patch-system
+amlibexec_SCRIPTS_SHELL = patch-system
 
-SCRIPTS_PERL = $(sbin_SCRIPTS)
-SCRIPTS_SHELL = $(amlibexec_SCRIPTS)
+sbin_SCRIPTS_PERL = amdump_client
+
+SCRIPTS_PERL = $(sbin_SCRIPTS_PERL)
+SCRIPTS_SHELL = $(amlibexec_SCRIPTS_SHELL)
+sbin_SCRIPTS = $(sbin_SCRIPTS_PERL)
+amlibexec_SCRIPTS = $(amlibexec_SCRIPTS_SHELL)
 
 libamclient_la_SOURCES=        amandates.c             getfsent.c      \
                        unctime.c               client_util.c
@@ -31,7 +35,7 @@ if WANT_SAMBA
 libamclient_la_SOURCES += findpass.c
 endif
 
-libamclient_la_LDFLAGS = -release $(VERSION)
+libamclient_la_LDFLAGS = -release $(VERSION) $(AS_NEEDED_FLAGS)
 libamclient_la_LIBADD  = ../common-src/libamanda.la
 
 ###
index 1c3aceef2616c41dbe18698a9be2d6da77a2d8ed..a3852887e8995f8618b28f3d97725f06204bc068 100644 (file)
@@ -208,6 +208,7 @@ am__aclocal_m4_deps =  \
        $(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/as_needed.m4 \
        $(top_srcdir)/config/amanda/bsd-security.m4 \
        $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
        $(top_srcdir)/config/amanda/bsdudp-security.m4 \
@@ -373,7 +374,7 @@ am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
 am__installdirs = "$(DESTDIR)$(amlibdir)" "$(DESTDIR)$(amlibexecdir)" \
-       "$(DESTDIR)$(amlibexecdir)"
+       "$(DESTDIR)$(amlibexecdir)" "$(DESTDIR)$(sbindir)"
 LTLIBRARIES = $(amlib_LTLIBRARIES)
 libamclient_la_DEPENDENCIES = ../common-src/libamanda.la
 am__libamclient_la_SOURCES_DIST = amandates.c getfsent.c unctime.c \
@@ -442,7 +443,7 @@ sendsize_LDADD = $(LDADD)
 sendsize_DEPENDENCIES = ../common-src/libamanda.la libamclient.la \
        ../amandad-src/libamandad.la ../common-src/libamanda.la \
        ../gnulib/libgnu.la
-SCRIPTS = $(amlibexec_SCRIPTS)
+SCRIPTS = $(amlibexec_SCRIPTS) $(sbin_SCRIPTS)
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/config
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
 am__depfiles_maybe = depfiles
@@ -489,6 +490,7 @@ APPLICATION_DIR = @APPLICATION_DIR@
 AR = @AR@
 ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
 ASSERTIONS = @ASSERTIONS@
+AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -962,6 +964,7 @@ LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
 MKDIR_P = @MKDIR_P@
+MOUNT = @MOUNT@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
@@ -1159,6 +1162,7 @@ STDBOOL_H = @STDBOOL_H@
 STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
+SUNTAR = @SUNTAR@
 SVN = @SVN@
 SWIG = @SWIG@
 SWIG_LIB = @SWIG_LIB@
@@ -1166,6 +1170,7 @@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TCPPORTRANGE = @TCPPORTRANGE@
 TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
 UDPPORTRANGE = @UDPPORTRANGE@
+UMOUNT = @UMOUNT@
 UNCOMPRESS_OPT = @UNCOMPRESS_OPT@
 UNCOMPRESS_PATH = @UNCOMPRESS_PATH@
 UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
@@ -1311,16 +1316,19 @@ INCLUDES = -I$(top_builddir)/common-src \
                -I$(top_srcdir)/gnulib
 
 AM_CFLAGS = $(AMANDA_WARNING_CFLAGS)
-AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
+AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS) $(AS_NEEDED_FLAGS)
 LINT = $(AMLINT)
 LINTFLAGS = $(AMLINTFLAGS)
 amlib_LTLIBRARIES = libamclient.la
-amlibexec_SCRIPTS = patch-system
-SCRIPTS_PERL = $(sbin_SCRIPTS)
-SCRIPTS_SHELL = $(amlibexec_SCRIPTS)
+amlibexec_SCRIPTS_SHELL = patch-system
+sbin_SCRIPTS_PERL = amdump_client
+SCRIPTS_PERL = $(sbin_SCRIPTS_PERL)
+SCRIPTS_SHELL = $(amlibexec_SCRIPTS_SHELL)
+sbin_SCRIPTS = $(sbin_SCRIPTS_PERL)
+amlibexec_SCRIPTS = $(amlibexec_SCRIPTS_SHELL)
 libamclient_la_SOURCES = amandates.c getfsent.c unctime.c \
        client_util.c $(am__append_2)
-libamclient_la_LDFLAGS = -release $(VERSION)
+libamclient_la_LDFLAGS = -release $(VERSION) $(AS_NEEDED_FLAGS)
 libamclient_la_LIBADD = ../common-src/libamanda.la
 
 ###
@@ -1520,6 +1528,40 @@ uninstall-amlibexecSCRIPTS:
        test -n "$$list" || exit 0; \
        echo " ( cd '$(DESTDIR)$(amlibexecdir)' && rm -f" $$files ")"; \
        cd "$(DESTDIR)$(amlibexecdir)" && rm -f $$files
+install-sbinSCRIPTS: $(sbin_SCRIPTS)
+       @$(NORMAL_INSTALL)
+       test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
+       @list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || list=; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+       done | \
+       sed -e 'p;s,.*/,,;n' \
+           -e 'h;s|.*|.|' \
+           -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+       $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+         { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+           if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+             if (++n[d] == $(am__install_max)) { \
+               print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+           else { print "f", d "/" $$4, $$1 } } \
+         END { for (d in files) print "f", d, files[d] }' | \
+       while read type dir files; do \
+            if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+            test -z "$$files" || { \
+              echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
+              $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
+            } \
+       ; done
+
+uninstall-sbinSCRIPTS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(sbin_SCRIPTS)'; test -n "$(sbindir)" || exit 0; \
+       files=`for p in $$list; do echo "$$p"; done | \
+              sed -e 's,.*/,,;$(transform)'`; \
+       test -n "$$list" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(sbindir)" && rm -f $$files
 
 mostlyclean-compile:
        -rm -f *.$(OBJEXT)
@@ -1663,7 +1705,7 @@ check: $(BUILT_SOURCES)
        $(MAKE) $(AM_MAKEFLAGS) check-am
 all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) $(HEADERS)
 installdirs:
-       for dir in "$(DESTDIR)$(amlibdir)" "$(DESTDIR)$(amlibexecdir)" "$(DESTDIR)$(amlibexecdir)"; do \
+       for dir in "$(DESTDIR)$(amlibdir)" "$(DESTDIR)$(amlibexecdir)" "$(DESTDIR)$(amlibexecdir)" "$(DESTDIR)$(sbindir)"; do \
          test -z "$$dir" || $(MKDIR_P) "$$dir"; \
        done
 install: $(BUILT_SOURCES)
@@ -1727,7 +1769,8 @@ install-dvi: install-dvi-am
 
 install-dvi-am:
 
-install-exec-am: install-amlibexecPROGRAMS install-amlibexecSCRIPTS
+install-exec-am: install-amlibexecPROGRAMS install-amlibexecSCRIPTS \
+       install-sbinSCRIPTS
        @$(NORMAL_INSTALL)
        $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
 install-html: install-html-am
@@ -1769,7 +1812,7 @@ ps: ps-am
 ps-am:
 
 uninstall-am: uninstall-amlibLTLIBRARIES uninstall-amlibexecPROGRAMS \
-       uninstall-amlibexecSCRIPTS
+       uninstall-amlibexecSCRIPTS uninstall-sbinSCRIPTS
 
 .MAKE: all check check-am install install-am install-data-am \
        install-exec-am install-strip
@@ -1784,12 +1827,13 @@ uninstall-am: uninstall-amlibLTLIBRARIES uninstall-amlibexecPROGRAMS \
        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 uninstall-amlibexecSCRIPTS
+       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
diff --git a/client-src/amdump_client.pl b/client-src/amdump_client.pl
new file mode 100644 (file)
index 0000000..672c259
--- /dev/null
@@ -0,0 +1,171 @@
+#! @PERL@
+# Copyright (c) 2010 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., 465 S. Mathilda Ave., Suite 300
+# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
+
+use lib '@amperldir@';
+use strict;
+use warnings;
+
+use Getopt::Long;
+use Symbol;
+use IPC::Open3;
+
+use Amanda::Util qw( :constants );
+use Amanda::Config qw( :init :getconf );
+use Amanda::Paths;
+use Amanda::Logfile qw( log_rename get_current_log_timestamp $amanda_log_trace_log );
+use Amanda::Debug qw( debug );
+
+Amanda::Util::setup_application("amdump_client", "client", $CONTEXT_CMDLINE);
+
+my $config;
+my $config_overrides = new_config_overrides($#ARGV+1);
+Getopt::Long::Configure(qw{bundling});
+GetOptions(
+    'config=s' => sub { $config = $_[1]; },
+    'o=s' => sub { add_config_override_opt($config_overrides, $_[1]); },
+) or usage();
+
+if (@ARGV < 1) {
+    die "USAGE: amdump_client [--config <config>] <config-overwrites> [list|dump|check] <diskname>";
+}
+
+my $cmd = $ARGV[0];
+
+set_config_overrides($config_overrides);
+config_init($CONFIG_INIT_CLIENT, undef);
+$config = getconf($CNF_CONF) if !defined $config;
+print "config: $config\n";
+config_init($CONFIG_INIT_CLIENT | $CONFIG_INIT_EXPLICIT_NAME | $CONFIG_INIT_OVERLAY, $config);
+my ($cfgerr_level, @cfgerr_errors) = config_errors();
+if ($cfgerr_level >= $CFGERR_WARNINGS) {
+    config_print_errors();
+    if ($cfgerr_level >= $CFGERR_ERRORS) {
+        die "Errors processing config file";
+    }
+}
+
+#Amanda::Debug::add_amanda_log_handler($amanda_log_trace_log);
+
+Amanda::Util::finish_setup($RUNNING_AS_DUMPUSER);
+
+my $amservice = $sbindir . '/amservice';
+my $amdump_server = getconf($CNF_AMDUMP_SERVER);
+my $auth = getconf($CNF_AUTH);
+
+my @cmd = ($amservice, '-f', '/dev/null', '-s', $amdump_server, $auth, 'amdumpd');
+
+debug("cmd: @cmd");
+my $amservice_out;
+my $amservice_in;
+my $err = Symbol::gensym;
+my $pid = open3($amservice_in, $amservice_out, $err, @cmd);
+my @disks;
+
+debug("send: CONFIG $config");
+print {$amservice_in} "CONFIG $config\n";
+if ($cmd eq 'list') {
+    debug("send: LIST");
+    print {$amservice_in} "LIST\n";
+    get_list(1);
+} elsif ($cmd eq 'dump') {
+    # check if diskname on the command line
+    if ($ARGV[1]) {
+       # get the list of dle
+       debug ("send: LIST");
+       print {$amservice_in} "LIST\n";
+       get_list(0);
+
+        #find the diskname that match
+       for (my $i=1; $i <= $#ARGV; $i++) {
+           for my $diskname (@disks) {
+               if (Amanda::Logfile::match_disk($ARGV[$i], $diskname)) {
+                   debug("send: DISK " . Amanda::Util::quote_string($diskname));
+                   print {$amservice_in} "DISK " . Amanda::Util::quote_string($diskname) . "\n";
+                   my $a = <$amservice_out>;
+                   print if ($a != /^DISK /)
+               }
+           }
+       }
+    }
+    debug("send: DUMP");
+    print {$amservice_in} "DUMP\n";
+    get_server_data();
+} elsif ($cmd eq 'check') {
+    # check if diskname on the command line
+    if ($ARGV[1]) {
+       # get the list of dle
+       debug ("send: LIST");
+       print {$amservice_in} "LIST\n";
+       get_list(0);
+
+        #find the diskname that match
+       for (my $i=1; $i <= $#ARGV; $i++) {
+           for my $diskname (@disks) {
+               if (Amanda::Logfile::match_disk($ARGV[$i], $diskname)) {
+                   debug("send: DISK " . Amanda::Util::quote_string($diskname));
+                   print {$amservice_in} "DISK " . Amanda::Util::quote_string($diskname) . "\n";
+                   my $a = <$amservice_out>;
+                   print if ($a != /^DISK /)
+               }
+           }
+       }
+    }
+    debug("send: CHECK");
+    print {$amservice_in} "CHECK\n";
+    get_server_data();
+} else {
+    usage();
+}
+debug("send: END");
+print {$amservice_in} "END\n";
+
+sub get_list {
+    my $verbose = shift;
+
+    while (<$amservice_out>) {
+       return if /^CONFIG/;
+       return if /^ENDLIST/;
+       print if $verbose;
+       chomp;
+       push @disks, Amanda::Util::unquote_string($_);
+    }
+}
+
+sub get_server_data {
+    while (<$amservice_out>) {
+       if (/^ENDDUMP/) {
+           print "The backup is finished\n";
+           return;
+       }
+       if (/^ENDCHECK/) {
+           print "The check is finished\n";
+           return;
+       }
+       print;
+       return if /^CONFIG/;
+       return if /^BUSY/;
+    }
+}
+
+sub usage {
+    print STDERR "USAGE: amdump_client [--config <config>] <config-overwrites> [list|dump|check] <diskname>";
+}
+
+Amanda::Util::finish_application();
+exit;
index d7387e852b4ebf84f4f66474db6a53539ac27fb9..89365ce44aab90e3a69c312f5615f227885396cb 100644 (file)
@@ -440,9 +440,9 @@ build_include(
        
     if (nb_exp == 0) {
        quoted = quote_string(dle->disk);
-       dbprintf(_("No include for %s\n"), quoted);
+       dbprintf(_("Nothing found to include for disk %s\n"), quoted);
        if (verbose && dle->include_optional == 0) {
-           g_printf(_("ERROR [No include for %s]\n"), quoted);
+           g_printf(_("ERROR [Nothing found to include for disk %s]\n"), quoted);
        }
        amfree(quoted);
     }
@@ -717,6 +717,174 @@ application_property_add_to_argv(
     return;
 }
 
+typedef struct {
+    dle_t *dle;
+    char *name;
+    proplist_t dle_proplist;
+    int verbose;
+    int good;
+} merge_property_t;
+
+static void
+merge_property(
+    gpointer key_p,
+    gpointer value_p,
+    gpointer user_data_p)
+{
+    char *property_s = key_p;
+    property_t *conf_property = value_p;
+    merge_property_t *merge_p = user_data_p;
+    property_t *dle_property = g_hash_table_lookup(merge_p->dle_proplist,
+                                                  property_s);
+    GSList *value;
+    char *qdisk = quote_string(merge_p->dle->disk);
+
+    if (dle_property) {
+       if (dle_property->priority && conf_property->priority) {
+           if (merge_p->verbose) {
+               g_fprintf(stdout,
+                        _("ERROR %s (%s) Both server client have priority for property '%s'.\n"),
+                        qdisk, merge_p->name, property_s);
+           }
+           g_debug("ERROR %s (%s) Both server client have priority for property '%s'.", qdisk, merge_p->name, property_s);
+           merge_p->good = 0;
+           /* Use client property */
+           g_hash_table_remove(merge_p->dle_proplist, key_p);
+            g_hash_table_insert(merge_p->dle_proplist, key_p, conf_property);
+       } else if (dle_property->priority) {
+           if (merge_p->verbose) {
+               g_fprintf(stdout,
+                        _("ERROR %s (%s) Server set priority for property '%s' but client set the property.\n"),
+                        qdisk, merge_p->name, property_s);
+           }
+           g_debug("%s (%s) Server set priority for property '%s' but client set the property.", qdisk, merge_p->name, property_s);
+           /* use server property */
+       } else if (conf_property->priority) {
+           if (merge_p->verbose) {
+               g_fprintf(stdout,
+                        _("ERROR %s (%s) Client set priority for property '%s' but server set the property.\n"),
+                        qdisk, merge_p->name, property_s);
+           }
+           g_debug("%s (%s) Client set priority for property '%s' but server set the property.", qdisk, merge_p->name, property_s);
+           /* Use client property */
+           g_hash_table_remove(merge_p->dle_proplist, key_p);
+            g_hash_table_insert(merge_p->dle_proplist, key_p, conf_property);
+       } else if (!conf_property->append) {
+           if (merge_p->verbose) {
+               g_fprintf(stdout,
+                        _("ERROR %s (%s) Both server and client set property '%s', using client value.\n"),
+                        qdisk, merge_p->name, property_s);
+           }
+           g_debug("%s (%s) Both server and client set property '%s', using client value.", qdisk, merge_p->name, property_s);
+           /* Use client property */
+           g_hash_table_remove(merge_p->dle_proplist, key_p);
+            g_hash_table_insert(merge_p->dle_proplist, key_p, conf_property);
+       } else { /* merge */
+           for (value = conf_property->values; value != NULL;
+                value = value->next) {
+               dle_property->values = g_slist_append(dle_property->values,
+                                                     value->data);
+           }
+       }
+    } else { /* take value from conf */
+        g_hash_table_insert(merge_p->dle_proplist, key_p, conf_property);
+    }
+}
+
+int
+merge_properties(
+    dle_t      *dle,
+    char       *name,
+    proplist_t  dle_proplist,
+    proplist_t  conf_proplist,
+    int         verbose)
+{
+    merge_property_t merge_p = {dle, name, dle_proplist, verbose, 1};
+
+    if (conf_proplist != NULL) {
+       g_hash_table_foreach(conf_proplist,
+                             &merge_property,
+                             &merge_p);
+    }
+
+    return merge_p.good;
+}
+
+int
+merge_dles_properties(
+    dle_t *dles,
+    int verbose)
+{
+    dle_t         *dle;
+    application_t *app;
+    GSList        *scriptlist;
+    pp_script_t   *pp_script;
+    int            good = 1;
+
+    for (dle=dles; dle != NULL; dle=dle->next) {
+        if (dle->program_is_application_api) {
+           app = NULL;
+           if (dle->application_client_name &&
+               strlen(dle->application_client_name) > 0) {
+               app = lookup_application(dle->application_client_name);
+               if (!app) {
+                   char *qamname = quote_string(dle->disk);
+                   char *errmsg = vstrallocf("Application '%s' not found on client",
+                                             dle->application_client_name);
+                   char *qerrmsg = quote_string(errmsg);
+                   good = 0;
+                   if (verbose) {
+                       g_fprintf(stdout, _("ERROR %s %s\n"), qamname, qerrmsg);
+                   }
+                   g_debug("%s: %s", qamname, qerrmsg);
+                   amfree(qamname);
+                   amfree(errmsg);
+                   amfree(qerrmsg);
+               }
+           } else {
+               app = lookup_application(dle->program);
+           }
+            if (app) {
+                merge_properties(dle, dle->program,
+                                dle->application_property,
+                                application_get_property(app),
+                                verbose);
+            }
+        }
+        for (scriptlist = dle->scriptlist; scriptlist != NULL;
+             scriptlist = scriptlist->next) {
+            script_t *script =  scriptlist->data;
+           pp_script = NULL;
+           if (script->client_name && strlen(script->client_name) > 0) {
+               pp_script = lookup_pp_script(script->client_name);
+               if (!pp_script) {
+                   char *qamname = quote_string(dle->disk);
+                   char *errmsg = vstrallocf("Script '%s' not found on client",
+                                             script->client_name);
+                   char *qerrmsg = quote_string(errmsg);
+                   good = 0;
+                   if (verbose) {
+                       g_fprintf(stderr, _("ERROR %s %s\n"), qamname, qerrmsg);
+                   }
+                   g_debug("%s: %s", qamname, qerrmsg);
+                   amfree(qamname);
+                   amfree(errmsg);
+                   amfree(qerrmsg);
+               }
+           } else {
+               pp_script = lookup_pp_script(script->plugin);
+           }
+            if (pp_script) {
+               merge_properties(dle, script->plugin,
+                                script->property,
+                                pp_script_get_property(pp_script),
+                                verbose);
+           }
+        }
+    }
+    return good;
+}
+
 backup_support_option_t *
 backup_support_option(
     char       *program,
@@ -1680,39 +1848,3 @@ build_re_table(
     return new_re_table;
 }
 
-typedef struct {
-    proplist_t result;
-} merge_property_t;
-
-static void
-merge_property(
-    gpointer key_p,
-    gpointer value_p,
-    gpointer user_data_p)
-{
-    char *property_s = key_p;
-    GSList *value_s = value_p;
-    merge_property_t *merge_p = user_data_p;
-    GSList *value = g_hash_table_lookup(merge_p->result, property_s);
-
-    if (value) { /* remove old value */
-       g_hash_table_remove(merge_p->result, key_p);
-    }
-    g_hash_table_insert(merge_p->result, key_p, value_s);
-}
-
-void
-merge_properties(
-    proplist_t proplist1,
-    proplist_t proplist2)
-{
-    merge_property_t merge_p = {proplist1};
-
-    if (proplist2 == NULL) {
-       return;
-    }
-    g_hash_table_foreach(proplist2,
-                         &merge_property,
-                         &merge_p);
-}
-
index 7d56768e31c3a6622cdf3dbb6a74e8abb5115434..ef61786642164cd423c80b2761112ef83878042f 100644 (file)
@@ -116,6 +116,14 @@ void application_property_add_to_argv(GPtrArray *argv_ptr,
                                      backup_support_option_t *bsu,
                                      am_feature_t *amfeatures);
 
+/* Merge properties from amanda-client.conf files to dles (application and scripts)
+ *
+ * @param dle: the dle list.
+ * @returns: Return 1 on success
+ *           Return 0 on failure
+ */
+int merge_dles_properties(dle_t *dles, int verbose);
+
 char *fixup_relative(char *name, char *device);
 backup_support_option_t *backup_support_option(char *program,
                                               g_option_t *g_options,
@@ -164,9 +172,14 @@ void add_type_table(dmpline_t typ,
 void add_list_table(dmpline_t typ, amregex_t **re_table,
                     GSList *message);
 
-/* Merge properties from proplist2 to proplist1)
+/* Merge properties from conf_proplist to dle_proplist
+   If verbose is 1, then dle->disk and name are used in output.
+ * @returns: Return 1 on success
+ *           Return 0 on failure
  */
-void merge_properties(proplist_t proplist1, proplist_t proplist2);
+int
+merge_properties(dle_t *dle, char *name, proplist_t dle_proplist,
+                proplist_t conf_proplist, int verbose);
 
 #endif
 
index 5f6cb075db48e0495d8a99501e3b197bacbdd14a..a381233f7a282f7dc3270a14a5037bd2f7a3eb3e 100644 (file)
@@ -313,6 +313,9 @@ main(
            err_extra = errmsg;
            goto err;
        }
+       if (merge_dles_properties(dles, 1) == 0) {
+           goto checkoverall;
+       }
        for (dle = dles; dle != NULL; dle = dle->next) {
            run_client_scripts(EXECUTE_ON_PRE_HOST_AMCHECK, g_options, dle,
                               stdout);
@@ -335,6 +338,7 @@ main(
        }
     }
 
+checkoverall:
     check_overall();
 
     amfree(line);
index dacb961e143ab296e4c4e19e3de67a14994795cd..781dedb4b3cf055fca5a28b9363bb453a0767e11 100644 (file)
@@ -467,6 +467,10 @@ main(
       }
     }
 
+    if (merge_dles_properties(dle, 1) == 0) {
+       g_debug("merge_dles_properties failed");
+       exit(1);
+    }
     mesgstream = fdopen(mesgfd,"w");
     run_client_scripts(EXECUTE_ON_PRE_DLE_BACKUP, g_options, dle, mesgstream);
     fflush(mesgstream);
index 8eb5c046c56afe7ca5e13589afefbadf3445b137..6d9f0c28f0bf83c7b1ba57f15dbb44ece9ecf566 100644 (file)
@@ -122,6 +122,7 @@ main(
     disk_estimates_t *est;
     disk_estimates_t *est1;
     disk_estimates_t *est_prev;
+    disk_estimates_t *est_next;
     char *line = NULL;
     char *s, *fp;
     int ch;
@@ -413,6 +414,20 @@ main(
        amandates_started = FALSE;
     }
 
+    est_prev = NULL;
+    for(est = est_list; est != NULL; est = est_next) {
+       int good = merge_dles_properties(est->dle, 0);
+       est_next = est->next;
+       if (!good) {
+           if (est == est_list) {
+               est_list = est_next;
+           } else {
+               est_prev->next = est_next;
+           }
+       } else {
+           est_prev = est;
+       }
+    }
     for(est = est_list; est != NULL; est = est->next) {
        run_client_scripts(EXECUTE_ON_PRE_HOST_ESTIMATE, g_options, est->dle,
                           stdout);
index d57d351eb20317136cc357b046efdbab0b9c477c..58443ad890ab984ccd92367db2865985dd806819 100644 (file)
@@ -8,10 +8,12 @@ include $(top_srcdir)/config/automake/precompile.am
 INCLUDES =      -I$(top_srcdir)/gnulib   
 
 AM_CFLAGS = $(AMANDA_WARNING_CFLAGS)
-AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
+AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS) $(AS_NEEDED_FLAGS)
 
 amlib_LTLIBRARIES =    libamanda.la
 
+sbin_PROGRAMS = amservice
+
 LINT=$(AMLINT)
 LINTFLAGS=$(AMLINTFLAGS)
 
@@ -47,6 +49,12 @@ libamanda_la_SOURCES =               \
 # version.c is generated; see below
 nodist_libamanda_la_SOURCES = version.c
 
+INSTALLPERMS_exec = \
+       dest=$(sbindir) chown=root:setuid chmod=04750 \
+               amservice
+
+LDADD = libamanda.la
+
 libamanda_la_LIBADD =          \
        ../gnulib/libgnu.la
 
@@ -88,7 +96,7 @@ endif
 
 libamanda_la_SOURCES += local-security.c
 
-libamanda_la_LDFLAGS =  -release $(VERSION)
+libamanda_la_LDFLAGS =  -release $(VERSION) $(AS_NEEDED_FLAGS)
 
 noinst_HEADERS =               \
        amanda.h                \
index 37f864fb2b6eecc13a402008c1f9764b9faa1f8f..637af48871acb13d6bcc08836b40028ee5e853f7 100644 (file)
@@ -191,6 +191,7 @@ DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
        $(top_srcdir)/config/automake/scripts.am \
        $(top_srcdir)/config/automake/vars.am
 @WANT_INSTALLPERMS_FALSE@am__append_1 = $(installperms_sh)
+sbin_PROGRAMS = amservice$(EXEEXT)
 @WANT_AMFLOCK_POSIX_TRUE@am__append_2 = amflock-posix.c
 @WANT_AMFLOCK_FLOCK_TRUE@am__append_3 = amflock-flock.c
 @WANT_AMFLOCK_LOCKF_TRUE@am__append_4 = amflock-lockf.c
@@ -220,6 +221,7 @@ am__aclocal_m4_deps =  \
        $(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/as_needed.m4 \
        $(top_srcdir)/config/amanda/bsd-security.m4 \
        $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
        $(top_srcdir)/config/amanda/bsdudp-security.m4 \
@@ -384,8 +386,9 @@ am__nobase_list = $(am__nobase_strip_setup); \
 am__base_list = \
   sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
   sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
-am__installdirs = "$(DESTDIR)$(amlibdir)" "$(DESTDIR)$(amlibexecdir)" \
-       "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(amlibexecdir)"
+am__installdirs = "$(DESTDIR)$(amlibdir)" "$(DESTDIR)$(sbindir)" \
+       "$(DESTDIR)$(amlibexecdir)" "$(DESTDIR)$(sbindir)" \
+       "$(DESTDIR)$(amlibexecdir)"
 LTLIBRARIES = $(amlib_LTLIBRARIES) $(noinst_LTLIBRARIES)
 libamanda_la_DEPENDENCIES = ../gnulib/libgnu.la
 am__libamanda_la_SOURCES_DIST = alloc.c amfeatures.c amflock.c \
@@ -431,10 +434,14 @@ am__EXEEXT_2 = amflock-test$(EXEEXT) event-test$(EXEEXT) \
        semaphore-test$(EXEEXT) quoting-test$(EXEEXT) \
        ipc-binary-test$(EXEEXT) hexencode-test$(EXEEXT) \
        fileheader-test$(EXEEXT) match-test$(EXEEXT)
-PROGRAMS = $(noinst_PROGRAMS)
+PROGRAMS = $(noinst_PROGRAMS) $(sbin_PROGRAMS)
 am_amflock_test_OBJECTS = amflock-test.$(OBJEXT)
 amflock_test_OBJECTS = $(am_amflock_test_OBJECTS)
 amflock_test_DEPENDENCIES = libamanda.la libtestutils.la
+amservice_SOURCES = amservice.c
+amservice_OBJECTS = amservice.$(OBJEXT)
+amservice_LDADD = $(LDADD)
+amservice_DEPENDENCIES = libamanda.la
 am_bsdsecurity_OBJECTS = bsd-security.test.$(OBJEXT)
 bsdsecurity_OBJECTS = $(am_bsdsecurity_OBJECTS)
 bsdsecurity_DEPENDENCIES = alloc.lo clock.lo debug.lo dgram.lo \
@@ -482,14 +489,14 @@ 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) \
-       $(libtestutils_la_SOURCES) $(amflock_test_SOURCES) \
+       $(libtestutils_la_SOURCES) $(amflock_test_SOURCES) amservice.c \
        $(bsdsecurity_SOURCES) $(event_test_SOURCES) $(file_SOURCES) \
        $(fileheader_test_SOURCES) $(genversion_SOURCES) \
        $(hexencode_test_SOURCES) $(ipc_binary_test_SOURCES) \
        $(match_test_SOURCES) $(quoting_test_SOURCES) \
        $(semaphore_test_SOURCES)
 DIST_SOURCES = $(am__libamanda_la_SOURCES_DIST) \
-       $(libtestutils_la_SOURCES) $(amflock_test_SOURCES) \
+       $(libtestutils_la_SOURCES) $(amflock_test_SOURCES) amservice.c \
        $(bsdsecurity_SOURCES) $(event_test_SOURCES) $(file_SOURCES) \
        $(fileheader_test_SOURCES) $(genversion_SOURCES) \
        $(hexencode_test_SOURCES) $(ipc_binary_test_SOURCES) \
@@ -525,6 +532,7 @@ APPLICATION_DIR = @APPLICATION_DIR@
 AR = @AR@
 ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
 ASSERTIONS = @ASSERTIONS@
+AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -998,6 +1006,7 @@ LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
 MKDIR_P = @MKDIR_P@
+MOUNT = @MOUNT@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
@@ -1195,6 +1204,7 @@ STDBOOL_H = @STDBOOL_H@
 STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
+SUNTAR = @SUNTAR@
 SVN = @SVN@
 SWIG = @SWIG@
 SWIG_LIB = @SWIG_LIB@
@@ -1202,6 +1212,7 @@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TCPPORTRANGE = @TCPPORTRANGE@
 TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
 UDPPORTRANGE = @UDPPORTRANGE@
+UMOUNT = @UMOUNT@
 UNCOMPRESS_OPT = @UNCOMPRESS_OPT@
 UNCOMPRESS_PATH = @UNCOMPRESS_PATH@
 UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
@@ -1344,7 +1355,7 @@ do_installperms = dest=; chown=; chmod=; \
 
 INCLUDES = -I$(top_srcdir)/gnulib   
 AM_CFLAGS = $(AMANDA_WARNING_CFLAGS)
-AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
+AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS) $(AS_NEEDED_FLAGS)
 amlib_LTLIBRARIES = libamanda.la
 LINT = $(AMLINT)
 LINTFLAGS = $(AMLINTFLAGS)
@@ -1359,10 +1370,15 @@ libamanda_la_SOURCES = alloc.c amfeatures.c amflock.c ipc-binary.c \
        $(am__append_11) local-security.c
 # version.c is generated; see below
 nodist_libamanda_la_SOURCES = version.c
+INSTALLPERMS_exec = \
+       dest=$(sbindir) chown=root:setuid chmod=04750 \
+               amservice
+
+LDADD = libamanda.la
 libamanda_la_LIBADD = \
        ../gnulib/libgnu.la
 
-libamanda_la_LDFLAGS = -release $(VERSION)
+libamanda_la_LDFLAGS = -release $(VERSION) $(AS_NEEDED_FLAGS)
 noinst_HEADERS = \
        amanda.h                \
        amfeatures.h            \
@@ -1582,9 +1598,55 @@ clean-noinstPROGRAMS:
        list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
        echo " rm -f" $$list; \
        rm -f $$list
+install-sbinPROGRAMS: $(sbin_PROGRAMS)
+       @$(NORMAL_INSTALL)
+       test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
+       @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+       for p in $$list; do echo "$$p $$p"; done | \
+       sed 's/$(EXEEXT)$$//' | \
+       while read p p1; do if test -f $$p || test -f $$p1; \
+         then echo "$$p"; echo "$$p"; else :; fi; \
+       done | \
+       sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+           -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+       sed 'N;N;N;s,\n, ,g' | \
+       $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+         { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+           if ($$2 == $$4) files[d] = files[d] " " $$1; \
+           else { print "f", $$3 "/" $$4, $$1; } } \
+         END { for (d in files) print "f", d, files[d] }' | \
+       while read type dir files; do \
+           if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+           test -z "$$files" || { \
+           echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
+           $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
+           } \
+       ; done
+
+uninstall-sbinPROGRAMS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+       files=`for p in $$list; do echo "$$p"; done | \
+         sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+             -e 's/$$/$(EXEEXT)/' `; \
+       test -n "$$list" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(sbindir)" && rm -f $$files
+
+clean-sbinPROGRAMS:
+       @list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \
+       echo " rm -f" $$list; \
+       rm -f $$list || exit $$?; \
+       test -n "$(EXEEXT)" || exit 0; \
+       list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+       echo " rm -f" $$list; \
+       rm -f $$list
 amflock-test$(EXEEXT): $(amflock_test_OBJECTS) $(amflock_test_DEPENDENCIES) 
        @rm -f amflock-test$(EXEEXT)
        $(LINK) $(amflock_test_OBJECTS) $(amflock_test_LDADD) $(LIBS)
+amservice$(EXEEXT): $(amservice_OBJECTS) $(amservice_DEPENDENCIES) 
+       @rm -f amservice$(EXEEXT)
+       $(LINK) $(amservice_OBJECTS) $(amservice_LDADD) $(LIBS)
 bsdsecurity$(EXEEXT): $(bsdsecurity_OBJECTS) $(bsdsecurity_DEPENDENCIES) 
        @rm -f bsdsecurity$(EXEEXT)
        $(LINK) $(bsdsecurity_OBJECTS) $(bsdsecurity_LDADD) $(LIBS)
@@ -1698,6 +1760,7 @@ distclean-compile:
 @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)/amservice.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amxml.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@
@@ -1975,7 +2038,7 @@ check: $(BUILT_SOURCES)
 all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) $(DATA) \
                $(HEADERS)
 installdirs:
-       for dir in "$(DESTDIR)$(amlibdir)" "$(DESTDIR)$(amlibexecdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(amlibexecdir)"; do \
+       for dir in "$(DESTDIR)$(amlibdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(amlibexecdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(amlibexecdir)"; do \
          test -z "$$dir" || $(MKDIR_P) "$$dir"; \
        done
 install: $(BUILT_SOURCES)
@@ -2012,7 +2075,8 @@ maintainer-clean-generic:
 clean: clean-am
 
 clean-am: clean-amlibLTLIBRARIES clean-generic clean-libtool \
-       clean-noinstLTLIBRARIES clean-noinstPROGRAMS mostlyclean-am
+       clean-noinstLTLIBRARIES clean-noinstPROGRAMS \
+       clean-sbinPROGRAMS mostlyclean-am
 
 distclean: distclean-am
        -rm -rf ./$(DEPDIR)
@@ -2040,7 +2104,7 @@ install-dvi: install-dvi-am
 install-dvi-am:
 
 install-exec-am: install-amlibexecDATA install-amlibexecSCRIPTS \
-       install-sbinSCRIPTS
+       install-sbinPROGRAMS install-sbinSCRIPTS
        @$(NORMAL_INSTALL)
        $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
 install-html: install-html-am
@@ -2082,29 +2146,31 @@ ps: ps-am
 ps-am:
 
 uninstall-am: uninstall-amlibLTLIBRARIES uninstall-amlibexecDATA \
-       uninstall-amlibexecSCRIPTS uninstall-sbinSCRIPTS
+       uninstall-amlibexecSCRIPTS uninstall-sbinPROGRAMS \
+       uninstall-sbinSCRIPTS
 
 .MAKE: all check check-am install 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-noinstLTLIBRARIES clean-noinstPROGRAMS ctags dist-hook \
-       distclean distclean-compile distclean-generic \
-       distclean-libtool distclean-local distclean-tags distdir dvi \
-       dvi-am html html-am info info-am 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
+       clean-noinstLTLIBRARIES clean-noinstPROGRAMS \
+       clean-sbinPROGRAMS ctags dist-hook distclean distclean-compile \
+       distclean-generic distclean-libtool distclean-local \
+       distclean-tags distdir dvi dvi-am html html-am info info-am \
+       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-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-amlibexecDATA uninstall-amlibexecSCRIPTS \
+       uninstall-sbinPROGRAMS uninstall-sbinSCRIPTS
 
 
 # Perl
index c7b80503e7ba4a89406e64bc39c4217dd78a5e92..085c8ea2a280784e97db1819c653c7deaaee9160 100644 (file)
@@ -162,6 +162,9 @@ am_init_feature_set(void)
        am_add_feature(f, fe_amidxtaped_abort);
        am_add_feature(f, fe_amrecover_correct_disk_quoting);
        am_add_feature(f, fe_amindexd_quote_label);
+       am_add_feature(f, fe_amrecover_receive_unfiltered);
+       am_add_feature(f, fe_application_client_name);
+       am_add_feature(f, fe_script_client_name);
     }
     return f;
 }
index 8c5b5f82f4d511567128d85b73f215f1b09eb724..068b8d560af3c22a13504fe589bd45206ff42a28 100644 (file)
@@ -189,6 +189,10 @@ typedef enum {
     fe_amrecover_correct_disk_quoting,
     fe_amindexd_quote_label,
 
+    fe_amrecover_receive_unfiltered,
+    fe_application_client_name,
+    fe_script_client_name,
+
     /*
      * All new features must be inserted immediately *before* this entry.
      */
index cffde0aa6e5c64a99115e6668dae21e537e2a1f4..0e160e09274a029fc626dff69a1e8ae52888a803 100644 (file)
@@ -36,7 +36,7 @@ extern amflock_impl_t *amflock_impls[];
 /* Test all amflock implementations available for basic 
  * functionality
  */
-static int
+static gboolean
 test_old_impls(void)
 {
     amflock_impl_t **imp = amflock_impls;
@@ -54,29 +54,29 @@ test_old_impls(void)
        for (lock_ro = 0; lock_ro < 2; lock_ro++) { /* false (0) or true (1) */
            if (unlink(TEST_FILENAME) == -1 && errno != ENOENT) {
                perror("unlink");
-               return 0;
+               return FALSE;
            }
 
            if ((fd = open(TEST_FILENAME, O_RDWR | O_CREAT | O_EXCL, 0600)) == -1) {
                perror("open");
-               return 0;
+               return FALSE;
            }
 
            if (lock_ro) {
                if ((*imp)->amroflock_impl(fd, resource) != 0) {
                    perror("amroflock");
-                   return 0;
+                   return FALSE;
                }
            } else {
                if ((*imp)->amflock_impl(fd, resource) != 0) {
                    perror("amflock");
-                   return 0;
+                   return FALSE;
                }
            }
 
            if ((*imp)->amfunlock_impl(fd, resource) != 0) {
                perror("amfunlock");
-               return 0;
+               return FALSE;
            }
 
            close(fd); /* ignore error */
@@ -88,7 +88,7 @@ test_old_impls(void)
        imp++;
     }
 
-    return 1;
+    return TRUE;
 }
 
 /*
@@ -290,7 +290,7 @@ test_intra_proc_locking_thd(gpointer *fdptr)
     return NULL;
 }
 
-static int
+static gboolean
 test_intra_proc_locking(void)
 {
     GThread *thd;
@@ -320,7 +320,7 @@ test_intra_proc_locking(void)
     return rv;
 }
 
-static int
+static gboolean
 test_inter_proc_locking(void)
 {
     int outpipe[2], inpipe[2];
index 177266dd07c52bd4f5e03bac41fa23689b59d00e..858c2885594a4403b948669f8c3d0b42df84f552 100644 (file)
@@ -38,6 +38,7 @@
 
 static GStaticMutex lock_lock = G_STATIC_MUTEX_INIT;
 static GHashTable *locally_locked_files = NULL;
+static int lock_rw_rd(file_lock *lock, short l_type);
 
 file_lock *
 file_lock_new(
@@ -155,6 +156,90 @@ done:
     return rv;
 }
 
+static int
+lock_rw_rd(
+    file_lock *lock,
+    short      l_type)
+{
+    int rv = -2;
+    int fd = -1;
+    int saved_errno;
+    struct flock lock_buf;
+    struct stat stat_buf;
+
+    g_assert(!lock->locked);
+
+    /* protect from overlapping lock operations within a process */
+    g_static_mutex_lock(&lock_lock);
+
+    /* The locks are advisory, so an error here never means the lock is already
+     * taken. */
+    lock->fd = fd = open(lock->filename, O_CREAT|O_RDWR, 0666);
+    if (fd < 0) {
+       rv = -1;
+       goto done;
+    }
+
+    /* now try locking it */
+    lock_buf.l_type = l_type;
+    lock_buf.l_start = 0;
+    lock_buf.l_whence = SEEK_SET;
+    lock_buf.l_len = 0; /* to EOF */
+    if (fcntl(fd, F_SETLK, &lock_buf) < 0) {
+       if (errno == EACCES || errno == EAGAIN)
+           rv = 1;
+       else
+           rv = -1;
+       goto done;
+    }
+
+    /* and read the file in its entirety */
+    if (fstat(fd, &stat_buf) < 0) {
+       rv = -1;
+       goto done;
+    }
+
+    if (!(stat_buf.st_mode & S_IFREG)) {
+       rv = -1;
+       errno = EINVAL;
+       goto done;
+    }
+
+    fd = -1; /* we'll keep the file now */
+    lock->locked = TRUE;
+
+    rv = 0;
+
+done:
+    saved_errno = errno;
+    g_static_mutex_unlock(&lock_lock);
+    if (fd >= 0) /* close and unlock if an error occurred */
+       close(fd);
+    errno = saved_errno;
+    return rv;
+}
+
+int
+file_lock_lock_wr(
+    file_lock *lock)
+{
+    return lock_rw_rd(lock, F_WRLCK);
+}
+
+int
+file_lock_lock_rd(
+    file_lock *lock)
+{
+    return lock_rw_rd(lock, F_RDLCK);
+}
+
+int
+file_lock_locked(
+    file_lock *lock)
+{
+    return lock->locked;
+}
+
 int
 file_lock_write(
     file_lock *lock,
@@ -198,7 +283,9 @@ file_lock_unlock(
     close(lock->fd);
 
     /* and the hash table entry */
-    g_hash_table_remove(locally_locked_files, lock->filename);
+    if (locally_locked_files) {
+       g_hash_table_remove(locally_locked_files, lock->filename);
+    }
 
     g_static_mutex_unlock(&lock_lock);
 
index 75661b277f8d344832faef5c0bde568a458935dd..649cdf265642ae8b8fc74e47afe97139a259ebe5 100644 (file)
@@ -77,6 +77,18 @@ void file_lock_free(file_lock *lock);
  */
 int file_lock_lock(file_lock *lock);
 
+/* Lock the file in write or read mode, the file is not read
+ *
+ * @param lock: the file_lock object @returns: -1 on error, 0 on success, 1 on
+ * a busy lock (see above)
+ */
+int file_lock_lock_wr(file_lock *lock);
+int file_lock_lock_rd(file_lock *lock);
+
+/* Return 1 if the object is already locked
+ */
+int file_lock_locked(file_lock *lock);
+
 /* Write the given data to the locked file, and reset the file_lock
  * data member to point to a copy of the new data.  This does not unlock
  * the file.
diff --git a/common-src/amservice.c b/common-src/amservice.c
new file mode 100644 (file)
index 0000000..286a770
--- /dev/null
@@ -0,0 +1,348 @@
+/*
+ * 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.
+ *
+ * Authors: the Amanda Development Team.  Its members are listed in a
+ * file named AUTHORS, in the root directory of this distribution.
+ */
+/*
+ * $Id: amservice.c 11167 2008-05-06 11:53:54Z martineau $
+ *
+ * Take the REQ packet in stdin and output the REP packet in stdout
+ */
+#include "amanda.h"
+#include "util.h"
+#include "conffile.h"
+#include "packet.h"
+#include "protocol.h"
+#include "amfeatures.h"
+#include "event.h"
+
+static int copy_stream = 0;
+static time_t conf_ctimeout;
+static am_feature_t *our_features = NULL;
+static char *our_feature_string = NULL;
+static int remote_errors = 0;
+static event_handle_t *event_in;
+static security_stream_t *fd;
+
+/* local functions */
+
+void usage(void);
+void client_protocol(char *hostname, char *auth, char *service,
+                    FILE *input_file);
+void client_first_stream(security_handle_t *sech, int port_num);
+int main(int argc, char **argv);
+static void read_in(void *cookie);
+void aaa(void);
+static void read_server(void *cookie, void *buf, ssize_t size);
+
+void
+usage(void)
+{
+    error(_("Usage: amservice [-o configoption]* [-f input_file [-s]] host auth service"));
+    /*NOTREACHED*/
+}
+
+int
+main(
+    int                argc,
+    char **    argv)
+{
+    config_overrides_t *cfg_ovr;
+    char *hostname;
+    char *auth;
+    char *service;
+    int opt;
+    extern int optind;
+    extern char *optarg;
+    FILE *input_file;
+    int use_connect = 0;
+    int got_input_file = 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"); 
+
+    safe_fd(-1, 0);
+    safe_cd();
+
+    set_pname("amservice");
+    /* drop root privileges */
+    if (!set_root_privs(0)) {
+       error(_("amservice must be run setuid root"));
+    }
+
+    /* Don't die when child closes pipe */
+    signal(SIGPIPE, SIG_IGN);
+
+    dbopen(DBG_SUBDIR_SERVER);
+
+    add_amanda_log_handler(amanda_log_stderr);
+
+    our_features = am_init_feature_set();
+    our_feature_string = am_feature_to_string(our_features);
+
+    /* process arguments */
+
+    cfg_ovr = new_config_overrides(argc/2);
+    input_file = stdin;
+    while((opt = getopt(argc, argv, "o:f:s")) != EOF) {
+       switch(opt) {
+       case 'o':       add_config_override_opt(cfg_ovr, optarg);
+                       break;
+       case 'f':       got_input_file = 1;
+                       if (*optarg == '/') {
+                           input_file = fopen(optarg, "r");
+                       } else {
+                           char *name = vstralloc(get_original_cwd(), "/",
+                                                  optarg, NULL);
+                           input_file = fopen(name, "r");
+                           amfree(name);
+                       }
+                       if (!input_file)
+                           g_critical("Cannot open output file '%s': %s",
+                               optarg, strerror(errno));
+                       break;
+       case 's':       use_connect = 1;
+                       break;
+       }
+    }
+
+    if (use_connect && !got_input_file) {
+       g_critical("The -s option require -f");
+    }
+
+    argc -= optind, argv += optind;
+    if(argc < 3) usage();
+
+    /* set a default config */
+    set_config_overrides(cfg_ovr);
+    config_init(CONFIG_INIT_CLIENT, NULL);
+    dbrename(get_config_name(), DBG_SUBDIR_SERVER);
+
+    if (config_errors(NULL) >= CFGERR_WARNINGS) {
+       config_print_errors();
+       if (config_errors(NULL) >= CFGERR_ERRORS) {
+           g_critical(_("errors processing config file"));
+       }
+    }
+
+    conf_ctimeout = (time_t)getconf_int(CNF_CTIMEOUT);
+
+    hostname = argv[0];
+    auth = argv[1];
+    service = argv[2];
+
+    /* start client side checks */
+
+    copy_stream = use_connect && got_input_file;
+    client_protocol(hostname, auth, service, input_file);
+
+    amfree(our_feature_string);
+    am_release_feature_set(our_features);
+    our_features = NULL;
+
+    dbclose();
+    return(remote_errors != 0);
+}
+
+/* --------------------------------------------------- */
+
+static void handle_result(void *, pkt_t *, security_handle_t *);
+void start_host(char *hostname, char *auth, char *req);
+
+void
+start_host(
+    char        *hostname,
+    char        *auth,
+    char        *req)
+{
+    const security_driver_t *secdrv;
+    secdrv = security_getdriver(auth);
+    if (secdrv == NULL) {
+       fprintf(stderr, _("Could not find security driver \"%s\".\n"), auth);
+    } else {
+       protocol_sendreq(hostname, secdrv, generic_client_get_security_conf,
+                        req, conf_ctimeout, handle_result, NULL);
+    }
+
+}
+
+void
+client_protocol(
+    char        *hostname,
+    char        *auth,
+    char        *service,
+    FILE        *input_file)
+{
+    char *req, *req1;
+
+    req = g_strdup_printf("SERVICE %s\nOPTIONS features=%s\n",
+                         service, our_feature_string);
+    req1 = malloc(1024);
+    while(fgets(req1, 1024, input_file) != NULL) {
+       vstrextend(&req, req1, NULL);
+    }
+    protocol_init();
+
+    start_host(hostname, auth, req);
+
+    protocol_run();
+
+    fflush(stdout);
+
+    amfree(our_feature_string);
+
+    return;
+}
+
+static void
+handle_result(
+    void              *datap G_GNUC_UNUSED,
+    pkt_t             *pkt,
+    security_handle_t *sech)
+{
+    char *line;
+    char *s;
+    int ch;
+    int port_num = 0;
+    int has_error = 0;
+
+    if (pkt == NULL) {
+       g_fprintf(stdout,
+                 _("Request failed: %s\n"), security_geterror(sech));
+       remote_errors++;
+       return;
+    }
+
+    s = pkt->body;
+    ch = *s++;
+    while(ch) {
+       line = s - 1;
+       skip_quoted_line(s, ch);
+       if (s[-2] == '\n') {
+           s[-2] = '\0';
+       }
+
+       if (copy_stream) {
+           g_debug("REP: %s\n", line);
+       } else {
+           fprintf(stdout, "%s\n", line);
+       }
+       if (strncmp(line, "CONNECT ", 8) == 0) {
+           char *port = strchr(line, ' ');
+           if (port) {
+               port = strchr(port+1, ' ');
+               if (port) {
+                   port_num = atoi(port+1);
+               }
+           }
+       } else if (strncmp(line, "ERROR ", 6) == 0) {
+           if (copy_stream) {
+               fprintf(stdout, "%s\n", line);
+           }
+           has_error++;
+       }
+    }
+
+    if (has_error)
+       return;
+
+    if (copy_stream) {
+       client_first_stream(sech, port_num);
+    } else {
+       fprintf(stdout, "\n");
+    }
+
+}
+
+void
+client_first_stream(
+    security_handle_t *sech,
+    int port_num)
+{
+
+    if (port_num == 0) {
+       g_critical("The service did not ask to open stream, do not use '-s' with that service");
+    }
+
+    fd = security_stream_client(sech, port_num);
+    if (!fd) {
+       g_critical("Could not connect to stream: %s\n", security_stream_geterror(fd));
+    }
+    if (security_stream_auth(fd) < 0) {
+       g_critical("could not authenticate stream: %s\n", security_stream_geterror(fd));
+    }
+
+    printf("Connected\n");
+    /* read from stdin */
+    event_in = event_register((event_id_t)0, EV_READFD, read_in, NULL);
+
+    /* read from connected stream */
+    security_stream_read(fd, read_server, NULL);
+}
+
+
+static void
+read_in(
+    void *cookie G_GNUC_UNUSED)
+{
+    size_t nread;
+    char   buf[1024];
+
+    event_release(event_in);
+    nread = read(0, buf, 1024);
+    if (nread == 0) {
+       security_stream_close(fd);
+       return;
+    }
+
+    buf[nread] = '\0';
+    security_stream_write(fd, buf, nread);
+    event_in = event_register((event_id_t)0, EV_READFD, read_in, NULL);
+}
+
+static void
+read_server(
+    void *      cookie G_GNUC_UNUSED,
+    void *      buf,
+    ssize_t     size)
+{
+    switch (size) {
+    case -1:
+    case  0: security_stream_close(fd);
+            event_release(event_in);
+            break;
+    default:
+       full_write(1, buf, size);
+       if (errno > 0) {
+           g_debug("failed to write to stdout: %s", strerror(errno));
+       }
+       security_stream_read(fd, read_server, NULL);
+       break;
+    }
+}
index bf7195ac51b885b012e2d54713959cd82036f1f2..28b88aeea27b57fdc424913c7f05dfbe42a5959b 100644 (file)
@@ -94,6 +94,7 @@ free_dle(
     amfree(dle->srv_decrypt_opt);
     amfree(dle->clnt_decrypt_opt);
     amfree(dle->auth);
+    amfree(dle->application_client_name);
     free_sl(dle->exclude_file);
     free_sl(dle->exclude_list);
     free_sl(dle->include_file);
@@ -114,6 +115,7 @@ free_script_data(
     script_t *script)
 {
     amfree(script->plugin);
+    amfree(script->client_name);
     if (script->property)
        g_hash_table_destroy(script->property);
 }
@@ -151,6 +153,7 @@ init_dle(
     dle->scriptlist = NULL;
     dle->data_path = DATA_PATH_AMANDA;
     dle->directtcp_list = NULL;
+    dle->application_client_name = NULL;
     dle->next = NULL;
 }
 
@@ -428,6 +431,7 @@ amstart_element(
        data_user->script->execute_on = 0;
        data_user->script->execute_where = ES_CLIENT;
        data_user->script->property = NULL;
+       data_user->script->client_name = NULL;
        data_user->script->result = NULL;
        data_user->has_plugin = 0;
     } else if (strcmp(element_name, "execute_on") == 0) {
@@ -438,6 +442,7 @@ amstart_element(
                        "XML: Invalid %s element", element_name);
            return;
        }
+    } else if (strcmp(element_name, "client_name") == 0) {
     } else {
        g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,
                    "XML: Invalid %s element", element_name);
@@ -879,26 +884,38 @@ amtext(
            sep = strchr(tt1,',');
            if (sep)
                *sep = '\0';
-           if (strcmp(tt1,"PRE-DLE-AMCHECK") == 0)
+           if (strcmp(tt1,"PRE-AMCHECK") == 0)
+               data_user->script->execute_on |= EXECUTE_ON_PRE_AMCHECK;
+           else if (strcmp(tt1,"PRE-DLE-AMCHECK") == 0)
                data_user->script->execute_on |= EXECUTE_ON_PRE_DLE_AMCHECK;
            else if (strcmp(tt1,"PRE-HOST-AMCHECK") == 0)
                data_user->script->execute_on |= EXECUTE_ON_PRE_HOST_AMCHECK;
+           else if (strcmp(tt1,"POST-AMCHECK") == 0)
+               data_user->script->execute_on |= EXECUTE_ON_POST_AMCHECK;
            else if (strcmp(tt1,"POST-DLE-AMCHECK") == 0)
                data_user->script->execute_on |= EXECUTE_ON_POST_DLE_AMCHECK;
            else if (strcmp(tt1,"POST-HOST-AMCHECK") == 0)
                data_user->script->execute_on |= EXECUTE_ON_POST_HOST_AMCHECK;
+           else if (strcmp(tt1,"PRE-ESTIMATE") == 0)
+               data_user->script->execute_on |= EXECUTE_ON_PRE_ESTIMATE;
            else if (strcmp(tt1,"PRE-DLE-ESTIMATE") == 0)
                data_user->script->execute_on |= EXECUTE_ON_PRE_DLE_ESTIMATE;
            else if (strcmp(tt1,"PRE-HOST-ESTIMATE") == 0)
                data_user->script->execute_on |= EXECUTE_ON_PRE_HOST_ESTIMATE;
+           else if (strcmp(tt1,"POST-ESTIMATE") == 0)
+               data_user->script->execute_on |= EXECUTE_ON_POST_ESTIMATE;
            else if (strcmp(tt1,"POST-DLE-ESTIMATE") == 0)
                data_user->script->execute_on |= EXECUTE_ON_POST_DLE_ESTIMATE;
            else if (strcmp(tt1,"POST-HOST-ESTIMATE") == 0)
                data_user->script->execute_on |= EXECUTE_ON_POST_HOST_ESTIMATE;
+           else if (strcmp(tt1,"PRE-BACKUP") == 0)
+               data_user->script->execute_on |= EXECUTE_ON_PRE_BACKUP;
            else if (strcmp(tt1,"PRE-DLE-BACKUP") == 0)
                data_user->script->execute_on |= EXECUTE_ON_PRE_DLE_BACKUP;
            else if (strcmp(tt1,"PRE-HOST-BACKUP") == 0)
                data_user->script->execute_on |= EXECUTE_ON_PRE_HOST_BACKUP;
+           else if (strcmp(tt1,"POST-BACKUP") == 0)
+               data_user->script->execute_on |= EXECUTE_ON_POST_BACKUP;
            else if (strcmp(tt1,"POST-DLE-BACKUP") == 0)
                data_user->script->execute_on |= EXECUTE_ON_POST_DLE_BACKUP;
            else if (strcmp(tt1,"POST-HOST-BACKUP") == 0)
@@ -938,6 +955,21 @@ amtext(
        amfree(tt);
     } else if(strcmp(last_element_name, "directtcp") == 0) {
        dle->directtcp_list = g_slist_append(dle->directtcp_list, tt);
+    } else if(strcmp(last_element_name, "client_name") == 0) {
+       last_element2 = g_slist_nth(data_user->element_names, 1);
+       if (!last_element2) {
+           error("Invalid client_name text");
+       }
+       last_element2_name = last_element2->data;
+       if (strcmp(last_element2_name, "backup-program") == 0) {
+           dle->application_client_name = tt;
+g_debug("set dle->application_client_name: %s", dle->application_client_name);
+       } else if (strcmp(last_element2_name, "script") == 0) {
+           data_user->script->client_name = tt;
+g_debug("set data_user->script->client_name: %s", data_user->script->client_name);
+       } else {
+           error("client_name outside of script or backup-program");
+       }
     } else {
        g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,
                    "XML: amtext not defined for '%s'", last_element_name);
index 2f64b62426dbab646464c8fa3b9340ac892ff35f..a670ba9146d7e2bef026968e18222b21aedc84b7 100644 (file)
@@ -40,6 +40,7 @@ typedef struct script_s {
     execute_on_t                   execute_on;
     int                            execute_where;
     proplist_t                     property;
+    char                          *client_name;
     struct client_script_result_s *result;
 } script_t;
 
@@ -79,6 +80,7 @@ typedef struct a_dle_s {
     int     exclude_optional;
     int     include_optional;
     proplist_t application_property;
+    char        *application_client_name;
     scriptlist_t scriptlist;
     data_path_t  data_path;
     GSList      *directtcp_list;
index ad2929219e93031d2b060aa15cae0391edfadacb..ad929b3cce40ee4d4616be02919762091fa1a9b1 100644 (file)
@@ -317,6 +317,7 @@ bsd_accept(
     void       (*fn)(security_handle_t *, pkt_t *),
     void       *datap)
 {
+    struct stat sbuf;
 
     assert(in >= 0 && out >= 0);
     assert(fn != NULL);
@@ -343,7 +344,13 @@ bsd_accept(
     netfd4.prefix_packet = &bsd_prefix_packet;
     netfd4.driver = &bsd_security_driver;
 
-    udp_addref(&netfd4, &udp_netfd_read_callback);
+    /* check if in is a socket */
+    fstat(in, &sbuf);
+    if (S_ISSOCK(sbuf.st_mode)) {
+       udp_addref(&netfd4, &udp_netfd_read_callback);
+    } else {
+       g_warning("input file descriptor is not a socket; cannot use BSD auth");
+    }
 }
 
 /*
index 12d9f0392e93f860330ab25b7233c73bc77d65c1..90b37239ff6144d51dc2505947499b9ca9afe5d8 100644 (file)
@@ -88,15 +88,18 @@ typedef enum {
     CONF_APPLICATION,          CONF_APPLICATION_TOOL,
     CONF_SCRIPT,               CONF_SCRIPT_TOOL,
     CONF_EXECUTE_ON,           CONF_EXECUTE_WHERE,     CONF_SEND_AMREPORT_ON,
-    CONF_DEVICE,               CONF_ORDER,
+    CONF_DEVICE,               CONF_ORDER,             CONF_SINGLE_EXECUTION,
     CONF_DATA_PATH,            CONF_AMANDA,            CONF_DIRECTTCP,
-    CONF_TAPER_PARALLEL_WRITE,
+    CONF_TAPER_PARALLEL_WRITE, CONF_INTERACTIVITY,     CONF_TAPERSCAN,
 
     /* execute on */
+    CONF_PRE_AMCHECK,          CONF_POST_AMCHECK,
     CONF_PRE_DLE_AMCHECK,      CONF_PRE_HOST_AMCHECK,
     CONF_POST_DLE_AMCHECK,     CONF_POST_HOST_AMCHECK,
+    CONF_PRE_ESTIMATE,         CONF_POST_ESTIMATE,
     CONF_PRE_DLE_ESTIMATE,     CONF_PRE_HOST_ESTIMATE,
     CONF_POST_DLE_ESTIMATE,    CONF_POST_HOST_ESTIMATE,
+    CONF_PRE_BACKUP,           CONF_POST_BACKUP,
     CONF_PRE_DLE_BACKUP,       CONF_PRE_HOST_BACKUP,
     CONF_POST_DLE_BACKUP,      CONF_POST_HOST_BACKUP,
     CONF_PRE_RECOVER,         CONF_POST_RECOVER,
@@ -133,6 +136,7 @@ typedef enum {
     /* client conf */
     CONF_CONF,                 CONF_INDEX_SERVER,      CONF_TAPE_SERVER,
     CONF_SSH_KEYS,             CONF_GNUTAR_LIST_DIR,   CONF_AMANDATES,
+    CONF_AMDUMP_SERVER,
 
     /* protocol config */
     CONF_REP_TRIES,            CONF_CONNECT_TRIES,     CONF_REQ_TRIES,
@@ -160,13 +164,14 @@ typedef enum {
     /* autolabel */
     CONF_AUTOLABEL,            CONF_ANY_VOLUME,        CONF_OTHER_CONFIG,
     CONF_NON_AMANDA,           CONF_VOLUME_ERROR,      CONF_EMPTY,
+    CONF_META_AUTOLABEL,
 
     /* part_cache_type */
     CONF_PART_SIZE,            CONF_PART_CACHE_TYPE,   CONF_PART_CACHE_DIR,
     CONF_PART_CACHE_MAX_SIZE,  CONF_DISK,              CONF_MEMORY,
 
-    /* recovery-limit */
-    CONF_RECOVERY_LIMIT,       CONF_SAME_HOST,
+    /* host-limit */
+    CONF_RECOVERY_LIMIT,       CONF_SAME_HOST,         CONF_DUMP_LIMIT,
 
     /* holdingdisk */
     CONF_NEVER,                        CONF_AUTO,              CONF_REQUIRED,
@@ -191,7 +196,9 @@ typedef enum {
     CONF_MULT1T,
 
     /* boolean */
-    CONF_ATRUE,                        CONF_AFALSE
+    CONF_ATRUE,                        CONF_AFALSE,
+
+    CONF_CLIENT_NAME,
 } tok_t;
 
 /* A keyword table entry, mapping the given keyword to the given token.
@@ -355,6 +362,22 @@ struct changer_config_s {
     val_t value[CHANGER_CONFIG_CHANGER_CONFIG];
 };
 
+struct interactivity_s {
+    struct interactivity_s *next;
+    seen_t seen;
+    char *name;
+
+    val_t value[INTERACTIVITY_INTERACTIVITY];
+};
+
+struct taperscan_s {
+    struct taperscan_s *next;
+    seen_t seen;
+    char *name;
+
+    val_t value[TAPERSCAN_TAPERSCAN];
+};
+
 /* The current parser table */
 static conf_var_t *parsetable = NULL;
 
@@ -473,6 +496,18 @@ static void init_changer_config_defaults(void);
 static void save_changer_config(void);
 static void copy_changer_config(void);
 
+static interactivity_t ivcur;
+static void get_interactivity(void);
+static void init_interactivity_defaults(void);
+static void save_interactivity(void);
+static void copy_interactivity(void);
+
+static taperscan_t tscur;
+static void get_taperscan(void);
+static void init_taperscan_defaults(void);
+static void save_taperscan(void);
+static void copy_taperscan(void);
+
 /* 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
@@ -487,6 +522,7 @@ static void read_time(conf_var_t *, val_t *);
 static void read_size(conf_var_t *, val_t *);
 static void read_size_byte(conf_var_t *, val_t *);
 static void read_bool(conf_var_t *, val_t *);
+static void read_no_yes_all(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 *);
@@ -500,6 +536,8 @@ 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_dapplication(conf_var_t *, val_t *);
+static void read_dinteractivity(conf_var_t *, val_t *);
+static void read_dtaperscan(conf_var_t *, val_t *);
 static void read_dpp_script(conf_var_t *, val_t *);
 static void read_property(conf_var_t *, val_t *);
 static void read_execute_on(conf_var_t *, val_t *);
@@ -508,8 +546,20 @@ static void read_holdingdisk(conf_var_t *, val_t *);
 static void read_int_or_str(conf_var_t *, val_t *);
 static void read_autolabel(conf_var_t *, val_t *);
 static void read_part_cache_type(conf_var_t *, val_t *);
-static void read_recovery_limit(conf_var_t *, val_t *);
-
+static void read_host_limit(conf_var_t *, val_t *);
+
+static application_t *read_application(char *name, FILE *from, char *fname,
+                                      int *linenum);
+static pp_script_t *read_pp_script(char *name, FILE *from, char *fname,
+                                  int *linenum);
+static device_config_t *read_device_config(char *name, FILE *from, char *fname,
+                                          int *linenum);
+static changer_config_t *read_changer_config(char *name, FILE *from,
+                                            char *fname, int *linenum);
+static interactivity_t *read_interactivity(char *name, FILE *from,
+                                          char *fname, int *linenum);
+static taperscan_t *read_taperscan(char *name, FILE *from, char *fname,
+                                  int *linenum);
 /* 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
@@ -521,6 +571,7 @@ static ssize_t get_size(void);
 static ssize_t get_size_byte(void);
 static gint64  get_int64(void);
 static int     get_bool(void);
+static int     get_no_yes_all(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
@@ -550,6 +601,7 @@ 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 *);
 static void validate_program(conf_var_t *, val_t *);
+static void validate_dump_limit(conf_var_t *, val_t *);
 gint compare_pp_script_order(gconstpointer a, gconstpointer b);
 
 /*
@@ -593,6 +645,8 @@ static application_t *application_list = NULL;
 static pp_script_t *pp_script_list = NULL;
 static device_config_t *device_config_list = NULL;
 static changer_config_t *changer_config_list = NULL;
+static interactivity_t *interactivity_list = NULL;
+static taperscan_t *taperscan_list = NULL;
 
 /* storage for derived values */
 static long int unit_divisor = 1;
@@ -645,6 +699,7 @@ static void conf_init_identlist(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_no_yes_all(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_data_path(val_t *val, data_path_t i);
@@ -663,7 +718,8 @@ static void conf_init_proplist(val_t *val); /* to empty list */
 static void conf_init_application(val_t *val);
 static void conf_init_autolabel(val_t *val);
 static void conf_init_part_cache_type(val_t *val, part_cache_type_t i);
-static void conf_init_recovery_limit(val_t *val);
+static void conf_init_host_limit(val_t *val);
+static void conf_init_host_limit_server(val_t *val);
 
 /*
  * Command-line Handling
@@ -740,12 +796,14 @@ static void    conf_parswarn(const char *format, ...)
 /* First, the keyword tables for client and server */
 keytab_t client_keytab[] = {
     { "CONF", CONF_CONF },
+    { "AMDUMP_SERVER", CONF_AMDUMP_SERVER },
     { "INDEX_SERVER", CONF_INDEX_SERVER },
     { "TAPE_SERVER", CONF_TAPE_SERVER },
     { "TAPEDEV", CONF_TAPEDEV },
     { "AUTH", CONF_AUTH },
     { "SSH_KEYS", CONF_SSH_KEYS },
     { "AMANDAD_PATH", CONF_AMANDAD_PATH },
+    { "CLIENT_NAME", CONF_CLIENT_NAME },
     { "CLIENT_USERNAME", CONF_CLIENT_USERNAME },
     { "CLIENT_PORT", CONF_CLIENT_PORT },
     { "GNUTAR_LIST_DIR", CONF_GNUTAR_LIST_DIR },
@@ -787,16 +845,22 @@ keytab_t client_keytab[] = {
     { "SCRIPT", CONF_SCRIPT },
     { "SCRIPT_TOOL", CONF_SCRIPT_TOOL },
     { "PLUGIN", CONF_PLUGIN },
+    { "PRE_AMCHECK", CONF_PRE_AMCHECK },
     { "PRE_DLE_AMCHECK", CONF_PRE_DLE_AMCHECK },
     { "PRE_HOST_AMCHECK", CONF_PRE_HOST_AMCHECK },
+    { "POST_AMCHECK", CONF_POST_AMCHECK },
     { "POST_DLE_AMCHECK", CONF_POST_DLE_AMCHECK },
     { "POST_HOST_AMCHECK", CONF_POST_HOST_AMCHECK },
+    { "PRE_ESTIMATE", CONF_PRE_ESTIMATE },
     { "PRE_DLE_ESTIMATE", CONF_PRE_DLE_ESTIMATE },
     { "PRE_HOST_ESTIMATE", CONF_PRE_HOST_ESTIMATE },
+    { "POST_ESTIMATE", CONF_POST_ESTIMATE },
     { "POST_DLE_ESTIMATE", CONF_POST_DLE_ESTIMATE },
     { "POST_HOST_ESTIMATE", CONF_POST_HOST_ESTIMATE },
+    { "POST_BACKUP", CONF_POST_BACKUP },
     { "POST_DLE_BACKUP", CONF_POST_DLE_BACKUP },
     { "POST_HOST_BACKUP", CONF_POST_HOST_BACKUP },
+    { "PRE_BACKUP", CONF_PRE_BACKUP },
     { "PRE_DLE_BACKUP", CONF_PRE_DLE_BACKUP },
     { "PRE_HOST_BACKUP", CONF_PRE_HOST_BACKUP },
     { "PRE_RECOVER", CONF_PRE_RECOVER },
@@ -845,6 +909,7 @@ keytab_t server_keytab[] = {
     { "CLIENT_CUSTOM_COMPRESS", CONF_CLNTCOMPPROG },
     { "CLIENT_DECRYPT_OPTION", CONF_CLNT_DECRYPT_OPT },
     { "CLIENT_ENCRYPT", CONF_CLNT_ENCRYPT },
+    { "CLIENT_NAME", CONF_CLIENT_NAME },
     { "CLIENT_USERNAME", CONF_CLIENT_USERNAME },
     { "COLUMNSPEC", CONF_COLUMNSPEC },
     { "COMMENT", CONF_COMMENT },
@@ -885,6 +950,7 @@ keytab_t server_keytab[] = {
     { "DUMPORDER", CONF_DUMPORDER },
     { "DUMPTYPE", CONF_DUMPTYPE },
     { "DUMPUSER", CONF_DUMPUSER },
+    { "DUMP_LIMIT", CONF_DUMP_LIMIT },
     { "EMPTY", CONF_EMPTY },
     { "ENCRYPT", CONF_ENCRYPT },
     { "ERROR", CONF_ERROR },
@@ -912,6 +978,7 @@ keytab_t server_keytab[] = {
     { "INDEXDIR", CONF_INDEXDIR },
     { "INFOFILE", CONF_INFOFILE },
     { "INPARALLEL", CONF_INPARALLEL },
+    { "INTERACTIVITY", CONF_INTERACTIVITY },
     { "INTERFACE", CONF_INTERFACE },
     { "KENCRYPT", CONF_KENCRYPT },
     { "KRB5KEYTAB", CONF_KRB5KEYTAB },
@@ -934,6 +1001,7 @@ keytab_t server_keytab[] = {
     { "MAXPROMOTEDAY", CONF_MAXPROMOTEDAY },
     { "MEMORY", CONF_MEMORY },
     { "MEDIUM", CONF_MEDIUM },
+    { "META_AUTOLABEL", CONF_META_AUTOLABEL },
     { "NETUSAGE", CONF_NETUSAGE },
     { "NEVER", CONF_NEVER },
     { "NOFULL", CONF_NOFULL },
@@ -949,16 +1017,22 @@ keytab_t server_keytab[] = {
     { "PART_CACHE_TYPE", CONF_PART_CACHE_TYPE },
     { "PART_SIZE", CONF_PART_SIZE },
     { "PLUGIN", CONF_PLUGIN },
+    { "PRE_AMCHECK", CONF_PRE_AMCHECK },
     { "PRE_DLE_AMCHECK", CONF_PRE_DLE_AMCHECK },
     { "PRE_HOST_AMCHECK", CONF_PRE_HOST_AMCHECK },
+    { "POST_AMCHECK", CONF_POST_AMCHECK },
     { "POST_DLE_AMCHECK", CONF_POST_DLE_AMCHECK },
     { "POST_HOST_AMCHECK", CONF_POST_HOST_AMCHECK },
+    { "PRE_ESTIMATE", CONF_PRE_ESTIMATE },
     { "PRE_DLE_ESTIMATE", CONF_PRE_DLE_ESTIMATE },
     { "PRE_HOST_ESTIMATE", CONF_PRE_HOST_ESTIMATE },
+    { "POST_ESTIMATE", CONF_POST_ESTIMATE },
     { "POST_DLE_ESTIMATE", CONF_POST_DLE_ESTIMATE },
     { "POST_HOST_ESTIMATE", CONF_POST_HOST_ESTIMATE },
+    { "POST_BACKUP", CONF_POST_BACKUP },
     { "POST_DLE_BACKUP", CONF_POST_DLE_BACKUP },
     { "POST_HOST_BACKUP", CONF_POST_HOST_BACKUP },
+    { "PRE_BACKUP", CONF_PRE_BACKUP },
     { "PRE_DLE_BACKUP", CONF_PRE_DLE_BACKUP },
     { "PRE_HOST_BACKUP", CONF_PRE_HOST_BACKUP },
     { "PRE_RECOVER", CONF_PRE_RECOVER },
@@ -992,6 +1066,7 @@ keytab_t server_keytab[] = {
     { "SKIP", CONF_SKIP },
     { "SKIP_FULL", CONF_SKIP_FULL },
     { "SKIP_INCR", CONF_SKIP_INCR },
+    { "SINGLE_EXECUTION", CONF_SINGLE_EXECUTION },
     { "SMALLEST", CONF_SMALLEST },
     { "SPEED", CONF_SPEED },
     { "SPLIT_DISKBUFFER", CONF_SPLIT_DISKBUFFER },
@@ -1005,6 +1080,7 @@ keytab_t server_keytab[] = {
     { "TAPEDEV", CONF_TAPEDEV },
     { "TAPELIST", CONF_TAPELIST },
     { "TAPERALGO", CONF_TAPERALGO },
+    { "TAPERSCAN", CONF_TAPERSCAN },
     { "TAPER_PARALLEL_WRITE", CONF_TAPER_PARALLEL_WRITE },
     { "FLUSH_THRESHOLD_DUMPED", CONF_FLUSH_THRESHOLD_DUMPED },
     { "FLUSH_THRESHOLD_SCHEDULED", CONF_FLUSH_THRESHOLD_SCHEDULED },
@@ -1085,10 +1161,27 @@ keytab_t bool_keytable[] = {
     { NULL, CONF_IDENT }
 };
 
+/* no_yes_all keywords -- all the ways to say "true" and "false" in amanda.conf */
+keytab_t no_yes_all_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 },
+    { "ALL", CONF_ALL },
+    { NULL, CONF_IDENT }
+};
+
 /* 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_AMDUMP_SERVER      , CONFTYPE_STR     , read_str     , CNF_AMDUMP_SERVER      , 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 },
@@ -1176,13 +1269,14 @@ conf_var_t server_var [] = {
    { 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_AUTOFLUSH            , CONFTYPE_NO_YES_ALL,read_no_yes_all  , CNF_AUTOFLUSH            , NULL },
    { CONF_RESERVE              , CONFTYPE_INT      , read_int         , CNF_RESERVE              , validate_reserve },
    { CONF_MAXDUMPSIZE          , CONFTYPE_INT64    , read_int64       , 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_AUTOLABEL            , CONFTYPE_AUTOLABEL, read_autolabel   , CNF_AUTOLABEL            , NULL },
+   { CONF_META_AUTOLABEL       , CONFTYPE_STR      , read_str         , CNF_META_AUTOLABEL       , 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 },
@@ -1211,7 +1305,9 @@ conf_var_t server_var [] = {
    { 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_RECOVERY_LIMIT       , CONFTYPE_RECOVERY_LIMIT, read_recovery_limit, CNF_RECOVERY_LIMIT, NULL },
+   { CONF_RECOVERY_LIMIT       , CONFTYPE_HOST_LIMIT, read_host_limit , CNF_RECOVERY_LIMIT       , NULL },
+   { CONF_INTERACTIVITY        , CONFTYPE_STR      , read_dinteractivity, CNF_INTERACTIVITY      , NULL },
+   { CONF_TAPERSCAN            , CONFTYPE_STR      , read_dtaperscan  , CNF_TAPERSCAN            , NULL },
    { CONF_UNKNOWN              , CONFTYPE_INT      , NULL             , CNF_CNF                  , NULL }
 };
 
@@ -1274,8 +1370,9 @@ conf_var_t dumptype_var [] = {
    { CONF_APPLICATION       , CONFTYPE_STR      , read_dapplication, DUMPTYPE_APPLICATION    , NULL },
    { CONF_SCRIPT            , CONFTYPE_STR      , read_dpp_script, DUMPTYPE_SCRIPTLIST       , NULL },
    { CONF_DATA_PATH         , CONFTYPE_DATA_PATH, read_data_path, DUMPTYPE_DATA_PATH         , NULL },
-   { CONF_ALLOW_SPLIT       , CONFTYPE_BOOLEAN  , read_bool    , DUMPTYPE_ALLOW_SPLIT       , NULL },
-   { CONF_RECOVERY_LIMIT    , CONFTYPE_RECOVERY_LIMIT, read_recovery_limit, DUMPTYPE_RECOVERY_LIMIT, NULL },
+   { CONF_ALLOW_SPLIT       , CONFTYPE_BOOLEAN  , read_bool    , DUMPTYPE_ALLOW_SPLIT        , NULL },
+   { CONF_RECOVERY_LIMIT    , CONFTYPE_HOST_LIMIT, read_host_limit, DUMPTYPE_RECOVERY_LIMIT  , NULL },
+   { CONF_DUMP_LIMIT        , CONFTYPE_HOST_LIMIT, read_host_limit, DUMPTYPE_DUMP_LIMIT      , validate_dump_limit },
    { CONF_UNKNOWN           , CONFTYPE_INT      , NULL          , DUMPTYPE_DUMPTYPE          , NULL }
 };
 
@@ -1298,6 +1395,7 @@ conf_var_t application_var [] = {
    { CONF_COMMENT  , CONFTYPE_STR     , read_str     , APPLICATION_COMMENT    , NULL },
    { CONF_PLUGIN   , CONFTYPE_STR     , read_str     , APPLICATION_PLUGIN     , NULL },
    { CONF_PROPERTY , CONFTYPE_PROPLIST, read_property, APPLICATION_PROPERTY   , NULL },
+   { CONF_CLIENT_NAME, CONFTYPE_STR   , read_str     , APPLICATION_CLIENT_NAME, NULL },
    { CONF_UNKNOWN  , CONFTYPE_INT     , NULL         , APPLICATION_APPLICATION, NULL }
 };
 
@@ -1308,6 +1406,8 @@ conf_var_t pp_script_var [] = {
    { CONF_EXECUTE_ON   , CONFTYPE_EXECUTE_ON  , read_execute_on  , PP_SCRIPT_EXECUTE_ON   , NULL },
    { CONF_EXECUTE_WHERE, CONFTYPE_EXECUTE_WHERE  , read_execute_where  , PP_SCRIPT_EXECUTE_WHERE, NULL },
    { CONF_ORDER        , CONFTYPE_INT     , read_int     , PP_SCRIPT_ORDER        , NULL },
+   { CONF_SINGLE_EXECUTION, CONFTYPE_BOOLEAN, read_bool    , PP_SCRIPT_SINGLE_EXECUTION, NULL },
+   { CONF_CLIENT_NAME  , CONFTYPE_STR     , read_str     , PP_SCRIPT_CLIENT_NAME  , NULL },
    { CONF_UNKNOWN      , CONFTYPE_INT     , NULL         , PP_SCRIPT_PP_SCRIPT    , NULL }
 };
 
@@ -1329,6 +1429,20 @@ conf_var_t changer_config_var [] = {
    { CONF_UNKNOWN         , CONFTYPE_INT      , NULL          , CHANGER_CONFIG_CHANGER_CONFIG , NULL }
 };
 
+conf_var_t interactivity_var [] = {
+   { CONF_COMMENT         , CONFTYPE_STR      , read_str      , INTERACTIVITY_COMMENT        , NULL },
+   { CONF_PLUGIN          , CONFTYPE_STR      , read_str      , INTERACTIVITY_PLUGIN         , NULL },
+   { CONF_PROPERTY        , CONFTYPE_PROPLIST , read_property , INTERACTIVITY_PROPERTY       , NULL },
+   { CONF_UNKNOWN         , CONFTYPE_INT      , NULL          , INTERACTIVITY_INTERACTIVITY  , NULL }
+};
+
+conf_var_t taperscan_var [] = {
+   { CONF_COMMENT         , CONFTYPE_STR      , read_str      , TAPERSCAN_COMMENT        , NULL },
+   { CONF_PLUGIN          , CONFTYPE_STR      , read_str      , TAPERSCAN_PLUGIN         , NULL },
+   { CONF_PROPERTY        , CONFTYPE_PROPLIST , read_property , TAPERSCAN_PROPERTY       , NULL },
+   { CONF_UNKNOWN         , CONFTYPE_INT      , NULL          , TAPERSCAN_TAPERSCAN      , NULL }
+};
+
 /*
  * Lexical Analysis Implementation
  */
@@ -1510,8 +1624,11 @@ negative_number: /* look for goto negative_number below sign is set there */
            *buf++ = (char)ch;
            while (inquote && ((ch = conftoken_getc()) != EOF)) {
                if (ch == '\n') {
-                   if (!escape)
+                   if (!escape) {
+                       conf_parserror(_("string not terminated"));
+                       conftoken_ungetc(ch);
                        break;
+                   }
                    escape = 0;
                    buf--; /* Consume escape in buffer */
                } else if (ch == '\\' && !escape) {
@@ -1778,7 +1895,9 @@ read_confline(
            else if(tok == CONF_DEVICE) get_device_config();
            else if(tok == CONF_CHANGER) get_changer_config();
            else if(tok == CONF_HOLDING) get_holdingdisk(1);
-           else conf_parserror(_("DUMPTYPE, INTERFACE, TAPETYPE, HOLDINGDISK, APPLICATION-TOOL, SCRIPT-TOOL, DEVICE, or CHANGER expected"));
+           else if(tok == CONF_INTERACTIVITY) get_interactivity();
+           else if(tok == CONF_TAPERSCAN) get_taperscan();
+           else conf_parserror(_("DUMPTYPE, INTERFACE, TAPETYPE, HOLDINGDISK, APPLICATION, SCRIPT, DEVICE, CHANGER, INTERACTIVITY or TAPERSCAN expected"));
        }
        break;
 
@@ -2241,7 +2360,7 @@ init_dumptype_defaults(void)
     conf_init_str   (&dpcur.value[DUMPTYPE_CLIENT_USERNAME]   , "");
     conf_init_str   (&dpcur.value[DUMPTYPE_CLIENT_PORT]       , "");
     conf_init_str   (&dpcur.value[DUMPTYPE_SSH_KEYS]          , "");
-    conf_init_str   (&dpcur.value[DUMPTYPE_AUTH]   , "BSD");
+    conf_init_str   (&dpcur.value[DUMPTYPE_AUTH]   , "BSDTCP");
     conf_init_exinclude(&dpcur.value[DUMPTYPE_EXCLUDE]);
     conf_init_exinclude(&dpcur.value[DUMPTYPE_INCLUDE]);
     conf_init_priority (&dpcur.value[DUMPTYPE_PRIORITY]          , 1);
@@ -2275,7 +2394,8 @@ init_dumptype_defaults(void)
     conf_init_identlist(&dpcur.value[DUMPTYPE_SCRIPTLIST], NULL);
     conf_init_proplist(&dpcur.value[DUMPTYPE_PROPERTY]);
     conf_init_bool     (&dpcur.value[DUMPTYPE_ALLOW_SPLIT]       , 1);
-    conf_init_recovery_limit(&dpcur.value[DUMPTYPE_RECOVERY_LIMIT]);
+    conf_init_host_limit(&dpcur.value[DUMPTYPE_RECOVERY_LIMIT]);
+    conf_init_host_limit_server(&dpcur.value[DUMPTYPE_DUMP_LIMIT]);
 }
 
 static void
@@ -2460,7 +2580,7 @@ static void
 init_interface_defaults(void)
 {
     conf_init_str(&ifcur.value[INTER_COMMENT] , "");
-    conf_init_int   (&ifcur.value[INTER_MAXUSAGE], 8000);
+    conf_init_int   (&ifcur.value[INTER_MAXUSAGE], 80000);
 }
 
 static void
@@ -2511,7 +2631,7 @@ copy_interface(void)
 }
 
 
-application_t *
+static application_t *
 read_application(
     char *name,
     FILE *from,
@@ -2586,6 +2706,7 @@ init_application_defaults(
     conf_init_str(&apcur.value[APPLICATION_COMMENT] , "");
     conf_init_str(&apcur.value[APPLICATION_PLUGIN]  , "");
     conf_init_proplist(&apcur.value[APPLICATION_PROPERTY]);
+    conf_init_str(&apcur.value[APPLICATION_CLIENT_NAME] , "");
 }
 
 static void
@@ -2637,7 +2758,259 @@ copy_application(void)
     }
 }
 
-pp_script_t *
+static interactivity_t *
+read_interactivity(
+    char *name,
+    FILE *from,
+    char *fname,
+    int *linenum)
+{
+    int save_overwrites;
+    FILE *saved_conf = NULL;
+    char *saved_fname = NULL;
+
+    if (from) {
+       saved_conf = current_file;
+       current_file = from;
+    }
+
+    if (fname) {
+       saved_fname = current_filename;
+       current_filename = get_seen_filename(fname);
+    }
+
+    if (linenum)
+       current_line_num = *linenum;
+
+    save_overwrites = allow_overwrites;
+    allow_overwrites = 1;
+
+    init_interactivity_defaults();
+    if (name) {
+       ivcur.name = name;
+    } else {
+       get_conftoken(CONF_IDENT);
+       ivcur.name = stralloc(tokenval.v.s);
+    }
+    ivcur.seen.filename = current_filename;
+    ivcur.seen.linenum = current_line_num;
+
+    read_block(interactivity_var, ivcur.value,
+              _("interactivity parameter expected"),
+              (name == NULL), *copy_interactivity,
+              "INTERACTIVITY", ivcur.name);
+    if(!name)
+       get_conftoken(CONF_NL);
+
+    save_interactivity();
+
+    allow_overwrites = save_overwrites;
+
+    if (linenum)
+       *linenum = current_line_num;
+
+    if (fname)
+       current_filename = saved_fname;
+
+    if (from)
+       current_file = saved_conf;
+
+    return lookup_interactivity(ivcur.name);
+}
+
+static void
+get_interactivity(
+    void)
+{
+    read_interactivity(NULL, NULL, NULL, NULL);
+}
+
+static void
+init_interactivity_defaults(
+    void)
+{
+    ivcur.name = NULL;
+    conf_init_str(&ivcur.value[INTERACTIVITY_COMMENT] , "");
+    conf_init_str(&ivcur.value[INTERACTIVITY_PLUGIN]  , "");
+    conf_init_proplist(&ivcur.value[INTERACTIVITY_PROPERTY]);
+}
+
+static void
+save_interactivity(
+    void)
+{
+    interactivity_t *iv, *iv1;
+
+    iv = lookup_interactivity(ivcur.name);
+
+    if (iv != (interactivity_t *)0) {
+       conf_parserror(_("interactivity %s already defined at %s:%d"),
+                      iv->name, iv->seen.filename, iv->seen.linenum);
+       return;
+    }
+
+    iv = alloc(sizeof(interactivity_t));
+    *iv = ivcur;
+    iv->next = NULL;
+    /* add at end of list */
+    if (!interactivity_list)
+       interactivity_list = iv;
+    else {
+       iv1 = interactivity_list;
+       while (iv1->next != NULL) {
+           iv1 = iv1->next;
+       }
+       iv1->next = iv;
+    }
+}
+
+static void
+copy_interactivity(void)
+{
+    interactivity_t *iv;
+    int i;
+
+    iv = lookup_interactivity(tokenval.v.s);
+
+    if (iv == NULL) {
+       conf_parserror(_("interactivity parameter expected"));
+       return;
+    }
+
+    for (i=0; i < INTERACTIVITY_INTERACTIVITY; i++) {
+       if(iv->value[i].seen.linenum) {
+           merge_val_t(&ivcur.value[i], &iv->value[i]);
+       }
+    }
+}
+
+static taperscan_t *
+read_taperscan(
+    char *name,
+    FILE *from,
+    char *fname,
+    int *linenum)
+{
+    int save_overwrites;
+    FILE *saved_conf = NULL;
+    char *saved_fname = NULL;
+
+    if (from) {
+       saved_conf = current_file;
+       current_file = from;
+    }
+
+    if (fname) {
+       saved_fname = current_filename;
+       current_filename = get_seen_filename(fname);
+    }
+
+    if (linenum)
+       current_line_num = *linenum;
+
+    save_overwrites = allow_overwrites;
+    allow_overwrites = 1;
+
+    init_taperscan_defaults();
+    if (name) {
+       tscur.name = name;
+    } else {
+       get_conftoken(CONF_IDENT);
+       tscur.name = stralloc(tokenval.v.s);
+    }
+    tscur.seen.filename = current_filename;
+    tscur.seen.linenum = current_line_num;
+
+    read_block(taperscan_var, tscur.value,
+              _("taperscan parameter expected"),
+              (name == NULL), *copy_taperscan,
+              "TAPERSCAN", tscur.name);
+    if(!name)
+       get_conftoken(CONF_NL);
+
+    save_taperscan();
+
+    allow_overwrites = save_overwrites;
+
+    if (linenum)
+       *linenum = current_line_num;
+
+    if (fname)
+       current_filename = saved_fname;
+
+    if (from)
+       current_file = saved_conf;
+
+    return lookup_taperscan(tscur.name);
+}
+
+static void
+get_taperscan(
+    void)
+{
+    read_taperscan(NULL, NULL, NULL, NULL);
+}
+
+static void
+init_taperscan_defaults(
+    void)
+{
+    tscur.name = NULL;
+    conf_init_str(&tscur.value[TAPERSCAN_COMMENT] , "");
+    conf_init_str(&tscur.value[TAPERSCAN_PLUGIN]  , "");
+    conf_init_proplist(&tscur.value[TAPERSCAN_PROPERTY]);
+}
+
+static void
+save_taperscan(
+    void)
+{
+    taperscan_t *ts, *ts1;
+
+    ts = lookup_taperscan(tscur.name);
+
+    if (ts != (taperscan_t *)0) {
+       conf_parserror(_("taperscan %s already defined at %s:%d"),
+                      ts->name, ts->seen.filename, ts->seen.linenum);
+       return;
+    }
+
+    ts = alloc(sizeof(taperscan_t));
+    *ts = tscur;
+    ts->next = NULL;
+    /* add at end of list */
+    if (!taperscan_list)
+       taperscan_list = ts;
+    else {
+       ts1 = taperscan_list;
+       while (ts1->next != NULL) {
+           ts1 = ts1->next;
+       }
+       ts1->next = ts;
+    }
+}
+
+static void
+copy_taperscan(void)
+{
+    taperscan_t *ts;
+    int i;
+
+    ts = lookup_taperscan(tokenval.v.s);
+
+    if (ts == NULL) {
+       conf_parserror(_("taperscan parameter expected"));
+       return;
+    }
+
+    for (i=0; i < TAPERSCAN_TAPERSCAN; i++) {
+       if(ts->value[i].seen.linenum) {
+           merge_val_t(&tscur.value[i], &ts->value[i]);
+       }
+    }
+}
+
+static pp_script_t *
 read_pp_script(
     char *name,
     FILE *from,
@@ -2715,6 +3088,8 @@ init_pp_script_defaults(
     conf_init_execute_on(&pscur.value[PP_SCRIPT_EXECUTE_ON], 0);
     conf_init_execute_where(&pscur.value[PP_SCRIPT_EXECUTE_WHERE], ES_CLIENT);
     conf_init_int(&pscur.value[PP_SCRIPT_ORDER], 5000);
+    conf_init_bool(&pscur.value[PP_SCRIPT_SINGLE_EXECUTION], 0);
+    conf_init_str(&pscur.value[PP_SCRIPT_CLIENT_NAME], "");
 }
 
 static void
@@ -2766,7 +3141,7 @@ copy_pp_script(void)
     }
 }
 
-device_config_t *
+static device_config_t *
 read_device_config(
     char *name,
     FILE *from,
@@ -2892,7 +3267,7 @@ copy_device_config(void)
     }
 }
 
-changer_config_t *
+static changer_config_t *
 read_changer_config(
     char *name,
     FILE *from,
@@ -3107,6 +3482,15 @@ read_bool(
     val_t__boolean(val) = get_bool();
 }
 
+static void
+read_no_yes_all(
+    conf_var_t *np G_GNUC_UNUSED,
+    val_t *val)
+{
+    ckseen(&val->seen);
+    val_t__int(val) = get_no_yes_all();
+}
+
 static void
 read_compress(
     conf_var_t *np G_GNUC_UNUSED,
@@ -3349,8 +3733,8 @@ read_data_path(
 
     get_conftoken(CONF_ANY);
     switch(tok) {
-    case CONF_AMANDA   : val_t__send_amreport(val) = DATA_PATH_AMANDA   ; break;
-    case CONF_DIRECTTCP: val_t__send_amreport(val) = DATA_PATH_DIRECTTCP; break;
+    case CONF_AMANDA   : val_t__data_path(val) = DATA_PATH_AMANDA   ; break;
+    case CONF_DIRECTTCP: val_t__data_path(val) = DATA_PATH_DIRECTTCP; break;
     default:
        conf_parserror(_("AMANDA or DIRECTTCP expected"));
     }
@@ -3587,6 +3971,64 @@ read_dapplication(
     ckseen(&val->seen);
 }
 
+static void
+read_dinteractivity(
+    conf_var_t *np G_GNUC_UNUSED,
+    val_t      *val)
+{
+    interactivity_t *interactivity;
+
+    get_conftoken(CONF_ANY);
+    if (tok == CONF_LBRACE) {
+       current_line_num -= 1;
+       interactivity = read_interactivity(vstralloc("custom(iv)", ".",
+                                                    anonymous_value(),NULL),
+                                      NULL, NULL, NULL);
+       current_line_num -= 1;
+    } else if (tok == CONF_STRING) {
+       interactivity = lookup_interactivity(tokenval.v.s);
+       if (interactivity == NULL) {
+           conf_parserror(_("Unknown interactivity named: %s"), tokenval.v.s);
+           return;
+       }
+    } else {
+       conf_parserror(_("interactivity name expected: %d %d"), tok, CONF_STRING);
+       return;
+    }
+    amfree(val->v.s);
+    val->v.s = stralloc(interactivity->name);
+    ckseen(&val->seen);
+}
+
+static void
+read_dtaperscan(
+    conf_var_t *np G_GNUC_UNUSED,
+    val_t      *val)
+{
+    taperscan_t *taperscan;
+
+    get_conftoken(CONF_ANY);
+    if (tok == CONF_LBRACE) {
+       current_line_num -= 1;
+       taperscan = read_taperscan(vstralloc("custom(ts)", ".",
+                                  anonymous_value(),NULL),
+                                  NULL, NULL, NULL);
+       current_line_num -= 1;
+    } else if (tok == CONF_STRING) {
+       taperscan = lookup_taperscan(tokenval.v.s);
+       if (taperscan == NULL) {
+           conf_parserror(_("Unknown taperscan named: %s"), tokenval.v.s);
+           return;
+       }
+    } else {
+       conf_parserror(_("taperscan name expected: %d %d"), tok, CONF_STRING);
+       return;
+    }
+    amfree(val->v.s);
+    val->v.s = stralloc(taperscan->name);
+    ckseen(&val->seen);
+}
+
 static void
 read_dpp_script(
     conf_var_t *np G_GNUC_UNUSED,
@@ -3631,16 +4073,22 @@ read_execute_on(
     val->v.i = 0;
     do {
        switch(tok) {
+       case CONF_PRE_AMCHECK:         val->v.i |= EXECUTE_ON_PRE_AMCHECK;          break;
        case CONF_PRE_DLE_AMCHECK:     val->v.i |= EXECUTE_ON_PRE_DLE_AMCHECK;     break;
        case CONF_PRE_HOST_AMCHECK:    val->v.i |= EXECUTE_ON_PRE_HOST_AMCHECK;    break;
        case CONF_POST_DLE_AMCHECK:    val->v.i |= EXECUTE_ON_POST_DLE_AMCHECK;    break;
        case CONF_POST_HOST_AMCHECK:   val->v.i |= EXECUTE_ON_POST_HOST_AMCHECK;   break;
+       case CONF_POST_AMCHECK:        val->v.i |= EXECUTE_ON_POST_AMCHECK;          break;
+       case CONF_PRE_ESTIMATE:        val->v.i |= EXECUTE_ON_PRE_ESTIMATE;          break;
        case CONF_PRE_DLE_ESTIMATE:    val->v.i |= EXECUTE_ON_PRE_DLE_ESTIMATE;    break;
        case CONF_PRE_HOST_ESTIMATE:   val->v.i |= EXECUTE_ON_PRE_HOST_ESTIMATE;   break;
        case CONF_POST_DLE_ESTIMATE:   val->v.i |= EXECUTE_ON_POST_DLE_ESTIMATE;   break;
        case CONF_POST_HOST_ESTIMATE:  val->v.i |= EXECUTE_ON_POST_HOST_ESTIMATE;  break;
+       case CONF_POST_ESTIMATE:       val->v.i |= EXECUTE_ON_POST_ESTIMATE;          break;
+       case CONF_PRE_BACKUP:          val->v.i |= EXECUTE_ON_PRE_BACKUP;          break;
        case CONF_PRE_DLE_BACKUP:      val->v.i |= EXECUTE_ON_PRE_DLE_BACKUP;      break;
        case CONF_PRE_HOST_BACKUP:     val->v.i |= EXECUTE_ON_PRE_HOST_BACKUP;     break;
+       case CONF_POST_BACKUP:         val->v.i |= EXECUTE_ON_POST_BACKUP;         break;
        case CONF_POST_DLE_BACKUP:     val->v.i |= EXECUTE_ON_POST_DLE_BACKUP;     break;
        case CONF_POST_HOST_BACKUP:    val->v.i |= EXECUTE_ON_POST_HOST_BACKUP;    break;
        case CONF_PRE_RECOVER:         val->v.i |= EXECUTE_ON_PRE_RECOVER;         break;
@@ -3783,13 +4231,17 @@ read_part_cache_type(
 }
 
 static void
-read_recovery_limit(
+read_host_limit(
     conf_var_t *np G_GNUC_UNUSED,
     val_t *val)
 {
-    recovery_limit_t *rl = &val_t__recovery_limit(val);
+    host_limit_t *rl = &val_t__host_limit(val);
     ckseen(&val->seen);
 
+    rl->match_pats = NULL;
+    rl->same_host  = FALSE;
+    rl->server     = FALSE;
+
     while (1) {
        get_conftoken(CONF_ANY);
        switch(tok) {
@@ -3800,6 +4252,10 @@ read_recovery_limit(
            rl->same_host = TRUE;
            break;
 
+       case CONF_SERVER:
+           rl->server = TRUE;
+           break;
+
        case CONF_NL:
        case CONF_END:
            return;
@@ -4283,6 +4739,59 @@ get_bool(void)
     return val;
 }
 
+static int
+get_no_yes_all(void)
+{
+    int val;
+    keytab_t *save_kt;
+
+    save_kt = keytable;
+    keytable = no_yes_all_keytable;
+
+    get_conftoken(CONF_ANY);
+
+    switch(tok) {
+    case CONF_INT:
+       val = tokenval.v.i;
+       break;
+
+    case CONF_SIZE:
+       val = tokenval.v.size;
+       break;
+
+    case CONF_INT64:
+       val = tokenval.v.int64;
+       break;
+
+    case CONF_ALL:
+       val = 2;
+       break;
+
+    case CONF_ATRUE:
+       val = 1;
+       break;
+
+    case CONF_AFALSE:
+       val = 0;
+       break;
+
+    case CONF_NL:
+       unget_conftoken();
+       val = 3; /* no argument - most likely TRUE */
+       break;
+    default:
+       unget_conftoken();
+       val = 3; /* a bad argument - most likely TRUE */
+       conf_parserror(_("%d: YES, NO, ALL, TRUE, FALSE, ON, OFF, 0, 1, 2 expected"), tok);
+       break;
+    }
+
+    if (val > 2 || val < 0)
+       val = 1;
+    keytable = save_kt;
+    return val;
+}
+
 void
 ckseen(
     seen_t *seen)
@@ -4661,6 +5170,8 @@ config_uninit(void)
     pp_script_t   *pp, *ppnext;
     device_config_t *dc, *dcnext;
     changer_config_t *cc, *ccnext;
+    interactivity_t  *iv, *ivnext;
+    taperscan_t      *ts, *tsnext;
     int               i;
 
     if (!config_initialized) return;
@@ -4743,9 +5254,28 @@ config_uninit(void)
        ccnext = cc->next;
        amfree(cc);
     }
-
     changer_config_list = NULL;
 
+    for(iv=interactivity_list; iv != NULL; iv = ivnext) {
+       amfree(iv->name);
+       for(i=0; i<INTERACTIVITY_INTERACTIVITY; i++) {
+          free_val_t(&iv->value[i]);
+       }
+       ivnext = iv->next;
+       amfree(iv);
+    }
+    interactivity_list = NULL;
+
+    for(ts=taperscan_list; ts != NULL; ts = tsnext) {
+       amfree(ts->name);
+       for(i=0; i<TAPERSCAN_TAPERSCAN; i++) {
+          free_val_t(&ts->value[i]);
+       }
+       tsnext = ts->next;
+       amfree(ts);
+    }
+    taperscan_list = NULL;
+
     for(i=0; i<CNF_CNF; i++)
        free_val_t(&conf_data[i]);
 
@@ -4776,9 +5306,10 @@ init_defaults(
     /* 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_AMDUMP_SERVER], DEFAULT_SERVER);
     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_AUTH], "bsdtcp");
     conf_init_str(&conf_data[CNF_SSH_KEYS], "");
     conf_init_str(&conf_data[CNF_AMANDAD_PATH], "");
     conf_init_str(&conf_data[CNF_CLIENT_USERNAME], "");
@@ -4803,7 +5334,7 @@ init_defaults(
     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_NETUSAGE]             , 80000);
     conf_init_int      (&conf_data[CNF_INPARALLEL]           , 10);
     conf_init_str   (&conf_data[CNF_DUMPORDER]            , "ttt");
     conf_init_int      (&conf_data[CNF_BUMPPERCENT]          , 0);
@@ -4819,7 +5350,7 @@ init_defaults(
     conf_init_size     (&conf_data[CNF_DEVICE_OUTPUT_BUFFER_SIZE], 40*32768);
     conf_init_str   (&conf_data[CNF_PRINTER]              , "");
     conf_init_str   (&conf_data[CNF_MAILER]               , DEFAULT_MAILER);
-    conf_init_bool     (&conf_data[CNF_AUTOFLUSH]            , 0);
+    conf_init_no_yes_all(&conf_data[CNF_AUTOFLUSH]            , 0);
     conf_init_int      (&conf_data[CNF_RESERVE]              , 100);
     conf_init_int64    (&conf_data[CNF_MAXDUMPSIZE]          , (gint64)-1);
     conf_init_str   (&conf_data[CNF_COLUMNSPEC]           , "");
@@ -4874,7 +5405,10 @@ init_defaults(
 #endif
     conf_init_send_amreport (&conf_data[CNF_SEND_AMREPORT_ON], SEND_AMREPORT_ALL);
     conf_init_autolabel(&conf_data[CNF_AUTOLABEL]);
-    conf_init_recovery_limit(&conf_data[CNF_RECOVERY_LIMIT]);
+    conf_init_str(&conf_data[CNF_META_AUTOLABEL], NULL);
+    conf_init_host_limit(&conf_data[CNF_RECOVERY_LIMIT]);
+    conf_init_str(&conf_data[CNF_INTERACTIVITY], NULL);
+    conf_init_str(&conf_data[CNF_TAPERSCAN], NULL);
 
     /* reset internal variables */
     config_clear_errors();
@@ -4931,6 +5465,14 @@ init_defaults(
     val_t__seen(&dpcur.value[DUMPTYPE_AUTH]).linenum = -1;
     save_dumptype();
 
+    init_dumptype_defaults();
+    dpcur.name = stralloc("BSDTCP-AUTH");
+    dpcur.seen.linenum = -1;
+    free_val_t(&dpcur.value[DUMPTYPE_AUTH]);
+    val_t__str(&dpcur.value[DUMPTYPE_AUTH]) = stralloc("BSDTCP");
+    val_t__seen(&dpcur.value[DUMPTYPE_AUTH]).linenum = -1;
+    save_dumptype();
+
     init_dumptype_defaults();
     dpcur.name = stralloc("NO-RECORD");
     dpcur.seen.linenum = -1;
@@ -5222,6 +5764,17 @@ conf_init_bool(
     val_t__boolean(val) = i;
 }
 
+static void
+conf_init_no_yes_all(
+    val_t *val,
+    int    i)
+{
+    val->seen.linenum = 0;
+    val->seen.filename = NULL;
+    val->type = CONFTYPE_NO_YES_ALL;
+    val_t__int(val) = i;
+}
+
 static void
 conf_init_compress(
     val_t *val,
@@ -5256,14 +5809,23 @@ conf_init_part_cache_type(
 }
 
 static void
-conf_init_recovery_limit(
+conf_init_host_limit(
     val_t *val)
 {
     val->seen.linenum = 0;
     val->seen.filename = NULL;
-    val->type = CONFTYPE_RECOVERY_LIMIT;
-    val_t__recovery_limit(val).match_pats = NULL;
-    val_t__recovery_limit(val).same_host = FALSE;
+    val->type = CONFTYPE_HOST_LIMIT;
+    val_t__host_limit(val).match_pats = NULL;
+    val_t__host_limit(val).same_host  = FALSE;
+    val_t__host_limit(val).server     = FALSE;
+}
+
+static void
+conf_init_host_limit_server(
+    val_t *val)
+{
+    conf_init_host_limit(val);
+    val_t__host_limit(val).server = TRUE;
 }
 
 static void
@@ -5468,6 +6030,8 @@ getconf_list(
     pp_script_t   *pp;
     device_config_t *dc;
     changer_config_t *cc;
+    interactivity_t  *iv;
+    taperscan_t      *ts;
     GSList *rv = NULL;
 
     if (strcasecmp(listname,"tapetype") == 0) {
@@ -5507,6 +6071,14 @@ getconf_list(
        for(cc = changer_config_list; cc != NULL; cc=cc->next) {
            rv = g_slist_append(rv, cc->name);
        }
+    } else if (strcasecmp(listname,"interactivity") == 0) {
+       for(iv = interactivity_list; iv != NULL; iv=iv->next) {
+           rv = g_slist_append(rv, iv->name);
+       }
+    } else if (strcasecmp(listname,"taperscan") == 0) {
+       for(ts = taperscan_list; ts != NULL; ts=ts->next) {
+           rv = g_slist_append(rv, ts->name);
+       }
     }
     return rv;
 }
@@ -5557,6 +6129,16 @@ validate_program(
        conf_parserror("program must be \"DUMP\", \"GNUTAR\", \"STAR\" or \"APPLICATION\"");
 }
 
+static void
+validate_dump_limit(
+    conf_var_t *np G_GNUC_UNUSED,
+    val_t        *val)
+{
+    if (val->v.host_limit.match_pats) {
+       conf_parserror("dump-limit can't specify hostname");
+    }
+}
+
 char *
 tapetype_name(
     tapetype_t *ttyp)
@@ -5694,6 +6276,66 @@ application_name(
     return ap->name;
 }
 
+interactivity_t *
+lookup_interactivity(
+    char *str)
+{
+    interactivity_t *p;
+
+    for(p = interactivity_list; p != NULL; p = p->next) {
+       if(strcasecmp(p->name, str) == 0) return p;
+    }
+    return NULL;
+}
+
+val_t *
+interactivity_getconf(
+    interactivity_t *iv,
+    interactivity_key key)
+{
+    assert(iv != NULL);
+    assert(key < INTERACTIVITY_INTERACTIVITY);
+    return &iv->value[key];
+}
+
+char *
+interactivity_name(
+    interactivity_t *iv)
+{
+    assert(iv != NULL);
+    return iv->name;
+}
+
+taperscan_t *
+lookup_taperscan(
+    char *str)
+{
+    taperscan_t *p;
+
+    for(p = taperscan_list; p != NULL; p = p->next) {
+       if(strcasecmp(p->name, str) == 0) return p;
+    }
+    return NULL;
+}
+
+val_t *
+taperscan_getconf(
+    taperscan_t *ts,
+    taperscan_key key)
+{
+    assert(ts != NULL);
+    assert(key < TAPERSCAN_TAPERSCAN);
+    return &ts->value[key];
+}
+
+char *
+taperscan_name(
+    taperscan_t *ts)
+{
+    assert(ts != NULL);
+    return ts->name;
+}
+
 pp_script_t *
 lookup_pp_script(
     char *str)
@@ -6079,6 +6721,18 @@ val_t_to_boolean(
     return val_t__boolean(val);
 }
 
+int
+val_t_to_no_yes_all(
+    val_t *val)
+{
+    assert(config_initialized);
+    if (val->type != CONFTYPE_NO_YES_ALL) {
+       error(_("val_t_to_no_yes_all: val.type is not CONFTYPE_NO_YES_ALL"));
+       /*NOTREACHED*/
+    }
+    return val_t__no_yes_all(val);
+}
+
 comp_t
 val_t_to_compress(
     val_t *val)
@@ -6115,16 +6769,16 @@ val_t_to_part_cache_type(
     return val_t__part_cache_type(val);
 }
 
-recovery_limit_t *
-val_t_to_recovery_limit(
+host_limit_t *
+val_t_to_host_limit(
     val_t *val)
 {
     assert(config_initialized);
-    if (val->type != CONFTYPE_RECOVERY_LIMIT) {
-       error(_("val_t_to_recovery_limit: val.type is not CONFTYPE_RECOVERY_LIMIT"));
+    if (val->type != CONFTYPE_HOST_LIMIT) {
+       error(_("val_t_to_host_limit: val.type is not CONFTYPE_HOST_LIMIT"));
        /*NOTREACHED*/
     }
-    return &val_t__recovery_limit(val);
+    return &val_t__host_limit(val);
 }
 
 dump_holdingdisk_t
@@ -6320,6 +6974,7 @@ copy_val_t(
        switch(valsrc->type) {
        case CONFTYPE_INT:
        case CONFTYPE_BOOLEAN:
+       case CONFTYPE_NO_YES_ALL:
        case CONFTYPE_COMPRESS:
        case CONFTYPE_ENCRYPT:
        case CONFTYPE_HOLDING:
@@ -6364,12 +7019,12 @@ copy_val_t(
            }
            break;
 
-       case CONFTYPE_RECOVERY_LIMIT:
-           valdst->v.recovery_limit = valsrc->v.recovery_limit;
-           valdst->v.recovery_limit.match_pats = NULL;
-           for (ia = valsrc->v.recovery_limit.match_pats; ia != NULL; ia = ia->next) {
-               valdst->v.recovery_limit.match_pats =
-                   g_slist_append(valdst->v.recovery_limit.match_pats, g_strdup(ia->data));
+       case CONFTYPE_HOST_LIMIT:
+           valdst->v.host_limit = valsrc->v.host_limit;
+           valdst->v.host_limit.match_pats = NULL;
+           for (ia = valsrc->v.host_limit.match_pats; ia != NULL; ia = ia->next) {
+               valdst->v.host_limit.match_pats =
+                   g_slist_append(valdst->v.host_limit.match_pats, g_strdup(ia->data));
            }
            break;
 
@@ -6487,6 +7142,7 @@ free_val_t(
     switch(val->type) {
        case CONFTYPE_INT:
        case CONFTYPE_BOOLEAN:
+       case CONFTYPE_NO_YES_ALL:
        case CONFTYPE_COMPRESS:
        case CONFTYPE_ENCRYPT:
        case CONFTYPE_HOLDING:
@@ -6515,8 +7171,8 @@ free_val_t(
            slist_free_full(val->v.identlist, g_free);
            break;
 
-       case CONFTYPE_RECOVERY_LIMIT:
-           slist_free_full(val->v.recovery_limit.match_pats, g_free);
+       case CONFTYPE_HOST_LIMIT:
+           slist_free_full(val->v.host_limit.match_pats, g_free);
            break;
 
        case CONFTYPE_TIME:
@@ -6576,6 +7232,8 @@ generic_client_get_security_conf(
 
        if(strcmp(string, "conf")==0) {
                return(getconf_str(CNF_CONF));
+       } else if(strcmp(string, "amdump_server")==0) {
+               return(getconf_str(CNF_AMDUMP_SERVER));
        } else if(strcmp(string, "index_server")==0) {
                return(getconf_str(CNF_INDEX_SERVER));
        } else if(strcmp(string, "tape_server")==0) {
@@ -6616,6 +7274,8 @@ dump_configuration(void)
     pp_script_t *ps;
     device_config_t *dc;
     changer_config_t *cc;
+    interactivity_t  *iv;
+    taperscan_t      *ts;
     int i;
     conf_var_t *np;
     keytab_t *kt;
@@ -6813,6 +7473,44 @@ dump_configuration(void)
        }
        g_printf("%s}\n",prefix);
     }
+
+    for(iv = interactivity_list; iv != NULL; iv = iv->next) {
+       prefix = "";
+       g_printf("\n%sDEFINE INTERACTIVITY %s {\n", prefix, iv->name);
+       for(i=0; i < INTERACTIVITY_INTERACTIVITY; i++) {
+           for(np=interactivity_var; np->token != CONF_UNKNOWN; np++)
+               if(np->parm == i) break;
+           if(np->token == CONF_UNKNOWN)
+               error(_("interactivity bad value"));
+
+           for(kt = server_keytab; kt->token != CONF_UNKNOWN; kt++)
+               if(kt->token == np->token) break;
+           if(kt->token == CONF_UNKNOWN)
+               error(_("interactivity bad token"));
+
+           val_t_print_token(stdout, prefix, "      %-19s ", kt, &iv->value[i]);
+       }
+       g_printf("%s}\n",prefix);
+    }
+
+    for(ts = taperscan_list; ts != NULL; ts = ts->next) {
+       prefix = "";
+       g_printf("\n%sDEFINE TAPERSCAN %s {\n", prefix, ts->name);
+       for(i=0; i < TAPERSCAN_TAPERSCAN; i++) {
+           for(np=taperscan_var; np->token != CONF_UNKNOWN; np++)
+               if(np->parm == i) break;
+           if(np->token == CONF_UNKNOWN)
+               error(_("taperscan bad value"));
+
+           for(kt = server_keytab; kt->token != CONF_UNKNOWN; kt++)
+               if(kt->token == np->token) break;
+           if(kt->token == CONF_UNKNOWN)
+               error(_("taperscan bad token"));
+
+           val_t_print_token(stdout, prefix, "      %-19s ", kt, &ts->value[i]);
+       }
+       g_printf("%s}\n",prefix);
+    }
 }
 
 static void
@@ -6965,6 +7663,20 @@ val_t_display_strs(
            buf[0] = stralloc("no");
        break;
 
+    case CONFTYPE_NO_YES_ALL:
+       switch(val_t__no_yes_all(val)) {
+       case 0:
+           buf[0] = stralloc("no");
+           break;
+       case 1:
+           buf[0] = stralloc("yes");
+           break;
+       case 2:
+           buf[0] = stralloc("all");
+           break;
+       }
+       break;
+
     case CONFTYPE_STRATEGY:
        switch(val_t__strategy(val)) {
        case DS_SKIP:
@@ -7117,14 +7829,17 @@ val_t_display_strs(
        }
        break;
 
-     case CONFTYPE_RECOVERY_LIMIT: {
-       GSList *iter = val_t__recovery_limit(val).match_pats;
+     case CONFTYPE_HOST_LIMIT: {
+       GSList *iter = val_t__host_limit(val).match_pats;
 
-       if(val_t__recovery_limit(val).same_host)
+       if (val_t__host_limit(val).same_host)
            buf[0] = stralloc("SAME-HOST ");
        else
            buf[0] = stralloc("");
 
+       if (val_t__host_limit(val).server)
+           strappend(buf[0], "SERVER ");
+
        while (iter) {
            strappend(buf[0], quote_string_always((char *)iter->data));
            strappend(buf[0], " ");
@@ -7197,6 +7912,10 @@ val_t_display_strs(
        buf[0] = stralloc("");
        if (val->v.i != 0) {
            char *sep = "";
+           if (val->v.i & EXECUTE_ON_PRE_AMCHECK) {
+               buf[0] = vstrextend(&buf[0], sep, "PRE-AMCHECK", NULL);
+               sep = ", ";
+           }
            if (val->v.i & EXECUTE_ON_PRE_DLE_AMCHECK) {
                buf[0] = vstrextend(&buf[0], sep, "PRE-DLE-AMCHECK", NULL);
                sep = ", ";
@@ -7213,6 +7932,14 @@ val_t_display_strs(
                buf[0] = vstrextend(&buf[0], sep, "POST-HOST-AMCHECK", NULL);
                sep = ", ";
            }
+           if (val->v.i & EXECUTE_ON_POST_AMCHECK) {
+               buf[0] = vstrextend(&buf[0], sep, "POST-AMCHECK", NULL);
+               sep = ", ";
+           }
+           if (val->v.i & EXECUTE_ON_PRE_ESTIMATE) {
+               buf[0] = vstrextend(&buf[0], sep, "PRE-ESTIMATE", NULL);
+               sep = ", ";
+           }
            if (val->v.i & EXECUTE_ON_PRE_DLE_ESTIMATE) {
                buf[0] = vstrextend(&buf[0], sep, "PRE-DLE-ESTIMATE", NULL);
                sep = ", ";
@@ -7229,6 +7956,14 @@ val_t_display_strs(
                buf[0] = vstrextend(&buf[0], sep, "POST-HOST-ESTIMATE", NULL);
                sep = ", ";
            }
+           if (val->v.i & EXECUTE_ON_POST_ESTIMATE) {
+               buf[0] = vstrextend(&buf[0], sep, "POST-ESTIMATE", NULL);
+               sep = ", ";
+           }
+           if (val->v.i & EXECUTE_ON_PRE_BACKUP) {
+               buf[0] = vstrextend(&buf[0], sep, "PRE-BACKUP", NULL);
+               sep = ", ";
+           }
            if (val->v.i & EXECUTE_ON_PRE_DLE_BACKUP) {
                buf[0] = vstrextend(&buf[0], sep, "PRE-DLE-BACKUP", NULL);
                sep = ", ";
@@ -7237,6 +7972,10 @@ val_t_display_strs(
                buf[0] = vstrextend(&buf[0], sep, "PRE-HOST-BACKUP", NULL);
                sep = ", ";
            }
+           if (val->v.i & EXECUTE_ON_POST_BACKUP) {
+               buf[0] = vstrextend(&buf[0], sep, "POST-BACKUP", NULL);
+               sep = ", ";
+           }
            if (val->v.i & EXECUTE_ON_POST_DLE_BACKUP) {
                buf[0] = vstrextend(&buf[0], sep, "POST-DLE-BACKUP", NULL);
                sep = ", ";
index cedc4a7fcd8bb8cbe0ee3058fc21db317c68a466..b901b6f2272e35a41504e5c66e808fa794b77a45 100644 (file)
@@ -155,23 +155,29 @@ typedef enum {
 } taperalgo_t;
 
 /* execute_on types */
-#define EXECUTE_ON_PRE_DLE_AMCHECK     1<<0
-#define EXECUTE_ON_PRE_HOST_AMCHECK    1<<1
-#define EXECUTE_ON_POST_DLE_AMCHECK    1<<2
-#define EXECUTE_ON_POST_HOST_AMCHECK   1<<3
-#define EXECUTE_ON_PRE_DLE_ESTIMATE    1<<4
-#define EXECUTE_ON_PRE_HOST_ESTIMATE   1<<5
-#define EXECUTE_ON_POST_DLE_ESTIMATE   1<<6
-#define EXECUTE_ON_POST_HOST_ESTIMATE  1<<7
-#define EXECUTE_ON_PRE_DLE_BACKUP      1<<8
-#define EXECUTE_ON_PRE_HOST_BACKUP     1<<9
-#define EXECUTE_ON_POST_DLE_BACKUP     1<<10
-#define EXECUTE_ON_POST_HOST_BACKUP    1<<11
-#define EXECUTE_ON_PRE_RECOVER         1<<12
-#define EXECUTE_ON_POST_RECOVER        1<<13
-#define EXECUTE_ON_PRE_LEVEL_RECOVER   1<<14
-#define EXECUTE_ON_POST_LEVEL_RECOVER  1<<15
-#define EXECUTE_ON_INTER_LEVEL_RECOVER 1<<16
+#define EXECUTE_ON_PRE_AMCHECK         1<<0
+#define EXECUTE_ON_PRE_DLE_AMCHECK     1<<1
+#define EXECUTE_ON_PRE_HOST_AMCHECK    1<<2
+#define EXECUTE_ON_POST_AMCHECK        1<<3
+#define EXECUTE_ON_POST_DLE_AMCHECK    1<<4
+#define EXECUTE_ON_POST_HOST_AMCHECK   1<<5
+#define EXECUTE_ON_PRE_ESTIMATE        1<<6
+#define EXECUTE_ON_PRE_DLE_ESTIMATE    1<<7
+#define EXECUTE_ON_PRE_HOST_ESTIMATE   1<<8
+#define EXECUTE_ON_POST_ESTIMATE       1<<9
+#define EXECUTE_ON_POST_DLE_ESTIMATE   1<<10
+#define EXECUTE_ON_POST_HOST_ESTIMATE  1<<11
+#define EXECUTE_ON_PRE_BACKUP          1<<12
+#define EXECUTE_ON_PRE_DLE_BACKUP      1<<13
+#define EXECUTE_ON_PRE_HOST_BACKUP     1<<14
+#define EXECUTE_ON_POST_BACKUP         1<<15
+#define EXECUTE_ON_POST_DLE_BACKUP     1<<16
+#define EXECUTE_ON_POST_HOST_BACKUP    1<<17
+#define EXECUTE_ON_PRE_RECOVER         1<<18
+#define EXECUTE_ON_POST_RECOVER        1<<19
+#define EXECUTE_ON_PRE_LEVEL_RECOVER   1<<20
+#define EXECUTE_ON_POST_LEVEL_RECOVER  1<<21
+#define EXECUTE_ON_INTER_LEVEL_RECOVER 1<<22
 typedef int execute_on_t;
 
 typedef int execute_where_t;
@@ -211,11 +217,12 @@ typedef enum {
     PART_CACHE_TYPE_DISK,
 } part_cache_type_t;
 
-/* recovery_limit */
+/* host_limit */
 typedef struct {
+    gboolean server;
     gboolean same_host;
     GSList *match_pats;
-} recovery_limit_t;
+} host_limit_t;
 
 /* Names for the type of value in a val_t.  Mostly for internal use, but useful
  * for wrapping val_t's, too. */
@@ -247,7 +254,8 @@ typedef enum {
     CONFTYPE_DATA_PATH,
     CONFTYPE_AUTOLABEL,
     CONFTYPE_PART_CACHE_TYPE,
-    CONFTYPE_RECOVERY_LIMIT,
+    CONFTYPE_HOST_LIMIT,
+    CONFTYPE_NO_YES_ALL,
 } conftype_t;
 
 /* A "seen" struct.  Rather than allocate strings all over the place, this
@@ -276,7 +284,7 @@ typedef struct val_s {
        estimatelist_t  estimatelist;
        identlist_t     identlist;
         autolabel_t     autolabel;
-       recovery_limit_t recovery_limit;
+       host_limit_t    host_limit;
     } v;
     seen_t seen;
     conftype_t type;
@@ -294,6 +302,7 @@ identlist_t           val_t_to_identlist(val_t *);
 time_t                val_t_to_time     (val_t *);
 ssize_t               val_t_to_size     (val_t *);
 int                   val_t_to_boolean  (val_t *);
+int                   val_t_to_no_yes_all(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 *);
@@ -312,7 +321,7 @@ send_amreport_t       val_t_to_send_amreport(val_t *);
 data_path_t           val_t_to_data_path(val_t *);
 autolabel_t           val_t_to_autolabel(val_t *);
 part_cache_type_t     val_t_to_part_cache_type(val_t *);
-recovery_limit_t     *val_t_to_recovery_limit(val_t *);
+host_limit_t         *val_t_to_host_limit(val_t *);
 
 /* Has the given val_t been seen in a configuration file or config overwrite?
  *
@@ -345,6 +354,7 @@ recovery_limit_t     *val_t_to_recovery_limit(val_t *);
 #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__no_yes_all(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)
@@ -363,7 +373,7 @@ recovery_limit_t     *val_t_to_recovery_limit(val_t *);
 #define val_t__data_path(val)     ((val)->v.i)
 #define val_t__autolabel(val)     ((val)->v.autolabel)
 #define val_t__part_cache_type(val) ((val)->v.i)
-#define val_t__recovery_limit(val) ((val)->v.recovery_limit)
+#define val_t__host_limit(val)    ((val)->v.host_limit)
 
 /*
  * Parameters
@@ -381,6 +391,7 @@ typedef enum {
     CNF_CONF,
     CNF_INDEX_SERVER,
     CNF_TAPE_SERVER,
+    CNF_AMDUMP_SERVER,
     CNF_AUTH,
     CNF_SSH_KEYS,
     CNF_AMANDAD_PATH,
@@ -393,6 +404,7 @@ typedef enum {
     CNF_TAPEDEV,
     CNF_DEVICE_PROPERTY,
     CNF_PROPERTY,
+    CNF_INTERACTIVITY,
     CNF_APPLICATION,
     CNF_APPLICATION_TOOL,
     CNF_EXECUTE_ON,
@@ -469,9 +481,11 @@ typedef enum {
     CNF_UNRESERVED_TCP_PORT,
     CNF_HOLDINGDISK,
     CNF_AUTOLABEL,
+    CNF_META_AUTOLABEL,
     CNF_DEBUG_DAYS,
     CNF_TAPER_PARALLEL_WRITE,
     CNF_RECOVERY_LIMIT,
+    CNF_TAPERSCAN,
     CNF_CNF /* sentinel */
 } confparm_key;
 
@@ -508,6 +522,7 @@ val_t *getconf(confparm_key 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_no_yes_all(key)   (val_t_to_no_yes_all(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))))
@@ -522,7 +537,7 @@ val_t *getconf(confparm_key key);
 #define getconf_send_amreport(key) (val_t_to_send_amreport(getconf((key))))
 #define getconf_autolabel(key)    (val_t_to_autolabel(getconf((key))))
 #define getconf_part_cache_type(key) (val_t_to_part_cache_type(getconf((key))))
-#define getconf_recovery_limit(key) (val_t_to_recovery_limit(getconf((key))))
+#define getconf_recovery_limit(key) (val_t_to_host_limit(getconf((key))))
 
 /* Get a list of names for subsections of the given type
  *
@@ -697,6 +712,7 @@ typedef enum {
     DUMPTYPE_DATA_PATH,
     DUMPTYPE_ALLOW_SPLIT,
     DUMPTYPE_RECOVERY_LIMIT,
+    DUMPTYPE_DUMP_LIMIT,
     DUMPTYPE_DUMPTYPE /* sentinel */
 } dumptype_key;
 
@@ -783,10 +799,11 @@ char *dumptype_name(dumptype_t *dtyp);
 #define dumptype_get_application(dtyp)         (val_t_to_application(dumptype_getconf((dtyp), DUMPTYPE_APPLICATION)))
 #define dumptype_get_scriptlist(dtyp)          (val_t_to_identlist(dumptype_getconf((dtyp), DUMPTYPE_SCRIPTLIST)))
 #define dumptype_get_property(dtyp)            (val_t_to_proplist(dumptype_getconf((dtyp), DUMPTYPE_PROPERTY)))
-#define dumptype_get_client_port(dtyp)             (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_CLIENT_PORT)))
-#define dumptype_get_data_path(dtyp)             (val_t_to_data_path(dumptype_getconf((dtyp), DUMPTYPE_DATA_PATH)))
+#define dumptype_get_client_port(dtyp)         (val_t_to_str(dumptype_getconf((dtyp), DUMPTYPE_CLIENT_PORT)))
+#define dumptype_get_data_path(dtyp)           (val_t_to_data_path(dumptype_getconf((dtyp), DUMPTYPE_DATA_PATH)))
 #define dumptype_get_allow_split(dtyp)         (val_t_to_boolean(dumptype_getconf((dtyp), DUMPTYPE_ALLOW_SPLIT)))
-#define dumptype_get_recovery_limit(dtyp)      (val_t_to_recovery_limit(dumptype_getconf((dtyp), DUMPTYPE_RECOVERY_LIMIT)))
+#define dumptype_get_recovery_limit(dtyp)      (val_t_to_host_limit(dumptype_getconf((dtyp), DUMPTYPE_RECOVERY_LIMIT)))
+#define dumptype_get_dump_limit(dtyp)          (val_t_to_host_limit(dumptype_getconf((dtyp), DUMPTYPE_DUMP_LIMIT)))
 
 /*
  * Interface parameter access
@@ -909,6 +926,7 @@ typedef enum application_e  {
     APPLICATION_COMMENT,
     APPLICATION_PLUGIN,
     APPLICATION_PROPERTY,
+    APPLICATION_CLIENT_NAME,
     APPLICATION_APPLICATION
 } application_key;
 
@@ -956,8 +974,7 @@ char *application_name(application_t *app);
 #define application_get_comment(application)  (val_t_to_str(application_getconf((application), APPLICATION_COMMENT))
 #define application_get_plugin(application)   (val_t_to_str(application_getconf((application), APPLICATION_PLUGIN)))
 #define application_get_property(application) (val_t_to_proplist(application_getconf((application), APPLICATION_PROPERTY)))
-
-application_t *read_application(char *name, FILE *from, char *fname, int *linenum);
+#define application_get_client_name(application) (val_t_to_str(application_getconf((application), APPLICATION_CLIENT_NAME)))
 
 /* A pp-script-tool interface */
 typedef enum pp_script_e  {
@@ -967,6 +984,8 @@ typedef enum pp_script_e  {
     PP_SCRIPT_EXECUTE_ON,
     PP_SCRIPT_EXECUTE_WHERE,
     PP_SCRIPT_ORDER,
+    PP_SCRIPT_SINGLE_EXECUTION,
+    PP_SCRIPT_CLIENT_NAME,
     PP_SCRIPT_PP_SCRIPT
 } pp_script_key;
 
@@ -1018,8 +1037,9 @@ char *pp_script_name(pp_script_t *pps);
 #define pp_script_get_execute_on(pp_script)   (val_t_to_execute_on(pp_script_getconf((pp_script), PP_SCRIPT_EXECUTE_ON)))
 #define pp_script_get_execute_where(pp_script)   (val_t_to_execute_where(pp_script_getconf((pp_script), PP_SCRIPT_EXECUTE_WHERE)))
 #define pp_script_get_order(pp_script)   (val_t_to_int(pp_script_getconf((pp_script), PP_SCRIPT_ORDER)))
+#define pp_script_get_single_execution(pp_script)   (val_t_to_boolean(pp_script_getconf((pp_script), PP_SCRIPT_SINGLE_EXECUTION)))
+#define pp_script_get_client_name(pp_script)   (val_t_to_str(pp_script_getconf((pp_script), PP_SCRIPT_CLIENT_NAME)))
 
-pp_script_t *read_pp_script(char *name, FILE *from, char *fname, int *linenum);
 pp_script_t *lookup_pp_script(char *identifier);
 
 /* A device definition */
@@ -1076,7 +1096,6 @@ char *device_config_name(device_config_t *devconf);
 #define device_config_get_tapedev(devconf)   (val_t_to_str(device_config_getconf((devconf), DEVICE_CONFIG_TAPEDEV)))
 #define device_config_get_property(devconf)   (val_t_to_proplist(device_config_getconf((devconf), DEVICE_CONFIG_DEVICE_PROPERTY)))
 
-device_config_t *read_device_config(char *name, FILE *from, char *fname, int *linenum);
 device_config_t *lookup_device_config(char *identifier);
 
 /* A changer definition */
@@ -1139,9 +1158,117 @@ char *changer_config_name(changer_config_t *devconf);
 #define changer_config_get_changerdev(devconf)   (val_t_to_str(changer_config_getconf((devconf), CHANGER_CONFIG_CHANGERDEV)))
 #define changer_config_get_changerfile(devconf)   (val_t_to_str(changer_config_getconf((devconf), CHANGER_CONFIG_CHANGERFILE)))
 
-changer_config_t *read_changer_config(char *name, FILE *from, char *fname, int *linenum);
 changer_config_t *lookup_changer_config(char *identifier);
 
+/* A interacrtivity interface */
+typedef enum interactivity_e  {
+    INTERACTIVITY_COMMENT,
+    INTERACTIVITY_PLUGIN,
+    INTERACTIVITY_PROPERTY,
+    INTERACTIVITY_INTERACTIVITY
+} interactivity_key;
+
+/* opaque object */
+typedef struct interactivity_s interactivity_t;
+
+/* Given the name of the interactivity, return a interactivity object.
+ *  Returns NULL if no matching interactivity exists.
+ *  Note that the match is case-insensitive.
+ *
+ * @param identifier: name of the desired interactivity
+ * @returns: object or NULL
+ */
+
+interactivity_t *lookup_interactivity(char *identifier);
+
+/* Given a interactivity and a key, return a pointer to the corresponding val_t.
+ *
+ * @param ttyp: the interactivity to examine
+ * @param key: interactivity (one of the INTERACTIVITY_* constants)
+ * @returns: pointer to value
+ */
+val_t *interactivity_getconf(interactivity_t *app, interactivity_key key);
+
+/* Get the name of this interactivity.
+ *
+ * @param ttyp: the interactivity to examine
+ * @returns: name of the interactivity
+ */
+char *interactivity_name(interactivity_t *app);
+
+/* (convenience macro) has this parameter been seen in this interactivity?
+ * This applies to the specific parameter *within* the interactivity.
+ *
+ * @param key: interactivity_key
+ * @returns: boolean
+ */
+#define interactivity_seen(app, key)       (val_t_seen(interactivity_getconf((app), (key))))
+
+/* (convenience macros)
+ * fetch a particular parameter; caller must know the correct type.
+ *
+ * @param ttyp: the interactivity to examine
+ * @returns: various
+ */
+#define interactivity_get_comment(interactivity)  (val_t_to_str(interactivity_getconf((interactivity), INTERACTIVITY_COMMENT))
+#define interactivity_get_plugin(interactivity)   (val_t_to_str(interactivity_getconf((interactivity), INTERACTIVITY_PLUGIN)))
+#define interactivity_get_property(interactivity) (val_t_to_proplist(interactivity_getconf((interactivity), INTERACTIVITY_PROPERTY)))
+
+/* A taperscan interface */
+typedef enum taperscan_e  {
+    TAPERSCAN_COMMENT,
+    TAPERSCAN_PLUGIN,
+    TAPERSCAN_PROPERTY,
+    TAPERSCAN_TAPERSCAN
+} taperscan_key;
+
+/* opaque object */
+typedef struct taperscan_s taperscan_t;
+
+/* Given the name of the taperscan, return a taperscan object.
+ *  Returns NULL if no matching taperscan exists.
+ *  Note that the match is case-insensitive.
+ *
+ * @param identifier: name of the desired taperscan
+ * @returns: object or NULL
+ */
+
+taperscan_t *lookup_taperscan(char *identifier);
+
+/* Given a taperscan and a key, return a pointer to the corresponding val_t.
+ *
+ * @param ttyp: the taperscan to examine
+ * @param key: taperscan (one of the TAPERSCAN_* constants)
+ * @returns: pointer to value
+ */
+val_t *taperscan_getconf(taperscan_t *app, taperscan_key key);
+
+/* Get the name of this taperscan.
+ *
+ * @param ttyp: the taperscan to examine
+ * @returns: name of the taperscan
+ */
+char *taperscan_name(taperscan_t *app);
+
+/* (convenience macro) has this parameter been seen in this taperscan?
+ * This applies to the specific parameter *within* the taperscan.
+ *
+ * @param key: taperscan_key
+ * @returns: boolean
+ */
+#define taperscan_seen(app, key)       (val_t_seen(taperscan_getconf((app), (key))))
+
+/* (convenience macros)
+ * fetch a particular parameter; caller must know the correct type.
+ *
+ * @param ttyp: the taperscan to examine
+ * @returns: various
+ */
+#define taperscan_get_comment(taperscan)  (val_t_to_str(taperscan_getconf((taperscan), TAPERSCAN_COMMENT))
+#define taperscan_get_plugin(taperscan)   (val_t_to_str(taperscan_getconf((taperscan), TAPERSCAN_PLUGIN)))
+#define taperscan_get_property(taperscan) (val_t_to_proplist(taperscan_getconf((taperscan), TAPERSCAN_PROPERTY)))
+
+
 /*
  * Error Handling
  */
index 91fb19df1a700b29fbc17983e1b7eefd6861dd61..9fa8f2cd04049ecb3e8ffcf84e87d99d3b005bd4 100644 (file)
 #define DIRECTTCP_H
 
 #include <glib.h>
+#include <amanda.h>
 
-/* A combination of IP address (expressed as an integer in host byte
- * order) and port.  These are commonly seen in arrays terminated by
- * a {0,0}.  Note that, right now, only IPv4 addresses are supported
- * (since this is all that NDMP supports). */
-typedef struct DirectTCPAddr_ {
-    guint32 ipv4;
-    guint16 port;
-} DirectTCPAddr;
+/* The address to connect to. These are commonly seen in arrays
+ * terminated by a family of 0. */
+#define DirectTCPAddr sockaddr_union
 
 #endif /* DIRECTTCP_H */
index df7e2163d1d9385a5b52fb8c133366929cc8a8cf..e4c67c5629d983b845585a0f01b409b84708269d 100644 (file)
@@ -58,7 +58,7 @@ test_decrement_cb(void *up G_GNUC_UNUSED)
 /****
  * Test that EV_TIME events fire, repeatedly.
  */
-static int
+static gboolean
 test_ev_time(void)
 {
     global = 2;
@@ -74,7 +74,7 @@ test_ev_time(void)
 /****
  * Test that nonblocking waits don't block.
  */
-static int
+static gboolean
 test_nonblock(void)
 {
     global = 1; /* the callback should not be triggered, so this should stay 1 */
@@ -90,24 +90,24 @@ test_nonblock(void)
  * another iteration of the event loop.  Security API depends on callbacks occuring
  * immediately.
  */
-static int
+static gboolean
 test_ev_wait(void)
 {
     global = 2;
     hdl[0] = event_register(4422, EV_WAIT, test_decrement_cb, NULL);
 
-    if (global != 2) return 0;
+    if (global != 2) return FALSE;
     event_wakeup(4422);
-    if (global != 1) return 0;
+    if (global != 1) return FALSE;
     event_wakeup(4422);
-    if (global != 0) return 0;
+    if (global != 0) return FALSE;
     event_wakeup(4422); /* the handler has been removed, but this is not an error */
-    if (global != 0) return 0;
+    if (global != 0) return FALSE;
 
     /* queue should now be empty, so this won't block */
     event_loop(0);
 
-    return 1;
+    return TRUE;
 }
 
 /****
@@ -131,22 +131,22 @@ test_ev_wait_2_cb(void *up G_GNUC_UNUSED)
     }
 }
 
-static int
+static gboolean
 test_ev_wait_2(void)
 {
     global = 2;
     hdl[0] = event_register(84, EV_WAIT, test_ev_wait_2_cb, NULL);
 
     /* Each wakeup should only invoke the callback *once* */
-    if (global != 2) return 0;
+    if (global != 2) return FALSE;
     event_wakeup(84);
-    if (global != 1) return 0;
+    if (global != 1) return FALSE;
     event_wakeup(84);
-    if (global != 0) return 0;
+    if (global != 0) return FALSE;
     event_wakeup(84); /* the handler has been removed, but this is not an error */
-    if (global != 0) return 0;
+    if (global != 0) return FALSE;
 
-    return 1;
+    return TRUE;
 }
 
 /****
@@ -163,7 +163,7 @@ test_event_wait_cb(void *up G_GNUC_UNUSED)
     event_release(hdl[1]);
 }
 
-static int
+static gboolean
 test_event_wait(void)
 {
     int cb_fired = 0;
@@ -183,16 +183,16 @@ test_event_wait(void)
      * three times */
     if (global == 0) {
        tu_dbg("global is already zero!\n");
-       return 0;
+       return FALSE;
     }
 
     /* and our own callback should have fired */
     if (!cb_fired) {
        tu_dbg("test_event_wait_cb didn't fire\n");
-       return 0;
+       return FALSE;
     }
 
-    return 1;
+    return TRUE;
 }
 
 /****
@@ -220,7 +220,7 @@ test_event_wait_2_wakeup_cb(void *up G_GNUC_UNUSED)
     event_wakeup(9876);
 }
 
-static int
+static gboolean
 test_event_wait_2(void)
 {
     int wakeups_remaining = 2;
@@ -243,16 +243,16 @@ test_event_wait_2(void)
      * three times */
     if (global == 0) {
        tu_dbg("global is already zero!\n");
-       return 0;
+       return FALSE;
     }
 
     /* and our own callback should have fired twice, not just once */
     if (wakeups_remaining != 0) {
        tu_dbg("test_event_wait_2_cb didn't fire twice\n");
-       return 0;
+       return FALSE;
     }
 
-    return 1;
+    return TRUE;
 }
 
 /****
@@ -308,7 +308,7 @@ test_ev_readfd_writer(int fd, size_t count)
 
 #define TEST_EV_READFD_SIZE (1024*1024)
 
-static int
+static gboolean
 test_ev_readfd(void)
 {
     int writer_pid;
@@ -329,7 +329,7 @@ test_ev_readfd(void)
 
        case -1: /* error */
            perror("fork");
-           return 0;
+           return FALSE;
 
        default: /* parent */
            break;
@@ -350,10 +350,10 @@ test_ev_readfd(void)
 
     if (global != 0) {
        tu_dbg("%d bytes remain unread..\n", global);
-       return 0;
+       return FALSE;
     }
 
-    return 1;
+    return TRUE;
 }
 
 /****
@@ -385,7 +385,7 @@ test_read_timeout_cb(void *up G_GNUC_UNUSED)
     event_release(hdl[1]);
 }
 
-static int
+static gboolean
 test_read_timeout(void)
 {
     int writer_pid;
@@ -406,7 +406,7 @@ test_read_timeout(void)
 
        case -1: /* error */
            perror("fork");
-           return 0;
+           return FALSE;
 
        default: /* parent */
            break;
@@ -427,9 +427,9 @@ test_read_timeout(void)
 
     /* see if we got the sentinel indicating the timeout fired */
     if (global != 1234)
-       return 0;
+       return FALSE;
 
-    return 1;
+    return TRUE;
 }
 
 /****
@@ -492,7 +492,7 @@ test_ev_writefd_consumer(int fd, size_t count)
 
 #define TEST_EV_WRITEFD_SIZE (1024*1024)
 
-static int
+static gboolean
 test_ev_writefd(void)
 {
     int reader_pid;
@@ -513,7 +513,7 @@ test_ev_writefd(void)
 
        case -1: /* error */
            perror("fork");
-           return 0;
+           return FALSE;
 
        default: /* parent */
            break;
@@ -535,10 +535,10 @@ test_ev_writefd(void)
     /* and see what we got */
     if (global != 0) {
        tu_dbg("writes did not complete\n");
-       return 0;
+       return FALSE;
     }
 
-    return 1;
+    return TRUE;
 }
 
 /****
@@ -569,7 +569,7 @@ test_child_watch_callback(
        g_main_loop_quit(test_child_watch_main_loop);
 }
 
-static int
+static gboolean
 test_child_watch_source(void)
 {
     int pid, pid2;
@@ -583,7 +583,7 @@ test_child_watch_source(void)
 
        case -1: /* error */
            perror("fork");
-           return 0;
+           return FALSE;
 
        default: /* parent */
            break;
@@ -603,7 +603,7 @@ test_child_watch_source(void)
 
        case -1: /* error */
            perror("fork");
-           return 0;
+           return FALSE;
 
        default: /* parent */
            break;
index c917e2a3ac0f42a6dd6eeb02f5ad95e3ea3684ab..ec8057d7043ba6b99f2c310f62ce5d604f03e1c1 100644 (file)
@@ -375,7 +375,7 @@ rt_type(dumpfile_t *hdr)
 }
 
 /* one function for each field; each fn calls the one above */
-static int
+static gboolean
 test_roundtrip(void)
 {
     int rv;
@@ -388,7 +388,7 @@ test_roundtrip(void)
 
     rv = PREV_RT(&hdr);
     tu_dbg("%d round-trips run\n", n_round_trips);
-    return rv;
+    return (rv) ? TRUE : FALSE;
 }
 
 /* doc
index 433625e7620f678e89410b6b2b3ad28f825ccbdd..4aeab435aa879720d91862d79b7b090964ba4293 100644 (file)
 #include "testutils.h"
 #include "simpleprng.h"
 
-static int test_encode(void);
-static int test_decode(void);
-static int test_roundtrip(void);
-static int test_roundtrip_rand(void);
+static gboolean test_encode(void);
+static gboolean test_decode(void);
+static gboolean test_roundtrip(void);
+static gboolean test_roundtrip_rand(void);
 
 typedef struct {char *in; char *out;} enc_vec;
-static int
+static gboolean
 test_encode(void)
 {
     static const enc_vec test_strs[] = {
@@ -41,7 +41,8 @@ test_encode(void)
         {"\nhi\n", "%0ahi%0a"}
     };
     static const int num = sizeof(test_strs)/sizeof(enc_vec);
-    int i, ret;
+    int i;
+    gboolean ret;
     char *tmp;
     
     ret = TRUE;
@@ -60,7 +61,7 @@ test_encode(void)
 }
 
 typedef struct {char *in; char *out; gboolean expect_err; } dec_vec;
-static int
+static gboolean
 test_decode(void)
 {
     static const dec_vec test_strs[] = {
@@ -80,7 +81,8 @@ test_decode(void)
         {"%00", "", TRUE}
     };
     static const int num = sizeof(test_strs)/sizeof(dec_vec);
-    int i, ret;
+    int i;
+    gboolean ret;
     char *tmp;
     GError *err = NULL;
     
@@ -104,7 +106,7 @@ test_decode(void)
 }
 
 typedef char* round_vec;
-static int
+static gboolean
 test_roundtrip(void)
 {
     static const round_vec test_strs[] = {
@@ -117,7 +119,8 @@ test_roundtrip(void)
         "h%"
     };
     static const int num = sizeof(test_strs)/sizeof(round_vec);
-    int i, ret;
+    int i;
+    gboolean ret;
     char *tmp_enc = NULL, *tmp_dec = NULL;
     GError *err = NULL;
     
@@ -140,10 +143,11 @@ test_roundtrip(void)
     return ret;
 }
 
-static int
+static gboolean
 test_roundtrip_rand(void)
 {
-    int i, ret;
+    int i;
+    gboolean ret;
     simpleprng_state_t state;
     char *in, *tmp_enc = NULL, *tmp_dec = NULL;
     size_t size;
index 11945c33ed73d7c85bf212748f3c1b430cff51bc..7361e6e6527b3be26164a7d027179a3d6e92b4b0 100644 (file)
@@ -158,7 +158,7 @@ test_sync_parent(ipc_binary_proto_t *proto, int fd)
     return 1;
 }
 
-static int
+static gboolean
 test_sync(void)
 {
     int rv;
@@ -170,7 +170,7 @@ test_sync(void)
 
     if (pipe(p) == -1) {
        perror("pipe");
-       return 0;
+       return FALSE;
     }
 
     proto = ipc_binary_proto_new(0xE10E);
@@ -187,7 +187,7 @@ test_sync(void)
 
     /* run the parent and collect the results */
     rv = test_sync_parent(proto, p[0]) && GPOINTER_TO_INT(g_thread_join(child));
-    return rv;
+    return (rv) ? TRUE : FALSE;
 }
 
 int
index 24016e7ed1efb7bc87780d0be09bcacdd866d357..9a27dff4099ad5ac2a4b6cdf9b7d30181749c415 100644 (file)
@@ -61,7 +61,7 @@ const security_driver_t local_security_driver = {
     "LOCAL",
     local_connect,
     sec_accept,
-    sec_get_authenticated_peer_name_localhost,
+    sec_get_authenticated_peer_name_gethostname,
     sec_close,
     stream_sendpkt,
     stream_recvpkt,
@@ -246,20 +246,25 @@ runlocal(
     /* drop root privs for good */
     set_root_privs(-1);
 
-    safe_fd(-1, 0);
-
     if(!xamandad_path || strlen(xamandad_path) <= 1) 
        xamandad_path = vstralloc(amlibexecdir, "/", "amandad", NULL);
 
 #ifndef SINGLE_USERID
+    if (client_username && *client_username != '\0') {
+       initgroups(client_username, gid);
+    } else {
+       initgroups(CLIENT_LOGIN, gid);
+    }
+    if (gid != 0)
+       setregid(uid, gid);
     if (uid != 0)
        setreuid(uid, uid);
-    if (gid != 0)
-       setregid(gid, gid);
 #endif
 
+    safe_fd(-1, 0);
+
     execlp(xamandad_path, xamandad_path,
-          "-auth=local", "amdump", "amindexd", "amidxtaped", (char *)NULL);
+          "-auth=local", (char *)NULL);
     error(_("error: couldn't exec %s: %s"), xamandad_path, strerror(errno));
 
     /* should never go here, shut up compiler warning */
index 63717385b68aef34bb19ec6b0931c6f9c5b3d325..8737e56584829f1f101625be1d8cee42eb365c14 100644 (file)
@@ -26,7 +26,7 @@
  * Tests
  */
 
-static int
+static gboolean
 test_validate_regexp(void)
 {
     gboolean ok = TRUE;
@@ -59,7 +59,7 @@ test_validate_regexp(void)
     return ok;
 }
 
-static int
+static gboolean
 test_match(void)
 {
     gboolean ok = TRUE;
@@ -184,7 +184,7 @@ test_match(void)
     return ok;
 }
 
-static int
+static gboolean
 test_validate_glob(void)
 {
     gboolean ok = TRUE;
@@ -224,7 +224,7 @@ test_validate_glob(void)
     return ok;
 }
 
-static int
+static gboolean
 test_glob_to_regex(void)
 {
     gboolean ok = TRUE;
@@ -253,7 +253,7 @@ test_glob_to_regex(void)
     return ok;
 }
 
-static int
+static gboolean
 test_match_glob(void)
 {
     gboolean ok = TRUE;
@@ -325,7 +325,7 @@ test_match_glob(void)
     return ok;
 }
 
-static int
+static gboolean
 test_match_tar(void)
 {
     gboolean ok = TRUE;
@@ -442,7 +442,7 @@ test_match_tar(void)
     return ok;
 }
 
-static int
+static gboolean
 test_make_exact_host_expression(void)
 {
     gboolean ok = TRUE;
@@ -493,7 +493,7 @@ test_make_exact_host_expression(void)
     return ok;
 }
 
-static int
+static gboolean
 test_match_host(void)
 {
     gboolean ok = TRUE;
@@ -605,7 +605,7 @@ test_match_host(void)
     return ok;
 }
 
-static int
+static gboolean
 test_make_exact_disk_expression(void)
 {
     gboolean ok = TRUE;
@@ -649,7 +649,7 @@ test_make_exact_disk_expression(void)
     return ok;
 }
 
-static int
+static gboolean
 test_match_disk(void)
 {
     gboolean ok = TRUE;
@@ -762,7 +762,7 @@ test_match_disk(void)
     return ok;
 }
 
-static int
+static gboolean
 test_match_datestamp(void)
 {
     gboolean ok = TRUE;
@@ -846,7 +846,7 @@ test_match_datestamp(void)
     return ok;
 }
 
-static int
+static gboolean
 test_match_level(void)
 {
     gboolean ok = TRUE;
index 826a2867fafceb46bd2e9dbc2b65184e2350b21e..362e3451c4f113d9502786594d4816a88286d8d8 100644 (file)
 static int match_word(const char *glob, const char *word, const char separator);
 static char *tar_to_regex(const char *glob);
 
+/*
+ * REGEX MATCHING FUNCTIONS
+ */
+
+/*
+ * Define a specific type to hold error messages in case regex compile/matching
+ * fails
+ */
+
+typedef char regex_errbuf[STR_SIZE];
+
+/*
+ * Validate one regular expression. If the regex is invalid, copy the error
+ * message into the supplied regex_errbuf pointer. Also, we want to know whether
+ * flags should include REG_NEWLINE (See regcomp(3) for details). Since this is
+ * the more frequent case, add REG_NEWLINE to the default flags, and remove it
+ * only if match_newline is set to FALSE.
+ */
+
+static gboolean do_validate_regex(const char *str, regex_t *regex,
+       regex_errbuf *errbuf, gboolean match_newline)
+{
+       int flags = REG_EXTENDED | REG_NOSUB | REG_NEWLINE;
+       int result;
+
+       if (!match_newline)
+               CLR(flags, REG_NEWLINE);
+
+       result = regcomp(regex, str, flags);
+
+       if (!result)
+               return TRUE;
+
+       regerror(result, regex, *errbuf, SIZEOF(*errbuf));
+       return FALSE;
+}
+
+/*
+ * See if a string matches a regular expression. Return one of MATCH_* defined
+ * below. If, for some reason, regexec() returns something other than not 0 or
+ * REG_NOMATCH, return MATCH_ERROR and print the error message in the supplied
+ * regex_errbuf.
+ */
+
+#define MATCH_OK (1)
+#define MATCH_NONE (0)
+#define MATCH_ERROR (-1)
+
+static int try_match(regex_t *regex, const char *str,
+    regex_errbuf *errbuf)
+{
+    int result = regexec(regex, str, 0, 0, 0);
+
+    switch(result) {
+        case 0:
+            return MATCH_OK;
+        case REG_NOMATCH:
+            return MATCH_NONE;
+        /* Fall through: something went really wrong */
+    }
+
+    regerror(result, regex, *errbuf, SIZEOF(*errbuf));
+    return MATCH_ERROR;
+}
+
 char *
 validate_regexp(
     const char *       regex)
 {
     regex_t regc;
-    int result;
-    static char errmsg[STR_SIZE];
+    static regex_errbuf errmsg;
+    gboolean valid;
 
-    if ((result = regcomp(&regc, regex,
-                         REG_EXTENDED|REG_NOSUB|REG_NEWLINE)) != 0) {
-      regerror(result, &regc, errmsg, SIZEOF(errmsg));
-      return errmsg;
-    }
+    valid = do_validate_regex(regex, &regc, &errmsg, TRUE);
 
     regfree(&regc);
-
-    return NULL;
+    return (valid) ? NULL : errmsg;
 }
 
 char *
@@ -79,152 +139,114 @@ clean_regex(
     return result;
 }
 
-char *
-make_exact_host_expression(
-    const char *       host)
+/*
+ * Check whether a given character should be escaped (that is, prepended with a
+ * backslash), EXCEPT for one character.
+ */
+
+static gboolean should_be_escaped_except(char c, char not_this_one)
 {
-    char *result;
-    int j;
-    size_t i;
-    result = alloc(2*strlen(host)+3);
+    if (c == not_this_one)
+        return FALSE;
+
+    switch (c) {
+        case '\\':
+        case '^':
+        case '$':
+        case '?':
+        case '*':
+        case '[':
+        case ']':
+        case '.':
+        case '/':
+            return TRUE;
+    }
+
+    return FALSE;
+}
 
-    j = 0;
-    result[j++] = '^';
-    for(i=0;i<strlen(host);i++) {
-       /* quote host expression metcharacters *except* '.'.  Note that
-        * most of these are invalid in a DNS hostname anyway. */
-       switch (host[i]) {
-           case '\\':
-           case '/':
-           case '^':
-           case '$':
-           case '?':
-           case '*':
-           case '[':
-           case ']':
-           result[j++]='\\';
-           /* fall through */
+/*
+ * Take a disk/host expression and turn it into a full-blown amglob (with
+ * start and end anchors) following rules in amanda-match(7). The not_this_one
+ * argument represents a character which is NOT meant to be special in this
+ * case: '/' for disks and '.' for hosts.
+ */
 
-           default:
-           result[j++]=host[i];
-       }
+static char *full_amglob_from_expression(const char *str, char not_this_one)
+{
+    const char *src;
+    char *result, *dst;
+
+    result = alloc(2 * strlen(str) + 3);
+    dst = result;
+
+    *(dst++) = '^';
+
+    for (src = str; *src; src++) {
+        if (should_be_escaped_except(*src, not_this_one))
+            *(dst++) = '\\';
+        *(dst++) = *src;
     }
-    result[j++] = '$';
-    result[j] = '\0';
+
+    *(dst++) = '$';
+    *dst = '\0';
     return result;
 }
 
+char *
+make_exact_host_expression(
+    const char *       host)
+{
+    return full_amglob_from_expression(host, '.');
+}
+
 char *
 make_exact_disk_expression(
     const char *       disk)
 {
-    char *result;
-    int j;
-    size_t i;
-    result = alloc(2*strlen(disk)+3);
-
-    j = 0;
-    result[j++] = '^';
-    for(i=0;i<strlen(disk);i++) {
-       /* quote disk expression metcharacters *except* '/' */
-       switch (disk[i]) {
-           case '\\':
-           case '.':
-           case '^':
-           case '$':
-           case '?':
-           case '*':
-           case '[':
-           case ']':
-           result[j++]='\\';
-           /* fall through */
-
-           default:
-           result[j++]=disk[i];
-       }
-    }
-    result[j++] = '$';
-    result[j] = '\0';
-    return result;
+    return full_amglob_from_expression(disk, '/');
 }
 
-int
-match(
-    const char *       regex,
-    const char *       str)
+int do_match(const char *regex, const char *str, gboolean match_newline)
 {
     regex_t regc;
     int result;
-    char errmsg[STR_SIZE];
-
-    if((result = regcomp(&regc, regex,
-                        REG_EXTENDED|REG_NOSUB|REG_NEWLINE)) != 0) {
-        regerror(result, &regc, errmsg, SIZEOF(errmsg));
-       error(_("regex \"%s\": %s"), regex, errmsg);
-       /*NOTREACHED*/
-    }
+    regex_errbuf errmsg;
+    gboolean ok;
 
-    if((result = regexec(&regc, str, 0, 0, 0)) != 0
-       && result != REG_NOMATCH) {
-        regerror(result, &regc, errmsg, SIZEOF(errmsg));
-       error(_("regex \"%s\": %s"), regex, errmsg);
-       /*NOTREACHED*/
-    }
-
-    regfree(&regc);
-
-    return result == 0;
-}
+    ok = do_validate_regex(regex, &regc, &errmsg, match_newline);
 
-int
-match_no_newline(
-    const char *       regex,
-    const char *       str)
-{
-    regex_t regc;
-    int result;
-    char errmsg[STR_SIZE];
+    if (!ok)
+        error(_("regex \"%s\": %s"), regex, errmsg);
+        /*NOTREACHED*/
 
-    if((result = regcomp(&regc, regex,
-                        REG_EXTENDED|REG_NOSUB)) != 0) {
-        regerror(result, &regc, errmsg, SIZEOF(errmsg));
-       error(_("regex \"%s\": %s"), regex, errmsg);
-       /*NOTREACHED*/
-    }
+    result = try_match(&regc, str, &errmsg);
 
-    if((result = regexec(&regc, str, 0, 0, 0)) != 0
-       && result != REG_NOMATCH) {
-        regerror(result, &regc, errmsg, SIZEOF(errmsg));
-       error(_("regex \"%s\": %s"), regex, errmsg);
-       /*NOTREACHED*/
-    }
+    if (result == MATCH_ERROR)
+        error(_("regex \"%s\": %s"), regex, errmsg);
+        /*NOTREACHED*/
 
     regfree(&regc);
 
-    return result == 0;
+    return result;
 }
 
 char *
 validate_glob(
     const char *       glob)
 {
-    char *regex;
+    char *regex, *ret = NULL;
     regex_t regc;
-    int result;
-    static char errmsg[STR_SIZE];
+    static regex_errbuf errmsg;
 
     regex = glob_to_regex(glob);
-    if ((result = regcomp(&regc, regex,
-                         REG_EXTENDED|REG_NOSUB|REG_NEWLINE)) != 0) {
-      regerror(result, &regc, errmsg, SIZEOF(errmsg));
-      amfree(regex);
-      return errmsg;
-    }
+
+    if (!do_validate_regex(regex, &regc, &errmsg, TRUE))
+        ret = errmsg;
 
     regfree(&regc);
     amfree(regex);
-
-    return NULL;
+    return ret;
 }
 
 int
@@ -235,106 +257,223 @@ match_glob(
     char *regex;
     regex_t regc;
     int result;
-    char errmsg[STR_SIZE];
+    regex_errbuf errmsg;
+    gboolean ok;
 
     regex = glob_to_regex(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);
-       /*NOTREACHED*/
-    }
+    ok = do_validate_regex(regex, &regc, &errmsg, TRUE);
 
-    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);
-       /*NOTREACHED*/
-    }
+    if (!ok)
+        error(_("glob \"%s\" -> regex \"%s\": %s"), glob, regex, errmsg);
+        /*NOTREACHED*/
+
+    result = try_match(&regc, str, &errmsg);
+
+    if (result == MATCH_ERROR)
+        error(_("glob \"%s\" -> regex \"%s\": %s"), glob, regex, errmsg);
+        /*NOTREACHED*/
 
     regfree(&regc);
     amfree(regex);
 
-    return result == 0;
+    return result;
 }
 
-char *
-glob_to_regex(
-    const char *       glob)
+/*
+ * Macro to tell whether a character is a regex metacharacter. Note that '*'
+ * and '?' are NOT included: they are themselves special in globs.
+ */
+
+#define IS_REGEX_META(c) ( \
+    (c) == '.' || (c) == '(' || (c) == ')' || (c) == '{' || (c) == '}' || \
+    (c) == '+' || (c) == '^' || (c) == '$' || (c) == '|' \
+)
+
+/*
+ * EXPANDING A MATCH TO A REGEX (as per amanda-match(7))
+ *
+ * The function at the code of this operation is amglob_to_regex(). It
+ * takes three arguments: the string to convert, a substitution table and a
+ * worst-case expansion.
+ *
+ * The substitution table, defined right below, is used to replace particular
+ * string positions and/or characters. Its fields are:
+ * - begin: what the beginnin of the string should be replaced with;
+ * - end: what the end of the string should be replaced with;
+ * - question_mark: what the question mark ('?') should be replaced with;
+ * - star: what the star ('*') should be replaced with;
+ * - double_star: what two consecutive stars should be replaced with.
+ *
+ * Note that apart from double_star, ALL OTHER FIELDS MUST NOT BE NULL
+ */
+
+struct subst_table {
+    const char *begin;
+    const char *end;
+    const char *question_mark;
+    const char *star;
+    const char *double_star;
+};
+
+static char *amglob_to_regex(const char *str, struct subst_table *table,
+    size_t worst_case)
 {
-    char *regex;
-    char *r;
-    size_t len;
-    int ch;
-    int last_ch;
+    const char *src;
+    char *result, *dst;
+    char c;
 
     /*
-     * Allocate an area to convert into.  The worst case is a five to
-     * one expansion.
+     * There are two particular cases when building a regex out of a glob:
+     * character classes (anything inside [...] or [!...] and quotes (anything
+     * preceded by a backslash). We start with none being true.
      */
-    len = strlen(glob);
-    regex = alloc(1 + len * 5 + 1 + 1);
+
+    gboolean in_character_class = FALSE, in_quote = FALSE;
 
     /*
-     * Do the conversion:
-     *
-     *  ?      -> [^/]
-     *  *      -> [^/]*
-     *  [...] ->  [...]
-     *  [!...] -> [^...]
-     *
-     * The following are given a leading backslash to protect them
-     * unless they already have a backslash:
-     *
-     *   ( ) { } + . ^ $ |
-     *
-     * Put a leading ^ and trailing $ around the result.  If the last
-     * non-escaped character is \ leave the $ off to cause a syntax
-     * error when the regex is compiled.
+     * Allocate enough space for our string. At worst, the allocated space is
+     * the length of the following:
+     * - beginning of regex;
+     * - size of original string multiplied by worst-case expansion;
+     * - end of regex;
+     * - final 0.
      */
 
-    r = regex;
-    *r++ = '^';
-    last_ch = '\0';
-    for (ch = *glob++; ch != '\0'; last_ch = ch, ch = *glob++) {
-       if (last_ch == '\\') {
-           *r++ = (char)ch;
-           ch = '\0';                  /* so last_ch != '\\' next time */
-       } else if (last_ch == '[' && ch == '!') {
-           *r++ = '^';
-       } else if (ch == '\\') {
-           *r++ = (char)ch;
-       } else if (ch == '*' || ch == '?') {
-           *r++ = '[';
-           *r++ = '^';
-           *r++ = '/';
-           *r++ = ']';
-           if (ch == '*') {
-               *r++ = '*';
-           }
-       } else if (ch == '('
-                  || ch == ')'
-                  || ch == '{'
-                  || ch == '}'
-                  || ch == '+'
-                  || ch == '.'
-                  || ch == '^'
-                  || ch == '$'
-                  || ch == '|') {
-           *r++ = '\\';
-           *r++ = (char)ch;
-       } else {
-           *r++ = (char)ch;
-       }
-    }
-    if (last_ch != '\\') {
-       *r++ = '$';
+    result = alloc(strlen(table->begin) + strlen(str) * worst_case
+        + strlen(table->end) + 1);
+
+    /*
+     * Start by copying the beginning of the regex...
+     */
+
+    dst = g_stpcpy(result, table->begin);
+
+    /*
+     * ... Now to the meat of it.
+     */
+
+    for (src = str; *src; src++) {
+        c = *src;
+
+        /*
+         * First, check that we're in a character class: each and every
+         * character can be copied as is. We only need to be careful is the
+         * character is a closing bracket: it will end the character class IF
+         * AND ONLY IF it is not preceded by a backslash.
+         */
+
+        if (in_character_class) {
+            in_character_class = ((c != ']') || (*(src - 1) == '\\'));
+            goto straight_copy;
+        }
+
+        /*
+         * Are we in a quote? If yes, it is really simple: copy the current
+         * character, close the quote, the end.
+         */
+
+        if (in_quote) {
+            in_quote = FALSE;
+            goto straight_copy;
+        }
+
+        /*
+         * The only thing left to handle now is the "normal" case: we are not in
+         * a character class nor in a quote.
+         */
+
+        if (c == '\\') {
+            /*
+             * Backslash: append it, and open a new quote.
+             */
+            in_quote = TRUE;
+            goto straight_copy;
+        } else if (c == '[') {
+            /*
+             * Opening bracket: the beginning of a character class.
+             *
+             * Look ahead the next character: if it's an exclamation mark, then
+             * this is a complemented character class; append a caret to make
+             * the result string regex-friendly, and forward one character in
+             * advance.
+             */
+            *dst++ = c;
+            in_character_class = TRUE;
+            if (*(src + 1) == '!') {
+                *dst++ = '^';
+                src++;
+            }
+        } else if (IS_REGEX_META(c)) {
+            /*
+             * Regex metacharacter (except for ? and *, see below): append a
+             * backslash, and then the character itself.
+             */
+            *dst++ = '\\';
+            goto straight_copy;
+        } else if (c == '?')
+            /*
+             * Question mark: take the subsitution string out of our subst_table
+             * and append it to the string.
+             */
+            dst = g_stpcpy(dst, table->question_mark);
+        else if (c == '*') {
+            /*
+             * Star: append the subsitution string found in our subst_table.
+             * However, look forward the next character: if it's yet another
+             * star, then see if there is a substitution string for the double
+             * star and append this one instead.
+             *
+             * FIXME: this means that two consecutive stars in a glob string
+             * where there is no substition for double_star can lead to
+             * exponential regex execution time: consider [^/]*[^/]*.
+             */
+            const char *p = table->star;
+            if (*(src + 1) == '*' && table->double_star) {
+                src++;
+                p = table->double_star;
+            }
+            dst = g_stpcpy(dst, p);
+        } else {
+            /*
+             * Any other character: append each time.
+             */
+straight_copy:
+            *dst++ = c;
+        }
     }
-    *r = '\0';
 
-    return regex;
+    /*
+     * Done, now append the end, ONLY if we are not in a quote - a lone
+     * backslash at the end of a glob is illegal, just leave it as it, it will
+     * make the regex compile fail.
+     */
+
+    if (!in_quote)
+        dst = g_stpcpy(dst, table->end);
+    /*
+     * Finalize, return.
+     */
+
+    *dst = '\0';
+    return result;
 }
 
+static struct subst_table glob_subst_stable = {
+    "^", /* begin */
+    "$", /* end */
+    "[^/]", /* question_mark */
+    "[^/]*", /* star */
+    NULL /* double_star */
+};
+
+static size_t glob_worst_case = 5; /* star */
+
+char *
+glob_to_regex(
+    const char *       glob)
+{
+    return amglob_to_regex(glob, &glob_subst_stable, glob_worst_case);
+}
 
 int
 match_tar(
@@ -344,116 +483,110 @@ match_tar(
     char *regex;
     regex_t regc;
     int result;
-    char errmsg[STR_SIZE];
+    regex_errbuf errmsg;
+    gboolean ok;
 
     regex = tar_to_regex(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);
-       /*NOTREACHED*/
-    }
+    ok = do_validate_regex(regex, &regc, &errmsg, TRUE);
 
-    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);
-       /*NOTREACHED*/
-    }
+    if (!ok)
+        error(_("glob \"%s\" -> regex \"%s\": %s"), glob, regex, errmsg);
+        /*NOTREACHED*/
+
+    result = try_match(&regc, str, &errmsg);
+
+    if (result == MATCH_ERROR)
+        error(_("glob \"%s\" -> regex \"%s\": %s"), glob, regex, errmsg);
+        /*NOTREACHED*/
 
     regfree(&regc);
     amfree(regex);
 
-    return result == 0;
+    return result;
 }
 
+static struct subst_table tar_subst_stable = {
+    "(^|/)", /* begin */
+    "($|/)", /* end */
+    "[^/]", /* question_mark */
+    ".*", /* star */
+    NULL /* double_star */
+};
+
+static size_t tar_worst_case = 5; /* begin or end */
+
 static char *
 tar_to_regex(
     const char *       glob)
 {
-    char *regex;
-    char *r;
-    size_t len;
-    int ch;
-    int last_ch;
+    return amglob_to_regex(glob, &tar_subst_stable, tar_worst_case);
+}
 
-    /*
-     * Allocate an area to convert into.  The worst case is a five to
-     * one expansion.
-     */
-    len = strlen(glob);
-    regex = alloc(1 + len * 5 + 5 + 5);
+/*
+ * Two utility functions used by match_disk() below: they are used to convert a
+ * disk and glob from Windows expressed paths (backslashes) into Unix paths
+ * (slashes).
+ *
+ * Note: the resulting string is dynamically allocated, it is up to the caller
+ * to free it.
+ *
+ * Note 2: UNC in convert_unc_to_unix stands for Uniform Naming Convention.
+ */
 
-    /*
-     * Do the conversion:
-     *
-     *  ?      -> [^/]
-     *  *      -> .*
-     *  [...]  -> [...]
-     *  [!...] -> [^...]
-     *
-     * The following are given a leading backslash to protect them
-     * unless they already have a backslash:
-     *
-     *   ( ) { } + . ^ $ |
-     *
-     * The expression must begin and end either at the beginning/end of the string or
-     * at at a pathname separator.
-     *
-     * If the last non-escaped character is \ leave the $ off to cause a syntax
-     * error when the regex is compiled.
-     */
+static char *convert_unc_to_unix(const char *unc)
+{
+    const char *src;
+    char *result, *dst;
+    result = alloc(strlen(unc) + 1);
+    dst = result;
 
-    r = regex;
-    *r++ = '(';
-    *r++ = '^';
-    *r++ = '|';
-    *r++ = '/';
-    *r++ = ')';
-    last_ch = '\0';
-    for (ch = *glob++; ch != '\0'; last_ch = ch, ch = *glob++) {
-       if (last_ch == '\\') {
-           *r++ = (char)ch;
-           ch = '\0';                  /* so last_ch != '\\' next time */
-       } else if (last_ch == '[' && ch == '!') {
-           *r++ = '^';
-       } else if (ch == '\\') {
-           *r++ = (char)ch;
-       } else if (ch == '*') {
-           *r++ = '.';
-           *r++ = '*';
-       } else if (ch == '?') {
-           *r++ = '[';
-           *r++ = '^';
-           *r++ = '/';
-           *r++ = ']';
-       } else if (ch == '('
-                  || ch == ')'
-                  || ch == '{'
-                  || ch == '}'
-                  || ch == '+'
-                  || ch == '.'
-                  || ch == '^'
-                  || ch == '$'
-                  || ch == '|') {
-           *r++ = '\\';
-           *r++ = (char)ch;
-       } else {
-           *r++ = (char)ch;
-       }
-    }
-    if (last_ch != '\\') {
-       *r++ = '(';
-       *r++ = '$';
-       *r++ = '|';
-       *r++ = '/';
-       *r++ = ')';
-    }
-    *r = '\0';
+    for (src = unc; *src; src++)
+        *(dst++) = (*src == '\\') ? '/' : *src;
+
+    *dst = '\0';
+    return result;
+}
 
-    return regex;
+static char *convert_winglob_to_unix(const char *glob)
+{
+    const char *src;
+    char *result, *dst;
+    result = alloc(strlen(glob) + 1);
+    dst = result;
+
+    for (src = glob; *src; src++) {
+        if (*src == '\\' && *(src + 1) == '\\') {
+            *(dst++) = '/';
+            src++;
+            continue;
+        }
+        *(dst++) = *src;
+    }
+    *dst = '\0';
+    return result;
 }
 
+/*
+ * Check whether a glob passed as an argument to match_word() only looks for the
+ * separator
+ */
+
+static gboolean glob_is_separator_only(const char *glob, char sep) {
+    size_t len = strlen(glob);
+    const char len2_1[] = { '^', sep , 0 }, len2_2[] = { sep, '$', 0 },
+        len3[] = { '^', sep, '$', 0 };
+
+    switch (len) {
+        case 1:
+            return (*glob == sep);
+        case 2:
+            return !(strcmp(glob, len2_1) && strcmp(glob, len2_2));
+        case 3:
+            return !strcmp(glob, len3);
+        default:
+            return FALSE;
+    }
+}
 
 static int
 match_word(
@@ -462,186 +595,143 @@ match_word(
     const char         separator)
 {
     char *regex;
-    char *r;
+    char *dst;
     size_t  len;
-    int  ch;
-    int  last_ch;
-    int  next_ch;
     size_t  lenword;
-    char  *mword, *nword;
-    char  *mglob, *nglob;
-    char *g; 
-    const char *w;
-    int  i;
+    char *nword;
+    char *nglob;
+    const char *src;
+    int ret;
 
     lenword = strlen(word);
     nword = (char *)alloc(lenword + 3);
 
-    if (separator == '/' && lenword > 2 && word[0] == '\\' && word[1] == '\\' && !strchr(word, '/')) {
-       /* Convert all "\" to '/' */
-       mword = (char *)alloc(lenword + 1);
-       r = mword;
-       w = word;
-       while (*w != '\0') {
-           if (*w == '\\') {
-               *r++ = '/';
-               w += 1;
-           } else {
-               *r++ = *w++;
-           }
-       }
-       *r++ = '\0';
-       lenword = strlen(word);
-
-       /* Convert all "\\" to '/' */
-       mglob = (char *)alloc(strlen(glob) + 1);
-       r = mglob;
-       w = glob;
-       while (*w != '\0') {
-           if (*w == '\\' && *(w+1) == '\\') {
-               *r++ = '/';
-               w += 2;
-           } else {
-               *r++ = *w++;
-           }
-       }
-       *r++ = '\0';
-    } else {
-       mword = stralloc(word);
-       mglob = stralloc(glob);
-    }
-
-    r = nword;
-    w = mword;
-    if(lenword == 1 && *w == separator) {
-       *r++ = separator;
-       *r++ = separator;
-    }
-    else {
-       if(*w != separator)
-           *r++ = separator;
-       while(*w != '\0')
-           *r++ = *w++;
-       if(*(r-1) != separator)
-           *r++ = separator;    
-    }
-    *r = '\0';
-
-    /*
-     * Allocate an area to convert into.  The worst case is a six to
-     * one expansion.
-     */
-    len = strlen(mglob);
-    regex = (char *)alloc(1 + len * 6 + 1 + 1 + 2 + 2);
-    r = regex;
-    nglob = stralloc(mglob);
-    g = nglob;
-
-    if((len == 1 && nglob[0] == separator) ||
-       (len == 2 && nglob[0] == '^' && nglob[1] == separator) ||
-       (len == 2 && nglob[0] == separator && nglob[1] == '$') ||
-       (len == 3 && nglob[0] == '^' && nglob[1] == separator &&
-        nglob[2] == '$')) {
-       *r++ = '^';
-       *r++ = '\\';
-       *r++ = separator;
-       *r++ = '\\';
-       *r++ = separator;
-       *r++ = '$';
+    dst = nword;
+    src = word;
+    if(lenword == 1 && *src == separator) {
+       *dst++ = separator;
+       *dst++ = separator;
     }
     else {
-       /*
-        * Do the conversion:
-        *
-        *  ?      -> [^\separator]
-        *  *      -> [^\separator]*
-        *  [!...] -> [^...]
-        *  **     -> .*
-        *
-        * The following are given a leading backslash to protect them
-        * unless they already have a backslash:
-        *
-        *   ( ) { } + . ^ $ |
-        *
-        * If the last
-        * non-escaped character is \ leave it to cause a syntax
-        * error when the regex is compiled.
-        */
-
-       if(*g == '^') {
-           *r++ = '^';
-           *r++ = '\\';        /* escape the separator */
-           *r++ = separator;
-           g++;
-           if(*g == separator) g++;
-       }
-       else if(*g != separator) {
-           *r++ = '\\';        /* add a leading \separator */
-           *r++ = separator;
-       }
-       last_ch = '\0';
-       for (ch = *g++; ch != '\0'; last_ch = ch, ch = *g++) {
-           next_ch = *g;
-           if (last_ch == '\\') {
-               *r++ = (char)ch;
-               ch = '\0';              /* so last_ch != '\\' next time */
-           } else if (last_ch == '[' && ch == '!') {
-               *r++ = '^';
-           } else if (ch == '\\') {
-               *r++ = (char)ch;
-           } else if (ch == '*' || ch == '?') {
-               if(ch == '*' && next_ch == '*') {
-                   *r++ = '.';
-                   g++;
-               }
-               else {
-                   *r++ = '[';
-                   *r++ = '^';
-                   *r++ = '\\';
-                   *r++ = separator;
-                   *r++ = ']';
-               }
-               if (ch == '*') {
-                   *r++ = '*';
-               }
-           } else if (ch == '$' && next_ch == '\0') {
-               if(last_ch != separator) {
-                   *r++ = '\\';
-                   *r++ = separator;
-               }
-               *r++ = (char)ch;
-           } else if (   ch == '('
-                      || ch == ')'
-                      || ch == '{'
-                      || ch == '}'
-                      || ch == '+'
-                      || ch == '.'
-                      || ch == '^'
-                      || ch == '$'
-                      || ch == '|') {
-               *r++ = '\\';
-               *r++ = (char)ch;
-           } else {
-               *r++ = (char)ch;
-           }
-       }
-       if(last_ch != '\\') {
-           if(last_ch != separator && last_ch != '$') {
-               *r++ = '\\';
-               *r++ = separator;               /* add a trailing \separator */
-           }
-       }
+       if(*src != separator)
+           *dst++ = separator;
+       while(*src != '\0')
+           *dst++ = *src++;
+       if(*(dst-1) != separator)
+           *dst++ = separator;
     }
-    *r = '\0';
+    *dst = '\0';
 
-    i = match(regex,nword);
+    len = strlen(glob);
+    nglob = stralloc(glob);
+
+    if(glob_is_separator_only(nglob, separator)) {
+        regex = alloc(7); /* Length of what is written below plus '\0' */
+        dst = regex;
+       *dst++ = '^';
+       *dst++ = '\\';
+       *dst++ = separator;
+       *dst++ = '\\';
+       *dst++ = separator;
+       *dst++ = '$';
+        *dst = '\0';
+    } else {
+        /*
+         * Unlike what happens for tar and disk expressions, here the
+         * substitution table needs to be dynamically allocated. When we enter
+         * here, we know what the expansions will be for the question mark, the
+         * star and the double star, and also the worst case expansion. We
+         * calculate the begin and end expansions below.
+         */
+
+#define MATCHWORD_STAR_EXPANSION(c) (const char []) { \
+    '[', '^', (c), ']', '*', 0 \
+}
+#define MATCHWORD_QUESTIONMARK_EXPANSION(c) (const char []) { \
+    '[', '^', (c), ']', 0 \
+}
+#define MATCHWORD_DOUBLESTAR_EXPANSION ".*"
+
+        struct subst_table table;
+        size_t worst_case = 5;
+        const char *begin, *end;
+        char *p, *g = nglob;
+
+        /*
+         * Calculate the beginning of the regex:
+         * - by default, it is an unanchored separator;
+         * - if the glob begins with a caret, make that an anchored separator,
+         *   and increment g appropriately;
+         * - if it begins with a separator, make it the empty string.
+         */
+
+        p = nglob;
+
+#define REGEX_BEGIN_FULL(c) (const char[]) { '^', '\\', (c), 0 }
+#define REGEX_BEGIN_NOANCHOR(c) (const char[]) { '\\', (c), 0 }
+#define REGEX_BEGIN_ANCHORONLY "^" /* Unused, but defined for consistency */
+#define REGEX_BEGIN_EMPTY ""
+
+        begin = REGEX_BEGIN_NOANCHOR(separator);
+
+        if (*p == '^') {
+            begin = REGEX_BEGIN_FULL(separator);
+            p++, g++;
+            if (*p == separator)
+                g++;
+        } else if (*p == separator)
+            begin = REGEX_BEGIN_EMPTY;
+
+        /*
+         * Calculate the end of the regex:
+         * - an unanchored separator by default;
+         * - if the last character is a backslash or the separator itself, it
+         *   should be the empty string;
+         * - if it is a dollar sign, overwrite it with 0 and look at the
+         *   character before it: if it is the separator, only anchor at the
+         *   end, otherwise, add a separator before the anchor.
+         */
+
+        p = &(nglob[strlen(nglob) - 1]);
+
+#define REGEX_END_FULL(c) (const char[]) { '\\', (c), '$', 0 }
+#define REGEX_END_NOANCHOR(c) REGEX_BEGIN_NOANCHOR(c)
+#define REGEX_END_ANCHORONLY "$"
+#define REGEX_END_EMPTY REGEX_BEGIN_EMPTY
+
+        end = REGEX_END_NOANCHOR(separator);
+
+        if (*p == '\\' || *p == separator)
+            end = REGEX_END_EMPTY;
+        else if (*p == '$') {
+            char prev = *(p - 1);
+            *p = '\0';
+            if (prev == separator)
+                end = REGEX_END_ANCHORONLY;
+            else
+                end = REGEX_END_FULL(separator);
+        }
+
+        /*
+         * Fill in our substitution table and generate the regex
+         */
+
+        table.begin = begin;
+        table.end = end;
+        table.question_mark = MATCHWORD_QUESTIONMARK_EXPANSION(separator);
+        table.star = MATCHWORD_STAR_EXPANSION(separator);
+        table.double_star = MATCHWORD_DOUBLESTAR_EXPANSION;
+
+        regex = amglob_to_regex(g, &table, worst_case);
+    }
+
+    ret = do_match(regex, nword, TRUE);
 
-    amfree(mword);
-    amfree(mglob);
     amfree(nword);
     amfree(nglob);
     amfree(regex);
-    return i;
+
+    return ret;
 }
 
 
@@ -651,27 +741,17 @@ match_host(
     const char *       host)
 {
     char *lglob, *lhost;
-    char *c;
-    const char *d;
-    int i;
+    int ret;
 
     
-    lglob = (char *)alloc(strlen(glob)+1);
-    c = lglob, d=glob;
-    while( *d != '\0')
-       *c++ = (char)tolower(*d++);
-    *c = *d;
-
-    lhost = (char *)alloc(strlen(host)+1);
-    c = lhost, d=host;
-    while( *d != '\0')
-       *c++ = (char)tolower(*d++);
-    *c = *d;
-
-    i = match_word(lglob, lhost, (int)'.');
+    lglob = g_ascii_strdown(glob, -1);
+    lhost = g_ascii_strdown(host, -1);
+
+    ret = match_word(lglob, lhost, '.');
+
     amfree(lglob);
     amfree(lhost);
-    return i;
+    return ret;
 }
 
 
@@ -680,7 +760,35 @@ match_disk(
     const char *       glob,
     const char *       disk)
 {
-    return match_word(glob, disk, '/');
+    char *glob2 = NULL, *disk2 = NULL;
+    const char *g = glob, *d = disk;
+    int result;
+
+    /*
+     * Check whether our disk potentially refers to a Windows share (the first
+     * two characters are '\' and there is no / in the word at all): if yes,
+     * convert all double backslashes to slashes in the glob, and simple
+     * backslashes into slashes in the disk, and pass these new strings as
+     * arguments instead of the originals.
+     */
+    gboolean windows_share = !(strncmp(disk, "\\\\", 2) || strchr(disk, '/'));
+
+    if (windows_share) {
+        glob2 = convert_winglob_to_unix(glob);
+        disk2 = convert_unc_to_unix(disk);
+        g = (const char *) glob2;
+        d = (const char *) disk2;
+    }
+
+    result = match_word(g, d, '/');
+
+    /*
+     * We can amfree(NULL), so this is "safe"
+     */
+    amfree(glob2);
+    amfree(disk2);
+
+    return result;
 }
 
 static int
index 40b277cc5262989e38f3fa579457693fae0bb73a..967c852b854c880738bd8df54aeba104fb681bae 100644 (file)
  * Returns a statically allocated error message on failure or NULL on success. */
 char * validate_regexp(const char *regex);
 
-/* Match STR against POSIX regular expression REGEX by calling regexec.  This uses
- * the REG_NEWLINE flag, meaning that . does not match a newline and $ and ^ are
- * relative to lines as well as the beginning and end of STR. */
-int    match(const char *regex, const char *str);
-
-/* Like match(), but without REG_NEWLINE, so a newline is treated like any other
- * character */
-int    match_no_newline(const char *regex, const char *str);
+/*
+ * Match the string "str" against POSIX regex "regex" with regexec(), with
+ * REG_NEWLINE set (match_newline == TRUE) or not.
+ *
+ * REG_NEWLINE means two things:
+ * - the dot won't match a newline;
+ * - ^ and $ will match around \n in the input string (as well as the beginning
+ *   and end of the input).
+ */
+
+int do_match(const char *regex, const char *str, gboolean match_newline);
+
+#define match(regex, str) do_match(regex, str, TRUE)
+#define match_no_newline(regex, str) do_match(regex, str, FALSE)
 
 /* quote any non-alphanumeric characters in str, so that the result will only
  * match the original string.  If anchor is true, then add ^ and $ to make sure
index fe848ba624985feefe4758a289db5a17e8ee4aa6..b2df6acff293cfd511909789102cd21e5b2c2c7b 100644 (file)
@@ -78,7 +78,7 @@ char * quotable_strings[] = {
  * Round-trip testing of quoting functions
  */
 
-static int
+static gboolean
 test_round_trip(void)
 {
     char **strp;
@@ -161,7 +161,7 @@ compare_strv(
     return TRUE;
 }
 
-static int
+static gboolean
 test_split_quoted_strings(void)
 {
     char **iter1, **iter2, **iter3;
@@ -215,7 +215,7 @@ struct trial {
     const char *expected[5];
 };
 
-static int
+static gboolean
 test_split_quoted_strings_edge(void)
 {
     gboolean success = TRUE;
@@ -250,7 +250,7 @@ test_split_quoted_strings_edge(void)
 /****
  * Test unquoting of some pathological strings
  */
-static int
+static gboolean
 test_unquote_string(void)
 {
     gboolean success = TRUE;
@@ -333,7 +333,7 @@ test_unquote_string(void)
 /****
  * Test the strquotedstr function
  */
-static int
+static gboolean
 test_strquotedstr_skipping(void)
 {
     char **iter1, **iter2;
@@ -394,7 +394,7 @@ next:
     return success;
 }
 
-static int
+static gboolean
 test_strquotedstr_edge_invalid(void)
 {
     gboolean success = TRUE;
@@ -430,7 +430,7 @@ test_strquotedstr_edge_invalid(void)
     return success;
 }
 
-static int
+static gboolean
 test_strquotedstr_edge_valid(void)
 {
     gboolean success = TRUE;
index f1fa2a8076a68a9954457f3c0b91a4887e848cbe..04266ab6309896d44bf2644babb43e20909e1acc 100644 (file)
@@ -240,8 +240,7 @@ runrsh(
        xclient_username = CLIENT_LOGIN;
 
     execlp(RSH_PATH, RSH_PATH, "-l", xclient_username,
-          rc->hostname, xamandad_path, "-auth=rsh", "amdump", "amindexd",
-          "amidxtaped", (char *)NULL);
+          rc->hostname, xamandad_path, "-auth=rsh", (char *)NULL);
     error(_("error: couldn't exec %s: %s"), RSH_PATH, strerror(errno));
 
     /* should never go here, shut up compiler warning */
index bc108cdd0fbfcd4747579ce02ce4f933bdd728c9..3a2e0564bb0aa6c037d429bc470bae9b4a3d1501 100644 (file)
@@ -2661,9 +2661,16 @@ find_port_for_service(
 }
 
 char *
-sec_get_authenticated_peer_name_localhost(
+sec_get_authenticated_peer_name_gethostname(
     security_handle_t *hdl G_GNUC_UNUSED)
 {
+    char *server_hostname;
+    server_hostname = malloc(1024);
+    if (gethostname(server_hostname, 1024) == 0) {
+       server_hostname[1023] = '\0';
+       return server_hostname;
+    }
+    amfree(server_hostname);
     return "localhost";
 }
 
index 9fa67701a6a48d53d3fa5a6382de3787daa5153f..c62a7c79bb849b9d3bd8124a84006c4631975c40 100644 (file)
@@ -274,7 +274,7 @@ void        show_stat_info(char *a, char *b);
 int     check_name_give_sockaddr(const char *hostname, struct sockaddr *addr,
                                 char **errstr);
 in_port_t find_port_for_service(char *service, char *proto);
-char   *sec_get_authenticated_peer_name_localhost(security_handle_t *);
+char   *sec_get_authenticated_peer_name_gethostname(security_handle_t *);
 char   *sec_get_authenticated_peer_name_hostname(security_handle_t *);
 
 #endif /* _SECURITY_INFO_H */
index ffbc32ecf18fc7b10fc1014b93631baa532f6418..041757575de264f3e394d975773d7b088f5be286 100644 (file)
@@ -85,7 +85,31 @@ str_sockaddr(
     {
        inet_ntop(AF_INET, &sa->sin.sin_addr.s_addr, ipstr, sizeof(ipstr));
     }
-    g_snprintf(mystr_sockaddr,sizeof(mystr_sockaddr),"%s.%d", ipstr, port);
+    g_snprintf(mystr_sockaddr,sizeof(mystr_sockaddr),"%s:%d", ipstr, port);
+    mystr_sockaddr[sizeof(mystr_sockaddr)-1] = '\0';
+
+    return mystr_sockaddr;
+}
+
+char *
+str_sockaddr_no_port(
+    sockaddr_union *sa)
+{
+#ifdef WORKING_IPV6
+    char ipstr[INET6_ADDRSTRLEN];
+#else
+    char ipstr[INET_ADDRSTRLEN];
+#endif
+
+#ifdef WORKING_IPV6
+    if ( SU_GET_FAMILY(sa) == AF_INET6) {
+       inet_ntop(AF_INET6, &sa->sin6.sin6_addr, ipstr, sizeof(ipstr));
+    } else
+#endif
+    {
+       inet_ntop(AF_INET, &sa->sin.sin_addr.s_addr, ipstr, sizeof(ipstr));
+    }
+    g_snprintf(mystr_sockaddr,sizeof(mystr_sockaddr),"%s", ipstr);
     mystr_sockaddr[sizeof(mystr_sockaddr)-1] = '\0';
 
     return mystr_sockaddr;
index d5e68eef7393d99c7e434799fdc65daf973e3e75..2b162018d025081bc663e2bb8327399d7d427f50 100644 (file)
@@ -42,6 +42,7 @@ void  dump_sockaddr(sockaddr_union *  sa);
  * @returns: pointer to statically allocated string
  */
 char *  str_sockaddr(sockaddr_union *sa);
+char *  str_sockaddr_no_port(sockaddr_union *sa);
 
 /* Compare two sockaddr_union objects, optionally comparing
  * only the address (and thus ignoring port, flow info, etc.).
index bed501be996151a31ca54560b8b1513b7de975e9..1d84ab6fd7a74ad1c954acbb57cac87bc438fccb 100644 (file)
@@ -96,7 +96,8 @@ static int newhandle = 1;
 /*
  * Local functions
  */
-static int runssh(struct tcp_conn *, const char *, const char *, const char *);
+static int runssh(struct tcp_conn *, const char *, const char *, const char *,
+                 const char *);
 
 /*
  * ssh version of a security handle allocator.  Logically sets
@@ -113,6 +114,7 @@ ssh_connect(
     int result;
     struct sec_handle *rh;
     char *amandad_path=NULL, *client_username=NULL, *ssh_keys=NULL;
+    char *client_port = "22";
 
     assert(fn != NULL);
     assert(hostname != NULL);
@@ -152,12 +154,18 @@ ssh_connect(
      * XXX need to eventually limit number of outgoing connections here.
      */
     if(conf_fn) {
+       char *port_str;
        amandad_path    = conf_fn("amandad_path", datap);
        client_username = conf_fn("client_username", datap);
        ssh_keys        = conf_fn("ssh_keys", datap);
+       port_str        = conf_fn("client_port", datap);
+       if (port_str && strlen(port_str) >= 1) {
+           client_port = port_str;
+       }
     }
     if(rh->rc->read == -1) {
-       if (runssh(rh->rs->rc, amandad_path, client_username, ssh_keys) < 0) {
+       if (runssh(rh->rs->rc, amandad_path, client_username, ssh_keys,
+                  client_port) < 0) {
            security_seterror(&rh->sech, _("can't connect to %s: %s"),
                              hostname, rh->rs->rc->errmsg);
            goto error;
@@ -288,12 +296,14 @@ runssh(
     struct tcp_conn *  rc,
     const char *       amandad_path,
     const char *       client_username,
-    const char *       ssh_keys)
+    const char *       ssh_keys,
+    const char *        client_port)
 {
     int rpipe[2], wpipe[2];
     char *xamandad_path = (char *)amandad_path;
     char *xclient_username = (char *)client_username;
     char *xssh_keys = (char *)ssh_keys;
+    char *xclient_port = (char *)client_port;
 
     memset(rpipe, -1, SIZEOF(rpipe));
     memset(wpipe, -1, SIZEOF(wpipe));
@@ -302,6 +312,24 @@ runssh(
        return (-1);
     }
 
+    if(!xamandad_path || strlen(xamandad_path) <= 1) 
+       xamandad_path = vstralloc(amlibexecdir, "/", "amandad", NULL);
+    if(!xclient_username || strlen(xclient_username) <= 1)
+       xclient_username = CLIENT_LOGIN;
+    if(!xclient_port || strlen(xclient_port) <= 1)
+       xclient_port = "22";
+
+    if(!ssh_keys || strlen(ssh_keys) <= 1) {
+       g_debug("exec: %s %s %s %s %s %s %s %s %s",
+               SSH, "SSH_OPTIONS", "-l", xclient_username, "-p", client_port,
+               rc->hostname, xamandad_path, "-auth=ssh");
+    }
+    else {
+       g_debug("exec: %s %s %s %s %s %s %s %s %s %s %s",
+               SSH, "SSH_OPTIONS", "-l", xclient_username, "-p", client_port,
+               "-i", xssh_keys, rc->hostname, xamandad_path, "-auth=ssh");
+    }
+
     switch (rc->pid = fork()) {
     case -1:
        rc->errmsg = newvstrallocf(rc->errmsg, _("fork: %s"), strerror(errno));
@@ -327,19 +355,14 @@ runssh(
 
     safe_fd(-1, 0);
 
-    if(!xamandad_path || strlen(xamandad_path) <= 1) 
-       xamandad_path = vstralloc(amlibexecdir, "/", "amandad", NULL);
-    if(!xclient_username || strlen(xclient_username) <= 1)
-       xclient_username = CLIENT_LOGIN;
     if(!ssh_keys || strlen(ssh_keys) <= 1) {
-       execlp(SSH, SSH, SSH_OPTIONS, "-l", xclient_username,
-              rc->hostname, xamandad_path, "-auth=ssh", "amdump", "amindexd",
-              "amidxtaped", (char *)NULL);
+       execlp(SSH, SSH, SSH_OPTIONS, "-l", xclient_username, "-p", client_port,
+              rc->hostname, xamandad_path, "-auth=ssh", (char *)NULL);
     }
     else {
-       execlp(SSH, SSH, SSH_OPTIONS, "-l", xclient_username,
+       execlp(SSH, SSH, SSH_OPTIONS, "-l", xclient_username, "-p", client_port,
               "-i", xssh_keys, rc->hostname, xamandad_path, "-auth=ssh",
-              "amdump", "amindexd", "amidxtaped", (char *)NULL);
+              (char *)NULL);
     }
     error("error: couldn't exec %s: %s", SSH, strerror(errno));
 
index 657045b6a9658e2fd831b3a166a5cae5d8578b91..51eff3b54212f417d35f95afe529c0612fb1a119 100644 (file)
@@ -1,2 +1,2 @@
-#define BUILT_REV "3720"
-#define BUILT_BRANCH "3_2"
+#define BUILT_REV "4084"
+#define BUILT_BRANCH "3_3"
index acd13a842441cde23d0b237636bf8b6782be77c1..b957e872a105e61c892145754d3d3466f0289ce1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008 Zmanda, Inc.  All Rights Reserved.
+ * Copyright (c) 2008, 2011 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
 #include "amanda.h"
 #include "testutils.h"
 
-int tu_debugging_enabled = FALSE;
+gboolean tu_debugging_enabled = FALSE;
+
+static gboolean run_all = TRUE;
+static gboolean ignore_timeouts = FALSE;
+static gboolean skip_fork = FALSE;
+static gboolean only_one = FALSE;
+static gboolean loop_forever = FALSE;
+static guint64 occurrences = 1;
 
 static void
 alarm_hdlr(int sig G_GNUC_UNUSED)
@@ -30,31 +37,85 @@ alarm_hdlr(int sig G_GNUC_UNUSED)
     exit(1);
 }
 
-/* Call testfn in a forked process, such that any failures will trigger a
- * test failure, but allow the other tests to proceed.
+/*
+ * Run a single test, accouting for the timeout (if timeouts are not ignored)
+ * and output runtime information (in milliseconds) at the end of the run.
+ * Output avg/min/max only if the number of runs is strictly greater than one.
+ */
+
+static gboolean run_one_test(TestUtilsTest *test)
+{
+    guint64 count = 0;
+    gboolean ret = TRUE;
+    const char *test_name = test->name;
+    GTimer *timer;
+
+    gdouble total = 0.0, thisrun, mintime = G_MAXDOUBLE, maxtime = G_MINDOUBLE;
+
+    signal(SIGALRM, alarm_hdlr);
+
+    timer = g_timer_new();
+
+    while (count++ < occurrences) {
+        if (!ignore_timeouts)
+            alarm(test->timeout);
+
+        g_timer_start(timer);
+        ret = test->fn();
+        g_timer_stop(timer);
+
+        thisrun = g_timer_elapsed(timer, NULL);
+        total += thisrun;
+        if (mintime > thisrun)
+            mintime = thisrun;
+        if (maxtime < thisrun)
+            maxtime = thisrun;
+
+        if (!ret)
+            break;
+    }
+
+    g_timer_destroy(timer);
+
+    if (loop_forever)
+        goto out;
+
+    if (ret) {
+        g_fprintf(stderr, " PASS %s (total: %.06f", test_name, total);
+        if (occurrences > 1) {
+            total /= (gdouble) occurrences;
+            g_fprintf(stderr, ", avg/min/max: %.06f/%.06f/%.06f",
+                total, mintime, maxtime);
+        }
+        g_fprintf(stderr, ")\n");
+    } else
+        g_fprintf(stderr, " FAIL %s (run %ju of %ju, after %.06f secs)\n",
+            test_name, (uintmax_t)count, (uintmax_t)occurrences, total);
+
+out:
+    return ret;
+}
+
+/*
+ * Call testfn in a forked process, such that any failures will trigger a
+ * test failure, but allow the other tests to proceed. The only exception is if
+ * -n is supplied at the command line, but in this case only one test is allowed
+ * to run.
  */
-static int
-callinfork(TestUtilsTest *test, int ignore_timeouts, gboolean skip_fork)
+
+static gboolean
+callinfork(TestUtilsTest *test)
 {
     pid_t pid;
     amwait_t status;
     gboolean result;
 
-    if (skip_fork) {
-       /* kill the test after a bit */
-       signal(SIGALRM, alarm_hdlr);
-       if (!ignore_timeouts) alarm(test->timeout);
-
-       result = test->fn();
-    } else {
+    if (skip_fork)
+        result = run_one_test(test);
+    else {
        switch (pid = fork()) {
            case 0:     /* child */
-               /* kill the test after a bit */
-               signal(SIGALRM, alarm_hdlr);
-               if (!ignore_timeouts) alarm(test->timeout);
-
-               result = test->fn();
-               exit(result? 0:1);
+               exit(run_one_test(test) ? 0 : 1);
 
            case -1:
                perror("fork");
@@ -67,12 +128,6 @@ callinfork(TestUtilsTest *test, int ignore_timeouts, gboolean skip_fork)
        }
     }
 
-    if (result) {
-       g_fprintf(stderr, " PASS %s\n", test->name);
-    } else {
-       g_fprintf(stderr, " FAIL %s\n", test->name);
-    }
-
     return result;
 }
 
@@ -80,12 +135,15 @@ static void
 usage(
     TestUtilsTest *tests)
 {
-    printf("USAGE: <test-script> [-d] [-h] [testname [testname [..]]]\n"
+    printf("USAGE: <test-script> [options] [testname [testname [..]]]\n"
        "\n"
+        "Options can be one of:\n"
+        "\n"
        "\t-h: this message\n"
        "\t-d: print debugging messages\n"
        "\t-t: ignore timeouts\n"
         "\t-n: do not fork\n"
+        "\t-c <count>: run each test <count> times instead of only once\n"
         "\t-l: loop the same test repeatedly (use with -n for leak checks)\n"
        "\n"
        "If no test names are specified, all tests are run.  Available tests:\n"
@@ -112,12 +170,7 @@ testutils_run_tests(
     TestUtilsTest *tests)
 {
     TestUtilsTest *t;
-    int run_all = 1;
-    int success;
-    int ignore_timeouts = 0;
-    gboolean skip_fork = FALSE;
-    gboolean only_one = FALSE;
-    gboolean loop_forever = FALSE;
+    gboolean success;
 
     /* first_parse the command line */
     while (argc > 1) {
@@ -131,6 +184,23 @@ testutils_run_tests(
        } else if (strcmp(argv[1], "-l") == 0) {
            loop_forever = TRUE;
            only_one = TRUE;
+       } else if (strcmp(argv[1], "-c") == 0) {
+            char *p;
+            argv++, argc--;
+            occurrences = g_ascii_strtoull(argv[1], &p, 10);
+            if (errno == ERANGE) {
+                g_fprintf(stderr, "%s is out of range\n", argv[1]);
+                exit(1);
+            }
+            if (*p) {
+                g_fprintf(stderr, "The -c option expects a positive integer "
+                    "as an argument, but \"%s\" isn't\n", argv[1]);
+                exit(1);
+            }
+            if (occurrences == 0) {
+                g_fprintf(stderr, "Sorry, I will not run tests 0 times\n");
+                exit(1);
+            }
        } else if (strcmp(argv[1], "-h") == 0) {
            usage(tests);
            return 1;
@@ -150,12 +220,21 @@ testutils_run_tests(
                return 1;
            }
 
-           run_all = 0;
+           run_all = FALSE;
        }
 
        argc--; argv++;
     }
 
+    /*
+     * Check whether the -c option has been given. In this case, -l must not be
+     * specified at the same time.
+     */
+    if (occurrences > 1 && loop_forever) {
+        g_fprintf(stderr, "-c and -l are incompatible\n");
+        exit(1);
+    }
+
     if (run_all) {
         for (t = tests; t->fn; t++)
             t->selected = 1;
@@ -184,14 +263,14 @@ testutils_run_tests(
     }
 
     /* Now actually run the tests */
-    success = 1;
+    success = TRUE;
     for (t = tests; t->fn; t++) {
         if (t->selected) {
            do {
-               success = callinfork(t, ignore_timeouts, skip_fork) && success;
+               success = callinfork(t) && success;
            } while (loop_forever);
         }
     }
 
-    return success? 0:1;
+    return success ? 0 : 1;
 }
index 402fe00af79ce4b3b2deec1e161efd3e5170bb8b..e5fb10466fa6d2123809b5690d1ec3387c40c26e 100644 (file)
@@ -52,6 +52,7 @@ am__aclocal_m4_deps =  \
        $(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/as_needed.m4 \
        $(top_srcdir)/config/amanda/bsd-security.m4 \
        $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
        $(top_srcdir)/config/amanda/bsdudp-security.m4 \
@@ -221,6 +222,7 @@ APPLICATION_DIR = @APPLICATION_DIR@
 AR = @AR@
 ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
 ASSERTIONS = @ASSERTIONS@
+AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -694,6 +696,7 @@ LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
 MKDIR_P = @MKDIR_P@
+MOUNT = @MOUNT@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
@@ -891,6 +894,7 @@ STDBOOL_H = @STDBOOL_H@
 STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
+SUNTAR = @SUNTAR@
 SVN = @SVN@
 SWIG = @SWIG@
 SWIG_LIB = @SWIG_LIB@
@@ -898,6 +902,7 @@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TCPPORTRANGE = @TCPPORTRANGE@
 TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
 UDPPORTRANGE = @UDPPORTRANGE@
+UMOUNT = @UMOUNT@
 UNCOMPRESS_OPT = @UNCOMPRESS_OPT@
 UNCOMPRESS_PATH = @UNCOMPRESS_PATH@
 UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
@@ -991,11 +996,11 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 EXTRA_DIST = config.guess config.sub install-sh libtool.m4 ltmain.sh \
        missing mkinstalldirs set_full_version amanda/amplot.m4 \
-       amanda/bsd-security.m4 amanda/bsdtcp-security.m4 \
-       amanda/bsdudp-security.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/as_needed.m4 amanda/bsd-security.m4 \
+       amanda/bsdtcp-security.m4 amanda/bsdudp-security.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/dvdrw-device.m4 amanda/flags.m4 amanda/flock.m4 \
        amanda/funcs.m4 amanda/getfsent.m4 amanda/i18n.m4 \
        amanda/ipv6.m4 amanda/krb5-security.m4 amanda/lfs.m4 \
diff --git a/config/amanda/as_needed.m4 b/config/amanda/as_needed.m4
new file mode 100644 (file)
index 0000000..a51a991
--- /dev/null
@@ -0,0 +1,25 @@
+# SYNOPSIS
+#
+#   AMANDA_AS_NEEDED
+#
+# OVERVIEW
+#   Add --as-needed ld flag to LD_FLAGS except when using readline. On
+#   some platforms, readline does not correctly advertise it's requirements,
+#   causing ld errors.  In Amanda, readline is used by amrecover/amoldrecover.
+#
+AC_DEFUN([AMANDA_AS_NEEDED], [
+    AC_ARG_ENABLE([as-needed],
+       AS_HELP_STRING([--enable-as-needed],
+                      [enable use od --as-needed linker flag]),
+       [ WANT_AS_NEEDED=$enableval ], [ WANT_AS_NEEDED=no ])
+
+    AM_CONDITIONAL([WANT_AS_NEEDED], [test x"$WANT_AS_NEEDED" = x"yes"])
+
+    if test x"$WANT_AS_NEEDED" = x"yes"; then
+       AS_NEEDED_FLAGS="-Wl,--as-needed"
+    else
+       AS_NEEDED_FLAGS=""
+    fi
+    AC_SUBST(AS_NEEDED_FLAGS)
+])
+
index d1b15e7a64579eecc96b3ff28bbf23de91d08812..15daed79420d602a5c89e84c567ae3c42a2e19b4 100644 (file)
@@ -135,6 +135,55 @@ AC_DEFUN([AMANDA_PROG_STAR],
     AC_SUBST(STAR)
 ])
 
+# SYNOPSIS
+#
+#   AMANDA_PROG_SUNTAR
+#
+# OVERVIEW
+#
+#   Use the value given with the option --with-suntar= or the value of the 
+#   precious variable SUNTAR to define the location of Sun's version of tar.
+#   Otherwise set the value to /usr/sbin/tar.  Value is not checked.
+#
+#   Also handle --with-suntar
+#
+AC_DEFUN([AMANDA_PROG_SUNTAR],
+[
+    AC_REQUIRE([AMANDA_INIT_PROGS])
+
+    # call with
+    AC_ARG_WITH(suntar,
+       AS_HELP_STRING([--with-suntar=PROG],
+                      [use PROG as 'suntar']),
+       [
+           # check withval
+           case "$withval" in
+               /*) SUNTAR="$withval";;
+               y|ye|yes) :;;
+               n|no) SUNTAR=no ;;
+               *)  AC_MSG_ERROR([*** You must supply a full pathname to --with-suntar]);;
+           esac
+           # done
+       ],
+       [
+           if test "x$SUNTAR" == "x"; then
+               SUNTAR="/usr/sbin/tar"
+           fi
+       ]
+    )
+
+    if test "x$SUNTAR" = "xno"; then
+       SUNTAR=
+    fi
+
+    if test "x$SUNTAR" != "x"; then
+       # define unquoted
+       AC_DEFINE_UNQUOTED(SUNTAR, "$SUNTAR", [Location of the 'suntar' binary])
+    fi
+    AC_ARG_VAR(SUNTAR, [Location of the 'suntar' binary])
+    AC_SUBST(SUNTAR)
+])
+
 # SYNOPSIS
 #
 #   AMANDA_PROG_SAMBA_CLIENT
index cba7971d8feb1d6df66c02ad065fd3079198813c..a3b707bf8d0903d294242b7c4cb8b082cb3def11 100644 (file)
@@ -1,5 +1,6 @@
 ## this file is automatically generated by autogen
 EXTRA_DIST += amanda/amplot.m4
+EXTRA_DIST += amanda/as_needed.m4
 EXTRA_DIST += amanda/bsd-security.m4
 EXTRA_DIST += amanda/bsdtcp-security.m4
 EXTRA_DIST += amanda/bsdudp-security.m4
index 0aea8f5711f015b90bc588ffb8f7b72c730ddba4..9c8cf30e048eaa45afcc9817d4fd5fee728af27b 100644 (file)
@@ -82,7 +82,10 @@ AC_DEFUN([AMANDA_KRB5_SECURITY],
                 AMANDA_ADD_CPPFLAGS([-I$KRB5_DIR_FOUND/include])
             fi
                 AC_CHECK_LIB(krb5support,main)
-            AMANDA_ADD_LDFLAGS([-L$KRB5_LIBDIR_FOUND])
+
+            if test "$KRB5_LIBDIR_FOUND" != "$libdir" ; then
+                AMANDA_ADD_LDFLAGS([-L$KRB5_LIBDIR_FOUND])
+            fi
 
             AC_DEFINE(KRB5_SECURITY,1,
                 [Define if Kerberos 5 security is to be enabled. ])
index 0c513ad6cf80e31f546439bbd8461a1cc3101a0d..1cee766753bca0f603fef60bca5ddb450506dcb9 100644 (file)
@@ -211,7 +211,8 @@ AC_DEFUN([LIBCURL_CHECK_CONFIG],
   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]),
+     AC_HELP_STRING([--with-libcurl=PREFIX],
+       [look for the curl library in PREFIX/lib and headers in PREFIX/include]),
      [_libcurl_with=$withval],[_libcurl_with=ifelse([$1],,[yes],[$1])])
 
   if test "$_libcurl_with" != "no" ; then
@@ -225,9 +226,9 @@ AC_DEFUN([LIBCURL_CHECK_CONFIG],
      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"])
+        AC_PATH_PROG([_libcurl_config],[curl-config],[],["$withval/bin"])
      else
-        AC_PATH_PROG([_libcurl_config],[curl-config])
+        AC_PATH_PROG([_libcurl_config],[curl-config],[],[$PATH])
      fi
 
      if test x$_libcurl_config != "x" ; then
index 11f98924b06ee0cce9b04c876cb7b328f7bf1182..3f79e7112fa52c5ef98717a99254fbd862ed3954 100644 (file)
@@ -298,6 +298,20 @@ AC_DEFUN([AMANDA_PROG_MTX],
     AC_ARG_VAR([MTX], [Path to the 'mtx' binary])
 ])
 
+AC_DEFUN([AMANDA_PROG_MOUNT],
+[
+    AC_REQUIRE([AMANDA_INIT_PROGS])
+    AC_PATH_PROG(MOUNT,mount,mount,$LOCSYSPATH)
+    AC_ARG_VAR([MOUNT], [Path to the 'mount' binary])
+])
+
+AC_DEFUN([AMANDA_PROG_UMOUNT],
+[
+    AC_REQUIRE([AMANDA_INIT_PROGS])
+    AC_PATH_PROG(UMOUNT,umount,umount,$LOCSYSPATH)
+    AC_ARG_VAR([UMOUNT], [Path to the 'umount' binary])
+])
+
 AC_DEFUN([AMANDA_PROG_PCAT],
 [
     AC_REQUIRE([AMANDA_INIT_PROGS])
index ef728b2bc9b81a4e97508f6413fb282bf1bcdd1f..445f91fe8871f2b97f9a1cfa01f095984aabbaa5 100644 (file)
 /* Define to 1 if you have the ANSI C header files. */
 #undef STDC_HEADERS
 
+/* Location of the 'suntar' binary */
+#undef SUNTAR
+
 /* A comma-separated list of two integers, determining the minimum and *
    maximum unreserved TCP port numbers sockets should be bound to. */
 #undef TCPPORTRANGE
index c2ed61562bc10c311965f902643c8096e3577f65..01b7e5d49d8bea5e68e01d35dfcc7a649b0630ec 100755 (executable)
--- a/configure
+++ b/configure
@@ -797,6 +797,17 @@ am__EXEEXT_FALSE
 am__EXEEXT_TRUE
 LTLIBOBJS
 LIBOBJS
+WANT_NDMP_DEVICE_FALSE
+WANT_NDMP_DEVICE_TRUE
+WANT_DVDRW_DEVICE_FALSE
+WANT_DVDRW_DEVICE_TRUE
+WANT_TAPE_DEVICE_FALSE
+WANT_TAPE_DEVICE_TRUE
+WANT_S3_DEVICE_FALSE
+WANT_S3_DEVICE_TRUE
+LIBCURL
+LIBCURL_CPPFLAGS
+_libcurl_config
 READLINE_LIBS
 PKG_CONFIG
 GLIB_MKENUMS
@@ -829,6 +840,8 @@ PS_ARGUMENT
 PS
 LPRFLAG
 LPR
+UMOUNT
+MOUNT
 MTX
 MT_FILE_FLAG
 MT
@@ -849,6 +862,7 @@ USE_RUNDUMP
 WANT_SAMBA_FALSE
 WANT_SAMBA_TRUE
 SAMBA_CLIENT
+SUNTAR
 STAR
 GNUTAR
 DUMP_RETURNS_1
@@ -881,17 +895,6 @@ USE_AMANDAHOSTS
 BSD_SECURITY
 WANT_BSD_SECURITY_FALSE
 WANT_BSD_SECURITY_TRUE
-WANT_NDMP_DEVICE_FALSE
-WANT_NDMP_DEVICE_TRUE
-WANT_DVDRW_DEVICE_FALSE
-WANT_DVDRW_DEVICE_TRUE
-WANT_TAPE_DEVICE_FALSE
-WANT_TAPE_DEVICE_TRUE
-WANT_S3_DEVICE_FALSE
-WANT_S3_DEVICE_TRUE
-LIBCURL
-LIBCURL_CPPFLAGS
-_libcurl_config
 POSUB
 INTLLIBS
 LTLIBICONV
@@ -998,6 +1001,9 @@ GNUTAR_LISTED_INCREMENTAL_DIR
 CONFIG_DIR
 SETUID_GROUP
 CLIENT_LOGIN
+AS_NEEDED_FLAGS
+WANT_AS_NEEDED_FALSE
+WANT_AS_NEEDED_TRUE
 AMANDA_WARNING_CFLAGS
 gltests_WITNESS
 REPLACE_ISWCNTRL
@@ -1653,6 +1659,7 @@ enable_largefile
 with_cflags
 with_includes
 with_libraries
+enable_as_needed
 with_user
 with_group
 with_dumperdir
@@ -1706,10 +1713,6 @@ with_amdatadir
 enable_nls
 with_libiconv_prefix
 with_libintl_prefix
-with_libcurl
-enable_s3_device
-enable_dvdrw_device
-enable_ndmp_device
 with_bsd_security
 with_amandahosts
 with_bsdtcp_security
@@ -1721,6 +1724,7 @@ with_krb5_security
 with_dump_honor_nodump
 with_gnutar
 with_star
+with_suntar
 with_smbclient
 with_samba_user
 with_rundump
@@ -1734,6 +1738,10 @@ enable_libtool_lock
 enable_static_binary
 enable_glibtest
 with_readline
+with_libcurl
+enable_s3_device
+enable_dvdrw_device
+enable_ndmp_device
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1749,9 +1757,12 @@ SWIG
 PERL
 GNUTAR
 STAR
+SUNTAR
 YACC
 YFLAGS
 MTX
+MOUNT
+UMOUNT
 GLIB_CFLAGS
 GLIB_LIBS
 GLIB_GENMARSHAL
@@ -2393,6 +2404,7 @@ Optional Features:
   --disable-threads       build without multithread safety
   --disable-rpath         do not hardcode runtime library paths
   --disable-largefile     omit support for large files
+  --enable-as-needed      enable use od --as-needed linker flag
   --disable-installperms  do not modify ownership and permissions on installed
                           files
   --enable-syntax-checks  Perform syntax checks when installing - developers
@@ -2400,9 +2412,6 @@ Optional Features:
   --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
-  --disable-dvdrw-device  disable the DVD-RW device
-  --disable-ndmp-device   disable the NDMP device
   --enable-werror         To compile with -Werror compiler flag
   --enable-swig-error     To compile swiged C file with -Werror compiler flag
   --enable-shared[=PKGS]  build shared libraries [default=yes]
@@ -2412,6 +2421,9 @@ Optional Features:
   --disable-libtool-lock  avoid locking (might break parallel builds)
   --enable-static-binary  To build statically linked binaries
   --disable-glibtest      do not try to compile and run a test GLIB program
+  --disable-s3-device     disable the S3 device
+  --disable-dvdrw-device  disable the DVD-RW device
+  --disable-ndmp-device   disable the NDMP device
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -2514,7 +2526,6 @@ Optional Packages:
   --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
@@ -2531,6 +2542,7 @@ Optional Packages:
                           if dump supports -h, use it for level0s too
   --with-gnutar=PROG      use PROG as GNU 'tar'
   --with-star=PROG        use PROG as 'star'
+  --with-suntar=PROG      use PROG as 'suntar'
   --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
@@ -2539,6 +2551,8 @@ Optional Packages:
   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
   --with-readline         require readline support (for amrecover)
   --without-readline      don't search for readline
+  --with-libcurl=PREFIX   look for the curl library in PREFIX/lib and headers
+                          in PREFIX/include
 
 Some influential environment variables:
   CC          C compiler command
@@ -2554,12 +2568,15 @@ Some influential environment variables:
   PERL        Path to the 'perl' binary
   GNUTAR      Location of the GNU 'tar' binary
   STAR        Location of the 'star' binary
+  SUNTAR      Location of the 'suntar' 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.
   MTX         Path to the 'mtx' binary
+  MOUNT       Path to the 'mount' binary
+  UMOUNT      Path to the 'umount' binary
   GLIB_CFLAGS CFLAGS to build with glib; disables use of pkg-config
   GLIB_LIBS   libraries to build with glib; disables use of pkg-config
   GLIB_GENMARSHAL
@@ -33654,6 +33671,31 @@ $as_echo "no (not using gcc)" >&6; }
 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
 
 
+    # Check whether --enable-as-needed was given.
+if test "${enable_as_needed+set}" = set; then
+  enableval=$enable_as_needed;  WANT_AS_NEEDED=$enableval
+else
+   WANT_AS_NEEDED=no
+fi
+
+
+     if test x"$WANT_AS_NEEDED" = x"yes"; then
+  WANT_AS_NEEDED_TRUE=
+  WANT_AS_NEEDED_FALSE='#'
+else
+  WANT_AS_NEEDED_TRUE='#'
+  WANT_AS_NEEDED_FALSE=
+fi
+
+
+    if test x"$WANT_AS_NEEDED" = x"yes"; then
+       AS_NEEDED_FLAGS="-Wl,--as-needed"
+    else
+       AS_NEEDED_FLAGS=""
+    fi
+
+
+
 
 #
 # Configuration flags (--with-xxx and --enable-xxx)
@@ -40350,127 +40392,219 @@ _ACEOF
 
 
 #
-# Devices
+# Security (authentication) mechansims
 #
 
+    BSD_SECURITY="yes"
 
+# 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) BSD_SECURITY=yes ;;
+                *) { { $as_echo "$as_me:$LINENO: error: *** You must not supply an argument to --without-bsd-security." >&5
+$as_echo "$as_me: error: *** You must not supply an argument to --without-bsd-security." >&2;}
+   { (exit 1); exit 1; }; }
+                    ;;
+            esac
 
+fi
 
 
+    USE_AMANDAHOSTS=yes
 
+# 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) USE_AMANDAHOSTS=yes ;;
+                *) { { $as_echo "$as_me:$LINENO: error: *** You must not supply an argument to --without-amandahosts option." >&5
+$as_echo "$as_me: error: *** You must not supply an argument to --without-amandahosts option." >&2;}
+   { (exit 1); exit 1; }; }
+                  ;;
+            esac
 
 
+fi
 
 
+    if test "x$BSD_SECURITY" = "xyes"; then
 
+cat >>confdefs.h <<\_ACEOF
+#define BSD_SECURITY 1
+_ACEOF
 
+        if test "x$USE_AMANDAHOSTS" = "xyes"; then
 
+cat >>confdefs.h <<\_ACEOF
+#define USE_AMANDAHOSTS 1
+_ACEOF
 
+        fi
+    fi
 
+     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
 
 
 
 
 
+    BSDTCP_SECURITY="yes"
 
+# Check whether --with-bsdtcp-security was given.
+if test "${with_bsdtcp_security+set}" = set; then
+  withval=$with_bsdtcp_security;
+            case "$withval" in
+                n | no) BSDTCP_SECURITY=no ;;
+                y |  ye | yes) BSDTCP_SECURITY=yes ;;
+                *) { { $as_echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-bsdtcp-security." >&5
+$as_echo "$as_me: error: *** You must not supply an argument to --with-bsdtcp-security." >&2;}
+   { (exit 1); exit 1; }; }
+              ;;
+            esac
 
+fi
 
 
+    if test "x$BSDTCP_SECURITY" = "xyes"; then
 
+cat >>confdefs.h <<\_ACEOF
+#define BSDTCP_SECURITY 1
+_ACEOF
 
+    fi
 
+     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
 
 
 
 
+    BSDUDP_SECURITY="no"
 
+# 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 ;;
+                *) { { $as_echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-bsdudp-security." >&5
+$as_echo "$as_me: error: *** You must not supply an argument to --with-bsdudp-security." >&2;}
+   { (exit 1); exit 1; }; }
+              ;;
+            esac
 
+fi
 
 
+    if test "x$BSDUDP_SECURITY" = "xyes"; then
 
+cat >>confdefs.h <<\_ACEOF
+#define BSDUDP_SECURITY 1
+_ACEOF
 
+    fi
 
-
-# Check whether --with-libcurl was given.
-if test "${with_libcurl+set}" = set; then
-  withval=$with_libcurl; _libcurl_with=$withval
+     if test x"$BSDUDP_SECURITY" = x"yes"; then
+  WANT_BSDUDP_SECURITY_TRUE=
+  WANT_BSDUDP_SECURITY_FALSE='#'
 else
-  _libcurl_with=yes
+  WANT_BSDUDP_SECURITY_TRUE='#'
+  WANT_BSDUDP_SECURITY_FALSE=
 fi
 
 
-  if test "$_libcurl_with" != "no" ; 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
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_AWK+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$AWK"; then
-  ac_cv_prog_AWK="$AWK" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { 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"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
+
+    RSH_SECURITY=no
+
+# 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 ;;
+                *) { { $as_echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-rsh-security." >&5
+$as_echo "$as_me: error: *** You must not supply an argument to --with-rsh-security." >&2;}
+   { (exit 1); exit 1; }; }
+              ;;
+            esac
 
 fi
-fi
-AWK=$ac_cv_prog_AWK
-if test -n "$AWK"; then
-  { $as_echo "$as_me:$LINENO: result: $AWK" >&5
-$as_echo "$AWK" >&6; }
+
+
+    if test "x$RSH_SECURITY" = "xyes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define RSH_SECURITY 1
+_ACEOF
+
+    fi
+     if test x"$RSH_SECURITY" = x"yes"; then
+  WANT_RSH_SECURITY_TRUE=
+  WANT_RSH_SECURITY_FALSE='#'
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
+  WANT_RSH_SECURITY_TRUE='#'
+  WANT_RSH_SECURITY_FALSE=
 fi
 
 
-  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;}'"
+    SSH_SECURITY=yes
 
-     _libcurl_try_link=yes
+# Check whether --with-ssh-security was given.
+if test "${with_ssh_security+set}" = set; then
+  withval=$with_ssh_security;
+            case "$withval" in
+                n | no) SSH_SECURITY=no ;;
+                y |  ye | yes) SSH_SECURITY=yes ;;
+                *) { { $as_echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-ssh-security." >&5
+$as_echo "$as_me: error: *** You must not supply an argument to --with-ssh-security." >&2;}
+   { (exit 1); exit 1; }; }
+              ;;
+            esac
 
-     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
+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
 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path__libcurl_config+set}" = set; then
+if test "${ac_cv_path_SSH+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  case $_libcurl_config in
+  case $SSH in
   [\\/]* | ?:[\\/]*)
-  ac_cv_path__libcurl_config="$_libcurl_config" # Let the user override the test with a path.
+  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 "$withval/bin"
+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__libcurl_config="$as_dir/$ac_word$ac_exec_ext"
+    ac_cv_path_SSH="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 IFS=$as_save_IFS
 
-  test -z "$ac_cv_path__libcurl_config" && ac_cv_path__libcurl_config=""$withval/bin""
   ;;
 esac
 fi
-_libcurl_config=$ac_cv_path__libcurl_config
-if test -n "$_libcurl_config"; then
-  { $as_echo "$as_me:$LINENO: result: $_libcurl_config" >&5
-$as_echo "$_libcurl_config" >&6; }
+SSH=$ac_cv_path_SSH
+if test -n "$SSH"; then
+  { $as_echo "$as_me:$LINENO: result: $SSH" >&5
+$as_echo "$SSH" >&6; }
 else
   { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
-     else
-        # Extract the first word of "curl-config", so it can be a program name with args.
-set dummy curl-config; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path__libcurl_config+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  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 { 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"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
+  test -n "$SSH" && break
 done
-IFS=$as_save_IFS
 
-  ;;
-esac
-fi
-_libcurl_config=$ac_cv_path__libcurl_config
-if test -n "$_libcurl_config"; then
-  { $as_echo "$as_me:$LINENO: result: $_libcurl_config" >&5
-$as_echo "$_libcurl_config" >&6; }
+
+        # 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
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
+   SSH_OPTIONS=''
+
 fi
 
 
-     fi
+        case "$SSH_OPTIONS" in
+            y | ye | yes | n | no)
+                { { $as_echo "$as_me:$LINENO: error: *** You must supply an argument to --with-ssh-options." >&5
+$as_echo "$as_me: error: *** You must supply an argument to --with-ssh-options." >&2;}
+   { (exit 1); exit 1; }; };;
+            *) : ;;
+        esac
 
-     if test x$_libcurl_config != "x" ; then
-        { $as_echo "$as_me:$LINENO: checking for the version of libcurl" >&5
-$as_echo_n "checking for the version of libcurl... " >&6; }
-if test "${libcurl_cv_lib_curl_version+set}" = set; then
-  $as_echo_n "(cached) " >&6
+        { $as_echo "$as_me:$LINENO: checking SSH options" >&5
+$as_echo_n "checking SSH options... " >&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
+        { $as_echo "$as_me:$LINENO: result: $SSH_OPTIONS" >&5
+$as_echo "$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
-  libcurl_cv_lib_curl_version=`$_libcurl_config --version | $AWK '{print $2}'`
+  WANT_SSH_SECURITY_TRUE='#'
+  WANT_SSH_SECURITY_FALSE=
 fi
-{ $as_echo "$as_me:$LINENO: result: $libcurl_cv_lib_curl_version" >&5
-$as_echo "$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
-           { $as_echo "$as_me:$LINENO: checking for libcurl >= version 7.10.0" >&5
-$as_echo_n "checking for libcurl >= version 7.10.0... " >&6; }
-if test "${libcurl_cv_lib_version_ok+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
 
-              if test $_libcurl_version -ge $_libcurl_wanted ; then
-                 libcurl_cv_lib_version_ok=yes
-              else
-                 libcurl_cv_lib_version_ok=no
-              fi
+    # (note -- don't just substitute SSH_OPTIONS -- shell quoting will break)
+
+
+    # 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
-{ $as_echo "$as_me:$LINENO: result: $libcurl_cv_lib_version_ok" >&5
-$as_echo "$libcurl_cv_lib_version_ok" >&6; }
-        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
+    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
+        { $as_echo "$as_me:$LINENO: checking for Kerberos V libraries" >&5
+$as_echo_n "checking for Kerberos V libraries... " >&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"
 
-           # All curl-config scripts support --feature
-           _libcurl_features=`$_libcurl_config --feature`
+                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"
 
-           # 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
+                CPPFLAGS="$CPPFLAGS -DKRB5_HEIMDAL_INCLUDES"
 
-        unset _libcurl_wanted
-     fi
+                break
+            fi
+          done
+        done
 
-     if test $_libcurl_try_link = yes ; then
+        if test "$KRB5_DIR_FOUND"; then
+            { $as_echo "$as_me:$LINENO: result: found in $KRB5_DIR_FOUND" >&5
+$as_echo "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"
 
-        # 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"}
+            else
+                CPPFLAGS="$CPPFLAGS -I$KRB5_DIR_FOUND/include"
 
-        { $as_echo "$as_me:$LINENO: checking whether libcurl is usable" >&5
-$as_echo_n "checking whether libcurl is usable... " >&6; }
-if test "${libcurl_cv_lib_curl_usable+set}" = set; then
+            fi
+
+{ $as_echo "$as_me:$LINENO: checking for main in -lkrb5support" >&5
+$as_echo_n "checking for main in -lkrb5support... " >&6; }
+if test "${ac_cv_lib_krb5support_main+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-
-           _libcurl_save_cppflags=$CPPFLAGS
-           CPPFLAGS="$LIBCURL_CPPFLAGS $CPPFLAGS"
-           _libcurl_save_libs=$LIBS
-           LIBS="$LIBCURL $LIBS"
-
-           cat >conftest.$ac_ext <<_ACEOF
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lkrb5support  $LIBS"
+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 ()
 {
-
-/* 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;
-
+return main ();
   ;
   return 0;
 }
@@ -40662,1491 +40820,1158 @@ $as_echo "$ac_try_echo") >&5
         test "$cross_compiling" = yes ||
         $as_test_x conftest$ac_exeext
        }; then
-  libcurl_cv_lib_curl_usable=yes
+  ac_cv_lib_krb5support_main=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       libcurl_cv_lib_curl_usable=no
+       ac_cv_lib_krb5support_main=no
 fi
 
 rm -rf conftest.dSYM
 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
-
+LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:$LINENO: result: $libcurl_cv_lib_curl_usable" >&5
-$as_echo "$libcurl_cv_lib_curl_usable" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_krb5support_main" >&5
+$as_echo "$ac_cv_lib_krb5support_main" >&6; }
+if test "x$ac_cv_lib_krb5support_main" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBKRB5SUPPORT 1
+_ACEOF
 
-        if test $libcurl_cv_lib_curl_usable = yes ; then
+  LIBS="-lkrb5support $LIBS"
 
-           # Does curl_free() exist in this version of libcurl?
-           # If not, fake it with free()
+fi
 
-           _libcurl_save_cppflags=$CPPFLAGS
-           CPPFLAGS="$CPPFLAGS $LIBCURL_CPPFLAGS"
-           _libcurl_save_libs=$LIBS
-           LIBS="$LIBS $LIBCURL"
 
-           { $as_echo "$as_me:$LINENO: checking for curl_free" >&5
-$as_echo_n "checking for curl_free... " >&6; }
-if test "${ac_cv_func_curl_free+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* 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
+            if test "$KRB5_LIBDIR_FOUND" != "$libdir" ; then
+                LDFLAGS="$LDFLAGS -L$KRB5_LIBDIR_FOUND"
 
-/* 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.  */
+            fi
 
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
 
-#undef curl_free
+cat >>confdefs.h <<\_ACEOF
+#define KRB5_SECURITY 1
+_ACEOF
 
-/* 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
+        else
+            { $as_echo "$as_me:$LINENO: result: no krb5 system libraries found" >&5
+$as_echo "no krb5 system libraries found" >&6; }
+            { { $as_echo "$as_me:$LINENO: error: No Kerberos V libraries were found on your system; krb5-security cannot be enabled" >&5
+$as_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
 
-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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_func_curl_free=yes
+     if test x"$KRB5_SECURITY" = x"yes"; then
+  WANT_KRB5_SECURITY_TRUE=
+  WANT_KRB5_SECURITY_FALSE='#'
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_cv_func_curl_free=no
+  WANT_KRB5_SECURITY_TRUE='#'
+  WANT_KRB5_SECURITY_FALSE=
 fi
 
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_curl_free" >&5
-$as_echo "$ac_cv_func_curl_free" >&6; }
-if test "x$ac_cv_func_curl_free" = x""yes; then
-  :
-else
 
-cat >>confdefs.h <<\_ACEOF
-#define curl_free free
-_ACEOF
 
-fi
 
+#
+# Dumpers
+#
 
-           CPPFLAGS=$_libcurl_save_cppflags
-           LIBS=$_libcurl_save_libs
-           unset _libcurl_save_cppflags
-           unset _libcurl_save_libs
 
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIBCURL 1
-_ACEOF
+    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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_XFSDUMP+set}" = set; then
+  $as_echo_n "(cached) " >&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 { 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"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
+  ;;
+esac
+fi
+XFSDUMP=$ac_cv_path_XFSDUMP
+if test -n "$XFSDUMP"; then
+  { $as_echo "$as_me:$LINENO: result: $XFSDUMP" >&5
+$as_echo "$XFSDUMP" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
 
+  test -n "$XFSDUMP" && break
+done
 
-           for _libcurl_feature in $_libcurl_features ; do
-              cat >>confdefs.h <<_ACEOF
-#define `$as_echo "libcurl_feature_$_libcurl_feature" | $as_tr_cpp` 1
-_ACEOF
+    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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_XFSRESTORE+set}" = set; then
+  $as_echo_n "(cached) " >&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 { 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"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-              eval `$as_echo "libcurl_feature_$_libcurl_feature" | $as_tr_sh`=yes
-           done
+  ;;
+esac
+fi
+XFSRESTORE=$ac_cv_path_XFSRESTORE
+if test -n "$XFSRESTORE"; then
+  { $as_echo "$as_me:$LINENO: result: $XFSRESTORE" >&5
+$as_echo "$XFSRESTORE" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
-           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"
+  test -n "$XFSRESTORE" && break
+done
 
-              if test x$libcurl_feature_SSL = xyes ; then
-                 _libcurl_protocols="$_libcurl_protocols HTTPS"
+    if test "$XFSDUMP" -a "$XFSRESTORE"; then
 
-                 # 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
+cat >>confdefs.h <<_ACEOF
+#define XFSDUMP "$XFSDUMP"
+_ACEOF
 
-           for _libcurl_protocol in $_libcurl_protocols ; do
-              cat >>confdefs.h <<_ACEOF
-#define `$as_echo "libcurl_protocol_$_libcurl_protocol" | $as_tr_cpp` 1
+
+cat >>confdefs.h <<_ACEOF
+#define XFSRESTORE "$XFSRESTORE"
 _ACEOF
 
-              eval `$as_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
+    { $as_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
+$as_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;}
 
-  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
-     # This is the IF-YES path
-     HAVE_CURL=yes
-  fi
 
-  unset _libcurl_with
+    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
 
-    if test x"$HAVE_CURL" = x"yes"; then
-       LIBS="$LIBCURL $LIBS"
 
-       CPPFLAGS="$CPPFLAGS $LIBCURL_CPPFLAGS"
+    fi
 
 
 
 
-    { $as_echo "$as_me:$LINENO: checking for curl_off_t" >&5
-$as_echo_n "checking for curl_off_t... " >&6; }
-if test "${ac_cv_type_curl_off_t+set}" = set; then
+    # Extract the first word of "vxdump", so it can be a program name with args.
+set dummy vxdump; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_VXDUMP+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  ac_cv_type_curl_off_t=no
-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_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-#include <curl/curl.h>
-
-
+  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"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-int
-main ()
-{
-if (sizeof (curl_off_t))
-       return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
+  ;;
 esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-#include <curl/curl.h>
-
+fi
+VXDUMP=$ac_cv_path_VXDUMP
+if test -n "$VXDUMP"; then
+  { $as_echo "$as_me:$LINENO: result: $VXDUMP" >&5
+$as_echo "$VXDUMP" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
 
-int
-main ()
-{
-if (sizeof ((curl_off_t)))
-         return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  :
+    # Extract the first word of "vxrestore", so it can be a program name with args.
+set dummy vxrestore; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_VXRESTORE+set}" = set; then
+  $as_echo_n "(cached) " >&6
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  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"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-       ac_cv_type_curl_off_t=yes
+  ;;
+esac
 fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+VXRESTORE=$ac_cv_path_VXRESTORE
+if test -n "$VXRESTORE"; then
+  { $as_echo "$as_me:$LINENO: result: $VXRESTORE" >&5
+$as_echo "$VXRESTORE" >&6; }
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_curl_off_t" >&5
-$as_echo "$ac_cv_type_curl_off_t" >&6; }
-if test "x$ac_cv_type_curl_off_t" = x""yes; then
-  :
-else
 
+    if test "$VXDUMP" -a "$VXRESTORE"; then
 
-cat >>confdefs.h <<\_ACEOF
-#define curl_off_t off_t
+cat >>confdefs.h <<_ACEOF
+#define VXDUMP "$VXDUMP"
 _ACEOF
 
 
-fi
-
+cat >>confdefs.h <<_ACEOF
+#define VXRESTORE "$VXRESTORE"
+_ACEOF
 
-       case "$host" in
-           *sun-solaris2*) # Solaris, all versions.
-           # we extract the -L flags and translate them to -R flags, as required
-           # by the runtime linker.
-           if test -n "$_libcurl_config"; then
-               curlflags=`$_libcurl_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
     fi
 
 
 
-    HAVE_HMAC=yes
 
-{ $as_echo "$as_me:$LINENO: checking for HMAC_CTX_init in -lcrypto" >&5
-$as_echo_n "checking for HMAC_CTX_init in -lcrypto... " >&6; }
-if test "${ac_cv_lib_crypto_HMAC_CTX_init+set}" = set; then
+    # Extract the first word of "vdump", so it can be a program name with args.
+set dummy vdump; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_VDUMP+set}" = set; then
   $as_echo_n "(cached) " >&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.  */
-
-/* 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;;
+  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"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
 esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_lib_crypto_HMAC_CTX_init=yes
+fi
+VDUMP=$ac_cv_path_VDUMP
+if test -n "$VDUMP"; then
+  { $as_echo "$as_me:$LINENO: result: $VDUMP" >&5
+$as_echo "$VDUMP" >&6; }
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_cv_lib_crypto_HMAC_CTX_init=no
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
-rm -rf conftest.dSYM
-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
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_crypto_HMAC_CTX_init" >&5
-$as_echo "$ac_cv_lib_crypto_HMAC_CTX_init" >&6; }
-if test "x$ac_cv_lib_crypto_HMAC_CTX_init" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBCRYPTO 1
-_ACEOF
 
-  LIBS="-lcrypto $LIBS"
+    # Extract the first word of "vrestore", so it can be a program name with args.
+set dummy vrestore; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_VRESTORE+set}" = set; then
+  $as_echo_n "(cached) " >&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"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
+  ;;
+esac
+fi
+VRESTORE=$ac_cv_path_VRESTORE
+if test -n "$VRESTORE"; then
+  { $as_echo "$as_me:$LINENO: result: $VRESTORE" >&5
+$as_echo "$VRESTORE" >&6; }
 else
-  HAVE_HMAC=no
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
-    found_hmac_h=no
+    if test "$VDUMP" -a "$VRESTORE"; then
 
+cat >>confdefs.h <<_ACEOF
+#define VDUMP "$VDUMP"
+_ACEOF
 
 
-for ac_header in openssl/hmac.h crypto/hmac.h hmac.h
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
-$as_echo_n "checking $ac_header usability... " >&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>
+cat >>confdefs.h <<_ACEOF
+#define VRESTORE "$VRESTORE"
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_header_compiler=no
-fi
+    fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
 
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
-$as_echo_n "checking $ac_header presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+
+
+
+    # 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=
+    AIX_BACKUP=
+    case "$host" in
+       *-dg-*)
+           DUMP_PROGRAMS="dump "$DUMP_PROGRAMS
+           DUMP_RETURNS_1=1
+           ;;
+      *-ibm-aix*)
+           DUMP_PROGRAMS="backup "$DUMP_PROGRAMS
+           AIX_BACKUP=1
+
+cat >>confdefs.h <<\_ACEOF
+#define AIX_BACKUP 1
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
+
+           ;;
+      *-ultrix*)
+           DUMP_RETURNS_1=1
+           ;;
+    esac
+
+    if test -n "$DUMP_RETURNS_1"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define DUMP_RETURNS_1 1
 _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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$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
-  $as_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
+
+    fi
+
+    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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_DUMP+set}" = set; then
+  $as_echo_n "(cached) " >&6
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  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"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-  ac_header_preproc=no
+  ;;
+esac
+fi
+DUMP=$ac_cv_path_DUMP
+if test -n "$DUMP"; then
+  { $as_echo "$as_me:$LINENO: result: $DUMP" >&5
+$as_echo "$DUMP" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
 
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+  test -n "$DUMP" && break
+done
 
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+    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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_RESTORE+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
+  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"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
+  ;;
+esac
 fi
-as_val=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
- found_hmac_h=yes; break
+RESTORE=$ac_cv_path_RESTORE
+if test -n "$RESTORE"; then
+  { $as_echo "$as_me:$LINENO: result: $RESTORE" >&5
+$as_echo "$RESTORE" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
+
+  test -n "$RESTORE" && break
 done
 
-    if test x"$found_hmac_h" != x"yes"; then
-       HAVE_HMAC=no
+
+    # 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
 
+cat >>confdefs.h <<_ACEOF
+#define DUMP "$DUMP"
+_ACEOF
 
 
+cat >>confdefs.h <<_ACEOF
+#define RESTORE "$RESTORE"
+_ACEOF
 
-    # Check whether --enable-s3-device was given.
-if test "${enable_s3_device+set}" = set; then
-  enableval=$enable_s3_device;  WANT_S3_DEVICE=$enableval
-else
-   WANT_S3_DEVICE=maybe
-fi
 
+       # check for an estimate flag
+       if test -x $DUMP; then
+           { $as_echo "$as_me:$LINENO: checking whether $DUMP supports -E or -S for estimates" >&5
+$as_echo_n "checking whether $DUMP supports -E or -S for estimates... " >&6; }
+if test "${amanda_cv_dump_estimate+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
 
-    { $as_echo "$as_me:$LINENO: checking whether to include the Amazon S3 device" >&5
-$as_echo_n "checking whether to include the Amazon S3 device... " >&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
-               { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-               { { $as_echo "$as_me:$LINENO: error: Cannot build the Amazon S3 device: one or more prerequisites are missing." >&5
-$as_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
-    { $as_echo "$as_me:$LINENO: result: $WANT_S3_DEVICE" >&5
-$as_echo "$WANT_S3_DEVICE" >&6; }
+                   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=$?
+  $as_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=$?
+  $as_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=$?
+  $as_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=$?
+  $as_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=$?
+  $as_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
 
-     if test x"$WANT_S3_DEVICE" = x"yes"; then
-  WANT_S3_DEVICE_TRUE=
-  WANT_S3_DEVICE_FALSE='#'
-else
-  WANT_S3_DEVICE_TRUE='#'
-  WANT_S3_DEVICE_FALSE=
 fi
+{ $as_echo "$as_me:$LINENO: result: $amanda_cv_dump_estimate" >&5
+$as_echo "$amanda_cv_dump_estimate" >&6; }
+       else
 
+    { $as_echo "$as_me:$LINENO: WARNING: $DUMP is not executable, cannot run -E/-S test" >&5
+$as_echo "$as_me: WARNING: $DUMP is not executable, cannot run -E/-S test" >&2;}
 
-    # 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
 
-    fi
+    cat <<AAW_EOF >>config.warnings
+$DUMP is not executable, cannot run -E/-S test
+AAW_EOF
 
 
+           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
 
-for ac_header in \
-       linux/zftape.h \
-       sys/tape.h \
-       sys/mtio.h \
 
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+# 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
+               { $as_echo "$as_me:$LINENO: checking whether $DUMP supports -h (honor nodump flag)" >&5
+$as_echo_n "checking whether $DUMP supports -h (honor nodump flag)... " >&6; }
+if test "${amanda_cv_honor_nodump+set}" = set; then
   $as_echo_n "(cached) " >&6
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
 else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
-$as_echo_n "checking $ac_header usability... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
+
+                   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=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_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
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
-$as_echo_n "checking $ac_header presence... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  (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=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
-else
-  $as_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
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-
-fi
-as_val=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
+  (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=$?
+  $as_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
+{ $as_echo "$as_me:$LINENO: result: $amanda_cv_honor_nodump" >&5
+$as_echo "$amanda_cv_honor_nodump" >&6; }
+           else
 
-done
+    { $as_echo "$as_me:$LINENO: WARNING: $DUMP is not executable, cannot run -h test" >&5
+$as_echo "$as_me: WARNING: $DUMP is not executable, cannot run -h test" >&2;}
 
 
-    # check for MTIOCTOP, an indicator of POSIX tape support
-    { $as_echo "$as_me:$LINENO: checking for MTIOCTOP" >&5
-$as_echo_n "checking for MTIOCTOP... " >&6; }
-if test "${amanda_cv_HAVE_MTIOCTOP+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
+    cat <<AAW_EOF >>config.warnings
+$DUMP is not executable, cannot run -h test
+AAW_EOF
 
-       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
+               amanda_cv_honor_nodump=no
+           fi
+           if test "x$amanda_cv_honor_nodump" = xyes; then
 
-int
-main ()
-{
- int dummy = 0;
-  ;
-  return 0;
-}
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_HONOR_NODUMP 1
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  amanda_cv_HAVE_MTIOCTOP=yes
-else
-  $as_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
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $amanda_cv_HAVE_MTIOCTOP" >&5
-$as_echo "$amanda_cv_HAVE_MTIOCTOP" >&6; }
-
-    # maybe we have no tape device at all (e.g., Mac OS X)?
-    if test x"$HAVE_MTIOCTOP" = x"yes"; then
-       want_tape_device=yes
-
-cat >>confdefs.h <<\_ACEOF
-#define WANT_TAPE_DEVICE 1
-_ACEOF
 
     fi
-     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
 
 
-    #
-    # Check for various "mt status" related structure elements.
-    #
-    { $as_echo "$as_me:$LINENO: checking for mt_flags mtget structure element" >&5
-$as_echo_n "checking for mt_flags mtget structure element... " >&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
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+    # call with
 
-           { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
+# 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 ;;
+               *)  { { $as_echo "$as_me:$LINENO: error: *** You must supply a full pathname to --with-gnutar" >&5
+$as_echo "$as_me: error: *** You must supply a full pathname to --with-gnutar" >&2;}
+   { (exit 1); exit 1; }; };;
+           esac
+           # done
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_MT_FLAGS 1
-_ACEOF
 
+fi
 
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
+    if test "x$GNUTAR" = "xno"; then
+       GNUTAR=
+    else
+       OLD_GNUTAR=$GNUTAR
+       for gnutar_name in gtar gnutar tar; do
+           for ac_prog in $gnutar_name
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_GNUTAR+set}" = set; then
+  $as_echo_n "(cached) " >&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"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-           { $as_echo "$as_me:$LINENO: result: no" >&5
+  ;;
+esac
+fi
+GNUTAR=$ac_cv_path_GNUTAR
+if test -n "$GNUTAR"; then
+  { $as_echo "$as_me:$LINENO: result: $GNUTAR" >&5
+$as_echo "$GNUTAR" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
-
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-    { $as_echo "$as_me:$LINENO: checking for mt_fileno mtget structure element" >&5
-$as_echo_n "checking for mt_fileno mtget structure element... " >&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>
+  test -n "$GNUTAR" && break
+done
 
-int
-main ()
-{
+           if test -n "$GNUTAR"; then
+             case `"$GNUTAR" --version 2>&1` in
+              *GNU*tar* | *Free*paxutils* )
+                           # OK, it is GNU tar
+                           break
+                           ;;
+              *)
+                           if test -n "$OLD_GNUTAR"; then
 
-           struct mtget buf;
-           long ds;
+    { $as_echo "$as_me:$LINENO: WARNING: $GNUTAR is not GNU tar, it will be used." >&5
+$as_echo "$as_me: WARNING: $GNUTAR is not GNU tar, it will be used." >&2;}
 
-           ds = buf.mt_fileno;
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+    cat <<AAW_EOF >>config.warnings
+$GNUTAR is not GNU tar, it will be used.
+AAW_EOF
 
-           { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_MT_FILENO 1
-_ACEOF
+                           else
+                                   # warning..
 
+    { $as_echo "$as_me:$LINENO: WARNING: $GNUTAR is not GNU tar, so it will not be used." >&5
+$as_echo "$as_me: WARNING: $GNUTAR is not GNU tar, so it will not be used." >&2;}
 
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
+    cat <<AAW_EOF >>config.warnings
+$GNUTAR is not GNU tar, so it will not be used.
+AAW_EOF
 
-           { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
 
-fi
+                                   # reset the cache for GNUTAR so AC_PATH_PROGS will search again
+                                   GNUTAR=''
+                                   unset ac_cv_path_GNUTAR
+                           fi
+                           ;;
+             esac
+           fi
+       done
+    fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+    if test "x$GNUTAR" != "x"; then
+       # define unquoted
 
-    { $as_echo "$as_me:$LINENO: checking for mt_blkno mtget structure element" >&5
-$as_echo_n "checking for mt_blkno mtget structure element... " >&6; }
-    cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+cat >>confdefs.h <<_ACEOF
+#define GNUTAR "$GNUTAR"
 _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;
+    fi
 
-           ds = buf.mt_blkno;
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
 
-           { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_MT_BLKNO 1
-_ACEOF
 
 
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+    # call with
 
+# Check whether --with-star was given.
+if test "${with_star+set}" = set; then
+  withval=$with_star;
+           # check withval
+           case "$withval" in
+               /*) STAR="$withval";;
+               y|ye|yes) :;;
+               n|no) STAR=no ;;
+               *)  { { $as_echo "$as_me:$LINENO: error: *** You must supply a full pathname to --with-star" >&5
+$as_echo "$as_me: error: *** You must supply a full pathname to --with-star" >&2;}
+   { (exit 1); exit 1; }; };;
+           esac
+           # done
 
-           { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
 
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-    { $as_echo "$as_me:$LINENO: checking for mt_dsreg mtget structure element" >&5
-$as_echo_n "checking for mt_dsreg mtget structure element... " >&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_dsreg;
+    if test "x$STAR" = "xno"; then
+       STAR=
+    else
+       OLD_STAR=$STAR
+       for ac_prog in star
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_STAR+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  case $STAR in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_STAR="$STAR" # 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_STAR="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
+  ;;
 esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-
-           { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_MT_DSREG 1
-_ACEOF
-
-
+fi
+STAR=$ac_cv_path_STAR
+if test -n "$STAR"; then
+  { $as_echo "$as_me:$LINENO: result: $STAR" >&5
+$as_echo "$STAR" >&6; }
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-           { $as_echo "$as_me:$LINENO: result: no" >&5
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
-
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-    { $as_echo "$as_me:$LINENO: checking for mt_erreg mtget structure element" >&5
-$as_echo_n "checking for mt_erreg mtget structure element... " >&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>
+  test -n "$STAR" && break
+done
 
-int
-main ()
-{
+       if test -n "$STAR"; then
+           case `"$STAR" --version 2>/dev/null` in
+            *star*)
+                   # OK, it is star
+                   break
+                   ;;
+            *)
+                   if test -n "$OLD_STAR"; then
 
-           struct mtget buf;
-           long ds;
+    { $as_echo "$as_me:$LINENO: WARNING: $STAR is not star, it will be used." >&5
+$as_echo "$as_me: WARNING: $STAR is not star, it will be used." >&2;}
 
-           ds = buf.mt_erreg;
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+    cat <<AAW_EOF >>config.warnings
+$STAR is not star, it will be used.
+AAW_EOF
 
-           { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_MT_ERREG 1
-_ACEOF
+                   else
+                       # warning..
 
+    { $as_echo "$as_me:$LINENO: WARNING: $STAR is not star, so it will not be used." >&5
+$as_echo "$as_me: WARNING: $STAR is not star, so it will not be used." >&2;}
 
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
+    cat <<AAW_EOF >>config.warnings
+$STAR is not star, so it will not be used.
+AAW_EOF
 
-           { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
 
-fi
+                       # reset the cache for STAR so AC_PATH_PROGS will search again
+                       STAR=''
+                       unset ac_cv_path_STAR
+                   fi
+                   ;;
+           esac
+       fi
+    fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+    if test "x$STAR" != "x"; then
+       # define unquoted
 
-    case "$host" in
-       *linux*)
-cat >>confdefs.h <<\_ACEOF
-#define DEFAULT_TAPE_NON_BLOCKING_OPEN 1
+cat >>confdefs.h <<_ACEOF
+#define STAR "$STAR"
 _ACEOF
-;;
-    esac
-
 
-       # Check whether --enable-dvdrw-device was given.
-if test "${enable_dvdrw_device+set}" = set; then
-  enableval=$enable_dvdrw_device;  WANT_DVDRW_DEVICE=$enableval
-else
-   WANT_DVDRW_DEVICE=yes
-fi
+    fi
 
 
-       { $as_echo "$as_me:$LINENO: checking whether to include the DVD-RW device" >&5
-$as_echo_n "checking whether to include the DVD-RW device... " >&6; }
-       { $as_echo "$as_me:$LINENO: result: $WANT_DVDRW_DEVICE" >&5
-$as_echo "$WANT_DVDRW_DEVICE" >&6; }
 
-        if test x"$WANT_DVDRW_DEVICE" = x"yes"; then
-  WANT_DVDRW_DEVICE_TRUE=
-  WANT_DVDRW_DEVICE_FALSE='#'
-else
-  WANT_DVDRW_DEVICE_TRUE='#'
-  WANT_DVDRW_DEVICE_FALSE=
-fi
 
 
-       # Now handle any setup for DVDRW, if we want it.
-       if test x"$WANT_DVDRW_DEVICE" = x"yes"; then
 
-cat >>confdefs.h <<\_ACEOF
-#define WANT_DVDRW_DEVICE /**/
-_ACEOF
+    # call with
 
-       fi
+# Check whether --with-suntar was given.
+if test "${with_suntar+set}" = set; then
+  withval=$with_suntar;
+           # check withval
+           case "$withval" in
+               /*) SUNTAR="$withval";;
+               y|ye|yes) :;;
+               n|no) SUNTAR=no ;;
+               *)  { { $as_echo "$as_me:$LINENO: error: *** You must supply a full pathname to --with-suntar" >&5
+$as_echo "$as_me: error: *** You must supply a full pathname to --with-suntar" >&2;}
+   { (exit 1); exit 1; }; };;
+           esac
+           # done
 
+else
 
+           if test "x$SUNTAR" == "x"; then
+               SUNTAR="/usr/sbin/tar"
+           fi
 
 
-    # Check whether --enable-ndmp-device was given.
-if test "${enable_ndmp_device+set}" = set; then
-  enableval=$enable_ndmp_device;  WANT_NDMP_DEVICE=$enableval
-else
-   WANT_NDMP_DEVICE=$WANT_NDMP
 fi
 
 
-    if test x"$WANT_NDMP" != x"true" -a x"$WANT_NDMP_DEVICE" = x"true"; then
-       { { $as_echo "$as_me:$LINENO: error: NDMP support is required to build the ndmp device (--with-ndmp)" >&5
-$as_echo "$as_me: error: NDMP support is required to build the ndmp device (--with-ndmp)" >&2;}
-   { (exit 1); exit 1; }; }
+    if test "x$SUNTAR" = "xno"; then
+       SUNTAR=
     fi
 
-    if test x"$WANT_NDMP_DEVICE" = x"true"; then
+    if test "x$SUNTAR" != "x"; then
+       # define unquoted
 
-cat >>confdefs.h <<\_ACEOF
-#define WANT_NDMP_DEVICE 1
+cat >>confdefs.h <<_ACEOF
+#define SUNTAR "$SUNTAR"
 _ACEOF
 
     fi
 
-     if test x"$WANT_NDMP_DEVICE" = x"true"; then
-  WANT_NDMP_DEVICE_TRUE=
-  WANT_NDMP_DEVICE_FALSE='#'
-else
-  WANT_NDMP_DEVICE_TRUE='#'
-  WANT_NDMP_DEVICE_FALSE=
-fi
-
-
-
-#
-# Security (authentication) mechansims
-#
-
-    BSD_SECURITY="yes"
-
-# 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) BSD_SECURITY=yes ;;
-                *) { { $as_echo "$as_me:$LINENO: error: *** You must not supply an argument to --without-bsd-security." >&5
-$as_echo "$as_me: error: *** You must not supply an argument to --without-bsd-security." >&2;}
-   { (exit 1); exit 1; }; }
-                    ;;
-            esac
-
-fi
-
-
-    USE_AMANDAHOSTS=yes
-
-# 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) USE_AMANDAHOSTS=yes ;;
-                *) { { $as_echo "$as_me:$LINENO: error: *** You must not supply an argument to --without-amandahosts option." >&5
-$as_echo "$as_me: error: *** You must not supply an argument to --without-amandahosts option." >&2;}
-   { (exit 1); exit 1; }; }
-                  ;;
-            esac
-
 
-fi
 
 
-    if test "x$BSD_SECURITY" = "xyes"; then
 
-cat >>confdefs.h <<\_ACEOF
-#define BSD_SECURITY 1
-_ACEOF
 
-        if test "x$USE_AMANDAHOSTS" = "xyes"; then
 
-cat >>confdefs.h <<\_ACEOF
-#define USE_AMANDAHOSTS 1
-_ACEOF
+# 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 ;;
+               *)  { { $as_echo "$as_me:$LINENO: error: *** You must supply a full pathname to --with-smbclient" >&5
+$as_echo "$as_me: error: *** You must supply a full pathname to --with-smbclient" >&2;}
+   { (exit 1); exit 1; }; };;
+           esac
 
-        fi
-    fi
 
-     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
 
 
 
-
-
-    BSDTCP_SECURITY="yes"
-
-# Check whether --with-bsdtcp-security was given.
-if test "${with_bsdtcp_security+set}" = set; then
-  withval=$with_bsdtcp_security;
-            case "$withval" in
-                n | no) BSDTCP_SECURITY=no ;;
-                y |  ye | yes) BSDTCP_SECURITY=yes ;;
-                *) { { $as_echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-bsdtcp-security." >&5
-$as_echo "$as_me: error: *** You must not supply an argument to --with-bsdtcp-security." >&2;}
+# Check whether --with-samba-user was given.
+if test "${with_samba_user+set}" = set; then
+  withval=$with_samba_user;  { { $as_echo "$as_me:$LINENO: error: --with-samba-user is no longer supported; place username in 'amandapass'" >&5
+$as_echo "$as_me: error: --with-samba-user is no longer supported; place username in 'amandapass'" >&2;}
    { (exit 1); exit 1; }; }
-              ;;
-            esac
 
 fi
 
 
-    if test "x$BSDTCP_SECURITY" = "xyes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define BSDTCP_SECURITY 1
-_ACEOF
-
-    fi
+    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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_SAMBA_CLIENT+set}" = set; then
+  $as_echo_n "(cached) " >&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"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-     if test x"$BSDTCP_SECURITY" = x"yes"; then
-  WANT_BSDTCP_SECURITY_TRUE=
-  WANT_BSDTCP_SECURITY_FALSE='#'
+  ;;
+esac
+fi
+SAMBA_CLIENT=$ac_cv_path_SAMBA_CLIENT
+if test -n "$SAMBA_CLIENT"; then
+  { $as_echo "$as_me:$LINENO: result: $SAMBA_CLIENT" >&5
+$as_echo "$SAMBA_CLIENT" >&6; }
 else
-  WANT_BSDTCP_SECURITY_TRUE='#'
-  WANT_BSDTCP_SECURITY_FALSE=
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
+      smbversion=0
+      if test ! -z "$SAMBA_CLIENT"; then
+        case `"$SAMBA_CLIENT" '\\\\nosuchhost.amanda.org\\notashare' -U nosuchuser -N -Tx /dev/null 2>&1` in
+        *"Unknown host"*)
+                     smbversion=1
+                     ;;
+        *"Connection to nosuchhost.amanda.org failed"*)
+                     smbversion=2
+                     ;;
+        *)
+
+    { $as_echo "$as_me:$LINENO: WARNING: $SAMBA_CLIENT does not seem to be smbclient, so it will not be used." >&5
+$as_echo "$as_me: WARNING: $SAMBA_CLIENT does not seem to be smbclient, so it will not be used." >&2;}
 
 
-    BSDUDP_SECURITY="no"
+    cat <<AAW_EOF >>config.warnings
+$SAMBA_CLIENT does not seem to be smbclient, so it will not be used.
+AAW_EOF
 
-# 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 ;;
-                *) { { $as_echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-bsdudp-security." >&5
-$as_echo "$as_me: error: *** You must not supply an argument to --with-bsdudp-security." >&2;}
-   { (exit 1); exit 1; }; }
-              ;;
-            esac
 
-fi
+                     SAMBA_CLIENT=
+                     ;;
+        esac
+        if test -n "$SAMBA_CLIENT"; then
 
+cat >>confdefs.h <<_ACEOF
+#define SAMBA_CLIENT "$SAMBA_CLIENT"
+_ACEOF
 
-    if test "x$BSDUDP_SECURITY" = "xyes"; then
 
-cat >>confdefs.h <<\_ACEOF
-#define BSDUDP_SECURITY 1
+cat >>confdefs.h <<_ACEOF
+#define SAMBA_VERSION $smbversion
 _ACEOF
 
+        fi
+      fi
     fi
 
-     if test x"$BSDUDP_SECURITY" = x"yes"; then
-  WANT_BSDUDP_SECURITY_TRUE=
-  WANT_BSDUDP_SECURITY_FALSE='#'
+     if test -n "$SAMBA_CLIENT"; then
+  WANT_SAMBA_TRUE=
+  WANT_SAMBA_FALSE='#'
 else
-  WANT_BSDUDP_SECURITY_TRUE='#'
-  WANT_BSDUDP_SECURITY_FALSE=
+  WANT_SAMBA_TRUE='#'
+  WANT_SAMBA_FALSE=
 fi
 
 
 
+    USE_RUNDUMP=no
 
-    RSH_SECURITY=no
+    # some systems require rundump unconditionally
+    case "$host" in
+        *-ultrix*) USE_RUNDUMP=yes ;;
+        *-dg-*) USE_RUNDUMP=yes ;;
+    esac
 
-# 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 ;;
-                *) { { $as_echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-rsh-security." >&5
-$as_echo "$as_me: error: *** You must not supply an argument to --with-rsh-security." >&2;}
-   { (exit 1); exit 1; }; }
-              ;;
-            esac
+
+# 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 ;;
+            *) { { $as_echo "$as_me:$LINENO: error: You must not supply an argument to --with-rundump option." >&5
+$as_echo "$as_me: error: You must not supply an argument to --with-rundump option." >&2;}
+   { (exit 1); exit 1; }; };;
+        esac
 
 fi
 
 
-    if test "x$RSH_SECURITY" = "xyes"; then
+    if test x"$USE_RUNDUMP" = x"yes"; then
+       USE_RUNDUMP=1
 
 cat >>confdefs.h <<\_ACEOF
-#define RSH_SECURITY 1
+#define USE_RUNDUMP 1
 _ACEOF
 
+    else
+       USE_RUNDUMP=
     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=yes
-
-# Check whether --with-ssh-security was given.
-if test "${with_ssh_security+set}" = set; then
-  withval=$with_ssh_security;
-            case "$withval" in
-                n | no) SSH_SECURITY=no ;;
-                y |  ye | yes) SSH_SECURITY=yes ;;
-                *) { { $as_echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-ssh-security." >&5
-$as_echo "$as_me: error: *** You must not supply an argument to --with-ssh-security." >&2;}
-   { (exit 1); exit 1; }; }
-              ;;
-            esac
-
-fi
+#
+# Look for other programs Amanda will use
+#
 
 
-    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
+    # Extract the first word of "grep", so it can be a program name with args.
+set dummy grep; ac_word=$2
 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_SSH+set}" = set; then
+if test "${ac_cv_path_GREP+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  case $SSH in
+  case $GREP in
   [\\/]* | ?:[\\/]*)
-  ac_cv_path_SSH="$SSH" # Let the user override the test with a path.
+  ac_cv_path_GREP="$GREP" # Let the user override the test with a path.
   ;;
   *)
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -42156,7 +41981,7 @@ do
   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"
+    ac_cv_path_GREP="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 IFS=$as_save_IFS
 
+  test -z "$ac_cv_path_GREP" && ac_cv_path_GREP="grep"
   ;;
 esac
 fi
-SSH=$ac_cv_path_SSH
-if test -n "$SSH"; then
-  { $as_echo "$as_me:$LINENO: result: $SSH" >&5
-$as_echo "$SSH" >&6; }
+GREP=$ac_cv_path_GREP
+if test -n "$GREP"; then
+  { $as_echo "$as_me:$LINENO: result: $GREP" >&5
+$as_echo "$GREP" >&6; }
 else
   { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 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
-   SSH_OPTIONS=''
-
-fi
-
-
-        case "$SSH_OPTIONS" in
-            y | ye | yes | n | no)
-                { { $as_echo "$as_me:$LINENO: error: *** You must supply an argument to --with-ssh-options." >&5
-$as_echo "$as_me: error: *** You must supply an argument to --with-ssh-options." >&2;}
-   { (exit 1); exit 1; }; };;
-            *) : ;;
-        esac
-
-        { $as_echo "$as_me:$LINENO: checking SSH options" >&5
-$as_echo_n "checking SSH options... " >&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
-        { $as_echo "$as_me:$LINENO: result: $SSH_OPTIONS" >&5
-$as_echo "$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
+#define GREP "$GREP"
 _ACEOF
 
-    fi
-     if test x"$SSH_SECURITY" = x"yes"; then
-  WANT_SSH_SECURITY_TRUE=
-  WANT_SSH_SECURITY_FALSE='#'
-else
-  WANT_SSH_SECURITY_TRUE='#'
-  WANT_SSH_SECURITY_FALSE=
-fi
-
-
-
-    # (note -- don't just substitute SSH_OPTIONS -- shell quoting will break)
-
-
-    # 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
-
-
-    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
-        { $as_echo "$as_me:$LINENO: checking for Kerberos V libraries" >&5
-$as_echo_n "checking for Kerberos V libraries... " >&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
-            { $as_echo "$as_me:$LINENO: result: found in $KRB5_DIR_FOUND" >&5
-$as_echo "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
 
-{ $as_echo "$as_me:$LINENO: checking for main in -lkrb5support" >&5
-$as_echo_n "checking for main in -lkrb5support... " >&6; }
-if test "${ac_cv_lib_krb5support_main+set}" = set; then
+{ $as_echo "$as_me:$LINENO: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lkrb5support  $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 ()
-{
-return 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;;
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     if test -z "$EGREP"; then
+  ac_path_EGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in egrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+      { 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
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    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
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_lib_krb5support_main=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_cv_lib_krb5support_main=no
-fi
-
-rm -rf conftest.dSYM
-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
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_krb5support_main" >&5
-$as_echo "$ac_cv_lib_krb5support_main" >&6; }
-if test "x$ac_cv_lib_krb5support_main" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBKRB5SUPPORT 1
-_ACEOF
-
-  LIBS="-lkrb5support $LIBS"
-
-fi
-
-            LDFLAGS="$LDFLAGS -L$KRB5_LIBDIR_FOUND"
-
 
-
-cat >>confdefs.h <<\_ACEOF
-#define KRB5_SECURITY 1
-_ACEOF
-
-        else
-            { $as_echo "$as_me:$LINENO: result: no krb5 system libraries found" >&5
-$as_echo "no krb5 system libraries found" >&6; }
-            { { $as_echo "$as_me:$LINENO: error: No Kerberos V libraries were found on your system; krb5-security cannot be enabled" >&5
-$as_echo "$as_me: error: No Kerberos V libraries were found on your system; krb5-security cannot be enabled" >&2;}
+      $ac_path_EGREP_found && break 3
+    done
+  done
+done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_EGREP"; then
+    { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
    { (exit 1); exit 1; }; }
-            KRB5_SECURITY="no"
-        fi
-    fi
-
-     if test x"$KRB5_SECURITY" = x"yes"; then
-  WANT_KRB5_SECURITY_TRUE=
-  WANT_KRB5_SECURITY_FALSE='#'
+  fi
 else
-  WANT_KRB5_SECURITY_TRUE='#'
-  WANT_KRB5_SECURITY_FALSE=
+  ac_cv_path_EGREP=$EGREP
 fi
 
+   fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
 
 
 
-#
-# 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
+    # Extract the first word of "lint", so it can be a program name with args.
+set dummy lint; ac_word=$2
 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_XFSDUMP+set}" = set; then
+if test "${ac_cv_path_AMLINT+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  case $XFSDUMP in
+  case $AMLINT in
   [\\/]* | ?:[\\/]*)
-  ac_cv_path_XFSDUMP="$XFSDUMP" # Let the user override the test with a path.
+  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
+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_XFSDUMP="$as_dir/$ac_word$ac_exec_ext"
+    ac_cv_path_AMLINT="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -42463,31 +42113,84 @@ IFS=$as_save_IFS
   ;;
 esac
 fi
-XFSDUMP=$ac_cv_path_XFSDUMP
-if test -n "$XFSDUMP"; then
-  { $as_echo "$as_me:$LINENO: result: $XFSDUMP" >&5
-$as_echo "$XFSDUMP" >&6; }
+AMLINT=$ac_cv_path_AMLINT
+if test -n "$AMLINT"; then
+  { $as_echo "$as_me:$LINENO: result: $AMLINT" >&5
+$as_echo "$AMLINT" >&6; }
 else
   { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
-  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
+    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
 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_XFSRESTORE+set}" = set; then
+if test "${ac_cv_path_AMLINT+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  case $XFSRESTORE in
+  case $AMLINT in
   [\\/]* | ?:[\\/]*)
-  ac_cv_path_XFSRESTORE="$XFSRESTORE" # Let the user override the test with a path.
+  ac_cv_path_AMLINT="$AMLINT" # Let the user override the test with a path.
   ;;
   *)
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -42497,7 +42200,7 @@ do
   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"
+    ac_cv_path_AMLINT="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -42508,107 +42211,46 @@ IFS=$as_save_IFS
   ;;
 esac
 fi
-XFSRESTORE=$ac_cv_path_XFSRESTORE
-if test -n "$XFSRESTORE"; then
-  { $as_echo "$as_me:$LINENO: result: $XFSRESTORE" >&5
-$as_echo "$XFSRESTORE" >&6; }
+AMLINT=$ac_cv_path_AMLINT
+if test -n "$AMLINT"; then
+  { $as_echo "$as_me:$LINENO: result: $AMLINT" >&5
+$as_echo "$AMLINT" >&6; }
 else
   { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
-  test -n "$XFSRESTORE" && break
-done
-
-    if test "$XFSDUMP" -a "$XFSRESTORE"; then
-
-cat >>confdefs.h <<_ACEOF
-#define XFSDUMP "$XFSDUMP"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define XFSRESTORE "$XFSRESTORE"
-_ACEOF
-
-
-    { $as_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
-$as_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;}
-
-
-    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
-
-
+      if test ! -z "$AMLINT"; then
+       AMLINT="splint"
+        AMLINTFLAGS='+show-scan +unixlib -weak -globs +usedef +usereleased +impouts -paramimptemp -varuse -warnposix -redef -preproc -fixedformalarray -retval -unrecog -usevarargs -formatcode'
+      else
+       AMLINT='echo "Error: LINT is not installed" ; false'
+        AMLINTFLAGS=''
+      fi
     fi
 
 
-
-
-    # Extract the first word of "vxdump", so it can be a program name with args.
-set dummy vxdump; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_VXDUMP+set}" = set; then
-  $as_echo_n "(cached) " >&6
-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
-as_dummy="$SYSLOCPATH:/usr/lib/fs/vxfs"
-for as_dir in $as_dummy
+for ac_prog in flex lex
 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"
-    $as_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
-  { $as_echo "$as_me:$LINENO: result: $VXDUMP" >&5
-$as_echo "$VXDUMP" >&6; }
-else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-    # Extract the first word of "vxrestore", so it can be a program name with args.
-set dummy vxrestore; ac_word=$2
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_VXRESTORE+set}" = set; then
+if test "${ac_cv_prog_LEX+set}" = set; then
   $as_echo_n "(cached) " >&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
+  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 { 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"
+    ac_cv_prog_LEX="$ac_prog"
     $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -42616,55 +42258,235 @@ done
 done
 IFS=$as_save_IFS
 
-  ;;
-esac
 fi
-VXRESTORE=$ac_cv_path_VXRESTORE
-if test -n "$VXRESTORE"; then
-  { $as_echo "$as_me:$LINENO: result: $VXRESTORE" >&5
-$as_echo "$VXRESTORE" >&6; }
+fi
+LEX=$ac_cv_prog_LEX
+if test -n "$LEX"; then
+  { $as_echo "$as_me:$LINENO: result: $LEX" >&5
+$as_echo "$LEX" >&6; }
 else
   { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
-    if test "$VXDUMP" -a "$VXRESTORE"; then
+  test -n "$LEX" && break
+done
+test -n "$LEX" || LEX=":"
 
-cat >>confdefs.h <<_ACEOF
-#define VXDUMP "$VXDUMP"
+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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$LEX conftest.l") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ $as_echo "$as_me:$LINENO: checking lex output file root" >&5
+$as_echo_n "checking lex output file root... " >&6; }
+if test "${ac_cv_prog_lex_root+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+
+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
+  { { $as_echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5
+$as_echo "$as_me: error: cannot find output from $LEX; giving up" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5
+$as_echo "$ac_cv_prog_lex_root" >&6; }
+LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root
 
+if test -z "${LEXLIB+set}"; then
+  { $as_echo "$as_me:$LINENO: checking lex library" >&5
+$as_echo_n "checking lex library... " >&6; }
+if test "${ac_cv_lib_lex+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
 
-cat >>confdefs.h <<_ACEOF
-#define VXRESTORE "$VXRESTORE"
+    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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_lex=$ac_lib
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-    fi
 
+fi
+
+rm -rf conftest.dSYM
+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
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_lex" >&5
+$as_echo "$ac_cv_lib_lex" >&6; }
+  test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex
+fi
 
 
-    # Extract the first word of "vdump", so it can be a program name with args.
-set dummy vdump; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5
+$as_echo_n "checking whether yytext is a pointer... " >&6; }
+if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then
+  $as_echo_n "(cached) " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_prog_lex_yytext_pointer=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_save_LIBS
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5
+$as_echo "$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
+
+
+
+    if test x"$LEX" != x""; then
+       { $as_echo "$as_me:$LINENO: checking whether lex is broken Solaris (SGU) lex" >&5
+$as_echo_n "checking whether lex is broken Solaris (SGU) lex... " >&6; }
+       $LEX -V < /dev/null >/dev/null 2>conftest.out
+       if grep SGU conftest.out >/dev/null; then
+           { $as_echo "$as_me:$LINENO: result: yes - disabled (set LEX=/path/to/lex to use a specific binary)" >&5
+$as_echo "yes - disabled (set LEX=/path/to/lex to use a specific binary)" >&6; }
+           LEX='echo no lex equivalent available; false'
+       else
+           { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+       fi
+       rm conftest.out
+    fi
+
+
+
+    # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_VDUMP+set}" = set; then
+if test "${ac_cv_path_AR+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  case $VDUMP in
+  case $AR in
   [\\/]* | ?:[\\/]*)
-  ac_cv_path_VDUMP="$VDUMP" # Let the user override the test with a path.
+  ac_cv_path_AR="$AR" # 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 { 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"
+    ac_cv_path_AR="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -42675,36 +42497,39 @@ IFS=$as_save_IFS
   ;;
 esac
 fi
-VDUMP=$ac_cv_path_VDUMP
-if test -n "$VDUMP"; then
-  { $as_echo "$as_me:$LINENO: result: $VDUMP" >&5
-$as_echo "$VDUMP" >&6; }
+AR=$ac_cv_path_AR
+if test -n "$AR"; then
+  { $as_echo "$as_me:$LINENO: result: $AR" >&5
+$as_echo "$AR" >&6; }
 else
   { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
-    # Extract the first word of "vrestore", so it can be a program name with args.
-set dummy vrestore; ac_word=$2
+
+
+
+    # Extract the first word of "gettext", so it can be a program name with args.
+set dummy gettext; ac_word=$2
 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_VRESTORE+set}" = set; then
+if test "${ac_cv_path_GETTEXT+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  case $VRESTORE in
+  case $GETTEXT in
   [\\/]* | ?:[\\/]*)
-  ac_cv_path_VRESTORE="$VRESTORE" # Let the user override the test with a path.
+  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 $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 { 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"
+    ac_cv_path_GETTEXT="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -42715,91 +42540,167 @@ IFS=$as_save_IFS
   ;;
 esac
 fi
-VRESTORE=$ac_cv_path_VRESTORE
-if test -n "$VRESTORE"; then
-  { $as_echo "$as_me:$LINENO: result: $VRESTORE" >&5
-$as_echo "$VRESTORE" >&6; }
+GETTEXT=$ac_cv_path_GETTEXT
+if test -n "$GETTEXT"; then
+  { $as_echo "$as_me:$LINENO: result: $GETTEXT" >&5
+$as_echo "$GETTEXT" >&6; }
 else
   { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
-    if test "$VDUMP" -a "$VRESTORE"; then
 
-cat >>confdefs.h <<_ACEOF
-#define VDUMP "$VDUMP"
-_ACEOF
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AWK+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { 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"
+    $as_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
+  { $as_echo "$as_me:$LINENO: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
-cat >>confdefs.h <<_ACEOF
-#define VRESTORE "$VRESTORE"
-_ACEOF
 
-    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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_YACC+set}" = set; then
+  $as_echo_n "(cached) " >&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"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
+fi
+fi
+YACC=$ac_cv_prog_YACC
+if test -n "$YACC"; then
+  { $as_echo "$as_me:$LINENO: result: $YACC" >&5
+$as_echo "$YACC" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
 
+  test -n "$YACC" && break
+done
+test -n "$YACC" || YACC="yacc"
 
-    # 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=
-    AIX_BACKUP=
-    case "$host" in
-       *-dg-*)
-           DUMP_PROGRAMS="dump "$DUMP_PROGRAMS
-           DUMP_RETURNS_1=1
-           ;;
-      *-ibm-aix*)
-           DUMP_PROGRAMS="backup "$DUMP_PROGRAMS
-           AIX_BACKUP=1
+{ $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+  if test "${ac_cv_path_mkdir+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in mkdir gmkdir; do
+        for ac_exec_ext in '' $ac_executable_extensions; do
+          { 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 AIX_BACKUP 1
-_ACEOF
+fi
 
-           ;;
-      *-ultrix*)
-           DUMP_RETURNS_1=1
-           ;;
-    esac
+  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
+{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
 
-    if test -n "$DUMP_RETURNS_1"; then
 
-cat >>confdefs.h <<\_ACEOF
-#define DUMP_RETURNS_1 1
-_ACEOF
 
-    fi
 
-    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
+    # Extract the first word of "dd", so it can be a program name with args.
+set dummy dd; ac_word=$2
 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_DUMP+set}" = set; then
+if test "${ac_cv_path_DD+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  case $DUMP in
+  case $DD in
   [\\/]* | ?:[\\/]*)
-  ac_cv_path_DUMP="$DUMP" # Let the user override the test with a path.
+  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 $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 { 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"
+    ac_cv_path_DD="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -42810,41 +42711,39 @@ IFS=$as_save_IFS
   ;;
 esac
 fi
-DUMP=$ac_cv_path_DUMP
-if test -n "$DUMP"; then
-  { $as_echo "$as_me:$LINENO: result: $DUMP" >&5
-$as_echo "$DUMP" >&6; }
+DD=$ac_cv_path_DD
+if test -n "$DD"; then
+  { $as_echo "$as_me:$LINENO: result: $DD" >&5
+$as_echo "$DD" >&6; }
 else
   { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
-  test -n "$DUMP" && break
-done
 
-    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
+
+
+    # Extract the first word of "bash", so it can be a program name with args.
+set dummy bash; ac_word=$2
 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_RESTORE+set}" = set; then
+if test "${ac_cv_path_BASH+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  case $RESTORE in
+  case $BASH in
   [\\/]* | ?:[\\/]*)
-  ac_cv_path_RESTORE="$RESTORE" # Let the user override the test with a path.
+  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 $SYSLOCPATH
+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_RESTORE="$as_dir/$ac_word$ac_exec_ext"
+    ac_cv_path_BASH="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -42855,251 +42754,214 @@ IFS=$as_save_IFS
   ;;
 esac
 fi
-RESTORE=$ac_cv_path_RESTORE
-if test -n "$RESTORE"; then
-  { $as_echo "$as_me:$LINENO: result: $RESTORE" >&5
-$as_echo "$RESTORE" >&6; }
+BASH=$ac_cv_path_BASH
+if test -n "$BASH"; then
+  { $as_echo "$as_me:$LINENO: result: $BASH" >&5
+$as_echo "$BASH" >&6; }
 else
   { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
-  test -n "$RESTORE" && break
+
+
+
+
+
+    # Extract the first word of "sort", so it can be a program name with args.
+set dummy sort; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_SORT+set}" = set; then
+  $as_echo_n "(cached) " >&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 { 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"
+    $as_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_SORT" && ac_cv_path_SORT="NONE"
+  ;;
+esac
+fi
+SORT=$ac_cv_path_SORT
+if test -n "$SORT"; then
+  { $as_echo "$as_me:$LINENO: result: $SORT" >&5
+$as_echo "$SORT" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
 
-    # 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
+
+    # sort is only needed in the server build
+    if test x"$SORT" = x"NONE" && $WANT_SERVER; then
+        { { $as_echo "$as_me:$LINENO: error: Set SORT to the path of the sort program." >&5
+$as_echo "$as_me: error: Set SORT to the path of the sort program." >&2;}
+   { (exit 1); exit 1; }; }
     fi
 
-    if test "$DUMP" -a "$RESTORE"; then
 
 cat >>confdefs.h <<_ACEOF
-#define DUMP "$DUMP"
+#define SORT_PATH "$SORT"
 _ACEOF
 
 
-cat >>confdefs.h <<_ACEOF
-#define RESTORE "$RESTORE"
-_ACEOF
 
 
-       # check for an estimate flag
-       if test -x $DUMP; then
-           { $as_echo "$as_me:$LINENO: checking whether $DUMP supports -E or -S for estimates" >&5
-$as_echo_n "checking whether $DUMP supports -E or -S for estimates... " >&6; }
-if test "${amanda_cv_dump_estimate+set}" = set; then
+    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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_MAILER+set}" = set; then
   $as_echo_n "(cached) " >&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"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-                   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=$?
-  $as_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=$?
-  $as_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=$?
-  $as_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=$?
-  $as_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=$?
-  $as_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
-
+  ;;
+esac
+fi
+MAILER=$ac_cv_path_MAILER
+if test -n "$MAILER"; then
+  { $as_echo "$as_me:$LINENO: result: $MAILER" >&5
+$as_echo "$MAILER" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
-{ $as_echo "$as_me:$LINENO: result: $amanda_cv_dump_estimate" >&5
-$as_echo "$amanda_cv_dump_estimate" >&6; }
-       else
 
-    { $as_echo "$as_me:$LINENO: WARNING: $DUMP is not executable, cannot run -E/-S test" >&5
-$as_echo "$as_me: WARNING: $DUMP is not executable, cannot run -E/-S test" >&2;}
+
+  test -n "$MAILER" && break
+done
+test -n "$MAILER" || MAILER="NONE"
+
+    if test x"$MAILER" = x"NONE"; then
+
+    { $as_echo "$as_me:$LINENO: WARNING: WARNING: Amanda cannot send mail reports without a mailer." >&5
+$as_echo "$as_me: WARNING: WARNING: Amanda cannot send mail reports without a mailer." >&2;}
 
 
     cat <<AAW_EOF >>config.warnings
-$DUMP is not executable, cannot run -E/-S test
+WARNING: Amanda cannot send mail reports without a mailer.
 AAW_EOF
 
 
-           amanda_cv_dump_estimate=no
-       fi
-       if test "x$amanda_cv_dump_estimate" != xno; then
+       DEFAULT_MAILER=""
+    else
+       DEFAULT_MAILER="$MAILER"
+    fi
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_DUMP_ESTIMATE "$amanda_cv_dump_estimate"
+#define DEFAULT_MAILER "$DEFAULT_MAILER"
 _ACEOF
 
-       fi
 
 
-# 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
-               { $as_echo "$as_me:$LINENO: checking whether $DUMP supports -h (honor nodump flag)" >&5
-$as_echo_n "checking whether $DUMP supports -h (honor nodump flag)... " >&6; }
-if test "${amanda_cv_honor_nodump+set}" = set; then
+
+
+    # Extract the first word of "mt", so it can be a program name with args.
+set dummy mt; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_MT+set}" = set; then
   $as_echo_n "(cached) " >&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 $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_MT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-                   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=$?
-  $as_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=$?
-  $as_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=$?
-  $as_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
-
+  test -z "$ac_cv_path_MT" && ac_cv_path_MT="mt"
+  ;;
+esac
 fi
-{ $as_echo "$as_me:$LINENO: result: $amanda_cv_honor_nodump" >&5
-$as_echo "$amanda_cv_honor_nodump" >&6; }
-           else
-
-    { $as_echo "$as_me:$LINENO: WARNING: $DUMP is not executable, cannot run -h test" >&5
-$as_echo "$as_me: WARNING: $DUMP is not executable, cannot run -h test" >&2;}
-
-
-    cat <<AAW_EOF >>config.warnings
-$DUMP is not executable, cannot run -h test
-AAW_EOF
-
-
-               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
-
+MT=$ac_cv_path_MT
+if test -n "$MT"; then
+  { $as_echo "$as_me:$LINENO: result: $MT" >&5
+$as_echo "$MT" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
-    fi
-
-
-
 
 
+    case "$host" in
+       *-hp-*) MT_FILE_FLAG="-t" ;;
+       *) MT_FILE_FLAG="-f" ;;
+    esac
 
 
-    # call with
 
-# 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 ;;
-               *)  { { $as_echo "$as_me:$LINENO: error: *** You must supply a full pathname to --with-gnutar" >&5
-$as_echo "$as_me: error: *** You must supply a full pathname to --with-gnutar" >&2;}
-   { (exit 1); exit 1; }; };;
-           esac
-           # done
+cat >>confdefs.h <<_ACEOF
+#define MT_FILE_FLAG "$MT_FILE_FLAG"
+_ACEOF
 
 
-fi
 
 
-    if test "x$GNUTAR" = "xno"; then
-       GNUTAR=
-    else
-       OLD_GNUTAR=$GNUTAR
-       for gnutar_name in gtar gnutar tar; do
-           for ac_prog in $gnutar_name
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
+    # Extract the first word of "mtx", so it can be a program name with args.
+set dummy mtx; ac_word=$2
 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_GNUTAR+set}" = set; then
+if test "${ac_cv_path_MTX+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  case $GNUTAR in
+  case $MTX in
   [\\/]* | ?:[\\/]*)
-  ac_cv_path_GNUTAR="$GNUTAR" # 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
@@ -43109,7 +42971,7 @@ do
   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"
+    ac_cv_path_MTX="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 IFS=$as_save_IFS
 
+  test -z "$ac_cv_path_MTX" && ac_cv_path_MTX="mtx"
   ;;
 esac
 fi
-GNUTAR=$ac_cv_path_GNUTAR
-if test -n "$GNUTAR"; then
-  { $as_echo "$as_me:$LINENO: result: $GNUTAR" >&5
-$as_echo "$GNUTAR" >&6; }
+MTX=$ac_cv_path_MTX
+if test -n "$MTX"; then
+  { $as_echo "$as_me:$LINENO: result: $MTX" >&5
+$as_echo "$MTX" >&6; }
 else
   { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
-  test -n "$GNUTAR" && break
-done
-
-           if test -n "$GNUTAR"; then
-             case `"$GNUTAR" --version 2>&1` in
-              *GNU*tar* | *Free*paxutils* )
-                           # OK, it is GNU tar
-                           break
-                           ;;
-              *)
-                           if test -n "$OLD_GNUTAR"; then
-
-    { $as_echo "$as_me:$LINENO: WARNING: $GNUTAR is not GNU tar, it will be used." >&5
-$as_echo "$as_me: WARNING: $GNUTAR is not GNU tar, it will be used." >&2;}
-
-
-    cat <<AAW_EOF >>config.warnings
-$GNUTAR is not GNU tar, it will be used.
-AAW_EOF
-
-
-                           else
-                                   # warning..
 
-    { $as_echo "$as_me:$LINENO: WARNING: $GNUTAR is not GNU tar, so it will not be used." >&5
-$as_echo "$as_me: WARNING: $GNUTAR is not GNU tar, so it will not be used." >&2;}
 
 
-    cat <<AAW_EOF >>config.warnings
-$GNUTAR is not GNU tar, so it will not be used.
-AAW_EOF
 
+    # Extract the first word of "mount", so it can be a program name with args.
+set dummy mount; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_MOUNT+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  case $MOUNT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_MOUNT="$MOUNT" # 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_MOUNT="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-                                   # reset the cache for GNUTAR so AC_PATH_PROGS will search again
-                                   GNUTAR=''
-                                   unset ac_cv_path_GNUTAR
-                           fi
-                           ;;
-             esac
-           fi
-       done
-    fi
+  test -z "$ac_cv_path_MOUNT" && ac_cv_path_MOUNT="mount"
+  ;;
+esac
+fi
+MOUNT=$ac_cv_path_MOUNT
+if test -n "$MOUNT"; then
+  { $as_echo "$as_me:$LINENO: result: $MOUNT" >&5
+$as_echo "$MOUNT" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
-    if test "x$GNUTAR" != "x"; then
-       # define unquoted
 
-cat >>confdefs.h <<_ACEOF
-#define GNUTAR "$GNUTAR"
-_ACEOF
 
-    fi
 
 
 
+    # Extract the first word of "umount", so it can be a program name with args.
+set dummy umount; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_UMOUNT+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  case $UMOUNT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_UMOUNT="$UMOUNT" # 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_UMOUNT="$as_dir/$ac_word$ac_exec_ext"
+    $as_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_UMOUNT" && ac_cv_path_UMOUNT="umount"
+  ;;
+esac
+fi
+UMOUNT=$ac_cv_path_UMOUNT
+if test -n "$UMOUNT"; then
+  { $as_echo "$as_me:$LINENO: result: $UMOUNT" >&5
+$as_echo "$UMOUNT" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
 
-    # call with
 
-# Check whether --with-star was given.
-if test "${with_star+set}" = set; then
-  withval=$with_star;
-           # check withval
-           case "$withval" in
-               /*) STAR="$withval";;
-               y|ye|yes) :;;
-               n|no) STAR=no ;;
-               *)  { { $as_echo "$as_me:$LINENO: error: *** You must supply a full pathname to --with-star" >&5
-$as_echo "$as_me: error: *** You must supply a full pathname to --with-star" >&2;}
-   { (exit 1); exit 1; }; };;
-           esac
-           # done
 
 
-fi
 
 
-    if test "x$STAR" = "xno"; then
-       STAR=
-    else
-       OLD_STAR=$STAR
-       for ac_prog in star
+    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
 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_STAR+set}" = set; then
+if test "${ac_cv_path_LPR+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  case $STAR in
+  case $LPR in
   [\\/]* | ?:[\\/]*)
-  ac_cv_path_STAR="$STAR" # Let the user override the test with a path.
+  ac_cv_path_LPR="$LPR" # 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
 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_STAR="$as_dir/$ac_word$ac_exec_ext"
+    ac_cv_path_LPR="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -43243,110 +43120,70 @@ IFS=$as_save_IFS
   ;;
 esac
 fi
-STAR=$ac_cv_path_STAR
-if test -n "$STAR"; then
-  { $as_echo "$as_me:$LINENO: result: $STAR" >&5
-$as_echo "$STAR" >&6; }
+LPR=$ac_cv_path_LPR
+if test -n "$LPR"; then
+  { $as_echo "$as_me:$LINENO: result: $LPR" >&5
+$as_echo "$LPR" >&6; }
 else
   { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
-  test -n "$STAR" && break
+  test -n "$LPR" && break
 done
 
-       if test -n "$STAR"; then
-           case `"$STAR" --version 2>/dev/null` in
-            *star*)
-                   # OK, it is star
-                   break
-                   ;;
-            *)
-                   if test -n "$OLD_STAR"; then
+    if test ! -z "$LPR"; then
 
-    { $as_echo "$as_me:$LINENO: WARNING: $STAR is not star, it will be used." >&5
-$as_echo "$as_me: WARNING: $STAR is not star, it will be used." >&2;}
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LPR_CMD 1
+_ACEOF
 
 
-    cat <<AAW_EOF >>config.warnings
-$STAR is not star, it will be used.
-AAW_EOF
+       { $as_echo "$as_me:$LINENO: checking which flag to use to select a printer" >&5
+$as_echo_n "checking which flag to use to select a printer... " >&6; }
+if test "${amanda_cv_printer_flag+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
 
+           amanda_cv_printer_flag=$LPRFLAG
+           case "$LPR" in
+               lpr|*/lpr) amanda_cv_printer_flag="-P";;
+               lp|*/lp) amanda_cv_printer_flag="-d";;
+           esac
 
-                   else
-                       # warning..
+fi
+{ $as_echo "$as_me:$LINENO: result: $amanda_cv_printer_flag" >&5
+$as_echo "$amanda_cv_printer_flag" >&6; }
+       if test -z "$amanda_cv_printer_flag"; then
 
-    { $as_echo "$as_me:$LINENO: WARNING: $STAR is not star, so it will not be used." >&5
-$as_echo "$as_me: WARNING: $STAR is not star, so it will not be used." >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: WARNING: amanda will always print to the default printer" >&5
+$as_echo "$as_me: WARNING: WARNING: amanda will always print to the default printer" >&2;}
 
 
     cat <<AAW_EOF >>config.warnings
-$STAR is not star, so it will not be used.
+WARNING: amanda will always print to the default printer
 AAW_EOF
 
 
-                       # reset the cache for STAR so AC_PATH_PROGS will search again
-                       STAR=''
-                       unset ac_cv_path_STAR
-                   fi
-                   ;;
-           esac
        fi
     fi
 
-    if test "x$STAR" != "x"; then
-       # define unquoted
-
-cat >>confdefs.h <<_ACEOF
-#define STAR "$STAR"
-_ACEOF
-
-    fi
-
-
-
-
-
-
-
-# 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 ;;
-               *)  { { $as_echo "$as_me:$LINENO: error: *** You must supply a full pathname to --with-smbclient" >&5
-$as_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 was given.
-if test "${with_samba_user+set}" = set; then
-  withval=$with_samba_user;  { { $as_echo "$as_me:$LINENO: error: --with-samba-user is no longer supported; place username in 'amandapass'" >&5
-$as_echo "$as_me: error: --with-samba-user is no longer supported; place username in 'amandapass'" >&2;}
-   { (exit 1); exit 1; }; }
 
-fi
 
 
-    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
+    # Extract the first word of "pcat", so it can be a program name with args.
+set dummy pcat; ac_word=$2
 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_SAMBA_CLIENT+set}" = set; then
+if test "${ac_cv_path_PCAT+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  case $SAMBA_CLIENT in
+  case $PCAT in
   [\\/]* | ?:[\\/]*)
-  ac_cv_path_SAMBA_CLIENT="$SAMBA_CLIENT" # Let the user override the test with a path.
+  ac_cv_path_PCAT="$PCAT" # Let the user override the test with a path.
   ;;
   *)
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -43356,7 +43193,7 @@ do
   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"
+    ac_cv_path_PCAT="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -43367,116 +43204,31 @@ IFS=$as_save_IFS
   ;;
 esac
 fi
-SAMBA_CLIENT=$ac_cv_path_SAMBA_CLIENT
-if test -n "$SAMBA_CLIENT"; then
-  { $as_echo "$as_me:$LINENO: result: $SAMBA_CLIENT" >&5
-$as_echo "$SAMBA_CLIENT" >&6; }
-else
+PCAT=$ac_cv_path_PCAT
+if test -n "$PCAT"; then
+  { $as_echo "$as_me:$LINENO: result: $PCAT" >&5
+$as_echo "$PCAT" >&6; }
+else
   { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
-      smbversion=0
-      if test ! -z "$SAMBA_CLIENT"; then
-        case `"$SAMBA_CLIENT" '\\\\nosuchhost.amanda.org\\notashare' -U nosuchuser -N -Tx /dev/null 2>&1` in
-        *"Unknown host"*)
-                     smbversion=1
-                     ;;
-        *"Connection to nosuchhost.amanda.org failed"*)
-                     smbversion=2
-                     ;;
-        *)
-
-    { $as_echo "$as_me:$LINENO: WARNING: $SAMBA_CLIENT does not seem to be smbclient, so it will not be used." >&5
-$as_echo "$as_me: WARNING: $SAMBA_CLIENT does not seem to be smbclient, so it will not be used." >&2;}
-
-
-    cat <<AAW_EOF >>config.warnings
-$SAMBA_CLIENT does not seem to be smbclient, so it will not be used.
-AAW_EOF
-
-
-                     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
-    fi
-
-     if test -n "$SAMBA_CLIENT"; then
-  WANT_SAMBA_TRUE=
-  WANT_SAMBA_FALSE='#'
-else
-  WANT_SAMBA_TRUE='#'
-  WANT_SAMBA_FALSE=
-fi
-
-
-
-    USE_RUNDUMP=no
-
-    # some systems require rundump unconditionally
-    case "$host" in
-        *-ultrix*) USE_RUNDUMP=yes ;;
-        *-dg-*) USE_RUNDUMP=yes ;;
-    esac
-
-
-# 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 ;;
-            *) { { $as_echo "$as_me:$LINENO: error: You must not supply an argument to --with-rundump option." >&5
-$as_echo "$as_me: error: You must not supply an argument to --with-rundump option." >&2;}
-   { (exit 1); exit 1; }; };;
-        esac
-
-fi
-
-
-    if test x"$USE_RUNDUMP" = x"yes"; then
-       USE_RUNDUMP=1
-
-cat >>confdefs.h <<\_ACEOF
-#define USE_RUNDUMP 1
-_ACEOF
-
-    else
-       USE_RUNDUMP=
-    fi
-
-
 
 
-#
-# Look for other programs Amanda will use
-#
-
 
-    # Extract the first word of "grep", so it can be a program name with args.
-set dummy grep; ac_word=$2
+    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
 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_GREP+set}" = set; then
+if test "${ac_cv_path_PERL+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  case $GREP in
+  case $PERL in
   [\\/]* | ?:[\\/]*)
-  ac_cv_path_GREP="$GREP" # Let the user override the test with a path.
+  ac_cv_path_PERL="$PERL" # Let the user override the test with a path.
   ;;
   *)
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -43486,7 +43238,7 @@ do
   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"
+    ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 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
-  { $as_echo "$as_me:$LINENO: result: $GREP" >&5
-$as_echo "$GREP" >&6; }
+PERL=$ac_cv_path_PERL
+if test -n "$PERL"; then
+  { $as_echo "$as_me:$LINENO: result: $PERL" >&5
+$as_echo "$PERL" >&6; }
 else
   { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
-
-cat >>confdefs.h <<_ACEOF
-#define GREP "$GREP"
-_ACEOF
+  test -n "$PERL" && break
+done
 
 
-{ $as_echo "$as_me:$LINENO: checking for egrep" >&5
-$as_echo_n "checking for egrep... " >&6; }
-if test "${ac_cv_path_EGREP+set}" = set; then
+    # 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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_PERL+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
-   then ac_cv_path_EGREP="$GREP -E"
-   else
-     if test -z "$EGREP"; then
-  ac_path_EGREP_found=false
-  # Loop through the user's path and test for each of PROGNAME-LIST
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+  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_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
-  $as_echo_n 0123456789 >"conftest.in"
-  while :
-  do
-    cat "conftest.in" "conftest.in" >"conftest.tmp"
-    mv "conftest.tmp" "conftest.in"
-    cp "conftest.in" "conftest.nl"
-    $as_echo 'EGREP' >> "conftest.nl"
-    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
-    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
-    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
+  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"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
 done
 IFS=$as_save_IFS
-  if test -z "$ac_cv_path_EGREP"; then
-    { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
-$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
-   { (exit 1); exit 1; }; }
-  fi
+
+fi
+fi
+PERL=$ac_cv_prog_PERL
+if test -n "$PERL"; then
+  { $as_echo "$as_me:$LINENO: result: $PERL" >&5
+$as_echo "$PERL" >&6; }
 else
-  ac_cv_path_EGREP=$EGREP
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
-   fi
+
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
-$as_echo "$ac_cv_path_EGREP" >&6; }
- EGREP="$ac_cv_path_EGREP"
 
+# Check if version of Perl is sufficient
+ac_perl_version="5.6.0"
+
+if test "x$PERL" != "x"; then
+  { $as_echo "$as_me:$LINENO: checking for perl version greater than or equal to $ac_perl_version" >&5
+$as_echo_n "checking for perl version greater than or equal to $ac_perl_version... " >&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
+    { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; };
+
+       { { $as_echo "$as_me:$LINENO: error: Amanda requires at least perl 5.6.0" >&5
+$as_echo "$as_me: error: Amanda requires at least perl 5.6.0" >&2;}
+   { (exit 1); exit 1; }; }
+
+  else
+    { $as_echo "$as_me:$LINENO: result: ok" >&5
+$as_echo "ok" >&6; };
 
+  fi
+else
+  { $as_echo "$as_me:$LINENO: WARNING: could not find perl" >&5
+$as_echo "$as_me: WARNING: could not find perl" >&2;}
+fi
 
 
 
 
-    # Extract the first word of "lint", so it can be a program name with args.
-set dummy lint; ac_word=$2
+    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
 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_AMLINT+set}" = set; then
+if test "${ac_cv_path_SWIG+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  case $AMLINT in
+  case $SWIG in
   [\\/]* | ?:[\\/]*)
-  ac_cv_path_AMLINT="$AMLINT" # Let the user override the test with a path.
+  ac_cv_path_SWIG="$SWIG" # 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
+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_AMLINT="$as_dir/$ac_word$ac_exec_ext"
+    ac_cv_path_SWIG="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -43618,94 +43366,44 @@ IFS=$as_save_IFS
   ;;
 esac
 fi
-AMLINT=$ac_cv_path_AMLINT
-if test -n "$AMLINT"; then
-  { $as_echo "$as_me:$LINENO: result: $AMLINT" >&5
-$as_echo "$AMLINT" >&6; }
+SWIG=$ac_cv_path_SWIG
+if test -n "$SWIG"; then
+  { $as_echo "$as_me:$LINENO: result: $SWIG" >&5
+$as_echo "$SWIG" >&6; }
 else
   { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "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
+  test -n "$SWIG" && break
+done
+
+
+    # 1.3.32 introduces a change in the way empty strings are handled (old versions
+    # returned undef in Perl, while new versions return an empty Perl string)
+    # 1.3.39 is required for the %begin block
+
+        # Extract the first word of "swig", so it can be a program name with args.
+set dummy swig; ac_word=$2
 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_AMLINT+set}" = set; then
+if test "${ac_cv_path_SWIG+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  case $AMLINT in
+  case $SWIG in
   [\\/]* | ?:[\\/]*)
-  ac_cv_path_AMLINT="$AMLINT" # Let the user override the test with a path.
+  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 $SYSLOCPATH
+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_AMLINT="$as_dir/$ac_word$ac_exec_ext"
+    ac_cv_path_SWIG="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -43716,46 +43414,91 @@ IFS=$as_save_IFS
   ;;
 esac
 fi
-AMLINT=$ac_cv_path_AMLINT
-if test -n "$AMLINT"; then
-  { $as_echo "$as_me:$LINENO: result: $AMLINT" >&5
-$as_echo "$AMLINT" >&6; }
+SWIG=$ac_cv_path_SWIG
+if test -n "$SWIG"; then
+  { $as_echo "$as_me:$LINENO: result: $SWIG" >&5
+$as_echo "$SWIG" >&6; }
 else
   { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
-      if test ! -z "$AMLINT"; then
-       AMLINT="splint"
-        AMLINTFLAGS='+show-scan +unixlib -weak -globs +usedef +usereleased +impouts -paramimptemp -varuse -warnposix -redef -preproc -fixedformalarray -retval -unrecog -usevarargs -formatcode'
-      else
-       AMLINT='echo "Error: LINT is not installed" ; false'
-        AMLINTFLAGS=''
-      fi
-    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.39" ; then
+                { $as_echo "$as_me:$LINENO: checking for SWIG version" >&5
+$as_echo_n "checking for SWIG version... " >&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'`
+                { $as_echo "$as_me:$LINENO: result: $swig_version" >&5
+$as_echo "$swig_version" >&6; }
+                if test -n "$swig_version" ; then
 
+  # Used to indicate true or false condition
+  ax_compare_version=false
 
-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
+  # 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 "$swig_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'`
+
+
+  ax_compare_version_B=`echo "1.3.39" | 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'`
+
+
+    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}/true/;s/x${ax_compare_version_B}/false/;1q"`
+
+
+
+    if test "$ax_compare_version" = "true" ; then
+
+                                                   SWIG_LIB=`$SWIG -swiglib`
+
+    else
+                                                   SWIG='echo "Error: SWIG version >= 1.3.39 is required.  You have '"$swig_version"'.  You should look at http://www.swig.org" ; false'
+
+  fi
+
+                else
+                        SWIG='echo "Error: Cannot determine SWIG version.  You should look at http://www.swig.org" ; false'
+                fi
+        fi
+
+
+
+
+    # Extract the first word of "ps", so it can be a program name with args.
+set dummy ps; ac_word=$2
 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_LEX+set}" = set; then
+if test "${ac_cv_path_PS+set}" = set; then
   $as_echo_n "(cached) " >&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
+  case $PS in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PS="$PS" # 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_prog_LEX="$ac_prog"
+    ac_cv_path_PS="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
 IFS=$as_save_IFS
 
+  ;;
+esac
 fi
-fi
-LEX=$ac_cv_prog_LEX
-if test -n "$LEX"; then
-  { $as_echo "$as_me:$LINENO: result: $LEX" >&5
-$as_echo "$LEX" >&6; }
+PS=$ac_cv_path_PS
+if test -n "$PS"; then
+  { $as_echo "$as_me:$LINENO: result: $PS" >&5
+$as_echo "$PS" >&6; }
 else
   { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
-  test -n "$LEX" && break
-done
-test -n "$LEX" || LEX=":"
-
-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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$LEX conftest.l") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }
-{ $as_echo "$as_me:$LINENO: checking lex output file root" >&5
-$as_echo_n "checking lex output file root... " >&6; }
-if test "${ac_cv_prog_lex_root+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
+    { $as_echo "$as_me:$LINENO: checking ps argument to use" >&5
+$as_echo_n "checking ps argument to use... " >&6; }
+    PS_ARGUMENT=
 
-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
-  { { $as_echo "$as_me:$LINENO: error: cannot find output from $LEX; giving up" >&5
-$as_echo "$as_me: error: cannot find output from $LEX; giving up" >&2;}
-   { (exit 1); exit 1; }; }
-fi
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_lex_root" >&5
-$as_echo "$ac_cv_prog_lex_root" >&6; }
-LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root
+    # ps is *very* non-portable, and across many systems, the same option
+    # (e.g., -e) can mean different things.  So this macro tries to
+    # special-case most known systems, and makes an effort to detect unknown
+    # systems
+    case "$host" in
+       *-*-solaris*)
+           PS_ARGUMENT="-eo pid,ppid,comm"
+           PS_ARGUMENT_ARGS="-eo pid,ppid,comm"
+           ;;
 
-if test -z "${LEXLIB+set}"; then
-  { $as_echo "$as_me:$LINENO: checking lex library" >&5
-$as_echo_n "checking lex library... " >&6; }
-if test "${ac_cv_lib_lex+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
+       *-*-linux-*)
+           PS_ARGUMENT="-eo pid,ppid,command"
+           PS_ARGUMENT_ARGS="-eo pid,ppid,command"
+           ;;
 
-    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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_lib_lex=$ac_lib
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -rf conftest.dSYM
-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
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_lex" >&5
-$as_echo "$ac_cv_lib_lex" >&6; }
-  test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex
-fi
-
-
-{ $as_echo "$as_me:$LINENO: checking whether yytext is a pointer" >&5
-$as_echo_n "checking whether yytext is a pointer... " >&6; }
-if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then
-  $as_echo_n "(cached) " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_prog_lex_yytext_pointer=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_save_LIBS
+       *-*-*bsd*)
+           PS_ARGUMENT="-axo pid,ppid,command"
+           PS_ARGUMENT_ARGS="-axo pid,ppid,command"
+           ;;
 
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_lex_yytext_pointer" >&5
-$as_echo "$ac_cv_prog_lex_yytext_pointer" >&6; }
-if test $ac_cv_prog_lex_yytext_pointer = yes; then
+       *-apple-darwin*)
+           PS_ARGUMENT="-aAco pid,ppid,command"
+           PS_ARGUMENT_ARGS="-aAo pid,ppid,command"
+           ;;
 
-cat >>confdefs.h <<\_ACEOF
-#define YYTEXT_POINTER 1
-_ACEOF
+       *-pc-cygwin)
+           # Cygwin is special-cased in Amanda::Process
+           PS_ARGUMENT=CYGWIN
+           PS_ARGUMENT_ARGS="-ef"
+           ;;
 
-fi
-rm -f conftest.l $LEX_OUTPUT_ROOT.c
+       *-*-hpux*)
+           # HPUX's 'PS' needs the env var UNIX95 to run in "xpg4" mode
+           PS="UNIX95=1 $PS"
+           PS_ARGUMENT="-eo pid,ppid,comm"
+           PS_ARGUMENT_ARGS="-eo pid,ppid,comm"
+           ;;
 
-fi
-if test "$LEX" = :; then
-  LEX=${am_missing_run}flex
-fi
+       *)
+           for try in \
+               "-axo pid,ppid,command" \
+               "-aAco pid,ppid,command" \
+               "-eo pid,ppid,comm"
+           do
+               ps $try >/dev/null 2>/dev/null
+               if test $? -eq 0; then
+                   PS_ARGUMENT="$try"
+                   break
+               fi
+           done
+           for try in \
+               "-axo pid,ppid,command" \
+               "-aAo pid,ppid,command" \
+               "-eo pid,ppid,comm"
+           do
+               ps $try >/dev/null 2>/dev/null
+               if test $? -eq 0; then
+                   PS_ARGUMENT_ARGS="$try"
+                   break
+               fi
+           done
+           if test -z "$PS_ARGUMENT" -o -z "$PS_ARGUMENT_ARGS"; then
+               { { $as_echo "$as_me:$LINENO: error: Can't find ps argument to use." >&5
+$as_echo "$as_me: error: Can't find ps argument to use." >&2;}
+   { (exit 1); exit 1; }; }
+           fi
+           ;;
+    esac
 
+    { $as_echo "$as_me:$LINENO: result: $PS_ARGUMENT" >&5
+$as_echo "$PS_ARGUMENT" >&6; }
 
+    { $as_echo "$as_me:$LINENO: result: $PS_ARGUMENT_ARGS" >&5
+$as_echo "$PS_ARGUMENT_ARGS" >&6; }
 
-    if test x"$LEX" != x""; then
-       { $as_echo "$as_me:$LINENO: checking whether lex is broken Solaris (SGU) lex" >&5
-$as_echo_n "checking whether lex is broken Solaris (SGU) lex... " >&6; }
-       $LEX -V < /dev/null >/dev/null 2>conftest.out
-       if grep SGU conftest.out >/dev/null; then
-           { $as_echo "$as_me:$LINENO: result: yes - disabled (set LEX=/path/to/lex to use a specific binary)" >&5
-$as_echo "yes - disabled (set LEX=/path/to/lex to use a specific binary)" >&6; }
-           LEX='echo no lex equivalent available; false'
-       else
-           { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-       fi
-       rm conftest.out
-    fi
 
 
 
-    # Extract the first word of "ar", so it can be a program name with args.
-set dummy ar; ac_word=$2
+    # Extract the first word of "rpcgen", so it can be a program name with args.
+set dummy rpcgen; ac_word=$2
 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_AR+set}" = set; then
+if test "${ac_cv_path_RPCGEN+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  case $AR in
+  case $RPCGEN in
   [\\/]* | ?:[\\/]*)
-  ac_cv_path_AR="$AR" # Let the user override the test with a path.
+  ac_cv_path_RPCGEN="$RPCGEN" # Let the user override the test with a path.
   ;;
   *)
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
@@ -43991,7 +43620,7 @@ do
   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"
+    ac_cv_path_RPCGEN="$as_dir/$ac_word$ac_exec_ext"
     $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -44002,10 +43631,10 @@ IFS=$as_save_IFS
   ;;
 esac
 fi
-AR=$ac_cv_path_AR
-if test -n "$AR"; then
-  { $as_echo "$as_me:$LINENO: result: $AR" >&5
-$as_echo "$AR" >&6; }
+RPCGEN=$ac_cv_path_RPCGEN
+if test -n "$RPCGEN"; then
+  { $as_echo "$as_me:$LINENO: result: $RPCGEN" >&5
+$as_echo "$RPCGEN" >&6; }
 else
   { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 
 
 
-    # Extract the first word of "gettext", so it can be a program name with args.
-set dummy gettext; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_GETTEXT+set}" = set; then
+#
+# Compiler / system characteristics
+#
+
+#
+# compiler
+#
+if test $ac_cv_c_compiler_gnu = yes; then
+    { $as_echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5
+$as_echo_n "checking whether $CC needs -traditional... " >&6; }
+if test "${ac_cv_prog_gcc_traditional+set}" = set; then
   $as_echo_n "(cached) " >&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"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-  ;;
-esac
-fi
-GETTEXT=$ac_cv_path_GETTEXT
-if test -n "$GETTEXT"; then
-  { $as_echo "$as_me:$LINENO: result: $GETTEXT" >&5
-$as_echo "$GETTEXT" >&6; }
+    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
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
+  ac_cv_prog_gcc_traditional=no
 fi
+rm -f 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*
 
-for ac_prog in gawk mawk nawk awk
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_AWK+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$AWK"; then
-  ac_cv_prog_AWK="$AWK" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { 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"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
   fi
-done
-done
-IFS=$as_save_IFS
-
 fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5
+$as_echo "$ac_cv_prog_gcc_traditional" >&6; }
+  if test $ac_cv_prog_gcc_traditional = yes; then
+    CC="$CC -traditional"
+  fi
 fi
-AWK=$ac_cv_prog_AWK
-if test -n "$AWK"; then
-  { $as_echo "$as_me:$LINENO: result: $AWK" >&5
-$as_echo "$AWK" >&6; }
-else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "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
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_YACC+set}" = set; then
+{ $as_echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
+$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
+if test "${ac_cv_c_const+set}" = set; then
   $as_echo_n "(cached) " >&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"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-fi
-fi
-YACC=$ac_cv_prog_YACC
-if test -n "$YACC"; then
-  { $as_echo "$as_me:$LINENO: result: $YACC" >&5
-$as_echo "$YACC" >&6; }
-else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-fi
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
+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;
 
-  test -n "$YACC" && break
-done
-test -n "$YACC" || YACC="yacc"
+    *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
 
-{ $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
-$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
-if test -z "$MKDIR_P"; then
-  if test "${ac_cv_path_mkdir+set}" = set; then
-  $as_echo_n "(cached) " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_c_const=yes
 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
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+       ac_cv_c_const=no
 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
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5
-$as_echo "$MKDIR_P" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
+$as_echo "$ac_cv_c_const" >&6; }
+if test $ac_cv_c_const = no; then
 
+cat >>confdefs.h <<\_ACEOF
+#define const /**/
+_ACEOF
 
+fi
 
 
-    # Extract the first word of "dd", so it can be a program name with args.
-set dummy dd; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_DD+set}" = set; then
+ { $as_echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
+$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
+if test "${ac_cv_c_bigendian+set}" = set; then
   $as_echo_n "(cached) " >&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 { 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"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
-
-  ;;
+  ac_cv_c_bigendian=unknown
+    # See if we're dealing with a universal compiler.
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifndef __APPLE_CC__
+              not a universal capable compiler
+            #endif
+            typedef int dummy;
+
+_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
-DD=$ac_cv_path_DD
-if test -n "$DD"; then
-  { $as_echo "$as_me:$LINENO: result: $DD" >&5
-$as_echo "$DD" >&6; }
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+
+       # Check for potential -arch flags.  It is not universal unless
+       # there are some -arch flags.  Note that *ppc* also matches
+       # ppc64.  This check is also rather less than ideal.
+       case "${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}" in  #(
+         *-arch*ppc*|*-arch*i386*|*-arch*x86_64*) ac_cv_c_bigendian=universal;;
+       esac
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
 fi
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+    if test $ac_cv_c_bigendian = unknown; then
+      # 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  # 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
 
-    # Extract the first word of "bash", so it can be a program name with args.
-set dummy bash; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_BASH+set}" = set; then
-  $as_echo_n "(cached) " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_c_bigendian=yes
 else
-  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"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-  ;;
-esac
+       ac_cv_c_bigendian=no
 fi
-BASH=$ac_cv_path_BASH
-if test -n "$BASH"; then
-  { $as_echo "$as_me:$LINENO: result: $BASH" >&5
-$as_echo "$BASH" >&6; }
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-fi
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
 
+fi
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+    fi
+    if test $ac_cv_c_bigendian = unknown; then
+      # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
+      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>
 
+int
+main ()
+{
+#if ! (defined _LITTLE_ENDIAN || defined _BIG_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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  # 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 <limits.h>
 
+int
+main ()
+{
+#ifndef _BIG_ENDIAN
+                not big endian
+               #endif
 
-    # Extract the first word of "sort", so it can be a program name with args.
-set dummy sort; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_SORT+set}" = set; then
-  $as_echo_n "(cached) " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_c_bigendian=yes
 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 { 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"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-  test -z "$ac_cv_path_SORT" && ac_cv_path_SORT="NONE"
-  ;;
-esac
+       ac_cv_c_bigendian=no
 fi
-SORT=$ac_cv_path_SORT
-if test -n "$SORT"; then
-  { $as_echo "$as_me:$LINENO: result: $SORT" >&5
-$as_echo "$SORT" >&6; }
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-fi
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
 
+fi
 
-    # sort is only needed in the server build
-    if test x"$SORT" = x"NONE" && $WANT_SERVER; then
-        { { $as_echo "$as_me:$LINENO: error: Set SORT to the path of the sort program." >&5
-$as_echo "$as_me: error: Set SORT to the path of the sort program." >&2;}
-   { (exit 1); exit 1; }; }
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
     fi
-
-
-cat >>confdefs.h <<_ACEOF
-#define SORT_PATH "$SORT"
+    if test $ac_cv_c_bigendian = unknown; then
+      # Compile a test program.
+      if test "$cross_compiling" = yes; then
+  # Try to guess by grepping values from an object file.
+        cat >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 };
+               int use_ascii (int i) {
+                 return ascii_mm[i] + ascii_ii[i];
+               }
+               short int ebcdic_ii[] =
+                 { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+               short int ebcdic_mm[] =
+                 { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+               int use_ebcdic (int i) {
+                 return ebcdic_mm[i] + ebcdic_ii[i];
+               }
+               extern int foo;
 
+int
+main ()
+{
+return use_ascii (foo) == use_ebcdic (foo);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  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
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
 
+fi
 
-    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
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_MAILER+set}" = set; then
-  $as_echo_n "(cached) " >&6
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 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"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
+  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 ()
+{
 
-  ;;
+            /* Are we little or big endian?  From Harbison&Steele.  */
+            union
+            {
+              long int l;
+              char c[sizeof (long int)];
+            } u;
+            u.l = 1;
+            return u.c[sizeof (long int) - 1] == 1;
+
+  ;
+  return 0;
+}
+_ACEOF
+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
-fi
-MAILER=$ac_cv_path_MAILER
-if test -n "$MAILER"; then
-  { $as_echo "$as_me:$LINENO: result: $MAILER" >&5
-$as_echo "$MAILER" >&6; }
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_c_bigendian=no
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-  test -n "$MAILER" && break
-done
-test -n "$MAILER" || MAILER="NONE"
+( exit $ac_status )
+ac_cv_c_bigendian=yes
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
 
-    if test x"$MAILER" = x"NONE"; then
 
-    { $as_echo "$as_me:$LINENO: WARNING: WARNING: Amanda cannot send mail reports without a mailer." >&5
-$as_echo "$as_me: WARNING: WARNING: Amanda cannot send mail reports without a mailer." >&2;}
+    fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
+$as_echo "$ac_cv_c_bigendian" >&6; }
+ case $ac_cv_c_bigendian in #(
+   yes)
+     cat >>confdefs.h <<\_ACEOF
+#define WORDS_BIGENDIAN 1
+_ACEOF
+;; #(
+   no)
+      ;; #(
+   universal)
 
+cat >>confdefs.h <<\_ACEOF
+#define AC_APPLE_UNIVERSAL_BUILD 1
+_ACEOF
 
-    cat <<AAW_EOF >>config.warnings
-WARNING: Amanda cannot send mail reports without a mailer.
-AAW_EOF
+     ;; #(
+   *)
+     { { $as_echo "$as_me:$LINENO: error: unknown endianness
+ presetting ac_cv_c_bigendian=no (or yes) will help" >&5
+$as_echo "$as_me: error: unknown endianness
+ presetting ac_cv_c_bigendian=no (or yes) will help" >&2;}
+   { (exit 1); exit 1; }; } ;;
+ esac
 
 
-       DEFAULT_MAILER=""
-    else
-       DEFAULT_MAILER="$MAILER"
-    fi
+# 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
 
-cat >>confdefs.h <<_ACEOF
-#define DEFAULT_MAILER "$DEFAULT_MAILER"
-_ACEOF
 
+#
+# Warnings
+#
 
 
 
 
-    # Extract the first word of "mt", so it can be a program name with args.
-set dummy mt; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_MT+set}" = set; then
-  $as_echo_n "(cached) " >&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 $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_MT="$as_dir/$ac_word$ac_exec_ext"
-    $as_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_MT" && ac_cv_path_MT="mt"
-  ;;
-esac
-fi
-MT=$ac_cv_path_MT
-if test -n "$MT"; then
-  { $as_echo "$as_me:$LINENO: result: $MT" >&5
-$as_echo "$MT" >&6; }
-else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+    { $as_echo "$as_me:$LINENO: checking for gcc flag -Wparentheses" >&5
+$as_echo_n "checking for gcc flag -Wparentheses... " >&6; }
+    if test "x$GCC" = "xyes"; then
+               (gcc --help={target,optimizers,warnings,undocumented,params,c} 2>&1 ||
+           $CC -v --help 2>&1) |
+         $EGREP -- '[^[:alnum:]]-Wparentheses[^[:alnum:]-]' 2>&1 > /dev/null
+               if test $? -eq 0; then
+           found_warning=yes
+           { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+           found_warning=no
+           { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
-fi
+       fi
+    else
+       found_warning=no
+       { $as_echo "$as_me:$LINENO: result: no (not using gcc)" >&5
+$as_echo "no (not using gcc)" >&6; }
+    fi
 
+    if test x"$found_warning" = x"yes"; then
+       AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wparentheses"
 
 
-    case "$host" in
-       *-hp-*) MT_FILE_FLAG="-t" ;;
-       *) MT_FILE_FLAG="-f" ;;
-    esac
+    else
+       :
+    fi
 
 
 
-cat >>confdefs.h <<_ACEOF
-#define MT_FILE_FLAG "$MT_FILE_FLAG"
-_ACEOF
 
 
 
+    { $as_echo "$as_me:$LINENO: checking for gcc flag -Wdeclaration-after-statement" >&5
+$as_echo_n "checking for gcc flag -Wdeclaration-after-statement... " >&6; }
+    if test "x$GCC" = "xyes"; then
+               (gcc --help={target,optimizers,warnings,undocumented,params,c} 2>&1 ||
+           $CC -v --help 2>&1) |
+         $EGREP -- '[^[:alnum:]]-Wdeclaration-after-statement[^[:alnum:]-]' 2>&1 > /dev/null
+               if test $? -eq 0; then
+           found_warning=yes
+           { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+           found_warning=no
+           { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+       fi
+    else
+       found_warning=no
+       { $as_echo "$as_me:$LINENO: result: no (not using gcc)" >&5
+$as_echo "no (not using gcc)" >&6; }
+    fi
 
-    # Extract the first word of "mtx", so it can be a program name with args.
-set dummy mtx; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_MTX+set}" = set; then
-  $as_echo_n "(cached) " >&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 { 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"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
+    if test x"$found_warning" = x"yes"; then
+       AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wdeclaration-after-statement"
 
-  test -z "$ac_cv_path_MTX" && ac_cv_path_MTX="mtx"
-  ;;
-esac
-fi
-MTX=$ac_cv_path_MTX
-if test -n "$MTX"; then
-  { $as_echo "$as_me:$LINENO: result: $MTX" >&5
-$as_echo "$MTX" >&6; }
-else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+
+    else
+       :
+    fi
+
+
+
+
+
+
+    { $as_echo "$as_me:$LINENO: checking for gcc flag -Wmissing-prototypes" >&5
+$as_echo_n "checking for gcc flag -Wmissing-prototypes... " >&6; }
+    if test "x$GCC" = "xyes"; then
+               (gcc --help={target,optimizers,warnings,undocumented,params,c} 2>&1 ||
+           $CC -v --help 2>&1) |
+         $EGREP -- '[^[:alnum:]]-Wmissing-prototypes[^[:alnum:]-]' 2>&1 > /dev/null
+               if test $? -eq 0; then
+           found_warning=yes
+           { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+           found_warning=no
+           { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
-fi
+       fi
+    else
+       found_warning=no
+       { $as_echo "$as_me:$LINENO: result: no (not using gcc)" >&5
+$as_echo "no (not using gcc)" >&6; }
+    fi
 
+    if test x"$found_warning" = x"yes"; then
+       AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wmissing-prototypes"
 
 
+    else
+       :
+    fi
 
 
 
 
-    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
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_LPR+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  case $LPR in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_LPR="$LPR" # 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_LPR="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
 
-  ;;
-esac
-fi
-LPR=$ac_cv_path_LPR
-if test -n "$LPR"; then
-  { $as_echo "$as_me:$LINENO: result: $LPR" >&5
-$as_echo "$LPR" >&6; }
-else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+
+    { $as_echo "$as_me:$LINENO: checking for gcc flag -Wstrict-prototypes" >&5
+$as_echo_n "checking for gcc flag -Wstrict-prototypes... " >&6; }
+    if test "x$GCC" = "xyes"; then
+               (gcc --help={target,optimizers,warnings,undocumented,params,c} 2>&1 ||
+           $CC -v --help 2>&1) |
+         $EGREP -- '[^[:alnum:]]-Wstrict-prototypes[^[:alnum:]-]' 2>&1 > /dev/null
+               if test $? -eq 0; then
+           found_warning=yes
+           { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+           found_warning=no
+           { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
-fi
+       fi
+    else
+       found_warning=no
+       { $as_echo "$as_me:$LINENO: result: no (not using gcc)" >&5
+$as_echo "no (not using gcc)" >&6; }
+    fi
 
+    if test x"$found_warning" = x"yes"; then
+       AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wstrict-prototypes"
 
-  test -n "$LPR" && break
-done
 
-    if test ! -z "$LPR"; then
+    else
+       :
+    fi
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LPR_CMD 1
-_ACEOF
 
 
-       { $as_echo "$as_me:$LINENO: checking which flag to use to select a printer" >&5
-$as_echo_n "checking which flag to use to select a printer... " >&6; }
-if test "${amanda_cv_printer_flag+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
 
-           amanda_cv_printer_flag=$LPRFLAG
-           case "$LPR" in
-               lpr|*/lpr) amanda_cv_printer_flag="-P";;
-               lp|*/lp) amanda_cv_printer_flag="-d";;
-           esac
 
-fi
-{ $as_echo "$as_me:$LINENO: result: $amanda_cv_printer_flag" >&5
-$as_echo "$amanda_cv_printer_flag" >&6; }
-       if test -z "$amanda_cv_printer_flag"; then
 
-    { $as_echo "$as_me:$LINENO: WARNING: WARNING: amanda will always print to the default printer" >&5
-$as_echo "$as_me: WARNING: WARNING: amanda will always print to the default printer" >&2;}
+    { $as_echo "$as_me:$LINENO: checking for gcc flag -Wmissing-declarations" >&5
+$as_echo_n "checking for gcc flag -Wmissing-declarations... " >&6; }
+    if test "x$GCC" = "xyes"; then
+               (gcc --help={target,optimizers,warnings,undocumented,params,c} 2>&1 ||
+           $CC -v --help 2>&1) |
+         $EGREP -- '[^[:alnum:]]-Wmissing-declarations[^[:alnum:]-]' 2>&1 > /dev/null
+               if test $? -eq 0; then
+           found_warning=yes
+           { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+           found_warning=no
+           { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+       fi
+    else
+       found_warning=no
+       { $as_echo "$as_me:$LINENO: result: no (not using gcc)" >&5
+$as_echo "no (not using gcc)" >&6; }
+    fi
+
+    if test x"$found_warning" = x"yes"; then
+       AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wmissing-declarations"
 
 
-    cat <<AAW_EOF >>config.warnings
-WARNING: amanda will always print to the default printer
-AAW_EOF
+    else
+       :
+    fi
+
 
 
+
+
+
+    { $as_echo "$as_me:$LINENO: checking for gcc flag -Wformat" >&5
+$as_echo_n "checking for gcc flag -Wformat... " >&6; }
+    if test "x$GCC" = "xyes"; then
+               (gcc --help={target,optimizers,warnings,undocumented,params,c} 2>&1 ||
+           $CC -v --help 2>&1) |
+         $EGREP -- '[^[:alnum:]]-Wformat[^[:alnum:]-]' 2>&1 > /dev/null
+               if test $? -eq 0; then
+           found_warning=yes
+           { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+           found_warning=no
+           { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
        fi
+    else
+       found_warning=no
+       { $as_echo "$as_me:$LINENO: result: no (not using gcc)" >&5
+$as_echo "no (not using gcc)" >&6; }
     fi
 
+    if test x"$found_warning" = x"yes"; then
+       AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wformat"
 
 
+    else
+       :
+    fi
 
 
 
-    # Extract the first word of "pcat", so it can be a program name with args.
-set dummy pcat; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PCAT+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  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"
-    $as_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
-  { $as_echo "$as_me:$LINENO: result: $PCAT" >&5
-$as_echo "$PCAT" >&6; }
-else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+
+
+    { $as_echo "$as_me:$LINENO: checking for gcc flag -Wformat-security" >&5
+$as_echo_n "checking for gcc flag -Wformat-security... " >&6; }
+    if test "x$GCC" = "xyes"; then
+               (gcc --help={target,optimizers,warnings,undocumented,params,c} 2>&1 ||
+           $CC -v --help 2>&1) |
+         $EGREP -- '[^[:alnum:]]-Wformat-security[^[:alnum:]-]' 2>&1 > /dev/null
+               if test $? -eq 0; then
+           found_warning=yes
+           { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+           found_warning=no
+           { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
-fi
+       fi
+    else
+       found_warning=no
+       { $as_echo "$as_me:$LINENO: result: no (not using gcc)" >&5
+$as_echo "no (not using gcc)" >&6; }
+    fi
 
+    if test x"$found_warning" = x"yes"; then
+       AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wformat-security"
 
 
+    else
+       :
+    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
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PERL+set}" = set; then
-  $as_echo_n "(cached) " >&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"
-    $as_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
-  { $as_echo "$as_me:$LINENO: result: $PERL" >&5
-$as_echo "$PERL" >&6; }
-else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+
+
+
+    { $as_echo "$as_me:$LINENO: checking for gcc flag -Wsign-compare" >&5
+$as_echo_n "checking for gcc flag -Wsign-compare... " >&6; }
+    if test "x$GCC" = "xyes"; then
+               (gcc --help={target,optimizers,warnings,undocumented,params,c} 2>&1 ||
+           $CC -v --help 2>&1) |
+         $EGREP -- '[^[:alnum:]]-Wsign-compare[^[:alnum:]-]' 2>&1 > /dev/null
+               if test $? -eq 0; then
+           found_warning=yes
+           { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+           found_warning=no
+           { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
-fi
+       fi
+    else
+       found_warning=no
+       { $as_echo "$as_me:$LINENO: result: no (not using gcc)" >&5
+$as_echo "no (not using gcc)" >&6; }
+    fi
 
+    if test x"$found_warning" = x"yes"; then
+       AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wsign-compare"
 
-  test -n "$PERL" && break
-done
 
+    else
+       :
+    fi
 
-    # 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
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_PERL+set}" = set; then
-  $as_echo_n "(cached) " >&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"
-    $as_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
-  { $as_echo "$as_me:$LINENO: result: $PERL" >&5
-$as_echo "$PERL" >&6; }
-else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-fi
 
 
-fi
 
-# Check if version of Perl is sufficient
-ac_perl_version="5.6.0"
 
-if test "x$PERL" != "x"; then
-  { $as_echo "$as_me:$LINENO: checking for perl version greater than or equal to $ac_perl_version" >&5
-$as_echo_n "checking for perl version greater than or equal to $ac_perl_version... " >&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
-    { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; };
+    { $as_echo "$as_me:$LINENO: checking for gcc flag -Wfloat-equal" >&5
+$as_echo_n "checking for gcc flag -Wfloat-equal... " >&6; }
+    if test "x$GCC" = "xyes"; then
+               (gcc --help={target,optimizers,warnings,undocumented,params,c} 2>&1 ||
+           $CC -v --help 2>&1) |
+         $EGREP -- '[^[:alnum:]]-Wfloat-equal[^[:alnum:]-]' 2>&1 > /dev/null
+               if test $? -eq 0; then
+           found_warning=yes
+           { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+           found_warning=no
+           { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+       fi
+    else
+       found_warning=no
+       { $as_echo "$as_me:$LINENO: result: no (not using gcc)" >&5
+$as_echo "no (not using gcc)" >&6; }
+    fi
 
-       { { $as_echo "$as_me:$LINENO: error: Amanda requires at least perl 5.6.0" >&5
-$as_echo "$as_me: error: Amanda requires at least perl 5.6.0" >&2;}
-   { (exit 1); exit 1; }; }
+    if test x"$found_warning" = x"yes"; then
+       AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wfloat-equal"
 
-  else
-    { $as_echo "$as_me:$LINENO: result: ok" >&5
-$as_echo "ok" >&6; };
 
-  fi
-else
-  { $as_echo "$as_me:$LINENO: WARNING: could not find perl" >&5
-$as_echo "$as_me: WARNING: could not find perl" >&2;}
-fi
+    else
+       :
+    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
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_SWIG+set}" = set; then
-  $as_echo_n "(cached) " >&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 $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"
-    $as_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
-  { $as_echo "$as_me:$LINENO: result: $SWIG" >&5
-$as_echo "$SWIG" >&6; }
-else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+
+    { $as_echo "$as_me:$LINENO: checking for gcc flag -Wold-style-definition" >&5
+$as_echo_n "checking for gcc flag -Wold-style-definition... " >&6; }
+    if test "x$GCC" = "xyes"; then
+               (gcc --help={target,optimizers,warnings,undocumented,params,c} 2>&1 ||
+           $CC -v --help 2>&1) |
+         $EGREP -- '[^[:alnum:]]-Wold-style-definition[^[:alnum:]-]' 2>&1 > /dev/null
+               if test $? -eq 0; then
+           found_warning=yes
+           { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+           found_warning=no
+           { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
-fi
+       fi
+    else
+       found_warning=no
+       { $as_echo "$as_me:$LINENO: result: no (not using gcc)" >&5
+$as_echo "no (not using gcc)" >&6; }
+    fi
 
+    if test x"$found_warning" = x"yes"; then
+       AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wold-style-definition"
 
-  test -n "$SWIG" && break
-done
 
+    else
+       :
+    fi
 
-    # 1.3.32 introduces a change in the way empty strings are handled (old versions
-    # returned undef in Perl, while new versions return an empty Perl string)
-    # 1.3.39 is required for the %begin block
 
-        # Extract the first word of "swig", so it can be a program name with args.
-set dummy swig; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_SWIG+set}" = set; then
-  $as_echo_n "(cached) " >&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"
-    $as_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
-  { $as_echo "$as_me:$LINENO: result: $SWIG" >&5
-$as_echo "$SWIG" >&6; }
-else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-fi
+    # test for -W'warning', then add the 'no-' version.
 
 
-        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.39" ; then
-                { $as_echo "$as_me:$LINENO: checking for SWIG version" >&5
-$as_echo_n "checking for SWIG version... " >&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'`
-                { $as_echo "$as_me:$LINENO: result: $swig_version" >&5
-$as_echo "$swig_version" >&6; }
-                if test -n "$swig_version" ; then
 
-  # Used to indicate true or false condition
-  ax_compare_version=false
+    { $as_echo "$as_me:$LINENO: checking for gcc flag -Wstrict-aliasing" >&5
+$as_echo_n "checking for gcc flag -Wstrict-aliasing... " >&6; }
+    if test "x$GCC" = "xyes"; then
+               (gcc --help={target,optimizers,warnings,undocumented,params,c} 2>&1 ||
+           $CC -v --help 2>&1) |
+         $EGREP -- '[^[:alnum:]]-Wstrict-aliasing[^[:alnum:]-]' 2>&1 > /dev/null
+               if test $? -eq 0; then
+           found_warning=yes
+           { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+           found_warning=no
+           { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+       fi
+    else
+       found_warning=no
+       { $as_echo "$as_me:$LINENO: result: no (not using gcc)" >&5
+$as_echo "no (not using gcc)" >&6; }
+    fi
 
-  # 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.
+    if test x"$found_warning" = x"yes"; then
+       AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wno-strict-aliasing"
 
-  ax_compare_version_A=`echo "$swig_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'`
 
+    else
+       :
+    fi
 
-  ax_compare_version_B=`echo "1.3.39" | 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'`
 
 
-    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}/true/;s/x${ax_compare_version_B}/false/;1q"`
+    # test for -W'warning', then add the 'no-' version.
 
 
 
-    if test "$ax_compare_version" = "true" ; then
+    { $as_echo "$as_me:$LINENO: checking for gcc flag -Wunknown-pragmas" >&5
+$as_echo_n "checking for gcc flag -Wunknown-pragmas... " >&6; }
+    if test "x$GCC" = "xyes"; then
+               (gcc --help={target,optimizers,warnings,undocumented,params,c} 2>&1 ||
+           $CC -v --help 2>&1) |
+         $EGREP -- '[^[:alnum:]]-Wunknown-pragmas[^[:alnum:]-]' 2>&1 > /dev/null
+               if test $? -eq 0; then
+           found_warning=yes
+           { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+           found_warning=no
+           { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+       fi
+    else
+       found_warning=no
+       { $as_echo "$as_me:$LINENO: result: no (not using gcc)" >&5
+$as_echo "no (not using gcc)" >&6; }
+    fi
+
+    if test x"$found_warning" = x"yes"; then
+       AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wno-unknown-pragmas"
 
-                                                   SWIG_LIB=`$SWIG -swiglib`
 
     else
-                                                   SWIG='echo "Error: SWIG version >= 1.3.39 is required.  You have '"$swig_version"'.  You should look at http://www.swig.org" ; false'
+       :
+    fi
 
-  fi
 
-                else
-                        SWIG='echo "Error: Cannot determine SWIG version.  You should look at http://www.swig.org" ; false'
-                fi
-        fi
 
+    # Check whether --enable-werror was given.
+if test "${enable_werror+set}" = set; then
+  enableval=$enable_werror;
+           case "$enableval" in
+           "" | y | ye | yes)
 
 
 
-    # Extract the first word of "ps", so it can be a program name with args.
-set dummy ps; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PS+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  case $PS in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_PS="$PS" # 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_PS="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-IFS=$as_save_IFS
 
-  ;;
-esac
-fi
-PS=$ac_cv_path_PS
-if test -n "$PS"; then
-  { $as_echo "$as_me:$LINENO: result: $PS" >&5
-$as_echo "$PS" >&6; }
-else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
+    { $as_echo "$as_me:$LINENO: checking for gcc flag -Werror" >&5
+$as_echo_n "checking for gcc flag -Werror... " >&6; }
+    if test "x$GCC" = "xyes"; then
+               (gcc --help={target,optimizers,warnings,undocumented,params,c} 2>&1 ||
+           $CC -v --help 2>&1) |
+         $EGREP -- '[^[:alnum:]]-Werror[^[:alnum:]-]' 2>&1 > /dev/null
+               if test $? -eq 0; then
+           found_warning=yes
+           { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+           found_warning=no
+           { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
+       fi
+    else
+       found_warning=no
+       { $as_echo "$as_me:$LINENO: result: no (not using gcc)" >&5
+$as_echo "no (not using gcc)" >&6; }
+    fi
+
+    if test x"$found_warning" = x"yes"; then
+       AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Werror"
+
+
+    else
+       :
+    fi
+
+
+               ;;
+           esac
+
 fi
 
 
-    { $as_echo "$as_me:$LINENO: checking ps argument to use" >&5
-$as_echo_n "checking ps argument to use... " >&6; }
-    PS_ARGUMENT=
 
-    # ps is *very* non-portable, and across many systems, the same option
-    # (e.g., -e) can mean different things.  So this macro tries to
-    # special-case most known systems, and makes an effort to detect unknown
-    # systems
-    case "$host" in
-       *-*-solaris*)
-           PS_ARGUMENT="-eo pid,ppid,comm"
-           PS_ARGUMENT_ARGS="-eo pid,ppid,comm"
-           ;;
+    # Check whether --enable-swig-error was given.
+if test "${enable_swig_error+set}" = set; then
+  enableval=$enable_swig_error;
+           case "$enableval" in
+           "" | y | ye | yes)
+               AMANDA_SWIG_PERL_CFLAGS=-Werror
+               ;;
+           *n | no)
+               AMANDA_SWIG_PERL_CFLAGS=
+               ;;
+           esac
 
-       *-*-linux-*)
-           PS_ARGUMENT="-eo pid,ppid,command"
-           PS_ARGUMENT_ARGS="-eo pid,ppid,command"
-           ;;
+fi
 
-       *-*-*bsd*)
-           PS_ARGUMENT="-axo pid,ppid,command"
-           PS_ARGUMENT_ARGS="-axo pid,ppid,command"
-           ;;
 
-       *-apple-darwin*)
-           PS_ARGUMENT="-aAco pid,ppid,command"
-           PS_ARGUMENT_ARGS="-aAo pid,ppid,command"
-           ;;
 
-       *-pc-cygwin)
-           # Cygwin is special-cased in Amanda::Process
-           PS_ARGUMENT=CYGWIN
-           PS_ARGUMENT_ARGS="-ef"
-           ;;
 
-       *-*-hpux*)
-           # HPUX's 'PS' needs the env var UNIX95 to run in "xpg4" mode
-           PS="UNIX95=1 $PS"
-           PS_ARGUMENT="-eo pid,ppid,comm"
-           PS_ARGUMENT_ARGS="-eo pid,ppid,comm"
-           ;;
+#
+# Libtool
+#
+case `pwd` in
+  *\ * | *\    *)
+    { $as_echo "$as_me:$LINENO: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
+$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
+esac
 
-       *)
-           for try in \
-               "-axo pid,ppid,command" \
-               "-aAco pid,ppid,command" \
-               "-eo pid,ppid,comm"
-           do
-               ps $try >/dev/null 2>/dev/null
-               if test $? -eq 0; then
-                   PS_ARGUMENT="$try"
-                   break
-               fi
-           done
-           for try in \
-               "-axo pid,ppid,command" \
-               "-aAo pid,ppid,command" \
-               "-eo pid,ppid,comm"
-           do
-               ps $try >/dev/null 2>/dev/null
-               if test $? -eq 0; then
-                   PS_ARGUMENT_ARGS="$try"
-                   break
-               fi
-           done
-           if test -z "$PS_ARGUMENT" -o -z "$PS_ARGUMENT_ARGS"; then
-               { { $as_echo "$as_me:$LINENO: error: Can't find ps argument to use." >&5
-$as_echo "$as_me: error: Can't find ps argument to use." >&2;}
-   { (exit 1); exit 1; }; }
-           fi
-           ;;
-    esac
 
-    { $as_echo "$as_me:$LINENO: result: $PS_ARGUMENT" >&5
-$as_echo "$PS_ARGUMENT" >&6; }
 
-    { $as_echo "$as_me:$LINENO: result: $PS_ARGUMENT_ARGS" >&5
-$as_echo "$PS_ARGUMENT_ARGS" >&6; }
+macro_version='2.2.4'
+macro_revision='1.2976'
 
 
 
 
-    # Extract the first word of "rpcgen", so it can be a program name with args.
-set dummy rpcgen; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_RPCGEN+set}" = set; then
+
+
+
+
+
+
+
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+{ $as_echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if test "${ac_cv_path_SED+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  case $RPCGEN in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_RPCGEN="$RPCGEN" # Let the user override the test with a path.
-  ;;
-  *)
+            ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+     for ac_i in 1 2 3 4 5 6 7; do
+       ac_script="$ac_script$as_nl$ac_script"
+     done
+     echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+     $as_unset ac_script || ac_script=
+     if test -z "$SED"; then
+  ac_path_SED_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $LOCSYSPATH
+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_RPCGEN="$as_dir/$ac_word$ac_exec_ext"
-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
+  for ac_prog in sed gsed; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
+# Check for GNU ac_path_SED and select it if it is found.
+  # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+  ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo '' >> "conftest.nl"
+    "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_SED_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_SED="$ac_path_SED"
+      ac_path_SED_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_SED_found && break 3
+    done
+  done
 done
 IFS=$as_save_IFS
-
-  ;;
-esac
-fi
-RPCGEN=$ac_cv_path_RPCGEN
-if test -n "$RPCGEN"; then
-  { $as_echo "$as_me:$LINENO: result: $RPCGEN" >&5
-$as_echo "$RPCGEN" >&6; }
+  if test -z "$ac_cv_path_SED"; then
+    { { $as_echo "$as_me:$LINENO: error: no acceptable sed could be found in \$PATH" >&5
+$as_echo "$as_me: error: no acceptable sed could be found in \$PATH" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
 else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
+  ac_cv_path_SED=$SED
 fi
 
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+  rm -f conftest.sed
 
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
 
 
 
-#
-# Compiler / system characteristics
-#
 
-#
-# compiler
-#
-if test $ac_cv_c_compiler_gnu = yes; then
-    { $as_echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5
-$as_echo_n "checking whether $CC needs -traditional... " >&6; }
-if test "${ac_cv_prog_gcc_traditional+set}" = set; then
-  $as_echo_n "(cached) " >&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 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
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5
-$as_echo "$ac_cv_prog_gcc_traditional" >&6; }
-  if test $ac_cv_prog_gcc_traditional = yes; then
-    CC="$CC -traditional"
-  fi
-fi
 
-{ $as_echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
-$as_echo_n "checking for an ANSI C-conforming const... " >&6; }
-if test "${ac_cv_c_const+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
 
-int
-main ()
-{
-/* 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;
 
-    *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
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_c_const=yes
+{ $as_echo "$as_me:$LINENO: checking for fgrep" >&5
+$as_echo_n "checking for fgrep... " >&6; }
+if test "${ac_cv_path_FGREP+set}" = set; then
+  $as_echo_n "(cached) " >&6
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
+   then ac_cv_path_FGREP="$GREP -F"
+   else
+     if test -z "$FGREP"; then
+  ac_path_FGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in fgrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue
+# Check for GNU ac_path_FGREP and select it if it is found.
+  # Check for GNU $ac_path_FGREP
+case `"$ac_path_FGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'FGREP' >> "conftest.nl"
+    "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_FGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_FGREP="$ac_path_FGREP"
+      ac_path_FGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
 
-       ac_cv_c_const=no
+      $ac_path_FGREP_found && break 3
+    done
+  done
+done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_FGREP"; then
+    { { $as_echo "$as_me:$LINENO: error: no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+$as_echo "$as_me: error: no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+else
+  ac_cv_path_FGREP=$FGREP
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   fi
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
-$as_echo "$ac_cv_c_const" >&6; }
-if test $ac_cv_c_const = no; then
-
-cat >>confdefs.h <<\_ACEOF
-#define const /**/
-_ACEOF
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_FGREP" >&5
+$as_echo "$ac_cv_path_FGREP" >&6; }
+ FGREP="$ac_cv_path_FGREP"
 
-fi
 
+test -z "$GREP" && GREP=grep
 
- { $as_echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
-$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
-if test "${ac_cv_c_bigendian+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_c_bigendian=unknown
-    # See if we're dealing with a universal compiler.
-    cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#ifndef __APPLE_CC__
-              not a universal capable compiler
-            #endif
-            typedef int dummy;
 
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
 
-       # Check for potential -arch flags.  It is not universal unless
-       # there are some -arch flags.  Note that *ppc* also matches
-       # ppc64.  This check is also rather less than ideal.
-       case "${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}" in  #(
-         *-arch*ppc*|*-arch*i386*|*-arch*x86_64*) ac_cv_c_bigendian=universal;;
-       esac
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
 
-fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    if test $ac_cv_c_bigendian = unknown; then
-      # 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  # 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_c_bigendian=yes
-else
-  $as_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
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
 
-fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    fi
-    if test $ac_cv_c_bigendian = unknown; then
-      # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
-      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>
 
-int
-main ()
-{
-#if ! (defined _LITTLE_ENDIAN || defined _BIG_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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  # 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 <limits.h>
 
-int
-main ()
-{
-#ifndef _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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_c_bigendian=yes
+# 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
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_cv_c_bigendian=no
+  with_gnu_ld=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  { $as_echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [\\/]* | ?:[\\/]*)
+      re_direlt='/[^/][^/]*/\.\./'
+      # Canonicalize the pathname of ld
+      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+       ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  { $as_echo "$as_me:$LINENO: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
+  { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
 fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+if test "${lt_cv_path_LD+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$LD"; then
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some variants of GNU ld only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+       test "$with_gnu_ld" != no && break
+       ;;
+      *)
+       test "$with_gnu_ld" != yes && break
+       ;;
+      esac
     fi
-    if test $ac_cv_c_bigendian = unknown; then
-      # Compile a test program.
-      if test "$cross_compiling" = yes; then
-  # Try to guess by grepping values from an object file.
-        cat >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 };
-               int use_ascii (int i) {
-                 return ascii_mm[i] + ascii_ii[i];
-               }
-               short int ebcdic_ii[] =
-                 { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
-               short int ebcdic_mm[] =
-                 { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
-               int use_ebcdic (int i) {
-                 return ebcdic_mm[i] + ebcdic_ii[i];
-               }
-               extern int foo;
-
-int
-main ()
-{
-return use_ascii (foo) == use_ebcdic (foo);
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  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
+  done
+  IFS="$lt_save_ifs"
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-
-            /* Are we little or big endian?  From Harbison&Steele.  */
-            union
-            {
-              long int l;
-              char c[sizeof (long int)];
-            } u;
-            u.l = 1;
-            return u.c[sizeof (long int) - 1] == 1;
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_c_bigendian=no
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  { $as_echo "$as_me:$LINENO: result: $LD" >&5
+$as_echo "$LD" >&6; }
 else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_c_bigendian=yes
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+$as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+   { (exit 1); exit 1; }; }
+{ $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if test "${lt_cv_prog_gnu_ld+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac
 fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
 
 
-    fi
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
-$as_echo "$ac_cv_c_bigendian" >&6; }
- case $ac_cv_c_bigendian in #(
-   yes)
-     cat >>confdefs.h <<\_ACEOF
-#define WORDS_BIGENDIAN 1
-_ACEOF
-;; #(
-   no)
-      ;; #(
-   universal)
 
-cat >>confdefs.h <<\_ACEOF
-#define AC_APPLE_UNIVERSAL_BUILD 1
-_ACEOF
 
-     ;; #(
-   *)
-     { { $as_echo "$as_me:$LINENO: error: unknown endianness
- presetting ac_cv_c_bigendian=no (or yes) will help" >&5
-$as_echo "$as_me: error: unknown endianness
- presetting ac_cv_c_bigendian=no (or yes) will help" >&2;}
-   { (exit 1); exit 1; }; } ;;
- esac
 
 
-# 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
 
 
-#
-# Warnings
-#
 
+{ $as_echo "$as_me:$LINENO: checking for BSD- or MS-compatible name lister (nm)" >&5
+$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
+if test "${lt_cv_path_NM+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  lt_nm_to_check="${ac_tool_prefix}nm"
+  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+    lt_nm_to_check="$lt_nm_to_check nm"
+  fi
+  for lt_tmp_nm in $lt_nm_to_check; do
+    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+      IFS="$lt_save_ifs"
+      test -z "$ac_dir" && ac_dir=.
+      tmp_nm="$ac_dir/$lt_tmp_nm"
+      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+       # Check to see if the nm accepts a BSD-compat flag.
+       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+       #   nm: unknown option "B" ignored
+       # Tru64's nm complains that /dev/null is an invalid object file
+       case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+       */dev/null* | *'Invalid file or object type'*)
+         lt_cv_path_NM="$tmp_nm -B"
+         break
+         ;;
+       *)
+         case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+         */dev/null*)
+           lt_cv_path_NM="$tmp_nm -p"
+           break
+           ;;
+         *)
+           lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+           continue # so that we can try to find one that supports BSD flags
+           ;;
+         esac
+         ;;
+       esac
+      fi
+    done
+    IFS="$lt_save_ifs"
+  done
+  : ${lt_cv_path_NM=no}
+fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5
+$as_echo "$lt_cv_path_NM" >&6; }
+if test "$lt_cv_path_NM" != "no"; then
+  NM="$lt_cv_path_NM"
+else
+  # Didn't find any BSD compatible name lister, look for dumpbin.
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in "dumpbin -symbols" "link -dump -symbols"
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_DUMPBIN+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$DUMPBIN"; then
+  ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+DUMPBIN=$ac_cv_prog_DUMPBIN
+if test -n "$DUMPBIN"; then
+  { $as_echo "$as_me:$LINENO: result: $DUMPBIN" >&5
+$as_echo "$DUMPBIN" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
 
+    test -n "$DUMPBIN" && break
+  done
+fi
+if test -z "$DUMPBIN"; then
+  ac_ct_DUMPBIN=$DUMPBIN
+  for ac_prog in "dumpbin -symbols" "link -dump -symbols"
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_DUMPBIN"; then
+  ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { 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_DUMPBIN="$ac_prog"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-    { $as_echo "$as_me:$LINENO: checking for gcc flag -Wparentheses" >&5
-$as_echo_n "checking for gcc flag -Wparentheses... " >&6; }
-    if test "x$GCC" = "xyes"; then
-               (gcc --help={target,optimizers,warnings,undocumented,params,c} 2>&1 ||
-           $CC -v --help 2>&1) |
-         $EGREP -- '[^[:alnum:]]-Wparentheses[^[:alnum:]-]' 2>&1 > /dev/null
-               if test $? -eq 0; then
-           found_warning=yes
-           { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
-       else
-           found_warning=no
-           { $as_echo "$as_me:$LINENO: result: no" >&5
+fi
+fi
+ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
+if test -n "$ac_ct_DUMPBIN"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_DUMPBIN" >&5
+$as_echo "$ac_ct_DUMPBIN" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
-       fi
-    else
-       found_warning=no
-       { $as_echo "$as_me:$LINENO: result: no (not using gcc)" >&5
-$as_echo "no (not using gcc)" >&6; }
-    fi
+fi
 
-    if test x"$found_warning" = x"yes"; then
-       AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wparentheses"
 
+  test -n "$ac_ct_DUMPBIN" && break
+done
 
-    else
-       :
-    fi
+  if test "x$ac_ct_DUMPBIN" = x; then
+    DUMPBIN=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    DUMPBIN=$ac_ct_DUMPBIN
+  fi
+fi
 
 
+  if test "$DUMPBIN" != ":"; then
+    NM="$DUMPBIN"
+  fi
+fi
+test -z "$NM" && NM=nm
 
 
 
 
-    { $as_echo "$as_me:$LINENO: checking for gcc flag -Wdeclaration-after-statement" >&5
-$as_echo_n "checking for gcc flag -Wdeclaration-after-statement... " >&6; }
-    if test "x$GCC" = "xyes"; then
-               (gcc --help={target,optimizers,warnings,undocumented,params,c} 2>&1 ||
-           $CC -v --help 2>&1) |
-         $EGREP -- '[^[:alnum:]]-Wdeclaration-after-statement[^[:alnum:]-]' 2>&1 > /dev/null
-               if test $? -eq 0; then
-           found_warning=yes
-           { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
-       else
-           found_warning=no
-           { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-       fi
-    else
-       found_warning=no
-       { $as_echo "$as_me:$LINENO: result: no (not using gcc)" >&5
-$as_echo "no (not using gcc)" >&6; }
-    fi
 
-    if test x"$found_warning" = x"yes"; then
-       AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wdeclaration-after-statement"
 
+{ $as_echo "$as_me:$LINENO: checking the name lister ($NM) interface" >&5
+$as_echo_n "checking the name lister ($NM) interface... " >&6; }
+if test "${lt_cv_nm_interface+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_nm_interface="BSD nm"
+  echo "int some_variable = 0;" > conftest.$ac_ext
+  (eval echo "\"\$as_me:45193: $ac_compile\"" >&5)
+  (eval "$ac_compile" 2>conftest.err)
+  cat conftest.err >&5
+  (eval echo "\"\$as_me:45196: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+  cat conftest.err >&5
+  (eval echo "\"\$as_me:45199: output\"" >&5)
+  cat conftest.out >&5
+  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+    lt_cv_nm_interface="MS dumpbin"
+  fi
+  rm -f conftest*
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_nm_interface" >&5
+$as_echo "$lt_cv_nm_interface" >&6; }
 
-    else
-       :
-    fi
+{ $as_echo "$as_me:$LINENO: checking whether ln -s works" >&5
+$as_echo_n "checking whether ln -s works... " >&6; }
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+$as_echo "no, using $LN_S" >&6; }
+fi
 
+# find the maximum length of command line arguments
+{ $as_echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
+$as_echo_n "checking the maximum length of command line arguments... " >&6; }
+if test "${lt_cv_sys_max_cmd_len+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+    i=0
+  teststring="ABCD"
 
+  case $build_os in
+  msdosdjgpp*)
+    # On DJGPP, this test can blow up pretty badly due to problems in libc
+    # (any single argument exceeding 2000 bytes causes a buffer overrun
+    # during glob expansion).  Even if it were fixed, the result of this
+    # check would be larger than it should be.
+    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
+    ;;
 
+  gnu*)
+    # Under GNU Hurd, this test is not required because there is
+    # no limit to the length of command line arguments.
+    # Libtool will interpret -1 as no limit whatsoever
+    lt_cv_sys_max_cmd_len=-1;
+    ;;
 
+  cygwin* | mingw*)
+    # 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;
+    ;;
 
-    { $as_echo "$as_me:$LINENO: checking for gcc flag -Wmissing-prototypes" >&5
-$as_echo_n "checking for gcc flag -Wmissing-prototypes... " >&6; }
-    if test "x$GCC" = "xyes"; then
-               (gcc --help={target,optimizers,warnings,undocumented,params,c} 2>&1 ||
-           $CC -v --help 2>&1) |
-         $EGREP -- '[^[:alnum:]]-Wmissing-prototypes[^[:alnum:]-]' 2>&1 > /dev/null
-               if test $? -eq 0; then
-           found_warning=yes
-           { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
-       else
-           found_warning=no
-           { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-       fi
+  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
-       found_warning=no
-       { $as_echo "$as_me:$LINENO: result: no (not using gcc)" >&5
-$as_echo "no (not using gcc)" >&6; }
+      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`
+    ;;
 
-    if test x"$found_warning" = x"yes"; then
-       AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wmissing-prototypes"
-
+  interix*)
+    # We know the value 262144 and hardcode it with a safety zone (like BSD)
+    lt_cv_sys_max_cmd_len=196608
+    ;;
 
+  osf*)
+    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+    # nice to cause kernel panics so lets avoid the loop below.
+    # First set a reasonable default.
+    lt_cv_sys_max_cmd_len=16384
+    #
+    if test -x /sbin/sysconfig; then
+      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+        *1*) lt_cv_sys_max_cmd_len=-1 ;;
+      esac
+    fi
+    ;;
+  sco3.2v5*)
+    lt_cv_sys_max_cmd_len=102400
+    ;;
+  sysv5* | sco5v6* | sysv4.2uw2*)
+    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+    if test -n "$kargmax"; then
+      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[         ]//'`
     else
-       :
+      lt_cv_sys_max_cmd_len=32768
     fi
-
-
-
-
-
-
-    { $as_echo "$as_me:$LINENO: checking for gcc flag -Wstrict-prototypes" >&5
-$as_echo_n "checking for gcc flag -Wstrict-prototypes... " >&6; }
-    if test "x$GCC" = "xyes"; then
-               (gcc --help={target,optimizers,warnings,undocumented,params,c} 2>&1 ||
-           $CC -v --help 2>&1) |
-         $EGREP -- '[^[:alnum:]]-Wstrict-prototypes[^[:alnum:]-]' 2>&1 > /dev/null
-               if test $? -eq 0; then
-           found_warning=yes
-           { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
-       else
-           found_warning=no
-           { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-       fi
+    ;;
+  *)
+    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+    if test -n "$lt_cv_sys_max_cmd_len"; then
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
     else
-       found_warning=no
-       { $as_echo "$as_me:$LINENO: result: no (not using gcc)" >&5
-$as_echo "no (not using gcc)" >&6; }
+      # Make teststring a little bigger before we do anything with it.
+      # a 1K string should be a reasonable start.
+      for i in 1 2 3 4 5 6 7 8 ; do
+        teststring=$teststring$teststring
+      done
+      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+      # If test is not a shell built-in, we'll probably end up computing a
+      # maximum length that is only half of the actual maximum length, but
+      # we can't tell.
+      while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
+                = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
+             test $i != 17 # 1/2 MB should be enough
+      do
+        i=`expr $i + 1`
+        teststring=$teststring$teststring
+      done
+      # Only check the string length outside the loop.
+      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+      teststring=
+      # Add a significant safety factor because C++ compilers can tack on
+      # massive amounts of additional arguments before passing them to the
+      # linker.  It appears as though 1/2 is a usable value.
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
     fi
+    ;;
+  esac
 
-    if test x"$found_warning" = x"yes"; then
-       AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wstrict-prototypes"
-
+fi
 
-    else
-       :
-    fi
+if test -n $lt_cv_sys_max_cmd_len ; then
+  { $as_echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
+$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: none" >&5
+$as_echo "none" >&6; }
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
 
 
 
 
 
 
-    { $as_echo "$as_me:$LINENO: checking for gcc flag -Wmissing-declarations" >&5
-$as_echo_n "checking for gcc flag -Wmissing-declarations... " >&6; }
-    if test "x$GCC" = "xyes"; then
-               (gcc --help={target,optimizers,warnings,undocumented,params,c} 2>&1 ||
-           $CC -v --help 2>&1) |
-         $EGREP -- '[^[:alnum:]]-Wmissing-declarations[^[:alnum:]-]' 2>&1 > /dev/null
-               if test $? -eq 0; then
-           found_warning=yes
-           { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
-       else
-           found_warning=no
-           { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-       fi
-    else
-       found_warning=no
-       { $as_echo "$as_me:$LINENO: result: no (not using gcc)" >&5
-$as_echo "no (not using gcc)" >&6; }
-    fi
-
-    if test x"$found_warning" = x"yes"; then
-       AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wmissing-declarations"
-
-
-    else
-       :
-    fi
-
-
-
-
-
+: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
 
-    { $as_echo "$as_me:$LINENO: checking for gcc flag -Wformat" >&5
-$as_echo_n "checking for gcc flag -Wformat... " >&6; }
-    if test "x$GCC" = "xyes"; then
-               (gcc --help={target,optimizers,warnings,undocumented,params,c} 2>&1 ||
-           $CC -v --help 2>&1) |
-         $EGREP -- '[^[:alnum:]]-Wformat[^[:alnum:]-]' 2>&1 > /dev/null
-               if test $? -eq 0; then
-           found_warning=yes
-           { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
-       else
-           found_warning=no
-           { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-       fi
-    else
-       found_warning=no
-       { $as_echo "$as_me:$LINENO: result: no (not using gcc)" >&5
-$as_echo "no (not using gcc)" >&6; }
-    fi
+{ $as_echo "$as_me:$LINENO: checking whether the shell understands some XSI constructs" >&5
+$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
+      = c,a/b,, \
+    && eval 'test $(( 1 + 1 )) -eq 2 \
+    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+  && xsi_shell=yes
+{ $as_echo "$as_me:$LINENO: result: $xsi_shell" >&5
+$as_echo "$xsi_shell" >&6; }
 
-    if test x"$found_warning" = x"yes"; then
-       AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wformat"
 
+{ $as_echo "$as_me:$LINENO: checking whether the shell understands \"+=\"" >&5
+$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
+    >/dev/null 2>&1 \
+  && lt_shell_append=yes
+{ $as_echo "$as_me:$LINENO: result: $lt_shell_append" >&5
+$as_echo "$lt_shell_append" >&6; }
 
-    else
-       :
-    fi
 
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  lt_unset=unset
+else
+  lt_unset=false
+fi
 
 
 
 
 
-    { $as_echo "$as_me:$LINENO: checking for gcc flag -Wformat-security" >&5
-$as_echo_n "checking for gcc flag -Wformat-security... " >&6; }
-    if test "x$GCC" = "xyes"; then
-               (gcc --help={target,optimizers,warnings,undocumented,params,c} 2>&1 ||
-           $CC -v --help 2>&1) |
-         $EGREP -- '[^[:alnum:]]-Wformat-security[^[:alnum:]-]' 2>&1 > /dev/null
-               if test $? -eq 0; then
-           found_warning=yes
-           { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
-       else
-           found_warning=no
-           { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-       fi
-    else
-       found_warning=no
-       { $as_echo "$as_me:$LINENO: result: no (not using gcc)" >&5
-$as_echo "no (not using gcc)" >&6; }
-    fi
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+  lt_SP2NL='tr \040 \012'
+  lt_NL2SP='tr \015\012 \040\040'
+  ;;
+ *) # EBCDIC based system
+  lt_SP2NL='tr \100 \n'
+  lt_NL2SP='tr \r\n \100\100'
+  ;;
+esac
 
-    if test x"$found_warning" = x"yes"; then
-       AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wformat-security"
 
 
-    else
-       :
-    fi
 
 
 
 
 
 
-    { $as_echo "$as_me:$LINENO: checking for gcc flag -Wsign-compare" >&5
-$as_echo_n "checking for gcc flag -Wsign-compare... " >&6; }
-    if test "x$GCC" = "xyes"; then
-               (gcc --help={target,optimizers,warnings,undocumented,params,c} 2>&1 ||
-           $CC -v --help 2>&1) |
-         $EGREP -- '[^[:alnum:]]-Wsign-compare[^[:alnum:]-]' 2>&1 > /dev/null
-               if test $? -eq 0; then
-           found_warning=yes
-           { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
-       else
-           found_warning=no
-           { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-       fi
+{ $as_echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
+$as_echo_n "checking for $LD option to reload object files... " >&6; }
+if test "${lt_cv_ld_reload_flag+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_ld_reload_flag='-r'
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
+$as_echo "$lt_cv_ld_reload_flag" >&6; }
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+  darwin*)
+    if test "$GCC" = yes; then
+      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
     else
-       found_warning=no
-       { $as_echo "$as_me:$LINENO: result: no (not using gcc)" >&5
-$as_echo "no (not using gcc)" >&6; }
+      reload_cmds='$LD$reload_flag -o $output$reload_objs'
     fi
+    ;;
+esac
 
-    if test x"$found_warning" = x"yes"; then
-       AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wsign-compare"
 
 
-    else
-       :
-    fi
 
 
 
 
 
 
-    { $as_echo "$as_me:$LINENO: checking for gcc flag -Wfloat-equal" >&5
-$as_echo_n "checking for gcc flag -Wfloat-equal... " >&6; }
-    if test "x$GCC" = "xyes"; then
-               (gcc --help={target,optimizers,warnings,undocumented,params,c} 2>&1 ||
-           $CC -v --help 2>&1) |
-         $EGREP -- '[^[:alnum:]]-Wfloat-equal[^[:alnum:]-]' 2>&1 > /dev/null
-               if test $? -eq 0; then
-           found_warning=yes
-           { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
-       else
-           found_warning=no
-           { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-       fi
-    else
-       found_warning=no
-       { $as_echo "$as_me:$LINENO: result: no (not using gcc)" >&5
-$as_echo "no (not using gcc)" >&6; }
-    fi
 
-    if test x"$found_warning" = x"yes"; then
-       AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wfloat-equal"
+{ $as_echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5
+$as_echo_n "checking how to recognize dependent libraries... " >&6; }
+if test "${lt_cv_deplibs_check_method+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
 
+case $host_os in
+aix[4-9]*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
 
-    else
-       :
-    fi
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
 
+bsdi[45]*)
+  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
 
+cygwin*)
+  # func_win32_libid is a shell function defined in ltmain.sh
+  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+  lt_cv_file_magic_cmd='func_win32_libid'
+  ;;
 
+mingw* | pw32*)
+  # Base MSYS/MinGW do not provide the 'file' command needed by
+  # func_win32_libid shell function, so use a weaker test based on 'objdump',
+  # unless we find 'file', for example because we are cross-compiling.
+  if ( file / ) >/dev/null 2>&1; then
+    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+    lt_cv_file_magic_cmd='func_win32_libid'
+  else
+    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+    lt_cv_file_magic_cmd='$OBJDUMP -f'
+  fi
+  ;;
 
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
 
+freebsd* | dragonfly*)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    case $host_cpu in
+    i*86 )
+      # Not sure whether the presence of OpenBSD here was a mistake.
+      # Let's accept both of them until this is cleared up.
+      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
+      lt_cv_file_magic_cmd=/usr/bin/file
+      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+      ;;
+    esac
+  else
+    lt_cv_deplibs_check_method=pass_all
+  fi
+  ;;
 
-    { $as_echo "$as_me:$LINENO: checking for gcc flag -Wold-style-definition" >&5
-$as_echo_n "checking for gcc flag -Wold-style-definition... " >&6; }
-    if test "x$GCC" = "xyes"; then
-               (gcc --help={target,optimizers,warnings,undocumented,params,c} 2>&1 ||
-           $CC -v --help 2>&1) |
-         $EGREP -- '[^[:alnum:]]-Wold-style-definition[^[:alnum:]-]' 2>&1 > /dev/null
-               if test $? -eq 0; then
-           found_warning=yes
-           { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
-       else
-           found_warning=no
-           { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-       fi
-    else
-       found_warning=no
-       { $as_echo "$as_me:$LINENO: result: no (not using gcc)" >&5
-$as_echo "no (not using gcc)" >&6; }
-    fi
+gnu*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
 
-    if test x"$found_warning" = x"yes"; then
-       AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wold-style-definition"
+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
+  ;;
 
+interix[3-9]*)
+  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+  lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
+  ;;
 
-    else
-       :
-    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* | k*bsd*-gnu)
+  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
+  ;;
 
-    # test for -W'warning', then add the 'no-' version.
+newos6*)
+  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=/usr/lib/libnls.so
+  ;;
 
+*nto* | *qnx*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
 
+openbsd*)
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+  fi
+  ;;
 
-    { $as_echo "$as_me:$LINENO: checking for gcc flag -Wstrict-aliasing" >&5
-$as_echo_n "checking for gcc flag -Wstrict-aliasing... " >&6; }
-    if test "x$GCC" = "xyes"; then
-               (gcc --help={target,optimizers,warnings,undocumented,params,c} 2>&1 ||
-           $CC -v --help 2>&1) |
-         $EGREP -- '[^[:alnum:]]-Wstrict-aliasing[^[:alnum:]-]' 2>&1 > /dev/null
-               if test $? -eq 0; then
-           found_warning=yes
-           { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
-       else
-           found_warning=no
-           { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-       fi
-    else
-       found_warning=no
-       { $as_echo "$as_me:$LINENO: result: no (not using gcc)" >&5
-$as_echo "no (not using gcc)" >&6; }
-    fi
+osf3* | osf4* | osf5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
 
-    if test x"$found_warning" = x"yes"; then
-       AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Wno-strict-aliasing"
+rdos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
 
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
 
-    else
-       :
-    fi
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
 
+sysv4 | sysv4.3*)
+  case $host_vendor in
+  motorola)
+    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+    ;;
+  ncr)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  sequent)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
+    ;;
+  sni)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
+    lt_cv_file_magic_test_file=/lib/libc.so
+    ;;
+  siemens)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  pc)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  esac
+  ;;
 
+tpf*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+esac
 
-    # test for -W'warning', then add the 'no-' version.
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
+$as_echo "$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
 
 
 
-    { $as_echo "$as_me:$LINENO: checking for gcc flag -Wunknown-pragmas" >&5
-$as_echo_n "checking for gcc flag -Wunknown-pragmas... " >&6; }
-    if test "x$GCC" = "xyes"; then
-               (gcc --help={target,optimizers,warnings,undocumented,params,c} 2>&1 ||
-           $CC -v --help 2>&1) |
-         $EGREP -- '[^[:alnum:]]-Wunknown-pragmas[^[:alnum:]-]' 2>&1 > /dev/null
-               if test $? -eq 0; then
-           found_warning=yes
-           { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
-       else
-           found_warning=no
-           { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-       fi
-    else
-       found_warning=no
-       { $as_echo "$as_me:$LINENO: result: no (not using gcc)" >&5
-$as_echo "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
 
 
 
-    # Check whether --enable-werror was given.
-if test "${enable_werror+set}" = set; then
-  enableval=$enable_werror;
-           case "$enableval" in
-           "" | y | ye | yes)
 
 
 
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AR+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { 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"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
 
-    { $as_echo "$as_me:$LINENO: checking for gcc flag -Werror" >&5
-$as_echo_n "checking for gcc flag -Werror... " >&6; }
-    if test "x$GCC" = "xyes"; then
-               (gcc --help={target,optimizers,warnings,undocumented,params,c} 2>&1 ||
-           $CC -v --help 2>&1) |
-         $EGREP -- '[^[:alnum:]]-Werror[^[:alnum:]-]' 2>&1 > /dev/null
-               if test $? -eq 0; then
-           found_warning=yes
-           { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
-       else
-           found_warning=no
-           { $as_echo "$as_me:$LINENO: result: no" >&5
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+  { $as_echo "$as_me:$LINENO: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
-       fi
-    else
-       found_warning=no
-       { $as_echo "$as_me:$LINENO: result: no (not using gcc)" >&5
-$as_echo "no (not using gcc)" >&6; }
-    fi
-
-    if test x"$found_warning" = x"yes"; then
-       AMANDA_WARNING_CFLAGS="$AMANDA_WARNING_CFLAGS -Werror"
-
-
-    else
-       :
-    fi
-
-
-               ;;
-           esac
-
 fi
 
 
-
-    # Check whether --enable-swig-error was given.
-if test "${enable_swig_error+set}" = set; then
-  enableval=$enable_swig_error;
-           case "$enableval" in
-           "" | y | ye | yes)
-               AMANDA_SWIG_PERL_CFLAGS=-Werror
-               ;;
-           *n | no)
-               AMANDA_SWIG_PERL_CFLAGS=
-               ;;
-           esac
-
 fi
-
-
-
-
-#
-# Libtool
-#
-case `pwd` in
-  *\ * | *\    *)
-    { $as_echo "$as_me:$LINENO: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
-$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
-esac
-
-
-
-macro_version='2.2.4'
-macro_revision='1.2976'
-
-
-
-
-
-
-
-
-
-
-
-
-
-ltmain="$ac_aux_dir/ltmain.sh"
-
-{ $as_echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
-$as_echo_n "checking for a sed that does not truncate output... " >&6; }
-if test "${ac_cv_path_SED+set}" = set; then
+if test -z "$ac_cv_prog_AR"; then
+  ac_ct_AR=$AR
+  # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-            ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
-     for ac_i in 1 2 3 4 5 6 7; do
-       ac_script="$ac_script$as_nl$ac_script"
-     done
-     echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
-     $as_unset ac_script || ac_script=
-     if test -z "$SED"; then
-  ac_path_SED_found=false
-  # Loop through the user's path and test for each of PROGNAME-LIST
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+  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_prog in sed gsed; do
-    for ac_exec_ext in '' $ac_executable_extensions; do
-      ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
-# Check for GNU ac_path_SED and select it if it is found.
-  # Check for GNU $ac_path_SED
-case `"$ac_path_SED" --version 2>&1` in
-*GNU*)
-  ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
-*)
-  ac_count=0
-  $as_echo_n 0123456789 >"conftest.in"
-  while :
-  do
-    cat "conftest.in" "conftest.in" >"conftest.tmp"
-    mv "conftest.tmp" "conftest.in"
-    cp "conftest.in" "conftest.nl"
-    $as_echo '' >> "conftest.nl"
-    "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
-    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
-    ac_count=`expr $ac_count + 1`
-    if test $ac_count -gt ${ac_path_SED_max-0}; then
-      # Best one so far, save it but keep looking for a better one
-      ac_cv_path_SED="$ac_path_SED"
-      ac_path_SED_max=$ac_count
-    fi
-    # 10*(2^10) chars as input seems more than enough
-    test $ac_count -gt 10 && break
-  done
-  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
-      $ac_path_SED_found && break 3
-    done
-  done
+  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"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
 done
 IFS=$as_save_IFS
-  if test -z "$ac_cv_path_SED"; then
-    { { $as_echo "$as_me:$LINENO: error: no acceptable sed could be found in \$PATH" >&5
-$as_echo "$as_me: error: no acceptable sed could be found in \$PATH" >&2;}
-   { (exit 1); exit 1; }; }
-  fi
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
 else
-  ac_cv_path_SED=$SED
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
+  if test "x$ac_ct_AR" = x; then
+    AR="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    AR=$ac_ct_AR
+  fi
+else
+  AR="$ac_cv_prog_AR"
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_SED" >&5
-$as_echo "$ac_cv_path_SED" >&6; }
- SED="$ac_cv_path_SED"
-  rm -f conftest.sed
 
-test -z "$SED" && SED=sed
-Xsed="$SED -e 1s/^X//"
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
 
 
 
@@ -46229,275 +45756,115 @@ Xsed="$SED -e 1s/^X//"
 
 
 
-{ $as_echo "$as_me:$LINENO: checking for fgrep" >&5
-$as_echo_n "checking for fgrep... " >&6; }
-if test "${ac_cv_path_FGREP+set}" = set; then
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_STRIP+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
-   then ac_cv_path_FGREP="$GREP -F"
-   else
-     if test -z "$FGREP"; then
-  ac_path_FGREP_found=false
-  # Loop through the user's path and test for each of PROGNAME-LIST
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+  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_prog in fgrep; do
-    for ac_exec_ext in '' $ac_executable_extensions; do
-      ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
-      { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue
-# Check for GNU ac_path_FGREP and select it if it is found.
-  # Check for GNU $ac_path_FGREP
-case `"$ac_path_FGREP" --version 2>&1` in
-*GNU*)
-  ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
-*)
-  ac_count=0
-  $as_echo_n 0123456789 >"conftest.in"
-  while :
-  do
-    cat "conftest.in" "conftest.in" >"conftest.tmp"
-    mv "conftest.tmp" "conftest.in"
-    cp "conftest.in" "conftest.nl"
-    $as_echo 'FGREP' >> "conftest.nl"
-    "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
-    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
-    ac_count=`expr $ac_count + 1`
-    if test $ac_count -gt ${ac_path_FGREP_max-0}; then
-      # Best one so far, save it but keep looking for a better one
-      ac_cv_path_FGREP="$ac_path_FGREP"
-      ac_path_FGREP_max=$ac_count
-    fi
-    # 10*(2^10) chars as input seems more than enough
-    test $ac_count -gt 10 && break
-  done
-  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
-      $ac_path_FGREP_found && break 3
-    done
-  done
+  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"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
 done
 IFS=$as_save_IFS
-  if test -z "$ac_cv_path_FGREP"; then
-    { { $as_echo "$as_me:$LINENO: error: no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
-$as_echo "$as_me: error: no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
-   { (exit 1); exit 1; }; }
-  fi
-else
-  ac_cv_path_FGREP=$FGREP
-fi
 
-   fi
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_FGREP" >&5
-$as_echo "$ac_cv_path_FGREP" >&6; }
- FGREP="$ac_cv_path_FGREP"
-
-
-test -z "$GREP" && GREP=grep
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-# Check whether --with-gnu-ld was given.
-if test "${with_gnu_ld+set}" = set; then
-  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:$LINENO: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
 else
-  with_gnu_ld=no
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
-ac_prog=ld
-if test "$GCC" = yes; then
-  # Check if gcc -print-prog-name=ld gives a path.
-  { $as_echo "$as_me:$LINENO: checking for ld used by $CC" >&5
-$as_echo_n "checking for ld used by $CC... " >&6; }
-  case $host in
-  *-*-mingw*)
-    # gcc leaves a trailing carriage return which upsets mingw
-    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
-  *)
-    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
-  esac
-  case $ac_prog in
-    # Accept absolute paths.
-    [\\/]* | ?:[\\/]*)
-      re_direlt='/[^/][^/]*/\.\./'
-      # Canonicalize the pathname of ld
-      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
-      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
-       ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
-      done
-      test -z "$LD" && LD="$ac_prog"
-      ;;
-  "")
-    # If it fails, then pretend we aren't using GCC.
-    ac_prog=ld
-    ;;
-  *)
-    # If it is relative, then search for the first ld in PATH.
-    with_gnu_ld=unknown
-    ;;
-  esac
-elif test "$with_gnu_ld" = yes; then
-  { $as_echo "$as_me:$LINENO: checking for GNU ld" >&5
-$as_echo_n "checking for GNU ld... " >&6; }
-else
-  { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5
-$as_echo_n "checking for non-GNU ld... " >&6; }
+
 fi
-if test "${lt_cv_path_LD+set}" = set; then
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  if test -z "$LD"; then
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for ac_dir in $PATH; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      lt_cv_path_LD="$ac_dir/$ac_prog"
-      # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some variants of GNU ld only accept -v.
-      # Break only if it was the GNU/non-GNU ld that we prefer.
-      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
-      *GNU* | *'with BFD'*)
-       test "$with_gnu_ld" != no && break
-       ;;
-      *)
-       test "$with_gnu_ld" != yes && break
-       ;;
-      esac
-    fi
-  done
-  IFS="$lt_save_ifs"
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
 else
-  lt_cv_path_LD="$LD" # 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_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
 fi
 fi
-
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
-  { $as_echo "$as_me:$LINENO: result: $LD" >&5
-$as_echo "$LD" >&6; }
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
 else
   { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
-test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
-$as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
-   { (exit 1); exit 1; }; }
-{ $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
-$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
-if test "${lt_cv_prog_gnu_ld+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  # I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
-  lt_cv_prog_gnu_ld=yes
-  ;;
-*)
-  lt_cv_prog_gnu_ld=no
-  ;;
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
 esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
 fi
-{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
-$as_echo "$lt_cv_prog_gnu_ld" >&6; }
-with_gnu_ld=$lt_cv_prog_gnu_ld
-
-
 
+test -z "$STRIP" && STRIP=:
 
 
 
 
 
 
-{ $as_echo "$as_me:$LINENO: checking for BSD- or MS-compatible name lister (nm)" >&5
-$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
-if test "${lt_cv_path_NM+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$NM"; then
-  # Let the user override the test.
-  lt_cv_path_NM="$NM"
-else
-  lt_nm_to_check="${ac_tool_prefix}nm"
-  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
-    lt_nm_to_check="$lt_nm_to_check nm"
-  fi
-  for lt_tmp_nm in $lt_nm_to_check; do
-    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
-      IFS="$lt_save_ifs"
-      test -z "$ac_dir" && ac_dir=.
-      tmp_nm="$ac_dir/$lt_tmp_nm"
-      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
-       # Check to see if the nm accepts a BSD-compat flag.
-       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
-       #   nm: unknown option "B" ignored
-       # Tru64's nm complains that /dev/null is an invalid object file
-       case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
-       */dev/null* | *'Invalid file or object type'*)
-         lt_cv_path_NM="$tmp_nm -B"
-         break
-         ;;
-       *)
-         case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
-         */dev/null*)
-           lt_cv_path_NM="$tmp_nm -p"
-           break
-           ;;
-         *)
-           lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
-           continue # so that we can try to find one that supports BSD flags
-           ;;
-         esac
-         ;;
-       esac
-      fi
-    done
-    IFS="$lt_save_ifs"
-  done
-  : ${lt_cv_path_NM=no}
-fi
-fi
-{ $as_echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5
-$as_echo "$lt_cv_path_NM" >&6; }
-if test "$lt_cv_path_NM" != "no"; then
-  NM="$lt_cv_path_NM"
-else
-  # Didn't find any BSD compatible name lister, look for dumpbin.
-  if test -n "$ac_tool_prefix"; then
-  for ac_prog in "dumpbin -symbols" "link -dump -symbols"
-  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
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_DUMPBIN+set}" = set; then
+if test "${ac_cv_prog_RANLIB+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  if test -n "$DUMPBIN"; then
-  ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
+  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
@@ -46506,7 +45873,7 @@ do
   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_DUMPBIN="$ac_tool_prefix$ac_prog"
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
     $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -46516,32 +45883,28 @@ IFS=$as_save_IFS
 
 fi
 fi
-DUMPBIN=$ac_cv_prog_DUMPBIN
-if test -n "$DUMPBIN"; then
-  { $as_echo "$as_me:$LINENO: result: $DUMPBIN" >&5
-$as_echo "$DUMPBIN" >&6; }
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
 else
   { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
-    test -n "$DUMPBIN" && break
-  done
 fi
-if test -z "$DUMPBIN"; then
-  ac_ct_DUMPBIN=$DUMPBIN
-  for ac_prog in "dumpbin -symbols" "link -dump -symbols"
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  if test -n "$ac_ct_DUMPBIN"; then
-  ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
+  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
@@ -46550,7 +45913,7 @@ do
   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_DUMPBIN="$ac_prog"
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
     $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -46560,21 +45923,17 @@ IFS=$as_save_IFS
 
 fi
 fi
-ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
-if test -n "$ac_ct_DUMPBIN"; then
-  { $as_echo "$as_me:$LINENO: result: $ac_ct_DUMPBIN" >&5
-$as_echo "$ac_ct_DUMPBIN" >&6; }
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
 else
   { $as_echo "$as_me:$LINENO: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
-
-  test -n "$ac_ct_DUMPBIN" && break
-done
-
-  if test "x$ac_ct_DUMPBIN" = x; then
-    DUMPBIN=":"
+  if test "x$ac_ct_RANLIB" = x; then
+    RANLIB=":"
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
@@ -46582,240 +45941,52 @@ yes:)
 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
-    DUMPBIN=$ac_ct_DUMPBIN
+    RANLIB=$ac_ct_RANLIB
   fi
+else
+  RANLIB="$ac_cv_prog_RANLIB"
 fi
 
-
-  if test "$DUMPBIN" != ":"; then
-    NM="$DUMPBIN"
-  fi
-fi
-test -z "$NM" && NM=nm
+test -z "$RANLIB" && RANLIB=:
 
 
 
 
 
 
-{ $as_echo "$as_me:$LINENO: checking the name lister ($NM) interface" >&5
-$as_echo_n "checking the name lister ($NM) interface... " >&6; }
-if test "${lt_cv_nm_interface+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_nm_interface="BSD nm"
-  echo "int some_variable = 0;" > conftest.$ac_ext
-  (eval echo "\"\$as_me:46608: $ac_compile\"" >&5)
-  (eval "$ac_compile" 2>conftest.err)
-  cat conftest.err >&5
-  (eval echo "\"\$as_me:46611: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
-  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
-  cat conftest.err >&5
-  (eval echo "\"\$as_me:46614: output\"" >&5)
-  cat conftest.out >&5
-  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
-    lt_cv_nm_interface="MS dumpbin"
-  fi
-  rm -f conftest*
-fi
-{ $as_echo "$as_me:$LINENO: result: $lt_cv_nm_interface" >&5
-$as_echo "$lt_cv_nm_interface" >&6; }
-
-{ $as_echo "$as_me:$LINENO: checking whether ln -s works" >&5
-$as_echo_n "checking whether ln -s works... " >&6; }
-LN_S=$as_ln_s
-if test "$LN_S" = "ln -s"; then
-  { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
-else
-  { $as_echo "$as_me:$LINENO: result: no, using $LN_S" >&5
-$as_echo "no, using $LN_S" >&6; }
-fi
-
-# find the maximum length of command line arguments
-{ $as_echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
-$as_echo_n "checking the maximum length of command line arguments... " >&6; }
-if test "${lt_cv_sys_max_cmd_len+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-    i=0
-  teststring="ABCD"
-
-  case $build_os in
-  msdosdjgpp*)
-    # On DJGPP, this test can blow up pretty badly due to problems in libc
-    # (any single argument exceeding 2000 bytes causes a buffer overrun
-    # during glob expansion).  Even if it were fixed, the result of this
-    # check would be larger than it should be.
-    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
-    ;;
-
-  gnu*)
-    # Under GNU Hurd, this test is not required because there is
-    # no limit to the length of command line arguments.
-    # Libtool will interpret -1 as no limit whatsoever
-    lt_cv_sys_max_cmd_len=-1;
-    ;;
-
-  cygwin* | mingw*)
-    # 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`
-    ;;
-
-  interix*)
-    # We know the value 262144 and hardcode it with a safety zone (like BSD)
-    lt_cv_sys_max_cmd_len=196608
-    ;;
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
 
-  osf*)
-    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
-    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
-    # nice to cause kernel panics so lets avoid the loop below.
-    # First set a reasonable default.
-    lt_cv_sys_max_cmd_len=16384
-    #
-    if test -x /sbin/sysconfig; then
-      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
-        *1*) lt_cv_sys_max_cmd_len=-1 ;;
-      esac
-    fi
-    ;;
-  sco3.2v5*)
-    lt_cv_sys_max_cmd_len=102400
-    ;;
-  sysv5* | sco5v6* | sysv4.2uw2*)
-    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
-    if test -n "$kargmax"; then
-      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[         ]//'`
-    else
-      lt_cv_sys_max_cmd_len=32768
-    fi
+if test -n "$RANLIB"; then
+  case $host_os in
+  openbsd*)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
     ;;
   *)
-    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
-    if test -n "$lt_cv_sys_max_cmd_len"; then
-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
-    else
-      # Make teststring a little bigger before we do anything with it.
-      # a 1K string should be a reasonable start.
-      for i in 1 2 3 4 5 6 7 8 ; do
-        teststring=$teststring$teststring
-      done
-      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
-      # If test is not a shell built-in, we'll probably end up computing a
-      # maximum length that is only half of the actual maximum length, but
-      # we can't tell.
-      while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \
-                = "XX$teststring$teststring"; } >/dev/null 2>&1 &&
-             test $i != 17 # 1/2 MB should be enough
-      do
-        i=`expr $i + 1`
-        teststring=$teststring$teststring
-      done
-      # Only check the string length outside the loop.
-      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
-      teststring=
-      # Add a significant safety factor because C++ compilers can tack on
-      # massive amounts of additional arguments before passing them to the
-      # linker.  It appears as though 1/2 is a usable value.
-      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
-    fi
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
     ;;
   esac
-
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
 fi
 
-if test -n $lt_cv_sys_max_cmd_len ; then
-  { $as_echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
-$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
-else
-  { $as_echo "$as_me:$LINENO: result: none" >&5
-$as_echo "none" >&6; }
-fi
-max_cmd_len=$lt_cv_sys_max_cmd_len
 
 
 
 
 
 
-: ${CP="cp -f"}
-: ${MV="mv -f"}
-: ${RM="rm -f"}
 
-{ $as_echo "$as_me:$LINENO: checking whether the shell understands some XSI constructs" >&5
-$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
-# Try some XSI features
-xsi_shell=no
-( _lt_dummy="a/b/c"
-  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
-      = c,a/b,, \
-    && eval 'test $(( 1 + 1 )) -eq 2 \
-    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
-  && xsi_shell=yes
-{ $as_echo "$as_me:$LINENO: result: $xsi_shell" >&5
-$as_echo "$xsi_shell" >&6; }
 
 
-{ $as_echo "$as_me:$LINENO: checking whether the shell understands \"+=\"" >&5
-$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
-lt_shell_append=no
-( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
-    >/dev/null 2>&1 \
-  && lt_shell_append=yes
-{ $as_echo "$as_me:$LINENO: result: $lt_shell_append" >&5
-$as_echo "$lt_shell_append" >&6; }
 
 
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
-  lt_unset=unset
-else
-  lt_unset=false
-fi
 
 
 
 
 
-# test EBCDIC or ASCII
-case `echo X|tr X '\101'` in
- A) # ASCII based system
-    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
-  lt_SP2NL='tr \040 \012'
-  lt_NL2SP='tr \015\012 \040\040'
-  ;;
- *) # EBCDIC based system
-  lt_SP2NL='tr \100 \n'
-  lt_NL2SP='tr \r\n \100\100'
-  ;;
-esac
 
 
 
@@ -46825,30 +45996,6 @@ esac
 
 
 
-{ $as_echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
-$as_echo_n "checking for $LD option to reload object files... " >&6; }
-if test "${lt_cv_ld_reload_flag+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  lt_cv_ld_reload_flag='-r'
-fi
-{ $as_echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
-$as_echo "$lt_cv_ld_reload_flag" >&6; }
-reload_flag=$lt_cv_ld_reload_flag
-case $reload_flag in
-"" | " "*) ;;
-*) reload_flag=" $reload_flag" ;;
-esac
-reload_cmds='$LD$reload_flag -o $output$reload_objs'
-case $host_os in
-  darwin*)
-    if test "$GCC" = yes; then
-      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
-    else
-      reload_cmds='$LD$reload_flag -o $output$reload_objs'
-    fi
-    ;;
-esac
 
 
 
 
 
 
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
 
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
 
-{ $as_echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5
-$as_echo_n "checking how to recognize dependent libraries... " >&6; }
-if test "${lt_cv_deplibs_check_method+set}" = set; then
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+{ $as_echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
+$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
+if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  lt_cv_file_magic_cmd='$MAGIC_CMD'
-lt_cv_file_magic_test_file=
-lt_cv_deplibs_check_method='unknown'
-# Need to set the preceding variable on all platforms that support
-# interlibrary dependencies.
-# 'none' -- dependencies not supported.
-# `unknown' -- same as none, but documents that we really don't know.
-# 'pass_all' -- all dependencies passed with no checks.
-# 'test_compile' -- check by making test program.
-# 'file_magic [[regex]]' -- check by looking for files in library path
-# which responds to the $file_magic_cmd with a given extended regex.
-# If you have `file' or equivalent on your system and you're not sure
-# whether `pass_all' will *always* work, you probably want this one.
-
-case $host_os in
-aix[4-9]*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
 
-beos*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
 
-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
-  ;;
+# Character class describing NM global symbol codes.
+symcode='[BCDEGRST]'
 
-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'
-  ;;
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
 
-mingw* | pw32*)
-  # Base MSYS/MinGW do not provide the 'file' command needed by
-  # func_win32_libid shell function, so use a weaker test based on 'objdump',
-  # unless we find 'file', for example because we are cross-compiling.
-  if ( file / ) >/dev/null 2>&1; then
-    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
-    lt_cv_file_magic_cmd='func_win32_libid'
-  else
-    lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
-    lt_cv_file_magic_cmd='$OBJDUMP -f'
-  fi
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[BCDT]'
   ;;
-
-darwin* | rhapsody*)
-  lt_cv_deplibs_check_method=pass_all
+cygwin* | mingw* | pw32*)
+  symcode='[ABCDGISTW]'
   ;;
-
-freebsd* | dragonfly*)
-  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
-    case $host_cpu in
-    i*86 )
-      # Not sure whether the presence of OpenBSD here was a mistake.
-      # Let's accept both of them until this is cleared up.
-      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
-      lt_cv_file_magic_cmd=/usr/bin/file
-      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
-      ;;
-    esac
-  else
-    lt_cv_deplibs_check_method=pass_all
+hpux*)
+  if test "$host_cpu" = ia64; then
+    symcode='[ABCDEGRST]'
   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
-  ;;
-
-interix[3-9]*)
-  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
-  lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
-  ;;
-
-irix5* | irix6* | nonstopux*)
-  case $LD in
-  *-32|*"-32 ") libmagic=32-bit;;
-  *-n32|*"-n32 ") libmagic=N32;;
-  *-64|*"-64 ") libmagic=64-bit;;
-  *) libmagic=never-match;;
-  esac
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-
-# This must be Linux ELF.
-linux* | k*bsd*-gnu)
-  lt_cv_deplibs_check_method=pass_all
+irix* | nonstopux*)
+  symcode='[BCDEGRST]'
   ;;
-
-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
+osf*)
+  symcode='[BCDEGQRST]'
   ;;
-
-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
+solaris*)
+  symcode='[BDRT]'
   ;;
-
-*nto* | *qnx*)
-  lt_cv_deplibs_check_method=pass_all
+sco3.2v5*)
+  symcode='[DT]'
   ;;
-
-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
+sysv4.2uw2*)
+  symcode='[DT]'
   ;;
-
-osf3* | osf4* | osf5*)
-  lt_cv_deplibs_check_method=pass_all
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+  symcode='[ABDT]'
   ;;
-
-rdos*)
-  lt_cv_deplibs_check_method=pass_all
+sysv4)
+  symcode='[DFNSTU]'
   ;;
+esac
 
-solaris*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[ABCDGIRSTW]' ;;
+esac
 
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
 
-sysv4 | sysv4.3*)
-  case $host_vendor in
-  motorola)
-    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
-    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
-    ;;
-  ncr)
-    lt_cv_deplibs_check_method=pass_all
-    ;;
-  sequent)
-    lt_cv_file_magic_cmd='/bin/file'
-    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
-    ;;
-  sni)
-    lt_cv_file_magic_cmd='/bin/file'
-    lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
-    lt_cv_file_magic_test_file=/lib/libc.so
-    ;;
-  siemens)
-    lt_cv_deplibs_check_method=pass_all
-    ;;
-  pc)
-    lt_cv_deplibs_check_method=pass_all
-    ;;
-  esac
-  ;;
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
 
-tpf*)
-  lt_cv_deplibs_check_method=pass_all
+# 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
 
-fi
-{ $as_echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
-$as_echo "$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
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
 
+  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+  symxfrm="\\1 $ac_symprfx\\2 \\2"
 
+  # Write the raw and C identifiers.
+  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+    # Fake it for dumpbin and say T for any non-static function
+    # and D for any global variable.
+    # Also find C++ and __fastcall symbols from MSVC++,
+    # which start with @ or ?.
+    lt_cv_sys_global_symbol_pipe="$AWK '"\
+"     {last_section=section; section=\$ 3};"\
+"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+"     \$ 0!~/External *\|/{next};"\
+"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+"     {if(hide[section]) next};"\
+"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
+"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+"     ' prfx=^$ac_symprfx"
+  else
+    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[     ]\($symcode$symcode*\)[         ][      ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+  fi
 
+  # Check to see that the pipe works correctly.
+  pipe_works=no
 
+  rm -f conftest*
+  cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
 
-
-
-
-
-
-
-
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ar; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_AR+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$AR"; then
-  ac_cv_prog_AR="$AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { 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"
-    $as_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
-  { $as_echo "$as_me:$LINENO: result: $AR" >&5
-$as_echo "$AR" >&6; }
-else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_AR"; then
-  ac_ct_AR=$AR
-  # Extract the first word of "ar", so it can be a program name with args.
-set dummy ar; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_AR"; then
-  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { 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"
-    $as_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_AR=$ac_cv_prog_ac_ct_AR
-if test -n "$ac_ct_AR"; then
-  { $as_echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
-$as_echo "$ac_ct_AR" >&6; }
-else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_AR" = x; then
-    AR="false"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    AR=$ac_ct_AR
-  fi
-else
-  AR="$ac_cv_prog_AR"
-fi
-
-test -z "$AR" && AR=ar
-test -z "$AR_FLAGS" && AR_FLAGS=cru
-
-
-
-
-
-
-
-
-
-
-
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_STRIP+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$STRIP"; then
-  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { 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"
-    $as_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
-  { $as_echo "$as_me:$LINENO: result: $STRIP" >&5
-$as_echo "$STRIP" >&6; }
-else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_STRIP"; then
-  ac_ct_STRIP=$STRIP
-  # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_STRIP"; then
-  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { 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"
-    $as_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_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
-  { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
-$as_echo "$ac_ct_STRIP" >&6; }
-else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_STRIP" = x; then
-    STRIP=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    STRIP=$ac_ct_STRIP
-  fi
-else
-  STRIP="$ac_cv_prog_STRIP"
-fi
-
-test -z "$STRIP" && STRIP=:
-
-
-
-
-
-
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_RANLIB+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$RANLIB"; then
-  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { 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"
-    $as_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
-  { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5
-$as_echo "$RANLIB" >&6; }
-else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-fi
-if test -z "$ac_cv_prog_RANLIB"; then
-  ac_ct_RANLIB=$RANLIB
-  # Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_RANLIB"; then
-  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if { 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"
-    $as_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_RANLIB=$ac_cv_prog_ac_ct_RANLIB
-if test -n "$ac_ct_RANLIB"; then
-  { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
-$as_echo "$ac_ct_RANLIB" >&6; }
-else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-  if test "x$ac_ct_RANLIB" = x; then
-    RANLIB=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    RANLIB=$ac_ct_RANLIB
-  fi
-else
-  RANLIB="$ac_cv_prog_RANLIB"
-fi
-
-test -z "$RANLIB" && RANLIB=:
-
-
-
-
-
-
-# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
-old_postinstall_cmds='chmod 644 $oldlib'
-old_postuninstall_cmds=
-
-if test -n "$RANLIB"; then
-  case $host_os in
-  openbsd*)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
-    ;;
-  *)
-    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
-    ;;
-  esac
-  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# If no C compiler flags were specified, use CFLAGS.
-LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-
-
-# Check for command to grab the raw symbol name followed by C symbol from nm.
-{ $as_echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
-$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
-if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-
-# These are sane defaults that work on at least a few old systems.
-# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
-
-# Character class describing NM global symbol codes.
-symcode='[BCDEGRST]'
-
-# Regexp to match symbols that can be accessed directly from C.
-sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
-
-# Define system-specific variables.
-case $host_os in
-aix*)
-  symcode='[BCDT]'
-  ;;
-cygwin* | mingw* | pw32*)
-  symcode='[ABCDGISTW]'
-  ;;
-hpux*)
-  if test "$host_cpu" = ia64; then
-    symcode='[ABCDEGRST]'
-  fi
-  ;;
-irix* | nonstopux*)
-  symcode='[BCDEGRST]'
-  ;;
-osf*)
-  symcode='[BCDEGQRST]'
-  ;;
-solaris*)
-  symcode='[BDRT]'
-  ;;
-sco3.2v5*)
-  symcode='[DT]'
-  ;;
-sysv4.2uw2*)
-  symcode='[DT]'
-  ;;
-sysv5* | sco5v6* | unixware* | OpenUNIX*)
-  symcode='[ABDT]'
-  ;;
-sysv4)
-  symcode='[DFNSTU]'
-  ;;
-esac
-
-# If we're using GNU nm, then use its standard symbol codes.
-case `$NM -V 2>&1` in
-*GNU* | *'with BFD'*)
-  symcode='[ABCDGIRSTW]' ;;
-esac
-
-# Transform an extracted symbol line into a proper C declaration.
-# Some systems (esp. on ia64) link data and code symbols differently,
-# so use this general approach.
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
-
-# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
-
-# Handle CRLF in mingw tool chain
-opt_cr=
-case $build_os in
-mingw*)
-  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
-  ;;
-esac
-
-# Try without a prefix underscore, then with it.
-for ac_symprfx in "" "_"; do
-
-  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
-  symxfrm="\\1 $ac_symprfx\\2 \\2"
-
-  # Write the raw and C identifiers.
-  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
-    # Fake it for dumpbin and say T for any non-static function
-    # and D for any global variable.
-    # Also find C++ and __fastcall symbols from MSVC++,
-    # which start with @ or ?.
-    lt_cv_sys_global_symbol_pipe="$AWK '"\
-"     {last_section=section; section=\$ 3};"\
-"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
-"     \$ 0!~/External *\|/{next};"\
-"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
-"     {if(hide[section]) next};"\
-"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
-"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
-"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
-"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
-"     ' prfx=^$ac_symprfx"
-  else
-    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[     ]\($symcode$symcode*\)[         ][      ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
-  fi
-
-  # Check to see that the pipe works correctly.
-  pipe_works=no
-
-  rm -f conftest*
-  cat > conftest.$ac_ext <<_LT_EOF
-#ifdef __cplusplus
-extern "C" {
-#endif
-char nm_test_var;
-void nm_test_func(void);
-void nm_test_func(void){}
-#ifdef __cplusplus
-}
-#endif
-int main(){nm_test_var='a';nm_test_func();return(0);}
-_LT_EOF
-
-  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  $as_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=$?
-  $as_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
+  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_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=$?
+  $as_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
@@ -47709,7 +46294,7 @@ ia64-*-hpux*)
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 47712 "configure"' > conftest.$ac_ext
+  echo '#line 46297 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -49078,11 +47663,11 @@ else
    -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:49081: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:47666: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:49085: \$? = $ac_status" >&5
+   echo "$as_me:47670: \$? = $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.
@@ -49402,11 +47987,11 @@ else
    -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:49405: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:47990: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:49409: \$? = $ac_status" >&5
+   echo "$as_me:47994: \$? = $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.
@@ -49507,11 +48092,11 @@ else
    -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:49510: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:48095: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:49514: \$? = $ac_status" >&5
+   echo "$as_me:48099: \$? = $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
@@ -49562,11 +48147,11 @@ else
    -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:49565: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:48150: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:49569: \$? = $ac_status" >&5
+   echo "$as_me:48154: \$? = $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
@@ -51367,24 +49952,2660 @@ _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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then
+  shlibpath_overrides_runpath=yes
+fi
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+  LDFLAGS=$save_LDFLAGS
+  libdir=$save_libdir
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # Append ld.so.conf contents to the search path
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[      ]*hwcap[        ]/d;s/[:,      ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/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'
+  ;;
+
+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=qnx
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='ldqnx.so'
+  ;;
+
+openbsd*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
+  need_lib_prefix=no
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+    *)                         need_version=no  ;;
+  esac
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[89] | openbsd2.[89].*)
+       shlibpath_overrides_runpath=no
+       ;;
+      *)
+       shlibpath_overrides_runpath=yes
+       ;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
+
+os2*)
+  libname_spec='$name'
+  shrext_cmds=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
+
+rdos*)
+  dynamic_linker=no
+  ;;
+
+solaris*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+       ;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
+tpf*)
+  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_name_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+uts4*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+{ $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  { $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" ||
+   test -n "$runpath_var" ||
+   test "X$hardcode_automatic" = "Xyes" ; then
+
+  # We can hardcode non-existent directories.
+  if test "$hardcode_direct" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
+     test "$hardcode_minus_L" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action=unsupported
+fi
+{ $as_echo "$as_me:$LINENO: result: $hardcode_action" >&5
+$as_echo "$hardcode_action" >&6; }
+
+if test "$hardcode_action" = relink ||
+   test "$inherit_rpath" = yes; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+
+
+
+
+
+
+  if test "x$enable_dlopen" != xyes; then
+  enable_dlopen=unknown
+  enable_dlopen_self=unknown
+  enable_dlopen_self_static=unknown
+else
+  lt_cv_dlopen=no
+  lt_cv_dlopen_libs=
+
+  case $host_os in
+  beos*)
+    lt_cv_dlopen="load_add_on"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ;;
+
+  mingw* | pw32*)
+    lt_cv_dlopen="LoadLibrary"
+    lt_cv_dlopen_libs=
+    ;;
+
+  cygwin*)
+    lt_cv_dlopen="dlopen"
+    lt_cv_dlopen_libs=
+    ;;
+
+  darwin*)
+  # if libdl is installed we need to link against it
+    { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  $as_echo_n "(cached) " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_dl_dlopen=no
+fi
+
+rm -rf conftest.dSYM
+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
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = x""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
+
+    ;;
+
+  *)
+    { $as_echo "$as_me:$LINENO: checking for shl_load" >&5
+$as_echo_n "checking for shl_load... " >&6; }
+if test "${ac_cv_func_shl_load+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_func_shl_load=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_func_shl_load=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+$as_echo "$ac_cv_func_shl_load" >&6; }
+if test "x$ac_cv_func_shl_load" = x""yes; then
+  lt_cv_dlopen="shl_load"
+else
+  { $as_echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+$as_echo_n "checking for shl_load in -ldld... " >&6; }
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+  $as_echo_n "(cached) " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_dld_shl_load=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_dld_shl_load=no
+fi
+
+rm -rf conftest.dSYM
+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
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
+if test "x$ac_cv_lib_dld_shl_load" = x""yes; then
+  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
+else
+  { $as_echo "$as_me:$LINENO: checking for dlopen" >&5
+$as_echo_n "checking for dlopen... " >&6; }
+if test "${ac_cv_func_dlopen+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_func_dlopen=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_func_dlopen=no
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+$as_echo "$ac_cv_func_dlopen" >&6; }
+if test "x$ac_cv_func_dlopen" = x""yes; then
+  lt_cv_dlopen="dlopen"
+else
+  { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+  $as_echo_n "(cached) " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_dl_dlopen=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_dl_dlopen=no
+fi
+
+rm -rf conftest.dSYM
+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
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = x""yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  { $as_echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+$as_echo_n "checking for dlopen in -lsvld... " >&6; }
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then
+  $as_echo_n "(cached) " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_svld_dlopen=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_svld_dlopen=no
+fi
+
+rm -rf conftest.dSYM
+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
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
+if test "x$ac_cv_lib_svld_dlopen" = x""yes; then
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+  { $as_echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+$as_echo_n "checking for dld_link in -ldld... " >&6; }
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then
+  $as_echo_n "(cached) " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_dld_dld_link=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_dld_dld_link=no
+fi
+
+rm -rf conftest.dSYM
+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
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
+if test "x$ac_cv_lib_dld_dld_link" = x""yes; then
+  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+    ;;
+  esac
+
+  if test "x$lt_cv_dlopen" != xno; then
+    enable_dlopen=yes
+  else
+    enable_dlopen=no
+  fi
+
+  case $lt_cv_dlopen in
+  dlopen)
+    save_CPPFLAGS="$CPPFLAGS"
+    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+    save_LDFLAGS="$LDFLAGS"
+    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    { $as_echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+$as_echo_n "checking whether a program can dlopen itself... " >&6; }
+if test "${lt_cv_dlopen_self+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+         if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<_LT_EOF
+#line 50955 "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); */
+    }
+  else
+    puts (dlerror ());
+
+    exit (status);
+}
+_LT_EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  $as_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_dlunknown|x*) lt_cv_dlopen_self=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+$as_echo "$lt_cv_dlopen_self" >&6; }
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+      { $as_echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+         if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self_static=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<_LT_EOF
+#line 51055 "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); */
+    }
+  else
+    puts (dlerror ());
+
+    exit (status);
+}
+_LT_EOF
+  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  $as_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_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self_static=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+$as_echo "$lt_cv_dlopen_self_static" >&6; }
+    fi
+
+    CPPFLAGS="$save_CPPFLAGS"
+    LDFLAGS="$save_LDFLAGS"
+    LIBS="$save_LIBS"
+    ;;
+  esac
+
+  case $lt_cv_dlopen_self in
+  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+  *) enable_dlopen_self=unknown ;;
+  esac
+
+  case $lt_cv_dlopen_self_static in
+  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+  *) enable_dlopen_self_static=unknown ;;
+  esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+striplib=
+old_striplib=
+{ $as_echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+$as_echo_n "checking whether stripping libraries is possible... " >&6; }
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+  case $host_os in
+  darwin*)
+    if test -n "$STRIP" ; then
+      striplib="$STRIP -x"
+      old_striplib="$STRIP -S"
+      { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+    else
+      { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+    fi
+    ;;
+  *)
+    { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+    ;;
+  esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+  # Report which library types will actually be built
+  { $as_echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
+$as_echo_n "checking if libtool supports shared libraries... " >&6; }
+  { $as_echo "$as_me:$LINENO: result: $can_build_shared" >&5
+$as_echo "$can_build_shared" >&6; }
+
+  { $as_echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+$as_echo_n "checking whether to build shared libraries... " >&6; }
+  test "$can_build_shared" = "no" && enable_shared=no
+
+  # On AIX, shared libraries and static libraries use the same namespace, and
+  # are all built from PIC.
+  case $host_os in
+  aix3*)
+    test "$enable_shared" = yes && enable_static=no
+    if test -n "$RANLIB"; then
+      archive_cmds="$archive_cmds~\$RANLIB \$lib"
+      postinstall_cmds='$RANLIB $lib'
+    fi
+    ;;
+
+  aix[4-9]*)
+    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+      test "$enable_shared" = yes && enable_static=no
+    fi
+    ;;
+  esac
+  { $as_echo "$as_me:$LINENO: result: $enable_shared" >&5
+$as_echo "$enable_shared" >&6; }
+
+  { $as_echo "$as_me:$LINENO: checking whether to build static libraries" >&5
+$as_echo_n "checking whether to build static libraries... " >&6; }
+  # Make sure either enable_shared or enable_static is yes.
+  test "$enable_shared" = yes || enable_static=yes
+  { $as_echo "$as_me:$LINENO: result: $enable_static" >&5
+$as_echo "$enable_static" >&6; }
+
+
+
+
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+
+
+
+
+
+
+
+
+
+
+
+
+        ac_config_commands="$ac_config_commands libtool"
+
+
+
+
+# Only expand once:
+
+
+
+
+    # Check whether --enable-static-binary was given.
+if test "${enable_static_binary+set}" = set; then
+  enableval=$enable_static_binary;
+           case "$enableval" in
+           "" | y | ye | yes)
+               AMANDA_STATIC_LDFLAGS=-static
+               if test x"$enable_static" = x"no"; then
+                       { { $as_echo "$as_me:$LINENO: error: *** --enable-static-binary is incompatible with --disable-static" >&5
+$as_echo "$as_me: error: *** --enable-static-binary is incompatible with --disable-static" >&2;}
+   { (exit 1); exit 1; }; }
+               fi
+               ;;
+           *n | no)
+               AMANDA_STATIC_LDFLAGS=
+               ;;
+           esac
+
+fi
+
+
+
+
+#
+# headers
+#
+
+
+
+
+
+ac_header_dirent=no
+for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
+  as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5
+$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+#include <$ac_hdr>
+
+int
+main ()
+{
+if ((DIR *) 0)
+return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  eval "$as_ac_Header=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_ac_Header=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
+_ACEOF
+
+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
+  { $as_echo "$as_me:$LINENO: checking for library containing opendir" >&5
+$as_echo_n "checking for library containing opendir... " >&6; }
+if test "${ac_cv_search_opendir+set}" = set; then
+  $as_echo_n "(cached) " >&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 opendir ();
+int
+main ()
+{
+return opendir ();
+  ;
+  return 0;
+}
+_ACEOF
+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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_search_opendir=$ac_res
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+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
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
+$as_echo "$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
+  { $as_echo "$as_me:$LINENO: checking for library containing opendir" >&5
+$as_echo_n "checking for library containing opendir... " >&6; }
+if test "${ac_cv_search_opendir+set}" = set; then
+  $as_echo_n "(cached) " >&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 opendir ();
+int
+main ()
+{
+return opendir ();
+  ;
+  return 0;
+}
+_ACEOF
+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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_search_opendir=$ac_res
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -rf conftest.dSYM
+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
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
+$as_echo "$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
+
+fi
+
+{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if test "${ac_cv_header_stdc+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_header_stdc=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_header_stdc=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat >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
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat >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
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then
+  :
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+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))
+#else
+# define ISLOWER(c) \
+                  (('a' <= (c) && (c) <= 'i') \
+                    || ('j' <= (c) && (c) <= 'r') \
+                    || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+       || toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+{ $as_echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5
+$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; }
+if test "${ac_cv_header_time+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+#include <sys/time.h>
+#include <time.h>
+
+int
+main ()
+{
+if ((struct tm *) 0)
+return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_header_time=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_header_time=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5
+$as_echo "$ac_cv_header_time" >&6; }
+if test $ac_cv_header_time = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define TIME_WITH_SYS_TIME 1
+_ACEOF
+
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+for ac_header in grp.h \
+       libc.h \
+       libgen.h \
+       limits.h \
+       math.h \
+       netinet/in.h \
+       regex.h \
+       stdarg.h \
+       stdlib.h \
+       strings.h \
+       rpc/rpc.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 \
+       time.h \
+       unistd.h \
+
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  $as_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
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$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
+  $as_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
+  $as_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
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+
+fi
+as_val=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_AMANDA_H 1
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_UTIL_H 1
+_ACEOF
+
+
+
+cat >>confdefs.h <<\_ACEOF
+#define USE_GETTEXT 1
+_ACEOF
+
+
+#
+# Types
+#
+# 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.
+{ $as_echo "$as_me:$LINENO: checking size of int" >&5
+$as_echo_n "checking size of int... " >&6; }
+if test "${ac_cv_sizeof_int+set}" = set; then
+  $as_echo_n "(cached) " >&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
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (int))) >= 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_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 int) (sizeof (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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=$ac_mid; break
+else
+  $as_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
+  $as_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 int) (sizeof (int))) < 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_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 int) (sizeof (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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_lo=$ac_mid; break
+else
+  $as_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
+  $as_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.  */
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=$ac_mid
+else
+  $as_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
+?*) ac_cv_sizeof_int=$ac_lo;;
+'') if test "$ac_cv_type_int" = yes; then
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (int)
+See \`config.log' for more details." >&5
+$as_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
+  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
+static long int longval () { return (long int) (sizeof (int)); }
+static unsigned long int ulongval () { return (long int) (sizeof (int)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+  FILE *f = fopen ("conftest.val", "w");
+  if (! f)
+    return 1;
+  if (((long int) (sizeof (int))) < 0)
+    {
+      long int i = longval ();
+      if (i != ((long int) (sizeof (int))))
+       return 1;
+      fprintf (f, "%ld", i);
+    }
+  else
+    {
+      unsigned long int i = ulongval ();
+      if (i != ((long int) (sizeof (int))))
+       return 1;
+      fprintf (f, "%lu", i);
+    }
+  /* Do not output a trailing newline, as this causes \r\n confusion
+     on some platforms.  */
+  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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_sizeof_int=`cat conftest.val`
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+if test "$ac_cv_type_int" = yes; then
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (int)
+See \`config.log' for more details." >&5
+$as_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 -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.val
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5
+$as_echo "$ac_cv_sizeof_int" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_INT $ac_cv_sizeof_int
+_ACEOF
+
+
+# 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.
+{ $as_echo "$as_me:$LINENO: checking size of long" >&5
+$as_echo_n "checking size of long... " >&6; }
+if test "${ac_cv_sizeof_long+set}" = set; then
+  $as_echo_n "(cached) " >&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
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (long))) >= 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_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 int) (sizeof (long))) <= $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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=$ac_mid; break
+else
+  $as_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
+  $as_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 int) (sizeof (long))) < 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_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 int) (sizeof (long))) >= $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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_lo=$ac_mid; break
+else
+  $as_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
+  $as_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.  */
+$ac_includes_default
 int
 main ()
 {
+static int test_array [1 - 2 * !(((long int) (sizeof (long))) <= $ac_mid)];
+test_array [0] = 0
 
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -51393,445 +52614,202 @@ $as_echo "$ac_try_echo") >&5
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then
-  shlibpath_overrides_runpath=yes
-fi
-
+       } && test -s conftest.$ac_objext; then
+  ac_hi=$ac_mid
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-
+       ac_lo=`expr '(' $ac_mid ')' + 1`
 fi
 
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-  LDFLAGS=$save_LDFLAGS
-  libdir=$save_libdir
-
-  # This implies no fast_install, which is unacceptable.
-  # Some rework will be needed to allow for fast_install
-  # before this can be enabled.
-  hardcode_into_libs=yes
-
-  # Append ld.so.conf contents to the search path
-  if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[      ]*hwcap[        ]/d;s/[:,      ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/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'
-  ;;
-
-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=qnx
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='ldqnx.so'
-  ;;
-
-openbsd*)
-  version_type=sunos
-  sys_lib_dlsearch_path_spec="/usr/lib"
-  need_lib_prefix=no
-  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
-  case $host_os in
-    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
-    *)                         need_version=no  ;;
-  esac
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    case $host_os in
-      openbsd2.[89] | openbsd2.[89].*)
-       shlibpath_overrides_runpath=no
-       ;;
-      *)
-       shlibpath_overrides_runpath=yes
-       ;;
-      esac
-  else
-    shlibpath_overrides_runpath=yes
-  fi
-  ;;
-
-os2*)
-  libname_spec='$name'
-  shrext_cmds=".dll"
-  need_lib_prefix=no
-  library_names_spec='$libname${shared_ext} $libname.a'
-  dynamic_linker='OS/2 ld.exe'
-  shlibpath_var=LIBPATH
-  ;;
-
-osf3* | osf4* | osf5*)
-  version_type=osf
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
-  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
-  ;;
-
-rdos*)
-  dynamic_linker=no
-  ;;
-
-solaris*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  # ldd complains unless libraries are executable
-  postinstall_cmds='chmod +x $lib'
-  ;;
-
-sunos4*)
-  version_type=sunos
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  if test "$with_gnu_ld" = yes; then
-    need_lib_prefix=no
-  fi
-  need_version=yes
-  ;;
-
-sysv4 | sysv4.3*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_vendor in
-    sni)
-      shlibpath_overrides_runpath=no
-      need_lib_prefix=no
-      runpath_var=LD_RUN_PATH
-      ;;
-    siemens)
-      need_lib_prefix=no
-      ;;
-    motorola)
-      need_lib_prefix=no
-      need_version=no
-      shlibpath_overrides_runpath=no
-      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
-      ;;
-  esac
-  ;;
-
-sysv4*MP*)
-  if test -d /usr/nec ;then
-    version_type=linux
-    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
-  ;;
+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
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long)
+See \`config.log' for more details." >&5
+$as_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
+  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
+static long int longval () { return (long int) (sizeof (long)); }
+static unsigned long int ulongval () { return (long int) (sizeof (long)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
 
-sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
-  version_type=freebsd-elf
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
-  hardcode_into_libs=yes
-  if test "$with_gnu_ld" = yes; then
-    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+  FILE *f = fopen ("conftest.val", "w");
+  if (! f)
+    return 1;
+  if (((long int) (sizeof (long))) < 0)
+    {
+      long int i = longval ();
+      if (i != ((long int) (sizeof (long))))
+       return 1;
+      fprintf (f, "%ld", i);
+    }
   else
-    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
-    case $host_os in
-      sco3.2v5*)
-        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
-       ;;
-    esac
-  fi
-  sys_lib_dlsearch_path_spec='/usr/lib'
-  ;;
-
-tpf*)
-  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_name_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  ;;
-
-uts4*)
-  version_type=linux
-  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
-  ;;
+    {
+      unsigned long int i = ulongval ();
+      if (i != ((long int) (sizeof (long))))
+       return 1;
+      fprintf (f, "%lu", i);
+    }
+  /* Do not output a trailing newline, as this causes \r\n confusion
+     on some platforms.  */
+  return ferror (f) || fclose (f) != 0;
 
-*)
-  dynamic_linker=no
-  ;;
+  ;
+  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
-{ $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5
-$as_echo "$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
-  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_sizeof_long=`cat conftest.val`
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
-  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
-fi
-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
-  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+( exit $ac_status )
+if test "$ac_cv_type_long" = yes; then
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long)
+See \`config.log' for more details." >&5
+$as_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
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-  { $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
-$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
-hardcode_action=
-if test -n "$hardcode_libdir_flag_spec" ||
-   test -n "$runpath_var" ||
-   test "X$hardcode_automatic" = "Xyes" ; then
-
-  # We can hardcode non-existent directories.
-  if test "$hardcode_direct" != no &&
-     # If the only mechanism to avoid hardcoding is shlibpath_var, we
-     # have to relink, otherwise we might link with an installed library
-     # when we should be linking with a yet-to-be-installed one
-     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
-     test "$hardcode_minus_L" != no; then
-    # Linking always hardcodes the temporary library directory.
-    hardcode_action=relink
-  else
-    # We can link without hardcoding, and we can hardcode nonexisting dirs.
-    hardcode_action=immediate
-  fi
-else
-  # We cannot hardcode anything, or else we can only hardcode existing
-  # directories.
-  hardcode_action=unsupported
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $hardcode_action" >&5
-$as_echo "$hardcode_action" >&6; }
-
-if test "$hardcode_action" = relink ||
-   test "$inherit_rpath" = yes; then
-  # Fast installation is not supported
-  enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
-     test "$enable_shared" = no; then
-  # Fast installation is not necessary
-  enable_fast_install=needless
+rm -f conftest.val
 fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5
+$as_echo "$ac_cv_sizeof_long" >&6; }
 
 
 
-
-
-
-  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
-    { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-$as_echo_n "checking for dlopen in -ldl... " >&6; }
-if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_LONG $ac_cv_sizeof_long
+_ACEOF
+
+
+# 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.
+{ $as_echo "$as_me:$LINENO: checking size of long long" >&5
+$as_echo_n "checking size of long long... " >&6; }
+if test "${ac_cv_sizeof_long_long+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl  $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
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (long long))) >= 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 dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_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 ()
 {
-return dlopen ();
+static int test_array [1 - 2 * !(((long int) (sizeof (long long))) <= $ac_mid)];
+test_array [0] = 0
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -51840,97 +52818,89 @@ $as_echo "$ac_try_echo") >&5
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_lib_dl_dlopen=yes
+       } && test -s conftest.$ac_objext; then
+  ac_hi=$ac_mid; break
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_lib_dl_dlopen=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 -rf conftest.dSYM
-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
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
-if test "x$ac_cv_lib_dl_dlopen" = x""yes; then
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
 else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-    lt_cv_dlopen="dyld"
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=yes
-
-fi
-
-    ;;
-
-  *)
-    { $as_echo "$as_me:$LINENO: checking for shl_load" >&5
-$as_echo_n "checking for shl_load... " >&6; }
-if test "${ac_cv_func_shl_load+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
+       cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* 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
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (long long))) < 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_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 ()
 {
-return shl_load ();
+static int test_array [1 - 2 * !(((long int) (sizeof (long long))) >= $ac_mid)];
+test_array [0] = 0
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -51939,65 +52909,62 @@ $as_echo "$ac_try_echo") >&5
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_func_shl_load=yes
+       } && test -s conftest.$ac_objext; then
+  ac_lo=$ac_mid; break
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_func_shl_load=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 -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
-$as_echo "$ac_cv_func_shl_load" >&6; }
-if test "x$ac_cv_func_shl_load" = x""yes; then
-  lt_cv_dlopen="shl_load"
-else
-  { $as_echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
-$as_echo_n "checking for shl_load in -ldld... " >&6; }
-if test "${ac_cv_lib_dld_shl_load+set}" = set; then
-  $as_echo_n "(cached) " >&6
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+  $as_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.  */
-
-/* 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 ();
+$ac_includes_default
 int
 main ()
 {
-return shl_load ();
+static int test_array [1 - 2 * !(((long int) (sizeof (long long))) <= $ac_mid)];
+test_array [0] = 0
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -52006,32 +52973,31 @@ $as_echo "$ac_try_echo") >&5
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_lib_dld_shl_load=yes
+       } && test -s conftest.$ac_objext; then
+  ac_hi=$ac_mid
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_lib_dld_shl_load=no
+       ac_lo=`expr '(' $ac_mid ')' + 1`
 fi
 
-rm -rf conftest.dSYM
-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
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
-$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
-if test "x$ac_cv_lib_dld_shl_load" = x""yes; then
-  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
-else
-  { $as_echo "$as_me:$LINENO: checking for dlopen" >&5
-$as_echo_n "checking for dlopen... " >&6; }
-if test "${ac_cv_func_dlopen+set}" = set; then
-  $as_echo_n "(cached) " >&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
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long long)
+See \`config.log' for more details." >&5
+$as_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
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -52039,46 +53005,41 @@ _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
-
+$ac_includes_default
+static long int longval () { return (long int) (sizeof (long long)); }
+static unsigned long int ulongval () { return (long int) (sizeof (long long)); }
+#include <stdio.h>
+#include <stdlib.h>
 int
 main ()
 {
-return dlopen ();
+
+  FILE *f = fopen ("conftest.val", "w");
+  if (! f)
+    return 1;
+  if (((long int) (sizeof (long long))) < 0)
+    {
+      long int i = longval ();
+      if (i != ((long int) (sizeof (long long))))
+       return 1;
+      fprintf (f, "%ld", i);
+    }
+  else
+    {
+      unsigned long int i = ulongval ();
+      if (i != ((long int) (sizeof (long long))))
+       return 1;
+      fprintf (f, "%lu", i);
+    }
+  /* Do not output a trailing newline, as this causes \r\n confusion
+     on some platforms.  */
+  return ferror (f) || fclose (f) != 0;
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
+rm -f conftest$ac_exeext
 if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
@@ -52086,74 +53047,128 @@ case "(($ac_try" in
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
+  (eval "$ac_link") 2>&5
   ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_func_dlopen=yes
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_sizeof_long_long=`cat conftest.val`
 else
-  $as_echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_func_dlopen=no
+( exit $ac_status )
+if test "$ac_cv_type_long_long" = yes; then
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long long)
+See \`config.log' for more details." >&5
+$as_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
-
 rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      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
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
-$as_echo "$ac_cv_func_dlopen" >&6; }
-if test "x$ac_cv_func_dlopen" = x""yes; then
-  lt_cv_dlopen="dlopen"
-else
-  { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
-$as_echo_n "checking for dlopen in -ldl... " >&6; }
-if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+rm -f conftest.val
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5
+$as_echo "$ac_cv_sizeof_long_long" >&6; }
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
+_ACEOF
+
+
+# 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.
+{ $as_echo "$as_me:$LINENO: checking size of intmax_t" >&5
+$as_echo_n "checking size of intmax_t... " >&6; }
+if test "${ac_cv_sizeof_intmax_t+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldl  $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
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (intmax_t))) >= 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 dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_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 ()
 {
-return dlopen ();
+static int test_array [1 - 2 * !(((long int) (sizeof (intmax_t))) <= $ac_mid)];
+test_array [0] = 0
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -52162,66 +53177,52 @@ $as_echo "$ac_try_echo") >&5
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_lib_dl_dlopen=yes
+       } && test -s conftest.$ac_objext; then
+  ac_hi=$ac_mid; break
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_lib_dl_dlopen=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 -rf conftest.dSYM
-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
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
-$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
-if test "x$ac_cv_lib_dl_dlopen" = x""yes; then
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
-else
-  { $as_echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
-$as_echo_n "checking for dlopen in -lsvld... " >&6; }
-if test "${ac_cv_lib_svld_dlopen+set}" = set; then
-  $as_echo_n "(cached) " >&6
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsvld  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+  $as_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.  */
-
-/* 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 ();
+$ac_includes_default
 int
 main ()
 {
-return dlopen ();
+static int test_array [1 - 2 * !(((long int) (sizeof (intmax_t))) < 0)];
+test_array [0] = 0
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -52230,66 +53231,35 @@ $as_echo "$ac_try_echo") >&5
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_lib_svld_dlopen=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_cv_lib_svld_dlopen=no
-fi
-
-rm -rf conftest.dSYM
-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
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
-$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
-if test "x$ac_cv_lib_svld_dlopen" = x""yes; then
-  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
-else
-  { $as_echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
-$as_echo_n "checking for dld_link in -ldld... " >&6; }
-if test "${ac_cv_lib_dld_dld_link+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldld  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+       } && 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 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 ();
+$ac_includes_default
 int
 main ()
 {
-return dld_link ();
+static int test_array [1 - 2 * !(((long int) (sizeof (intmax_t))) >= $ac_mid)];
+test_array [0] = 0
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -52298,460 +53268,253 @@ $as_echo "$ac_try_echo") >&5
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_lib_dld_dld_link=yes
+       } && test -s conftest.$ac_objext; then
+  ac_lo=$ac_mid; break
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_lib_dld_dld_link=no
-fi
-
-rm -rf conftest.dSYM
-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
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
-$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
-if test "x$ac_cv_lib_dld_dld_link" = x""yes; then
-  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
-
-fi
-
-
+       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
 
-    ;;
-  esac
-
-  if test "x$lt_cv_dlopen" != xno; then
-    enable_dlopen=yes
-  else
-    enable_dlopen=no
-  fi
-
-  case $lt_cv_dlopen in
-  dlopen)
-    save_CPPFLAGS="$CPPFLAGS"
-    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
-
-    save_LDFLAGS="$LDFLAGS"
-    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
-
-    save_LIBS="$LIBS"
-    LIBS="$lt_cv_dlopen_libs $LIBS"
-
-    { $as_echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
-$as_echo_n "checking whether a program can dlopen itself... " >&6; }
-if test "${lt_cv_dlopen_self+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-         if test "$cross_compiling" = yes; then :
-  lt_cv_dlopen_self=cross
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
 else
-  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
-  lt_status=$lt_dlunknown
-  cat > conftest.$ac_ext <<_LT_EOF
-#line 52370 "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); */
-    }
-  else
-    puts (dlerror ());
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-    exit (status);
-}
-_LT_EOF
-  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  $as_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_dlunknown|x*) lt_cv_dlopen_self=no ;;
-    esac
-  else :
-    # compilation failed
-    lt_cv_dlopen_self=no
-  fi
+       ac_lo= ac_hi=
 fi
-rm -fr conftest*
-
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
-$as_echo "$lt_cv_dlopen_self" >&6; }
-
-    if test "x$lt_cv_dlopen_self" = xyes; then
-      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
-      { $as_echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
-$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
-if test "${lt_cv_dlopen_self_static+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-         if test "$cross_compiling" = yes; then :
-  lt_cv_dlopen_self_static=cross
-else
-  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
-  lt_status=$lt_dlunknown
-  cat > conftest.$ac_ext <<_LT_EOF
-#line 52470 "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 ()
+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
+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); */
-    }
-  else
-    puts (dlerror ());
+static int test_array [1 - 2 * !(((long int) (sizeof (intmax_t))) <= $ac_mid)];
+test_array [0] = 0
 
-    exit (status);
+  ;
+  return 0;
 }
-_LT_EOF
-  if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  $as_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_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
-    esac
-  else :
-    # compilation failed
-    lt_cv_dlopen_self_static=no
-  fi
-fi
-rm -fr conftest*
-
-
-fi
-{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
-$as_echo "$lt_cv_dlopen_self_static" >&6; }
-    fi
-
-    CPPFLAGS="$save_CPPFLAGS"
-    LDFLAGS="$save_LDFLAGS"
-    LIBS="$save_LIBS"
-    ;;
-  esac
-
-  case $lt_cv_dlopen_self in
-  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
-  *) enable_dlopen_self=unknown ;;
-  esac
-
-  case $lt_cv_dlopen_self_static in
-  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
-  *) enable_dlopen_self_static=unknown ;;
-  esac
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-striplib=
-old_striplib=
-{ $as_echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
-$as_echo_n "checking whether stripping libraries is possible... " >&6; }
-if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
-  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
-  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
-  { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
-else
-# FIXME - insert some real tests, host_os isn't really good enough
-  case $host_os in
-  darwin*)
-    if test -n "$STRIP" ; then
-      striplib="$STRIP -x"
-      old_striplib="$STRIP -S"
-      { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
-    else
-      { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-    fi
-    ;;
-  *)
-    { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-    ;;
-  esac
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-  # Report which library types will actually be built
-  { $as_echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
-$as_echo_n "checking if libtool supports shared libraries... " >&6; }
-  { $as_echo "$as_me:$LINENO: result: $can_build_shared" >&5
-$as_echo "$can_build_shared" >&6; }
-
-  { $as_echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
-$as_echo_n "checking whether to build shared libraries... " >&6; }
-  test "$can_build_shared" = "no" && enable_shared=no
-
-  # On AIX, shared libraries and static libraries use the same namespace, and
-  # are all built from PIC.
-  case $host_os in
-  aix3*)
-    test "$enable_shared" = yes && enable_static=no
-    if test -n "$RANLIB"; then
-      archive_cmds="$archive_cmds~\$RANLIB \$lib"
-      postinstall_cmds='$RANLIB $lib'
-    fi
-    ;;
-
-  aix[4-9]*)
-    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-      test "$enable_shared" = yes && enable_static=no
-    fi
-    ;;
-  esac
-  { $as_echo "$as_me:$LINENO: result: $enable_shared" >&5
-$as_echo "$enable_shared" >&6; }
-
-  { $as_echo "$as_me:$LINENO: checking whether to build static libraries" >&5
-$as_echo_n "checking whether to build static libraries... " >&6; }
-  # Make sure either enable_shared or enable_static is yes.
-  test "$enable_shared" = yes || enable_static=yes
-  { $as_echo "$as_me:$LINENO: result: $enable_static" >&5
-$as_echo "$enable_static" >&6; }
-
-
-
-
-fi
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-CC="$lt_save_CC"
-
-
-
-
-
-
-
-
-
-
-
-
-
-        ac_config_commands="$ac_config_commands libtool"
-
-
-
-
-# Only expand once:
-
-
-
-
-    # Check whether --enable-static-binary was given.
-if test "${enable_static_binary+set}" = set; then
-  enableval=$enable_static_binary;
-           case "$enableval" in
-           "" | y | ye | yes)
-               AMANDA_STATIC_LDFLAGS=-static
-               if test x"$enable_static" = x"no"; then
-                       { { $as_echo "$as_me:$LINENO: error: *** --enable-static-binary is incompatible with --disable-static" >&5
-$as_echo "$as_me: error: *** --enable-static-binary is incompatible with --disable-static" >&2;}
-   { (exit 1); exit 1; }; }
-               fi
-               ;;
-           *n | no)
-               AMANDA_STATIC_LDFLAGS=
-               ;;
-           esac
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=$ac_mid
+else
+  $as_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
+?*) ac_cv_sizeof_intmax_t=$ac_lo;;
+'') if test "$ac_cv_type_intmax_t" = yes; then
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (intmax_t)
+See \`config.log' for more details." >&5
+$as_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.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+static long int longval () { return (long int) (sizeof (intmax_t)); }
+static unsigned long int ulongval () { return (long int) (sizeof (intmax_t)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
 
+  FILE *f = fopen ("conftest.val", "w");
+  if (! f)
+    return 1;
+  if (((long int) (sizeof (intmax_t))) < 0)
+    {
+      long int i = longval ();
+      if (i != ((long int) (sizeof (intmax_t))))
+       return 1;
+      fprintf (f, "%ld", i);
+    }
+  else
+    {
+      unsigned long int i = ulongval ();
+      if (i != ((long int) (sizeof (intmax_t))))
+       return 1;
+      fprintf (f, "%lu", i);
+    }
+  /* Do not output a trailing newline, as this causes \r\n confusion
+     on some platforms.  */
+  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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_sizeof_intmax_t=`cat conftest.val`
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-#
-# headers
-#
+( exit $ac_status )
+if test "$ac_cv_type_intmax_t" = yes; then
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (intmax_t)
+See \`config.log' for more details." >&5
+$as_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 -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.val
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_intmax_t" >&5
+$as_echo "$ac_cv_sizeof_intmax_t" >&6; }
 
 
 
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_INTMAX_T $ac_cv_sizeof_intmax_t
+_ACEOF
 
 
-ac_header_dirent=no
-for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
-  as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5
-$as_echo_n "checking for $ac_hdr that defines DIR... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+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.
+{ $as_echo "$as_me:$LINENO: checking size of off_t" >&5
+$as_echo_n "checking size of off_t... " >&6; }
+if test "${ac_cv_sizeof_off_t+set}" = set; then
   $as_echo_n "(cached) " >&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.  */
-#include <sys/types.h>
-#include <$ac_hdr>
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (off_t))) >= 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_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 ()
 {
-if ((DIR *) 0)
-return 0;
+static int test_array [1 - 2 * !(((long int) (sizeof (off_t))) <= $ac_mid)];
+test_array [0] = 0
+
   ;
   return 0;
 }
@@ -52774,77 +53537,88 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  eval "$as_ac_Header=yes"
+  ac_hi=$ac_mid; break
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       eval "$as_ac_Header=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 core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-as_val=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
-_ACEOF
-
-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
-  { $as_echo "$as_me:$LINENO: checking for library containing opendir" >&5
-$as_echo_n "checking for library containing opendir... " >&6; }
-if test "${ac_cv_search_opendir+set}" = set; then
-  $as_echo_n "(cached) " >&6
+  done
 else
-  ac_func_search_save_LIBS=$LIBS
-cat >conftest.$ac_ext <<_ACEOF
+  $as_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 int) (sizeof (off_t))) < 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 opendir ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_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 ()
 {
-return opendir ();
+static int test_array [1 - 2 * !(((long int) (sizeof (off_t))) >= $ac_mid)];
+test_array [0] = 0
+
   ;
   return 0;
 }
 _ACEOF
-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"
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -52853,86 +53627,62 @@ $as_echo "$ac_try_echo") >&5
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_search_opendir=$ac_res
+       } && test -s conftest.$ac_objext; then
+  ac_lo=$ac_mid; break
 else
   $as_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 -rf conftest.dSYM
-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
-  :
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
 else
-  ac_cv_search_opendir=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_lo= ac_hi=
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
-$as_echo "$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"
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
 
-else
-  { $as_echo "$as_me:$LINENO: checking for library containing opendir" >&5
-$as_echo_n "checking for library containing opendir... " >&6; }
-if test "${ac_cv_search_opendir+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_func_search_save_LIBS=$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 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 ();
+$ac_includes_default
 int
 main ()
 {
-return opendir ();
+static int test_array [1 - 2 * !(((long int) (sizeof (off_t))) <= $ac_mid)];
+test_array [0] = 0
+
   ;
   return 0;
 }
 _ACEOF
-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"
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -52941,62 +53691,151 @@ $as_echo "$ac_try_echo") >&5
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_search_opendir=$ac_res
+       } && test -s conftest.$ac_objext; then
+  ac_hi=$ac_mid
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-
+       ac_lo=`expr '(' $ac_mid ')' + 1`
 fi
 
-rm -rf conftest.dSYM
-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
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 done
-if test "${ac_cv_search_opendir+set}" = set; then
-  :
+case $ac_lo in
+?*) ac_cv_sizeof_off_t=$ac_lo;;
+'') if test "$ac_cv_type_off_t" = yes; then
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (off_t)
+See \`config.log' for more details." >&5
+$as_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
-  ac_cv_search_opendir=no
+  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
+static long int longval () { return (long int) (sizeof (off_t)); }
+static unsigned long int ulongval () { return (long int) (sizeof (off_t)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+  FILE *f = fopen ("conftest.val", "w");
+  if (! f)
+    return 1;
+  if (((long int) (sizeof (off_t))) < 0)
+    {
+      long int i = longval ();
+      if (i != ((long int) (sizeof (off_t))))
+       return 1;
+      fprintf (f, "%ld", i);
+    }
+  else
+    {
+      unsigned long int i = ulongval ();
+      if (i != ((long int) (sizeof (off_t))))
+       return 1;
+      fprintf (f, "%lu", i);
+    }
+  /* Do not output a trailing newline, as this causes \r\n confusion
+     on some platforms.  */
+  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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_sizeof_off_t=`cat conftest.val`
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+if test "$ac_cv_type_off_t" = yes; then
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (off_t)
+See \`config.log' for more details." >&5
+$as_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 conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
-$as_echo "$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"
-
+rm -f conftest.val
 fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_off_t" >&5
+$as_echo "$ac_cv_sizeof_off_t" >&6; }
 
-fi
 
-{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-$as_echo_n "checking for ANSI C header files... " >&6; }
-if test "${ac_cv_header_stdc+set}" = set; then
+
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_OFF_T $ac_cv_sizeof_off_t
+_ACEOF
+
+
+# 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.
+{ $as_echo "$as_me:$LINENO: checking size of size_t" >&5
+$as_echo_n "checking size of size_t... " >&6; }
+if test "${ac_cv_sizeof_size_t+set}" = set; then
   $as_echo_n "(cached) " >&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.  */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
+$ac_includes_default
 int
 main ()
 {
+static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) >= 0)];
+test_array [0] = 0
 
   ;
   return 0;
@@ -53020,162 +53859,112 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_cv_header_stdc=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_cv_header_stdc=no
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
-  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-  cat >conftest.$ac_ext <<_ACEOF
+  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 <string.h>
+$ac_includes_default
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) <= $ac_mid)];
+test_array [0] = 0
 
+  ;
+  return 0;
+}
 _ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "memchr" >/dev/null 2>&1; then
-  :
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_hi=$ac_mid; break
 else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
+  $as_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
 
-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>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "free" >/dev/null 2>&1; then
-  :
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
 else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-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
+       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>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
-                  (('a' <= (c) && (c) <= 'i') \
-                    || ('j' <= (c) && (c) <= 'r') \
-                    || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+$ac_includes_default
 int
 main ()
 {
-  int i;
-  for (i = 0; i < 256; i++)
-    if (XOR (islower (i), ISLOWER (i))
-       || toupper (i) != TOUPPER (i))
-      return 2;
+static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) < 0)];
+test_array [0] = 0
+
+  ;
   return 0;
 }
 _ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  :
-else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_header_stdc=no
-fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
-
-fi
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-$as_echo "$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define STDC_HEADERS 1
-_ACEOF
-
-fi
-
-{ $as_echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5
-$as_echo_n "checking whether time.h and sys/time.h may both be included... " >&6; }
-if test "${ac_cv_header_time+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  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 <sys/types.h>
-#include <sys/time.h>
-#include <time.h>
-
+$ac_includes_default
 int
 main ()
 {
-if ((struct tm *) 0)
-return 0;
+static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) >= $ac_mid)];
+test_array [0] = 0
+
   ;
   return 0;
 }
@@ -53198,101 +53987,51 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_cv_header_time=yes
+  ac_lo=$ac_mid; break
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_header_time=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 core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5
-$as_echo "$ac_cv_header_time" >&6; }
-if test $ac_cv_header_time = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define TIME_WITH_SYS_TIME 1
-_ACEOF
+  done
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+       ac_lo= ac_hi=
 fi
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-for ac_header in grp.h \
-       libc.h \
-       libgen.h \
-       limits.h \
-       math.h \
-       netinet/in.h \
-       regex.h \
-       stdarg.h \
-       stdlib.h \
-       strings.h \
-       rpc/rpc.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 \
-       time.h \
-       unistd.h \
-
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
-$as_echo_n "checking $ac_header usability... " >&6; }
-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
-#include <$ac_header>
+int
+main ()
+{
+static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) <= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -53312,134 +54051,134 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
+  ac_hi=$ac_mid
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_header_compiler=no
+       ac_lo=`expr '(' $ac_mid ')' + 1`
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
-$as_echo_n "checking $ac_header presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
+done
+case $ac_lo in
+?*) ac_cv_sizeof_size_t=$ac_lo;;
+'') if test "$ac_cv_type_size_t" = yes; then
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (size_t)
+See \`config.log' for more details." >&5
+$as_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 <$ac_header>
+$ac_includes_default
+static long int longval () { return (long int) (sizeof (size_t)); }
+static unsigned long int ulongval () { return (long int) (sizeof (size_t)); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+  FILE *f = fopen ("conftest.val", "w");
+  if (! f)
+    return 1;
+  if (((long int) (sizeof (size_t))) < 0)
+    {
+      long int i = longval ();
+      if (i != ((long int) (sizeof (size_t))))
+       return 1;
+      fprintf (f, "%ld", i);
+    }
+  else
+    {
+      unsigned long int i = ulongval ();
+      if (i != ((long int) (sizeof (size_t))))
+       return 1;
+      fprintf (f, "%lu", i);
+    }
+  /* Do not output a trailing newline, as this causes \r\n confusion
+     on some platforms.  */
+  return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
 _ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  (eval "$ac_link") 2>&5
   ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_sizeof_size_t=`cat conftest.val`
 else
-  $as_echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-  ac_header_preproc=no
-fi
-
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
+( exit $ac_status )
+if test "$ac_cv_type_size_t" = yes; then
+     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (size_t)
+See \`config.log' for more details." >&5
+$as_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
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
-as_val=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
+rm -f conftest.val
 fi
-
-done
-
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_AMANDA_H 1
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_UTIL_H 1
-_ACEOF
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_size_t" >&5
+$as_echo "$ac_cv_sizeof_size_t" >&6; }
 
 
 
-cat >>confdefs.h <<\_ACEOF
-#define USE_GETTEXT 1
+cat >>confdefs.h <<_ACEOF
+#define SIZEOF_SIZE_T $ac_cv_sizeof_size_t
 _ACEOF
 
 
-#
-# Types
-#
 # 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.
-{ $as_echo "$as_me:$LINENO: checking size of int" >&5
-$as_echo_n "checking size of int... " >&6; }
-if test "${ac_cv_sizeof_int+set}" = set; then
+{ $as_echo "$as_me:$LINENO: checking size of ssize_t" >&5
+$as_echo_n "checking size of ssize_t... " >&6; }
+if test "${ac_cv_sizeof_ssize_t+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then
@@ -53454,7 +54193,7 @@ $ac_includes_default
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (int))) >= 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ssize_t))) >= 0)];
 test_array [0] = 0
 
   ;
@@ -53491,7 +54230,7 @@ $ac_includes_default
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (int))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ssize_t))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -53545,7 +54284,7 @@ $ac_includes_default
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (int))) < 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ssize_t))) < 0)];
 test_array [0] = 0
 
   ;
@@ -53582,7 +54321,7 @@ $ac_includes_default
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (int))) >= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ssize_t))) >= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -53646,7 +54385,7 @@ $ac_includes_default
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (int))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (ssize_t))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
 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
+?*) ac_cv_sizeof_ssize_t=$ac_lo;;
+'') if test "$ac_cv_type_ssize_t" = yes; then
      { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (int)
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (ssize_t)
 See \`config.log' for more details." >&5
-$as_echo "$as_me: error: cannot compute sizeof (int)
+$as_echo "$as_me: error: cannot compute sizeof (ssize_t)
 See \`config.log' for more details." >&2;}
    { (exit 77); exit 77; }; }; }
    else
-     ac_cv_sizeof_int=0
+     ac_cv_sizeof_ssize_t=0
    fi ;;
 esac
 else
@@ -53703,8 +54442,8 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-static long int longval () { return (long int) (sizeof (int)); }
-static unsigned long int ulongval () { return (long int) (sizeof (int)); }
+static long int longval () { return (long int) (sizeof (ssize_t)); }
+static unsigned long int ulongval () { return (long int) (sizeof (ssize_t)); }
 #include <stdio.h>
 #include <stdlib.h>
 int
@@ -53714,17 +54453,17 @@ main ()
   FILE *f = fopen ("conftest.val", "w");
   if (! f)
     return 1;
-  if (((long int) (sizeof (int))) < 0)
+  if (((long int) (sizeof (ssize_t))) < 0)
     {
       long int i = longval ();
-      if (i != ((long int) (sizeof (int))))
+      if (i != ((long int) (sizeof (ssize_t))))
        return 1;
       fprintf (f, "%ld", i);
     }
   else
     {
       unsigned long int i = ulongval ();
-      if (i != ((long int) (sizeof (int))))
+      if (i != ((long int) (sizeof (ssize_t))))
        return 1;
       fprintf (f, "%lu", i);
     }
@@ -53758,23 +54497,23 @@ $as_echo "$ac_try_echo") >&5
   ac_status=$?
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_sizeof_int=`cat conftest.val`
+  ac_cv_sizeof_ssize_t=`cat conftest.val`
 else
   $as_echo "$as_me: program exited with status $ac_status" >&5
 $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-if test "$ac_cv_type_int" = yes; then
+if test "$ac_cv_type_ssize_t" = yes; then
      { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (int)
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (ssize_t)
 See \`config.log' for more details." >&5
-$as_echo "$as_me: error: cannot compute sizeof (int)
+$as_echo "$as_me: error: cannot compute sizeof (ssize_t)
 See \`config.log' for more details." >&2;}
    { (exit 77); exit 77; }; }; }
    else
-     ac_cv_sizeof_int=0
+     ac_cv_sizeof_ssize_t=0
    fi
 fi
 rm -rf conftest.dSYM
@@ -53782,13 +54521,13 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$a
 fi
 rm -f conftest.val
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5
-$as_echo "$ac_cv_sizeof_int" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_ssize_t" >&5
+$as_echo "$ac_cv_sizeof_ssize_t" >&6; }
 
 
 
 cat >>confdefs.h <<_ACEOF
-#define SIZEOF_INT $ac_cv_sizeof_int
+#define SIZEOF_SSIZE_T $ac_cv_sizeof_ssize_t
 _ACEOF
 
 
@@ -53796,9 +54535,9 @@ _ACEOF
 # 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.
-{ $as_echo "$as_me:$LINENO: checking size of long" >&5
-$as_echo_n "checking size of long... " >&6; }
-if test "${ac_cv_sizeof_long+set}" = set; then
+{ $as_echo "$as_me:$LINENO: checking size of time_t" >&5
+$as_echo_n "checking size of time_t... " >&6; }
+if test "${ac_cv_sizeof_time_t+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   if test "$cross_compiling" = yes; then
@@ -53813,7 +54552,7 @@ $ac_includes_default
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (long))) >= 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (time_t))) >= 0)];
 test_array [0] = 0
 
   ;
@@ -53850,7 +54589,7 @@ $ac_includes_default
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (long))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (time_t))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -53904,7 +54643,7 @@ $ac_includes_default
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (long))) < 0)];
+static int test_array [1 - 2 * !(((long int) (sizeof (time_t))) < 0)];
 test_array [0] = 0
 
   ;
@@ -53941,7 +54680,7 @@ $ac_includes_default
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (long))) >= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (time_t))) >= $ac_mid)];
 test_array [0] = 0
 
   ;
@@ -54005,7 +54744,7 @@ $ac_includes_default
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (long))) <= $ac_mid)];
+static int test_array [1 - 2 * !(((long int) (sizeof (time_t))) <= $ac_mid)];
 test_array [0] = 0
 
   ;
 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
+?*) ac_cv_sizeof_time_t=$ac_lo;;
+'') if test "$ac_cv_type_time_t" = yes; then
      { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long)
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (time_t)
 See \`config.log' for more details." >&5
-$as_echo "$as_me: error: cannot compute sizeof (long)
+$as_echo "$as_me: error: cannot compute sizeof (time_t)
 See \`config.log' for more details." >&2;}
    { (exit 77); exit 77; }; }; }
    else
-     ac_cv_sizeof_long=0
+     ac_cv_sizeof_time_t=0
    fi ;;
 esac
 else
@@ -54062,8 +54801,8 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-static long int longval () { return (long int) (sizeof (long)); }
-static unsigned long int ulongval () { return (long int) (sizeof (long)); }
+static long int longval () { return (long int) (sizeof (time_t)); }
+static unsigned long int ulongval () { return (long int) (sizeof (time_t)); }
 #include <stdio.h>
 #include <stdlib.h>
 int
@@ -54073,17 +54812,17 @@ main ()
   FILE *f = fopen ("conftest.val", "w");
   if (! f)
     return 1;
-  if (((long int) (sizeof (long))) < 0)
+  if (((long int) (sizeof (time_t))) < 0)
     {
       long int i = longval ();
-      if (i != ((long int) (sizeof (long))))
+      if (i != ((long int) (sizeof (time_t))))
        return 1;
       fprintf (f, "%ld", i);
     }
   else
     {
       unsigned long int i = ulongval ();
-      if (i != ((long int) (sizeof (long))))
+      if (i != ((long int) (sizeof (time_t))))
        return 1;
       fprintf (f, "%lu", i);
     }
@@ -54117,23 +54856,23 @@ $as_echo "$ac_try_echo") >&5
   ac_status=$?
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_sizeof_long=`cat conftest.val`
+  ac_cv_sizeof_time_t=`cat conftest.val`
 else
   $as_echo "$as_me: program exited with status $ac_status" >&5
 $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-if test "$ac_cv_type_long" = yes; then
+if test "$ac_cv_type_time_t" = yes; then
      { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long)
+{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (time_t)
 See \`config.log' for more details." >&5
-$as_echo "$as_me: error: cannot compute sizeof (long)
+$as_echo "$as_me: error: cannot compute sizeof (time_t)
 See \`config.log' for more details." >&2;}
    { (exit 77); exit 77; }; }; }
    else
-     ac_cv_sizeof_long=0
+     ac_cv_sizeof_time_t=0
    fi
 fi
 rm -rf conftest.dSYM
@@ -54141,27 +54880,22 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$a
 fi
 rm -f conftest.val
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5
-$as_echo "$ac_cv_sizeof_long" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_time_t" >&5
+$as_echo "$ac_cv_sizeof_time_t" >&6; }
 
 
 
 cat >>confdefs.h <<_ACEOF
-#define SIZEOF_LONG $ac_cv_sizeof_long
+#define SIZEOF_TIME_T $ac_cv_sizeof_time_t
 _ACEOF
 
 
-# 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.
-{ $as_echo "$as_me:$LINENO: checking size of long long" >&5
-$as_echo_n "checking size of long long... " >&6; }
-if test "${ac_cv_sizeof_long_long+set}" = set; then
+{ $as_echo "$as_me:$LINENO: checking for off_t" >&5
+$as_echo_n "checking for off_t... " >&6; }
+if test "${ac_cv_type_off_t+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  if test "$cross_compiling" = yes; then
-  # Depending upon the size, compute the lo and hi bounds.
+  ac_cv_type_off_t=no
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -54172,9 +54906,8 @@ $ac_includes_default
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (long long))) >= 0)];
-test_array [0] = 0
-
+if (sizeof (off_t))
+       return 0;
   ;
   return 0;
 }
@@ -54197,9 +54930,7 @@ $as_echo "$ac_try_echo") >&5
         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
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -54209,9 +54940,8 @@ $ac_includes_default
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (long long))) <= $ac_mid)];
-test_array [0] = 0
-
+if (sizeof ((off_t)))
+         return 0;
   ;
   return 0;
 }
@@ -54234,26 +54964,43 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_hi=$ac_mid; break
+  :
 else
   $as_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_type_off_t=yes
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       cat >conftest.$ac_ext <<_ACEOF
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5
+$as_echo "$ac_cv_type_off_t" >&6; }
+if test "x$ac_cv_type_off_t" = x""yes; then
+  :
+else
+
+cat >>confdefs.h <<_ACEOF
+#define off_t long int
+_ACEOF
+
+fi
+
+{ $as_echo "$as_me:$LINENO: checking for pid_t" >&5
+$as_echo_n "checking for pid_t... " >&6; }
+if test "${ac_cv_type_pid_t+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_type_pid_t=no
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -54263,9 +55010,8 @@ $ac_includes_default
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (long long))) < 0)];
-test_array [0] = 0
-
+if (sizeof (pid_t))
+       return 0;
   ;
   return 0;
 }
@@ -54288,9 +55034,7 @@ $as_echo "$ac_try_echo") >&5
         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
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -54300,9 +55044,8 @@ $ac_includes_default
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (long long))) >= $ac_mid)];
-test_array [0] = 0
-
+if (sizeof ((pid_t)))
+         return 0;
   ;
   return 0;
 }
@@ -54325,36 +55068,43 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_lo=$ac_mid; break
+  :
 else
   $as_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_type_pid_t=yes
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
 else
   $as_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
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5
+$as_echo "$ac_cv_type_pid_t" >&6; }
+if test "x$ac_cv_type_pid_t" = x""yes; then
+  :
+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
+cat >>confdefs.h <<_ACEOF
+#define pid_t int
+_ACEOF
+
+fi
+
+{ $as_echo "$as_me:$LINENO: checking for size_t" >&5
+$as_echo_n "checking for size_t... " >&6; }
+if test "${ac_cv_type_size_t+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_type_size_t=no
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
@@ -54364,9 +55114,8 @@ $ac_includes_default
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (long long))) <= $ac_mid)];
-test_array [0] = 0
-
+if (sizeof (size_t))
+       return 0;
   ;
   return 0;
 }
@@ -54389,31 +55138,6 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_hi=$ac_mid
-else
-  $as_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
-?*) ac_cv_sizeof_long_long=$ac_lo;;
-'') if test "$ac_cv_type_long_long" = yes; then
-     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long long)
-See \`config.log' for more details." >&5
-$as_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
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -54421,156 +55145,119 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-static long int longval () { return (long int) (sizeof (long long)); }
-static unsigned long int ulongval () { return (long int) (sizeof (long long)); }
-#include <stdio.h>
-#include <stdlib.h>
 int
 main ()
 {
-
-  FILE *f = fopen ("conftest.val", "w");
-  if (! f)
-    return 1;
-  if (((long int) (sizeof (long long))) < 0)
-    {
-      long int i = longval ();
-      if (i != ((long int) (sizeof (long long))))
-       return 1;
-      fprintf (f, "%ld", i);
-    }
-  else
-    {
-      unsigned long int i = ulongval ();
-      if (i != ((long int) (sizeof (long long))))
-       return 1;
-      fprintf (f, "%lu", i);
-    }
-  /* Do not output a trailing newline, as this causes \r\n confusion
-     on some platforms.  */
-  return ferror (f) || fclose (f) != 0;
-
+if (sizeof ((size_t)))
+         return 0;
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_sizeof_long_long=`cat conftest.val`
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
 else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-( exit $ac_status )
-if test "$ac_cv_type_long_long" = yes; then
-     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long long)
-See \`config.log' for more details." >&5
-$as_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
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f conftest.val
+       ac_cv_type_size_t=yes
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5
-$as_echo "$ac_cv_sizeof_long_long" >&6; }
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
+$as_echo "$ac_cv_type_size_t" >&6; }
+if test "x$ac_cv_type_size_t" = x""yes; then
+  :
+else
 
 cat >>confdefs.h <<_ACEOF
-#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
+#define size_t unsigned int
 _ACEOF
 
+fi
 
-# 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.
-{ $as_echo "$as_me:$LINENO: checking size of intmax_t" >&5
-$as_echo_n "checking size of intmax_t... " >&6; }
-if test "${ac_cv_sizeof_intmax_t+set}" = set; then
+{ $as_echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5
+$as_echo_n "checking for uid_t in sys/types.h... " >&6; }
+if test "${ac_cv_type_uid_t+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  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
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (intmax_t))) >= 0)];
-test_array [0] = 0
+#include <sys/types.h>
 
-  ;
-  return 0;
-}
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_lo=0 ac_mid=0
-  while :; do
-    cat >conftest.$ac_ext <<_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
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5
+$as_echo "$ac_cv_type_uid_t" >&6; }
+if test $ac_cv_type_uid_t = no; then
+
+cat >>confdefs.h <<\_ACEOF
+#define uid_t int
+_ACEOF
+
+
+cat >>confdefs.h <<\_ACEOF
+#define gid_t int
+_ACEOF
+
+fi
+
+{ $as_echo "$as_me:$LINENO: checking return type of signal handlers" >&5
+$as_echo_n "checking return type of signal handlers... " >&6; }
+if test "${ac_cv_type_signal+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+#include <sys/types.h>
+#include <signal.h>
+
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (intmax_t))) <= $ac_mid)];
-test_array [0] = 0
-
+return *(signal (0, 0)) (0) == 1;
   ;
   return 0;
 }
@@ -54593,75 +55280,44 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_hi=$ac_mid; break
+  ac_cv_type_signal=int
 else
   $as_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_type_signal=void
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5
+$as_echo "$ac_cv_type_signal" >&6; }
 
-       cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+cat >>confdefs.h <<_ACEOF
+#define RETSIGTYPE $ac_cv_type_signal
 _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 int) (sizeof (intmax_t))) < 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_hi=-1 ac_mid=-1
-  while :; do
-    cat >conftest.$ac_ext <<_ACEOF
+
+{ $as_echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5
+$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; }
+if test "${ac_cv_struct_tm+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+#include <sys/types.h>
+#include <time.h>
+
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (intmax_t))) >= $ac_mid)];
-test_array [0] = 0
-
+struct tm tm;
+                                    int *p = &tm.tm_sec;
+                                    return !p;
   ;
   return 0;
 }
@@ -54684,48 +55340,53 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_lo=$ac_mid; break
+  ac_cv_struct_tm=time.h
 else
   $as_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_struct_tm=sys/time.h
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_lo= ac_hi=
 fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5
+$as_echo "$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
 
-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
+
+      ## lifted from config/gnulib/socklen.m4
+            { $as_echo "$as_me:$LINENO: checking for socklen_t equivalent" >&5
+$as_echo_n "checking for socklen_t equivalent... " >&6; }
+      if test "${gl_cv_socklen_t_equiv+set}" = set; then
+  $as_echo_n "(cached) " >&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 socklen_t 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.  */
-$ac_includes_default
+#include <sys/types.h>
+               #include <sys/socket.h>
+
+               int getpeername (int, $arg2 *, $t *);
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (intmax_t))) <= $ac_mid)];
-test_array [0] = 0
-
+$t len;
+               getpeername (0, 0, &len);
   ;
   return 0;
 }
@@ -54748,151 +55409,67 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_hi=$ac_mid
+  gl_cv_socklen_t_equiv="$t"
 else
   $as_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
-?*) ac_cv_sizeof_intmax_t=$ac_lo;;
-'') if test "$ac_cv_type_intmax_t" = yes; then
-     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (intmax_t)
-See \`config.log' for more details." >&5
-$as_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.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-static long int longval () { return (long int) (sizeof (intmax_t)); }
-static unsigned long int ulongval () { return (long int) (sizeof (intmax_t)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
-
-  FILE *f = fopen ("conftest.val", "w");
-  if (! f)
-    return 1;
-  if (((long int) (sizeof (intmax_t))) < 0)
-    {
-      long int i = longval ();
-      if (i != ((long int) (sizeof (intmax_t))))
-       return 1;
-      fprintf (f, "%ld", i);
-    }
-  else
-    {
-      unsigned long int i = ulongval ();
-      if (i != ((long int) (sizeof (intmax_t))))
-       return 1;
-      fprintf (f, "%lu", i);
-    }
-  /* Do not output a trailing newline, as this causes \r\n confusion
-     on some platforms.  */
-  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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_sizeof_intmax_t=`cat conftest.val`
-else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+            test "$gl_cv_socklen_t_equiv" != "" && break
+          done
+          test "$gl_cv_socklen_t_equiv" != "" && break
+        done
 
-( exit $ac_status )
-if test "$ac_cv_type_intmax_t" = yes; then
-     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (intmax_t)
-See \`config.log' for more details." >&5
-$as_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 -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f conftest.val
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_intmax_t" >&5
-$as_echo "$ac_cv_sizeof_intmax_t" >&6; }
 
+      ## end lifting from config/gnulib/socklen.m4
+      # fallback if the check fails
+      if test "$gl_cv_socklen_t_equiv" = ""; then
+       gl_cv_socklen_t_equiv=socklen_t
+      fi
+      { $as_echo "$as_me:$LINENO: result: $gl_cv_socklen_t_equiv" >&5
+$as_echo "$gl_cv_socklen_t_equiv" >&6; }
 
 
 cat >>confdefs.h <<_ACEOF
-#define SIZEOF_INTMAX_T $ac_cv_sizeof_intmax_t
+#define socklen_t_equiv $gl_cv_socklen_t_equiv
 _ACEOF
 
 
-# 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.
-{ $as_echo "$as_me:$LINENO: checking size of off_t" >&5
-$as_echo_n "checking size of off_t... " >&6; }
-if test "${ac_cv_sizeof_off_t+set}" = set; then
+
+
+    { $as_echo "$as_me:$LINENO: checking for sa_family_t" >&5
+$as_echo_n "checking for sa_family_t... " >&6; }
+if test "${ac_cv_type_sa_family_t+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  if test "$cross_compiling" = yes; then
-  # Depending upon the size, compute the lo and hi bounds.
+  ac_cv_type_sa_family_t=no
 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
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+#include <sys/socket.h>
+
+
+
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (off_t))) >= 0)];
-test_array [0] = 0
-
+if (sizeof (sa_family_t))
+       return 0;
   ;
   return 0;
 }
@@ -54915,21 +55492,29 @@ $as_echo "$ac_try_echo") >&5
         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
+  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
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+#include <sys/socket.h>
+
+
+
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (off_t))) <= $ac_mid)];
-test_array [0] = 0
-
+if (sizeof ((sa_family_t)))
+         return 0;
   ;
   return 0;
 }
@@ -54952,38 +55537,70 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_hi=$ac_mid; break
+  :
 else
   $as_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_type_sa_family_t=yes
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       cat >conftest.$ac_ext <<_ACEOF
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_sa_family_t" >&5
+$as_echo "$ac_cv_type_sa_family_t" >&6; }
+if test "x$ac_cv_type_sa_family_t" = x""yes; then
+  :
+else
+
+
+cat >>confdefs.h <<\_ACEOF
+#define sa_family_t unsigned short
+_ACEOF
+
+
+fi
+
+
+
+
+    { $as_echo "$as_me:$LINENO: checking for in_port_t" >&5
+$as_echo_n "checking for in_port_t... " >&6; }
+if test "${ac_cv_type_in_port_t+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_type_in_port_t=no
+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
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+#include <netinet/in.h>
+
+
+
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (off_t))) < 0)];
-test_array [0] = 0
-
+if (sizeof (in_port_t))
+       return 0;
   ;
   return 0;
 }
@@ -55006,21 +55623,29 @@ $as_echo "$ac_try_echo") >&5
         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
+  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
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+#include <netinet/in.h>
+
+
+
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (off_t))) >= $ac_mid)];
-test_array [0] = 0
-
+if (sizeof ((in_port_t)))
+         return 0;
   ;
   return 0;
 }
@@ -55043,51 +55668,68 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_lo=$ac_mid; break
+  :
 else
   $as_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_type_in_port_t=yes
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
 else
   $as_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
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_in_port_t" >&5
+$as_echo "$ac_cv_type_in_port_t" >&6; }
+if test "x$ac_cv_type_in_port_t" = x""yes; then
+  :
+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
+
+cat >>confdefs.h <<\_ACEOF
+#define in_port_t unsigned short
+_ACEOF
+
+
+fi
+
+
+
+
+
+
+for ac_header in sys/wait.h wait.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&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 int) (sizeof (off_t))) <= $ac_mid)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
+#include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -55107,150 +55749,140 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_hi=$ac_mid
+  ac_header_compiler=yes
 else
   $as_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 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
-     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (off_t)
-See \`config.log' for more details." >&5
-$as_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
-  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
-static long int longval () { return (long int) (sizeof (off_t)); }
-static unsigned long int ulongval () { return (long int) (sizeof (off_t)); }
-#include <stdio.h>
-#include <stdlib.h>
-int
-main ()
-{
-
-  FILE *f = fopen ("conftest.val", "w");
-  if (! f)
-    return 1;
-  if (((long int) (sizeof (off_t))) < 0)
-    {
-      long int i = longval ();
-      if (i != ((long int) (sizeof (off_t))))
-       return 1;
-      fprintf (f, "%ld", i);
-    }
-  else
-    {
-      unsigned long int i = ulongval ();
-      if (i != ((long int) (sizeof (off_t))))
-       return 1;
-      fprintf (f, "%lu", i);
-    }
-  /* Do not output a trailing newline, as this causes \r\n confusion
-     on some platforms.  */
-  return ferror (f) || fclose (f) != 0;
-
-  ;
-  return 0;
-}
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
 _ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
+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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_sizeof_off_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
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-( exit $ac_status )
-if test "$ac_cv_type_off_t" = yes; then
-     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (off_t)
-See \`config.log' for more details." >&5
-$as_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 -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f conftest.val
+  ac_header_preproc=no
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_off_t" >&5
-$as_echo "$ac_cv_sizeof_off_t" >&6; }
 
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
+    ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_OFF_T $ac_cv_sizeof_off_t
+fi
+as_val=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
+fi
 
-# 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.
-{ $as_echo "$as_me:$LINENO: checking size of size_t" >&5
-$as_echo_n "checking size of size_t... " >&6; }
-if test "${ac_cv_sizeof_size_t+set}" = set; then
+done
+
+    { $as_echo "$as_me:$LINENO: checking whether wait uses union wait" >&5
+$as_echo_n "checking whether wait uses union wait... " >&6; }
+if test "${cf_cv_arg_union_wait+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  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>
+
+#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
+
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) >= 0)];
-test_array [0] = 0
+
+  union wait x; int i;
+  wait(&x); i = WIFEXITED(x)
 
   ;
   return 0;
@@ -55274,24 +55906,55 @@ $as_echo "$ac_try_echo") >&5
         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
+  cf_cv_arg_union_wait=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       cf_cv_arg_union_wait=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:$LINENO: result: $cf_cv_arg_union_wait" >&5
+$as_echo "$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
+
+    fi
+
+
+
+
+
+for ac_header in sys/wait.h wait.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&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 int) (sizeof (size_t))) <= $ac_mid)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
+#include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -55311,74 +55974,140 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_hi=$ac_mid; break
+  ac_header_compiler=yes
 else
   $as_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 core conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
-       cat >conftest.$ac_ext <<_ACEOF
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&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 int) (sizeof (size_t))) < 0)];
-test_array [0] = 0
-
-  ;
-  return 0;
-}
+#include <$ac_header>
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
+  (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
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$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
+       }; then
+  ac_header_preproc=yes
+else
+  $as_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
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+
+fi
+as_val=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+    { $as_echo "$as_me:$LINENO: checking whether wait uses int" >&5
+$as_echo_n "checking whether wait uses int... " >&6; }
+if test "${cf_cv_arg_int+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+
+        cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+
+#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
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) >= $ac_mid)];
-test_array [0] = 0
+
+  int x; int i;
+  wait(&x); i = WIFEXITED(x)
 
   ;
   return 0;
@@ -55402,61 +56131,64 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_lo=$ac_mid; break
+  cf_cv_arg_int=yes
 else
   $as_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`
+       cf_cv_arg_int=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_lo= ac_hi=
 fi
+{ $as_echo "$as_me:$LINENO: result: $cf_cv_arg_int" >&5
+$as_echo "$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.$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
+
+#
+# Libraries
+#
+# cur_colr is on some HP's
+
+{ $as_echo "$as_me:$LINENO: checking for main in -lcur_colr" >&5
+$as_echo_n "checking for main in -lcur_colr... " >&6; }
+if test "${ac_cv_lib_cur_colr_main+set}" = set; then
+  $as_echo_n "(cached) " >&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_includes_default
+
+
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (size_t))) <= $ac_mid)];
-test_array [0] = 0
-
+return main ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -55465,73 +56197,59 @@ $as_echo "$ac_try_echo") >&5
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_hi=$ac_mid
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_cur_colr_main=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_lo=`expr '(' $ac_mid ')' + 1`
+       ac_cv_lib_cur_colr_main=no
 fi
 
-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
-     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (size_t)
-See \`config.log' for more details." >&5
-$as_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
+rm -rf conftest.dSYM
+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
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_cur_colr_main" >&5
+$as_echo "$ac_cv_lib_cur_colr_main" >&6; }
+if test "x$ac_cv_lib_cur_colr_main" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBCUR_COLR 1
+_ACEOF
+
+  LIBS="-lcur_colr $LIBS"
+
+fi
+
+
+{ $as_echo "$as_me:$LINENO: checking for main in -lintl" >&5
+$as_echo_n "checking for main in -lintl... " >&6; }
+if test "${ac_cv_lib_intl_main+set}" = set; then
+  $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  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.  */
-$ac_includes_default
-static long int longval () { return (long int) (sizeof (size_t)); }
-static unsigned long int ulongval () { return (long int) (sizeof (size_t)); }
-#include <stdio.h>
-#include <stdlib.h>
+
+
 int
 main ()
 {
-
-  FILE *f = fopen ("conftest.val", "w");
-  if (! f)
-    return 1;
-  if (((long int) (sizeof (size_t))) < 0)
-    {
-      long int i = longval ();
-      if (i != ((long int) (sizeof (size_t))))
-       return 1;
-      fprintf (f, "%ld", i);
-    }
-  else
-    {
-      unsigned long int i = ulongval ();
-      if (i != ((long int) (sizeof (size_t))))
-       return 1;
-      fprintf (f, "%lu", i);
-    }
-  /* Do not output a trailing newline, as this causes \r\n confusion
-     on some platforms.  */
-  return ferror (f) || fclose (f) != 0;
-
+return main ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest$ac_exeext
+rm -f conftest.$ac_objext conftest$ac_exeext
 if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
@@ -55539,91 +56257,80 @@ case "(($ac_try" in
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_sizeof_size_t=`cat conftest.val`
-else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-if test "$ac_cv_type_size_t" = yes; then
-     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (size_t)
-See \`config.log' for more details." >&5
-$as_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
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_intl_main=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_intl_main=no
 fi
+
 rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f conftest.val
+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
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_size_t" >&5
-$as_echo "$ac_cv_sizeof_size_t" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_intl_main" >&5
+$as_echo "$ac_cv_lib_intl_main" >&6; }
+if test "x$ac_cv_lib_intl_main" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBINTL 1
+_ACEOF
 
+  LIBS="-lintl $LIBS"
 
+fi
 
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_SIZE_T $ac_cv_sizeof_size_t
-_ACEOF
 
+    # Make sure we don't use -lnsl and -lsun on Irix systems.
+    case "$host" in
+       *sgi-irix*)
 
-# 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.
-{ $as_echo "$as_me:$LINENO: checking size of ssize_t" >&5
-$as_echo_n "checking size of ssize_t... " >&6; }
-if test "${ac_cv_sizeof_ssize_t+set}" = set; then
+{ $as_echo "$as_me:$LINENO: checking for main in -lsocket" >&5
+$as_echo_n "checking for main in -lsocket... " >&6; }
+if test "${ac_cv_lib_socket_main+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  if test "$cross_compiling" = yes; then
-  # Depending upon the size, compute the lo and hi bounds.
+  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.  */
-$ac_includes_default
+
+
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ssize_t))) >= 0)];
-test_array [0] = 0
-
+return main ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -55632,35 +56339,69 @@ $as_echo "$ac_try_echo") >&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
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_socket_main=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_socket_main=no
+fi
+
+rm -rf conftest.dSYM
+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
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_socket_main" >&5
+$as_echo "$ac_cv_lib_socket_main" >&6; }
+if test "x$ac_cv_lib_socket_main" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBSOCKET 1
+_ACEOF
+
+  LIBS="-lsocket $LIBS"
+
+fi
+
+                           ;;
+       *)
+
+{ $as_echo "$as_me:$LINENO: checking for main in -lresolv" >&5
+$as_echo_n "checking for main in -lresolv... " >&6; }
+if test "${ac_cv_lib_resolv_main+set}" = set; then
+  $as_echo_n "(cached) " >&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.  */
-$ac_includes_default
+
+
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ssize_t))) <= $ac_mid)];
-test_array [0] = 0
-
+return main ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -55669,52 +56410,67 @@ $as_echo "$ac_try_echo") >&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
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_resolv_main=yes
 else
   $as_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_lib_resolv_main=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+rm -rf conftest.dSYM
+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
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_main" >&5
+$as_echo "$ac_cv_lib_resolv_main" >&6; }
+if test "x$ac_cv_lib_resolv_main" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBRESOLV 1
+_ACEOF
 
-       cat >conftest.$ac_ext <<_ACEOF
+  LIBS="-lresolv $LIBS"
+
+fi
+
+
+{ $as_echo "$as_me:$LINENO: checking for main in -lnsl" >&5
+$as_echo_n "checking for main in -lnsl... " >&6; }
+if test "${ac_cv_lib_nsl_main+set}" = set; then
+  $as_echo_n "(cached) " >&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.  */
-$ac_includes_default
+
+
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ssize_t))) < 0)];
-test_array [0] = 0
-
+return main ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -55723,35 +56479,67 @@ $as_echo "$ac_try_echo") >&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
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_nsl_main=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_nsl_main=no
+fi
+
+rm -rf conftest.dSYM
+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
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_main" >&5
+$as_echo "$ac_cv_lib_nsl_main" >&6; }
+if test "x$ac_cv_lib_nsl_main" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBNSL 1
+_ACEOF
+
+  LIBS="-lnsl $LIBS"
+
+fi
+
+
+{ $as_echo "$as_me:$LINENO: checking for main in -lsocket" >&5
+$as_echo_n "checking for main in -lsocket... " >&6; }
+if test "${ac_cv_lib_socket_main+set}" = set; then
+  $as_echo_n "(cached) " >&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.  */
-$ac_includes_default
+
+
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ssize_t))) >= $ac_mid)];
-test_array [0] = 0
-
+return main ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -55760,62 +56548,67 @@ $as_echo "$ac_try_echo") >&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
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_socket_main=yes
 else
   $as_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_lib_socket_main=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_lo= ac_hi=
+rm -rf conftest.dSYM
+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
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_socket_main" >&5
+$as_echo "$ac_cv_lib_socket_main" >&6; }
+if test "x$ac_cv_lib_socket_main" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBSOCKET 1
+_ACEOF
+
+  LIBS="-lsocket $LIBS"
 
-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
+
+{ $as_echo "$as_me:$LINENO: checking for main in -lsun" >&5
+$as_echo_n "checking for main in -lsun... " >&6; }
+if test "${ac_cv_lib_sun_main+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  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.  */
-$ac_includes_default
+
+
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (ssize_t))) <= $ac_mid)];
-test_array [0] = 0
-
+return main ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -55824,31 +56617,303 @@ $as_echo "$ac_try_echo") >&5
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_hi=$ac_mid
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_sun_main=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_lib_sun_main=no
+fi
+
+rm -rf conftest.dSYM
+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
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_sun_main" >&5
+$as_echo "$ac_cv_lib_sun_main" >&6; }
+if test "x$ac_cv_lib_sun_main" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBSUN 1
+_ACEOF
+
+  LIBS="-lsun $LIBS"
+
+fi
+
+                           ;;
+    esac
+
+
+
+
+
+
+
+
+    # if any of the precious variables are set, disable the pkg-config run
+    explicit_glib=no
+    test x"$GLIB_CFLAGS" = x"" || explicit_glib=yes
+    test x"$GLIB_LIBS" = x"" || explicit_glib=yes
+    test x"$GLIB_GENMARSHAL" = x"" || explicit_glib=yes
+    test x"$GOBJECT_QUERY" = x"" || explicit_glib=yes
+    test x"$GLIB_MKENUMS" = x"" || explicit_glib=yes
+
+    if test x"$explicit_glib" = x"no"; then
+       # 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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
+  $as_echo_n "(cached) " >&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"
+    $as_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
+  { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+       case "$host" 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
+
+
+  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"
+         ;;
+         gio*)
+             pkg_config_args="$pkg_config_args $module-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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
+  $as_echo_n "(cached) " >&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"
+    $as_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
+  { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
+  $as_echo_n "(cached) " >&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"
+    $as_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
+  { $as_echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_pt_PKG_CONFIG" = x; then
+    PKG_CONFIG=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
+  fi
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
 
-       ac_lo=`expr '(' $ac_mid ')' + 1`
 fi
+if test -n "$PKG_CONFIG"; then
+       _pkg_min_version=0.7
+       { $as_echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+               { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+               { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+               PKG_CONFIG=""
+       fi
 
-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
-     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (ssize_t)
-See \`config.log' for more details." >&5
-$as_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
+fi
+
+  no_glib=""
+
+  if test "x$PKG_CONFIG" = x ; then
+    no_glib=yes
+    PKG_CONFIG=no
+  fi
+
+  min_glib_version=2.2.0
+  { $as_echo "$as_me:$LINENO: checking for GLIB - version >= $min_glib_version" >&5
+$as_echo_n "checking for GLIB - version >= $min_glib_version... " >&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.  */
@@ -55856,39 +56921,78 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
-static long int longval () { return (long int) (sizeof (ssize_t)); }
-static unsigned long int ulongval () { return (long int) (sizeof (ssize_t)); }
+
+#include <glib.h>
 #include <stdio.h>
 #include <stdlib.h>
+
 int
 main ()
 {
+  int major, minor, micro;
+  char *tmp_version;
 
-  FILE *f = fopen ("conftest.val", "w");
-  if (! f)
-    return 1;
-  if (((long int) (sizeof (ssize_t))) < 0)
+  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))
     {
-      long int i = longval ();
-      if (i != ((long int) (sizeof (ssize_t))))
-       return 1;
-      fprintf (f, "%ld", i);
+      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
     {
-      unsigned long int i = ulongval ();
-      if (i != ((long int) (sizeof (ssize_t))))
-       return 1;
-      fprintf (f, "%lu", i);
+      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");
+      }
     }
-  /* Do not output a trailing newline, as this causes \r\n confusion
-     on some platforms.  */
-  return ferror (f) || fclose (f) != 0;
-
-  ;
-  return 0;
+  return 1;
 }
+
 _ACEOF
 rm -f conftest$ac_exeext
 if { (ac_try="$ac_link"
@@ -55912,114 +57016,70 @@ $as_echo "$ac_try_echo") >&5
   ac_status=$?
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_sizeof_ssize_t=`cat conftest.val`
+  :
 else
   $as_echo "$as_me: program exited with status $ac_status" >&5
 $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
 ( exit $ac_status )
-if test "$ac_cv_type_ssize_t" = yes; then
-     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (ssize_t)
-See \`config.log' for more details." >&5
-$as_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
+no_glib=yes
 fi
 rm -rf conftest.dSYM
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
-rm -f conftest.val
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_ssize_t" >&5
-$as_echo "$ac_cv_sizeof_ssize_t" >&6; }
-
-
-
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_SSIZE_T $ac_cv_sizeof_ssize_t
-_ACEOF
 
 
-# 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.
-{ $as_echo "$as_me:$LINENO: checking size of time_t" >&5
-$as_echo_n "checking size of time_t... " >&6; }
-if test "${ac_cv_sizeof_time_t+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then
-  # Depending upon the size, compute the lo and hi bounds.
-cat >conftest.$ac_ext <<_ACEOF
+       CFLAGS="$ac_save_CFLAGS"
+       LIBS="$ac_save_LIBS"
+     fi
+  fi
+  if test "x$no_glib" = x ; then
+     { $as_echo "$as_me:$LINENO: result: yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)" >&5
+$as_echo "yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)" >&6; }
+     :
+  else
+     { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "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.  */
-$ac_includes_default
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (time_t))) >= 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_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
+#include <glib.h>
+#include <stdio.h>
+
 int
 main ()
 {
-static int test_array [1 - 2 * !(((long int) (sizeof (time_t))) <= $ac_mid)];
-test_array [0] = 0
-
+ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version));
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -56028,228 +57088,125 @@ $as_echo "$ac_try_echo") >&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
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $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
   $as_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`
+        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 core conftest.err conftest.$ac_objext conftest.$ac_ext
-  done
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+          CFLAGS="$ac_save_CFLAGS"
+          LIBS="$ac_save_LIBS"
+       fi
+     fi
+     GLIB_CFLAGS=""
+     GLIB_LIBS=""
+     GLIB_GENMARSHAL=""
+     GOBJECT_QUERY=""
+     GLIB_MKENUMS=""
 
-       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 int) (sizeof (time_t))) < 0)];
-test_array [0] = 0
+           { { $as_echo "$as_me:$LINENO: error: glib not found or too old; See http://wiki.zmanda.com/index.php/Installation for help" >&5
+$as_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; }; }
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_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 int) (sizeof (time_t))) >= $ac_mid)];
-test_array [0] = 0
+  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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_lo=$ac_mid; break
-else
-  $as_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
-  $as_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 conf.glibtest
 
-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
-int
-main ()
-{
-static int test_array [1 - 2 * !(((long int) (sizeof (time_t))) <= $ac_mid)];
-test_array [0] = 0
+    else
+       { { $as_echo "$as_me:$LINENO: error: explicit glib" >&5
+$as_echo "$as_me: error: explicit glib" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+
+    # GLIB_CPPFLAGS is not set by autoconf, yet GLIB_CFLAGS contains what GLIB_CPPFLAGS should contain.
+    CPPFLAGS="$CPPFLAGS $GLIB_CFLAGS"
+
+    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) : ;;
+               *) { { $as_echo "$as_me:$LINENO: error: *** --with-readline does not take a value" >&5
+$as_echo "$as_me: error: *** --with-readline does not take a value" >&2;}
+   { (exit 1); exit 1; }; }
+           esac
+           want_readline="$withval"
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_hi=$ac_mid
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_lo=`expr '(' $ac_mid ')' + 1`
+           want_readline="maybe" # meaning "only if we can find it"
+
 fi
 
-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
-     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (time_t)
-See \`config.log' for more details." >&5
-$as_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
+
+
+  # unless the user said "no", look for readline.
+  if test x"$want_readline" != x"no"; then
+    { $as_echo "$as_me:$LINENO: checking for a readline compatible library" >&5
+$as_echo_n "checking for a readline compatible library... " >&6; }
+if test "${ax_cv_lib_readline+set}" = set; then
+  $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+
+      ORIG_LIBS="$LIBS"
+      for readline_lib in readline edit editline; do
+        for termcap_lib in "" termcap curses ncurses; do
+          if test -z "$termcap_lib"; then
+            TRY_LIB="-l$readline_lib"
+          else
+            TRY_LIB="-l$readline_lib -l$termcap_lib"
+          fi
+          LIBS="$ORIG_LIBS $TRY_LIB"
+          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
-static long int longval () { return (long int) (sizeof (time_t)); }
-static unsigned long int ulongval () { return (long int) (sizeof (time_t)); }
-#include <stdio.h>
-#include <stdlib.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 readline ();
 int
 main ()
 {
-
-  FILE *f = fopen ("conftest.val", "w");
-  if (! f)
-    return 1;
-  if (((long int) (sizeof (time_t))) < 0)
-    {
-      long int i = longval ();
-      if (i != ((long int) (sizeof (time_t))))
-       return 1;
-      fprintf (f, "%ld", i);
-    }
-  else
-    {
-      unsigned long int i = ulongval ();
-      if (i != ((long int) (sizeof (time_t))))
-       return 1;
-      fprintf (f, "%lu", i);
-    }
-  /* Do not output a trailing newline, as this causes \r\n confusion
-     on some platforms.  */
-  return ferror (f) || fclose (f) != 0;
-
+return readline ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest$ac_exeext
+rm -f conftest.$ac_objext conftest$ac_exeext
 if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
@@ -56257,60 +57214,75 @@ case "(($ac_try" in
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_sizeof_time_t=`cat conftest.val`
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  ax_cv_lib_readline="$TRY_LIB"
 else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-( exit $ac_status )
-if test "$ac_cv_type_time_t" = yes; then
-     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (time_t)
-See \`config.log' for more details." >&5
-$as_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 -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f conftest.val
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_time_t" >&5
-$as_echo "$ac_cv_sizeof_time_t" >&6; }
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+          if test -n "$ax_cv_lib_readline"; then
+            break
+          fi
+        done
+        if test -n "$ax_cv_lib_readline"; then
+          break
+        fi
+      done
+      if test -z "$ax_cv_lib_readline"; then
+        ax_cv_lib_readline="no"
+      fi
+      LIBS="$ORIG_LIBS"
 
+fi
+{ $as_echo "$as_me:$LINENO: result: $ax_cv_lib_readline" >&5
+$as_echo "$ax_cv_lib_readline" >&6; }
 
+    if test "$ax_cv_lib_readline" != "no"; then
+      ORIG_LIBS="$LIBS"
+      LIBS="$LIBS $ax_cv_lib_readline"
+      READLINE_LIBS="$ax_cv_lib_readline"
 
-cat >>confdefs.h <<_ACEOF
-#define SIZEOF_TIME_T $ac_cv_sizeof_time_t
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBREADLINE 1
 _ACEOF
 
 
-{ $as_echo "$as_me:$LINENO: checking for off_t" >&5
-$as_echo_n "checking for off_t... " >&6; }
-if test "${ac_cv_type_off_t+set}" = set; then
+
+for ac_header in readline.h readline/readline.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   $as_echo_n "(cached) " >&6
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 else
-  ac_cv_type_off_t=no
+  # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -56318,14 +57290,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-int
-main ()
-{
-if (sizeof (off_t))
-       return 0;
-  ;
-  return 0;
-}
+#include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -56345,135 +57310,145 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_header_compiler=yes
+else
+  $as_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
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&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 (sizeof ((off_t)))
-         return 0;
-  ;
-  return 0;
-}
+#include <$ac_header>
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
+  (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
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  :
+       }; then
+  ac_header_preproc=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_type_off_t=yes
+  ac_header_preproc=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
 
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
+    ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
 fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5
-$as_echo "$ac_cv_type_off_t" >&6; }
-if test "x$ac_cv_type_off_t" = x""yes; then
-  :
-else
-
-cat >>confdefs.h <<_ACEOF
-#define off_t long int
+as_val=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
 
-{ $as_echo "$as_me:$LINENO: checking for pid_t" >&5
-$as_echo_n "checking for pid_t... " >&6; }
-if test "${ac_cv_type_pid_t+set}" = set; then
+done
+
+      { $as_echo "$as_me:$LINENO: checking whether readline supports history" >&5
+$as_echo_n "checking whether readline supports history... " >&6; }
+if test "${ax_cv_lib_readline_history+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  ac_cv_type_pid_t=no
-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 (sizeof (pid_t))
-       return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  cat >conftest.$ac_ext <<_ACEOF
+
+        ax_cv_lib_readline_history="no"
+        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 add_history ();
 int
 main ()
 {
-if (sizeof ((pid_t)))
-         return 0;
+return add_history ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -56482,16 +57457,11 @@ $as_echo "$ac_try_echo") >&5
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  :
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_cv_type_pid_t=yes
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  ax_cv_lib_readline_history="yes"
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
@@ -56499,26 +57469,38 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5
-$as_echo "$ac_cv_type_pid_t" >&6; }
-if test "x$ac_cv_type_pid_t" = x""yes; then
-  :
-else
+{ $as_echo "$as_me:$LINENO: result: $ax_cv_lib_readline_history" >&5
+$as_echo "$ax_cv_lib_readline_history" >&6; }
+      if test "$ax_cv_lib_readline_history" = "yes"; then
 
-cat >>confdefs.h <<_ACEOF
-#define pid_t int
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_READLINE_HISTORY 1
 _ACEOF
 
-fi
 
-{ $as_echo "$as_me:$LINENO: checking for size_t" >&5
-$as_echo_n "checking for size_t... " >&6; }
-if test "${ac_cv_type_size_t+set}" = set; then
+
+for ac_header in history.h readline/history.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   $as_echo_n "(cached) " >&6
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 else
-  ac_cv_type_size_t=no
+  # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&6; }
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -56526,14 +57508,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-int
-main ()
-{
-if (sizeof (size_t))
-       return 0;
-  ;
-  return 0;
-}
+#include <$ac_header>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -56553,139 +57528,161 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_header_compiler=yes
+else
+  $as_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
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&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 (sizeof ((size_t)))
-         return 0;
-  ;
-  return 0;
-}
+#include <$ac_header>
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
+  (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
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  :
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_cv_type_size_t=yes
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+       }; then
+  ac_header_preproc=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  ac_header_preproc=no
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
-$as_echo "$ac_cv_type_size_t" >&6; }
-if test "x$ac_cv_type_size_t" = x""yes; then
-  :
-else
 
-cat >>confdefs.h <<_ACEOF
-#define size_t unsigned int
-_ACEOF
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
 
-fi
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
 
-{ $as_echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5
-$as_echo_n "checking for uid_t in sys/types.h... " >&6; }
-if test "${ac_cv_type_uid_t+set}" = set; then
+    ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <sys/types.h>
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 
-_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*
+as_val=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5
-$as_echo "$ac_cv_type_uid_t" >&6; }
-if test $ac_cv_type_uid_t = no; then
 
-cat >>confdefs.h <<\_ACEOF
-#define uid_t int
-_ACEOF
+done
 
+      fi
+      LIBS="$ORIG_LIBS"
 
-cat >>confdefs.h <<\_ACEOF
-#define gid_t int
-_ACEOF
+    else
+      # no readline.  if the user *really* wanted it, bail out.
+      if test x"$want_readline" = x"yes"; then
+       { { $as_echo "$as_me:$LINENO: error: *** No readline implementation found.  Try using --with-libraries and --with-includes" >&5
+$as_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
 
-fi
 
-{ $as_echo "$as_me:$LINENO: checking return type of signal handlers" >&5
-$as_echo_n "checking return type of signal handlers... " >&6; }
-if test "${ac_cv_type_signal+set}" = set; then
+
+{ $as_echo "$as_me:$LINENO: checking for modf in -lm" >&5
+$as_echo_n "checking for modf in -lm... " >&6; }
+if test "${ac_cv_lib_m_modf+set}" = set; then
   $as_echo_n "(cached) " >&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.  */
-#include <sys/types.h>
-#include <signal.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 modf ();
 int
 main ()
 {
-return *(signal (0, 0)) (0) == 1;
+return modf ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -56694,48 +57691,55 @@ $as_echo "$ac_try_echo") >&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
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_m_modf=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_type_signal=void
+       ac_cv_lib_m_modf=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -rf conftest.dSYM
+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
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5
-$as_echo "$ac_cv_type_signal" >&6; }
-
-cat >>confdefs.h <<_ACEOF
-#define RETSIGTYPE $ac_cv_type_signal
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_m_modf" >&5
+$as_echo "$ac_cv_lib_m_modf" >&6; }
+if test "x$ac_cv_lib_m_modf" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
 _ACEOF
 
+  LIBS="-lm $LIBS"
 
-{ $as_echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5
-$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; }
-if test "${ac_cv_struct_tm+set}" = set; then
+fi
+
+
+    if test "${ac_cv_header_execinfo_h+set}" = set; then
+  { $as_echo "$as_me:$LINENO: checking for execinfo.h" >&5
+$as_echo_n "checking for execinfo.h... " >&6; }
+if test "${ac_cv_header_execinfo_h+set}" = set; then
   $as_echo_n "(cached) " >&6
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_execinfo_h" >&5
+$as_echo "$ac_cv_header_execinfo_h" >&6; }
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking execinfo.h usability" >&5
+$as_echo_n "checking execinfo.h usability... " >&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 <time.h>
-
-int
-main ()
-{
-struct tm tm;
-                                    int *p = &tm.tm_sec;
-                                    return !p;
-  ;
-  return 0;
-}
+$ac_includes_default
+#include <execinfo.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (ac_try="$ac_compile"
@@ -56755,194 +57759,155 @@ $as_echo "$ac_try_echo") >&5
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
        } && test -s conftest.$ac_objext; then
-  ac_cv_struct_tm=time.h
+  ac_header_compiler=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_struct_tm=sys/time.h
+       ac_header_compiler=no
 fi
 
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5
-$as_echo "$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
-
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
-      ## lifted from config/gnulib/socklen.m4
-            { $as_echo "$as_me:$LINENO: checking for socklen_t equivalent" >&5
-$as_echo_n "checking for socklen_t equivalent... " >&6; }
-      if test "${gl_cv_socklen_t_equiv+set}" = set; then
-  $as_echo_n "(cached) " >&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 socklen_t int size_t "unsigned int" "long int" "unsigned long int"; do
-            cat >conftest.$ac_ext <<_ACEOF
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking execinfo.h presence" >&5
+$as_echo_n "checking execinfo.h presence... " >&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;
-}
+#include <execinfo.h>
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
+  (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
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  gl_cv_socklen_t_equiv="$t"
+       }; then
+  ac_header_preproc=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-            test "$gl_cv_socklen_t_equiv" != "" && break
-          done
-          test "$gl_cv_socklen_t_equiv" != "" && break
-        done
-
+  ac_header_preproc=no
 fi
 
-      ## end lifting from config/gnulib/socklen.m4
-      # fallback if the check fails
-      if test "$gl_cv_socklen_t_equiv" = ""; then
-       gl_cv_socklen_t_equiv=socklen_t
-      fi
-      { $as_echo "$as_me:$LINENO: result: $gl_cv_socklen_t_equiv" >&5
-$as_echo "$gl_cv_socklen_t_equiv" >&6; }
-
-
-cat >>confdefs.h <<_ACEOF
-#define socklen_t_equiv $gl_cv_socklen_t_equiv
-_ACEOF
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
 
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { $as_echo "$as_me:$LINENO: WARNING: execinfo.h: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: execinfo.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: execinfo.h: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: execinfo.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:$LINENO: WARNING: execinfo.h: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: execinfo.h: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: execinfo.h:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: execinfo.h:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: execinfo.h: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: execinfo.h: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: execinfo.h:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: execinfo.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: execinfo.h: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: execinfo.h: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: execinfo.h: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: execinfo.h: in the future, the compiler will take precedence" >&2;}
 
+    ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for execinfo.h" >&5
+$as_echo_n "checking for execinfo.h... " >&6; }
+if test "${ac_cv_header_execinfo_h+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_header_execinfo_h=$ac_header_preproc
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_execinfo_h" >&5
+$as_echo "$ac_cv_header_execinfo_h" >&6; }
 
+fi
+if test "x$ac_cv_header_execinfo_h" = x""yes; then
 
-    { $as_echo "$as_me:$LINENO: checking for sa_family_t" >&5
-$as_echo_n "checking for sa_family_t... " >&6; }
-if test "${ac_cv_type_sa_family_t+set}" = set; then
+       { $as_echo "$as_me:$LINENO: checking for backtrace_symbols_fd" >&5
+$as_echo_n "checking for backtrace_symbols_fd... " >&6; }
+if test "${ac_cv_func_backtrace_symbols_fd+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  ac_cv_type_sa_family_t=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 backtrace_symbols_fd to an innocuous variant, in case <limits.h> declares backtrace_symbols_fd.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define backtrace_symbols_fd innocuous_backtrace_symbols_fd
 
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-#include <sys/socket.h>
-
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char backtrace_symbols_fd (); 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
 
-int
-main ()
-{
-if (sizeof (sa_family_t))
-       return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
+#undef backtrace_symbols_fd
 
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.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
-#ifdef STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
+char backtrace_symbols_fd ();
+/* 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_backtrace_symbols_fd || defined __stub___backtrace_symbols_fd
+choke me
 #endif
-#include <sys/socket.h>
-
-
 
 int
 main ()
 {
-if (sizeof ((sa_family_t)))
-         return 0;
+return backtrace_symbols_fd ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -56951,129 +57916,114 @@ $as_echo "$ac_try_echo") >&5
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  :
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_cv_type_sa_family_t=yes
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_func_backtrace_symbols_fd=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-
+       ac_cv_func_backtrace_symbols_fd=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_sa_family_t" >&5
-$as_echo "$ac_cv_type_sa_family_t" >&6; }
-if test "x$ac_cv_type_sa_family_t" = x""yes; then
-  :
-else
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_backtrace_symbols_fd" >&5
+$as_echo "$ac_cv_func_backtrace_symbols_fd" >&6; }
+if test "x$ac_cv_func_backtrace_symbols_fd" = x""yes; then
 
 
 cat >>confdefs.h <<\_ACEOF
-#define sa_family_t unsigned short
+#define HAVE_GLIBC_BACKTRACE 1
 _ACEOF
 
 
 fi
 
 
+fi
 
 
-    { $as_echo "$as_me:$LINENO: checking for in_port_t" >&5
-$as_echo_n "checking for in_port_t... " >&6; }
-if test "${ac_cv_type_in_port_t+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_type_in_port_t=no
-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_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-#include <netinet/in.h>
 
+#
+# 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_have_accept=no
 
-int
-main ()
-{
-if (sizeof (in_port_t))
-       return 0;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
+for ac_func in accept
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+/* 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 HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.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
-#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
+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 (sizeof ((in_port_t)))
-         return 0;
+return $ac_func ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -57082,236 +58032,216 @@ $as_echo "$ac_try_echo") >&5
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  :
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  eval "$as_ac_var=yes"
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_type_in_port_t=yes
+       eval "$as_ac_var=no"
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
 fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_res=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+ ice_have_accept=yes
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_in_port_t" >&5
-$as_echo "$ac_cv_type_in_port_t" >&6; }
-if test "x$ac_cv_type_in_port_t" = x""yes; then
-  :
-else
+done
 
+if test "${ice_have_accept}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for accept declaration in sys/types.h sys/socket.h" >&5
+$as_echo_n "checking for accept declaration in sys/types.h sys/socket.h... " >&6; }
+if test "${ice_cv_have_accept_decl+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
 
-cat >>confdefs.h <<\_ACEOF
-#define in_port_t unsigned short
+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
+/* 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*
 
-
-
-
-
-
-for ac_header in sys/wait.h wait.h
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
+if test "$ice_cv_have_accept_decl" = yes; then
+       break
 fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
-$as_echo_n "checking $ac_header usability... " >&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.  */
-$ac_includes_default
-#include <$ac_header>
+#include <$header>
+
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_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}accept[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_accept_decl=yes
+fi
+rm -f conftest*
 
-       ac_header_compiler=no
+if test "$ice_cv_have_accept_decl" = yes; then
+       break
 fi
+done
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
+fi
 
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
-$as_echo_n "checking $ac_header presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_accept_decl" >&5
+$as_echo "$ice_cv_have_accept_decl" >&6; }
+if test "$ice_cv_have_accept_decl" = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_ACCEPT_DECL 1
+_ACEOF
+
+fi
+fi
+
+# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
+# for constant arguments.  Useless!
+{ $as_echo "$as_me:$LINENO: checking for working alloca.h" >&5
+$as_echo_n "checking for working alloca.h... " >&6; }
+if test "${ac_cv_working_alloca_h+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <$ac_header>
+#include <alloca.h>
+int
+main ()
+{
+char *p = (char *) alloca (2 * sizeof (int));
+                         if (p) return 0;
+  ;
+  return 0;
+}
 _ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
        }; then
-  ac_header_preproc=yes
+  ac_cv_working_alloca_h=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-  ac_header_preproc=no
+       ac_cv_working_alloca_h=no
 fi
 
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5
+$as_echo "$ac_cv_working_alloca_h" >&6; }
+if test $ac_cv_working_alloca_h = yes; then
 
-fi
-as_val=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_ALLOCA_H 1
 _ACEOF
 
 fi
 
-done
-
-    { $as_echo "$as_me:$LINENO: checking whether wait uses union wait" >&5
-$as_echo_n "checking whether wait uses union wait... " >&6; }
-if test "${cf_cv_arg_union_wait+set}" = set; then
+{ $as_echo "$as_me:$LINENO: checking for alloca" >&5
+$as_echo_n "checking for alloca... " >&6; }
+if test "${ac_cv_func_alloca_works+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-
-        cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-#include <sys/types.h>
-
-#if HAVE_SYS_WAIT_H
-# include <sys/wait.h>
+#ifdef __GNUC__
+# define alloca __builtin_alloca
 #else
-# if HAVE_WAIT_H
-#  include <wait.h>
+# 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
 
-#ifdef __STDC__
-pid_t wait(union wait *);
-#endif
-
 int
 main ()
 {
-
-  union wait x; int i;
-  wait(&x); i = WIFEXITED(x)
-
+char *p = (char *) alloca (1);
+                                   if (p) return 0;
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -57320,277 +58250,309 @@ $as_echo "$ac_try_echo") >&5
   (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
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_func_alloca_works=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       cf_cv_arg_union_wait=no
+       ac_cv_func_alloca_works=no
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $cf_cv_arg_union_wait" >&5
-$as_echo "$cf_cv_arg_union_wait" >&6; }
-    if test $cf_cv_arg_union_wait = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5
+$as_echo "$ac_cv_func_alloca_works" >&6; }
+
+if test $ac_cv_func_alloca_works = yes; then
 
 cat >>confdefs.h <<\_ACEOF
-#define WAIT_USES_UNION 1
+#define HAVE_ALLOCA 1
 _ACEOF
 
-    fi
-
+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=\${LIBOBJDIR}alloca.$ac_objext
 
+cat >>confdefs.h <<\_ACEOF
+#define C_ALLOCA 1
+_ACEOF
 
 
-for ac_header in sys/wait.h wait.h
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+{ $as_echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5
+$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; }
+if test "${ac_cv_os_cray+set}" = set; then
   $as_echo_n "(cached) " >&6
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
 else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
-$as_echo_n "checking $ac_header usability... " >&6; }
-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 <$ac_header>
+#if defined CRAY && ! defined CRAY2
+webecray
+#else
+wenotbecray
+#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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "webecray" >/dev/null 2>&1; then
+  ac_cv_os_cray=yes
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_header_compiler=no
+  ac_cv_os_cray=no
 fi
+rm -f conftest*
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
-$as_echo_n "checking $ac_header presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5
+$as_echo "$ac_cv_os_cray" >&6; }
+if test $ac_cv_os_cray = yes; then
+  for ac_func in _getb67 GETB67 getb67; do
+    as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <$ac_header>
+/* 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
-if { (ac_try="$ac_cpp conftest.$ac_ext"
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
        }; then
-  ac_header_preproc=yes
+  eval "$as_ac_var=yes"
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-  ac_header_preproc=no
+       eval "$as_ac_var=no"
 fi
 
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
+ac_res=`eval 'as_val=${'$as_ac_var'}
                 $as_echo "$as_val"'`
               { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-
-fi
-as_val=`eval 'as_val=${'$as_ac_Header'}
+as_val=`eval 'as_val=${'$as_ac_var'}
                 $as_echo "$as_val"'`
    if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+
+cat >>confdefs.h <<_ACEOF
+#define CRAY_STACKSEG_END $ac_func
 _ACEOF
 
+    break
 fi
 
-done
+  done
+fi
 
-    { $as_echo "$as_me:$LINENO: checking whether wait uses int" >&5
-$as_echo_n "checking whether wait uses int... " >&6; }
-if test "${cf_cv_arg_int+set}" = set; then
+{ $as_echo "$as_me:$LINENO: checking stack direction for C alloca" >&5
+$as_echo_n "checking stack direction for C alloca... " >&6; }
+if test "${ac_cv_c_stack_direction+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-
-        cat >conftest.$ac_ext <<_ACEOF
+  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.  */
-
-#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
+$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 ()
 {
-
-  int x; int i;
-  wait(&x); i = WIFEXITED(x)
-
-  ;
-  return 0;
+  return find_stack_direction () < 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
+  (eval "$ac_link") 2>&5
   ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  cf_cv_arg_int=yes
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_c_stack_direction=1
 else
-  $as_echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       cf_cv_arg_int=no
+( exit $ac_status )
+ac_cv_c_stack_direction=-1
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 fi
-{ $as_echo "$as_me:$LINENO: result: $cf_cv_arg_int" >&5
-$as_echo "$cf_cv_arg_int" >&6; }
-if test $cf_cv_arg_int = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5
+$as_echo "$ac_cv_c_stack_direction" >&6; }
 
-cat >>confdefs.h <<\_ACEOF
-#define WAIT_USES_INT 1
+cat >>confdefs.h <<_ACEOF
+#define STACK_DIRECTION $ac_cv_c_stack_direction
 _ACEOF
 
-fi
 
+fi
 
-#
-# Libraries
-#
-# cur_colr is on some HP's
 
-{ $as_echo "$as_me:$LINENO: checking for main in -lcur_colr" >&5
-$as_echo_n "checking for main in -lcur_colr... " >&6; }
-if test "${ac_cv_lib_cur_colr_main+set}" = set; then
+for ac_func in atexit
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   $as_echo_n "(cached) " >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcur_colr  $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.  */
+/* 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 main ();
+return $ac_func ();
   ;
   return 0;
 }
@@ -57616,50 +58578,84 @@ $as_echo "$ac_try_echo") >&5
         test "$cross_compiling" = yes ||
         $as_test_x conftest$ac_exeext
        }; then
-  ac_cv_lib_cur_colr_main=yes
+  eval "$as_ac_var=yes"
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_lib_cur_colr_main=no
+       eval "$as_ac_var=no"
 fi
 
 rm -rf conftest.dSYM
 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
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_cur_colr_main" >&5
-$as_echo "$ac_cv_lib_cur_colr_main" >&6; }
-if test "x$ac_cv_lib_cur_colr_main" = x""yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBCUR_COLR 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
-  LIBS="-lcur_colr $LIBS"
-
 fi
+done
 
 
-{ $as_echo "$as_me:$LINENO: checking for main in -lintl" >&5
-$as_echo_n "checking for main in -lintl... " >&6; }
-if test "${ac_cv_lib_intl_main+set}" = set; then
+ice_have_atof=no
+
+for ac_func in atof
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   $as_echo_n "(cached) " >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lintl  $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.  */
+/* 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 main ();
+return $ac_func ();
   ;
   return 0;
 }
@@ -57685,54 +58681,148 @@ $as_echo "$ac_try_echo") >&5
         test "$cross_compiling" = yes ||
         $as_test_x conftest$ac_exeext
        }; then
-  ac_cv_lib_intl_main=yes
+  eval "$as_ac_var=yes"
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_lib_intl_main=no
+       eval "$as_ac_var=no"
 fi
 
 rm -rf conftest.dSYM
 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
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_intl_main" >&5
-$as_echo "$ac_cv_lib_intl_main" >&6; }
-if test "x$ac_cv_lib_intl_main" = x""yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBINTL 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
+ ice_have_atof=yes
+fi
+done
 
-  LIBS="-lintl $LIBS"
+if test "${ice_have_atof}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for atof declaration in stdlib.h" >&5
+$as_echo_n "checking for atof declaration in stdlib.h... " >&6; }
+if test "${ice_cv_have_atof_decl+set}" = set; then
+  $as_echo_n "(cached) " >&6
+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
+/* 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}atof[  ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_atof_decl=yes
+fi
+rm -f conftest*
+
+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.  */
+_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}atof[  ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_atof_decl=yes
 fi
+rm -f conftest*
 
+if test "$ice_cv_have_atof_decl" = yes; then
+       break
+fi
+done
 
-    # Make sure we don't use -lnsl and -lsun on Irix systems.
-    case "$host" in
-       *sgi-irix*)
+fi
 
-{ $as_echo "$as_me:$LINENO: checking for main in -lsocket" >&5
-$as_echo_n "checking for main in -lsocket... " >&6; }
-if test "${ac_cv_lib_socket_main+set}" = set; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_atof_decl" >&5
+$as_echo "$ice_cv_have_atof_decl" >&6; }
+if test "$ice_cv_have_atof_decl" = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_ATOF_DECL 1
+_ACEOF
+
+fi
+fi
+
+
+ice_have_atol=no
+
+for ac_func in atol
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   $as_echo_n "(cached) " >&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.  */
+/* 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 main ();
+return $ac_func ();
   ;
   return 0;
 }
@@ -57758,121 +58848,148 @@ $as_echo "$ac_try_echo") >&5
         test "$cross_compiling" = yes ||
         $as_test_x conftest$ac_exeext
        }; then
-  ac_cv_lib_socket_main=yes
+  eval "$as_ac_var=yes"
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_lib_socket_main=no
+       eval "$as_ac_var=no"
 fi
 
 rm -rf conftest.dSYM
 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
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_socket_main" >&5
-$as_echo "$ac_cv_lib_socket_main" >&6; }
-if test "x$ac_cv_lib_socket_main" = x""yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBSOCKET 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
-
-  LIBS="-lsocket $LIBS"
-
+ ice_have_atol=yes
 fi
+done
 
-                           ;;
-       *)
-
-{ $as_echo "$as_me:$LINENO: checking for main in -lresolv" >&5
-$as_echo_n "checking for main in -lresolv... " >&6; }
-if test "${ac_cv_lib_resolv_main+set}" = set; then
+if test "${ice_have_atol}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for atol declaration in stdlib.h" >&5
+$as_echo_n "checking for atol declaration in stdlib.h... " >&6; }
+if test "${ice_cv_have_atol_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lresolv  $LIBS"
+
+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.  */
+#include <$header>
 
+_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*
 
-int
-main ()
-{
-return main ();
-  ;
-  return 0;
-}
+if test "$ice_cv_have_atol_decl" = yes; then
+       break
+fi
+# Check for "fixed" declaration like "getpid _PARAMS((int))"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_lib_resolv_main=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$header>
 
-       ac_cv_lib_resolv_main=no
+_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*
 
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+if test "$ice_cv_have_atol_decl" = yes; then
+       break
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_main" >&5
-$as_echo "$ac_cv_lib_resolv_main" >&6; }
-if test "x$ac_cv_lib_resolv_main" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBRESOLV 1
-_ACEOF
+done
 
-  LIBS="-lresolv $LIBS"
+fi
+
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_atol_decl" >&5
+$as_echo "$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
 
 
-{ $as_echo "$as_me:$LINENO: checking for main in -lnsl" >&5
-$as_echo_n "checking for main in -lnsl... " >&6; }
-if test "${ac_cv_lib_nsl_main+set}" = set; then
+ice_have_atoll=no
+
+for ac_func in atoll
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   $as_echo_n "(cached) " >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnsl  $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.  */
+/* 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 main ();
+return $ac_func ();
   ;
   return 0;
 }
@@ -57898,119 +59015,148 @@ $as_echo "$ac_try_echo") >&5
         test "$cross_compiling" = yes ||
         $as_test_x conftest$ac_exeext
        }; then
-  ac_cv_lib_nsl_main=yes
+  eval "$as_ac_var=yes"
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_lib_nsl_main=no
+       eval "$as_ac_var=no"
 fi
 
 rm -rf conftest.dSYM
 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
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_main" >&5
-$as_echo "$ac_cv_lib_nsl_main" >&6; }
-if test "x$ac_cv_lib_nsl_main" = x""yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBNSL 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
-
-  LIBS="-lnsl $LIBS"
-
+ ice_have_atoll=yes
 fi
+done
 
-
-{ $as_echo "$as_me:$LINENO: checking for main in -lsocket" >&5
-$as_echo_n "checking for main in -lsocket... " >&6; }
-if test "${ac_cv_lib_socket_main+set}" = set; then
+if test "${ice_have_atoll}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for atoll declaration in stdlib.h" >&5
+$as_echo_n "checking for atoll declaration in stdlib.h... " >&6; }
+if test "${ice_cv_have_atoll_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsocket  $LIBS"
+
+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
 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[         ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_atoll_decl=yes
+fi
+rm -f conftest*
 
-int
-main ()
-{
-return main ();
-  ;
-  return 0;
-}
+if test "$ice_cv_have_atoll_decl" = yes; then
+       break
+fi
+# Check for "fixed" declaration like "getpid _PARAMS((int))"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_lib_socket_main=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$header>
 
-       ac_cv_lib_socket_main=no
+_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
 
-rm -rf conftest.dSYM
-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
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_socket_main" >&5
-$as_echo "$ac_cv_lib_socket_main" >&6; }
-if test "x$ac_cv_lib_socket_main" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBSOCKET 1
-_ACEOF
 
-  LIBS="-lsocket $LIBS"
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_atoll_decl" >&5
+$as_echo "$ice_cv_have_atoll_decl" >&6; }
+if test "$ice_cv_have_atoll_decl" = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_ATOLL_DECL 1
+_ACEOF
 
 fi
+fi
 
 
-{ $as_echo "$as_me:$LINENO: checking for main in -lsun" >&5
-$as_echo_n "checking for main in -lsun... " >&6; }
-if test "${ac_cv_lib_sun_main+set}" = set; then
+ice_have_strtol=no
+
+for ac_func in strtol
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   $as_echo_n "(cached) " >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lsun  $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.  */
+/* 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 main ();
+return $ac_func ();
   ;
   return 0;
 }
@@ -58036,452 +59182,148 @@ $as_echo "$ac_try_echo") >&5
         test "$cross_compiling" = yes ||
         $as_test_x conftest$ac_exeext
        }; then
-  ac_cv_lib_sun_main=yes
+  eval "$as_ac_var=yes"
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_lib_sun_main=no
+       eval "$as_ac_var=no"
 fi
 
 rm -rf conftest.dSYM
 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
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_sun_main" >&5
-$as_echo "$ac_cv_lib_sun_main" >&6; }
-if test "x$ac_cv_lib_sun_main" = x""yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBSUN 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
-
-  LIBS="-lsun $LIBS"
-
-fi
-
-                           ;;
-    esac
-
-
-
-
-
-
-
-
-    # if any of the precious variables are set, disable the pkg-config run
-    explicit_glib=no
-    test x"$GLIB_CFLAGS" = x"" || explicit_glib=yes
-    test x"$GLIB_LIBS" = x"" || explicit_glib=yes
-    test x"$GLIB_GENMARSHAL" = x"" || explicit_glib=yes
-    test x"$GOBJECT_QUERY" = x"" || explicit_glib=yes
-    test x"$GLIB_MKENUMS" = x"" || explicit_glib=yes
-
-    if test x"$explicit_glib" = x"no"; then
-       # 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
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
-  $as_echo_n "(cached) " >&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"
-    $as_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
-  { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
-$as_echo "$PKG_CONFIG" >&6; }
-else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-
-       case "$host" 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
+ ice_have_strtol=yes
 fi
-
-
-  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"
-         ;;
-         gio*)
-             pkg_config_args="$pkg_config_args $module-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
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
-  $as_echo_n "(cached) " >&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"
-    $as_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
-  { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
-$as_echo "$PKG_CONFIG" >&6; }
-else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
 
-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
-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
+if test "${ice_have_strtol}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for strtol declaration in stdlib.h" >&5
+$as_echo_n "checking for strtol declaration in stdlib.h... " >&6; }
+if test "${ice_cv_have_strtol_decl+set}" = set; then
   $as_echo_n "(cached) " >&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"
-    $as_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
-  { $as_echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5
-$as_echo "$ac_pt_PKG_CONFIG" >&6; }
-else
-  { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-fi
 
-  if test "x$ac_pt_PKG_CONFIG" = x; then
-    PKG_CONFIG=""
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    PKG_CONFIG=$ac_pt_PKG_CONFIG
-  fi
-else
-  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
-fi
+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
+/* 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}strtol[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_strtol_decl=yes
 fi
-if test -n "$PKG_CONFIG"; then
-       _pkg_min_version=0.7
-       { $as_echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5
-$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
-       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
-               { $as_echo "$as_me:$LINENO: result: yes" >&5
-$as_echo "yes" >&6; }
-       else
-               { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "no" >&6; }
-               PKG_CONFIG=""
-       fi
+rm -f conftest*
 
+if test "$ice_cv_have_strtol_decl" = yes; then
+       break
 fi
-
-  no_glib=""
-
-  if test "x$PKG_CONFIG" = x ; then
-    no_glib=yes
-    PKG_CONFIG=no
-  fi
-
-  min_glib_version=2.2.0
-  { $as_echo "$as_me:$LINENO: checking for GLIB - version >= $min_glib_version" >&5
-$as_echo_n "checking for GLIB - version >= $min_glib_version... " >&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
+# 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 <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;
-}
+#include <$header>
 
 _ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  :
-else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+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*
 
-( exit $ac_status )
-no_glib=yes
+if test "$ice_cv_have_strtol_decl" = yes; then
+       break
 fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+done
+
 fi
 
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_strtol_decl" >&5
+$as_echo "$ice_cv_have_strtol_decl" >&6; }
+if test "$ice_cv_have_strtol_decl" = yes; then
 
-       CFLAGS="$ac_save_CFLAGS"
-       LIBS="$ac_save_LIBS"
-     fi
-  fi
-  if test "x$no_glib" = x ; then
-     { $as_echo "$as_me:$LINENO: result: yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)" >&5
-$as_echo "yes (version $glib_config_major_version.$glib_config_minor_version.$glib_config_micro_version)" >&6; }
-     :
-  else
-     { $as_echo "$as_me:$LINENO: result: no" >&5
-$as_echo "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
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRTOL_DECL 1
+_ACEOF
+
+fi
+fi
+
+
+ice_have_strtoll=no
+
+for ac_func in strtoll
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
+/* 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 <glib.h>
-#include <stdio.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
+
+#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 ((glib_major_version) || (glib_minor_version) || (glib_micro_version));
+return $ac_func ();
   ;
   return 0;
 }
@@ -58507,104 +59349,127 @@ $as_echo "$ac_try_echo") >&5
         test "$cross_compiling" = yes ||
         $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"
+  eval "$as_ac_var=yes"
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-        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."
+       eval "$as_ac_var=no"
 fi
 
 rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
-          CFLAGS="$ac_save_CFLAGS"
-          LIBS="$ac_save_LIBS"
-       fi
-     fi
-     GLIB_CFLAGS=""
-     GLIB_LIBS=""
-     GLIB_GENMARSHAL=""
-     GOBJECT_QUERY=""
-     GLIB_MKENUMS=""
-
-           { { $as_echo "$as_me:$LINENO: error: glib not found or too old; See http://wiki.zmanda.com/index.php/Installation for help" >&5
-$as_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
+fi
+ac_res=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+ ice_have_strtoll=yes
+fi
+done
 
-    else
-       { { $as_echo "$as_me:$LINENO: error: explicit glib" >&5
-$as_echo "$as_me: error: explicit glib" >&2;}
-   { (exit 1); exit 1; }; }
-    fi
+if test "${ice_have_strtoll}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for strtoll declaration in stdlib.h" >&5
+$as_echo_n "checking for strtoll declaration in stdlib.h... " >&6; }
+if test "${ice_cv_have_strtoll_decl+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
 
-    # GLIB_CPPFLAGS is not set by autoconf, yet GLIB_CFLAGS contains what GLIB_CPPFLAGS should contain.
-    CPPFLAGS="$CPPFLAGS $GLIB_CFLAGS"
+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
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$header>
 
-    LIBS="$GLIB_LIBS $LIBS"
+_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
+/* 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
 
-# Check whether --with-readline was given.
-if test "${with_readline+set}" = set; then
-  withval=$with_readline;
-           case "$withval" in
-               y | ye | yes | n | no) : ;;
-               *) { { $as_echo "$as_me:$LINENO: error: *** --with-readline does not take a value" >&5
-$as_echo "$as_me: error: *** --with-readline does not take a value" >&2;}
-   { (exit 1); exit 1; }; }
-           esac
-           want_readline="$withval"
+fi
 
-else
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_strtoll_decl" >&5
+$as_echo "$ice_cv_have_strtoll_decl" >&6; }
+if test "$ice_cv_have_strtoll_decl" = yes; then
 
-           want_readline="maybe" # meaning "only if we can find it"
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRTOLL_DECL 1
+_ACEOF
 
 fi
+fi
 
 
-
-  # unless the user said "no", look for readline.
-  if test x"$want_readline" != x"no"; then
-    { $as_echo "$as_me:$LINENO: checking for a readline compatible library" >&5
-$as_echo_n "checking for a readline compatible library... " >&6; }
-if test "${ax_cv_lib_readline+set}" = set; then
+for ac_func in basename
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   $as_echo_n "(cached) " >&6
 else
-
-      ORIG_LIBS="$LIBS"
-      for readline_lib in readline edit editline; do
-        for termcap_lib in "" termcap curses ncurses; do
-          if test -z "$termcap_lib"; then
-            TRY_LIB="-l$readline_lib"
-          else
-            TRY_LIB="-l$readline_lib -l$termcap_lib"
-          fi
-          LIBS="$ORIG_LIBS $TRY_LIB"
-          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.  */
+
+#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
@@ -58612,11 +59477,18 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char readline ();
+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 readline ();
+return $ac_func ();
   ;
   return 0;
 }
@@ -58642,80 +59514,97 @@ $as_echo "$ac_try_echo") >&5
         test "$cross_compiling" = yes ||
         $as_test_x conftest$ac_exeext
        }; then
-  ax_cv_lib_readline="$TRY_LIB"
+  eval "$as_ac_var=yes"
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-
+       eval "$as_ac_var=no"
 fi
 
 rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
-          if test -n "$ax_cv_lib_readline"; then
-            break
-          fi
-        done
-        if test -n "$ax_cv_lib_readline"; then
-          break
-        fi
-      done
-      if test -z "$ax_cv_lib_readline"; then
-        ax_cv_lib_readline="no"
-      fi
-      LIBS="$ORIG_LIBS"
-
 fi
-{ $as_echo "$as_me:$LINENO: result: $ax_cv_lib_readline" >&5
-$as_echo "$ax_cv_lib_readline" >&6; }
-
-    if test "$ax_cv_lib_readline" != "no"; then
-      ORIG_LIBS="$LIBS"
-      LIBS="$LIBS $ax_cv_lib_readline"
-      READLINE_LIBS="$ax_cv_lib_readline"
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_LIBREADLINE 1
+ac_res=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
+fi
+done
+
 
+ice_have_bind=no
 
-for ac_header in readline.h readline/readline.h
+for ac_func in bind
 do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   $as_echo_n "(cached) " >&6
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
 else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
-$as_echo_n "checking $ac_header usability... " >&6; }
-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 <$ac_header>
+/* 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 { (ac_try="$ac_compile"
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
+  (eval "$ac_link") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -58724,121 +59613,133 @@ $as_echo "$ac_try_echo") >&5
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  eval "$as_ac_var=yes"
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_header_compiler=no
+       eval "$as_ac_var=no"
 fi
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+ ice_have_bind=yes
+fi
+done
 
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
-$as_echo_n "checking $ac_header presence... " >&6; }
+if test "${ice_have_bind}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for bind declaration in sys/types.h sys/socket.h" >&5
+$as_echo_n "checking for bind declaration in sys/types.h sys/socket.h... " >&6; }
+if test "${ice_cv_have_bind_decl+set}" = set; then
+  $as_echo_n "(cached) " >&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 <$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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$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
-  $as_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
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+#include <$header>
 
-  ac_header_preproc=no
+_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*
 
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
+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>
 
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+_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*
 
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
+if test "$ice_cv_have_bind_decl" = yes; then
+       break
 fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
+done
 
 fi
-as_val=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_bind_decl" >&5
+$as_echo "$ice_cv_have_bind_decl" >&6; }
+if test "$ice_cv_have_bind_decl" = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_BIND_DECL 1
 _ACEOF
 
 fi
+fi
 
-done
 
-      { $as_echo "$as_me:$LINENO: checking whether readline supports history" >&5
-$as_echo_n "checking whether readline supports history... " >&6; }
-if test "${ax_cv_lib_readline_history+set}" = set; then
+ice_have_bcopy=no
+
+for ac_func in bcopy
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   $as_echo_n "(cached) " >&6
 else
-
-        ax_cv_lib_readline_history="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 $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
@@ -58846,11 +59747,18 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char add_history ();
+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 add_history ();
+return $ac_func ();
   ;
   return 0;
 }
@@ -58876,203 +59784,129 @@ $as_echo "$ac_try_echo") >&5
         test "$cross_compiling" = yes ||
         $as_test_x conftest$ac_exeext
        }; then
-  ax_cv_lib_readline_history="yes"
+  eval "$as_ac_var=yes"
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-
+       eval "$as_ac_var=no"
 fi
 
 rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:$LINENO: result: $ax_cv_lib_readline_history" >&5
-$as_echo "$ax_cv_lib_readline_history" >&6; }
-      if test "$ax_cv_lib_readline_history" = "yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_READLINE_HISTORY 1
-_ACEOF
-
-
-
-for ac_header in history.h readline/history.h
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
 fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
+ac_res=`eval 'as_val=${'$as_ac_var'}
                 $as_echo "$as_val"'`
               { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+ ice_have_bcopy=yes
+fi
+done
+
+if test "${ice_have_bcopy}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for bcopy declaration in string.h strings.h stdlib.h" >&5
+$as_echo_n "checking for bcopy declaration in string.h strings.h stdlib.h... " >&6; }
+if test "${ice_cv_have_bcopy_decl+set}" = set; then
+  $as_echo_n "(cached) " >&6
 else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
-$as_echo_n "checking $ac_header usability... " >&6; }
+
+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.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+#include <$header>
 
-       ac_header_compiler=no
+_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*
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
-$as_echo_n "checking $ac_header presence... " >&6; }
+if test "$ice_cv_have_bcopy_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 <$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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$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
-  $as_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
-  $as_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
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+#include <$header>
 
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
+_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
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
+rm -f conftest*
 
+if test "$ice_cv_have_bcopy_decl" = yes; then
+       break
 fi
-as_val=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
+done
 
 fi
 
-done
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_bcopy_decl" >&5
+$as_echo "$ice_cv_have_bcopy_decl" >&6; }
+if test "$ice_cv_have_bcopy_decl" = yes; then
 
-      fi
-      LIBS="$ORIG_LIBS"
+cat >>confdefs.h <<_ACEOF
+#define HAVE_BCOPY_DECL 1
+_ACEOF
 
-    else
-      # no readline.  if the user *really* wanted it, bail out.
-      if test x"$want_readline" = x"yes"; then
-       { { $as_echo "$as_me:$LINENO: error: *** No readline implementation found.  Try using --with-libraries and --with-includes" >&5
-$as_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
+fi
+fi
 
 
+ice_have_bzero=no
 
-{ $as_echo "$as_me:$LINENO: checking for modf in -lm" >&5
-$as_echo_n "checking for modf in -lm... " >&6; }
-if test "${ac_cv_lib_m_modf+set}" = set; then
+for ac_func in bzero
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   $as_echo_n "(cached) " >&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.  */
+/* 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
@@ -59080,11 +59914,18 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char modf ();
+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 modf ();
+return $ac_func ();
   ;
   return 0;
 }
@@ -59110,163 +59951,180 @@ $as_echo "$ac_try_echo") >&5
         test "$cross_compiling" = yes ||
         $as_test_x conftest$ac_exeext
        }; then
-  ac_cv_lib_m_modf=yes
+  eval "$as_ac_var=yes"
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_lib_m_modf=no
+       eval "$as_ac_var=no"
 fi
 
 rm -rf conftest.dSYM
 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
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_m_modf" >&5
-$as_echo "$ac_cv_lib_m_modf" >&6; }
-if test "x$ac_cv_lib_m_modf" = x""yes; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBM 1
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
+ ice_have_bzero=yes
+fi
+done
 
-  LIBS="-lm $LIBS"
+if test "${ice_have_bzero}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for bzero declaration in string.h strings.h stdlib.h" >&5
+$as_echo_n "checking for bzero declaration in string.h strings.h stdlib.h... " >&6; }
+if test "${ice_cv_have_bzero_decl+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
 
-fi
+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
+/* 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}bzero[         ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_bzero_decl=yes
+fi
+rm -f conftest*
 
-    if test "${ac_cv_header_execinfo_h+set}" = set; then
-  { $as_echo "$as_me:$LINENO: checking for execinfo.h" >&5
-$as_echo_n "checking for execinfo.h... " >&6; }
-if test "${ac_cv_header_execinfo_h+set}" = set; then
-  $as_echo_n "(cached) " >&6
+if test "$ice_cv_have_bzero_decl" = yes; then
+       break
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_execinfo_h" >&5
-$as_echo "$ac_cv_header_execinfo_h" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking execinfo.h usability" >&5
-$as_echo_n "checking execinfo.h usability... " >&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.  */
-$ac_includes_default
-#include <execinfo.h>
+#include <$header>
+
 _ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_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}bzero[         ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_bzero_decl=yes
+fi
+rm -f conftest*
 
-       ac_header_compiler=no
+if test "$ice_cv_have_bzero_decl" = yes; then
+       break
 fi
+done
 
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
+fi
 
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking execinfo.h presence" >&5
-$as_echo_n "checking execinfo.h presence... " >&6; }
-cat >conftest.$ac_ext <<_ACEOF
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_bzero_decl" >&5
+$as_echo "$ice_cv_have_bzero_decl" >&6; }
+if test "$ice_cv_have_bzero_decl" = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_BZERO_DECL 1
+_ACEOF
+
+fi
+fi
+
+{ $as_echo "$as_me:$LINENO: checking whether closedir returns void" >&5
+$as_echo_n "checking whether closedir returns void... " >&6; }
+if test "${ac_cv_func_closedir_void+set}" = set; then
+  $as_echo_n "(cached) " >&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.  */
-#include <execinfo.h>
+$ac_includes_default
+#include <$ac_header_dirent>
+#ifndef __cplusplus
+int closedir ();
+#endif
+
+int
+main ()
+{
+return closedir (opendir (".")) != 0;
+  ;
+  return 0;
+}
 _ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  (eval "$ac_link") 2>&5
   ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null && {
-        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       }; then
-  ac_header_preproc=yes
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_closedir_void=no
 else
-  $as_echo "$as_me: failed program was:" >&5
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-  ac_header_preproc=no
+( exit $ac_status )
+ac_cv_func_closedir_void=yes
+fi
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
-rm -f conftest.err conftest.$ac_ext
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: execinfo.h: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: execinfo.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: execinfo.h: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: execinfo.h: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: execinfo.h: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: execinfo.h: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: execinfo.h:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: execinfo.h:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: execinfo.h: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: execinfo.h: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: execinfo.h:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: execinfo.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: execinfo.h: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: execinfo.h: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: execinfo.h: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: execinfo.h: in the future, the compiler will take precedence" >&2;}
 
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for execinfo.h" >&5
-$as_echo_n "checking for execinfo.h... " >&6; }
-if test "${ac_cv_header_execinfo_h+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_header_execinfo_h=$ac_header_preproc
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_execinfo_h" >&5
-$as_echo "$ac_cv_header_execinfo_h" >&6; }
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_closedir_void" >&5
+$as_echo "$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
-if test "x$ac_cv_header_execinfo_h" = x""yes; then
 
-       { $as_echo "$as_me:$LINENO: checking for backtrace_symbols_fd" >&5
-$as_echo_n "checking for backtrace_symbols_fd... " >&6; }
-if test "${ac_cv_func_backtrace_symbols_fd+set}" = set; then
+
+ice_have_closelog=no
+
+for ac_func in closelog
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -59275,12 +60133,12 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define backtrace_symbols_fd to an innocuous variant, in case <limits.h> declares backtrace_symbols_fd.
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define backtrace_symbols_fd innocuous_backtrace_symbols_fd
+#define $ac_func innocuous_$ac_func
 
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char backtrace_symbols_fd (); 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.  */
 
@@ -59290,7 +60148,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 # include <assert.h>
 #endif
 
-#undef backtrace_symbols_fd
+#undef $ac_func
 
 /* Override any GCC internal prototype to avoid an error.
    Use char because int might match the return type of a GCC
@@ -59298,18 +60156,18 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char backtrace_symbols_fd ();
+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_backtrace_symbols_fd || defined __stub___backtrace_symbols_fd
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
 #endif
 
 int
 main ()
 {
-return backtrace_symbols_fd ();
+return $ac_func ();
   ;
   return 0;
 }
@@ -59335,49 +60193,100 @@ $as_echo "$ac_try_echo") >&5
         test "$cross_compiling" = yes ||
         $as_test_x conftest$ac_exeext
        }; then
-  ac_cv_func_backtrace_symbols_fd=yes
+  eval "$as_ac_var=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_ac_var=no"
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+ ice_have_closelog=yes
+fi
+done
+
+if test "${ice_have_closelog}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for closelog declaration in syslog.h" >&5
+$as_echo_n "checking for closelog declaration in syslog.h... " >&6; }
+if test "${ice_cv_have_closelog_decl+set}" = set; then
+  $as_echo_n "(cached) " >&6
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_func_backtrace_symbols_fd=no
-fi
+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>
 
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+_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
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_backtrace_symbols_fd" >&5
-$as_echo "$ac_cv_func_backtrace_symbols_fd" >&6; }
-if test "x$ac_cv_func_backtrace_symbols_fd" = x""yes; then
-
+rm -f conftest*
 
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_GLIBC_BACKTRACE 1
+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>
 
-
+_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
 
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_closelog_decl" >&5
+$as_echo "$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
 
-#
-# 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_have_accept=no
+ice_have_connect=no
 
-for ac_func in accept
+for ac_func in connect
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -59473,18 +60382,18 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_accept=yes
+ ice_have_connect=yes
 fi
 done
 
-if test "${ice_have_accept}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for accept declaration in sys/types.h sys/socket.h" >&5
-$as_echo_n "checking for accept declaration in sys/types.h sys/socket.h... " >&6; }
-if test "${ice_cv_have_accept_decl+set}" = set; then
+if test "${ice_have_connect}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for connect declaration in sys/types.h sys/socket.h" >&5
+$as_echo_n "checking for connect declaration in sys/types.h sys/socket.h... " >&6; }
+if test "${ice_cv_have_connect_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_accept_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
@@ -59499,12 +60408,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _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
+  $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_accept_decl" = yes; then
+if test "$ice_cv_have_connect_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -59518,34 +60427,38 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _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
+  $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_accept_decl" = yes; then
+if test "$ice_cv_have_connect_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_accept_decl" >&5
-$as_echo "$ice_cv_have_accept_decl" >&6; }
-if test "$ice_cv_have_accept_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_connect_decl" >&5
+$as_echo "$ice_cv_have_connect_decl" >&6; }
+if test "$ice_cv_have_connect_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_ACCEPT_DECL 1
+#define HAVE_CONNECT_DECL 1
 _ACEOF
 
 fi
 fi
 
-# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
-# for constant arguments.  Useless!
-{ $as_echo "$as_me:$LINENO: checking for working alloca.h" >&5
-$as_echo_n "checking for working alloca.h... " >&6; }
-if test "${ac_cv_working_alloca_h+set}" = set; then
+
+ice_have_fclose=no
+
+for ac_func in fclose
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -59554,12 +60467,41 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <alloca.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 ()
 {
-char *p = (char *) alloca (2 * sizeof (int));
-                         if (p) return 0;
+return $ac_func ();
   ;
   return 0;
 }
@@ -59585,156 +60527,102 @@ $as_echo "$ac_try_echo") >&5
         test "$cross_compiling" = yes ||
         $as_test_x conftest$ac_exeext
        }; then
-  ac_cv_working_alloca_h=yes
+  eval "$as_ac_var=yes"
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_working_alloca_h=no
+       eval "$as_ac_var=no"
 fi
 
 rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5
-$as_echo "$ac_cv_working_alloca_h" >&6; }
-if test $ac_cv_working_alloca_h = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_ALLOCA_H 1
+ac_res=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
-
+ ice_have_fclose=yes
 fi
+done
 
-{ $as_echo "$as_me:$LINENO: checking for alloca" >&5
-$as_echo_n "checking for alloca... " >&6; }
-if test "${ac_cv_func_alloca_works+set}" = set; then
+if test "${ice_have_fclose}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for fclose declaration in stdio.h" >&5
+$as_echo_n "checking for fclose declaration in stdio.h... " >&6; }
+if test "${ice_cv_have_fclose_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+
+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
+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
-#  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
+#include <$header>
 
-int
-main ()
-{
-char *p = (char *) alloca (1);
-                                   if (p) 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_func_alloca_works=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_cv_func_alloca_works=no
+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 -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+if test "$ice_cv_have_fclose_decl" = yes; then
+       break
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5
-$as_echo "$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
-  # 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
-
-
-{ $as_echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5
-$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; }
-if test "${ac_cv_os_cray+set}" = set; then
-  $as_echo_n "(cached) " >&6
-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.  */
-#if defined CRAY && ! defined CRAY2
-webecray
-#else
-wenotbecray
-#endif
+#include <$header>
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "webecray" >/dev/null 2>&1; then
-  ac_cv_os_cray=yes
-else
-  ac_cv_os_cray=no
+  $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
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5
-$as_echo "$ac_cv_os_cray" >&6; }
-if test $ac_cv_os_cray = yes; then
-  for ac_func in _getb67 GETB67 getb67; do
-    as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+done
+
+fi
+
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_fclose_decl" >&5
+$as_echo "$ice_cv_have_fclose_decl" >&6; }
+if test "$ice_cv_have_fclose_decl" = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_FCLOSE_DECL 1
+_ACEOF
+
+fi
+fi
+
+
+ice_have_fflush=no
+
+for ac_func in fflush
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
 $as_echo_n "checking for $ac_func... " >&6; }
 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
@@ -59825,101 +60713,81 @@ $as_echo "$ac_res" >&6; }
 as_val=`eval 'as_val=${'$as_ac_var'}
                 $as_echo "$as_val"'`
    if test "x$as_val" = x""yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define CRAY_STACKSEG_END $ac_func
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
-
-    break
-fi
-
-  done
+ ice_have_fflush=yes
 fi
+done
 
-{ $as_echo "$as_me:$LINENO: checking stack direction for C alloca" >&5
-$as_echo_n "checking stack direction for C alloca... " >&6; }
-if test "${ac_cv_c_stack_direction+set}" = set; then
+if test "${ice_have_fflush}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for fflush declaration in stdio.h" >&5
+$as_echo_n "checking for fflush declaration in stdio.h... " >&6; }
+if test "${ice_cv_have_fflush_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  if test "$cross_compiling" = yes; then
-  ac_cv_c_stack_direction=0
-else
-  cat >conftest.$ac_ext <<_ACEOF
+
+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
+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;
-}
+#include <$header>
 
-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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_c_stack_direction=1
-else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+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
+fi
+rm -f conftest*
 
-( exit $ac_status )
-ac_cv_c_stack_direction=-1
+if test "$ice_cv_have_fflush_decl" = yes; then
+       break
 fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* 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}fflush[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_fflush_decl=yes
 fi
+rm -f conftest*
 
+if test "$ice_cv_have_fflush_decl" = yes; then
+       break
+fi
+done
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5
-$as_echo "$ac_cv_c_stack_direction" >&6; }
+
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_fflush_decl" >&5
+$as_echo "$ice_cv_have_fflush_decl" >&6; }
+if test "$ice_cv_have_fflush_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define STACK_DIRECTION $ac_cv_c_stack_direction
+#define HAVE_FFLUSH_DECL 1
 _ACEOF
 
-
+fi
 fi
 
 
-for ac_func in atexit
+ice_have_fprintf=no
+
+for ac_func in fprintf
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -60015,14 +60883,78 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
+ ice_have_fprintf=yes
+fi
+done
+
+if test "${ice_have_fprintf}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for fprintf declaration in stdio.h" >&5
+$as_echo_n "checking for fprintf declaration in stdio.h... " >&6; }
+if test "${ice_cv_have_fprintf_decl+set}" = set; then
+  $as_echo_n "(cached) " >&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
+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>
+
+_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*
 
+if test "$ice_cv_have_fprintf_decl" = yes; then
+       break
 fi
 done
 
+fi
+
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_fprintf_decl" >&5
+$as_echo "$ice_cv_have_fprintf_decl" >&6; }
+if test "$ice_cv_have_fprintf_decl" = yes; then
 
-ice_have_atof=no
+cat >>confdefs.h <<_ACEOF
+#define HAVE_FPRINTF_DECL 1
+_ACEOF
 
-for ac_func in atof
+fi
+fi
+
+
+ice_have_fputc=no
+
+for ac_func in fputc
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -60118,21 +61050,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_atof=yes
+ ice_have_fputc=yes
 fi
 done
 
-if test "${ice_have_atof}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for atof declaration in stdlib.h" >&5
-$as_echo_n "checking for atof declaration in stdlib.h... " >&6; }
-if test "${ice_cv_have_atof_decl+set}" = set; then
+if test "${ice_have_fputc}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for fputc declaration in stdio.h" >&5
+$as_echo_n "checking for fputc declaration in stdio.h... " >&6; }
+if test "${ice_cv_have_fputc_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_atof_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 stdlib.h; do
+for header in stdio.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -60144,12 +61076,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _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
+  $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_atof_decl" = yes; then
+if test "$ice_cv_have_fputc_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -60163,33 +61095,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _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
+  $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_atof_decl" = yes; then
+if test "$ice_cv_have_fputc_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_atof_decl" >&5
-$as_echo "$ice_cv_have_atof_decl" >&6; }
-if test "$ice_cv_have_atof_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_fputc_decl" >&5
+$as_echo "$ice_cv_have_fputc_decl" >&6; }
+if test "$ice_cv_have_fputc_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_ATOF_DECL 1
+#define HAVE_FPUTC_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_atol=no
+ice_have_fputs=no
 
-for ac_func in atol
+for ac_func in fputs
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -60285,21 +61217,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_atol=yes
+ ice_have_fputs=yes
 fi
 done
 
-if test "${ice_have_atol}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for atol declaration in stdlib.h" >&5
-$as_echo_n "checking for atol declaration in stdlib.h... " >&6; }
-if test "${ice_cv_have_atol_decl+set}" = set; then
+if test "${ice_have_fputs}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for fputs declaration in stdio.h" >&5
+$as_echo_n "checking for fputs declaration in stdio.h... " >&6; }
+if test "${ice_cv_have_fputs_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_atol_decl=no
+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 stdlib.h; do
+for header in stdio.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -60311,12 +61243,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _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
+  $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_atol_decl" = yes; then
+if test "$ice_cv_have_fputs_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -60330,33 +61262,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _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
+  $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_atol_decl" = yes; then
+if test "$ice_cv_have_fputs_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_atol_decl" >&5
-$as_echo "$ice_cv_have_atol_decl" >&6; }
-if test "$ice_cv_have_atol_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_fputs_decl" >&5
+$as_echo "$ice_cv_have_fputs_decl" >&6; }
+if test "$ice_cv_have_fputs_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_ATOL_DECL 1
+#define HAVE_FPUTS_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_atoll=no
+ice_have_fread=no
 
-for ac_func in atoll
+for ac_func in fread
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -60452,21 +61384,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_atoll=yes
+ ice_have_fread=yes
 fi
 done
 
-if test "${ice_have_atoll}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for atoll declaration in stdlib.h" >&5
-$as_echo_n "checking for atoll declaration in stdlib.h... " >&6; }
-if test "${ice_cv_have_atoll_decl+set}" = set; then
+if test "${ice_have_fread}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for fread declaration in stdio.h stdlib.h" >&5
+$as_echo_n "checking for fread declaration in stdio.h stdlib.h... " >&6; }
+if test "${ice_cv_have_fread_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_atoll_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.  */
@@ -60478,12 +61410,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _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
+  $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_atoll_decl" = yes; then
+if test "$ice_cv_have_fread_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -60497,33 +61429,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _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
+  $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_atoll_decl" = yes; then
+if test "$ice_cv_have_fread_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_atoll_decl" >&5
-$as_echo "$ice_cv_have_atoll_decl" >&6; }
-if test "$ice_cv_have_atoll_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_fread_decl" >&5
+$as_echo "$ice_cv_have_fread_decl" >&6; }
+if test "$ice_cv_have_fread_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_ATOLL_DECL 1
+#define HAVE_FREAD_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_strtol=no
+ice_have_fseek=no
 
-for ac_func in strtol
+for ac_func in fseek
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -60619,21 +61551,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_strtol=yes
+ ice_have_fseek=yes
 fi
 done
 
-if test "${ice_have_strtol}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for strtol declaration in stdlib.h" >&5
-$as_echo_n "checking for strtol declaration in stdlib.h... " >&6; }
-if test "${ice_cv_have_strtol_decl+set}" = set; then
+if test "${ice_have_fseek}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for fseek declaration in stdio.h" >&5
+$as_echo_n "checking for fseek declaration in stdio.h... " >&6; }
+if test "${ice_cv_have_fseek_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_strtol_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.  */
@@ -60645,12 +61577,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _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
+  $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_strtol_decl" = yes; then
+if test "$ice_cv_have_fseek_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -60664,33 +61596,198 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _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
+  $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_strtol_decl" = yes; then
+if test "$ice_cv_have_fseek_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_strtol_decl" >&5
-$as_echo "$ice_cv_have_strtol_decl" >&6; }
-if test "$ice_cv_have_strtol_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_fseek_decl" >&5
+$as_echo "$ice_cv_have_fseek_decl" >&6; }
+if test "$ice_cv_have_fseek_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_STRTOL_DECL 1
+#define HAVE_FSEEK_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_strtoll=no
+ice_have_fwrite=no
 
-for ac_func in strtoll
+for ac_func in fwrite
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  eval "$as_ac_var=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_ac_var=no"
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+ ice_have_fwrite=yes
+fi
+done
+
+if test "${ice_have_fwrite}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for fwrite declaration in stdio.h stdlib.h" >&5
+$as_echo_n "checking for fwrite declaration in stdio.h stdlib.h... " >&6; }
+if test "${ice_cv_have_fwrite_decl+set}" = set; then
+  $as_echo_n "(cached) " >&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
+fi
+rm -f conftest*
+
+if test "$ice_cv_have_fwrite_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}fwrite[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_fwrite_decl=yes
+fi
+rm -f conftest*
+
+if test "$ice_cv_have_fwrite_decl" = yes; then
+       break
+fi
+done
+
+fi
+
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_fwrite_decl" >&5
+$as_echo "$ice_cv_have_fwrite_decl" >&6; }
+if test "$ice_cv_have_fwrite_decl" = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_FWRITE_DECL 1
+_ACEOF
+
+fi
+fi
+
+
+for ac_func in getgrgid_r
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -60786,76 +61883,12 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_strtoll=yes
-fi
-done
-
-if test "${ice_have_strtoll}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for strtoll declaration in stdlib.h" >&5
-$as_echo_n "checking for strtoll declaration in stdlib.h... " >&6; }
-if test "${ice_cv_have_strtoll_decl+set}" = set; then
-  $as_echo_n "(cached) " >&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
-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[       ]*\(" >/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
-/* 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
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_strtoll_decl" >&5
-$as_echo "$ice_cv_have_strtoll_decl" >&6; }
-if test "$ice_cv_have_strtoll_decl" = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRTOLL_DECL 1
-_ACEOF
-
-fi
-fi
-
-
-for ac_func in basename
+for ac_func in getpwuid_r
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -60956,9 +61989,9 @@ fi
 done
 
 
-ice_have_bind=no
+ice_have_gethostname=no
 
-for ac_func in bind
+for ac_func in gethostname
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -61054,21 +62087,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_bind=yes
+ ice_have_gethostname=yes
 fi
 done
 
-if test "${ice_have_bind}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for bind declaration in sys/types.h sys/socket.h" >&5
-$as_echo_n "checking for bind declaration in sys/types.h sys/socket.h... " >&6; }
-if test "${ice_cv_have_bind_decl+set}" = set; then
+if test "${ice_have_gethostname}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for gethostname declaration in unistd.h" >&5
+$as_echo_n "checking for gethostname declaration in unistd.h... " >&6; }
+if test "${ice_cv_have_gethostname_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_bind_decl=no
+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 sys/types.h sys/socket.h; do
+for header in unistd.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -61080,12 +62113,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _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
+  $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_bind_decl" = yes; then
+if test "$ice_cv_have_gethostname_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -61099,33 +62132,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _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
+  $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_bind_decl" = yes; then
+if test "$ice_cv_have_gethostname_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_bind_decl" >&5
-$as_echo "$ice_cv_have_bind_decl" >&6; }
-if test "$ice_cv_have_bind_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_gethostname_decl" >&5
+$as_echo "$ice_cv_have_gethostname_decl" >&6; }
+if test "$ice_cv_have_gethostname_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_BIND_DECL 1
+#define HAVE_GETHOSTNAME_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_bcopy=no
+ice_have_getopt=no
 
-for ac_func in bcopy
+for ac_func in getopt
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -61221,21 +62254,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_bcopy=yes
+ ice_have_getopt=yes
 fi
 done
 
-if test "${ice_have_bcopy}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for bcopy declaration in string.h strings.h stdlib.h" >&5
-$as_echo_n "checking for bcopy declaration in string.h strings.h stdlib.h... " >&6; }
-if test "${ice_cv_have_bcopy_decl+set}" = set; then
+if test "${ice_have_getopt}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for getopt declaration in stdlib.h unistd.h libc.h" >&5
+$as_echo_n "checking for getopt declaration in stdlib.h unistd.h libc.h... " >&6; }
+if test "${ice_cv_have_getopt_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_bcopy_decl=no
+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 string.h strings.h stdlib.h; do
+for header in stdlib.h unistd.h libc.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -61247,12 +62280,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _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
+  $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_bcopy_decl" = yes; then
+if test "$ice_cv_have_getopt_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -61266,33 +62299,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _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
+  $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_bcopy_decl" = yes; then
+if test "$ice_cv_have_getopt_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_bcopy_decl" >&5
-$as_echo "$ice_cv_have_bcopy_decl" >&6; }
-if test "$ice_cv_have_bcopy_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_getopt_decl" >&5
+$as_echo "$ice_cv_have_getopt_decl" >&6; }
+if test "$ice_cv_have_getopt_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_BCOPY_DECL 1
+#define HAVE_GETOPT_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_bzero=no
+ice_have_getpeername=no
 
-for ac_func in bzero
+for ac_func in getpeername
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -61388,21 +62421,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_bzero=yes
+ ice_have_getpeername=yes
 fi
 done
 
-if test "${ice_have_bzero}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for bzero declaration in string.h strings.h stdlib.h" >&5
-$as_echo_n "checking for bzero declaration in string.h strings.h stdlib.h... " >&6; }
-if test "${ice_cv_have_bzero_decl+set}" = set; then
+if test "${ice_have_getpeername}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for getpeername declaration in sys/types.h sys/socket.h" >&5
+$as_echo_n "checking for getpeername declaration in sys/types.h sys/socket.h... " >&6; }
+if test "${ice_cv_have_getpeername_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_bzero_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 string.h strings.h stdlib.h; do
+for header in sys/types.h sys/socket.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -61414,12 +62447,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _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 "${ice_re_word}getpeername[   ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_getpeername_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_bzero_decl" = yes; then
+if test "$ice_cv_have_getpeername_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -61433,113 +62466,32 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _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
+  $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_bzero_decl" = yes; then
+if test "$ice_cv_have_getpeername_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_bzero_decl" >&5
-$as_echo "$ice_cv_have_bzero_decl" >&6; }
-if test "$ice_cv_have_bzero_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_getpeername_decl" >&5
+$as_echo "$ice_cv_have_getpeername_decl" >&6; }
+if test "$ice_cv_have_getpeername_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_BZERO_DECL 1
-_ACEOF
-
-fi
-fi
-
-{ $as_echo "$as_me:$LINENO: checking whether closedir returns void" >&5
-$as_echo_n "checking whether closedir returns void... " >&6; }
-if test "${ac_cv_func_closedir_void+set}" = set; then
-  $as_echo_n "(cached) " >&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
-
-int
-main ()
-{
-return closedir (opendir (".")) != 0;
-  ;
-  return 0;
-}
+#define HAVE_GETPEERNAME_DECL 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_closedir_void=no
-else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_func_closedir_void=yes
-fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_closedir_void" >&5
-$as_echo "$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=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+{ $as_echo "$as_me:$LINENO: checking for getpgrp" >&5
+$as_echo_n "checking for getpgrp... " >&6; }
+if test "${ac_cv_func_getpgrp+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -61548,12 +62500,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 getpgrp to an innocuous variant, in case <limits.h> declares getpgrp.
    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
+#define getpgrp innocuous_getpgrp
 
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
+    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.  */
 
@@ -61563,7 +62515,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 # include <assert.h>
 #endif
 
-#undef $ac_func
+#undef getpgrp
 
 /* Override any GCC internal prototype to avoid an error.
    Use char because int might match the return type of a GCC
@@ -61571,18 +62523,18 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char $ac_func ();
+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_$ac_func || defined __stub___$ac_func
+#if defined __stub_getpgrp || defined __stub___getpgrp
 choke me
 #endif
 
 int
 main ()
 {
-return $ac_func ();
+return getpgrp ();
   ;
   return 0;
 }
@@ -61608,100 +62560,85 @@ $as_echo "$ac_try_echo") >&5
         test "$cross_compiling" = yes ||
         $as_test_x conftest$ac_exeext
        }; then
-  eval "$as_ac_var=yes"
+  ac_cv_func_getpgrp=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       eval "$as_ac_var=no"
+       ac_cv_func_getpgrp=no
 fi
 
 rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-as_val=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
- ice_have_closelog=yes
-fi
-done
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_getpgrp" >&5
+$as_echo "$ac_cv_func_getpgrp" >&6; }
 
-if test "${ice_have_closelog}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for closelog declaration in syslog.h" >&5
-$as_echo_n "checking for closelog declaration in syslog.h... " >&6; }
-if test "${ice_cv_have_closelog_decl+set}" = set; then
+{ $as_echo "$as_me:$LINENO: checking whether getpgrp requires zero arguments" >&5
+$as_echo_n "checking whether getpgrp requires zero arguments... " >&6; }
+if test "${ac_cv_func_getpgrp_void+set}" = set; then
   $as_echo_n "(cached) " >&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
+  # 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.  */
-#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
-fi
-rm -f conftest*
-
-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.  */
+$ac_includes_default
+int
+main ()
+{
+getpgrp (0);
+  ;
+  return 0;
+}
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_func_getpgrp_void=no
+else
+  $as_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}closelog[      ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_closelog_decl=yes
+       ac_cv_func_getpgrp_void=yes
 fi
-rm -f conftest*
 
-if test "$ice_cv_have_closelog_decl" = yes; then
-       break
-fi
-done
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_getpgrp_void" >&5
+$as_echo "$ac_cv_func_getpgrp_void" >&6; }
+if test $ac_cv_func_getpgrp_void = yes; then
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_closelog_decl" >&5
-$as_echo "$ice_cv_have_closelog_decl" >&6; }
-if test "$ice_cv_have_closelog_decl" = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_CLOSELOG_DECL 1
+cat >>confdefs.h <<\_ACEOF
+#define GETPGRP_VOID 1
 _ACEOF
 
 fi
-fi
 
 
-ice_have_connect=no
+ice_have_getsockname=no
 
-for ac_func in connect
+for ac_func in getsockname
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -61797,18 +62734,18 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_connect=yes
+ ice_have_getsockname=yes
 fi
 done
 
-if test "${ice_have_connect}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for connect declaration in sys/types.h sys/socket.h" >&5
-$as_echo_n "checking for connect declaration in sys/types.h sys/socket.h... " >&6; }
-if test "${ice_cv_have_connect_decl+set}" = set; then
+if test "${ice_have_getsockname}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for getsockname declaration in sys/types.h sys/socket.h" >&5
+$as_echo_n "checking for getsockname declaration in sys/types.h sys/socket.h... " >&6; }
+if test "${ice_cv_have_getsockname_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_connect_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 sys/types.h sys/socket.h; do
@@ -61823,12 +62760,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _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
+  $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_connect_decl" = yes; then
+if test "$ice_cv_have_getsockname_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -61842,33 +62779,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _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
+  $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_connect_decl" = yes; then
+if test "$ice_cv_have_getsockname_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_connect_decl" >&5
-$as_echo "$ice_cv_have_connect_decl" >&6; }
-if test "$ice_cv_have_connect_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_getsockname_decl" >&5
+$as_echo "$ice_cv_have_getsockname_decl" >&6; }
+if test "$ice_cv_have_getsockname_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_CONNECT_DECL 1
+#define HAVE_GETSOCKNAME_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_fclose=no
+ice_have_getsockopt=no
 
-for ac_func in fclose
+for ac_func in getsockopt
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -61964,21 +62901,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_fclose=yes
+ ice_have_getsockopt=yes
 fi
 done
 
-if test "${ice_have_fclose}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for fclose declaration in stdio.h" >&5
-$as_echo_n "checking for fclose declaration in stdio.h... " >&6; }
-if test "${ice_cv_have_fclose_decl+set}" = set; then
+if test "${ice_have_getsockopt}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for getsockopt declaration in sys/types.h sys/socket.h" >&5
+$as_echo_n "checking for getsockopt declaration in sys/types.h sys/socket.h... " >&6; }
+if test "${ice_cv_have_getsockopt_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_fclose_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.  */
@@ -61990,12 +62927,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _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
+  $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_fclose_decl" = yes; then
+if test "$ice_cv_have_getsockopt_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -62009,33 +62946,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _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
+  $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_fclose_decl" = yes; then
+if test "$ice_cv_have_getsockopt_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_fclose_decl" >&5
-$as_echo "$ice_cv_have_fclose_decl" >&6; }
-if test "$ice_cv_have_fclose_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_getsockopt_decl" >&5
+$as_echo "$ice_cv_have_getsockopt_decl" >&6; }
+if test "$ice_cv_have_getsockopt_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_FCLOSE_DECL 1
+#define HAVE_GETSOCKOPT_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_fflush=no
+ice_have_initgroups=no
 
-for ac_func in fflush
+for ac_func in initgroups
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -62131,21 +63068,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_fflush=yes
+ ice_have_initgroups=yes
 fi
 done
 
-if test "${ice_have_fflush}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for fflush declaration in stdio.h" >&5
-$as_echo_n "checking for fflush declaration in stdio.h... " >&6; }
-if test "${ice_cv_have_fflush_decl+set}" = set; then
+if test "${ice_have_initgroups}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for initgroups declaration in grp.h sys/types.h unistd.h libc.h" >&5
+$as_echo_n "checking for initgroups declaration in grp.h sys/types.h unistd.h libc.h... " >&6; }
+if test "${ice_cv_have_initgroups_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_fflush_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.  */
@@ -62157,12 +63094,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _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
+  $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_fflush_decl" = yes; then
+if test "$ice_cv_have_initgroups_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -62176,33 +63113,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _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
+  $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_fflush_decl" = yes; then
+if test "$ice_cv_have_initgroups_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_fflush_decl" >&5
-$as_echo "$ice_cv_have_fflush_decl" >&6; }
-if test "$ice_cv_have_fflush_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_initgroups_decl" >&5
+$as_echo "$ice_cv_have_initgroups_decl" >&6; }
+if test "$ice_cv_have_initgroups_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_FFLUSH_DECL 1
+#define HAVE_INITGROUPS_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_fprintf=no
+ice_have_ioctl=no
 
-for ac_func in fprintf
+for ac_func in ioctl
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -62298,21 +63235,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_fprintf=yes
+ ice_have_ioctl=yes
 fi
 done
 
-if test "${ice_have_fprintf}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for fprintf declaration in stdio.h" >&5
-$as_echo_n "checking for fprintf declaration in stdio.h... " >&6; }
-if test "${ice_cv_have_fprintf_decl+set}" = set; then
+if test "${ice_have_ioctl}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for ioctl declaration in sys/ioctl.h unistd.h libc.h" >&5
+$as_echo_n "checking for ioctl declaration in sys/ioctl.h unistd.h libc.h... " >&6; }
+if test "${ice_cv_have_ioctl_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_fprintf_decl=no
+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 stdio.h; do
+for header in sys/ioctl.h unistd.h libc.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -62324,12 +63261,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _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
+  $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_fprintf_decl" = yes; then
+if test "$ice_cv_have_ioctl_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -62343,33 +63280,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _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
+  $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_fprintf_decl" = yes; then
+if test "$ice_cv_have_ioctl_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_fprintf_decl" >&5
-$as_echo "$ice_cv_have_fprintf_decl" >&6; }
-if test "$ice_cv_have_fprintf_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_ioctl_decl" >&5
+$as_echo "$ice_cv_have_ioctl_decl" >&6; }
+if test "$ice_cv_have_ioctl_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_FPRINTF_DECL 1
+#define HAVE_IOCTL_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_fputc=no
+ice_have_isnormal=no
 
-for ac_func in fputc
+for ac_func in isnormal
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -62465,21 +63402,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_fputc=yes
+ ice_have_isnormal=yes
 fi
 done
 
-if test "${ice_have_fputc}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for fputc declaration in stdio.h" >&5
-$as_echo_n "checking for fputc declaration in stdio.h... " >&6; }
-if test "${ice_cv_have_fputc_decl+set}" = set; then
+if test "${ice_have_isnormal}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for isnormal declaration in math.h" >&5
+$as_echo_n "checking for isnormal declaration in math.h... " >&6; }
+if test "${ice_cv_have_isnormal_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_fputc_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.  */
@@ -62491,12 +63428,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _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
+  $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_fputc_decl" = yes; then
+if test "$ice_cv_have_isnormal_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -62510,33 +63447,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _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
+  $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_fputc_decl" = yes; then
+if test "$ice_cv_have_isnormal_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_fputc_decl" >&5
-$as_echo "$ice_cv_have_fputc_decl" >&6; }
-if test "$ice_cv_have_fputc_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_isnormal_decl" >&5
+$as_echo "$ice_cv_have_isnormal_decl" >&6; }
+if test "$ice_cv_have_isnormal_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_FPUTC_DECL 1
+#define HAVE_ISNORMAL_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_fputs=no
+ice_have_listen=no
 
-for ac_func in fputs
+for ac_func in listen
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -62632,21 +63569,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_fputs=yes
+ ice_have_listen=yes
 fi
 done
 
-if test "${ice_have_fputs}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for fputs declaration in stdio.h" >&5
-$as_echo_n "checking for fputs declaration in stdio.h... " >&6; }
-if test "${ice_cv_have_fputs_decl+set}" = set; then
+if test "${ice_have_listen}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for listen declaration in sys/types.h sys/socket.h" >&5
+$as_echo_n "checking for listen declaration in sys/types.h sys/socket.h... " >&6; }
+if test "${ice_cv_have_listen_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_fputs_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 stdio.h; do
+for header in sys/types.h sys/socket.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -62658,12 +63595,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _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
+  $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_fputs_decl" = yes; then
+if test "$ice_cv_have_listen_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -62677,33 +63614,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _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
+  $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_fputs_decl" = yes; then
+if test "$ice_cv_have_listen_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_fputs_decl" >&5
-$as_echo "$ice_cv_have_fputs_decl" >&6; }
-if test "$ice_cv_have_fputs_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_listen_decl" >&5
+$as_echo "$ice_cv_have_listen_decl" >&6; }
+if test "$ice_cv_have_listen_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_FPUTS_DECL 1
+#define HAVE_LISTEN_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_fread=no
+ice_have_lstat=no
 
-for ac_func in fread
+for ac_func in lstat
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -62799,21 +63736,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_fread=yes
+ ice_have_lstat=yes
 fi
 done
 
-if test "${ice_have_fread}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for fread declaration in stdio.h stdlib.h" >&5
-$as_echo_n "checking for fread declaration in stdio.h stdlib.h... " >&6; }
-if test "${ice_cv_have_fread_decl+set}" = set; then
+if test "${ice_have_lstat}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for lstat declaration in sys/types.h sys/stat.h" >&5
+$as_echo_n "checking for lstat declaration in sys/types.h sys/stat.h... " >&6; }
+if test "${ice_cv_have_lstat_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_fread_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 stdio.h stdlib.h; do
+for header in sys/types.h sys/stat.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -62825,12 +63762,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _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
+  $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_fread_decl" = yes; then
+if test "$ice_cv_have_lstat_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -62844,33 +63781,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _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
+  $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_fread_decl" = yes; then
+if test "$ice_cv_have_lstat_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_fread_decl" >&5
-$as_echo "$ice_cv_have_fread_decl" >&6; }
-if test "$ice_cv_have_fread_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_lstat_decl" >&5
+$as_echo "$ice_cv_have_lstat_decl" >&6; }
+if test "$ice_cv_have_lstat_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_FREAD_DECL 1
+#define HAVE_LSTAT_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_fseek=no
+ice_have_malloc=no
 
-for ac_func in fseek
+for ac_func in malloc
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -62966,21 +63903,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_fseek=yes
+ ice_have_malloc=yes
 fi
 done
 
-if test "${ice_have_fseek}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for fseek declaration in stdio.h" >&5
-$as_echo_n "checking for fseek declaration in stdio.h... " >&6; }
-if test "${ice_cv_have_fseek_decl+set}" = set; then
+if test "${ice_have_malloc}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for malloc declaration in stdlib.h" >&5
+$as_echo_n "checking for malloc declaration in stdlib.h... " >&6; }
+if test "${ice_cv_have_malloc_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_fseek_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.  */
@@ -62992,12 +63929,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _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
+  $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_fseek_decl" = yes; then
+if test "$ice_cv_have_malloc_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -63011,33 +63948,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _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
+  $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_fseek_decl" = yes; then
+if test "$ice_cv_have_malloc_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_fseek_decl" >&5
-$as_echo "$ice_cv_have_fseek_decl" >&6; }
-if test "$ice_cv_have_fseek_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_malloc_decl" >&5
+$as_echo "$ice_cv_have_malloc_decl" >&6; }
+if test "$ice_cv_have_malloc_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_FSEEK_DECL 1
+#define HAVE_MALLOC_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_fwrite=no
+ice_have_memmove=no
 
-for ac_func in fwrite
+for ac_func in memmove
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -63133,21 +64070,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_fwrite=yes
+ ice_have_memmove=yes
 fi
 done
 
-if test "${ice_have_fwrite}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for fwrite declaration in stdio.h stdlib.h" >&5
-$as_echo_n "checking for fwrite declaration in stdio.h stdlib.h... " >&6; }
-if test "${ice_cv_have_fwrite_decl+set}" = set; then
+if test "${ice_have_memmove}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for memmove declaration in string.h strings.h" >&5
+$as_echo_n "checking for memmove declaration in string.h strings.h... " >&6; }
+if test "${ice_cv_have_memmove_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_fwrite_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 stdlib.h; do
+for header in string.h strings.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -63159,12 +64096,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _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
+  $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_fwrite_decl" = yes; then
+if test "$ice_cv_have_memmove_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -63178,31 +64115,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _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
+  $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_fwrite_decl" = yes; then
+if test "$ice_cv_have_memmove_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_fwrite_decl" >&5
-$as_echo "$ice_cv_have_fwrite_decl" >&6; }
-if test "$ice_cv_have_fwrite_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_memmove_decl" >&5
+$as_echo "$ice_cv_have_memmove_decl" >&6; }
+if test "$ice_cv_have_memmove_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_FWRITE_DECL 1
+#define HAVE_MEMMOVE_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-for ac_func in getgrgid_r
+ice_have_memset=no
+
+for ac_func in memset
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -63298,115 +64237,78 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
-
+ ice_have_memset=yes
 fi
 done
 
-
-for ac_func in getpwuid_r
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+if test "${ice_have_memset}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for memset declaration in string.h strings.h" >&5
+$as_echo_n "checking for memset declaration in string.h strings.h... " >&6; }
+if test "${ice_cv_have_memset_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+
+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 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 $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
+#include <$header>
 
-#undef $ac_func
+_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
+fi
+rm -f conftest*
 
-/* 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 "$ice_cv_have_memset_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 $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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_var=yes"
-else
-  $as_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}memset[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_memset_decl=yes
+fi
+rm -f conftest*
 
-       eval "$as_ac_var=no"
+if test "$ice_cv_have_memset_decl" = yes; then
+       break
 fi
+done
 
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-as_val=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_memset_decl" >&5
+$as_echo "$ice_cv_have_memset_decl" >&6; }
+if test "$ice_cv_have_memset_decl" = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_MEMSET_DECL 1
 _ACEOF
 
 fi
-done
+fi
 
 
-ice_have_gethostname=no
+ice_have_mkstemp=no
 
-for ac_func in gethostname
+for ac_func in mkstemp
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -63502,21 +64404,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_gethostname=yes
+ ice_have_mkstemp=yes
 fi
 done
 
-if test "${ice_have_gethostname}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for gethostname declaration in unistd.h" >&5
-$as_echo_n "checking for gethostname declaration in unistd.h... " >&6; }
-if test "${ice_cv_have_gethostname_decl+set}" = set; then
+if test "${ice_have_mkstemp}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for mkstemp declaration in stdlib.h" >&5
+$as_echo_n "checking for mkstemp declaration in stdlib.h... " >&6; }
+if test "${ice_cv_have_mkstemp_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_gethostname_decl=no
+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 unistd.h; do
+for header in stdlib.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -63528,12 +64430,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}mkstemp[       ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_mkstemp_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_gethostname_decl" = yes; then
+if test "$ice_cv_have_mkstemp_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -63547,33 +64449,33 @@ 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}mkstemp[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_mkstemp_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_gethostname_decl" = yes; then
+if test "$ice_cv_have_mkstemp_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_gethostname_decl" >&5
-$as_echo "$ice_cv_have_gethostname_decl" >&6; }
-if test "$ice_cv_have_gethostname_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_mkstemp_decl" >&5
+$as_echo "$ice_cv_have_mkstemp_decl" >&6; }
+if test "$ice_cv_have_mkstemp_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_GETHOSTNAME_DECL 1
+#define HAVE_MKSTEMP_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_getopt=no
+ice_have_mktemp=no
 
-for ac_func in getopt
+for ac_func in mktemp
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -63669,21 +64571,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_getopt=yes
+ ice_have_mktemp=yes
 fi
 done
 
-if test "${ice_have_getopt}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for getopt declaration in stdlib.h unistd.h libc.h" >&5
-$as_echo_n "checking for getopt declaration in stdlib.h unistd.h libc.h... " >&6; }
-if test "${ice_cv_have_getopt_decl+set}" = set; then
+if test "${ice_have_mktemp}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for mktemp declaration in stdlib.h" >&5
+$as_echo_n "checking for mktemp declaration in stdlib.h... " >&6; }
+if test "${ice_cv_have_mktemp_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_getopt_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 stdlib.h unistd.h libc.h; do
+for header in stdlib.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -63695,12 +64597,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _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
+  $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_getopt_decl" = yes; then
+if test "$ice_cv_have_mktemp_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -63714,33 +64616,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _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
+  $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_getopt_decl" = yes; then
+if test "$ice_cv_have_mktemp_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_getopt_decl" >&5
-$as_echo "$ice_cv_have_getopt_decl" >&6; }
-if test "$ice_cv_have_getopt_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_mktemp_decl" >&5
+$as_echo "$ice_cv_have_mktemp_decl" >&6; }
+if test "$ice_cv_have_mktemp_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_GETOPT_DECL 1
+#define HAVE_MKTEMP_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_getpeername=no
+ice_have_mktime=no
 
-for ac_func in getpeername
+for ac_func in mktime
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -63836,21 +64738,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_getpeername=yes
+ ice_have_mktime=yes
 fi
 done
 
-if test "${ice_have_getpeername}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for getpeername declaration in sys/types.h sys/socket.h" >&5
-$as_echo_n "checking for getpeername declaration in sys/types.h sys/socket.h... " >&6; }
-if test "${ice_cv_have_getpeername_decl+set}" = set; then
+if test "${ice_have_mktime}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for mktime declaration in time.h sys/time.h" >&5
+$as_echo_n "checking for mktime declaration in time.h sys/time.h... " >&6; }
+if test "${ice_cv_have_mktime_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_getpeername_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; do
+for header in time.h sys/time.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -63862,12 +64764,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}mktime[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_mktime_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_getpeername_decl" = yes; then
+if test "$ice_cv_have_mktime_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -63881,32 +64783,36 @@ 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}mktime[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_mktime_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_getpeername_decl" = yes; then
+if test "$ice_cv_have_mktime_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_getpeername_decl" >&5
-$as_echo "$ice_cv_have_getpeername_decl" >&6; }
-if test "$ice_cv_have_getpeername_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_mktime_decl" >&5
+$as_echo "$ice_cv_have_mktime_decl" >&6; }
+if test "$ice_cv_have_mktime_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_GETPEERNAME_DECL 1
+#define HAVE_MKTIME_DECL 1
 _ACEOF
 
 fi
 fi
 
-{ $as_echo "$as_me:$LINENO: checking for getpgrp" >&5
-$as_echo_n "checking for getpgrp... " >&6; }
-if test "${ac_cv_func_getpgrp+set}" = set; then
+
+for ac_func in on_exit
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -63915,12 +64821,12 @@ _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.
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define getpgrp innocuous_getpgrp
+#define $ac_func innocuous_$ac_func
 
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char getpgrp (); 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.  */
 
@@ -63930,7 +64836,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 # include <assert.h>
 #endif
 
-#undef getpgrp
+#undef $ac_func
 
 /* Override any GCC internal prototype to avoid an error.
    Use char because int might match the return type of a GCC
@@ -63938,18 +64844,18 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char getpgrp ();
+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_getpgrp || defined __stub___getpgrp
+#if defined __stub_$ac_func || defined __stub___$ac_func
 choke me
 #endif
 
 int
 main ()
 {
-return getpgrp ();
+return $ac_func ();
   ;
   return 0;
 }
@@ -63975,85 +64881,36 @@ $as_echo "$ac_try_echo") >&5
         test "$cross_compiling" = yes ||
         $as_test_x conftest$ac_exeext
        }; then
-  ac_cv_func_getpgrp=yes
+  eval "$as_ac_var=yes"
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_func_getpgrp=no
+       eval "$as_ac_var=no"
 fi
 
 rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_getpgrp" >&5
-$as_echo "$ac_cv_func_getpgrp" >&6; }
-
-{ $as_echo "$as_me:$LINENO: checking whether getpgrp requires zero arguments" >&5
-$as_echo_n "checking whether getpgrp requires zero arguments... " >&6; }
-if test "${ac_cv_func_getpgrp_void+set}" = set; then
-  $as_echo_n "(cached) " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_cv_func_getpgrp_void=no
-else
-  $as_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
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_getpgrp_void" >&5
-$as_echo "$ac_cv_func_getpgrp_void" >&6; }
-if test $ac_cv_func_getpgrp_void = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define GETPGRP_VOID 1
+ac_res=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
+done
 
 
-ice_have_getsockname=no
+ice_have_openlog=no
 
-for ac_func in getsockname
+for ac_func in openlog
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -64149,21 +65006,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_getsockname=yes
+ ice_have_openlog=yes
 fi
 done
 
-if test "${ice_have_getsockname}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for getsockname declaration in sys/types.h sys/socket.h" >&5
-$as_echo_n "checking for getsockname declaration in sys/types.h sys/socket.h... " >&6; }
-if test "${ice_cv_have_getsockname_decl+set}" = set; then
+if test "${ice_have_openlog}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for openlog declaration in syslog.h" >&5
+$as_echo_n "checking for openlog declaration in syslog.h... " >&6; }
+if test "${ice_cv_have_openlog_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_getsockname_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.  */
@@ -64175,12 +65032,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}openlog[       ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_openlog_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_getsockname_decl" = yes; then
+if test "$ice_cv_have_openlog_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -64194,33 +65051,33 @@ 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}openlog[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_openlog_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_getsockname_decl" = yes; then
+if test "$ice_cv_have_openlog_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_getsockname_decl" >&5
-$as_echo "$ice_cv_have_getsockname_decl" >&6; }
-if test "$ice_cv_have_getsockname_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_openlog_decl" >&5
+$as_echo "$ice_cv_have_openlog_decl" >&6; }
+if test "$ice_cv_have_openlog_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_GETSOCKNAME_DECL 1
+#define HAVE_OPENLOG_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_getsockopt=no
+ice_have_pclose=no
 
-for ac_func in getsockopt
+for ac_func in pclose
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -64316,21 +65173,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_getsockopt=yes
+ ice_have_pclose=yes
 fi
 done
 
-if test "${ice_have_getsockopt}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for getsockopt declaration in sys/types.h sys/socket.h" >&5
-$as_echo_n "checking for getsockopt declaration in sys/types.h sys/socket.h... " >&6; }
-if test "${ice_cv_have_getsockopt_decl+set}" = set; then
+if test "${ice_have_pclose}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for pclose declaration in stdio.h" >&5
+$as_echo_n "checking for pclose declaration in stdio.h... " >&6; }
+if test "${ice_cv_have_pclose_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_getsockopt_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 sys/types.h sys/socket.h; do
+for header in stdio.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -64342,12 +65199,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}pclose[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_pclose_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_getsockopt_decl" = yes; then
+if test "$ice_cv_have_pclose_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -64361,33 +65218,33 @@ 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}pclose[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_pclose_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_getsockopt_decl" = yes; then
+if test "$ice_cv_have_pclose_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_getsockopt_decl" >&5
-$as_echo "$ice_cv_have_getsockopt_decl" >&6; }
-if test "$ice_cv_have_getsockopt_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_pclose_decl" >&5
+$as_echo "$ice_cv_have_pclose_decl" >&6; }
+if test "$ice_cv_have_pclose_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_GETSOCKOPT_DECL 1
+#define HAVE_PCLOSE_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_initgroups=no
+ice_have_perror=no
 
-for ac_func in initgroups
+for ac_func in perror
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -64483,21 +65340,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_initgroups=yes
+ ice_have_perror=yes
 fi
 done
 
-if test "${ice_have_initgroups}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for initgroups declaration in grp.h sys/types.h unistd.h libc.h" >&5
-$as_echo_n "checking for initgroups declaration in grp.h sys/types.h unistd.h libc.h... " >&6; }
-if test "${ice_cv_have_initgroups_decl+set}" = set; then
+if test "${ice_have_perror}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for perror declaration in stdio.h" >&5
+$as_echo_n "checking for perror declaration in stdio.h... " >&6; }
+if test "${ice_cv_have_perror_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_initgroups_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 grp.h sys/types.h unistd.h libc.h; do
+for header in stdio.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -64509,12 +65366,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}perror[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_perror_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_initgroups_decl" = yes; then
+if test "$ice_cv_have_perror_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -64528,33 +65385,33 @@ 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}perror[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_perror_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_initgroups_decl" = yes; then
+if test "$ice_cv_have_perror_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_initgroups_decl" >&5
-$as_echo "$ice_cv_have_initgroups_decl" >&6; }
-if test "$ice_cv_have_initgroups_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_perror_decl" >&5
+$as_echo "$ice_cv_have_perror_decl" >&6; }
+if test "$ice_cv_have_perror_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_INITGROUPS_DECL 1
+#define HAVE_PERROR_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_ioctl=no
+ice_have_printf=no
 
-for ac_func in ioctl
+for ac_func in printf
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -64650,21 +65507,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_ioctl=yes
+ ice_have_printf=yes
 fi
 done
 
-if test "${ice_have_ioctl}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for ioctl declaration in sys/ioctl.h unistd.h libc.h" >&5
-$as_echo_n "checking for ioctl declaration in sys/ioctl.h unistd.h libc.h... " >&6; }
-if test "${ice_cv_have_ioctl_decl+set}" = set; then
+if test "${ice_have_printf}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for printf declaration in stdio.h" >&5
+$as_echo_n "checking for printf declaration in stdio.h... " >&6; }
+if test "${ice_cv_have_printf_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_ioctl_decl=no
+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 sys/ioctl.h unistd.h libc.h; do
+for header in stdio.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -64676,12 +65533,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}printf[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_printf_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_ioctl_decl" = yes; then
+if test "$ice_cv_have_printf_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -64695,33 +65552,31 @@ 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}printf[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_printf_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_ioctl_decl" = yes; then
+if test "$ice_cv_have_printf_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_ioctl_decl" >&5
-$as_echo "$ice_cv_have_ioctl_decl" >&6; }
-if test "$ice_cv_have_ioctl_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_printf_decl" >&5
+$as_echo "$ice_cv_have_printf_decl" >&6; }
+if test "$ice_cv_have_printf_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_IOCTL_DECL 1
+#define HAVE_PRINTF_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_isnormal=no
-
-for ac_func in isnormal
+for ac_func in putenv
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -64817,78 +65672,14 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_isnormal=yes
-fi
-done
-
-if test "${ice_have_isnormal}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for isnormal declaration in math.h" >&5
-$as_echo_n "checking for isnormal declaration in math.h... " >&6; }
-if test "${ice_cv_have_isnormal_decl+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-
-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 math.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}isnormal[      ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_isnormal_decl=yes
-fi
-rm -f conftest*
-
-if test "$ice_cv_have_isnormal_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}isnormal[      ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_isnormal_decl=yes
-fi
-rm -f conftest*
 
-if test "$ice_cv_have_isnormal_decl" = yes; then
-       break
 fi
 done
 
-fi
-
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_isnormal_decl" >&5
-$as_echo "$ice_cv_have_isnormal_decl" >&6; }
-if test "$ice_cv_have_isnormal_decl" = yes; then
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_ISNORMAL_DECL 1
-_ACEOF
-
-fi
-fi
-
-
-ice_have_listen=no
+ice_have_puts=no
 
-for ac_func in listen
+for ac_func in puts
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -64984,21 +65775,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_listen=yes
+ ice_have_puts=yes
 fi
 done
 
-if test "${ice_have_listen}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for listen declaration in sys/types.h sys/socket.h" >&5
-$as_echo_n "checking for listen declaration in sys/types.h sys/socket.h... " >&6; }
-if test "${ice_cv_have_listen_decl+set}" = set; then
+if test "${ice_have_puts}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for puts declaration in stdio.h" >&5
+$as_echo_n "checking for puts declaration in stdio.h... " >&6; }
+if test "${ice_cv_have_puts_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_listen_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 sys/types.h sys/socket.h; do
+for header in stdio.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -65010,12 +65801,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}puts[  ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_puts_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_listen_decl" = yes; then
+if test "$ice_cv_have_puts_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -65029,33 +65820,33 @@ 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}puts[  ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_puts_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_listen_decl" = yes; then
+if test "$ice_cv_have_puts_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_listen_decl" >&5
-$as_echo "$ice_cv_have_listen_decl" >&6; }
-if test "$ice_cv_have_listen_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_puts_decl" >&5
+$as_echo "$ice_cv_have_puts_decl" >&6; }
+if test "$ice_cv_have_puts_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_LISTEN_DECL 1
+#define HAVE_PUTS_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_lstat=no
+ice_have_realloc=no
 
-for ac_func in lstat
+for ac_func in realloc
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -65151,21 +65942,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_lstat=yes
+ ice_have_realloc=yes
 fi
 done
 
-if test "${ice_have_lstat}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for lstat declaration in sys/types.h sys/stat.h" >&5
-$as_echo_n "checking for lstat declaration in sys/types.h sys/stat.h... " >&6; }
-if test "${ice_cv_have_lstat_decl+set}" = set; then
+if test "${ice_have_realloc}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for realloc declaration in stdlib.h" >&5
+$as_echo_n "checking for realloc declaration in stdlib.h... " >&6; }
+if test "${ice_cv_have_realloc_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_lstat_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 sys/types.h sys/stat.h; do
+for header in stdlib.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -65177,12 +65968,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}realloc[       ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_realloc_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_lstat_decl" = yes; then
+if test "$ice_cv_have_realloc_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -65196,33 +65987,33 @@ 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}realloc[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_realloc_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_lstat_decl" = yes; then
+if test "$ice_cv_have_realloc_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_lstat_decl" >&5
-$as_echo "$ice_cv_have_lstat_decl" >&6; }
-if test "$ice_cv_have_lstat_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_realloc_decl" >&5
+$as_echo "$ice_cv_have_realloc_decl" >&6; }
+if test "$ice_cv_have_realloc_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_LSTAT_DECL 1
+#define HAVE_REALLOC_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_malloc=no
+ice_have_recvfrom=no
 
-for ac_func in malloc
+for ac_func in recvfrom
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -65318,21 +66109,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_malloc=yes
+ ice_have_recvfrom=yes
 fi
 done
 
-if test "${ice_have_malloc}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for malloc declaration in stdlib.h" >&5
-$as_echo_n "checking for malloc declaration in stdlib.h... " >&6; }
-if test "${ice_cv_have_malloc_decl+set}" = set; then
+if test "${ice_have_recvfrom}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for recvfrom declaration in sys/types.h sys/socket.h" >&5
+$as_echo_n "checking for recvfrom declaration in sys/types.h sys/socket.h... " >&6; }
+if test "${ice_cv_have_recvfrom_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_malloc_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 stdlib.h; do
+for header in sys/types.h sys/socket.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -65344,12 +66135,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}recvfrom[      ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_recvfrom_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_malloc_decl" = yes; then
+if test "$ice_cv_have_recvfrom_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -65363,33 +66154,33 @@ 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}recvfrom[      ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_recvfrom_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_malloc_decl" = yes; then
+if test "$ice_cv_have_recvfrom_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_malloc_decl" >&5
-$as_echo "$ice_cv_have_malloc_decl" >&6; }
-if test "$ice_cv_have_malloc_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_recvfrom_decl" >&5
+$as_echo "$ice_cv_have_recvfrom_decl" >&6; }
+if test "$ice_cv_have_recvfrom_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_MALLOC_DECL 1
+#define HAVE_RECVFROM_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_memmove=no
+ice_have_remove=no
 
-for ac_func in memmove
+for ac_func in remove
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -65485,21 +66276,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_memmove=yes
+ ice_have_remove=yes
 fi
 done
 
-if test "${ice_have_memmove}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for memmove declaration in string.h strings.h" >&5
-$as_echo_n "checking for memmove declaration in string.h strings.h... " >&6; }
-if test "${ice_cv_have_memmove_decl+set}" = set; then
+if test "${ice_have_remove}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for remove declaration in stdio.h" >&5
+$as_echo_n "checking for remove declaration in stdio.h... " >&6; }
+if test "${ice_cv_have_remove_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_memmove_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 string.h strings.h; do
+for header in stdio.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -65511,12 +66302,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}remove[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_remove_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_memmove_decl" = yes; then
+if test "$ice_cv_have_remove_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -65530,33 +66321,33 @@ 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}remove[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_remove_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_memmove_decl" = yes; then
+if test "$ice_cv_have_remove_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_memmove_decl" >&5
-$as_echo "$ice_cv_have_memmove_decl" >&6; }
-if test "$ice_cv_have_memmove_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_remove_decl" >&5
+$as_echo "$ice_cv_have_remove_decl" >&6; }
+if test "$ice_cv_have_remove_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_MEMMOVE_DECL 1
+#define HAVE_REMOVE_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_memset=no
+ice_have_rename=no
 
-for ac_func in memset
+for ac_func in rename
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -65652,21 +66443,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_memset=yes
+ ice_have_rename=yes
 fi
 done
 
-if test "${ice_have_memset}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for memset declaration in string.h strings.h" >&5
-$as_echo_n "checking for memset declaration in string.h strings.h... " >&6; }
-if test "${ice_cv_have_memset_decl+set}" = set; then
+if test "${ice_have_rename}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for rename declaration in stdio.h" >&5
+$as_echo_n "checking for rename declaration in stdio.h... " >&6; }
+if test "${ice_cv_have_rename_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_memset_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 string.h strings.h; do
+for header in stdio.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -65678,12 +66469,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}rename[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_rename_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_memset_decl" = yes; then
+if test "$ice_cv_have_rename_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -65697,33 +66488,33 @@ 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}rename[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_rename_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_memset_decl" = yes; then
+if test "$ice_cv_have_rename_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_memset_decl" >&5
-$as_echo "$ice_cv_have_memset_decl" >&6; }
-if test "$ice_cv_have_memset_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_rename_decl" >&5
+$as_echo "$ice_cv_have_rename_decl" >&6; }
+if test "$ice_cv_have_rename_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_MEMSET_DECL 1
+#define HAVE_RENAME_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_mkstemp=no
+ice_have_rewind=no
 
-for ac_func in mkstemp
+for ac_func in rewind
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -65819,21 +66610,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_mkstemp=yes
+ ice_have_rewind=yes
 fi
 done
 
-if test "${ice_have_mkstemp}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for mkstemp declaration in stdlib.h" >&5
-$as_echo_n "checking for mkstemp declaration in stdlib.h... " >&6; }
-if test "${ice_cv_have_mkstemp_decl+set}" = set; then
+if test "${ice_have_rewind}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for rewind declaration in stdio.h" >&5
+$as_echo_n "checking for rewind declaration in stdio.h... " >&6; }
+if test "${ice_cv_have_rewind_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_mkstemp_decl=no
+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 stdlib.h; do
+for header in stdio.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -65845,12 +66636,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}rewind[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_rewind_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_mkstemp_decl" = yes; then
+if test "$ice_cv_have_rewind_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -65864,33 +66655,33 @@ 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}rewind[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_rewind_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_mkstemp_decl" = yes; then
+if test "$ice_cv_have_rewind_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_mkstemp_decl" >&5
-$as_echo "$ice_cv_have_mkstemp_decl" >&6; }
-if test "$ice_cv_have_mkstemp_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_rewind_decl" >&5
+$as_echo "$ice_cv_have_rewind_decl" >&6; }
+if test "$ice_cv_have_rewind_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_MKSTEMP_DECL 1
+#define HAVE_REWIND_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_mktemp=no
+ice_have_ruserok=no
 
-for ac_func in mktemp
+for ac_func in ruserok
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -65986,21 +66777,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_mktemp=yes
+ ice_have_ruserok=yes
 fi
 done
 
-if test "${ice_have_mktemp}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for mktemp declaration in stdlib.h" >&5
-$as_echo_n "checking for mktemp declaration in stdlib.h... " >&6; }
-if test "${ice_cv_have_mktemp_decl+set}" = set; then
+if test "${ice_have_ruserok}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for ruserok declaration in netdb.h sys/socket.h libc.h unistd.h" >&5
+$as_echo_n "checking for ruserok declaration in netdb.h sys/socket.h libc.h unistd.h... " >&6; }
+if test "${ice_cv_have_ruserok_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_mktemp_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 stdlib.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.  */
@@ -66012,12 +66803,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}ruserok[       ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_ruserok_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_mktemp_decl" = yes; then
+if test "$ice_cv_have_ruserok_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -66031,33 +66822,33 @@ 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}ruserok[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_ruserok_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_mktemp_decl" = yes; then
+if test "$ice_cv_have_ruserok_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_mktemp_decl" >&5
-$as_echo "$ice_cv_have_mktemp_decl" >&6; }
-if test "$ice_cv_have_mktemp_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_ruserok_decl" >&5
+$as_echo "$ice_cv_have_ruserok_decl" >&6; }
+if test "$ice_cv_have_ruserok_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_MKTEMP_DECL 1
+#define HAVE_RUSEROK_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_mktime=no
+ice_have_select=no
 
-for ac_func in mktime
+for ac_func in select
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -66153,21 +66944,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_mktime=yes
+ ice_have_select=yes
 fi
 done
 
-if test "${ice_have_mktime}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for mktime declaration in time.h sys/time.h" >&5
-$as_echo_n "checking for mktime declaration in time.h sys/time.h... " >&6; }
-if test "${ice_cv_have_mktime_decl+set}" = set; then
+if test "${ice_have_select}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for select declaration in sys/types.h sys/socket.h sys/select.h time.h sys/time.h" >&5
+$as_echo_n "checking for select declaration in sys/types.h sys/socket.h sys/select.h time.h sys/time.h... " >&6; }
+if test "${ice_cv_have_select_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_mktime_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 time.h sys/time.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.  */
@@ -66179,12 +66970,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}select[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_select_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_mktime_decl" = yes; then
+if test "$ice_cv_have_select_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -66198,134 +66989,275 @@ 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}select[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_select_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_mktime_decl" = yes; then
+if test "$ice_cv_have_select_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_mktime_decl" >&5
-$as_echo "$ice_cv_have_mktime_decl" >&6; }
-if test "$ice_cv_have_mktime_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_select_decl" >&5
+$as_echo "$ice_cv_have_select_decl" >&6; }
+if test "$ice_cv_have_select_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_MKTIME_DECL 1
+#define HAVE_SELECT_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-for ac_func in on_exit
+
+
+
+
+
+
+for ac_header in sys/time.h \
+           sys/types.h \
+           sys/select.h \
+           sys/socket.h \
+           unistd.h \
+
 do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   $as_echo_n "(cached) " >&6
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-#undef $ac_func
+       ac_header_compiler=no
+fi
 
-/* 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 core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
-int
-main ()
-{
-return $ac_func ();
-  ;
-  return 0;
-}
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
+  (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
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
        }; then
-  eval "$as_ac_var=yes"
+  ac_header_preproc=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       eval "$as_ac_var=no"
+  ac_header_preproc=no
 fi
 
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
 fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
+ac_res=`eval 'as_val=${'$as_ac_Header'}
                 $as_echo "$as_val"'`
               { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-as_val=`eval 'as_val=${'$as_ac_var'}
+
+fi
+as_val=`eval 'as_val=${'$as_ac_Header'}
                 $as_echo "$as_val"'`
    if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
 fi
+
 done
 
 
-ice_have_openlog=no
+       { $as_echo "$as_me:$LINENO: checking for select() argument type" >&5
+$as_echo_n "checking for select() argument type... " >&6; }
+if test "${amanda_cv_select_arg_type+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
 
-for ac_func in openlog
+               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*
+
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $amanda_cv_select_arg_type" >&5
+$as_echo "$amanda_cv_select_arg_type" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define SELECT_ARG_TYPE $amanda_cv_select_arg_type
+_ACEOF
+
+
+
+
+ice_have_sendto=no
+
+for ac_func in sendto
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -66421,21 +67353,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_openlog=yes
+ ice_have_sendto=yes
 fi
 done
 
-if test "${ice_have_openlog}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for openlog declaration in syslog.h" >&5
-$as_echo_n "checking for openlog declaration in syslog.h... " >&6; }
-if test "${ice_cv_have_openlog_decl+set}" = set; then
+if test "${ice_have_sendto}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for sendto declaration in sys/types.h sys/socket.h" >&5
+$as_echo_n "checking for sendto declaration in sys/types.h sys/socket.h... " >&6; }
+if test "${ice_cv_have_sendto_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_openlog_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 syslog.h; do
+for header in sys/types.h sys/socket.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -66447,12 +67379,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}sendto[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_sendto_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_openlog_decl" = yes; then
+if test "$ice_cv_have_sendto_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -66466,33 +67398,33 @@ 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}sendto[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_sendto_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_openlog_decl" = yes; then
+if test "$ice_cv_have_sendto_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_openlog_decl" >&5
-$as_echo "$ice_cv_have_openlog_decl" >&6; }
-if test "$ice_cv_have_openlog_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_sendto_decl" >&5
+$as_echo "$ice_cv_have_sendto_decl" >&6; }
+if test "$ice_cv_have_sendto_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_OPENLOG_DECL 1
+#define HAVE_SENDTO_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_pclose=no
+ice_have_setegid=no
 
-for ac_func in pclose
+for ac_func in setegid
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -66588,21 +67520,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_pclose=yes
+ ice_have_setegid=yes
 fi
 done
 
-if test "${ice_have_pclose}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for pclose declaration in stdio.h" >&5
-$as_echo_n "checking for pclose declaration in stdio.h... " >&6; }
-if test "${ice_cv_have_pclose_decl+set}" = set; then
+if test "${ice_have_setegid}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for setegid declaration in unistd.h" >&5
+$as_echo_n "checking for setegid declaration in unistd.h... " >&6; }
+if test "${ice_cv_have_setegid_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_pclose_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 stdio.h; do
+for header in unistd.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -66614,12 +67546,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}setegid[       ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_setegid_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_pclose_decl" = yes; then
+if test "$ice_cv_have_setegid_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -66633,33 +67565,33 @@ 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}setegid[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_setegid_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_pclose_decl" = yes; then
+if test "$ice_cv_have_setegid_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_pclose_decl" >&5
-$as_echo "$ice_cv_have_pclose_decl" >&6; }
-if test "$ice_cv_have_pclose_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_setegid_decl" >&5
+$as_echo "$ice_cv_have_setegid_decl" >&6; }
+if test "$ice_cv_have_setegid_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_PCLOSE_DECL 1
+#define HAVE_SETEGID_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_perror=no
+ice_have_seteuid=no
 
-for ac_func in perror
+for ac_func in seteuid
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -66755,21 +67687,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_perror=yes
+ ice_have_seteuid=yes
 fi
 done
 
-if test "${ice_have_perror}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for perror declaration in stdio.h" >&5
-$as_echo_n "checking for perror declaration in stdio.h... " >&6; }
-if test "${ice_cv_have_perror_decl+set}" = set; then
+if test "${ice_have_seteuid}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for seteuid declaration in unistd.h" >&5
+$as_echo_n "checking for seteuid declaration in unistd.h... " >&6; }
+if test "${ice_cv_have_seteuid_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_perror_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 stdio.h; do
+for header in unistd.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -66781,12 +67713,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}seteuid[       ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_seteuid_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_perror_decl" = yes; then
+if test "$ice_cv_have_seteuid_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -66800,33 +67732,33 @@ 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}seteuid[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_seteuid_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_perror_decl" = yes; then
+if test "$ice_cv_have_seteuid_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_perror_decl" >&5
-$as_echo "$ice_cv_have_perror_decl" >&6; }
-if test "$ice_cv_have_perror_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_seteuid_decl" >&5
+$as_echo "$ice_cv_have_seteuid_decl" >&6; }
+if test "$ice_cv_have_seteuid_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_PERROR_DECL 1
+#define HAVE_SETEUID_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_printf=no
+ice_have_setresgid=no
 
-for ac_func in printf
+for ac_func in setresgid
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -66922,21 +67854,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_printf=yes
+ ice_have_setresgid=yes
 fi
 done
 
-if test "${ice_have_printf}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for printf declaration in stdio.h" >&5
-$as_echo_n "checking for printf declaration in stdio.h... " >&6; }
-if test "${ice_cv_have_printf_decl+set}" = set; then
+if test "${ice_have_setresgid}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for setresgid declaration in unistd.h" >&5
+$as_echo_n "checking for setresgid declaration in unistd.h... " >&6; }
+if test "${ice_cv_have_setresgid_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_printf_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 stdio.h; do
+for header in unistd.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -66948,12 +67880,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}setresgid[     ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_setresgid_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_printf_decl" = yes; then
+if test "$ice_cv_have_setresgid_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -66967,134 +67899,33 @@ 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}setresgid[     ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_setresgid_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_printf_decl" = yes; then
+if test "$ice_cv_have_setresgid_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_printf_decl" >&5
-$as_echo "$ice_cv_have_printf_decl" >&6; }
-if test "$ice_cv_have_printf_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_setresgid_decl" >&5
+$as_echo "$ice_cv_have_setresgid_decl" >&6; }
+if test "$ice_cv_have_setresgid_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_PRINTF_DECL 1
+#define HAVE_SETRESGID_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-for ac_func in putenv
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_var=yes"
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       eval "$as_ac_var=no"
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-as_val=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-
-ice_have_puts=no
+ice_have_setresuid=no
 
-for ac_func in puts
+for ac_func in setresuid
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -67190,21 +68021,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_puts=yes
+ ice_have_setresuid=yes
 fi
 done
 
-if test "${ice_have_puts}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for puts declaration in stdio.h" >&5
-$as_echo_n "checking for puts declaration in stdio.h... " >&6; }
-if test "${ice_cv_have_puts_decl+set}" = set; then
+if test "${ice_have_setresuid}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for setresuid declaration in unistd.h" >&5
+$as_echo_n "checking for setresuid declaration in unistd.h... " >&6; }
+if test "${ice_cv_have_setresuid_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_puts_decl=no
+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 stdio.h; do
+for header in unistd.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -67216,12 +68047,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}setresuid[     ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_setresuid_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_puts_decl" = yes; then
+if test "$ice_cv_have_setresuid_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -67235,33 +68066,33 @@ 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}setresuid[     ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_setresuid_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_puts_decl" = yes; then
+if test "$ice_cv_have_setresuid_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_puts_decl" >&5
-$as_echo "$ice_cv_have_puts_decl" >&6; }
-if test "$ice_cv_have_puts_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_setresuid_decl" >&5
+$as_echo "$ice_cv_have_setresuid_decl" >&6; }
+if test "$ice_cv_have_setresuid_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_PUTS_DECL 1
+#define HAVE_SETRESUID_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_realloc=no
+ice_have_snprintf=no
 
-for ac_func in realloc
+for ac_func in snprintf
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -67357,21 +68188,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_realloc=yes
+ ice_have_snprintf=yes
 fi
 done
 
-if test "${ice_have_realloc}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for realloc declaration in stdlib.h" >&5
-$as_echo_n "checking for realloc declaration in stdlib.h... " >&6; }
-if test "${ice_cv_have_realloc_decl+set}" = set; then
+if test "${ice_have_snprintf}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for snprintf declaration in stdio.h" >&5
+$as_echo_n "checking for snprintf declaration in stdio.h... " >&6; }
+if test "${ice_cv_have_snprintf_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_realloc_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 stdlib.h; do
+for header in stdio.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -67383,12 +68214,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}snprintf[      ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_snprintf_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_realloc_decl" = yes; then
+if test "$ice_cv_have_snprintf_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -67402,33 +68233,33 @@ 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}snprintf[      ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_snprintf_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_realloc_decl" = yes; then
+if test "$ice_cv_have_snprintf_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_realloc_decl" >&5
-$as_echo "$ice_cv_have_realloc_decl" >&6; }
-if test "$ice_cv_have_realloc_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_snprintf_decl" >&5
+$as_echo "$ice_cv_have_snprintf_decl" >&6; }
+if test "$ice_cv_have_snprintf_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_REALLOC_DECL 1
+#define HAVE_SNPRINTF_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_recvfrom=no
+ice_have_vsnprintf=no
 
-for ac_func in recvfrom
+for ac_func in vsnprintf
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -67524,21 +68355,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_recvfrom=yes
+ ice_have_vsnprintf=yes
 fi
 done
 
-if test "${ice_have_recvfrom}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for recvfrom declaration in sys/types.h sys/socket.h" >&5
-$as_echo_n "checking for recvfrom declaration in sys/types.h sys/socket.h... " >&6; }
-if test "${ice_cv_have_recvfrom_decl+set}" = set; then
+if test "${ice_have_vsnprintf}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for vsnprintf declaration in stdio.h" >&5
+$as_echo_n "checking for vsnprintf declaration in stdio.h... " >&6; }
+if test "${ice_cv_have_vsnprintf_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_recvfrom_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 sys/types.h sys/socket.h; do
+for header in stdio.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -67550,12 +68381,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}vsnprintf[     ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_vsnprintf_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_recvfrom_decl" = yes; then
+if test "$ice_cv_have_vsnprintf_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -67569,38 +68400,33 @@ 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}vsnprintf[     ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_vsnprintf_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_recvfrom_decl" = yes; then
+if test "$ice_cv_have_vsnprintf_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_recvfrom_decl" >&5
-$as_echo "$ice_cv_have_recvfrom_decl" >&6; }
-if test "$ice_cv_have_recvfrom_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_vsnprintf_decl" >&5
+$as_echo "$ice_cv_have_vsnprintf_decl" >&6; }
+if test "$ice_cv_have_vsnprintf_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_RECVFROM_DECL 1
+#define HAVE_VSNPRINTF_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_remove=no
-
-for ac_func in remove
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+    { $as_echo "$as_me:$LINENO: checking for setpgid" >&5
+$as_echo_n "checking for setpgid... " >&6; }
+if test "${ac_cv_func_setpgid+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -67609,12 +68435,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.  */
 
@@ -67624,7 +68450,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 # include <assert.h>
 #endif
 
-#undef $ac_func
+#undef setpgid
 
 /* Override any GCC internal prototype to avoid an error.
    Use char because int might match the return type of a GCC
@@ -67632,18 +68458,18 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-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
 #endif
 
 int
 main ()
 {
-return $ac_func ();
+return setpgid ();
   ;
   return 0;
 }
@@ -67669,100 +68495,31 @@ $as_echo "$ac_try_echo") >&5
         test "$cross_compiling" = yes ||
         $as_test_x conftest$ac_exeext
        }; then
-  eval "$as_ac_var=yes"
+  ac_cv_func_setpgid=yes
 else
   $as_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 -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-as_val=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
- ice_have_remove=yes
-fi
-done
-
-if test "${ice_have_remove}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for remove declaration in stdio.h" >&5
-$as_echo_n "checking for remove declaration in stdio.h... " >&6; }
-if test "${ice_cv_have_remove_decl+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-
-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
-# 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}remove[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_remove_decl=yes
-fi
-rm -f conftest*
-
-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}remove[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_remove_decl=yes
-fi
-rm -f conftest*
-
-if test "$ice_cv_have_remove_decl" = yes; then
-       break
-fi
-done
-
-fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_setpgid" >&5
+$as_echo "$ac_cv_func_setpgid" >&6; }
+if test "x$ac_cv_func_setpgid" = x""yes; then
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_remove_decl" >&5
-$as_echo "$ice_cv_have_remove_decl" >&6; }
-if test "$ice_cv_have_remove_decl" = yes; then
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_REMOVE_DECL 1
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_SETPGID 1
 _ACEOF
 
-fi
-fi
-
 
-ice_have_rename=no
+ice_have_setpgid=no
 
-for ac_func in rename
+for ac_func in setpgid
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -67858,21 +68615,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_rename=yes
+ ice_have_setpgid=yes
 fi
 done
 
-if test "${ice_have_rename}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for rename declaration in stdio.h" >&5
-$as_echo_n "checking for rename declaration in stdio.h... " >&6; }
-if test "${ice_cv_have_rename_decl+set}" = set; then
+if test "${ice_have_setpgid}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for setpgid declaration in sys/types.h unistd.h" >&5
+$as_echo_n "checking for setpgid declaration in sys/types.h unistd.h... " >&6; }
+if test "${ice_cv_have_setpgid_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_rename_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 stdio.h; do
+for header in sys/types.h unistd.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -67884,12 +68641,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}setpgid[       ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_setpgid_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_rename_decl" = yes; then
+if test "$ice_cv_have_setpgid_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -67903,38 +68660,36 @@ 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}setpgid[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_setpgid_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_rename_decl" = yes; then
+if test "$ice_cv_have_setpgid_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_rename_decl" >&5
-$as_echo "$ice_cv_have_rename_decl" >&6; }
-if test "$ice_cv_have_rename_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_setpgid_decl" >&5
+$as_echo "$ice_cv_have_setpgid_decl" >&6; }
+if test "$ice_cv_have_setpgid_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_RENAME_DECL 1
+#define HAVE_SETPGID_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_rewind=no
+fi
 
-for ac_func in rewind
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+
+{ $as_echo "$as_me:$LINENO: checking for setpgrp" >&5
+$as_echo_n "checking for setpgrp... " >&6; }
+if test "${ac_cv_func_setpgrp+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -67943,12 +68698,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.  */
 
@@ -67958,7 +68713,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 # include <assert.h>
 #endif
 
-#undef $ac_func
+#undef setpgrp
 
 /* Override any GCC internal prototype to avoid an error.
    Use char because int might match the return type of a GCC
@@ -67966,18 +68721,18 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-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
 #endif
 
 int
 main ()
 {
-return $ac_func ();
+return setpgrp ();
   ;
   return 0;
 }
@@ -68003,100 +68758,102 @@ $as_echo "$ac_try_echo") >&5
         test "$cross_compiling" = yes ||
         $as_test_x conftest$ac_exeext
        }; then
-  eval "$as_ac_var=yes"
+  ac_cv_func_setpgrp=yes
 else
   $as_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 -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-as_val=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
- ice_have_rewind=yes
-fi
-done
-
-if test "${ice_have_rewind}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for rewind declaration in stdio.h" >&5
-$as_echo_n "checking for rewind declaration in stdio.h... " >&6; }
-if test "${ice_cv_have_rewind_decl+set}" = set; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_setpgrp" >&5
+$as_echo "$ac_cv_func_setpgrp" >&6; }
+if test "x$ac_cv_func_setpgrp" = x""yes; then
+  { $as_echo "$as_me:$LINENO: checking whether setpgrp takes no argument" >&5
+$as_echo_n "checking whether setpgrp takes no argument... " >&6; }
+if test "${ac_cv_func_setpgrp_void+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-
-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.  */
-#include <$header>
-
-_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
-fi
-rm -f conftest*
-
-if test "$ice_cv_have_rewind_decl" = yes; then
-       break
-fi
-# Check for "fixed" declaration like "getpid _PARAMS((int))"
-cat >conftest.$ac_ext <<_ACEOF
+  if test "$cross_compiling" = yes; then
+  { { $as_echo "$as_me:$LINENO: error: cannot check setpgrp when cross compiling" >&5
+$as_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.  */
-#include <$header>
-
+$ac_includes_default
+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. */
+  return setpgrp (1,1) != -1;
+  ;
+  return 0;
+}
 _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*
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_setpgrp_void=no
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-if test "$ice_cv_have_rewind_decl" = yes; then
-       break
+( exit $ac_status )
+ac_cv_func_setpgrp_void=yes
 fi
-done
-
+rm -rf conftest.dSYM
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_rewind_decl" >&5
-$as_echo "$ice_cv_have_rewind_decl" >&6; }
-if test "$ice_cv_have_rewind_decl" = yes; then
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_REWIND_DECL 1
+fi
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_setpgrp_void" >&5
+$as_echo "$ac_cv_func_setpgrp_void" >&6; }
+if test $ac_cv_func_setpgrp_void = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define SETPGRP_VOID 1
 _ACEOF
 
 fi
+
 fi
 
 
-ice_have_ruserok=no
+ice_have_setpgrp=no
 
-for ac_func in ruserok
+for ac_func in setpgrp
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -68192,21 +68949,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_ruserok=yes
+ ice_have_setpgrp=yes
 fi
 done
 
-if test "${ice_have_ruserok}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for ruserok declaration in netdb.h sys/socket.h libc.h unistd.h" >&5
-$as_echo_n "checking for ruserok declaration in netdb.h sys/socket.h libc.h unistd.h... " >&6; }
-if test "${ice_cv_have_ruserok_decl+set}" = set; then
+if test "${ice_have_setpgrp}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for setpgrp declaration in sys/types.h unistd.h libc.h" >&5
+$as_echo_n "checking for setpgrp declaration in sys/types.h unistd.h libc.h... " >&6; }
+if test "${ice_cv_have_setpgrp_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_ruserok_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 netdb.h sys/socket.h libc.h unistd.h; do
+for header in sys/types.h unistd.h libc.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -68218,12 +68975,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}setpgrp[       ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_setpgrp_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_ruserok_decl" = yes; then
+if test "$ice_cv_have_setpgrp_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -68237,33 +68994,33 @@ 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}setpgrp[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_setpgrp_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_ruserok_decl" = yes; then
+if test "$ice_cv_have_setpgrp_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_ruserok_decl" >&5
-$as_echo "$ice_cv_have_ruserok_decl" >&6; }
-if test "$ice_cv_have_ruserok_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_setpgrp_decl" >&5
+$as_echo "$ice_cv_have_setpgrp_decl" >&6; }
+if test "$ice_cv_have_setpgrp_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_RUSEROK_DECL 1
+#define HAVE_SETPGRP_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_select=no
+ice_have_setsockopt=no
 
-for ac_func in select
+for ac_func in setsockopt
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -68359,21 +69116,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_select=yes
+ ice_have_setsockopt=yes
 fi
 done
 
-if test "${ice_have_select}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for select declaration in sys/types.h sys/socket.h sys/select.h time.h sys/time.h" >&5
-$as_echo_n "checking for select declaration in sys/types.h sys/socket.h sys/select.h time.h sys/time.h... " >&6; }
-if test "${ice_cv_have_select_decl+set}" = set; then
+if test "${ice_have_setsockopt}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for setsockopt declaration in sys/types.h sys/socket.h" >&5
+$as_echo_n "checking for setsockopt declaration in sys/types.h sys/socket.h... " >&6; }
+if test "${ice_cv_have_setsockopt_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_select_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 sys/types.h sys/socket.h sys/select.h time.h sys/time.h; do
+for header in sys/types.h sys/socket.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -68385,12 +69142,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}setsockopt[    ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_setsockopt_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_select_decl" = yes; then
+if test "$ice_cv_have_setsockopt_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -68404,275 +69161,33 @@ 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}setsockopt[    ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_setsockopt_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_select_decl" = yes; then
+if test "$ice_cv_have_setsockopt_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_select_decl" >&5
-$as_echo "$ice_cv_have_select_decl" >&6; }
-if test "$ice_cv_have_select_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_setsockopt_decl" >&5
+$as_echo "$ice_cv_have_setsockopt_decl" >&6; }
+if test "$ice_cv_have_setsockopt_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SELECT_DECL 1
-_ACEOF
-
-fi
-fi
-
-
-
-
-
-
-
-
-for ac_header in sys/time.h \
-           sys/types.h \
-           sys/select.h \
-           sys/socket.h \
-           unistd.h \
-
-do
-as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
-$as_echo_n "checking $ac_header usability... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_compile") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then
-  ac_header_compiler=yes
-else
-  $as_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
-{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
-
-# Is the header present?
-{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
-$as_echo_n "checking $ac_header presence... " >&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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$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
-  $as_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
-  $as_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
-{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
-    ;;
-esac
-{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
-$as_echo_n "checking for $ac_header... " >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-ac_res=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-
-fi
-as_val=`eval 'as_val=${'$as_ac_Header'}
-                $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define HAVE_SETSOCKOPT_DECL 1
 _ACEOF
 
 fi
-
-done
-
-
-       { $as_echo "$as_me:$LINENO: checking for select() argument type" >&5
-$as_echo_n "checking for select() argument type... " >&6; }
-if test "${amanda_cv_select_arg_type+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-
-               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*
-
-
 fi
-{ $as_echo "$as_me:$LINENO: result: $amanda_cv_select_arg_type" >&5
-$as_echo "$amanda_cv_select_arg_type" >&6; }
-
-cat >>confdefs.h <<_ACEOF
-#define SELECT_ARG_TYPE $amanda_cv_select_arg_type
-_ACEOF
 
 
 
 
-ice_have_sendto=no
-
-for ac_func in sendto
+for ac_func in sigaction sigemptyset sigvec
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -68768,78 +69283,14 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_sendto=yes
-fi
-done
-
-if test "${ice_have_sendto}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for sendto declaration in sys/types.h sys/socket.h" >&5
-$as_echo_n "checking for sendto declaration in sys/types.h sys/socket.h... " >&6; }
-if test "${ice_cv_have_sendto_decl+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-
-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/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}sendto[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_sendto_decl=yes
-fi
-rm -f conftest*
-
-if test "$ice_cv_have_sendto_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}sendto[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_sendto_decl=yes
-fi
-rm -f conftest*
 
-if test "$ice_cv_have_sendto_decl" = yes; then
-       break
 fi
 done
 
-fi
-
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_sendto_decl" >&5
-$as_echo "$ice_cv_have_sendto_decl" >&6; }
-if test "$ice_cv_have_sendto_decl" = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_SENDTO_DECL 1
-_ACEOF
-
-fi
-fi
-
 
-ice_have_setegid=no
+ice_have_socket=no
 
-for ac_func in setegid
+for ac_func in socket
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -68935,21 +69386,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_setegid=yes
+ ice_have_socket=yes
 fi
 done
 
-if test "${ice_have_setegid}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for setegid declaration in unistd.h" >&5
-$as_echo_n "checking for setegid declaration in unistd.h... " >&6; }
-if test "${ice_cv_have_setegid_decl+set}" = set; then
+if test "${ice_have_socket}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for socket declaration in sys/types.h sys/socket.h" >&5
+$as_echo_n "checking for socket declaration in sys/types.h sys/socket.h... " >&6; }
+if test "${ice_cv_have_socket_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_setegid_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 unistd.h; do
+for header in sys/types.h sys/socket.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -68961,12 +69412,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}socket[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_socket_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_setegid_decl" = yes; then
+if test "$ice_cv_have_socket_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -68980,33 +69431,33 @@ 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}socket[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_socket_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_setegid_decl" = yes; then
+if test "$ice_cv_have_socket_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_setegid_decl" >&5
-$as_echo "$ice_cv_have_setegid_decl" >&6; }
-if test "$ice_cv_have_setegid_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_socket_decl" >&5
+$as_echo "$ice_cv_have_socket_decl" >&6; }
+if test "$ice_cv_have_socket_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SETEGID_DECL 1
+#define HAVE_SOCKET_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_seteuid=no
+ice_have_socketpair=no
 
-for ac_func in seteuid
+for ac_func in socketpair
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -69102,21 +69553,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_seteuid=yes
+ ice_have_socketpair=yes
 fi
 done
 
-if test "${ice_have_seteuid}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for seteuid declaration in unistd.h" >&5
-$as_echo_n "checking for seteuid declaration in unistd.h... " >&6; }
-if test "${ice_cv_have_seteuid_decl+set}" = set; then
+if test "${ice_have_socketpair}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for socketpair declaration in sys/types.h sys/socket.h" >&5
+$as_echo_n "checking for socketpair declaration in sys/types.h sys/socket.h... " >&6; }
+if test "${ice_cv_have_socketpair_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_seteuid_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 unistd.h; do
+for header in sys/types.h sys/socket.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -69128,12 +69579,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}socketpair[    ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_socketpair_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_seteuid_decl" = yes; then
+if test "$ice_cv_have_socketpair_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -69147,33 +69598,33 @@ 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}socketpair[    ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_socketpair_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_seteuid_decl" = yes; then
+if test "$ice_cv_have_socketpair_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_seteuid_decl" >&5
-$as_echo "$ice_cv_have_seteuid_decl" >&6; }
-if test "$ice_cv_have_seteuid_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_socketpair_decl" >&5
+$as_echo "$ice_cv_have_socketpair_decl" >&6; }
+if test "$ice_cv_have_socketpair_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SETEUID_DECL 1
+#define HAVE_SOCKETPAIR_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_setresgid=no
+ice_have_sscanf=no
 
-for ac_func in setresgid
+for ac_func in sscanf
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -69269,21 +69720,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_setresgid=yes
+ ice_have_sscanf=yes
 fi
 done
 
-if test "${ice_have_setresgid}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for setresgid declaration in unistd.h" >&5
-$as_echo_n "checking for setresgid declaration in unistd.h... " >&6; }
-if test "${ice_cv_have_setresgid_decl+set}" = set; then
+if test "${ice_have_sscanf}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for sscanf declaration in stdio.h" >&5
+$as_echo_n "checking for sscanf declaration in stdio.h... " >&6; }
+if test "${ice_cv_have_sscanf_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_setresgid_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 unistd.h; do
+for header in stdio.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -69295,12 +69746,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}sscanf[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_sscanf_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_setresgid_decl" = yes; then
+if test "$ice_cv_have_sscanf_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -69314,33 +69765,33 @@ 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}sscanf[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_sscanf_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_setresgid_decl" = yes; then
+if test "$ice_cv_have_sscanf_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_setresgid_decl" >&5
-$as_echo "$ice_cv_have_setresgid_decl" >&6; }
-if test "$ice_cv_have_setresgid_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_sscanf_decl" >&5
+$as_echo "$ice_cv_have_sscanf_decl" >&6; }
+if test "$ice_cv_have_sscanf_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SETRESGID_DECL 1
+#define HAVE_SSCANF_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_setresuid=no
+ice_have_strerror=no
 
-for ac_func in setresuid
+for ac_func in strerror
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -69436,21 +69887,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_setresuid=yes
+ ice_have_strerror=yes
 fi
 done
 
-if test "${ice_have_setresuid}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for setresuid declaration in unistd.h" >&5
-$as_echo_n "checking for setresuid declaration in unistd.h... " >&6; }
-if test "${ice_cv_have_setresuid_decl+set}" = set; then
+if test "${ice_have_strerror}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for strerror declaration in string.h strings.h" >&5
+$as_echo_n "checking for strerror declaration in string.h strings.h... " >&6; }
+if test "${ice_cv_have_strerror_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_setresuid_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 unistd.h; do
+for header in string.h strings.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -69462,12 +69913,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}strerror[      ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_strerror_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_setresuid_decl" = yes; then
+if test "$ice_cv_have_strerror_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -69481,33 +69932,31 @@ 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}strerror[      ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_strerror_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_setresuid_decl" = yes; then
+if test "$ice_cv_have_strerror_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_setresuid_decl" >&5
-$as_echo "$ice_cv_have_setresuid_decl" >&6; }
-if test "$ice_cv_have_setresuid_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_strerror_decl" >&5
+$as_echo "$ice_cv_have_strerror_decl" >&6; }
+if test "$ice_cv_have_strerror_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SETRESUID_DECL 1
+#define HAVE_STRERROR_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_snprintf=no
-
-for ac_func in snprintf
+for ac_func in strftime
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -69603,78 +70052,89 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_snprintf=yes
-fi
-done
 
-if test "${ice_have_snprintf}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for snprintf declaration in stdio.h" >&5
-$as_echo_n "checking for snprintf declaration in stdio.h... " >&6; }
-if test "${ice_cv_have_snprintf_decl+set}" = set; then
+else
+  # strftime is in -lintl on SCO UNIX.
+{ $as_echo "$as_me:$LINENO: checking for strftime in -lintl" >&5
+$as_echo_n "checking for strftime in -lintl... " >&6; }
+if test "${ac_cv_lib_intl_strftime+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-
-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 stdio.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}snprintf[      ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_snprintf_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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  ac_cv_lib_intl_strftime=yes
+else
+  $as_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_snprintf_decl" = yes; then
-       break
+rm -rf conftest.dSYM
+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.  */
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_intl_strftime" >&5
+$as_echo "$ac_cv_lib_intl_strftime" >&6; }
+if test "x$ac_cv_lib_intl_strftime" = x""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}snprintf[      ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_snprintf_decl=yes
+LIBS="-lintl $LIBS"
 fi
-rm -f conftest*
 
-if test "$ice_cv_have_snprintf_decl" = yes; then
-       break
 fi
 done
 
-fi
-
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_snprintf_decl" >&5
-$as_echo "$ice_cv_have_snprintf_decl" >&6; }
-if test "$ice_cv_have_snprintf_decl" = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_SNPRINTF_DECL 1
-_ACEOF
-
-fi
-fi
-
 
-ice_have_vsnprintf=no
+ice_have_strftime=no
 
-for ac_func in vsnprintf
+for ac_func in strftime
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -69770,21 +70230,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_vsnprintf=yes
+ ice_have_strftime=yes
 fi
 done
 
-if test "${ice_have_vsnprintf}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for vsnprintf declaration in stdio.h" >&5
-$as_echo_n "checking for vsnprintf declaration in stdio.h... " >&6; }
-if test "${ice_cv_have_vsnprintf_decl+set}" = set; then
+if test "${ice_have_strftime}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for strftime declaration in time.h sys/time.h" >&5
+$as_echo_n "checking for strftime declaration in time.h sys/time.h... " >&6; }
+if test "${ice_cv_have_strftime_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_vsnprintf_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.  */
@@ -69796,12 +70256,12 @@ 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}strftime[      ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_strftime_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_vsnprintf_decl" = yes; then
+if test "$ice_cv_have_strftime_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -69815,126 +70275,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _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
+  $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_vsnprintf_decl" = yes; then
+if test "$ice_cv_have_strftime_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_vsnprintf_decl" >&5
-$as_echo "$ice_cv_have_vsnprintf_decl" >&6; }
-if test "$ice_cv_have_vsnprintf_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_strftime_decl" >&5
+$as_echo "$ice_cv_have_strftime_decl" >&6; }
+if test "$ice_cv_have_strftime_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_VSNPRINTF_DECL 1
-_ACEOF
-
-fi
-fi
-
-
-    { $as_echo "$as_me:$LINENO: checking for setpgid" >&5
-$as_echo_n "checking for setpgid... " >&6; }
-if test "${ac_cv_func_setpgid+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* 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 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 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
-#endif
-
-int
-main ()
-{
-return setpgid ();
-  ;
-  return 0;
-}
+#define HAVE_STRFTIME_DECL 1
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_func_setpgid=yes
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_func_setpgid=no
 fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_setpgid" >&5
-$as_echo "$ac_cv_func_setpgid" >&6; }
-if test "x$ac_cv_func_setpgid" = x""yes; then
-
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SETPGID 1
-_ACEOF
 
 
-ice_have_setpgid=no
+ice_have_strncasecmp=no
 
-for ac_func in setpgid
+for ac_func in strncasecmp
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -70030,21 +70397,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_setpgid=yes
+ ice_have_strncasecmp=yes
 fi
 done
 
-if test "${ice_have_setpgid}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for setpgid declaration in sys/types.h unistd.h" >&5
-$as_echo_n "checking for setpgid declaration in sys/types.h unistd.h... " >&6; }
-if test "${ice_cv_have_setpgid_decl+set}" = set; then
+if test "${ice_have_strncasecmp}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for strncasecmp declaration in string.h strings.h" >&5
+$as_echo_n "checking for strncasecmp declaration in string.h strings.h... " >&6; }
+if test "${ice_cv_have_strncasecmp_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_setpgid_decl=no
+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 sys/types.h unistd.h; do
+for header in string.h strings.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -70056,12 +70423,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}strncasecmp[   ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_strncasecmp_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_setpgid_decl" = yes; then
+if test "$ice_cv_have_strncasecmp_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -70075,36 +70442,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}strncasecmp[   ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_strncasecmp_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_setpgid_decl" = yes; then
+if test "$ice_cv_have_strncasecmp_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_setpgid_decl" >&5
-$as_echo "$ice_cv_have_setpgid_decl" >&6; }
-if test "$ice_cv_have_setpgid_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_strncasecmp_decl" >&5
+$as_echo "$ice_cv_have_strncasecmp_decl" >&6; }
+if test "$ice_cv_have_strncasecmp_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SETPGID_DECL 1
+#define HAVE_STRNCASECMP_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-fi
-
+ice_have_syslog=no
 
-{ $as_echo "$as_me:$LINENO: checking for setpgrp" >&5
-$as_echo_n "checking for setpgrp... " >&6; }
-if test "${ac_cv_func_setpgrp+set}" = set; then
+for ac_func in syslog
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
   $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -70113,12 +70482,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.  */
 
@@ -70128,7 +70497,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 # include <assert.h>
 #endif
 
-#undef setpgrp
+#undef $ac_func
 
 /* Override any GCC internal prototype to avoid an error.
    Use char because int might match the return type of a GCC
@@ -70136,18 +70505,18 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-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
 #endif
 
 int
 main ()
 {
-return setpgrp ();
+return $ac_func ();
   ;
   return 0;
 }
@@ -70173,102 +70542,100 @@ $as_echo "$ac_try_echo") >&5
         test "$cross_compiling" = yes ||
         $as_test_x conftest$ac_exeext
        }; then
-  ac_cv_func_setpgrp=yes
+  eval "$as_ac_var=yes"
 else
   $as_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 -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_setpgrp" >&5
-$as_echo "$ac_cv_func_setpgrp" >&6; }
-if test "x$ac_cv_func_setpgrp" = x""yes; then
-  { $as_echo "$as_me:$LINENO: checking whether setpgrp takes no argument" >&5
-$as_echo_n "checking whether setpgrp takes no argument... " >&6; }
-if test "${ac_cv_func_setpgrp_void+set}" = set; then
+ac_res=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+ ice_have_syslog=yes
+fi
+done
+
+if test "${ice_have_syslog}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for syslog declaration in syslog.h" >&5
+$as_echo_n "checking for syslog declaration in syslog.h... " >&6; }
+if test "${ice_cv_have_syslog_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  if test "$cross_compiling" = yes; then
-  { { $as_echo "$as_me:$LINENO: error: cannot check setpgrp when cross compiling" >&5
-$as_echo "$as_me: error: cannot check setpgrp when cross compiling" >&2;}
-   { (exit 1); exit 1; }; }
-else
-  cat >conftest.$ac_ext <<_ACEOF
+
+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 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.  */
-$ac_includes_default
-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. */
-  return setpgrp (1,1) != -1;
-  ;
-  return 0;
-}
+#include <$header>
+
 _ACEOF
-rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_setpgrp_void=no
-else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+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
+fi
+rm -f conftest*
 
-( exit $ac_status )
-ac_cv_func_setpgrp_void=yes
+if test "$ice_cv_have_syslog_decl" = yes; then
+       break
 fi
-rm -rf conftest.dSYM
-rm -f core *.core core.conftest.* 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}syslog[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_syslog_decl=yes
 fi
+rm -f conftest*
 
+if test "$ice_cv_have_syslog_decl" = yes; then
+       break
+fi
+done
 
 fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_setpgrp_void" >&5
-$as_echo "$ac_cv_func_setpgrp_void" >&6; }
-if test $ac_cv_func_setpgrp_void = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define SETPGRP_VOID 1
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_syslog_decl" >&5
+$as_echo "$ice_cv_have_syslog_decl" >&6; }
+if test "$ice_cv_have_syslog_decl" = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_SYSLOG_DECL 1
 _ACEOF
 
 fi
-
 fi
 
 
-ice_have_setpgrp=no
+ice_have_system=no
 
-for ac_func in setpgrp
+for ac_func in system
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -70364,21 +70731,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_setpgrp=yes
+ ice_have_system=yes
 fi
 done
 
-if test "${ice_have_setpgrp}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for setpgrp declaration in sys/types.h unistd.h libc.h" >&5
-$as_echo_n "checking for setpgrp declaration in sys/types.h unistd.h libc.h... " >&6; }
-if test "${ice_cv_have_setpgrp_decl+set}" = set; then
+if test "${ice_have_system}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for system declaration in stdlib.h" >&5
+$as_echo_n "checking for system declaration in stdlib.h... " >&6; }
+if test "${ice_cv_have_system_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_setpgrp_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 sys/types.h unistd.h libc.h; do
+for header in stdlib.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -70390,12 +70757,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}system[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_system_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_setpgrp_decl" = yes; then
+if test "$ice_cv_have_system_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -70409,33 +70776,33 @@ 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}system[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_system_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_setpgrp_decl" = yes; then
+if test "$ice_cv_have_system_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_setpgrp_decl" >&5
-$as_echo "$ice_cv_have_setpgrp_decl" >&6; }
-if test "$ice_cv_have_setpgrp_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_system_decl" >&5
+$as_echo "$ice_cv_have_system_decl" >&6; }
+if test "$ice_cv_have_system_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SETPGRP_DECL 1
+#define HAVE_SYSTEM_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_setsockopt=no
+ice_have_time=no
 
-for ac_func in setsockopt
+for ac_func in time
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -70531,21 +70898,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_setsockopt=yes
+ ice_have_time=yes
 fi
 done
 
-if test "${ice_have_setsockopt}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for setsockopt declaration in sys/types.h sys/socket.h" >&5
-$as_echo_n "checking for setsockopt declaration in sys/types.h sys/socket.h... " >&6; }
-if test "${ice_cv_have_setsockopt_decl+set}" = set; then
+if test "${ice_have_time}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for time declaration in time.h sys/time.h" >&5
+$as_echo_n "checking for time declaration in time.h sys/time.h... " >&6; }
+if test "${ice_cv_have_time_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_setsockopt_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 sys/types.h sys/socket.h; do
+for header in time.h sys/time.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -70557,12 +70924,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}time[  ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_time_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_setsockopt_decl" = yes; then
+if test "$ice_cv_have_time_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -70576,33 +70943,33 @@ 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}time[  ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_time_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_setsockopt_decl" = yes; then
+if test "$ice_cv_have_time_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_setsockopt_decl" >&5
-$as_echo "$ice_cv_have_setsockopt_decl" >&6; }
-if test "$ice_cv_have_setsockopt_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_time_decl" >&5
+$as_echo "$ice_cv_have_time_decl" >&6; }
+if test "$ice_cv_have_time_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SETSOCKOPT_DECL 1
+#define HAVE_TIME_DECL 1
 _ACEOF
 
 fi
 fi
 
 
+ice_have_tolower=no
 
-
-for ac_func in sigaction sigemptyset sigvec
+for ac_func in tolower
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -70698,14 +71065,78 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
+ ice_have_tolower=yes
+fi
+done
+
+if test "${ice_have_tolower}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for tolower declaration in ctype.h" >&5
+$as_echo_n "checking for tolower declaration in ctype.h... " >&6; }
+if test "${ice_cv_have_tolower_decl+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+
+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 ctype.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}tolower[       ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_tolower_decl=yes
+fi
+rm -f conftest*
+
+if test "$ice_cv_have_tolower_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}tolower[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_tolower_decl=yes
+fi
+rm -f conftest*
+
+if test "$ice_cv_have_tolower_decl" = yes; then
+       break
 fi
 done
 
+fi
 
-ice_have_socket=no
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_tolower_decl" >&5
+$as_echo "$ice_cv_have_tolower_decl" >&6; }
+if test "$ice_cv_have_tolower_decl" = yes; then
 
-for ac_func in socket
+cat >>confdefs.h <<_ACEOF
+#define HAVE_TOLOWER_DECL 1
+_ACEOF
+
+fi
+fi
+
+
+ice_have_toupper=no
+
+for ac_func in toupper
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -70801,21 +71232,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_socket=yes
+ ice_have_toupper=yes
 fi
 done
 
-if test "${ice_have_socket}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for socket declaration in sys/types.h sys/socket.h" >&5
-$as_echo_n "checking for socket declaration in sys/types.h sys/socket.h... " >&6; }
-if test "${ice_cv_have_socket_decl+set}" = set; then
+if test "${ice_have_toupper}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for toupper declaration in ctype.h" >&5
+$as_echo_n "checking for toupper declaration in ctype.h... " >&6; }
+if test "${ice_cv_have_toupper_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_socket_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 sys/types.h sys/socket.h; do
+for header in ctype.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -70827,12 +71258,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _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
+  $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_socket_decl" = yes; then
+if test "$ice_cv_have_toupper_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -70846,33 +71277,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _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
+  $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_socket_decl" = yes; then
+if test "$ice_cv_have_toupper_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_socket_decl" >&5
-$as_echo "$ice_cv_have_socket_decl" >&6; }
-if test "$ice_cv_have_socket_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_toupper_decl" >&5
+$as_echo "$ice_cv_have_toupper_decl" >&6; }
+if test "$ice_cv_have_toupper_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SOCKET_DECL 1
+#define HAVE_TOUPPER_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_socketpair=no
+ice_have_ungetc=no
 
-for ac_func in socketpair
+for ac_func in ungetc
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -70968,21 +71399,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_socketpair=yes
+ ice_have_ungetc=yes
 fi
 done
 
-if test "${ice_have_socketpair}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for socketpair declaration in sys/types.h sys/socket.h" >&5
-$as_echo_n "checking for socketpair declaration in sys/types.h sys/socket.h... " >&6; }
-if test "${ice_cv_have_socketpair_decl+set}" = set; then
+if test "${ice_have_ungetc}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for ungetc declaration in stdio.h" >&5
+$as_echo_n "checking for ungetc declaration in stdio.h... " >&6; }
+if test "${ice_cv_have_ungetc_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_socketpair_decl=no
+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 sys/types.h sys/socket.h; do
+for header in stdio.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -70994,12 +71425,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}ungetc[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_ungetc_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_socketpair_decl" = yes; then
+if test "$ice_cv_have_ungetc_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -71013,33 +71444,134 @@ 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}ungetc[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_ungetc_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_socketpair_decl" = yes; then
+if test "$ice_cv_have_ungetc_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_socketpair_decl" >&5
-$as_echo "$ice_cv_have_socketpair_decl" >&6; }
-if test "$ice_cv_have_socketpair_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_ungetc_decl" >&5
+$as_echo "$ice_cv_have_ungetc_decl" >&6; }
+if test "$ice_cv_have_ungetc_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SOCKETPAIR_DECL 1
+#define HAVE_UNGETC_DECL 1
+_ACEOF
+
+fi
+fi
+
+
+for ac_func in unsetenv
+do
+as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
+$as_echo_n "checking for $ac_func... " >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        $as_test_x conftest$ac_exeext
+       }; then
+  eval "$as_ac_var=yes"
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       eval "$as_ac_var=no"
+fi
+
+rm -rf conftest.dSYM
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+as_val=`eval 'as_val=${'$as_ac_var'}
+                $as_echo "$as_val"'`
+   if test "x$as_val" = x""yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
-fi
+done
 
 
-ice_have_sscanf=no
+ice_have_vfprintf=no
 
-for ac_func in sscanf
+for ac_func in vfprintf
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -71135,21 +71667,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_sscanf=yes
+ ice_have_vfprintf=yes
 fi
 done
 
-if test "${ice_have_sscanf}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for sscanf declaration in stdio.h" >&5
-$as_echo_n "checking for sscanf declaration in stdio.h... " >&6; }
-if test "${ice_cv_have_sscanf_decl+set}" = set; then
+if test "${ice_have_vfprintf}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for vfprintf declaration in stdio.h stdlib.h" >&5
+$as_echo_n "checking for vfprintf declaration in stdio.h stdlib.h... " >&6; }
+if test "${ice_cv_have_vfprintf_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_sscanf_decl=no
+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; do
+for header in stdio.h stdlib.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -71161,12 +71693,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}vfprintf[      ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_vfprintf_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_sscanf_decl" = yes; then
+if test "$ice_cv_have_vfprintf_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -71180,33 +71712,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}vfprintf[      ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_vfprintf_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_sscanf_decl" = yes; then
+if test "$ice_cv_have_vfprintf_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_sscanf_decl" >&5
-$as_echo "$ice_cv_have_sscanf_decl" >&6; }
-if test "$ice_cv_have_sscanf_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_vfprintf_decl" >&5
+$as_echo "$ice_cv_have_vfprintf_decl" >&6; }
+if test "$ice_cv_have_vfprintf_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SSCANF_DECL 1
+#define HAVE_VFPRINTF_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_strerror=no
+ice_have_vprintf=no
 
-for ac_func in strerror
+for ac_func in vprintf
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -71302,21 +71834,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_strerror=yes
+ ice_have_vprintf=yes
 fi
 done
 
-if test "${ice_have_strerror}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for strerror declaration in string.h strings.h" >&5
-$as_echo_n "checking for strerror declaration in string.h strings.h... " >&6; }
-if test "${ice_cv_have_strerror_decl+set}" = set; then
+if test "${ice_have_vprintf}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for vprintf declaration in stdio.h stdlib.h" >&5
+$as_echo_n "checking for vprintf declaration in stdio.h stdlib.h... " >&6; }
+if test "${ice_cv_have_vprintf_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_strerror_decl=no
+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 string.h strings.h; do
+for header in stdio.h stdlib.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -71328,12 +71860,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}vprintf[       ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_vprintf_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_strerror_decl" = yes; then
+if test "$ice_cv_have_vprintf_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -71347,36 +71879,32 @@ 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}vprintf[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_vprintf_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_strerror_decl" = yes; then
+if test "$ice_cv_have_vprintf_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_strerror_decl" >&5
-$as_echo "$ice_cv_have_strerror_decl" >&6; }
-if test "$ice_cv_have_strerror_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_vprintf_decl" >&5
+$as_echo "$ice_cv_have_vprintf_decl" >&6; }
+if test "$ice_cv_have_vprintf_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_STRERROR_DECL 1
+#define HAVE_VPRINTF_DECL 1
 _ACEOF
 
 fi
 fi
 
-
-for ac_func in strftime
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+{ $as_echo "$as_me:$LINENO: checking for wait4" >&5
+$as_echo_n "checking for wait4... " >&6; }
+if test "${ac_cv_func_wait4+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -71385,12 +71913,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 wait4 to an innocuous variant, in case <limits.h> declares wait4.
    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
+#define wait4 innocuous_wait4
 
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
+    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.  */
 
@@ -71400,7 +71928,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 # include <assert.h>
 #endif
 
-#undef $ac_func
+#undef wait4
 
 /* Override any GCC internal prototype to avoid an error.
    Use char because int might match the return type of a GCC
@@ -71408,93 +71936,18 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char $ac_func ();
+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_$ac_func || defined __stub___$ac_func
+#if defined __stub_wait4 || defined __stub___wait4
 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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
-$as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_var=yes"
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       eval "$as_ac_var=no"
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-as_val=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-else
-  # strftime is in -lintl on SCO UNIX.
-{ $as_echo "$as_me:$LINENO: checking for strftime in -lintl" >&5
-$as_echo_n "checking for strftime in -lintl... " >&6; }
-if test "${ac_cv_lib_intl_strftime+set}" = set; then
-  $as_echo_n "(cached) " >&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.  */
-
-/* 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 wait4 ();
   ;
   return 0;
 }
@@ -71520,36 +71973,25 @@ $as_echo "$ac_try_echo") >&5
         test "$cross_compiling" = yes ||
         $as_test_x conftest$ac_exeext
        }; then
-  ac_cv_lib_intl_strftime=yes
+  ac_cv_func_wait4=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_lib_intl_strftime=no
+       ac_cv_func_wait4=no
 fi
 
 rm -rf conftest.dSYM
 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
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_intl_strftime" >&5
-$as_echo "$ac_cv_lib_intl_strftime" >&6; }
-if test "x$ac_cv_lib_intl_strftime" = x""yes; then
-  cat >>confdefs.h <<\_ACEOF
-#define HAVE_STRFTIME 1
-_ACEOF
-
-LIBS="-lintl $LIBS"
-fi
-
 fi
-done
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_wait4" >&5
+$as_echo "$ac_cv_func_wait4" >&6; }
 
 
-ice_have_strftime=no
+ice_have_writev=no
 
-for ac_func in strftime
+for ac_func in writev
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -71645,21 +72087,21 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_strftime=yes
+ ice_have_writev=yes
 fi
 done
 
-if test "${ice_have_strftime}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for strftime declaration in time.h sys/time.h" >&5
-$as_echo_n "checking for strftime declaration in time.h sys/time.h... " >&6; }
-if test "${ice_cv_have_strftime_decl+set}" = set; then
+if test "${ice_have_writev}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for writev declaration in unistd.h sys/uio.h" >&5
+$as_echo_n "checking for writev declaration in unistd.h sys/uio.h... " >&6; }
+if test "${ice_cv_have_writev_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_strftime_decl=no
+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 time.h sys/time.h; do
+for header in unistd.h sys/uio.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -71671,12 +72113,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}writev[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_writev_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_strftime_decl" = yes; then
+if test "$ice_cv_have_writev_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -71690,33 +72132,33 @@ 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}writev[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_writev_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_strftime_decl" = yes; then
+if test "$ice_cv_have_writev_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_strftime_decl" >&5
-$as_echo "$ice_cv_have_strftime_decl" >&6; }
-if test "$ice_cv_have_strftime_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_writev_decl" >&5
+$as_echo "$ice_cv_have_writev_decl" >&6; }
+if test "$ice_cv_have_writev_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_STRFTIME_DECL 1
+#define HAVE_WRITEV_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_strncasecmp=no
+ice_have_strcasecmp=no
 
-for ac_func in strncasecmp
+for ac_func in strcasecmp
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -71812,18 +72254,18 @@ as_val=`eval 'as_val=${'$as_ac_var'}
   cat >>confdefs.h <<_ACEOF
 #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_strncasecmp=yes
+ ice_have_strcasecmp=yes
 fi
 done
 
-if test "${ice_have_strncasecmp}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for strncasecmp declaration in string.h strings.h" >&5
-$as_echo_n "checking for strncasecmp declaration in string.h strings.h... " >&6; }
-if test "${ice_cv_have_strncasecmp_decl+set}" = set; then
+if test "${ice_have_strcasecmp}" = yes; then
+{ $as_echo "$as_me:$LINENO: checking for strcasecmp declaration in string.h strings.h" >&5
+$as_echo_n "checking for strcasecmp declaration in string.h strings.h... " >&6; }
+if test "${ice_cv_have_strcasecmp_decl+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
 
-ice_cv_have_strncasecmp_decl=no
+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
@@ -71838,12 +72280,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}strcasecmp[    ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_strcasecmp_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_strncasecmp_decl" = yes; then
+if test "$ice_cv_have_strcasecmp_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -71857,81 +72299,317 @@ 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}strcasecmp[    ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_strcasecmp_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_strncasecmp_decl" = yes; then
+if test "$ice_cv_have_strcasecmp_decl" = yes; then
        break
 fi
 done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_strncasecmp_decl" >&5
-$as_echo "$ice_cv_have_strncasecmp_decl" >&6; }
-if test "$ice_cv_have_strncasecmp_decl" = yes; then
+{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_strcasecmp_decl" >&5
+$as_echo "$ice_cv_have_strcasecmp_decl" >&6; }
+if test "$ice_cv_have_strcasecmp_decl" = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRCASECMP_DECL 1
+_ACEOF
+
+fi
+fi
+
+
+#
+# Devices
+#
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-libcurl was given.
+if test "${with_libcurl+set}" = set; then
+  withval=$with_libcurl; _libcurl_with=$withval
+else
+  _libcurl_with=yes
+fi
+
+
+  if test "$_libcurl_with" != "no" ; 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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_AWK+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { 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"
+    $as_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
+  { $as_echo "$as_me:$LINENO: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  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
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path__libcurl_config+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  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 { 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"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+_libcurl_config=$ac_cv_path__libcurl_config
+if test -n "$_libcurl_config"; then
+  { $as_echo "$as_me:$LINENO: result: $_libcurl_config" >&5
+$as_echo "$_libcurl_config" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+     else
+        # Extract the first word of "curl-config", so it can be a program name with args.
+set dummy curl-config; ac_word=$2
+{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path__libcurl_config+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  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 { 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"
+    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+_libcurl_config=$ac_cv_path__libcurl_config
+if test -n "$_libcurl_config"; then
+  { $as_echo "$as_me:$LINENO: result: $_libcurl_config" >&5
+$as_echo "$_libcurl_config" >&6; }
+else
+  { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+     fi
+
+     if test x$_libcurl_config != "x" ; then
+        { $as_echo "$as_me:$LINENO: checking for the version of libcurl" >&5
+$as_echo_n "checking for the version of libcurl... " >&6; }
+if test "${libcurl_cv_lib_curl_version+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+  libcurl_cv_lib_curl_version=`$_libcurl_config --version | $AWK '{print $2}'`
+fi
+{ $as_echo "$as_me:$LINENO: result: $libcurl_cv_lib_curl_version" >&5
+$as_echo "$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
+           { $as_echo "$as_me:$LINENO: checking for libcurl >= version 7.10.0" >&5
+$as_echo_n "checking for libcurl >= version 7.10.0... " >&6; }
+if test "${libcurl_cv_lib_version_ok+set}" = set; then
+  $as_echo_n "(cached) " >&6
+else
+
+              if test $_libcurl_version -ge $_libcurl_wanted ; then
+                 libcurl_cv_lib_version_ok=yes
+              else
+                 libcurl_cv_lib_version_ok=no
+              fi
+
+fi
+{ $as_echo "$as_me:$LINENO: result: $libcurl_cv_lib_version_ok" >&5
+$as_echo "$libcurl_cv_lib_version_ok" >&6; }
+        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`
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRNCASECMP_DECL 1
-_ACEOF
+           # 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
 
-fi
-fi
+        unset _libcurl_wanted
+     fi
 
+     if test $_libcurl_try_link = yes ; then
 
-ice_have_syslog=no
+        # 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"}
 
-for ac_func in syslog
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+        { $as_echo "$as_me:$LINENO: checking whether libcurl is usable" >&5
+$as_echo_n "checking whether libcurl is usable... " >&6; }
+if test "${libcurl_cv_lib_curl_usable+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+
+           _libcurl_save_cppflags=$CPPFLAGS
+           CPPFLAGS="$LIBCURL_CPPFLAGS $CPPFLAGS"
+           _libcurl_save_libs=$LIBS
+           LIBS="$LIBCURL $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 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
-
+#include <curl/curl.h>
 int
 main ()
 {
-return $ac_func ();
+
+/* 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;
+
   ;
   return 0;
 }
@@ -71957,105 +72635,40 @@ $as_echo "$ac_try_echo") >&5
         test "$cross_compiling" = yes ||
         $as_test_x conftest$ac_exeext
        }; then
-  eval "$as_ac_var=yes"
+  libcurl_cv_lib_curl_usable=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       eval "$as_ac_var=no"
+       libcurl_cv_lib_curl_usable=no
 fi
 
 rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-as_val=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
- ice_have_syslog=yes
-fi
-done
-
-if test "${ice_have_syslog}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for syslog declaration in syslog.h" >&5
-$as_echo_n "checking for syslog declaration in syslog.h... " >&6; }
-if test "${ice_cv_have_syslog_decl+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-
-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 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}syslog[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_syslog_decl=yes
-fi
-rm -f conftest*
-
-if test "$ice_cv_have_syslog_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}syslog[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_syslog_decl=yes
-fi
-rm -f conftest*
 
-if test "$ice_cv_have_syslog_decl" = yes; then
-       break
-fi
-done
+           CPPFLAGS=$_libcurl_save_cppflags
+           LIBS=$_libcurl_save_libs
+           unset _libcurl_save_cppflags
+           unset _libcurl_save_libs
 
 fi
+{ $as_echo "$as_me:$LINENO: result: $libcurl_cv_lib_curl_usable" >&5
+$as_echo "$libcurl_cv_lib_curl_usable" >&6; }
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_syslog_decl" >&5
-$as_echo "$ice_cv_have_syslog_decl" >&6; }
-if test "$ice_cv_have_syslog_decl" = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_SYSLOG_DECL 1
-_ACEOF
-
-fi
-fi
+        if test $libcurl_cv_lib_curl_usable = yes ; then
 
+           # Does curl_free() exist in this version of libcurl?
+           # If not, fake it with free()
 
-ice_have_system=no
+           _libcurl_save_cppflags=$CPPFLAGS
+           CPPFLAGS="$CPPFLAGS $LIBCURL_CPPFLAGS"
+           _libcurl_save_libs=$LIBS
+           LIBS="$LIBS $LIBCURL"
 
-for ac_func in system
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+           { $as_echo "$as_me:$LINENO: checking for curl_free" >&5
+$as_echo_n "checking for curl_free... " >&6; }
+if test "${ac_cv_func_curl_free+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -72064,12 +72677,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 curl_free to an innocuous variant, in case <limits.h> declares curl_free.
    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
+#define curl_free innocuous_curl_free
 
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
+    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.  */
 
@@ -72079,7 +72692,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 # include <assert.h>
 #endif
 
-#undef $ac_func
+#undef curl_free
 
 /* Override any GCC internal prototype to avoid an error.
    Use char because int might match the return type of a GCC
@@ -72087,18 +72700,18 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __cplusplus
 extern "C"
 #endif
-char $ac_func ();
+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_$ac_func || defined __stub___$ac_func
+#if defined __stub_curl_free || defined __stub___curl_free
 choke me
 #endif
 
 int
 main ()
 {
-return $ac_func ();
+return curl_free ();
   ;
   return 0;
 }
@@ -72124,161 +72737,153 @@ $as_echo "$ac_try_echo") >&5
         test "$cross_compiling" = yes ||
         $as_test_x conftest$ac_exeext
        }; then
-  eval "$as_ac_var=yes"
+  ac_cv_func_curl_free=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       eval "$as_ac_var=no"
+       ac_cv_func_curl_free=no
 fi
 
 rm -rf conftest.dSYM
 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
       conftest$ac_exeext conftest.$ac_ext
 fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-as_val=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
- ice_have_system=yes
-fi
-done
-
-if test "${ice_have_system}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for system declaration in stdlib.h" >&5
-$as_echo_n "checking for system declaration in stdlib.h... " >&6; }
-if test "${ice_cv_have_system_decl+set}" = set; then
-  $as_echo_n "(cached) " >&6
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_curl_free" >&5
+$as_echo "$ac_cv_func_curl_free" >&6; }
+if test "x$ac_cv_func_curl_free" = x""yes; then
+  :
 else
 
-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 stdlib.h; do
-# Check for ordinary declaration
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+cat >>confdefs.h <<\_ACEOF
+#define curl_free free
 _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}system[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_system_decl=yes
 fi
-rm -f conftest*
 
-if test "$ice_cv_have_system_decl" = yes; then
-       break
-fi
-# Check for "fixed" declaration like "getpid _PARAMS((int))"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+
+           CPPFLAGS=$_libcurl_save_cppflags
+           LIBS=$_libcurl_save_libs
+           unset _libcurl_save_cppflags
+           unset _libcurl_save_libs
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBCURL 1
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
 
+
+
+
+           for _libcurl_feature in $_libcurl_features ; do
+              cat >>confdefs.h <<_ACEOF
+#define `$as_echo "libcurl_feature_$_libcurl_feature" | $as_tr_cpp` 1
 _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
-fi
-rm -f conftest*
 
-if test "$ice_cv_have_system_decl" = yes; then
-       break
-fi
-done
+              eval `$as_echo "libcurl_feature_$_libcurl_feature" | $as_tr_sh`=yes
+           done
 
-fi
+           if test "x$_libcurl_protocols" = "x" ; then
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_system_decl" >&5
-$as_echo "$ice_cv_have_system_decl" >&6; }
-if test "$ice_cv_have_system_decl" = yes; then
+              # We don't have --protocols, so just assume that all
+              # protocols are available
+              _libcurl_protocols="HTTP FTP FILE TELNET LDAP DICT"
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_SYSTEM_DECL 1
+              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
+              cat >>confdefs.h <<_ACEOF
+#define `$as_echo "libcurl_protocol_$_libcurl_protocol" | $as_tr_cpp` 1
 _ACEOF
 
-fi
-fi
+              eval `$as_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
 
+  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
+     # This is the IF-YES path
+     HAVE_CURL=yes
+  fi
 
-ice_have_time=no
+  unset _libcurl_with
 
-for ac_func in time
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+    if test x"$HAVE_CURL" = x"yes"; then
+       LIBS="$LIBCURL $LIBS"
+
+       CPPFLAGS="$CPPFLAGS $LIBCURL_CPPFLAGS"
+
+
+
+
+    { $as_echo "$as_me:$LINENO: checking for curl_off_t" >&5
+$as_echo_n "checking for curl_off_t... " >&6; }
+if test "${ac_cv_type_curl_off_t+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_cv_type_curl_off_t=no
+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>
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
 #endif
+#include <curl/curl.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
-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 ();
+if (sizeof (curl_off_t))
+       return 0;
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -72287,165 +72892,43 @@ $as_echo "$ac_try_echo") >&5
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_var=yes"
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       eval "$as_ac_var=no"
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-as_val=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
- ice_have_time=yes
-fi
-done
-
-if test "${ice_have_time}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for time declaration in time.h sys/time.h" >&5
-$as_echo_n "checking for time declaration in time.h sys/time.h... " >&6; }
-if test "${ice_cv_have_time_decl+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-
-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 time.h sys/time.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}time[  ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_time_decl=yes
-fi
-rm -f conftest*
-
-if test "$ice_cv_have_time_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}time[  ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_time_decl=yes
-fi
-rm -f conftest*
-
-if test "$ice_cv_have_time_decl" = yes; then
-       break
-fi
-done
-
-fi
-
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_time_decl" >&5
-$as_echo "$ice_cv_have_time_decl" >&6; }
-if test "$ice_cv_have_time_decl" = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_TIME_DECL 1
-_ACEOF
-
-fi
-fi
-
-
-ice_have_tolower=no
-
-for ac_func in tolower
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
+       } && test -s conftest.$ac_objext; then
   cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* 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.  */
+/* 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>
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
 #endif
+#include <curl/curl.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
-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 ();
+if (sizeof ((curl_off_t)))
+         return 0;
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -72454,133 +72937,73 @@ $as_echo "$ac_try_echo") >&5
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_var=yes"
+       } && test -s conftest.$ac_objext; then
+  :
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       eval "$as_ac_var=no"
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-as_val=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
- ice_have_tolower=yes
+       ac_cv_type_curl_off_t=yes
 fi
-done
 
-if test "${ice_have_tolower}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for tolower declaration in ctype.h" >&5
-$as_echo_n "checking for tolower declaration in ctype.h... " >&6; }
-if test "${ice_cv_have_tolower_decl+set}" = set; then
-  $as_echo_n "(cached) " >&6
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-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 ctype.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}tolower[       ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_tolower_decl=yes
 fi
-rm -f conftest*
 
-if test "$ice_cv_have_tolower_decl" = yes; then
-       break
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 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>
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_curl_off_t" >&5
+$as_echo "$ac_cv_type_curl_off_t" >&6; }
+if test "x$ac_cv_type_curl_off_t" = x""yes; then
+  :
+else
+
 
+cat >>confdefs.h <<\_ACEOF
+#define curl_off_t off_t
 _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
-fi
-rm -f conftest*
 
-if test "$ice_cv_have_tolower_decl" = yes; then
-       break
-fi
-done
 
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_tolower_decl" >&5
-$as_echo "$ice_cv_have_tolower_decl" >&6; }
-if test "$ice_cv_have_tolower_decl" = yes; then
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_TOLOWER_DECL 1
-_ACEOF
+       case "$host" in
+           *sun-solaris2*) # Solaris, all versions.
+           # we extract the -L flags and translate them to -R flags, as required
+           # by the runtime linker.
+           if test -n "$_libcurl_config"; then
+               curlflags=`$_libcurl_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
+    fi
 
-fi
-fi
 
 
-ice_have_toupper=no
+    HAVE_HMAC=yes
 
-for ac_func in toupper
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+{ $as_echo "$as_me:$LINENO: checking for HMAC_CTX_init in -lcrypto" >&5
+$as_echo_n "checking for HMAC_CTX_init in -lcrypto... " >&6; }
+if test "${ac_cv_lib_crypto_HMAC_CTX_init+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  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.  */
-/* 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
@@ -72588,18 +73011,11 @@ cat >>conftest.$ac_ext <<_ACEOF
 #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
-
+char HMAC_CTX_init ();
 int
 main ()
 {
-return $ac_func ();
+return HMAC_CTX_init ();
   ;
   return 0;
 }
@@ -72625,326 +73041,282 @@ $as_echo "$ac_try_echo") >&5
         test "$cross_compiling" = yes ||
         $as_test_x conftest$ac_exeext
        }; then
-  eval "$as_ac_var=yes"
+  ac_cv_lib_crypto_HMAC_CTX_init=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       eval "$as_ac_var=no"
+       ac_cv_lib_crypto_HMAC_CTX_init=no
 fi
 
 rm -rf conftest.dSYM
 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
-ac_res=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-as_val=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
+{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_crypto_HMAC_CTX_init" >&5
+$as_echo "$ac_cv_lib_crypto_HMAC_CTX_init" >&6; }
+if test "x$ac_cv_lib_crypto_HMAC_CTX_init" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define HAVE_LIBCRYPTO 1
 _ACEOF
- ice_have_toupper=yes
-fi
-done
 
-if test "${ice_have_toupper}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for toupper declaration in ctype.h" >&5
-$as_echo_n "checking for toupper declaration in ctype.h... " >&6; }
-if test "${ice_cv_have_toupper_decl+set}" = set; then
-  $as_echo_n "(cached) " >&6
+  LIBS="-lcrypto $LIBS"
+
 else
+  HAVE_HMAC=no
+fi
 
-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
-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}toupper[       ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_toupper_decl=yes
-fi
-rm -f conftest*
+    found_hmac_h=no
 
-if test "$ice_cv_have_toupper_decl" = yes; then
-       break
+
+
+for ac_header in openssl/hmac.h crypto/hmac.h hmac.h
+do
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
 fi
-# Check for "fixed" declaration like "getpid _PARAMS((int))"
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&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>
-
-_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
-fi
-rm -f conftest*
-
-if test "$ice_cv_have_toupper_decl" = yes; then
-       break
-fi
-done
-
-fi
-
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_toupper_decl" >&5
-$as_echo "$ice_cv_have_toupper_decl" >&6; }
-if test "$ice_cv_have_toupper_decl" = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_TOUPPER_DECL 1
+$ac_includes_default
+#include <$ac_header>
 _ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+       ac_header_compiler=no
 fi
-fi
-
 
-ice_have_ungetc=no
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
-for ac_func in ungetc
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&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 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;
-}
+#include <$ac_header>
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
+  (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
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
        }; then
-  eval "$as_ac_var=yes"
+  ac_header_preproc=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       eval "$as_ac_var=no"
+  ac_header_preproc=no
 fi
 
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
 fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
+ac_res=`eval 'as_val=${'$as_ac_Header'}
                 $as_echo "$as_val"'`
               { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-as_val=`eval 'as_val=${'$as_ac_var'}
+
+fi
+as_val=`eval 'as_val=${'$as_ac_Header'}
                 $as_echo "$as_val"'`
    if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
- ice_have_ungetc=yes
+ found_hmac_h=yes; break
 fi
+
 done
 
-if test "${ice_have_ungetc}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for ungetc declaration in stdio.h" >&5
-$as_echo_n "checking for ungetc declaration in stdio.h... " >&6; }
-if test "${ice_cv_have_ungetc_decl+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
+    if test x"$found_hmac_h" != x"yes"; then
+       HAVE_HMAC=no
+    fi
 
-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.  */
-#include <$header>
 
-_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
-fi
-rm -f conftest*
 
-if test "$ice_cv_have_ungetc_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}ungetc[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_ungetc_decl=yes
+
+    # Check whether --enable-s3-device was given.
+if test "${enable_s3_device+set}" = set; then
+  enableval=$enable_s3_device;  WANT_S3_DEVICE=$enableval
+else
+   WANT_S3_DEVICE=maybe
 fi
-rm -f conftest*
 
-if test "$ice_cv_have_ungetc_decl" = yes; then
-       break
+
+    { $as_echo "$as_me:$LINENO: checking whether to include the Amazon S3 device" >&5
+$as_echo_n "checking whether to include the Amazon S3 device... " >&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
+               { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+               { { $as_echo "$as_me:$LINENO: error: Cannot build the Amazon S3 device: one or more prerequisites are missing." >&5
+$as_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
+    { $as_echo "$as_me:$LINENO: result: $WANT_S3_DEVICE" >&5
+$as_echo "$WANT_S3_DEVICE" >&6; }
+
+     if test x"$WANT_S3_DEVICE" = x"yes"; then
+  WANT_S3_DEVICE_TRUE=
+  WANT_S3_DEVICE_FALSE='#'
+else
+  WANT_S3_DEVICE_TRUE='#'
+  WANT_S3_DEVICE_FALSE=
 fi
-done
 
-fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_ungetc_decl" >&5
-$as_echo "$ice_cv_have_ungetc_decl" >&6; }
-if test "$ice_cv_have_ungetc_decl" = yes; then
+    # 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
+
+    fi
+
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_UNGETC_DECL 1
-_ACEOF
 
-fi
-fi
 
 
-for ac_func in unsetenv
+for ac_header in \
+       linux/zftape.h \
+       sys/tape.h \
+       sys/mtio.h \
+
 do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
   $as_echo_n "(cached) " >&6
+fi
+ac_res=`eval 'as_val=${'$as_ac_Header'}
+                $as_echo "$as_val"'`
+              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  # Is the header compilable?
+{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5
+$as_echo_n "checking $ac_header usability... " >&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 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;
-}
+$ac_includes_default
+#include <$ac_header>
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -72953,268 +73325,150 @@ $as_echo "$ac_try_echo") >&5
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_var=yes"
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       eval "$as_ac_var=no"
-fi
-
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-as_val=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
+       ac_header_compiler=no
 fi
-done
-
 
-ice_have_vfprintf=no
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
 
-for ac_func in vfprintf
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
+# Is the header present?
+{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5
+$as_echo_n "checking $ac_header presence... " >&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 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;
-}
+#include <$ac_header>
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+if { (ac_try="$ac_cpp conftest.$ac_ext"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
+  (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
   $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && {
-        test -z "$ac_c_werror_flag" ||
+  (exit $ac_status); } >/dev/null && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
        }; then
-  eval "$as_ac_var=yes"
+  ac_header_preproc=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       eval "$as_ac_var=no"
+  ac_header_preproc=no
 fi
 
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_ext
+{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+
+    ;;
+esac
+{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5
+$as_echo_n "checking for $ac_header... " >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  $as_echo_n "(cached) " >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
 fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
+ac_res=`eval 'as_val=${'$as_ac_Header'}
                 $as_echo "$as_val"'`
               { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
 $as_echo "$ac_res" >&6; }
-as_val=`eval 'as_val=${'$as_ac_var'}
+
+fi
+as_val=`eval 'as_val=${'$as_ac_Header'}
                 $as_echo "$as_val"'`
    if test "x$as_val" = x""yes; then
   cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
- ice_have_vfprintf=yes
-fi
-done
-
-if test "${ice_have_vfprintf}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for vfprintf declaration in stdio.h stdlib.h" >&5
-$as_echo_n "checking for vfprintf declaration in stdio.h stdlib.h... " >&6; }
-if test "${ice_cv_have_vfprintf_decl+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-
-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.  */
-#include <$header>
-
-_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
-fi
-rm -f conftest*
-
-if test "$ice_cv_have_vfprintf_decl" = yes; then
-       break
-fi
-# Check for "fixed" declaration like "getpid _PARAMS((int))"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 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}vfprintf[      ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_vfprintf_decl=yes
 fi
-rm -f conftest*
 
-if test "$ice_cv_have_vfprintf_decl" = yes; then
-       break
-fi
 done
 
-fi
-
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_vfprintf_decl" >&5
-$as_echo "$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
-
-fi
-fi
-
-
-ice_have_vprintf=no
 
-for ac_func in vprintf
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+    # check for MTIOCTOP, an indicator of POSIX tape support
+    { $as_echo "$as_me:$LINENO: checking for MTIOCTOP" >&5
+$as_echo_n "checking for MTIOCTOP... " >&6; }
+if test "${amanda_cv_HAVE_MTIOCTOP+set}" = set; then
   $as_echo_n "(cached) " >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+
+       cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* 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 HAVE_SYS_TAPE_H
+# include <sys/tape.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"
+#ifdef HAVE_SYS_MTIO_H
+# include <sys/mtio.h>
 #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
+#ifndef MTIOCTOP
+#error MTIOCTOP not defined
 #endif
 
 int
 main ()
 {
-return $ac_func ();
+ int dummy = 0;
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -73223,159 +73477,145 @@ $as_echo "$ac_try_echo") >&5
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_var=yes"
+       } && test -s conftest.$ac_objext; then
+  amanda_cv_HAVE_MTIOCTOP=yes
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       eval "$as_ac_var=no"
+       amanda_cv_HAVE_MTIOCTOP=no
 fi
 
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-as_val=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
- ice_have_vprintf=yes
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+       HAVE_MTIOCTOP=$amanda_cv_HAVE_MTIOCTOP
+
 fi
-done
+{ $as_echo "$as_me:$LINENO: result: $amanda_cv_HAVE_MTIOCTOP" >&5
+$as_echo "$amanda_cv_HAVE_MTIOCTOP" >&6; }
 
-if test "${ice_have_vprintf}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for vprintf declaration in stdio.h stdlib.h" >&5
-$as_echo_n "checking for vprintf declaration in stdio.h stdlib.h... " >&6; }
-if test "${ice_cv_have_vprintf_decl+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
+    # maybe we have no tape device at all (e.g., Mac OS X)?
+    if test x"$HAVE_MTIOCTOP" = x"yes"; then
+       want_tape_device=yes
 
-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.  */
+cat >>confdefs.h <<\_ACEOF
+#define WANT_TAPE_DEVICE 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}vprintf[       ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_vprintf_decl=yes
+    fi
+     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
-rm -f conftest*
 
-if test "$ice_cv_have_vprintf_decl" = yes; then
-       break
-fi
-# Check for "fixed" declaration like "getpid _PARAMS((int))"
-cat >conftest.$ac_ext <<_ACEOF
+
+    #
+    # Check for various "mt status" related structure elements.
+    #
+    { $as_echo "$as_me:$LINENO: checking for mt_flags mtget structure element" >&5
+$as_echo_n "checking for mt_flags mtget structure element... " >&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>
 
-_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
-rm -f conftest*
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/mtio.h>
 
-if test "$ice_cv_have_vprintf_decl" = yes; then
-       break
-fi
-done
+int
+main ()
+{
 
-fi
+           struct mtget buf;
+           long ds;
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_vprintf_decl" >&5
-$as_echo "$ice_cv_have_vprintf_decl" >&6; }
-if test "$ice_cv_have_vprintf_decl" = yes; then
+           ds = buf.mt_flags;
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_VPRINTF_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 ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
 
-fi
-fi
+           { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
-{ $as_echo "$as_me:$LINENO: checking for wait4" >&5
-$as_echo_n "checking for wait4... " >&6; }
-if test "${ac_cv_func_wait4+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MT_FLAGS 1
 _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
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-#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
+           { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+    { $as_echo "$as_me:$LINENO: checking for mt_fileno mtget structure element" >&5
+$as_echo_n "checking for mt_fileno mtget structure element... " >&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 ()
 {
-return wait4 ();
+
+           struct mtget buf;
+           long ds;
+
+           ds = buf.mt_fileno;
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -73384,90 +73624,63 @@ $as_echo "$ac_try_echo") >&5
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  ac_cv_func_wait4=yes
+       } && test -s conftest.$ac_objext; then
+
+           { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MT_FILENO 1
+_ACEOF
+
+
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       ac_cv_func_wait4=no
-fi
 
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_wait4" >&5
-$as_echo "$ac_cv_func_wait4" >&6; }
+           { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
+fi
 
-ice_have_writev=no
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-for ac_func in writev
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
+    { $as_echo "$as_me:$LINENO: checking for mt_blkno mtget structure element" >&5
+$as_echo_n "checking for mt_blkno mtget structure element... " >&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 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
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/mtio.h>
 
 int
 main ()
 {
-return $ac_func ();
+
+           struct mtget buf;
+           long ds;
+
+           ds = buf.mt_blkno;
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -73476,165 +73689,128 @@ $as_echo "$ac_try_echo") >&5
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_var=yes"
+       } && test -s conftest.$ac_objext; then
+
+           { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MT_BLKNO 1
+_ACEOF
+
+
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       eval "$as_ac_var=no"
-fi
 
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-as_val=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
- ice_have_writev=yes
+           { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+
 fi
-done
 
-if test "${ice_have_writev}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for writev declaration in unistd.h sys/uio.h" >&5
-$as_echo_n "checking for writev declaration in unistd.h sys/uio.h... " >&6; }
-if test "${ice_cv_have_writev_decl+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-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
+    { $as_echo "$as_me:$LINENO: checking for mt_dsreg mtget structure element" >&5
+$as_echo_n "checking for mt_dsreg mtget structure element... " >&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>
 
-_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*
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/mtio.h>
 
-if test "$ice_cv_have_writev_decl" = yes; then
-       break
-fi
-# Check for "fixed" declaration like "getpid _PARAMS((int))"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+int
+main ()
+{
+
+           struct mtget buf;
+           long ds;
+
+           ds = buf.mt_dsreg;
+
+  ;
+  return 0;
+}
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
+$as_echo "$ac_try_echo") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+
+           { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
 
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MT_DSREG 1
 _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
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_writev_decl" >&5
-$as_echo "$ice_cv_have_writev_decl" >&6; }
-if test "$ice_cv_have_writev_decl" = yes; then
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_WRITEV_DECL 1
-_ACEOF
+           { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
 
 fi
-fi
 
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-ice_have_strcasecmp=no
-
-for ac_func in strcasecmp
-do
-as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
-$as_echo_n "checking for $ac_func... " >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
-  $as_echo_n "(cached) " >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
+    { $as_echo "$as_me:$LINENO: checking for mt_erreg mtget structure element" >&5
+$as_echo_n "checking for mt_erreg mtget structure element... " >&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 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
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/mtio.h>
 
 int
 main ()
 {
-return $ac_func ();
+
+           struct mtget buf;
+           long ds;
+
+           ds = buf.mt_erreg;
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 $as_echo "$ac_try_echo") >&5
-  (eval "$ac_link") 2>conftest.er1
+  (eval "$ac_compile") 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -73643,99 +73819,101 @@ $as_echo "$ac_try_echo") >&5
   (exit $ac_status); } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        $as_test_x conftest$ac_exeext
-       }; then
-  eval "$as_ac_var=yes"
+       } && test -s conftest.$ac_objext; then
+
+           { $as_echo "$as_me:$LINENO: result: yes" >&5
+$as_echo "yes" >&6; }
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MT_ERREG 1
+_ACEOF
+
+
 else
   $as_echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-       eval "$as_ac_var=no"
-fi
 
-rm -rf conftest.dSYM
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-ac_res=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-              { $as_echo "$as_me:$LINENO: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-as_val=`eval 'as_val=${'$as_ac_var'}
-                $as_echo "$as_val"'`
-   if test "x$as_val" = x""yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
- ice_have_strcasecmp=yes
+           { $as_echo "$as_me:$LINENO: result: no" >&5
+$as_echo "no" >&6; }
+
 fi
-done
 
-if test "${ice_have_strcasecmp}" = yes; then
-{ $as_echo "$as_me:$LINENO: checking for strcasecmp declaration in string.h strings.h" >&5
-$as_echo_n "checking for strcasecmp declaration in string.h strings.h... " >&6; }
-if test "${ice_cv_have_strcasecmp_decl+set}" = set; then
-  $as_echo_n "(cached) " >&6
-else
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-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.  */
+    case "$host" in
+       *linux*)
+cat >>confdefs.h <<\_ACEOF
+#define DEFAULT_TAPE_NON_BLOCKING_OPEN 1
 _ACEOF
-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}strcasecmp[    ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_strcasecmp_decl=yes
+
+       # Check whether --enable-dvdrw-device was given.
+if test "${enable_dvdrw_device+set}" = set; then
+  enableval=$enable_dvdrw_device;  WANT_DVDRW_DEVICE=$enableval
+else
+   WANT_DVDRW_DEVICE=yes
 fi
-rm -f conftest*
 
-if test "$ice_cv_have_strcasecmp_decl" = yes; then
-       break
+
+       { $as_echo "$as_me:$LINENO: checking whether to include the DVD-RW device" >&5
+$as_echo_n "checking whether to include the DVD-RW device... " >&6; }
+       { $as_echo "$as_me:$LINENO: result: $WANT_DVDRW_DEVICE" >&5
+$as_echo "$WANT_DVDRW_DEVICE" >&6; }
+
+        if test x"$WANT_DVDRW_DEVICE" = x"yes"; then
+  WANT_DVDRW_DEVICE_TRUE=
+  WANT_DVDRW_DEVICE_FALSE='#'
+else
+  WANT_DVDRW_DEVICE_TRUE='#'
+  WANT_DVDRW_DEVICE_FALSE=
 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>
 
+
+       # Now handle any setup for DVDRW, if we want it.
+       if test x"$WANT_DVDRW_DEVICE" = x"yes"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define WANT_DVDRW_DEVICE /**/
 _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*
 
-if test "$ice_cv_have_strcasecmp_decl" = yes; then
-       break
-fi
-done
+       fi
+
 
+
+
+    # Check whether --enable-ndmp-device was given.
+if test "${enable_ndmp_device+set}" = set; then
+  enableval=$enable_ndmp_device;  WANT_NDMP_DEVICE=$enableval
+else
+   WANT_NDMP_DEVICE=$WANT_NDMP
 fi
 
-{ $as_echo "$as_me:$LINENO: result: $ice_cv_have_strcasecmp_decl" >&5
-$as_echo "$ice_cv_have_strcasecmp_decl" >&6; }
-if test "$ice_cv_have_strcasecmp_decl" = yes; then
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRCASECMP_DECL 1
+    if test x"$WANT_NDMP" != x"true" -a x"$WANT_NDMP_DEVICE" = x"true"; then
+       { { $as_echo "$as_me:$LINENO: error: NDMP support is required to build the ndmp device (--with-ndmp)" >&5
+$as_echo "$as_me: error: NDMP support is required to build the ndmp device (--with-ndmp)" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+
+    if test x"$WANT_NDMP_DEVICE" = x"true"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define WANT_NDMP_DEVICE 1
 _ACEOF
 
+    fi
+
+     if test x"$WANT_NDMP_DEVICE" = x"true"; then
+  WANT_NDMP_DEVICE_TRUE=
+  WANT_NDMP_DEVICE_FALSE='#'
+else
+  WANT_NDMP_DEVICE_TRUE='#'
+  WANT_NDMP_DEVICE_FALSE=
 fi
-fi
+
 
 
 
     gltests_LTLIBOBJS=$gltests_ltlibobjs
 
 
+if test -z "${WANT_AS_NEEDED_TRUE}" && test -z "${WANT_AS_NEEDED_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_AS_NEEDED\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"WANT_AS_NEEDED\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
 if test -z "${CHECK_USERID_TRUE}" && test -z "${CHECK_USERID_FALSE}"; then
   { { $as_echo "$as_me:$LINENO: error: conditional \"CHECK_USERID\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
@@ -74026,34 +74211,6 @@ $as_echo "$as_me: error: conditional \"WANT_MANDATORY_THREAD_CHECK\" was never d
 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
-  { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_S3_DEVICE\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-$as_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_TAPE_DEVICE_TRUE}" && test -z "${WANT_TAPE_DEVICE_FALSE}"; then
-  { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_TAPE_DEVICE\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-$as_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_DVDRW_DEVICE_TRUE}" && test -z "${WANT_DVDRW_DEVICE_FALSE}"; then
-  { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_DVDRW_DEVICE\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-$as_echo "$as_me: error: conditional \"WANT_DVDRW_DEVICE\" was never defined.
-Usually this means the macro was only invoked conditionally." >&2;}
-   { (exit 1); exit 1; }; }
-fi
-if test -z "${WANT_NDMP_DEVICE_TRUE}" && test -z "${WANT_NDMP_DEVICE_FALSE}"; then
-  { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_NDMP_DEVICE\" was never defined.
-Usually this means the macro was only invoked conditionally." >&5
-$as_echo "$as_me: error: conditional \"WANT_NDMP_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
   { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_BSD_SECURITY\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
@@ -74111,6 +74268,34 @@ $as_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 "${WANT_S3_DEVICE_TRUE}" && test -z "${WANT_S3_DEVICE_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_S3_DEVICE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_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_TAPE_DEVICE_TRUE}" && test -z "${WANT_TAPE_DEVICE_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_TAPE_DEVICE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_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_DVDRW_DEVICE_TRUE}" && test -z "${WANT_DVDRW_DEVICE_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_DVDRW_DEVICE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"WANT_DVDRW_DEVICE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+if test -z "${WANT_NDMP_DEVICE_TRUE}" && test -z "${WANT_NDMP_DEVICE_FALSE}"; then
+  { { $as_echo "$as_me:$LINENO: error: conditional \"WANT_NDMP_DEVICE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+$as_echo "$as_me: error: conditional \"WANT_NDMP_DEVICE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
 
 : ${CONFIG_STATUS=./config.status}
 ac_write_fail=0
index 8cc9bfbb35364b48189580680b19780ed6c98f8e..ee614a5398fc08be6df4ba85ebbf40e449011880 100644 (file)
@@ -34,6 +34,7 @@ AC_OBJEXT
 AC_EXEEXT
 AMANDA_INIT_FLAGS
 AMANDA_ADD_CPPFLAGS([-D_GNU_SOURCE])
+AMANDA_AS_NEEDED
 
 dnl -------------------------------------------------------------------------
 
@@ -94,14 +95,6 @@ dnl These lines *must* be in configure.in, and not indented
 AM_GNU_GETTEXT_VERSION([0.15])
 AM_GNU_GETTEXT([external])
 
-#
-# Devices
-#
-AMANDA_S3_DEVICE
-AMANDA_TAPE_DEVICE
-AMANDA_DVDRW_DEVICE
-AMANDA_NDMP_DEVICE
-
 #
 # Security (authentication) mechansims
 #
@@ -121,6 +114,7 @@ AMANDA_PROG_VDUMP_VRESTORE
 AMANDA_PROG_DUMP_RESTORE
 AMANDA_PROG_GNUTAR
 AMANDA_PROG_STAR
+AMANDA_PROG_SUNTAR
 AMANDA_PROG_SAMBA_CLIENT
 AMANDA_CHECK_USE_RUNDUMP
 
@@ -142,6 +136,8 @@ AMANDA_PROG_SORT
 AMANDA_PROG_MAILER
 AMANDA_PROG_MT
 AMANDA_PROG_MTX
+AMANDA_PROG_MOUNT
+AMANDA_PROG_UMOUNT
 AMANDA_PROG_LPR
 AMANDA_PROG_PCAT
 AMANDA_PROG_PERL
@@ -362,6 +358,14 @@ AC_CHECK_FUNC(wait4)
 ICE_CHECK_DECL(writev, unistd.h sys/uio.h)
 ICE_CHECK_DECL(strcasecmp,string.h strings.h)
 
+#
+# Devices
+#
+AMANDA_S3_DEVICE
+AMANDA_TAPE_DEVICE
+AMANDA_DVDRW_DEVICE
+AMANDA_NDMP_DEVICE
+
 dnl -------------------------------------------------------------------------
 
 dnl
index 2f0bf727bd67e310bc83edd7b23c08bcf5ebd252..73cf6585fe7b807296f21f6899e23a45207a6959 100644 (file)
@@ -15,7 +15,7 @@ if GCC_COMPILER
 # ndmp-device.c includes files with old-skool prototypes, so:
 AM_CFLAGS += -Wno-strict-prototypes
 endif
-AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
+AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS) $(AS_NEEDED_FLAGS)
 
 sbin_PROGRAMS =
 
@@ -27,7 +27,7 @@ sbin_SCRIPTS = $(SCRIPTS_PERL)
 ## libamdevice.la
 
 amlib_LTLIBRARIES =    libamdevice.la
-libamdevice_la_LDFLAGS = -release $(VERSION) 
+libamdevice_la_LDFLAGS = -release $(VERSION) $(AS_NEEDED_FLAGS)
 libamdevice_la_SOURCES = \
        property.c \
        device.c \
index 73b24cd0eea8faf249f8f7c3c203987c72ec1ca7..a2e54359f46060da55da2cacd7a3003863a1ca19 100644 (file)
@@ -163,6 +163,7 @@ am__aclocal_m4_deps =  \
        $(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/as_needed.m4 \
        $(top_srcdir)/config/amanda/bsd-security.m4 \
        $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
        $(top_srcdir)/config/amanda/bsdudp-security.m4 \
@@ -409,6 +410,7 @@ APPLICATION_DIR = @APPLICATION_DIR@
 AR = @AR@
 ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
 ASSERTIONS = @ASSERTIONS@
+AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -882,6 +884,7 @@ LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
 MKDIR_P = @MKDIR_P@
+MOUNT = @MOUNT@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
@@ -1079,6 +1082,7 @@ STDBOOL_H = @STDBOOL_H@
 STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
+SUNTAR = @SUNTAR@
 SVN = @SVN@
 SWIG = @SWIG@
 SWIG_LIB = @SWIG_LIB@
@@ -1086,6 +1090,7 @@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TCPPORTRANGE = @TCPPORTRANGE@
 TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
 UDPPORTRANGE = @UDPPORTRANGE@
+UMOUNT = @UMOUNT@
 UNCOMPRESS_OPT = @UNCOMPRESS_OPT@
 UNCOMPRESS_PATH = @UNCOMPRESS_PATH@
 UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
@@ -1196,14 +1201,14 @@ INCLUDES = -I$(top_builddir)/common-src \
                -I$(top_srcdir)/gnulib
 
 AM_CFLAGS = $(AMANDA_WARNING_CFLAGS) $(am__append_1)
-AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
+AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS) $(AS_NEEDED_FLAGS)
 SCRIPTS_PERL = \
        amdevcheck \
        amtapetype
 
 sbin_SCRIPTS = $(SCRIPTS_PERL)
 amlib_LTLIBRARIES = libamdevice.la
-libamdevice_la_LDFLAGS = -release $(VERSION) 
+libamdevice_la_LDFLAGS = -release $(VERSION) $(AS_NEEDED_FLAGS)
 libamdevice_la_SOURCES = property.c device.c directtcp-connection.c \
        null-device.c rait-device.c vfs-device.c xfer-source-device.c \
        xfer-dest-device.c xfer-dest-taper.c xfer-dest-taper-cacher.c \
index 0fe626a8829e258ab317aa500306809e2f12d41f..0e0c9987ea7333e253407b2a74107e11322d319a 100644 (file)
@@ -1027,8 +1027,8 @@ listen_impl(
 
     /* then tell it to start listening */
     if (!ndmp_connection_mover_listen(self->ndmp,
-               for_writing? NDMP4_MOVER_MODE_READ : NDMP4_MOVER_MODE_WRITE,
-               NDMP4_ADDR_TCP,
+               for_writing? NDMP9_MOVER_MODE_READ : NDMP9_MOVER_MODE_WRITE,
+               NDMP9_ADDR_TCP,
                addrs)) {
        set_error_from_ndmp(self);
        return FALSE;
@@ -1076,7 +1076,7 @@ accept_impl(
                return FALSE;
            }
 
-           if (state != NDMP4_MOVER_STATE_LISTEN)
+           if (state != NDMP9_MOVER_STATE_LISTEN)
                break;
 
            /* back off a little bit to give the other side time to breathe,
@@ -1088,7 +1088,7 @@ accept_impl(
        }
 
        /* double-check state */
-       if (state != NDMP4_MOVER_STATE_ACTIVE) {
+       if (state != NDMP9_MOVER_STATE_ACTIVE) {
            device_set_error(DEVICE(self),
                g_strdup("mover did not enter the ACTIVE state as expected"),
                DEVICE_STATUS_DEVICE_ERROR);
@@ -1136,9 +1136,9 @@ accept_impl(
     self->listen_addrs = NULL;
 
     if (self->for_writing)
-       mode = NDMP4_MOVER_MODE_READ;
+       mode = NDMP9_MOVER_MODE_READ;
     else
-       mode = NDMP4_MOVER_MODE_WRITE;
+       mode = NDMP9_MOVER_MODE_WRITE;
 
     /* set up the new directtcp connection */
     if (self->directtcp_conn)
@@ -1197,9 +1197,9 @@ connect_impl(
     }
 
     if (self->for_writing)
-       mode = NDMP4_MOVER_MODE_READ;
+       mode = NDMP9_MOVER_MODE_READ;
     else
-       mode = NDMP4_MOVER_MODE_WRITE;
+       mode = NDMP9_MOVER_MODE_WRITE;
 
     if (!ndmp_connection_mover_connect(self->ndmp, mode, addrs)) {
        set_error_from_ndmp(self);
@@ -1283,7 +1283,7 @@ write_from_connection_impl(
     /* if this is false, then the caller did not use use_connection correctly */
     g_assert(self->directtcp_conn != NULL);
     g_assert(self->ndmp == nconn->ndmp);
-    g_assert(nconn->mode == NDMP4_MOVER_MODE_READ);
+    g_assert(nconn->mode == NDMP9_MOVER_MODE_READ);
 
     if (!ndmp_connection_mover_get_state(self->ndmp,
                &mover_state, &bytes_moved_before, NULL, NULL)) {
@@ -1292,7 +1292,7 @@ write_from_connection_impl(
     }
 
     /* the mover had best be PAUSED right now */
-    g_assert(mover_state == NDMP4_MOVER_STATE_PAUSED);
+    g_assert(mover_state == NDMP9_MOVER_STATE_PAUSED);
 
     if (!ndmp_connection_mover_set_window(self->ndmp,
                nconn->offset,
@@ -1410,7 +1410,7 @@ read_to_connection_impl(
     /* if this is false, then the caller did not use use_connection correctly */
     g_assert(nconn != NULL);
     g_assert(self->ndmp == nconn->ndmp);
-    g_assert(nconn->mode == NDMP4_MOVER_MODE_WRITE);
+    g_assert(nconn->mode == NDMP9_MOVER_MODE_WRITE);
 
     if (!ndmp_connection_mover_get_state(self->ndmp,
                &mover_state, &bytes_moved_before, NULL, NULL)) {
@@ -1419,7 +1419,7 @@ read_to_connection_impl(
     }
 
     /* the mover had best be PAUSED right now */
-    g_assert(mover_state == NDMP4_MOVER_STATE_PAUSED);
+    g_assert(mover_state == NDMP9_MOVER_STATE_PAUSED);
 
     if (!ndmp_connection_mover_set_window(self->ndmp,
                nconn->offset,
index 875e7e6066c043b3f5b5426e2413d47cb886c247..e438dd57791c40a660df06fdf3d79a4ba8efcc6d 100644 (file)
@@ -234,6 +234,9 @@ void device_property_init(void) {
     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_enforce_max_volume_usage,
+                                      G_TYPE_BOOLEAN, "enforce_max_volume_usage",
+      "Does max_volume_usage enabled?");
     device_property_fill_and_register(&device_property_verbose,
                                      G_TYPE_BOOLEAN, "verbose",
        "Should the device produce verbose output?");
@@ -259,6 +262,7 @@ DevicePropertyBase device_property_medium_access_type;
 DevicePropertyBase device_property_partial_deletion;
 DevicePropertyBase device_property_full_deletion;
 DevicePropertyBase device_property_max_volume_usage;
+DevicePropertyBase device_property_enforce_max_volume_usage;
 DevicePropertyBase device_property_comment;
 DevicePropertyBase device_property_leom;
 DevicePropertyBase device_property_verbose;
index 1e296e1dd4b487e0aa3a216d1d866a57b14eff63..c2ea8f07a82af20ba2e2190da0ec4cd72f376a32 100644 (file)
@@ -240,6 +240,11 @@ extern DevicePropertyBase device_property_full_deletion;
 extern DevicePropertyBase device_property_max_volume_usage;
 #define PROPERTY_MAX_VOLUME_USAGE (device_property_max_volume_usage.ID)
 
+/* For devices supporting max_volume_usage this property will be used 
+disable/enable property max_volume_usage. If FALSE, max_volume_usage 
+will not be verified while writing to the device */
+extern DevicePropertyBase device_property_enforce_max_volume_usage;
+#define PROPERTY_ENFORCE_MAX_VOLUME_USAGE (device_property_enforce_max_volume_usage.ID)
 /* Should the device produce verbose output?  Value is a gboolean.  Not
  * present in all devices. */
 extern DevicePropertyBase device_property_verbose;
index d060974fff944a9d2153f69605bd34e77bc12780..1f0b601b706d8ababb65793aebe0f4cff7cc7e50 100644 (file)
@@ -66,12 +66,25 @@ static GType        s3_device_get_type      (void);
  */
 typedef struct _S3MetadataFile S3MetadataFile;
 
+typedef struct _S3_by_thread S3_by_thread;
+struct _S3_by_thread {
+    S3Handle * volatile          s3;
+    CurlBuffer volatile          curl_buffer;
+    guint volatile               buffer_len;
+    int volatile                 idle;
+    int volatile                 eof;
+    int volatile                 done;
+    char volatile * volatile     filename;
+    DeviceStatusFlags volatile   errflags;     /* device_status */
+    char volatile * volatile     errmsg;       /* device error message */
+};
+
 typedef struct _S3Device S3Device;
 struct _S3Device {
     Device __parent__;
 
     /* The "easy" curl handle we use to access Amazon S3 */
-    S3Handle *s3;
+    S3_by_thread *s3t;
 
     /* S3 access information */
     char *bucket;
@@ -84,6 +97,8 @@ struct _S3Device {
 
     char *bucket_location;
     char *storage_class;
+    char *host;
+    char *service_path;
 
     char *ca_info;
 
@@ -104,6 +119,21 @@ struct _S3Device {
     /* Throttling */
     guint64 max_send_speed;
     guint64 max_recv_speed;
+
+    gboolean leom;
+    guint64 volume_bytes;
+    guint64 volume_limit;
+    gboolean enforce_volume_limit;
+    gboolean use_subdomain;
+
+    int          nb_threads;
+    int          nb_threads_backup;
+    int          nb_threads_recovery;
+    GThreadPool *thread_pool_write;
+    GThreadPool *thread_pool_read;
+    GCond       *thread_idle_cond;
+    GMutex      *thread_idle_mutex;
+    int          next_block_to_read;
 };
 
 /*
@@ -129,6 +159,7 @@ struct _S3DeviceClass {
 #define S3_DEVICE_MIN_BLOCK_SIZE 1024
 #define S3_DEVICE_MAX_BLOCK_SIZE (100*1024*1024)
 #define S3_DEVICE_DEFAULT_BLOCK_SIZE (10*1024*1024)
+#define EOM_EARLY_WARNING_ZONE_BLOCKS 4
 
 /* This goes in lieu of file number for metadata. */
 #define SPECIAL_INFIX "special-"
@@ -146,6 +177,12 @@ static DevicePropertyBase device_property_s3_secret_key;
 #define PROPERTY_S3_SECRET_KEY (device_property_s3_secret_key.ID)
 #define PROPERTY_S3_ACCESS_KEY (device_property_s3_access_key.ID)
 
+/* Host and path */
+static DevicePropertyBase device_property_s3_host;
+static DevicePropertyBase device_property_s3_service_path;
+#define PROPERTY_S3_HOST (device_property_s3_host.ID)
+#define PROPERTY_S3_SERVICE_PATH (device_property_s3_service_path.ID)
+
 /* Same, but for S3 with DevPay. */
 static DevicePropertyBase device_property_s3_user_token;
 #define PROPERTY_S3_USER_TOKEN (device_property_s3_user_token.ID)
@@ -172,6 +209,15 @@ static DevicePropertyBase device_property_max_recv_speed;
 #define PROPERTY_MAX_SEND_SPEED (device_property_max_send_speed.ID)
 #define PROPERTY_MAX_RECV_SPEED (device_property_max_recv_speed.ID)
 
+/* Whether to use subdomain */
+static DevicePropertyBase device_property_s3_subdomain;
+#define PROPERTY_S3_SUBDOMAIN (device_property_s3_subdomain.ID)
+
+/* Number of threads to use */
+static DevicePropertyBase device_property_nb_threads_backup;
+#define PROPERTY_NB_THREADS_BACKUP (device_property_nb_threads_backup.ID)
+static DevicePropertyBase device_property_nb_threads_recovery;
+#define PROPERTY_NB_THREADS_RECOVERY (device_property_nb_threads_recovery.ID)
 
 /*
  * prototypes
@@ -250,9 +296,9 @@ delete_file(S3Device *self,
 static gboolean
 delete_all_files(S3Device *self);
 
-/* Set up self->s3 as best as possible.
+/* Set up self->s3t as best as possible.
  *
- * The return value is TRUE iff self->s3 is useable.
+ * The return value is TRUE iff self->s3t is useable.
  *
  * @param self: the S3Device object
  * @returns: TRUE if the handle is set up
@@ -318,6 +364,46 @@ static gboolean s3_device_set_max_recv_speed_fn(Device *self,
     DevicePropertyBase *base, GValue *val,
     PropertySurety surety, PropertySource source);
 
+static gboolean s3_device_set_nb_threads_backup(Device *self,
+    DevicePropertyBase *base, GValue *val,
+    PropertySurety surety, PropertySource source);
+
+static gboolean s3_device_set_nb_threads_recovery(Device *self,
+    DevicePropertyBase *base, GValue *val,
+    PropertySurety surety, PropertySource source);
+
+static gboolean s3_device_set_max_volume_usage_fn(Device *p_self,
+    DevicePropertyBase *base, GValue *val,
+    PropertySurety surety, PropertySource source);
+
+static gboolean property_set_leom_fn(Device *p_self,
+    DevicePropertyBase *base, GValue *val,
+    PropertySurety surety, PropertySource source);
+
+static gboolean s3_device_set_enforce_max_volume_usage_fn(Device *p_self,
+    DevicePropertyBase *base, GValue *val,
+    PropertySurety surety, PropertySource source);
+
+static gboolean s3_device_set_use_subdomain_fn(Device *p_self,
+    DevicePropertyBase *base, GValue *val,
+    PropertySurety surety, PropertySource source);
+
+static gboolean s3_device_set_host_fn(Device *p_self,
+    DevicePropertyBase *base, GValue *val,
+    PropertySurety surety, PropertySource source);
+
+static gboolean s3_device_set_service_path_fn(Device *p_self,
+    DevicePropertyBase *base, GValue *val,
+    PropertySurety surety, PropertySource source);
+
+static void s3_thread_read_block(gpointer thread_data,
+                                gpointer data);
+static void s3_thread_write_block(gpointer thread_data,
+                                 gpointer data);
+
+/* Wait that all threads are done */
+static void reset_thread(S3Device *self);
+
 /*
  * virtual functions */
 
@@ -368,6 +454,14 @@ s3_device_recycle_file(Device *pself,
 static gboolean
 s3_device_erase(Device *pself);
 
+static gboolean
+check_at_leom(S3Device *self,
+                guint64 size);
+
+static gboolean
+check_at_peom(S3Device *self,
+                guint64 size);
+
 /*
  * Private functions
  */
@@ -420,23 +514,36 @@ write_amanda_header(S3Device *self,
        return FALSE;
     }
 
+    if(check_at_leom(self, header_size))
+        d_self->is_eom = TRUE;
+
+    if(check_at_peom(self, header_size)) {
+        d_self->is_eom = TRUE;
+        device_set_error(d_self,
+            stralloc(_("No space left on device")),
+            DEVICE_STATUS_DEVICE_ERROR);
+        g_free(amanda_header.buffer);
+        return FALSE;
+    }
+
     /* write out the header and flush the uploads. */
     key = special_file_to_key(self, "tapestart", -1);
     g_assert(header_size < G_MAXUINT); /* for cast to guint */
     amanda_header.buffer_len = (guint)header_size;
-    result = s3_upload(self->s3, self->bucket, key, S3_BUFFER_READ_FUNCS,
+    result = s3_upload(self->s3t[0].s3, self->bucket, key, S3_BUFFER_READ_FUNCS,
                        &amanda_header, NULL, NULL);
     g_free(amanda_header.buffer);
     g_free(key);
 
     if (!result) {
        device_set_error(d_self,
-           vstrallocf(_("While writing amanda header: %s"), s3_strerror(self->s3)),
+           vstrallocf(_("While writing amanda header: %s"), s3_strerror(self->s3t[0].s3)),
            DEVICE_STATUS_DEVICE_ERROR | DEVICE_STATUS_VOLUME_ERROR);
        dumpfile_free(dumpinfo);
     } else {
        dumpfile_free(d_self->volume_header);
        d_self->volume_header = dumpinfo;
+        self->volume_bytes += header_size;
     }
 
     return result;
@@ -511,10 +618,10 @@ find_last_file(S3Device *self) {
     Device *d_self = DEVICE(self);
 
     /* list all keys matching C{PREFIX*-*}, stripping the C{-*} */
-    result = s3_list_keys(self->s3, self->bucket, self->prefix, "-", &keys);
+    result = s3_list_keys(self->s3t[0].s3, self->bucket, self->prefix, "-", &keys, NULL);
     if (!result) {
        device_set_error(d_self,
-           vstrallocf(_("While listing S3 keys: %s"), s3_strerror(self->s3)),
+           vstrallocf(_("While listing S3 keys: %s"), s3_strerror(self->s3t[0].s3)),
            DEVICE_STATUS_DEVICE_ERROR | DEVICE_STATUS_VOLUME_ERROR);
         return -1;
     }
@@ -542,10 +649,11 @@ find_next_file(S3Device *self, int last_file) {
     Device *d_self = DEVICE(self);
 
     /* list all keys matching C{PREFIX*-*}, stripping the C{-*} */
-    result = s3_list_keys(self->s3, self->bucket, self->prefix, "-", &keys);
+    result = s3_list_keys(self->s3t[0].s3, self->bucket, self->prefix, "-",
+                         &keys, NULL);
     if (!result) {
        device_set_error(d_self,
-           vstrallocf(_("While listing S3 keys: %s"), s3_strerror(self->s3)),
+           vstrallocf(_("While listing S3 keys: %s"), s3_strerror(self->s3t[0].s3)),
            DEVICE_STATUS_DEVICE_ERROR | DEVICE_STATUS_VOLUME_ERROR);
         return -1;
     }
@@ -576,13 +684,15 @@ delete_file(S3Device *self,
 {
     gboolean result;
     GSList *keys;
+    guint64 total_size = 0;
     char *my_prefix = g_strdup_printf("%sf%08x-", self->prefix, file);
     Device *d_self = DEVICE(self);
 
-    result = s3_list_keys(self->s3, self->bucket, my_prefix, NULL, &keys);
+    result = s3_list_keys(self->s3t[0].s3, self->bucket, my_prefix, NULL, &keys,
+                         &total_size);
     if (!result) {
        device_set_error(d_self,
-           vstrallocf(_("While listing S3 keys: %s"), s3_strerror(self->s3)),
+           vstrallocf(_("While listing S3 keys: %s"), s3_strerror(self->s3t[0].s3)),
            DEVICE_STATUS_DEVICE_ERROR | DEVICE_STATUS_VOLUME_ERROR);
         return FALSE;
     }
@@ -590,15 +700,16 @@ delete_file(S3Device *self,
     /* 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)) {
+        if (!s3_delete(self->s3t[0].s3, self->bucket, keys->data)) {
            device_set_error(d_self,
                vstrallocf(_("While deleting key '%s': %s"),
-                           (char*)keys->data, s3_strerror(self->s3)),
+                           (char*)keys->data, s3_strerror(self->s3t[0].s3)),
                DEVICE_STATUS_DEVICE_ERROR);
             g_slist_free(keys);
             return FALSE;
         }
     }
+    self->volume_bytes = total_size;
 
     return TRUE;
 }
@@ -616,7 +727,7 @@ delete_all_files(S3Device *self)
     if (last_file < 0) {
         guint response_code;
         s3_error_code_t s3_error_code;
-        s3_error(self->s3, NULL, &response_code, &s3_error_code, NULL, NULL, NULL);
+        s3_error(self->s3t[0].s3, NULL, &response_code, &s3_error_code, NULL, NULL, NULL);
 
         /*
          * if the bucket doesn't exist, it doesn't conatin any files,
@@ -658,6 +769,12 @@ s3_device_register(void)
     device_property_fill_and_register(&device_property_s3_access_key,
                                       G_TYPE_STRING, "s3_access_key",
        "Access key ID to authenticate with Amazon S3");
+    device_property_fill_and_register(&device_property_s3_host,
+                                      G_TYPE_STRING, "s3_host",
+       "hostname:port of the server");
+    device_property_fill_and_register(&device_property_s3_service_path,
+                                      G_TYPE_STRING, "s3_service_path",
+       "path to add in the url");
     device_property_fill_and_register(&device_property_s3_user_token,
                                       G_TYPE_STRING, "s3_user_token",
        "User token for authentication Amazon devpay requests");
@@ -673,12 +790,21 @@ s3_device_register(void)
     device_property_fill_and_register(&device_property_s3_ssl,
                                       G_TYPE_BOOLEAN, "s3_ssl",
        "Whether to use SSL with Amazon S3");
+    device_property_fill_and_register(&device_property_s3_subdomain,
+                                      G_TYPE_BOOLEAN, "s3_subdomain",
+       "Whether to use subdomain");
     device_property_fill_and_register(&device_property_max_send_speed,
                                       G_TYPE_UINT64, "max_send_speed",
        "Maximum average upload speed (bytes/sec)");
     device_property_fill_and_register(&device_property_max_recv_speed,
                                       G_TYPE_UINT64, "max_recv_speed",
        "Maximum average download speed (bytes/sec)");
+    device_property_fill_and_register(&device_property_nb_threads_backup,
+                                      G_TYPE_UINT64, "nb_threads_backup",
+       "Number of writer thread");
+    device_property_fill_and_register(&device_property_nb_threads_recovery,
+                                      G_TYPE_UINT64, "nb_threads_recovery",
+       "Number of reader thread");
 
     /* register the device itself */
     register_device(s3_device_factory, device_prefix_list);
@@ -716,6 +842,19 @@ s3_device_init(S3Device * self)
     Device * dself = DEVICE(self);
     GValue response;
 
+    self->volume_bytes = 0;
+    self->volume_limit = 0;
+    self->leom = TRUE;
+    self->enforce_volume_limit = FALSE;
+    self->use_subdomain = FALSE;
+    self->nb_threads = 1;
+    self->nb_threads_backup = 1;
+    self->nb_threads_recovery = 1;
+    self->thread_pool_write = NULL;
+    self->thread_pool_read = NULL;
+    self->thread_idle_cond = NULL;
+    self->thread_idle_mutex = NULL;
+
     /* Register property values
      * Note: Some aren't added until s3_device_open_device()
      */
@@ -757,6 +896,18 @@ s3_device_init(S3Device * self)
            &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED);
     g_value_unset(&response);
 
+    g_value_init(&response, G_TYPE_BOOLEAN);
+    g_value_set_boolean(&response, FALSE);
+    device_set_simple_property(dself, PROPERTY_ENFORCE_MAX_VOLUME_USAGE,
+           &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED);
+    g_value_unset(&response);
+
+    g_value_init(&response, G_TYPE_BOOLEAN);
+    g_value_set_boolean(&response, FALSE);
+    device_set_simple_property(dself, PROPERTY_S3_SUBDOMAIN,
+           &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED);
+    g_value_unset(&response);
+
     g_value_init(&response, G_TYPE_BOOLEAN);
     g_value_set_boolean(&response, FALSE);
     device_set_simple_property(dself, PROPERTY_COMPRESSION,
@@ -807,6 +958,16 @@ s3_device_class_init(S3DeviceClass * c G_GNUC_UNUSED)
            device_simple_property_get_fn,
            s3_device_set_secret_key_fn);
 
+    device_class_register_property(device_class, PROPERTY_S3_HOST,
+           PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START,
+           device_simple_property_get_fn,
+           s3_device_set_host_fn);
+
+    device_class_register_property(device_class, PROPERTY_S3_SERVICE_PATH,
+           PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START,
+           device_simple_property_get_fn,
+           s3_device_set_service_path_fn);
+
     device_class_register_property(device_class, PROPERTY_S3_USER_TOKEN,
            PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START,
            device_simple_property_get_fn,
@@ -847,10 +1008,43 @@ s3_device_class_init(S3DeviceClass * c G_GNUC_UNUSED)
            device_simple_property_get_fn,
            s3_device_set_max_recv_speed_fn);
 
+    device_class_register_property(device_class, PROPERTY_NB_THREADS_BACKUP,
+           PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START,
+           device_simple_property_get_fn,
+           s3_device_set_nb_threads_backup);
+
+    device_class_register_property(device_class, PROPERTY_NB_THREADS_RECOVERY,
+           PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START,
+           device_simple_property_get_fn,
+           s3_device_set_nb_threads_recovery);
+
     device_class_register_property(device_class, PROPERTY_COMPRESSION,
            PROPERTY_ACCESS_GET_MASK,
            device_simple_property_get_fn,
            NULL);
+
+    device_class_register_property(device_class, PROPERTY_LEOM,
+            PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_BEFORE_START,
+            device_simple_property_get_fn,
+            property_set_leom_fn);
+
+    device_class_register_property(device_class, PROPERTY_MAX_VOLUME_USAGE,
+            (PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_MASK) &
+                (~ PROPERTY_ACCESS_SET_INSIDE_FILE_WRITE),
+            device_simple_property_get_fn,
+            s3_device_set_max_volume_usage_fn);
+
+    device_class_register_property(device_class, PROPERTY_ENFORCE_MAX_VOLUME_USAGE,
+            (PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_MASK) &
+                (~ PROPERTY_ACCESS_SET_INSIDE_FILE_WRITE),
+            device_simple_property_get_fn,
+            s3_device_set_enforce_max_volume_usage_fn);
+
+    device_class_register_property(device_class, PROPERTY_S3_SUBDOMAIN,
+            (PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_MASK) &
+                (~ PROPERTY_ACCESS_SET_INSIDE_FILE_WRITE),
+            device_simple_property_get_fn,
+            s3_device_set_use_subdomain_fn);
 }
 
 static gboolean
@@ -879,6 +1073,34 @@ s3_device_set_secret_key_fn(Device *p_self, DevicePropertyBase *base,
     return device_simple_property_set_fn(p_self, base, val, surety, source);
 }
 
+static gboolean
+s3_device_set_host_fn(Device *p_self,
+    DevicePropertyBase *base, GValue *val,
+    PropertySurety surety, PropertySource source)
+{
+    S3Device *self = S3_DEVICE(p_self);
+
+    amfree(self->host);
+    self->host = g_value_dup_string(val);
+    device_clear_volume_details(p_self);
+
+    return device_simple_property_set_fn(p_self, base, val, surety, source);
+}
+
+static gboolean
+s3_device_set_service_path_fn(Device *p_self,
+    DevicePropertyBase *base, GValue *val,
+    PropertySurety surety, PropertySource source)
+{
+    S3Device *self = S3_DEVICE(p_self);
+
+    amfree(self->service_path);
+    self->service_path = g_value_dup_string(val);
+    device_clear_volume_details(p_self);
+
+    return device_simple_property_set_fn(p_self, base, val, surety, source);
+}
+
 static gboolean
 s3_device_set_user_token_fn(Device *p_self, DevicePropertyBase *base,
     GValue *val, PropertySurety surety, PropertySource source)
@@ -958,12 +1180,17 @@ s3_device_set_verbose_fn(Device *p_self, DevicePropertyBase *base,
     GValue *val, PropertySurety surety, PropertySource source)
 {
     S3Device *self = S3_DEVICE(p_self);
+    int       thread;
 
     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);
+    if (self->s3t) {
+       for (thread = 0; thread < self->nb_threads; thread++) {
+           if (self->s3t[thread].s3)
+               s3_verbose(self->s3t[thread].s3, self->verbose);
+       }
+    }
 
     return device_simple_property_set_fn(p_self, base, val, surety, source);
 }
@@ -974,16 +1201,21 @@ s3_device_set_ssl_fn(Device *p_self, DevicePropertyBase *base,
 {
     S3Device *self = S3_DEVICE(p_self);
     gboolean new_val;
+    int      thread;
 
     new_val = g_value_get_boolean(val);
     /* Our S3 handle may not yet have been instantiated; if so, it will
      * get the proper use_ssl setting when it is created */
-    if (self->s3 && !s3_use_ssl(self->s3, new_val)) {
-       device_set_error(p_self, g_strdup_printf(_(
-                "Error setting S3 SSL/TLS use "
-                "(tried to enable SSL/TLS for S3, but curl doesn't support it?)")),
-           DEVICE_STATUS_DEVICE_ERROR);
-        return FALSE;
+    if (self->s3t) {
+       for (thread = 0; thread < self->nb_threads; thread++) {
+           if (self->s3t[thread].s3 && !s3_use_ssl(self->s3t[thread].s3, new_val)) {
+               device_set_error(p_self, g_strdup_printf(_(
+                       "Error setting S3 SSL/TLS use "
+                       "(tried to enable SSL/TLS for S3, but curl doesn't support it?)")),
+                   DEVICE_STATUS_DEVICE_ERROR);
+               return FALSE;
+           }
+       }
     }
     self->use_ssl = new_val;
 
@@ -997,13 +1229,18 @@ s3_device_set_max_send_speed_fn(Device *p_self,
 {
     S3Device *self = S3_DEVICE(p_self);
     guint64 new_val;
+    int     thread;
 
     new_val = g_value_get_uint64(val);
-    if (self->s3 && !s3_set_max_send_speed(self->s3, new_val)) {
-       device_set_error(p_self,
-               g_strdup("Could not set S3 maximum send speed"),
-               DEVICE_STATUS_DEVICE_ERROR);
-        return FALSE;
+    if (self->s3t) {
+       for (thread = 0; thread < self->nb_threads; thread++) {
+           if (self->s3t[thread].s3 && !s3_set_max_send_speed(self->s3t[thread].s3, new_val)) {
+               device_set_error(p_self,
+                       g_strdup("Could not set S3 maximum send speed"),
+                       DEVICE_STATUS_DEVICE_ERROR);
+               return FALSE;
+           }
+       }
     }
     self->max_send_speed = new_val;
 
@@ -1017,19 +1254,108 @@ s3_device_set_max_recv_speed_fn(Device *p_self,
 {
     S3Device *self = S3_DEVICE(p_self);
     guint64 new_val;
+    int     thread;
 
     new_val = g_value_get_uint64(val);
-    if (self->s3 && !s3_set_max_recv_speed(self->s3, new_val)) {
-       device_set_error(p_self,
-               g_strdup("Could not set S3 maximum recv speed"),
-               DEVICE_STATUS_DEVICE_ERROR);
-        return FALSE;
+    if (self->s3t) {
+       for (thread = 0; thread < self->nb_threads; thread++) {
+           if (self->s3t[thread].s3 &&
+               !s3_set_max_recv_speed(self->s3t[thread].s3, new_val)) {
+               device_set_error(p_self,
+                       g_strdup("Could not set S3 maximum recv speed"),
+                       DEVICE_STATUS_DEVICE_ERROR);
+               return FALSE;
+           }
+       }
     }
     self->max_recv_speed = new_val;
 
     return device_simple_property_set_fn(p_self, base, val, surety, source);
 }
 
+static gboolean
+s3_device_set_nb_threads_backup(Device *p_self,
+    DevicePropertyBase *base, GValue *val,
+    PropertySurety surety, PropertySource source)
+{
+    S3Device *self = S3_DEVICE(p_self);
+    guint64 new_val;
+
+    new_val = g_value_get_uint64(val);
+    self->nb_threads_backup = new_val;
+    if (self->nb_threads_backup > self->nb_threads) {
+       self->nb_threads = self->nb_threads_backup;
+    }
+
+    return device_simple_property_set_fn(p_self, base, val, surety, source);
+}
+
+static gboolean
+s3_device_set_nb_threads_recovery(Device *p_self,
+    DevicePropertyBase *base, GValue *val,
+    PropertySurety surety, PropertySource source)
+{
+    S3Device *self = S3_DEVICE(p_self);
+    guint64 new_val;
+
+    new_val = g_value_get_uint64(val);
+    self->nb_threads_recovery = new_val;
+    if (self->nb_threads_recovery > self->nb_threads) {
+       self->nb_threads = self->nb_threads_recovery;
+    }
+
+    return device_simple_property_set_fn(p_self, base, val, surety, source);
+}
+
+static gboolean
+s3_device_set_max_volume_usage_fn(Device *p_self,
+    DevicePropertyBase *base, GValue *val,
+    PropertySurety surety, PropertySource source)
+{
+    S3Device *self = S3_DEVICE(p_self);
+
+    self->volume_limit = g_value_get_uint64(val);
+
+    return device_simple_property_set_fn(p_self, base, val, surety, source);
+
+}
+
+static gboolean
+s3_device_set_enforce_max_volume_usage_fn(Device *p_self,
+    DevicePropertyBase *base, GValue *val,
+    PropertySurety surety, PropertySource source)
+{
+    S3Device *self = S3_DEVICE(p_self);
+
+    self->enforce_volume_limit = g_value_get_boolean(val);
+
+    return device_simple_property_set_fn(p_self, base, val, surety, source);
+
+}
+
+static gboolean
+s3_device_set_use_subdomain_fn(Device *p_self,
+    DevicePropertyBase *base, GValue *val,
+    PropertySurety surety, PropertySource source)
+{
+    S3Device *self = S3_DEVICE(p_self);
+
+    self->use_subdomain = g_value_get_boolean(val);
+
+    return device_simple_property_set_fn(p_self, base, val, surety, source);
+}
+
+static gboolean
+property_set_leom_fn(Device *p_self,
+    DevicePropertyBase *base, GValue *val,
+    PropertySurety surety, PropertySource source)
+{
+    S3Device *self = S3_DEVICE(p_self);
+
+    self->leom = g_value_get_boolean(val);
+
+    return device_simple_property_set_fn(p_self, base, val, surety, source);
+}
 static Device*
 s3_device_factory(char * device_name, char * device_type, char * device_node)
 {
@@ -1099,15 +1425,39 @@ s3_device_open_device(Device *pself, char *device_name,
 
 static void s3_device_finalize(GObject * obj_self) {
     S3Device *self = S3_DEVICE (obj_self);
+    int thread;
 
     if(G_OBJECT_CLASS(parent_class)->finalize)
         (* G_OBJECT_CLASS(parent_class)->finalize)(obj_self);
 
-    if(self->s3) s3_free(self->s3);
+    if (self->thread_pool_write) {
+       g_thread_pool_free(self->thread_pool_write, 1, 1);
+       self->thread_pool_write = NULL;
+    }
+    if (self->thread_pool_read) {
+       g_thread_pool_free(self->thread_pool_read, 1, 1);
+       self->thread_pool_read = NULL;
+    }
+    if (self->thread_idle_mutex) {
+       g_mutex_free(self->thread_idle_mutex);
+       self->thread_idle_mutex = NULL;
+    }
+    if (self->thread_idle_cond) {
+       g_cond_free(self->thread_idle_cond);
+       self->thread_idle_cond = NULL;
+    }
+    if (self->s3t) {
+       for (thread = 0; thread < self->nb_threads; thread++) {
+            if(self->s3t[thread].s3) s3_free(self->s3t[thread].s3);
+       }
+       g_free(self->s3t);
+    }
     if(self->bucket) g_free(self->bucket);
     if(self->prefix) g_free(self->prefix);
     if(self->access_key) g_free(self->access_key);
     if(self->secret_key) g_free(self->secret_key);
+    if(self->host) g_free(self->host);
+    if(self->service_path) g_free(self->service_path);
     if(self->user_token) g_free(self->user_token);
     if(self->bucket_location) g_free(self->bucket_location);
     if(self->storage_class) g_free(self->storage_class);
@@ -1116,8 +1466,16 @@ static void s3_device_finalize(GObject * obj_self) {
 
 static gboolean setup_handle(S3Device * self) {
     Device *d_self = DEVICE(self);
-    if (self->s3 == NULL) {
+    int thread;
 
+    if (self->s3t == NULL) {
+       self->s3t = g_new(S3_by_thread, self->nb_threads);
+       if (self->s3t == NULL) {
+           device_set_error(d_self,
+               stralloc(_("Can't allocate S3Handle array")),
+               DEVICE_STATUS_DEVICE_ERROR);
+            return FALSE;
+       }
         if (self->access_key == NULL || self->access_key[0] == '\0') {
            device_set_error(d_self,
                stralloc(_("No Amazon access key specified")),
@@ -1136,40 +1494,63 @@ static gboolean setup_handle(S3Device * self) {
            amfree(self->ca_info);
        }
 
-        self->s3 = s3_open(self->access_key, self->secret_key, self->user_token,
-            self->bucket_location, self->storage_class, self->ca_info);
-        if (self->s3 == NULL) {
-           device_set_error(d_self,
-               stralloc(_("Internal error creating S3 handle")),
-               DEVICE_STATUS_DEVICE_ERROR);
-            return FALSE;
+       for (thread = 0; thread < self->nb_threads; thread++) {
+           self->s3t[thread].idle = 1;
+           self->s3t[thread].done = 1;
+           self->s3t[thread].eof = FALSE;
+           self->s3t[thread].errflags = DEVICE_STATUS_SUCCESS;
+           self->s3t[thread].errmsg = NULL;
+           self->s3t[thread].filename = NULL;
+           self->s3t[thread].curl_buffer.buffer = NULL;
+           self->s3t[thread].curl_buffer.buffer_len = 0;
+            self->s3t[thread].s3 = s3_open(self->access_key, self->secret_key,
+                                          self->host, self->service_path,
+                                          self->use_subdomain,
+                                          self->user_token, self->bucket_location,
+                                          self->storage_class, self->ca_info);
+            if (self->s3t[thread].s3 == NULL) {
+               device_set_error(d_self,
+                   stralloc(_("Internal error creating S3 handle")),
+                   DEVICE_STATUS_DEVICE_ERROR);
+                return FALSE;
+            }
         }
+
+       g_debug("Create %d threads", self->nb_threads);
+       self->thread_pool_write = g_thread_pool_new(s3_thread_write_block, self,
+                                             self->nb_threads, 0, NULL);
+       self->thread_pool_read = g_thread_pool_new(s3_thread_read_block, self,
+                                             self->nb_threads, 0, NULL);
+       self->thread_idle_cond = g_cond_new();
+       self->thread_idle_mutex = g_mutex_new();
     }
 
-    s3_verbose(self->s3, self->verbose);
+    for (thread = 0; thread < self->nb_threads; thread++) {
+       s3_verbose(self->s3t[thread].s3, self->verbose);
 
-    if (!s3_use_ssl(self->s3, self->use_ssl)) {
-       device_set_error(d_self, g_strdup_printf(_(
+       if (!s3_use_ssl(self->s3t[thread].s3, self->use_ssl)) {
+           device_set_error(d_self, g_strdup_printf(_(
                 "Error setting S3 SSL/TLS use "
                 "(tried to enable SSL/TLS for S3, but curl doesn't support it?)")),
-           DEVICE_STATUS_DEVICE_ERROR);
-        return FALSE;
-    }
+               DEVICE_STATUS_DEVICE_ERROR);
+            return FALSE;
+       }
 
-    if (self->max_send_speed &&
-           !s3_set_max_send_speed(self->s3, self->max_send_speed)) {
-       device_set_error(d_self,
+       if (self->max_send_speed &&
+           !s3_set_max_send_speed(self->s3t[thread].s3, self->max_send_speed)) {
+           device_set_error(d_self,
                g_strdup("Could not set S3 maximum send speed"),
                DEVICE_STATUS_DEVICE_ERROR);
-        return FALSE;
-    }
+            return FALSE;
+       }
 
-    if (self->max_recv_speed &&
-           !s3_set_max_recv_speed(self->s3, self->max_recv_speed)) {
-       device_set_error(d_self,
+       if (self->max_recv_speed &&
+           !s3_set_max_recv_speed(self->s3t[thread].s3, self->max_recv_speed)) {
+           device_set_error(d_self,
                g_strdup("Could not set S3 maximum recv speed"),
                DEVICE_STATUS_DEVICE_ERROR);
-        return FALSE;
+            return FALSE;
+       }
     }
 
     return TRUE;
@@ -1181,7 +1562,6 @@ s3_device_read_label(Device *pself) {
     char *key;
     CurlBuffer buf = {NULL, 0, 0, S3_DEVICE_MAX_BLOCK_SIZE};
     dumpfile_t *amanda_header;
-
     /* note that this may be called from s3_device_start, when
      * self->access_mode is not ACCESS_NULL */
 
@@ -1196,16 +1576,19 @@ s3_device_read_label(Device *pself) {
         /* setup_handle already set our error message */
        return pself->status;
     }
+    reset_thread(self);
 
     key = special_file_to_key(self, "tapestart", -1);
-    if (!s3_read(self->s3, self->bucket, key, S3_BUFFER_WRITE_FUNCS, &buf, NULL, NULL)) {
+    if (!s3_read(self->s3t[0].s3, self->bucket, key, S3_BUFFER_WRITE_FUNCS, &buf, NULL, NULL)) {
         guint response_code;
         s3_error_code_t s3_error_code;
-        s3_error(self->s3, NULL, &response_code, &s3_error_code, NULL, NULL, NULL);
+        s3_error(self->s3t[0].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)) {
+             (s3_error_code == S3_ERROR_NoSuchKey ||
+             s3_error_code == S3_ERROR_NoSuchEntity ||
+             s3_error_code == S3_ERROR_NoSuchBucket)) {
             g_debug(_("Amanda header not found while reading tapestart header (this is expected for empty tapes)"));
            device_set_error(pself,
                stralloc(_("Amanda header not found -- unlabeled volume?")),
@@ -1217,7 +1600,7 @@ s3_device_read_label(Device *pself) {
 
         /* otherwise, log it and return */
        device_set_error(pself,
-           vstrallocf(_("While trying to read tapestart header: %s"), s3_strerror(self->s3)),
+           vstrallocf(_("While trying to read tapestart header: %s"), s3_strerror(self->s3t[0].s3)),
            DEVICE_STATUS_DEVICE_ERROR | DEVICE_STATUS_VOLUME_ERROR);
         return pself->status;
     }
@@ -1252,6 +1635,9 @@ static gboolean
 s3_device_start (Device * pself, DeviceAccessMode mode,
                  char * label, char * timestamp) {
     S3Device * self;
+    GSList *keys;
+    guint64 total_size = 0;
+    gboolean result;
 
     self = S3_DEVICE(pself);
 
@@ -1262,21 +1648,23 @@ s3_device_start (Device * pself, DeviceAccessMode mode,
        return FALSE;
     }
 
+    reset_thread(self);
     pself->access_mode = mode;
     pself->in_file = FALSE;
 
     /* try creating the bucket, in case it doesn't exist */
-    if (mode != ACCESS_READ && !s3_make_bucket(self->s3, self->bucket)) {
+    if (mode != ACCESS_READ && !s3_make_bucket(self->s3t[0].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);
+        s3_error(self->s3t[0].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) {
+            (s3_error_code != S3_ERROR_BucketAlreadyExists &&
+            s3_error_code != S3_ERROR_BucketAlreadyOwnedByYou)) {
            device_set_error(pself,
-               vstrallocf(_("While creating new S3 bucket: %s"), s3_strerror(self->s3)),
+               vstrallocf(_("While creating new S3 bucket: %s"), s3_strerror(self->s3t[0].s3)),
                DEVICE_STATUS_DEVICE_ERROR);
             return FALSE;
         }
@@ -1310,7 +1698,17 @@ s3_device_start (Device * pself, DeviceAccessMode mode,
            if (pself->volume_label == NULL && s3_device_read_label(pself) != DEVICE_STATUS_SUCCESS) {
                /* s3_device_read_label already set our error message */
                return FALSE;
-           }
+           } else {
+                result = s3_list_keys(self->s3t[0].s3, self->bucket, NULL, NULL, &keys, &total_size);
+                if(!result) {
+                    device_set_error(pself,
+                                 vstrallocf(_("While listing S3 keys: %s"), s3_strerror(self->s3t[0].s3)),
+                                 DEVICE_STATUS_DEVICE_ERROR|DEVICE_STATUS_VOLUME_ERROR);
+                    return FALSE;
+                } else {
+                    self->volume_bytes = total_size;
+                }
+            }
             return seek_to_end(self);
             break;
 
@@ -1322,7 +1720,13 @@ s3_device_start (Device * pself, DeviceAccessMode mode,
 }
 
 static gboolean
-s3_device_finish (Device * pself) {
+s3_device_finish (
+    Device * pself)
+{
+    S3Device *self = S3_DEVICE(pself);
+
+    reset_thread(self);
+
     /* we're not in a file anymore */
     pself->access_mode = ACCESS_NULL;
 
@@ -1340,10 +1744,12 @@ s3_device_start_file (Device *pself, dumpfile_t *jobInfo) {
     CurlBuffer amanda_header = {NULL, 0, 0, 0};
     gboolean result;
     size_t header_size;
-    char *key;
+    char  *key;
+    int    thread;
 
     if (device_in_error(self)) return FALSE;
 
+    reset_thread(self);
     pself->is_eom = FALSE;
 
     /* Set the blocksize to zero, since there's no header to skip (it's stored
@@ -1362,57 +1768,174 @@ s3_device_start_file (Device *pself, dumpfile_t *jobInfo) {
     }
     amanda_header.buffer_len = header_size;
 
+    if(check_at_leom(self, header_size))
+        pself->is_eom = TRUE;
+
+    if(check_at_peom(self, header_size)) {
+        pself->is_eom = TRUE;
+        device_set_error(pself,
+            stralloc(_("No space left on device")),
+            DEVICE_STATUS_DEVICE_ERROR);
+        g_free(amanda_header.buffer);
+        return 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, S3_BUFFER_READ_FUNCS,
+    result = s3_upload(self->s3t[0].s3, self->bucket, key, S3_BUFFER_READ_FUNCS,
                        &amanda_header, NULL, NULL);
     g_free(amanda_header.buffer);
     g_free(key);
     if (!result) {
        device_set_error(pself,
-           vstrallocf(_("While writing filestart header: %s"), s3_strerror(self->s3)),
+           vstrallocf(_("While writing filestart header: %s"), s3_strerror(self->s3t[0].s3)),
            DEVICE_STATUS_DEVICE_ERROR | DEVICE_STATUS_VOLUME_ERROR);
         return FALSE;
     }
 
+    self->volume_bytes += header_size;
+    for (thread = 0; thread < self->nb_threads; thread++)  {
+       self->s3t[thread].idle = 1;
+    }
+
     return TRUE;
 }
 
 static gboolean
 s3_device_write_block (Device * pself, guint size, gpointer data) {
-    gboolean result;
     char *filename;
     S3Device * self = S3_DEVICE(pself);
-    CurlBuffer to_write = {data, size, 0, 0};
+    int idle_thread = 0;
+    int thread = -1;
+    int first_idle = -1;
 
     g_assert (self != NULL);
     g_assert (data != NULL);
     if (device_in_error(self)) return FALSE;
 
-    filename = file_and_block_to_key(self, pself->file, pself->block);
+    if(check_at_leom(self, size))
+        pself->is_eom = TRUE;
 
-    result = s3_upload(self->s3, self->bucket, filename, S3_BUFFER_READ_FUNCS,
-        &to_write, NULL, NULL);
-    g_free(filename);
-    if (!result) {
-       device_set_error(pself,
-           vstrallocf(_("While writing data block to S3: %s"), s3_strerror(self->s3)),
-           DEVICE_STATUS_DEVICE_ERROR | DEVICE_STATUS_VOLUME_ERROR);
+    if(check_at_peom(self, size)) {
+        pself->is_eom = TRUE;
+        device_set_error(pself,
+            stralloc(_("No space left on device")),
+            DEVICE_STATUS_DEVICE_ERROR);
         return FALSE;
     }
 
-    pself->block++;
+    filename = file_and_block_to_key(self, pself->file, pself->block);
+
+    g_mutex_lock(self->thread_idle_mutex);
+    while (!idle_thread) {
+       idle_thread = 0;
+       for (thread = 0; thread < self->nb_threads_backup; thread++)  {
+           if (self->s3t[thread].idle == 1) {
+               idle_thread++;
+               if (first_idle == -1)
+                   first_idle = thread;
+               /* Check if the thread is in error */
+               if (self->s3t[thread].errflags != DEVICE_STATUS_SUCCESS) {
+                   device_set_error(pself, (char *)self->s3t[thread].errmsg,
+                                    self->s3t[thread].errflags);
+                   self->s3t[thread].errflags = DEVICE_STATUS_SUCCESS;
+                   self->s3t[thread].errmsg = NULL;
+                   g_mutex_unlock(self->thread_idle_mutex);
+                   return FALSE;
+               }
+           }
+       }
+       if (!idle_thread) {
+           g_cond_wait(self->thread_idle_cond, self->thread_idle_mutex);
+       }
+    }
+    thread = first_idle;
+
+    self->s3t[thread].idle = 0;
+    self->s3t[thread].done = 0;
+    if (self->s3t[thread].curl_buffer.buffer &&
+       self->s3t[thread].curl_buffer.buffer_len < size) {
+       g_free((char *)self->s3t[thread].curl_buffer.buffer);
+       self->s3t[thread].curl_buffer.buffer = NULL;
+       self->s3t[thread].curl_buffer.buffer_len = 0;
+       self->s3t[thread].buffer_len = 0;
+    }
+    if (self->s3t[thread].curl_buffer.buffer == NULL) {
+       self->s3t[thread].curl_buffer.buffer = g_malloc(size);
+       self->s3t[thread].curl_buffer.buffer_len = size;
+       self->s3t[thread].buffer_len = size;
+    }
+    memcpy((char *)self->s3t[thread].curl_buffer.buffer, data, size);
+    self->s3t[thread].curl_buffer.buffer_pos = 0;
+    self->s3t[thread].curl_buffer.buffer_len = size;
+    self->s3t[thread].curl_buffer.max_buffer_size = 0;
+    self->s3t[thread].filename = filename;
+    g_thread_pool_push(self->thread_pool_write, &self->s3t[thread], NULL);
+    g_mutex_unlock(self->thread_idle_mutex);
 
+    pself->block++;
+    self->volume_bytes += size;
     return TRUE;
 }
 
+static void
+s3_thread_write_block(
+    gpointer thread_data,
+    gpointer data)
+{
+    S3_by_thread *s3t = (S3_by_thread *)thread_data;
+    Device *pself = (Device *)data;
+    S3Device *self = S3_DEVICE(pself);
+    gboolean result;
+
+    result = s3_upload(s3t->s3, self->bucket, (char *)s3t->filename,
+                      S3_BUFFER_READ_FUNCS, (CurlBuffer *)&s3t->curl_buffer, NULL, NULL);
+    g_free((void *)s3t->filename);
+    s3t->filename = NULL;
+    if (!result) {
+       s3t->errflags = DEVICE_STATUS_DEVICE_ERROR | DEVICE_STATUS_VOLUME_ERROR;
+       s3t->errmsg = g_strdup_printf(_("While writing data block to S3: %s"), s3_strerror(s3t->s3));
+    }
+    g_mutex_lock(self->thread_idle_mutex);
+    s3t->idle = 1;
+    s3t->done = 1;
+    s3t->curl_buffer.buffer_len = s3t->buffer_len;
+    g_cond_broadcast(self->thread_idle_cond);
+    g_mutex_unlock(self->thread_idle_mutex);
+}
+
 static gboolean
 s3_device_finish_file (Device * pself) {
+    S3Device *self = S3_DEVICE(pself);
+
+    /* Check all threads are done */
+    int idle_thread = 0;
+    int thread;
+
+    g_mutex_lock(self->thread_idle_mutex);
+    while (idle_thread != self->nb_threads) {
+       idle_thread = 0;
+       for (thread = 0; thread < self->nb_threads; thread++)  {
+           if (self->s3t[thread].idle == 1) {
+               idle_thread++;
+           }
+           /* check thread status */
+           if (self->s3t[thread].errflags != DEVICE_STATUS_SUCCESS) {
+               device_set_error(pself, (char *)self->s3t[thread].errmsg,
+                                self->s3t[thread].errflags);
+               self->s3t[thread].errflags = DEVICE_STATUS_SUCCESS;
+               self->s3t[thread].errmsg = NULL;
+           }
+       }
+       if (idle_thread != self->nb_threads) {
+           g_cond_wait(self->thread_idle_cond, self->thread_idle_mutex);
+       }
+    }
+    g_mutex_unlock(self->thread_idle_mutex);
+
     if (device_in_error(pself)) return FALSE;
 
     /* we're not in a file anymore */
@@ -1426,6 +1949,7 @@ s3_device_recycle_file(Device *pself, guint file) {
     S3Device *self = S3_DEVICE(pself);
     if (device_in_error(self)) return FALSE;
 
+    reset_thread(self);
     return delete_file(self, file);
     /* delete_file already set our error message if necessary */
 }
@@ -1443,9 +1967,10 @@ s3_device_erase(Device *pself) {
         return FALSE;
     }
 
+    reset_thread(self);
     key = special_file_to_key(self, "tapestart", -1);
-    if (!s3_delete(self->s3, self->bucket, key)) {
-        s3_error(self->s3, &errmsg, NULL, NULL, NULL, NULL, NULL);
+    if (!s3_delete(self->s3t[0].s3, self->bucket, key)) {
+        s3_error(self->s3t[0].s3, &errmsg, NULL, NULL, NULL, NULL, NULL);
        device_set_error(pself,
            stralloc(errmsg),
            DEVICE_STATUS_DEVICE_ERROR);
@@ -1456,8 +1981,8 @@ s3_device_erase(Device *pself) {
     if (!delete_all_files(self))
         return FALSE;
 
-    if (!s3_delete_bucket(self->s3, self->bucket)) {
-        s3_error(self->s3, NULL, &response_code, &s3_error_code, NULL, NULL, NULL);
+    if (!s3_delete_bucket(self->s3t[0].s3, self->bucket)) {
+        s3_error(self->s3t[0].s3, NULL, &response_code, &s3_error_code, NULL, NULL, NULL);
 
         /*
          * ignore the error if the bucket isn't empty (there may be data from elsewhere)
@@ -1473,6 +1998,7 @@ s3_device_erase(Device *pself) {
             return FALSE;
         }
     }
+    self->volume_bytes = 0;
     return TRUE;
 }
 
@@ -1486,27 +2012,33 @@ s3_device_seek_file(Device *pself, guint file) {
     CurlBuffer buf = {NULL, 0, 0, S3_DEVICE_MAX_BLOCK_SIZE};
     dumpfile_t *amanda_header;
     const char *errmsg = NULL;
+    int thread;
 
     if (device_in_error(self)) return NULL;
 
+    reset_thread(self);
+
     pself->file = file;
     pself->is_eof = FALSE;
     pself->in_file = FALSE;
     pself->block = 0;
+    self->next_block_to_read = 0;
 
     /* read it in */
     key = special_file_to_key(self, "filestart", pself->file);
-    result = s3_read(self->s3, self->bucket, key, S3_BUFFER_WRITE_FUNCS,
+    result = s3_read(self->s3t[0].s3, self->bucket, key, S3_BUFFER_WRITE_FUNCS,
         &buf, NULL, NULL);
     g_free(key);
 
     if (!result) {
         guint response_code;
         s3_error_code_t s3_error_code;
-        s3_error(self->s3, &errmsg, &response_code, &s3_error_code, NULL, NULL, NULL);
+        s3_error(self->s3t[0].s3, &errmsg, &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) {
+        if (response_code == 404 &&
+           (s3_error_code == S3_ERROR_NoSuchKey ||
+            s3_error_code == S3_ERROR_NoSuchEntity)) {
             int next_file;
             next_file = find_next_file(self, pself->file);
             if (next_file > 0) {
@@ -1515,7 +2047,7 @@ s3_device_seek_file(Device *pself, guint 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,
+                result = s3_read(self->s3t[0].s3, self->bucket, key,
                     S3_BUFFER_WRITE_FUNCS, &buf, NULL, NULL);
                 g_free(key);
                 if (result) {
@@ -1559,155 +2091,229 @@ s3_device_seek_file(Device *pself, guint file) {
     }
 
     pself->in_file = TRUE;
+    for (thread = 0; thread < self->nb_threads; thread++)  {
+       self->s3t[thread].idle = 1;
+       self->s3t[thread].eof = FALSE;
+    }
     return amanda_header;
 }
 
 static gboolean
 s3_device_seek_block(Device *pself, guint64 block) {
+    S3Device * self = S3_DEVICE(pself);
     if (device_in_error(pself)) return FALSE;
 
+    reset_thread(self);
     pself->block = block;
+    self->next_block_to_read = block;
     return TRUE;
 }
 
-typedef struct s3_read_block_data {
-    gpointer data;
-    int size_req;
-    int size_written;
-
-    CurlBuffer curl;
-} s3_read_block_data;
-
-/* wrapper around s3_buffer_write_func to write as much data as possible to
- * the user's buffer, and switch to a dynamically allocated buffer if that
- * isn't large enough */
-static size_t
-s3_read_block_write_func(void *ptr, size_t size, size_t nmemb, void *stream)
-{
-    s3_read_block_data *dat = stream;
-    guint new_bytes, bytes_needed;
-
-    /* if data is NULL, call through to s3_buffer_write_func */
-    if (!dat->data) {
-       return s3_buffer_write_func(ptr, size, nmemb, (void *)(&dat->curl));
-    }
-
-    new_bytes = (guint) size * nmemb;
-    bytes_needed = dat->size_written + new_bytes;
-
-    if (bytes_needed > (guint)dat->size_req) {
-       /* this read will overflow the user's buffer, so malloc ourselves
-        * a new buffer and keep reading */
-       dat->curl.buffer = g_malloc(bytes_needed);
-       dat->curl.buffer_len = bytes_needed;
-       dat->curl.buffer_pos = dat->size_written;
-       memcpy(dat->curl.buffer, dat->data, dat->size_written);
-       dat->data = NULL; /* signal that the user's buffer is too small */
-       return s3_buffer_write_func(ptr, size, nmemb, (void *)(&dat->curl));
-    }
-
-    /* copy it into the dat->data buffer, and increment the size */
-    memcpy(dat->data + dat->size_written, ptr, new_bytes);
-    dat->size_written += new_bytes;
-
-    return new_bytes;
-}
-
 static int
 s3_device_read_block (Device * pself, gpointer data, int *size_req) {
     S3Device * self = S3_DEVICE(pself);
     char *key;
-    s3_read_block_data dat = {NULL, 0, 0, { NULL, 0, 0, S3_DEVICE_MAX_BLOCK_SIZE} };
-    gboolean result;
+    int thread;
+    int done = 0;
 
     g_assert (self != NULL);
     if (device_in_error(self)) return -1;
 
+    g_mutex_lock(self->thread_idle_mutex);
+    /* start a read ahead for each thread */
+    for (thread = 0; thread < self->nb_threads_recovery; thread++) {
+       S3_by_thread *s3t = &self->s3t[thread];
+       if (s3t->idle) {
+           key = file_and_block_to_key(self, pself->file, self->next_block_to_read);
+           s3t->filename = key;
+           s3t->done = 0;
+           s3t->idle = 0;
+           s3t->eof = FALSE;
+           s3t->errflags = DEVICE_STATUS_SUCCESS;
+           if (self->s3t[thread].curl_buffer.buffer &&
+               (int)self->s3t[thread].curl_buffer.buffer_len < *size_req) {
+               g_free(self->s3t[thread].curl_buffer.buffer);
+               self->s3t[thread].curl_buffer.buffer = NULL;
+               self->s3t[thread].curl_buffer.buffer_len = 0;
+               self->s3t[thread].buffer_len = 0;
+           }
+           if (!self->s3t[thread].curl_buffer.buffer) {
+               self->s3t[thread].curl_buffer.buffer = g_malloc(*size_req);
+               self->s3t[thread].curl_buffer.buffer_len = *size_req;
+               self->s3t[thread].buffer_len = *size_req;
+           }
+           s3t->curl_buffer.buffer_pos = 0;
+           s3t->curl_buffer.max_buffer_size = S3_DEVICE_MAX_BLOCK_SIZE;
+           self->next_block_to_read++;
+           g_thread_pool_push(self->thread_pool_read, s3t, 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))) {
-       if (*size_req >= self->cached_size) {
-           /* use the cached copy and clear the cache */
-           memcpy(data, self->cached_buf, self->cached_size);
-           *size_req = self->cached_size;
-
-           g_free(key);
-           g_free(self->cached_key);
-           self->cached_key = NULL;
-           g_free(self->cached_buf);
-           self->cached_buf = NULL;
-
-           pself->block++;
-           return *size_req;
-       } else {
-           *size_req = self->cached_size;
-           g_free(key);
-           return 0;
+    while (!done) {
+       /* find which thread read the key */
+       for (thread = 0; thread < self->nb_threads_recovery; thread++) {
+           S3_by_thread *s3t;
+           s3t = &self->s3t[thread];
+           if (!s3t->idle &&
+               s3t->done &&
+               strcmp(key, (char *)s3t->filename) == 0) {
+               if (s3t->eof) {
+                   /* return eof */
+                   g_free(key);
+                   pself->is_eof = TRUE;
+                   pself->in_file = FALSE;
+                   device_set_error(pself, stralloc(_("EOF")),
+                                    DEVICE_STATUS_SUCCESS);
+                   g_mutex_unlock(self->thread_idle_mutex);
+                   return -1;
+               } else if (s3t->errflags != DEVICE_STATUS_SUCCESS) {
+                   /* return the error */
+                   device_set_error(pself, (char *)s3t->errmsg, s3t->errflags);
+                   g_free(key);
+                   g_mutex_unlock(self->thread_idle_mutex);
+                   return -1;
+
+               } else if ((guint)*size_req >= s3t->curl_buffer.buffer_pos) {
+                   /* return the buffer */
+                   g_mutex_unlock(self->thread_idle_mutex);
+                   memcpy(data, s3t->curl_buffer.buffer,
+                                s3t->curl_buffer.buffer_pos);
+                   *size_req = s3t->curl_buffer.buffer_pos;
+                   g_free(key);
+                   s3t->idle = 1;
+                   g_free((char *)s3t->filename);
+                   pself->block++;
+                   done = 1;
+                   g_mutex_lock(self->thread_idle_mutex);
+                   break;
+               } else { /* buffer not enough large */
+                   *size_req = s3t->curl_buffer.buffer_len;
+                   g_free(key);
+                   g_mutex_unlock(self->thread_idle_mutex);
+                   return 0;
+               }
+           }
+       }
+       if (!done) {
+           g_cond_wait(self->thread_idle_cond, self->thread_idle_mutex);
        }
     }
 
-    /* clear the cache, as it's useless to us */
-    if (self->cached_key) {
-       g_free(self->cached_key);
-       self->cached_key = NULL;
-
-       g_free(self->cached_buf);
-       self->cached_buf = NULL;
+    /* start a read ahead for the thread */
+    for (thread = 0; thread < self->nb_threads_recovery; thread++) {
+       S3_by_thread *s3t = &self->s3t[thread];
+       if (s3t->idle) {
+           key = file_and_block_to_key(self, pself->file, self->next_block_to_read);
+           s3t->filename = key;
+           s3t->done = 0;
+           s3t->idle = 0;
+           s3t->eof = FALSE;
+           s3t->errflags = DEVICE_STATUS_SUCCESS;
+           if (!self->s3t[thread].curl_buffer.buffer) {
+               self->s3t[thread].curl_buffer.buffer = g_malloc(*size_req);
+               self->s3t[thread].curl_buffer.buffer_len = *size_req;
+           }
+           s3t->curl_buffer.buffer_pos = 0;
+           self->next_block_to_read++;
+           g_thread_pool_push(self->thread_pool_read, s3t, NULL);
+       }
     }
+    g_mutex_unlock(self->thread_idle_mutex);
 
-    /* set up dat for the write_func callback */
-    if (!data || *size_req <= 0) {
-       dat.data = NULL;
-       dat.size_req = 0;
-    } else {
-       dat.data = data;
-       dat.size_req = *size_req;
-    }
+    return *size_req;
+
+}
+
+static void
+s3_thread_read_block(
+    gpointer thread_data,
+    gpointer data)
+{
+    S3_by_thread *s3t = (S3_by_thread *)thread_data;
+    Device *pself = (Device *)data;
+    S3Device *self = S3_DEVICE(pself);
+    gboolean result;
+
+    result = s3_read(s3t->s3, self->bucket, (char *)s3t->filename, s3_buffer_write_func,
+        s3_buffer_reset_func, (CurlBuffer *)&s3t->curl_buffer, NULL, NULL);
 
-    result = s3_read(self->s3, self->bucket, key, s3_read_block_write_func,
-        s3_buffer_reset_func, &dat, NULL, NULL);
+    g_mutex_lock(self->thread_idle_mutex);
     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;
+       s3_error(s3t->s3, NULL, &response_code, &s3_error_code, NULL, NULL, 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;
-           pself->in_file = FALSE;
-           device_set_error(pself,
-               stralloc(_("EOF")),
-               DEVICE_STATUS_SUCCESS);
-           return -1;
+       if (response_code == 404 &&
+           (s3_error_code == S3_ERROR_NoSuchKey ||
+            s3_error_code == S3_ERROR_NoSuchEntity)) {
+           s3t->eof = TRUE;
+       } else {
+
+           /* otherwise, log it and return FALSE */
+           s3t->errflags = DEVICE_STATUS_VOLUME_ERROR;
+           s3t->errmsg = g_strdup_printf(_("While reading data block from S3: %s"),
+                                         s3_strerror(s3t->s3));
        }
+    }
+    s3t->done = 1;
+    g_cond_broadcast(self->thread_idle_cond);
+    g_mutex_unlock(self->thread_idle_mutex);
 
-       /* otherwise, log it and return FALSE */
-       device_set_error(pself,
-           vstrallocf(_("While reading data block from S3: %s"), s3_strerror(self->s3)),
-           DEVICE_STATUS_VOLUME_ERROR);
-       return -1;
+    return;
+}
+
+static gboolean
+check_at_peom(S3Device *self, guint64 size)
+{
+    if(self->enforce_volume_limit && (self->volume_limit > 0)) {
+        guint64 newtotal = self->volume_bytes + size;
+        if(newtotal > self->volume_limit) {
+            return TRUE;
+        }
     }
+    return FALSE;
+}
 
-    if (dat.data == NULL) {
-       /* data was larger than the available space, so cache it and return
-        * the actual size */
-        self->cached_buf = dat.curl.buffer;
-        self->cached_size = dat.curl.buffer_pos;
-        self->cached_key = key;
-       key = NULL;
+static gboolean
+check_at_leom(S3Device *self, guint64 size)
+{
+    guint64 block_size = DEVICE(self)->block_size;
+    guint64 eom_warning_buffer = block_size *
+               (EOM_EARLY_WARNING_ZONE_BLOCKS + self->nb_threads);
 
-        *size_req = dat.curl.buffer_pos;
-        return 0;
+    if(!self->leom)
+        return FALSE;
+
+    if(self->enforce_volume_limit && (self->volume_limit > 0)) {
+        guint64 newtotal = self->volume_bytes + size + eom_warning_buffer;
+        if(newtotal > self->volume_limit) {
+           return TRUE;
+        }
     }
+    return FALSE;
+}
 
-    /* ok, the read went directly to the user's buffer, so we need only
-     * set and return the size */
-    pself->block++;
-    g_free(key);
-    *size_req = dat.size_written;
-    return dat.size_written;
+static void
+reset_thread(
+    S3Device *self)
+{
+    int thread;
+    int nb_done = 0;
+
+    g_mutex_lock(self->thread_idle_mutex);
+    while(nb_done != self->nb_threads) {
+       nb_done = 0;
+       for (thread = 0; thread < self->nb_threads; thread++)  {
+           if (self->s3t[thread].done == 1)
+               nb_done++;
+       }
+       if (nb_done != self->nb_threads) {
+           g_cond_wait(self->thread_idle_cond, self->thread_idle_mutex);
+       }
+    }
+    g_mutex_unlock(self->thread_idle_mutex);
 }
index 584a47d54ad1feacf0a8eae1e13549c104266dad..cd234c335671a0ce8ec0a8204de537443ab4c0c2 100644 (file)
@@ -138,7 +138,9 @@ struct S3Handle {
     /* attributes for new objects */
     char *bucket_location;
     char *storage_class;
-
+    char *host;
+    char *service_path;
+    gboolean use_subdomain;
     char *ca_info;
 
     CURL *curl;
@@ -284,13 +286,23 @@ static gboolean is_non_empty_string(const char *str);
  *
  * @param hdl: the S3Handle object
  * @param verb: capitalized verb for this request ('PUT', 'GET', etc.)
+ * @param host: the host name to connect to, 's3.amazonaws.com'
+ * @param service_path: A path to add in the URL, or NULL for none.
  * @param bucket: the bucket being accessed, or NULL for none
  * @param key: the key being accessed, or NULL for none
  * @param subresource: the sub-resource being accessed (e.g. "acl"), or NULL for none
- * @param use_subdomain: if TRUE, a subdomain of s3.amazonaws.com will be used
+ * @param use_subdomain: if TRUE, a subdomain of 'host' will be used
+ * @param use_ssl: if TRUE, use 'https'
+ *
+ * !use_subdomain: http://host/service_path/bucket/key
+ * use_subdomain : http://bucket.host/service_path/key
+ *
  */
 static char *
-build_url(const char *bucket,
+build_url(
+      const char *host,
+      const char *service_path,
+      const char *bucket,
       const char *key,
       const char *subresource,
       const char *query,
@@ -312,7 +324,6 @@ build_url(const char *bucket,
  * @param key: the key being accessed, or NULL for none
  * @param subresource: the sub-resource being accessed (e.g. "acl"), or NULL for none
  * @param md5_hash: the MD5 hash of the request body, or NULL for none
- * @param use_subdomain: if TRUE, a subdomain of s3.amazonaws.com will be used
  */
 static struct curl_slist *
 authenticate_request(S3Handle *hdl,
@@ -320,8 +331,7 @@ authenticate_request(S3Handle *hdl,
                      const char *bucket,
                      const char *key,
                      const char *subresource,
-                     const char *md5_hash,
-                     gboolean use_subdomain);
+                     const char *md5_hash);
 
 
 
@@ -513,7 +523,10 @@ is_non_empty_string(const char *str)
 }
 
 static char *
-build_url(const char *bucket,
+build_url(
+      const char *host,
+      const char *service_path,
+      const char *bucket,
       const char *key,
       const char *subresource,
       const char *query,
@@ -532,14 +545,20 @@ build_url(const char *bucket,
 
     /* domain */
     if (use_subdomain && bucket)
-        g_string_append_printf(url, "%s.s3.amazonaws.com/", bucket);
+        g_string_append_printf(url, "%s.%s", bucket, host);
     else
-        g_string_append(url, "s3.amazonaws.com/");
+        g_string_append_printf(url, "%s", host);
+
+    if (service_path) {
+        g_string_append_printf(url, "%s/", service_path);
+    } else {
+       g_string_append(url, "/");
+    }
 
     /* path */
     if (!use_subdomain && bucket) {
         esc_bucket = curl_escape(bucket, 0);
-    if (!esc_bucket) goto cleanup;
+        if (!esc_bucket) goto cleanup;
         g_string_append_printf(url, "%s", esc_bucket);
         if (key)
             g_string_append(url, "/");
@@ -547,7 +566,7 @@ build_url(const char *bucket,
 
     if (key) {
         esc_key = curl_escape(key, 0);
-    if (!esc_key) goto cleanup;
+        if (!esc_key) goto cleanup;
         g_string_append_printf(url, "%s", esc_key);
     }
 
@@ -577,8 +596,7 @@ authenticate_request(S3Handle *hdl,
                      const char *bucket,
                      const char *key,
                      const char *subresource,
-                     const char *md5_hash,
-                     gboolean use_subdomain)
+                     const char *md5_hash)
 {
     time_t t;
     struct tm tmp;
@@ -653,9 +671,12 @@ authenticate_request(S3Handle *hdl,
     }
 
     /* CanonicalizedResource */
+    if (hdl->service_path) {
+       g_string_append(auth_string, hdl->service_path);
+    }
     g_string_append(auth_string, "/");
     if (bucket) {
-        if (use_subdomain)
+        if (hdl->use_subdomain)
             g_string_append(auth_string, bucket);
         else {
             esc_bucket = curl_escape(bucket, 0);
@@ -664,7 +685,7 @@ authenticate_request(S3Handle *hdl,
         }
     }
 
-    if (bucket && (use_subdomain || key))
+    if (bucket && (hdl->use_subdomain || key))
         g_string_append(auth_string, "/");
 
     if (key) {
@@ -686,7 +707,6 @@ authenticate_request(S3Handle *hdl,
     HMAC_Final(&ctx, md->data, &md->len);
     HMAC_CTX_cleanup(&ctx);
     auth_base64 = s3_base64_encode(md);
-
     /* append the new headers */
     if (is_non_empty_string(hdl->user_token)) {
         /* Devpay headers are included in hash. */
@@ -1062,7 +1082,6 @@ perform_request(S3Handle *hdl,
                 gpointer progress_data,
                 const result_handling_t *result_handling)
 {
-    gboolean use_subdomain;
     char *url = NULL;
     s3_result_t result = S3_RESULT_FAIL; /* assume the worst.. */
     CURLcode curl_code = CURLE_OK;
@@ -1086,8 +1105,8 @@ perform_request(S3Handle *hdl,
 
     s3_reset(hdl);
 
-    use_subdomain = is_non_empty_string(hdl->bucket_location);
-    url = build_url(bucket, key, subresource, query, use_subdomain, hdl->use_ssl);
+    url = build_url(hdl->host, hdl->service_path, bucket, key, subresource,
+                    query, hdl->use_subdomain, hdl->use_ssl);
     if (!url) goto cleanup;
 
     /* libcurl may behave strangely if these are not set correctly */
@@ -1145,7 +1164,7 @@ perform_request(S3Handle *hdl,
 
         /* set up the request */
         headers = authenticate_request(hdl, verb, bucket, key, subresource,
-            md5_hash_b64, is_non_empty_string(hdl->bucket_location));
+            md5_hash_b64);
 
         if (hdl->use_ssl && hdl->ca_info) {
             if ((curl_code = curl_easy_setopt(hdl->curl, CURLOPT_CAINFO, hdl->ca_info)))
@@ -1474,11 +1493,15 @@ s3_bucket_location_compat(const char *bucket)
 S3Handle *
 s3_open(const char *access_key,
         const char *secret_key,
+        const char *host,
+        const char *service_path,
+        const gboolean use_subdomain,
         const char *user_token,
         const char *bucket_location,
         const char *storage_class,
         const char *ca_info
-        ) {
+        )
+{
     S3Handle *hdl;
 
     hdl = g_new0(S3Handle, 1);
@@ -1503,6 +1526,21 @@ s3_open(const char *access_key,
     /* NULL is okay */
     hdl->ca_info = g_strdup(ca_info);
 
+    if (!is_non_empty_string(host))
+       host = "s3.amazonaws.com";
+    hdl->host = g_strdup(host);
+    hdl->use_subdomain = use_subdomain ||
+                        (strcmp(host, "s3.amazonaws.com") == 0 &&
+                         is_non_empty_string(hdl->bucket_location));
+    if (service_path) {
+       if (service_path[0] != '/')
+           hdl->service_path = g_strdup_printf("/%s", service_path);
+       else
+           hdl->service_path = g_strdup(service_path);
+    } else {
+       hdl->service_path = NULL;
+    }
+
     hdl->curl = curl_easy_init();
     if (!hdl->curl) goto error;
 
@@ -1524,6 +1562,8 @@ s3_free(S3Handle *hdl)
         if (hdl->user_token) g_free(hdl->user_token);
         if (hdl->bucket_location) g_free(hdl->bucket_location);
         if (hdl->storage_class) g_free(hdl->storage_class);
+        if (hdl->host) g_free(hdl->host);
+        if (hdl->service_path) g_free(hdl->service_path);
         if (hdl->curl) curl_easy_cleanup(hdl->curl);
 
         g_free(hdl);
@@ -1703,6 +1743,7 @@ struct list_keys_thunk {
 
     gboolean is_truncated;
     gchar *next_marker;
+    guint64 size;
 
     gboolean want_text;
 
@@ -1731,6 +1772,8 @@ list_start_element(GMarkupParseContext *context G_GNUC_UNUSED,
         thunk->want_text = 1;
     } else if (g_ascii_strcasecmp(element_name, "key") == 0 && thunk->in_contents) {
         thunk->want_text = 1;
+    } else if (g_ascii_strcasecmp(element_name, "size") == 0 && thunk->in_contents) {
+        thunk->want_text = 1;
     } else if (g_ascii_strcasecmp(element_name, "istruncated")) {
         thunk->want_text = 1;
     } else if (g_ascii_strcasecmp(element_name, "nextmarker")) {
@@ -1753,6 +1796,9 @@ list_end_element(GMarkupParseContext *context G_GNUC_UNUSED,
     } else if (g_ascii_strcasecmp(element_name, "key") == 0 && thunk->in_contents) {
         thunk->filename_list = g_slist_prepend(thunk->filename_list, thunk->text);
         thunk->text = NULL;
+    } else if (g_ascii_strcasecmp(element_name, "size") == 0 && thunk->in_contents) {
+        thunk->size += g_ascii_strtoull (thunk->text, NULL, 10);
+        thunk->text = NULL;
     } else if (g_ascii_strcasecmp(element_name, "prefix") == 0 && thunk->in_common_prefixes) {
         thunk->filename_list = g_slist_prepend(thunk->filename_list, thunk->text);
         thunk->text = NULL;
@@ -1840,7 +1886,8 @@ s3_list_keys(S3Handle *hdl,
               const char *bucket,
               const char *prefix,
               const char *delimiter,
-              GSList **list)
+              GSList **list,
+              guint64 *total_size)
 {
     /*
      * max len of XML variables:
@@ -1867,6 +1914,7 @@ s3_list_keys(S3Handle *hdl,
     thunk.filename_list = NULL;
     thunk.text = NULL;
     thunk.next_marker = NULL;
+    thunk.size = 0;
 
     /* Loop until S3 has given us the entire picture */
     do {
@@ -1913,6 +1961,9 @@ cleanup:
         return FALSE;
     } else {
         *list = thunk.filename_list;
+        if(total_size) {
+            *total_size = thunk.size;
+        }
         return TRUE;
     }
 }
@@ -2013,18 +2064,21 @@ s3_make_bucket(S3Handle *hdl,
                  NULL, NULL, NULL, NULL, NULL, result_handling);
 
    if (result == S3_RESULT_OK ||
-       (is_non_empty_string(hdl->bucket_location) && result != S3_RESULT_OK
-         && hdl->last_s3_error_code == S3_ERROR_BucketAlreadyOwnedByYou)) {
+       (result != S3_RESULT_OK &&
+        hdl->last_s3_error_code == S3_ERROR_BucketAlreadyOwnedByYou)) {
         /* verify the that the location constraint on the existing bucket matches
          * the one that's configured.
          */
-        result = perform_request(hdl, "GET", bucket, NULL, "location", NULL,
-                                 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
-                                 NULL, NULL, result_handling);
+       if (is_non_empty_string(hdl->bucket_location)) {
+            result = perform_request(hdl, "GET", bucket, NULL, "location", NULL,
+                                     NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                                     NULL, NULL, result_handling);
+       } else {
+            result = perform_request(hdl, "GET", bucket, NULL, NULL, NULL,
+                                     NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+                                     NULL, NULL, result_handling);
+       }
 
-        /* note that we can check only one of the three AND conditions above
-         * and infer that the others are true
-         */
         if (result == S3_RESULT_OK && is_non_empty_string(hdl->bucket_location)) {
             /* return to the default state of failure */
             result = S3_RESULT_FAIL;
index 1e883a8c4465f01d37c0de9716970f2a67d51a71..c5ec6075378224188f45e4cfbcbabc2af0870ce8 100644 (file)
@@ -153,6 +153,7 @@ typedef curl_progress_callback s3_progress_func;
     S3_ERROR(MissingSecurityHeader), \
     S3_ERROR(NoLoggingStatusForKey), \
     S3_ERROR(NoSuchBucket), \
+    S3_ERROR(NoSuchEntity), \
     S3_ERROR(NoSuchKey), \
     S3_ERROR(NotImplemented), \
     S3_ERROR(NotSignedUp), \
@@ -232,7 +233,9 @@ s3_init(void);
  * @returns: the new S3Handle
  */
 S3Handle *
-s3_open(const char * access_key, const char *secret_key, const char * user_token,
+s3_open(const char * access_key, const char *secret_key, const char *host,
+        const char *service_path, gboolean use_subdomain,
+        const char * user_token,
         const char * bucket_location, const char * storage_class, const char * ca_info);
 
 /* Deallocate an S3Handle
@@ -365,6 +368,7 @@ s3_upload(S3Handle *hdl,
  * @param prefix: the prefix
  * @param delimiter: delimiter (any length string)
  * @param list: (output) the list of files
+ * @param total_size: (output) sum of size of files 
  * @returns: FALSE if an error occurs
  */
 gboolean
@@ -372,7 +376,8 @@ s3_list_keys(S3Handle *hdl,
               const char *bucket,
               const char *prefix,
               const char *delimiter,
-              GSList **list);
+              GSList **list,
+              guint64 *total_size);
 
 /* Read an entire file, passing the contents to write_func buffer
  * by buffer.
index 71387c6b08ce61dd6c388c04776b8ff3b546099c..4906c29a02db60c2da0796170f78309ff89b4f8a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2007, 2008, 2009, 2010 Zmanda, Inc.  All Rights Reserved.
+ * Copyright (c) 2007, 2008, 2009, 2010, 2011 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
@@ -99,6 +99,9 @@ static gboolean file_number_to_file_name_functor(const char * filename,
 static gboolean vfs_device_set_max_volume_usage_fn(Device *p_self,
                            DevicePropertyBase *base, GValue *val,
                            PropertySurety surety, PropertySource source);
+static gboolean vfs_device_set_enforce_max_volume_usage_fn(Device *p_self,
+                           DevicePropertyBase *base, GValue *val,
+                           PropertySurety surety, PropertySource source);
 static gboolean property_get_monitor_free_space_fn(Device *p_self,
                            DevicePropertyBase *base, GValue *val,
                            PropertySurety *surety, PropertySource *source);
@@ -187,6 +190,7 @@ vfs_device_init (VfsDevice * self) {
     self->volume_bytes = 0;
     self->volume_limit = 0;
     self->leom = TRUE;
+    self->enforce_volume_limit = TRUE;
 
     self->monitor_free_space = TRUE;
     self->checked_fs_free_bytes = G_MAXUINT64;
@@ -227,11 +231,17 @@ vfs_device_init (VfsDevice * self) {
     g_value_unset(&response);
 
     g_value_init(&response, G_TYPE_BOOLEAN);
-    g_value_set_boolean(&response, FALSE);
+    g_value_set_boolean(&response, TRUE);
     device_set_simple_property(dself, PROPERTY_LEOM,
            &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED);
     g_value_unset(&response);
 
+    g_value_init(&response, G_TYPE_BOOLEAN);
+    g_value_set_boolean(&response, TRUE);
+    device_set_simple_property(dself, PROPERTY_ENFORCE_MAX_VOLUME_USAGE,
+           &response, PROPERTY_SURETY_GOOD, PROPERTY_SOURCE_DETECTED);
+    g_value_unset(&response);
+
     g_value_init(&response, G_TYPE_BOOLEAN);
     g_value_set_boolean(&response, FALSE);
     device_set_simple_property(dself, PROPERTY_COMPRESSION,
@@ -285,6 +295,12 @@ vfs_device_base_init (VfsDeviceClass * c)
            device_simple_property_get_fn,
            vfs_device_set_max_volume_usage_fn);
 
+    device_class_register_property(device_class, PROPERTY_ENFORCE_MAX_VOLUME_USAGE,
+            (PROPERTY_ACCESS_GET_MASK | PROPERTY_ACCESS_SET_MASK) &
+                        (~ PROPERTY_ACCESS_SET_INSIDE_FILE_WRITE),
+            device_simple_property_get_fn,
+            vfs_device_set_enforce_max_volume_usage_fn);
+
     device_class_register_property(device_class, PROPERTY_COMPRESSION,
            PROPERTY_ACCESS_GET_MASK,
            device_simple_property_get_fn,
@@ -309,6 +325,18 @@ vfs_device_set_max_volume_usage_fn(Device *p_self,
     return device_simple_property_set_fn(p_self, base, val, surety, source);
 }
 
+static gboolean
+vfs_device_set_enforce_max_volume_usage_fn(Device *p_self,
+    DevicePropertyBase *base, GValue *val,
+    PropertySurety surety, PropertySource source)
+{
+    VfsDevice *self = VFS_DEVICE(p_self);
+
+    self->enforce_volume_limit = g_value_get_boolean(val);
+
+    return device_simple_property_set_fn(p_self, base, val, surety, source);
+}
+
 static gboolean
 property_get_monitor_free_space_fn(Device *p_self, DevicePropertyBase *base G_GNUC_UNUSED,
     GValue *val, PropertySurety *surety, PropertySource *source)
@@ -1257,7 +1285,7 @@ check_at_leom(VfsDevice *self, guint64 size)
        return FALSE;
 
     /* handle VOLUME_LIMIT */
-    if (self->volume_limit &&
+    if (self->enforce_volume_limit && self->volume_limit &&
            self->volume_bytes + size + eom_warning_buffer > self->volume_limit) {
        return TRUE;
     }
@@ -1302,7 +1330,7 @@ check_at_leom(VfsDevice *self, guint64 size)
 static gboolean
 check_at_peom(VfsDevice *self, guint64 size)
 {
-    if (self->volume_limit > 0) {
+    if (self->enforce_volume_limit && (self->volume_limit > 0)) {
        guint64 newtotal = self->volume_bytes + size;
         if (newtotal > self->volume_limit) {
            return TRUE;
@@ -1369,8 +1397,8 @@ static gboolean
 vfs_device_erase (Device * dself) {
     VfsDevice *self = VFS_DEVICE(dself);
 
-    if (!open_lock(self, 0, true))
-        return false;
+    if (!open_lock(self, 0, TRUE))
+        return FALSE;
 
     delete_vfs_files(self);
 
index 62442c470d9129b0ccd0a6da76d7be88c6216de0..09c3942babaf09563937113b5e34606a500c1a0a 100644 (file)
@@ -51,6 +51,7 @@ typedef struct {
     /* Properties */
     guint64 volume_bytes;
     guint64 volume_limit;
+    gboolean enforce_volume_limit;
 
     /* should we monitor free space? (controlled by MONITOR_FREE_SPACE property) */
     gboolean monitor_free_space;
index da2813473ebbdc9f3bb3efeae70c3b141f71b8ac..4f736a21a61e4684477be2c8bb215a30c759f7d9 100644 (file)
@@ -82,6 +82,8 @@ typedef struct XferSourceRecovery {
 
     /* timer for the duration; NULL while paused or cancelled */
     GTimer *part_timer;
+
+    gint64   size;
 } XferSourceRecovery;
 
 /*
@@ -438,6 +440,26 @@ pull_buffer_impl(
 
     g_mutex_unlock(self->start_part_mutex);
 
+    if (elt->size > 0) {
+       /* initialize on first pass */
+       if (self->size == 0)
+           self->size = elt->size;
+       
+       if (self->size == -1) {
+           *size = 0;
+           amfree(buf);
+           return NULL;
+       }
+
+       if (*size > (guint64)self->size) {
+           /* return only self->size bytes */
+           *size = self->size;
+           self->size = -1;
+       } else {
+           self->size -= *size;
+       }
+    }
+
     return buf;
 error:
     g_mutex_unlock(self->start_part_mutex);
index e1f59941bf3b7c0c50a781f136f2270c318e249b..ed48f589f1d7d6b9aff43a7e1eedc096463cf806 100644 (file)
@@ -124,6 +124,7 @@ am__aclocal_m4_deps =  \
        $(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/as_needed.m4 \
        $(top_srcdir)/config/amanda/bsd-security.m4 \
        $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
        $(top_srcdir)/config/amanda/bsdudp-security.m4 \
@@ -319,6 +320,7 @@ APPLICATION_DIR = @APPLICATION_DIR@
 AR = @AR@
 ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
 ASSERTIONS = @ASSERTIONS@
+AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -792,6 +794,7 @@ LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
 MKDIR_P = @MKDIR_P@
+MOUNT = @MOUNT@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
@@ -989,6 +992,7 @@ STDBOOL_H = @STDBOOL_H@
 STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
+SUNTAR = @SUNTAR@
 SVN = @SVN@
 SWIG = @SWIG@
 SWIG_LIB = @SWIG_LIB@
@@ -996,6 +1000,7 @@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TCPPORTRANGE = @TCPPORTRANGE@
 TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
 UDPPORTRANGE = @UDPPORTRANGE@
+UMOUNT = @UMOUNT@
 UNCOMPRESS_OPT = @UNCOMPRESS_OPT@
 UNCOMPRESS_PATH = @UNCOMPRESS_PATH@
 UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
index a6577aa7d0bdeec6b2ac205f1dc4219dacdedbbe..be30af01e8bfa239c382d47f612bb887459f8d37 100644 (file)
@@ -1,5 +1,5 @@
 #
-# amanda.conf - sample Amanda client configuration file.
+# amanda-client.conf - sample Amanda client configuration file.
 #
 # This file normally goes in @CONFIG_DIR@/amanda-client.conf.
 #
index 7ef107b681ab10f80716b5a785222c115d3a219c..692dcc5ec5a8cf1b1d9b3e935beac41f204ddafb 100644 (file)
@@ -359,7 +359,7 @@ define tapetype SEAGATE-ULTRIUM-LTO {
 #   auth       - authentication scheme to use between server and client.
 #                Valid values are "bsd", "bsdudp", "bsdtcp", "krb5", "local",
 #                "rsh" and "ssh".  
-#                Default: [auth "bsd"]
+#                Default: [auth "bsdtcp"]
 #   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
@@ -504,8 +504,7 @@ define dumptype global {
     # indexing, recording, etc.  Some examples:
     # index yes
     # record no
-    # split_diskbuffer "/raid/amanda"
-    # fallback_splitsize 64m
+    # auth "bsdtcp"
 }
 
 define dumptype always-full {
@@ -744,6 +743,39 @@ define script-tool sc-email {
 #your dumptype must include: script "sc-email"
 #to use the script
 
+define interactivity inter_tty {
+    plugin "tty"
+}
+define interactivity inter_email {
+    plugin "email"
+    property "mailto" "admin1" "admin2"
+    property "resend-delay" "10"
+    property "check-file" "/tmp/email_input"
+    property "check-file-delay" "10"
+}
+define interactivity inter_tty_email {
+    plugin "tty_email"
+    property "mailto" "admin1" "admin2"
+    property "resend-delay" "10"
+    property "check-file" "/tmp/email_input"
+    property "check-file-delay" "10"
+}
+interactivity "inter_tty_email"
+
+define taperscan taper_traditional {
+    comment "traditional"
+    plugin "traditional"
+}
+define taperscan taper_oldest {
+    comment "oldest"
+    plugin "oldest"
+}
+define taperscan taper_lexical {
+    comment "lexical"
+    plugin "lexical"
+}
+taperscan "taper_lexical"
+
 # You may include other amanda configuration files, so you can share
 # dumptypes, tapetypes and interface definitions among several
 # configurations.
index 71d3fed5b18fa0b927f0a1464e31e15695c832ac..e0312707e486bfd3c4c50f64f103e1d1e5e4364b 100644 (file)
@@ -1,4 +1,3 @@
-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
index 11ccc45d65c7efa21d948e4868f1e2ebaf62d8ae..e6bcfb24b4184e75a5a565207a0c1c288195577b 100644 (file)
@@ -1547,4 +1547,4 @@ mostlyclean-local: mostlyclean-generic
        :
 
 # Make sure regenerate/* are in the distribution tarball
-EXTRA_DIST += regenerate/no-error.patch regenerate/regenerate
+EXTRA_DIST += regenerate/fsusage-no-bool.patch regenerate/no-error.patch regenerate/regenerate
index 544d2531cbf299bd596f1f0461cccf5f22390385..6a99cca81fd57aeca738530831c3f33d88925ebe 100644 (file)
@@ -62,6 +62,7 @@ am__aclocal_m4_deps =  \
        $(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/as_needed.m4 \
        $(top_srcdir)/config/amanda/bsd-security.m4 \
        $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
        $(top_srcdir)/config/amanda/bsdudp-security.m4 \
@@ -295,6 +296,7 @@ APPLICATION_DIR = @APPLICATION_DIR@
 AR = @AR@
 ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
 ASSERTIONS = @ASSERTIONS@
+AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -768,6 +770,7 @@ LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
 MKDIR_P = @MKDIR_P@
+MOUNT = @MOUNT@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
@@ -965,6 +968,7 @@ STDBOOL_H = @STDBOOL_H@
 STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
+SUNTAR = @SUNTAR@
 SVN = @SVN@
 SWIG = @SWIG@
 SWIG_LIB = @SWIG_LIB@
@@ -972,6 +976,7 @@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TCPPORTRANGE = @TCPPORTRANGE@
 TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
 UDPPORTRANGE = @UDPPORTRANGE@
+UMOUNT = @UMOUNT@
 UNCOMPRESS_OPT = @UNCOMPRESS_OPT@
 UNCOMPRESS_PATH = @UNCOMPRESS_PATH@
 UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
@@ -1089,8 +1094,8 @@ EXTRA_DIST = alignof.h alloca.in.h $(top_srcdir)/config/arg-nonnull.h \
        asnprintf.c float+.h printf-args.c printf-args.h \
        printf-parse.c printf-parse.h vasnprintf.c vasnprintf.h \
        $(top_srcdir)/config/warn-on-use.h wchar.in.h wcrtomb.c \
-       wctype.in.h write.c regenerate/no-error.patch \
-       regenerate/regenerate
+       wctype.in.h write.c regenerate/fsusage-no-bool.patch \
+       regenerate/no-error.patch regenerate/regenerate
 
 # The BUILT_SOURCES created by this Makefile snippet are not used via #include
 # statements but through direct file reference. Therefore this snippet must be
index bb2d86f135fa57a87484541b72bf17ac083e606b..b3deefcdb8b9e40fccb11399b1dc1ca3880533a6 100644 (file)
@@ -22,7 +22,6 @@
 # define FSUSAGE_H_
 
 # include <stdint.h>
-# include <stdbool.h>
 
 struct fs_usage
 {
@@ -30,7 +29,7 @@ struct fs_usage
   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.  */
+  int 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. */
 };
diff --git a/gnulib/regenerate/fsusage-no-bool.patch b/gnulib/regenerate/fsusage-no-bool.patch
new file mode 100644 (file)
index 0000000..470b099
--- /dev/null
@@ -0,0 +1,21 @@
+diff --git a/gnulib/fsusage.h b/gnulib/fsusage.h
+index bb2d86f..b3deefc 100644
+--- a/gnulib/fsusage.h
++++ b/gnulib/fsusage.h
+@@ -22,7 +22,6 @@
+ # define FSUSAGE_H_
+ # include <stdint.h>
+-# include <stdbool.h>
+ struct fs_usage
+ {
+@@ -30,7 +29,7 @@ struct fs_usage
+   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.  */
++  int 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. */
+ };
index 57565d78ef319fba1b4e6e6531188524d94c25cd..d7f3a97c80985ed2a24666461d40b79580d58c1a 100755 (executable)
@@ -66,6 +66,10 @@ PATCH_DIR="`pwd`/gnulib/regenerate"
 patch -p0 < "${PATCH_DIR}/no-error.patch" || exit 1
 rm -f gnulib/Makefile.am.orig
 
+# Patch fsusage.h to not use 'bool', as it doesn't play nicely with
+# Perl on Mac OS X
+patch -p1 < "${PATCH_DIR}/fsusage-no-bool.patch" || exit 1
+
 # Add info to the makefile to ensure all this stuff gets put in
 # the distribution tarball
 (   echo ""
index 910d459cdea9ed0b54faf4438083e4c72feee8b6..ce3dbab57f7ad84032ef0e3e1dfe343b0644c277 100644 (file)
@@ -16,7 +16,7 @@
 # Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300
 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
 
-use Test::More tests => 47;
+use Test::More tests => 54;
 use File::Path;
 use Data::Dumper;
 use strict;
@@ -25,11 +25,12 @@ use warnings;
 use lib "@amperldir@";
 use Installcheck::Config;
 use Amanda::Paths;
-use Amanda::Device;
+use Amanda::Device qw( :constants );;
 use Amanda::Debug;
 use Amanda::MainLoop;
 use Amanda::Config qw( :init :getconf config_dir_relative );
 use Amanda::Changer;
+use Amanda::Tapelist;
 
 # set up debugging so debug output doesn't interfere with test results
 Amanda::Debug::dbopen("installcheck");
@@ -249,9 +250,32 @@ if ($cfg_result != $CFGERR_OK) {
 }
 
 # check out the relevant changer properties
-my $chg = Amanda::Changer->new("mychanger");
+my $tlf = Amanda::Config::config_dir_relative(getconf($CNF_TAPELIST));
+my $tl = Amanda::Tapelist->new($tlf);
+my $chg = Amanda::Changer->new("mychanger", tapelist => $tl);
 is($chg->{'config'}->get_property("testprop"), "testval",
     "changer properties are correctly represented");
+is($chg->have_inventory(), 1, "changer have inventory");
+is($chg->make_new_tape_label(), undef, "no make_new_tape_label");
+is($chg->make_new_meta_label(), undef, "no make_new_meta_label");
+
+$chg = Amanda::Changer->new("mychanger", tapelist => $tl,
+                           labelstr => "TESTCONF-[0-9][0-9][0-9]-[a-z][a-z][a-z]-[0-9][0-9][0-9]",
+                           autolabel => { template => '$c-$m-$b-%%%',
+                                          other_config => 1,
+                                          non_amanda => 1,
+                                          volume_error => 0,
+                                          empty => 1 },
+                           meta_autolabel => "%%%");
+my $meta = $chg->make_new_meta_label();
+is($meta, "001", "meta 001");
+my $label = $chg->make_new_tape_label(meta => $meta, barcode => 'aaa');
+is($label, 'TESTCONF-001-aaa-001', "label TESTCONF-001-aaa-001");
+
+is($chg->volume_is_labelable($DEVICE_STATUS_VOLUME_UNLABELED, $Amanda::Header::F_EMPTY),
+   1, "empty volume is labelable");
+is($chg->volume_is_labelable($DEVICE_STATUS_VOLUME_ERROR, undef),
+   0, "empty volume is labelable");
 
 # test loading by label
 {
@@ -522,6 +546,7 @@ Amanda::MainLoop::run();
     $do_info->();
     Amanda::MainLoop::run();
 }
+$chg->quit();
 
 # Test the various permutations of configuration setup, with a patched
 # _new_from_uri so we can monitor the result
@@ -676,7 +701,8 @@ sub test_locked_state {
     my $num_outstanding = 0;
 
     my $steps = define_steps
-       cb_ref => \$finished_cb;
+       cb_ref => \$finished_cb,
+       finalize => sub { $chg->quit() if defined $chg };
 
     step start => sub {
        $chg = Amanda::Changer->new("chg-null:");
index fc6d9ad0831054bd3979720bb310ffc77484389a..b2e311e13f60ff4dd1a20db2387150e86f67ba98 100644 (file)
@@ -16,7 +16,7 @@
 # Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300
 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
 
-use Test::More tests => 30;
+use Test::More tests => 31;
 use File::Path;
 use strict;
 use warnings;
@@ -197,6 +197,8 @@ if ($cfg_result != $CFGERR_OK) {
 my $chg = Amanda::Changer->new();
 die($chg) if $chg->isa("Amanda::Changer::Error");
 
+is($chg->have_inventory(), '', "changer have inventory");
+
 try_run_changer(
     sub { $chg->load(label => 'TAPE-01', res_cb => $check_res_cb); },
     undef,
@@ -346,6 +348,7 @@ if ($cfg_result != $CFGERR_OK) {
     die(join "\n", @errors);
 }
 
+$chg->quit();
 $chg = Amanda::Changer->new();
 die($chg) if $chg->isa("Amanda::Changer::Error");
 
@@ -444,6 +447,7 @@ die($chg) if $chg->isa("Amanda::Changer::Error");
     $get_info->();
     Amanda::MainLoop::run();
 }
+$chg->quit();
 
 # test two simultaneous invocations of info()
 
@@ -534,6 +538,7 @@ sub test_except_slots {
 }
 test_except_slots(\&Amanda::MainLoop::quit);
 Amanda::MainLoop::run();
+$chg->quit();
 
 unlink($changer_filename);
 unlink($result_file);
index 2b6b3fb3e27b6c383f1389a82e29517ab6847ed2..c5b144baf4c0e1d48784d185a8d2e184bd35abbf 100644 (file)
@@ -16,7 +16,7 @@
 # Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300
 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
 
-use Test::More tests => 18;
+use Test::More tests => 19;
 use File::Path;
 use strict;
 use warnings;
@@ -84,6 +84,7 @@ chg_err_like($chg,
 
 $chg = Amanda::Changer->new("chg-disk:$taperoot");
 die($chg) if $chg->isa("Amanda::Changer::Error");
+is($chg->have_inventory(), '1', "changer have inventory");
 
 sub test_reserved {
     my ($finished_cb, @slots) = @_;
@@ -421,4 +422,5 @@ Amanda::MainLoop::run();
     Amanda::MainLoop::run();
 }
 
+$chg->quit();
 rmtree($taperoot);
index 4c666662c263ae333fa6ffdfeae10390d5795019..0ca9ea1820eac7c64b47937ab5beaf10363aef12 100644 (file)
@@ -16,7 +16,7 @@
 # Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300
 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
 
-use Test::More tests => 18;
+use Test::More tests => 19;
 use File::Path;
 use strict;
 use warnings;
@@ -71,6 +71,7 @@ reset_taperoot(5);
 
 my $chg = Amanda::Changer->new("chg-multi:file:$taperoot/slot{0,1,2,3,4}");
 die($chg) if $chg->isa("Amanda::Changer::Error");
+is($chg->have_inventory(), '1', "changer have inventory");
 {
     my @slots = ();
     my @reservations = ();
@@ -431,4 +432,5 @@ Amanda::MainLoop::run();
     Amanda::MainLoop::run();
 }
 
+$chg->quit();
 rmtree($taperoot);
index a04ac2b181041c7fae14719be64544ce6ca74159..2219a2cc5f534bc87abb92c8a79b3652a4901792 100644 (file)
@@ -16,7 +16,7 @@
 # Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300
 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
 
-use Test::More tests => 165;
+use Test::More tests => 171;
 use File::Path;
 use Data::Dumper;
 use strict;
@@ -74,7 +74,8 @@ sub test_interface {
     my ($interface, $chg);
 
     my $steps = define_steps
-       cb_ref => \$finished_cb;
+       cb_ref => \$finished_cb,
+       finalize => sub { $chg->quit() if defined $chg};
 
     step start => sub {
        my $testconf = Installcheck::Config->new();
@@ -95,6 +96,7 @@ sub test_interface {
 
        $chg = Amanda::Changer->new("robo");
        die "$chg" if $chg->isa("Amanda::Changer::Error");
+       is($chg->have_inventory(), '1', "changer have inventory");
 
        $interface = $chg->{'interface'};
        $interface->inquiry($steps->{'inquiry_cb'});
@@ -290,12 +292,12 @@ sub test_changer {
     my $pfx = "BC=$mtx_config->{barcodes}; TORIG=$mtx_config->{track_orig}";
 
     my $steps = define_steps
-       cb_ref => \$finished_cb;
+       cb_ref => \$finished_cb,
+       finalize => sub { $chg->quit() if defined $chg};
 
     # clean up
     step setup => sub {
        unlink($chg_state_file) if -f $chg_state_file;
-       %Amanda::Changer::changers_by_uri_cc = ();
 
        my @ignore_barcodes = ( property => "\"ignore-barcodes\" \"y\"")
            if ($mtx_config->{'barcodes'} == -1);
@@ -335,6 +337,7 @@ sub test_changer {
            "$pfx: Create working chg-robot instance: $chg")
            or die("no sense going on");
 
+       is($chg->have_inventory(), '1', "changer have inventory");
        $chg->info(info => [qw(vendor_string num_slots fast_search)],
                    info_cb => $steps->{'info_cb'});
     };
index 342bb07eb60b58d95eea1a7fbeeb2e49073d9be1..50a98c190bf889deaf169f635a7405eadc69fbc0 100644 (file)
@@ -16,7 +16,7 @@
 # Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300
 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
 
-use Test::More tests => 4;
+use Test::More tests => 5;
 use File::Path;
 use strict;
 use warnings;
@@ -48,6 +48,7 @@ if ($cfg_result != $CFGERR_OK) {
 }
 
 my $chg = Amanda::Changer->new("chg-null:");
+is($chg->have_inventory(), '', "changer have inventory");
 {
     my ($get_info, $check_info, $do_load, $got_res);
 
@@ -105,3 +106,5 @@ my $chg = Amanda::Changer->new("chg-null:");
     $try_eject->();
     Amanda::MainLoop::run();
 }
+
+$chg->quit();
index 259c2b5b0925a89375cb6ea150acd5bb78fd5c84..2139296bfbba131a705519ab18c88109c1f2dd18 100644 (file)
@@ -16,7 +16,7 @@
 # Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300
 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
 
-use Test::More tests => 42;
+use Test::More tests => 43;
 use File::Path;
 use Data::Dumper;
 use strict;
@@ -103,7 +103,8 @@ sub test_threeway {
     pass("Create 3-way RAIT of vtapes");
 
     my $steps = define_steps
-       cb_ref => \$finished_cb;
+       cb_ref => \$finished_cb,
+       finalize => sub { $chg->quit() };
 
     step get_info => sub {
         $chg->info(info_cb => $steps->{'check_info'},
@@ -297,9 +298,11 @@ sub test_threeway_error {
 
     my $chg = Amanda::Changer->new("chg-rait:{chg-disk:$tapebase/1,chg-disk:$tapebase/2,ERROR}");
     pass("Create 3-way RAIT of vtapes, with the third errored out");
+    is($chg->have_inventory(), '1', "changer have inventory");
 
     my $steps = define_steps
-       cb_ref => \$finished_cb;
+       cb_ref => \$finished_cb,
+       finalize => sub { $chg->quit() };
 
     step get_info => sub {
         $chg->info(info_cb => $steps->{'check_info'},
@@ -389,7 +392,8 @@ sub test_normal_inventory {
     pass("Create 3-way RAIT of vtapes with correctly-labeled children");
 
     my $steps = define_steps
-       cb_ref => \$finished_cb;
+       cb_ref => \$finished_cb,
+       finalize => sub { $chg->quit() };
 
     step setup => sub {
        reset_taperoot();
@@ -454,7 +458,8 @@ sub test_properties {
        "Create RAIT device from a named config subsection");
 
     my $steps = define_steps
-       cb_ref => \$finished_cb;
+       cb_ref => \$finished_cb,
+       finalize => sub { $chg->quit() };
 
     step do_load_1 => sub {
        reset_taperoot();
@@ -498,7 +503,8 @@ sub test_except_slots {
     my $chg;
 
     my $steps = define_steps
-       cb_ref => \$finished_cb;
+       cb_ref => \$finished_cb,
+       finalize => sub { $chg->quit() if defined $chg };
 
     step start => sub {
        $chg = Amanda::Changer->new("myrait");
index e280375775e33a4d5452b347079b71df02344763..bed28ba7c4ffb39bed9f3d0a318b9b8bdc3525f6 100644 (file)
@@ -16,7 +16,7 @@
 # Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300
 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
 
-use Test::More tests => 321;
+use Test::More tests => 324;
 use File::Path;
 use Data::Dumper;
 use strict;
@@ -91,7 +91,8 @@ sub test_interface {
     my ($interface, $chg);
 
     my $steps = define_steps
-       cb_ref => \$finished_cb;
+       cb_ref => \$finished_cb,
+       finalize => sub { $chg->quit() };
 
     step start => sub {
        my $testconf = Installcheck::Config->new();
@@ -115,6 +116,7 @@ sub test_interface {
 
        $chg = Amanda::Changer->new("robo");
        die "$chg" if $chg->isa("Amanda::Changer::Error");
+       is($chg->have_inventory(), '1', "changer have inventory");
        $interface = $chg->{'interface'};
 
        $interface->inquiry($steps->{'inquiry_cb'});
@@ -335,6 +337,7 @@ Amanda::MainLoop::run();
 
     my $chg = Amanda::Changer->new("delays");
     die "$chg" if $chg->isa("Amanda::Changer::Error");
+    is($chg->have_inventory(), '1', "changer have inventory");
     is($chg->{'status_interval'}, 60, "status-interval parsed");
     is($chg->{'eject_delay'}, 1, "eject-delay parsed");
     is($chg->{'unload_delay'}, 120, "unload-delay parsed");
@@ -346,10 +349,12 @@ Amanda::MainLoop::run();
     $dashed_mtx_state_file =~ s/^-*//;
     is($chg->{'statefile'}, "$localstatedir/amanda/chg-robot-$dashed_mtx_state_file",
         "statefile calculated correctly");
+    $chg->quit();
 
     # test no-fast-search
     $chg = Amanda::Changer->new("no-fast-search");
     die "$chg" if $chg->isa("Amanda::Changer::Error");
+    is($chg->have_inventory(), '1', "changer have inventory");
     $chg->info(
            info => ['fast_search'],
            info_cb => make_cb(info_cb => sub {
@@ -363,6 +368,7 @@ Amanda::MainLoop::run();
     my @allowed = map { $chg->_is_slot_allowed($_) } (0 .. 10);
     is_deeply([ @allowed ], [ 0, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0 ],
        "_is_slot_allowed parses multiple properties and behaves as expected");
+    $chg->quit();
 }
 
 ##
@@ -376,12 +382,12 @@ sub test_changer {
     my $vtape_root = "$Installcheck::TMP/chg-robot-vtapes";
 
     my $steps = define_steps
-       cb_ref => \$finished_cb;
+       cb_ref => \$finished_cb,
+       finalize => sub { $chg->quit() };
 
     step setup => sub {
        # clean up
        unlink($chg_state_file) if -f $chg_state_file;
-       %Amanda::Changer::changers_by_uri_cc = ();
 
        # set up some vtapes
        rmtree($vtape_root);
index f2c42cf5f4879e52651994789d59824f6df815c3..1f876d69f1e643f2ed3d0f60592a89456a6054ec 100644 (file)
@@ -104,8 +104,10 @@ die "$chg" if $chg->isa("Amanda::Changer::Error");
     $get_info->();
     Amanda::MainLoop::run();
 }
+$chg->quit();
 
 $chg = Amanda::Changer->new("chg-single:bogus:device");
 is("$chg",
     "chg-single: error opening device 'bogus:device': Device type bogus is not known.",
     "bogus device name detected early");
+$chg->quit();
index 349ce1000a82e2b278af457750ef482ee50a754f..4a00337a70bfbfd24187b56b8ade3b1abab4e589 100644 (file)
@@ -16,7 +16,7 @@
 # Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300
 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
 
-use Test::More tests => 204;
+use Test::More tests => 224;
 use strict;
 use warnings;
 use Data::Dumper;
@@ -228,6 +228,17 @@ $testconf->add_changer('my_changer', [
   'property' => '"testprop" "testval"',
   'device_property' => '"testdprop" "testdval"',
 ]);
+$testconf->add_interactivity('my_interactivity', [
+  'comment' => '"my interactivity is mine, not yours"',
+  'plugin'  => '"MY-interactivity"',
+  'property' => '"testprop" "testval"',
+]);
+
+$testconf->add_taperscan('my_taperscan', [
+  'comment' => '"my taperscan is mine, not yours"',
+  'plugin'  => '"MY-taperscan"',
+  'property' => '"testprop" "testval"',
+]);
 
 $testconf->write();
 
@@ -363,7 +374,7 @@ is_deeply([ sort(+getconf_list("dumptype")) ],
          [ sort(qw(
            mydump-type second_dumptype third_dumptype
            NO-COMPRESS COMPRESS-FAST COMPRESS-BEST COMPRESS-CUST
-           SRVCOMPRESS BSD-AUTH NO-RECORD NO-HOLD
+           SRVCOMPRESS BSD-AUTH BSDTCP-AUTH NO-RECORD NO-HOLD
            NO-FULL
            )) ],
     "getconf_list lists all dumptypes (including defaults)");
@@ -515,6 +526,47 @@ is_deeply([ sort(+getconf_list("changer")) ],
          [ sort("my_changer") ],
     "getconf_list lists all changers");
 
+$dc = lookup_interactivity("my_interactivity");
+ok($dc, "found my_interactivity");
+is(interactivity_name($dc), "my_interactivity",
+    "my_interactivity knows its name");
+is(interactivity_getconf($dc, $INTERACTIVITY_COMMENT), 'my interactivity is mine, not yours',
+    "interactivity comment");
+is(interactivity_getconf($dc, $INTERACTIVITY_PLUGIN), 'MY-interactivity',
+    "interactivity plugin");
+is_deeply(interactivity_getconf($dc, $INTERACTIVITY_PROPERTY),
+    { 'testprop' => {
+           'priority' => 0,
+           'values' => [ 'testval' ],
+           'append' => 0,
+       }
+    }, "interactivity properties represented correctly");
+
+is_deeply([ sort(+getconf_list("interactivity")) ],
+         [ sort("my_interactivity") ],
+    "getconf_list lists all interactivity");
+
+$dc = lookup_taperscan("my_taperscan");
+ok($dc, "found my_taperscan");
+is(taperscan_name($dc), "my_taperscan",
+    "my_taperscan knows its name");
+is(taperscan_getconf($dc, $TAPERSCAN_COMMENT), 'my taperscan is mine, not yours',
+    "taperscan comment");
+is(taperscan_getconf($dc, $TAPERSCAN_PLUGIN), 'MY-taperscan',
+    "taperscan plugin");
+is_deeply(taperscan_getconf($dc, $TAPERSCAN_PROPERTY),
+    { 'testprop' => {
+           'priority' => 0,
+           'values' => [ 'testval' ],
+           'append' => 0,
+       }
+    }, "taperscan properties represented correctly");
+
+is_deeply([ sort(+getconf_list("taperscan")) ],
+         [ sort("my_taperscan") ],
+    "getconf_list lists all taperscan");
+
+
 ##
 # Test config overwrites (using the config from above)
 
@@ -667,13 +719,13 @@ SKIP: {
 $testconf = Installcheck::Config->new();
 $testconf->add_param('recovery-limit', '"foo" "bar"');
 $testconf->add_dumptype('rl1', [
-    'recovery-limit' => 'same-host',
+    'recovery-limit' => 'same-host server',
 ]);
 $testconf->add_dumptype('rl2', [
     'recovery-limit' => '"somehost"',
 ]);
 $testconf->add_dumptype('rl3', [
-    'recovery-limit' => 'same-host "somehost"',
+    'recovery-limit' => 'same-host server "somehost"',
 ]);
 $testconf->add_dumptype('rl4', [
     'recovery-limit' => '"foohost" same-host',
@@ -694,7 +746,7 @@ SKIP: {
 
     $dtyp = lookup_dumptype("rl1");
     is_deeply(dumptype_getconf($dtyp, $DUMPTYPE_RECOVERY_LIMIT),
-       [ undef ],
+       [ "SAMEHOST-SAMEHOST-SAMEHOST", "SERVER-SERVER-SERVER"  ],
        "same-host => undef in list");
 
     $dtyp = lookup_dumptype("rl2");
@@ -704,15 +756,62 @@ SKIP: {
 
     $dtyp = lookup_dumptype("rl3");
     is_deeply(dumptype_getconf($dtyp, $DUMPTYPE_RECOVERY_LIMIT),
-       [ undef, "somehost" ],
+       [ "SAMEHOST-SAMEHOST-SAMEHOST", "SERVER-SERVER-SERVER", "somehost" ],
        "hostname and same-host parsed correctly");
 
     $dtyp = lookup_dumptype("rl4");
     is_deeply(dumptype_getconf($dtyp, $DUMPTYPE_RECOVERY_LIMIT),
-       [ undef, "foohost" ], # note that the order is an implementation detail
+       [ "SAMEHOST-SAMEHOST-SAMEHOST", "foohost" ], # note that the order is an implementation detail
        ".. even if same-host comes last");
 }
 
+##
+# Check out dump-limit parsing
+
+$testconf = Installcheck::Config->new();
+$testconf->add_dumptype('dl1', [
+    'dump-limit' => 'same-host',
+]);
+$testconf->add_dumptype('dl2', [
+    'dump-limit' => 'server',
+]);
+$testconf->add_dumptype('dl3', [
+    'dump-limit' => 'same-host server',
+]);
+$testconf->write();
+
+$cfg_result = config_init($CONFIG_INIT_EXPLICIT_NAME, "TESTCONF");
+is($cfg_result, $CFGERR_OK,
+    "dump-limit config loaded")
+    or diag_config_errors();
+SKIP: {
+    skip "error loading config", 5 unless $cfg_result == $CFGERR_OK;
+    my $dtyp;
+
+    $dtyp = lookup_dumptype("dl1");
+    is_deeply(dumptype_getconf($dtyp, $DUMPTYPE_DUMP_LIMIT),
+       [ "SAMEHOST-SAMEHOST-SAMEHOST" ],
+       "same-host => \"SAMEHOST-SAMEHOST-SAMEHOST\" in list");
+
+    $dtyp = lookup_dumptype("dl2");
+    is_deeply(dumptype_getconf($dtyp, $DUMPTYPE_DUMP_LIMIT),
+       [ "SERVER-SERVER-SERVER"  ],
+       "server => \"SERVER-SERVER-SERVER\" in list");
+
+    $dtyp = lookup_dumptype("dl3");
+    is_deeply(dumptype_getconf($dtyp, $DUMPTYPE_DUMP_LIMIT),
+       [ "SAMEHOST-SAMEHOST-SAMEHOST", "SERVER-SERVER-SERVER"  ],
+       "same-host and server");
+}
+
+$testconf->add_dumptype('dl4', [
+    'dump-limit' => 'same-host server "somehost"',
+]);
+$testconf->write();
+$cfg_result = config_init($CONFIG_INIT_EXPLICIT_NAME, "TESTCONF");
+isnt($cfg_result, $CFGERR_OK,
+    "dump-limit do not accept hostname");
+
 ##
 # Try an autolabel with a template and 'any'
 
@@ -1038,3 +1137,16 @@ for my $pn (@prop_names) {
     is_deeply($properties->{$pn->{'val'}}->{values}, [ "VALUE" ]);
 }
 
+$testconf = Installcheck::Config->new();
+$testconf->add_client_config_param('amdump-server', '"amdump.localhost"');
+$testconf->add_client_config_param('index-server', '"index.localhost"');
+$testconf->add_client_config_param('tape-server', '"tape.localhost"');
+$testconf->write();
+config_init($CONFIG_INIT_CLIENT | $CONFIG_INIT_EXPLICIT_NAME, "TESTCONF");
+my $amdump_server = getconf($CNF_AMDUMP_SERVER);
+is ($amdump_server, "amdump.localhost", "amdump-server is \"amdump.localhost\"");
+my $index_server = getconf($CNF_INDEX_SERVER);
+is ($index_server, "index.localhost", "index-server is \"index.localhost\"");
+my $tape_server = getconf($CNF_TAPE_SERVER);
+is ($tape_server, "tape.localhost", "amdump is \"tape.localhost\"");
+
index e42cc4fbedaaa26a75d70c693f5a78e0beea0827..41a5d8a87ab0a1a8cd220389ad8b0e751f8bddb0 100644 (file)
@@ -145,6 +145,7 @@ sub sortparts {
     map {
        # convert bigints to strings and on to integers so is_deeply doesn't get confused
        $_->{'dump'}->{'level'} = "$_->{dump}->{level}" + 0;
+       $_->{'dump'}->{'bytes'} = "$_->{dump}->{bytes}" + 0;
        $_->{'dump'}->{'kb'} = "$_->{dump}->{kb}" + 0;
        $_->{'dump'}->{'orig_kb'} = "$_->{dump}->{orig_kb}" + 0;
        if (!defined $_->{filenum}) {
@@ -238,6 +239,7 @@ sub sortdumps {
     map {
        # convert bigints to strings and on to integers so is_deeply doesn't get confused
        $_->{'level'} = "$_->{level}" + 0;
+       $_->{'bytes'} = "$_->{bytes}" + 0;
        $_->{'kb'} = "$_->{kb}" + 0;
        $_->{'orig_kb'} = "$_->{orig_kb}" + 0;
        $_->{'nparts'} = "$_->{nparts}" + 0;
index c5f8520cd173ab5fd44169e45b8dab20c7fc55d2..363a17e9e1c4084a2016296caab8e86fb8197ecf 100644 (file)
@@ -16,7 +16,7 @@
 # Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300
 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
 
-use Test::More tests => 505;
+use Test::More tests => 582;
 use File::Path qw( mkpath rmtree );
 use Sys::Hostname;
 use Carp;
@@ -351,6 +351,42 @@ ok($dev->property_set("MAX_VOLUME_USAGE", "512k"),
     "set MAX_VOLUME_USAGE to test LEOM");
 ok($dev->property_set("LEOM", 1),
     "set LEOM");
+ok($dev->property_set("ENFORCE_MAX_VOLUME_USAGE", 0),
+    "set ENFORCE_MAX_VOLUME_USAGE");
+
+ok($dev->start($ACCESS_WRITE, 'TESTCONF23', undef),
+    "start in write mode")
+    or diag($dev->error_or_status());
+
+ok($dev->start_file($dumpfile),
+    "start file 1")
+    or diag($dev->error_or_status());
+
+ok(Amanda::Device::write_random_to_device(0xCAFE, 440*1024, $dev),
+    "write random data into the early-warning zone");
+
+ok(!$dev->is_eom,
+    "device does not indicates LEOM after writing when ENFORCE_MAX_VOLUME_USAGE is FALSE");
+
+ok($dev->finish_file(),
+    "..but a finish_file is allowed to complete")
+    or diag($dev->error_or_status());
+
+ok($dev->finish(),
+   "finish device after LEOM test")
+    or diag($dev->error_or_status());
+
+$dev = undef;
+$dev = Amanda::Device->new($dev_name);
+is($dev->status(), $DEVICE_STATUS_SUCCESS,
+    "$dev_name: re-create successful")
+    or diag($dev->error_or_status());
+ok($dev->property_set("MAX_VOLUME_USAGE", "512k"),
+    "set MAX_VOLUME_USAGE to test LEOM");
+ok($dev->property_set("LEOM", 1),
+    "set LEOM");
+ok($dev->property_set("ENFORCE_MAX_VOLUME_USAGE", 1),
+    "set ENFORCE_MAX_VOLUME_USAGE");
 
 ok($dev->start($ACCESS_WRITE, 'TESTCONF23', undef),
     "start in write mode")
@@ -377,6 +413,41 @@ ok($dev->finish(),
    "finish device after LEOM test")
     or diag($dev->error_or_status());
 
+$dev = undef;
+$dev = Amanda::Device->new($dev_name);
+is($dev->status(), $DEVICE_STATUS_SUCCESS,
+    "$dev_name: re-create successful")
+    or diag($dev->error_or_status());
+ok($dev->property_set("MAX_VOLUME_USAGE", "512k"),
+    "set MAX_VOLUME_USAGE to test LEOM");
+ok($dev->property_set("LEOM", 1),
+    "set LEOM");
+
+ok($dev->start($ACCESS_WRITE, 'TESTCONF23', undef),
+    "start in write mode")
+    or diag($dev->error_or_status());
+
+ok($dev->start_file($dumpfile),
+    "start file 1")
+    or diag($dev->error_or_status());
+
+ok(!$dev->is_eom,
+    "device does not indicate LEOM before writing");
+
+ok(Amanda::Device::write_random_to_device(0xCAFE, 440*1024, $dev),
+    "write random data into the early-warning zone");
+
+ok($dev->is_eom,
+    "device indicates LEOM after writing as default value of ENFORCE_MAX_VOLUME_USAGE is true for vfs device");
+
+ok($dev->finish_file(),
+    "..but a finish_file is allowed to complete")
+    or diag($dev->error_or_status());
+
+ok($dev->finish(),
+   "finish device after LEOM test")
+    or diag($dev->error_or_status());
+
 $dev = undef;
 $dev = Amanda::Device->new($dev_name);
 is($dev->status(), $DEVICE_STATUS_SUCCESS,
@@ -661,10 +732,10 @@ my $base_name;
 
 SKIP: {
     skip "define \$INSTALLCHECK_S3_{SECRET,ACCESS}_KEY to run S3 tests",
-            71 +
+            91 +
             1 * $verify_file_count +
-            4 * $write_file_count +
-            10 * $s3_make_device_count
+            7 * $write_file_count +
+            13 * $s3_make_device_count
        unless $run_s3_tests;
 
     $dev_name = "s3:";
@@ -839,6 +910,90 @@ SKIP: {
        "erase device right after creation")
        or diag($dev->error_or_status());
 
+    $dev = s3_make_device($dev_name, "s3");
+
+    # set MAX_VOLUME_USAGE, LEOM=true, ENFORCE_MAX_VOLUME_USAGE=false
+    ok($dev->property_set('MAX_VOLUME_USAGE', "512k"),
+       "set MAX_VOLUME_USAGE to test LEOM");
+
+    ok($dev->property_set("LEOM", 1),
+        "set LEOM");
+
+    ok($dev->start($ACCESS_WRITE, "TESTCONF13", undef), 
+       "start in write mode")
+        or diag($dev->error_or_status());
+
+    write_file(0x2FACE, 440*1024, 1);
+
+    ok(!$dev->is_eom,
+        "device does not indicate LEOM after writing as property ENFORCE_MAX_VOLUME_USAGE not set and its default value is false");
+
+    ok($dev->finish(),
+       "finish device after LEOM test")
+       or diag($dev->error_or_status());
+    
+    ok($dev->erase(),
+       "erase device")
+       or diag($dev->error_or_status());
+    
+    $dev = s3_make_device($dev_name, "s3");
+
+    # set MAX_VOLUME_USAGE, LEOM=true, ENFORCE_MAX_VOLUME_USAGE=true
+    ok($dev->property_set('MAX_VOLUME_USAGE', "512k"),
+       "set MAX_VOLUME_USAGE to test LEOM");
+
+    ok($dev->property_set('ENFORCE_MAX_VOLUME_USAGE', 1 ),
+       "set ENFORCE_MAX_VOLUME_USAGE");
+
+    ok($dev->property_set("LEOM", 1),
+        "set LEOM");
+
+    ok($dev->start($ACCESS_WRITE, "TESTCONF13", undef), 
+       "start in write mode")
+        or diag($dev->error_or_status());
+
+    write_file(0x2FACE, 440*1024, 1);
+
+    ok($dev->is_eom,
+        "device indicates LEOM after writing, when property ENFORCE_MAX_VOLUME_USAGE set to true");
+
+    ok($dev->finish(),
+       "finish device after LEOM test")
+       or diag($dev->error_or_status());
+
+    ok($dev->erase(),
+       "erase device")
+       or diag($dev->error_or_status());
+    
+    $dev = s3_make_device($dev_name, "s3");
+
+    # set MAX_VOLUME_USAGE, LEOM=true, ENFORCE_MAX_VOLUME_USAGE=false
+    ok($dev->property_set('MAX_VOLUME_USAGE', "512k"),
+       "set MAX_VOLUME_USAGE to test LEOM");
+
+    ok($dev->property_set('ENFORCE_MAX_VOLUME_USAGE', 0 ),
+       "set ENFORCE_MAX_VOLUME_USAGE");
+
+    ok($dev->property_set("LEOM", 1),
+        "set LEOM");
+
+    ok($dev->start($ACCESS_WRITE, "TESTCONF13", undef), 
+       "start in write mode")
+        or diag($dev->error_or_status());
+
+    write_file(0x2FACE, 440*1024, 1);
+
+    ok(!$dev->is_eom,
+        "device does not indicate LEOM after writing, when property ENFORCE_MAX_VOLUME_USAGE set to false");
+
+    ok($dev->finish(),
+       "finish device after LEOM test")
+       or diag($dev->error_or_status());
+    
+    ok($dev->erase(),
+       "erase device")
+       or diag($dev->error_or_status());
+    
     # try with empty user token
     $dev_name = lc("s3:$base_name-s3");
     $dev = s3_make_device($dev_name, "s3");
index e64e3caed23ffcc1773cb3670fcac39e2fd151fb..4d649349703c08ac2ef7c5fd8ea5ebaf01a74c6a 100644 (file)
@@ -57,7 +57,7 @@ my ($x, $d, @list);
 
 $x = Amanda::Disklist::get_host("otherbox");
 ok($x, "get_host returns a host");
-is($x->{'auth'}, 'BSD', "..host has correct auth");
+is($x->{'auth'}, 'BSDTCP', "..host has correct auth");
 is_deeply([ sort @{$x->{'disks'}} ],
          [ sort "/disk1", "/disk2", "/home" ],
          "..and three disks");
index ec3727f894806d7935e04e09cc72b3eb7358f251..7841f9900905e50f5be13f25e4a802cc061f1827 100644 (file)
@@ -70,7 +70,8 @@ sub setup_changer {
     my ($slot, $xfer_info, $partnum);
 
     my $steps = define_steps
-       cb_ref => \$finished_cb;
+       cb_ref => \$finished_cb,
+       finalize => sub { $chg->quit() };
 
     step setup => sub {
        $chg = Amanda::Changer->new($chg_name);
@@ -494,6 +495,8 @@ $feedback = main::Feedback->new(
     },
 );
 
+$chg = Amanda::Changer->new("chg-disk:$taperoot");
+$scan = Amanda::Recovery::Scan->new(chg => $chg);
 $clerk = Amanda::Recovery::Clerk->new(scan => $scan, debug => 1,
                                      feedback => $feedback);
 
index 40cf557332bb67a998a286cbf51d5b9033724760..dd704c7a17ef59dea96f4d55c0d004518ffe3469 100644 (file)
@@ -41,11 +41,11 @@ Installcheck::log_test_output();
 Amanda::Debug::disable_die_override();
 
 # --------
-# Interactive package
+# Interactivity package
 
-package Amanda::Interactive::Installcheck;
+package Amanda::Interactivity::Installcheck;
 use vars qw( @ISA );
-@ISA = qw( Amanda::Interactive );
+@ISA = qw( Amanda::Interactivity );
 
 sub new {
     my $class = shift;
@@ -58,7 +58,7 @@ sub user_request {
     my %params = @_;
 
     Amanda::Debug::debug("Change changer to multi-changer");
-    $params{'finished_cb'}->(undef, "multi-changer");
+    $params{'request_cb'}->(undef, "multi-changer");
 };
 
 # --------
@@ -211,7 +211,8 @@ sub test_searching {
     my $res03;
 
     my $steps = define_steps
-       cb_ref => \$finished_cb;
+       cb_ref => \$finished_cb,
+       finalize => sub { $scan->quit() };
 
     step start => sub {
        $scan = Amanda::Recovery::Scan->new(chg => $chg);
@@ -378,7 +379,8 @@ sub test_scan_poll {
     my $res04;
 
     my $steps = define_steps
-       cb_ref => \$finished_cb;
+       cb_ref => \$finished_cb,
+       finalize => sub { $scan->quit() };
 
     step start => sub {
        $chg = Amanda::Changer->new($chg_name);
@@ -437,15 +439,17 @@ sub test_scan_ask_poll {
     my $chg_name = "multi-changer";
     my $chg = Amanda::Changer->new($chg_name);
     amlabel_sync($chg, $chg_name, 2, 'TESTCONF05');
+    $chg->quit();
     $chg = Amanda::Changer->new("disk-changer");
 
     my $steps = define_steps
-       cb_ref => \$finished_cb;
+       cb_ref => \$finished_cb,
+       finalize => sub { $scan->quit() };
 
     step start => sub {
-       my $interactive = Amanda::Interactive::Installcheck->new();
+       my $interactivity = Amanda::Interactivity::Installcheck->new();
        $scan = Amanda::Recovery::Scan->new(chg =>         $chg,
-                                           interactive => $interactive);
+                                           interactivity => $interactivity);
        $scan->{'scan_conf'}->{'poll_delay'} = 10; # 10 ms
 
        $steps->{'find_05'}->();
@@ -460,7 +464,7 @@ sub test_scan_ask_poll {
        (my $err, $res05) = @_;
 
        ok(!$err, "found TESTCONF05 on changer multi");
-       ok($res05, "TESTCONF05 give a reservation after interactive");
+       ok($res05, "TESTCONF05 give a reservation after interactivity");
        is($res05->{'chg'}->{'chg_name'}, $chg_name,
           "found TESTCONF05 on correct changer: $chg_name");
 
index af0ed86a6b1968fd7fb40c49dc8186a2d873fe0b..02e6fb465af8930ccb6ebb0018a7aca9d7bfd48d 100644 (file)
@@ -16,7 +16,7 @@
 # Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300
 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
 
-use Test::More tests => 24;
+use Test::More tests => 26;
 use strict;
 use warnings;
 
@@ -25,6 +25,7 @@ use Installcheck::Config;
 use Amanda::Tapelist;
 use Amanda::Config qw( :init :getconf config_dir_relative );
 use POSIX ":sys_wait_h";
+use Data::Dumper;
 
 # put the debug messages somewhere
 Amanda::Debug::dbopen("installcheck");
@@ -62,9 +63,9 @@ sub readtapelist {
 }
 
 @lines = (
-    "20071111010002 TESTCONF004 reuse\n",
+    "20071111010002 TESTCONF004 reuse META:META1\n",
     "20071110010002 TESTCONF003 reuse BARCODE:BAR-003\n",
-    "20071109010002 TESTCONF002 reuse BARCODE:BAR-002 #comment 2\n",
+    "20071109010002 TESTCONF002 reuse BARCODE:BAR-002 META:META2 #comment 2\n",
     "20071108010001 TESTCONF001 no-reuse #comment 1\n",
 );
 mktapelist($tapelist, @lines);
@@ -75,13 +76,17 @@ $tl_ok = is_deeply($tl,     {
  lockname => $tapelist . ".lock",
  tles => [
   { 'datestamp' => '20071111010002', 'label' => 'TESTCONF004',
-    'reuse' => 1, 'position' => 1, 'barcode' => undef, 'comment' => undef },
+    'reuse' => 1, 'position' => 1,
+    'barcode' => undef, 'meta' => 'META1', 'comment' => undef },
   { 'datestamp' => '20071110010002', 'label' => 'TESTCONF003',
-    'reuse' => 1, 'position' => 2, 'barcode' => 'BAR-003', 'comment' => undef },
+    'reuse' => 1, 'position' => 2,
+    'barcode' => 'BAR-003', 'meta' => undef, 'comment' => undef },
   { 'datestamp' => '20071109010002', 'label' => 'TESTCONF002',
-    'reuse' => 1, 'position' => 3, 'barcode' => 'BAR-002', 'comment' => 'comment 2' },
+    'reuse' => 1, 'position' => 3,
+    'barcode' => 'BAR-002', 'meta' => 'META2', 'comment' => 'comment 2' },
   { 'datestamp' => '20071108010001', 'label' => 'TESTCONF001',
-    'reuse' => '', 'position' => 4, 'barcode' => undef, 'comment' => 'comment 1' },
+    'reuse' => '', 'position' => 4,
+    'barcode' => undef, 'meta' => undef, 'comment' => 'comment 1' },
 ] }, "A simple tapelist is parsed correctly");
 
 SKIP: {
@@ -95,7 +100,8 @@ SKIP: {
 
     is_deeply($tl->lookup_tapelabel('TESTCONF002'),
        { 'datestamp' => '20071109010002', 'label' => 'TESTCONF002',
-         'reuse' => 1, 'position' => 3, 'barcode' => 'BAR-002', 'comment' => 'comment 2' },
+         'reuse' => 1, 'position' => 3,
+         'barcode' => 'BAR-002', 'meta' => 'META2', 'comment' => 'comment 2' },
        "lookup_tapelabel works");
 
     is_deeply($tl->lookup_tapelabel('TESTCONF009'), undef,
@@ -103,7 +109,8 @@ SKIP: {
 
     is_deeply($tl->lookup_tapepos(4),
        { 'datestamp' => '20071108010001', 'label' => 'TESTCONF001',
-         'reuse' => '', 'position' => 4, 'barcode' => undef, 'comment' => 'comment 1' },
+         'reuse' => '', 'position' => 4,
+         'barcode' => undef, 'meta' => undef, 'comment' => 'comment 1' },
        "lookup_tapepos works");
 
     is_deeply($tl->lookup_tapepos(9), undef,
@@ -111,29 +118,33 @@ SKIP: {
 
     is_deeply($tl->lookup_tapedate('20071110010002'),
        { 'datestamp' => '20071110010002', 'label' => 'TESTCONF003',
-         'reuse' => 1, 'position' => 2, 'barcode' => 'BAR-003', 'comment' => undef },
+         'reuse' => 1, 'position' => 2,
+         'barcode' => 'BAR-003', 'meta' => undef, 'comment' => undef },
        "lookup_tapedate works");
 
     is_deeply($tl->lookup_tapedate('12345678'), undef,
        "lookup_tapedate returns undef on an unknown datestamp");
 
     # try some edits
-    $tl->add_tapelabel("20080112010203", "TESTCONF007", "seven", 1, undef, 'BAR-007');
+    $tl->add_tapelabel("20080112010203", "TESTCONF007", "seven", 1, 'META3', 'BAR-007');
     is(scalar @{$tl->{'tles'}}, 5, "add_tapelabel adds a new element to the tapelist");
 
     is_deeply($tl->lookup_tapepos(1),
        { 'datestamp' => '20080112010203', 'label' => 'TESTCONF007',
-         'reuse' => 1, 'position' => 1, 'barcode' => 'BAR-007', 'comment' => 'seven' },
+         'reuse' => 1, 'position' => 1,
+         'barcode' => 'BAR-007', 'meta' => 'META3', 'comment' => 'seven' },
        ".. lookup_tapepos finds it at the beginning");
 
     is_deeply($tl->lookup_tapelabel("TESTCONF007"),
        { 'datestamp' => '20080112010203', 'label' => 'TESTCONF007',
-         'reuse' => 1, 'position' => 1, 'barcode' => 'BAR-007', 'comment' => 'seven' },
+         'reuse' => 1, 'position' => 1,
+         'barcode' => 'BAR-007', 'meta' => 'META3' , 'comment' => 'seven' },
        ".. lookup_tapelabel finds it");
 
     is_deeply($tl->lookup_tapedate("20080112010203"),
        { 'datestamp' => '20080112010203', 'label' => 'TESTCONF007',
-         'reuse' => 1, 'position' => 1, 'barcode' => 'BAR-007', 'comment' => 'seven' },
+         'reuse' => 1, 'position' => 1,
+         'barcode' => 'BAR-007', 'meta' => 'META3', 'comment' => 'seven' },
        ".. lookup_tapedate finds it");
 
     # try some edits
@@ -142,7 +153,8 @@ SKIP: {
 
     is_deeply($tl->lookup_tapelabel("TESTCONF008"),
        { 'datestamp' => '20080112010204', 'label' => 'TESTCONF008',
-         'reuse' => 0, 'position' => 1, 'barcode' => undef, 'comment' => 'eight' },
+         'reuse' => 0, 'position' => 1,
+          'barcode' => undef, 'meta' => undef, 'comment' => 'eight' },
        ".. lookup_tapelabel finds it no-reuse");
 
     $tl->remove_tapelabel("TESTCONF008");
@@ -153,7 +165,8 @@ SKIP: {
 
     is_deeply($tl->lookup_tapepos(4), # used to be in position 5
        { 'datestamp' => '20071108010001', 'label' => 'TESTCONF001',
-         'reuse' => '', 'position' => 4, 'barcode' => undef, 'comment' => 'comment 1' },
+         'reuse' => '', 'position' => 4,
+         'barcode' => undef, 'meta' => undef, 'comment' => 'comment 1' },
        ".. tape positions are adjusted correctly");
 
     is_deeply($tl->lookup_tapelabel("TESTCONF002"), undef,
@@ -162,6 +175,21 @@ SKIP: {
     is_deeply($tl->lookup_tapedate("20071109010002"), undef,
        ".. lookup_tapedate no longer finds it");
 
+    # insert in the middle of the list.
+    $tl->add_tapelabel("20071109010204", "TESTCONF009", "nine", 1);
+
+    is_deeply($tl->lookup_tapepos(4),
+       { 'datestamp' => '20071109010204', 'label' => 'TESTCONF009',
+         'reuse' => '1', 'position' => 4,
+         'barcode' => undef, 'meta' => undef, 'comment' => 'nine' },
+       ".. tape positions are adjusted correctly");
+
+    is_deeply($tl->lookup_tapelabel('TESTCONF009'),
+       { 'datestamp' => '20071109010204', 'label' => 'TESTCONF009',
+         'reuse' => '1', 'position' => 4,
+         'barcode' => undef, 'meta' => undef, 'comment' => 'nine' },
+       ".. tape positions are adjusted correctly");
+
     ## set tapecycle to 0 to perform the next couple tests
     config_uninit();
     my $cor = new_config_overrides(1);
@@ -194,7 +222,8 @@ is_deeply($tl, {
   lockname => $tapelist . ".lock",
   tles => [
   { 'datestamp' => '2006123456', 'label' => 'FOO',
-    'reuse' => 1, 'position' => 1, 'barcode' => undef, 'comment' => undef },
+    'reuse' => 1, 'position' => 1,
+    'barcode' => undef, 'meta' => undef, 'comment' => undef },
 ] }, "Invalid lines are ignored");
 
 # make sure clear_tapelist is empty
@@ -209,6 +238,7 @@ is_deeply($tl, {
   lockname => $tapelist . ".lock",
   tles => [
   { 'datestamp' => '2006123456', 'label' => 'FOO',
-    'reuse' => 1, 'position' => 1, 'barcode' => undef, 'comment' => undef },
+    'reuse' => 1, 'position' => 1,
+    'barcode' => undef, 'meta' => undef, 'comment' => undef },
 ] }, "reload works");
 
index 92550f100e47922e51f3e70d9580c37665c877da..a2d96093d7a24f264e7fb4a496dc90a0ac2301c2 100644 (file)
@@ -38,10 +38,11 @@ Installcheck::log_test_output();
 # and disable Debug's die() and warn() overrides
 Amanda::Debug::disable_die_override();
 
-my $tapelist = "$Installcheck::TMP/tapelist";
+my $tapelist_filename = "$Installcheck::TMP/tapelist";
+my $tapelist = Amanda::Tapelist->new($tapelist_filename);
 sub set_tapelist {
     my ($content) = @_;
-    open(my $fh, ">", $tapelist) or die("opening '$tapelist': $!");
+    open(my $fh, ">", $tapelist_filename) or die("opening '$tapelist_filename': $!");
     print $fh $content;
     close($fh);
 }
@@ -51,8 +52,8 @@ sub set_tapelist {
 # methods are never invoked in this test.
 my $taperscan = Amanda::Taper::Scan->new(
     algorithm => "traditional",
-    changer => {}, # (not used)
-    tapelist_filename => $tapelist,
+    changer => undef, # (not used)
+    tapelist => $tapelist,
     tapecycle => 1, # will be changed periodically below
     labelstr => "TEST-[0-9]",
     autolabel => { 'template'    => "TEST-%",
@@ -140,3 +141,5 @@ ok(!$taperscan->is_reusable_volume(label => "TEST-2", new_label_ok => 0), " TEST
 ok(!$taperscan->is_reusable_volume(label => "TEST-3", new_label_ok => 0), " TEST-3 not reusable");
 ok(!$taperscan->is_reusable_volume(label => "TEST-4", new_label_ok => 0), " TEST-4 not reusable");
 
+$taperscan->quit();
+
diff --git a/installcheck/Amanda_Taper_Scan_lexical.pl b/installcheck/Amanda_Taper_Scan_lexical.pl
new file mode 100644 (file)
index 0000000..f6200f3
--- /dev/null
@@ -0,0 +1,545 @@
+# Copyright (c) 2010 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, 465 S. Mathilda Ave., Suite 300
+# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
+
+use Test::More tests => 27;
+use File::Path;
+use Data::Dumper;
+use strict;
+use warnings;
+
+use lib "@amperldir@";
+use Installcheck;
+use Installcheck::Config;
+use Installcheck::Changer;
+use Amanda::Device qw( :constants );
+use Amanda::Debug;
+use Amanda::MainLoop;
+use Amanda::Config qw( :init :getconf config_dir_relative );
+use Amanda::Changer;
+use Amanda::Taper::Scan;
+
+# set up debugging so debug output doesn't interfere with test results
+Amanda::Debug::dbopen("installcheck");
+Installcheck::log_test_output();
+
+# and disable Debug's die() and warn() overrides
+Amanda::Debug::disable_die_override();
+
+my $taperoot = "$Installcheck::TMP/Amanda_Taper_Scan_lexical";
+my $tapelist_filename = "$Installcheck::TMP/tapelist";
+`cat /dev/null > $Installcheck::TMP/tapelist`;
+my $tapelist = Amanda::Tapelist->new($tapelist_filename);
+
+# vtape support
+my %slot_label;
+
+sub reset_taperoot {
+    my ($nslots) = @_;
+
+    if (-d $taperoot) {
+       rmtree($taperoot);
+    }
+    mkpath($taperoot);
+
+    for my $slot (1 .. $nslots) {
+       mkdir("$taperoot/slot$slot")
+           or die("Could not mkdir: $!");
+    }
+
+    # clear out the tapefile
+    open(my $fh, ">", $tapelist_filename) or die("opening tapelist_filename: $!");
+    %slot_label = ();
+}
+
+sub label_slot {
+    my ($slot, $label, $stamp, $reuse, $update_tapelist) = @_;
+
+    my $drivedir = "$taperoot/tmp";
+    -d $drivedir and rmtree($drivedir);
+    mkpath($drivedir);
+    symlink("$taperoot/slot$slot", "$drivedir/data");
+
+    my $dev = Amanda::Device->new("file:$drivedir");
+    die $dev->error_or_status() unless $dev->status == $DEVICE_STATUS_SUCCESS;
+
+    if (defined $label){
+       if (!$dev->start($ACCESS_WRITE, $label, $stamp)) {
+           die $dev->error_or_status();
+       }
+    } else {
+       $dev->erase();
+    }
+
+    rmtree($drivedir);
+
+    if ($update_tapelist) {
+       if (exists $slot_label{$slot}) {
+           $tapelist->remove_tapelabel($slot_label{$slot});
+           delete $slot_label{$slot};
+       }
+       # tapelist uses '0' for new tapes; devices use 'X'..
+       $stamp = '0' if ($stamp eq 'X');
+       $reuse = $reuse ne 'no-reuse';
+       $tapelist->remove_tapelabel($label);
+       $tapelist->add_tapelabel($stamp, $label, "", $reuse);
+       $tapelist->write();
+       $slot_label{$slot} = $label;
+       #open(my $fh, ">>", $tapelist_filename) or die("opening tapelist_filename: $!");
+       #print $fh "$stamp $label $reuse\n";
+       #close($fh);
+    }
+}
+
+# run the mainloop around a scan
+sub run_scan {
+    my ($ts) = @_;
+    my ($error, $res, $label, $mode);
+
+    my $result_cb = make_cb(result_cb => sub {
+       ($error, $res, $label, $mode) = @_;
+
+       $error = "$error" if defined $error;
+       if ($res) {
+           $res->release(finished_cb => sub {
+               Amanda::MainLoop::quit();
+           });
+       } else {
+           Amanda::MainLoop::quit();
+       }
+    });
+
+    $ts->scan(result_cb => $result_cb);
+    Amanda::MainLoop::run();
+    return $error, $label, $mode;
+}
+
+# set the current slot on the changer
+sub set_current_slot {
+    my ($slot) = @_;
+
+    unlink("$taperoot/data");
+    symlink("slot$slot", "$taperoot/data");
+}
+
+# set up and load a config
+my $testconf = Installcheck::Config->new();
+$testconf->add_param("tapelist", "\"$tapelist\"");
+$testconf->add_param("labelstr", "\"TEST-[0-9]+\"");
+$testconf->write();
+my $cfg_result = config_init($CONFIG_INIT_EXPLICIT_NAME, 'TESTCONF');
+if ($cfg_result != $CFGERR_OK) {
+    my ($level, @errors) = Amanda::Config::config_errors();
+    die(join "\n", @errors);
+}
+
+reset_taperoot(6);
+$tapelist->clear_tapelist();
+$tapelist->write();
+label_slot(1, "TEST-10", "20090424173011", "reuse", 1);
+label_slot(2, "TEST-20", "20090424173022", "reuse", 1);
+label_slot(3, "TEST-30", "20090424173033", "reuse", 1);
+
+my $chg;
+my $taperscan;
+my @results;
+
+# set up a lexical taperscan
+$chg = Amanda::Changer->new("chg-disk:$taperoot", tapelist => $tapelist);
+$taperscan = Amanda::Taper::Scan->new(
+    tapelist  => $tapelist,
+    algorithm => "lexical",
+    tapecycle => 4,
+    changer => $chg);
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ "No acceptable volumes found", undef, undef ],
+         "no reusable tapes -> error")
+         or diag(Dumper(\@results));
+$taperscan->quit();
+
+$chg = Amanda::Changer->new("chg-disk:$taperoot", tapelist => $tapelist);
+$taperscan = Amanda::Taper::Scan->new(
+    tapelist  => $tapelist,
+    algorithm => "lexical",
+    tapecycle => 3,
+    changer => $chg);
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-10", $ACCESS_WRITE ],
+         "finds the best reusable tape")
+         or diag(Dumper(\@results));
+$taperscan->quit();
+
+$chg = Amanda::Changer->new("chg-disk:$taperoot", tapelist => $tapelist);
+set_current_slot(2);
+$taperscan = Amanda::Taper::Scan->new(
+    tapelist  => $tapelist,
+    algorithm => "lexical",
+    tapecycle => 1,
+    changer => $chg);
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-10", $ACCESS_WRITE ],
+         "finds the first reusable tape")
+         or diag(Dumper(\@results));
+$taperscan->quit();
+
+label_slot(4, "TEST-40", "20090424173030", "reuse", 1);
+$chg = Amanda::Changer->new("chg-disk:$taperoot", tapelist => $tapelist);
+$taperscan = Amanda::Taper::Scan->new(
+    tapelist  => $tapelist,
+    algorithm => "lexical",
+    tapecycle => 1,
+    changer => $chg);
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-40", $ACCESS_WRITE ],
+         "finds the first reusable tape")
+         or diag(Dumper(\@results));
+$taperscan->quit();
+
+label_slot(4, "TEST-40", "X", "reuse", 1);
+label_slot(5, "TEST-35", "X", "reuse", 1);
+$chg = Amanda::Changer->new("chg-disk:$taperoot", tapelist => $tapelist);
+$taperscan = Amanda::Taper::Scan->new(
+    tapelist  => $tapelist,
+    algorithm => "lexical",
+    tapecycle => 2,
+    changer => $chg);
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-35", $ACCESS_WRITE ],
+         "finds the first reusable tape")
+         or diag(Dumper(\@results));
+$taperscan->quit();
+
+$chg = Amanda::Changer->new("chg-disk:$taperoot",
+                       tapelist => $tapelist,
+                       autolabel => { 'template'     => "TEST-%0",
+                                      'empty'        => 1,
+                                      'volume_error' => 1});
+$taperscan = Amanda::Taper::Scan->new(
+    tapelist  => $tapelist,
+    algorithm => "lexical",
+    tapecycle => 2,
+    changer => $chg);
+$taperscan->{'scan_conf'}->{'new_labeled'} = 'order';
+$taperscan->{'scan_conf'}->{'new_volume'} = 'soon';
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-50", $ACCESS_WRITE ],
+         "labels new tapes in blank slots")
+         or diag(Dumper(\@results));
+$taperscan->quit();
+
+$chg = Amanda::Changer->new("chg-disk:$taperoot",
+                       tapelist => $tapelist);
+$taperscan->{'scan_conf'}->{'new_labeled'} = 'order';
+$taperscan->{'scan_conf'}->{'new_volume'} = 'soon';
+# simulate "amlabel"
+label_slot(1, "TEST-60", "X", "reuse", 1);
+$taperscan = Amanda::Taper::Scan->new(
+    tapelist  => $tapelist,
+    algorithm => "lexical",
+    tapecycle => 2,
+    changer => $chg);
+set_current_slot(2);
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-35", $ACCESS_WRITE ],
+         "scans for volumes, even with a newly labeled volume available")
+         or diag(Dumper(\@results));
+$taperscan->quit();
+
+# test new_labeled with autolabel
+reset_taperoot(5);
+$tapelist->clear_tapelist();
+$tapelist->write();
+label_slot(1, "TEST-10", "20090424173011", "reuse", 1);
+label_slot(2, "TEST-20", "20090424173033", "reuse", 1);
+label_slot(4, "TEST-30", "20090424173022", "reuse", 1);
+label_slot(3, "TEST-15", "X", "reuse", 1);
+label_slot(5, "TEST-25", "X", "reuse", 1);
+set_current_slot(2);
+
+$chg = Amanda::Changer->new("chg-disk:$taperoot", tapelist => $tapelist,
+                            autolabel => { 'template'     => "TEST-%0",
+                                           'empty'        => 1,
+                                           'volume_error' => 1});
+set_current_slot(1);
+
+$taperscan = Amanda::Taper::Scan->new(
+    tapelist  => $tapelist,
+    algorithm => "lexical",
+    tapecycle => 1,
+    changer => $chg);
+$taperscan->{'scan_conf'}->{'new_labeled'} = 'soon';
+$taperscan->{'scan_conf'}->{'new_volume'} = 'soon';
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-25", $ACCESS_WRITE ],
+         "autolabel soon")
+         or diag(Dumper(\@results));
+
+$taperscan->{'scan_conf'}->{'new_labeled'} = 'order';
+$taperscan->{'scan_conf'}->{'new_volume'} = 'order';
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-25", $ACCESS_WRITE ],
+         "autolabel order")
+         or diag(Dumper(\@results));
+
+$taperscan->{'scan_conf'}->{'new_labeled'} = 'last';
+$taperscan->{'scan_conf'}->{'new_volume'} = 'last';
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-30", $ACCESS_WRITE ],
+         "autolabel last")
+         or diag(Dumper(\@results));
+$taperscan->quit();
+
+# test new_labeled with autolabel
+reset_taperoot(5);
+$tapelist->clear_tapelist();
+$tapelist->write();
+label_slot(1, "TEST-10", "20090424173011", "reuse", 1);
+label_slot(2, "TEST-20", "20090424173033", "reuse", 1);
+label_slot(4, "TEST-30", "20090424173022", "reuse", 1);
+label_slot(3, "TEST-15", "X", "reuse", 1);
+set_current_slot(2);
+
+$chg = Amanda::Changer->new("chg-disk:$taperoot", tapelist => $tapelist,
+                            autolabel => { 'template'     => "TEST-%0",
+                                           'empty'        => 1,
+                                           'volume_error' => 1});
+set_current_slot(1);
+
+$taperscan = Amanda::Taper::Scan->new(
+    tapelist  => $tapelist,
+    algorithm => "lexical",
+    tapecycle => 1,
+    changer => $chg);
+$taperscan->{'scan_conf'}->{'new_labeled'} = 'soon';
+$taperscan->{'scan_conf'}->{'new_volume'} = 'soon';
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-15", $ACCESS_WRITE ],
+         "autolabel soon")
+         or diag(Dumper(\@results));
+
+$taperscan->{'scan_conf'}->{'new_labeled'} = 'order';
+$taperscan->{'scan_conf'}->{'new_volume'} = 'order';
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-30", $ACCESS_WRITE ],
+         "autolabel order")
+         or diag(Dumper(\@results));
+
+$taperscan->{'scan_conf'}->{'new_labeled'} = 'last';
+$taperscan->{'scan_conf'}->{'new_volume'} = 'last';
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-30", $ACCESS_WRITE ],
+         "autolabel last")
+         or diag(Dumper(\@results));
+
+$taperscan->{'scan_conf'}->{'new_labeled'} = 'last';
+$taperscan->{'scan_conf'}->{'new_volume'} = 'order';
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-30", $ACCESS_WRITE ],
+         "autolabel last")
+         or diag(Dumper(\@results));
+
+$taperscan->{'scan_conf'}->{'new_labeled'} = 'order';
+$taperscan->{'scan_conf'}->{'new_volume'} = 'soon';
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-40", $ACCESS_WRITE ],
+         "autolabel last")
+         or diag(Dumper(\@results));
+$taperscan->quit();
+
+# test new_labeled with autolabel
+reset_taperoot(5);
+$tapelist->clear_tapelist();
+$tapelist->write();
+label_slot(1, "TEST-10", "20090424173011", "reuse", 1);
+label_slot(2, "TEST-20", "20090424173022", "reuse", 1);
+label_slot(4, "TEST-30", "20090424173033", "reuse", 1);
+label_slot(3, "TEST-15", "X", "reuse", 1);
+set_current_slot(2);
+
+$chg = Amanda::Changer->new("chg-disk:$taperoot", tapelist => $tapelist,
+                            autolabel => { 'template'     => "TEST-%0",
+                                           'empty'        => 1,
+                                           'volume_error' => 1});
+set_current_slot(1);
+
+$taperscan = Amanda::Taper::Scan->new(
+    tapelist  => $tapelist,
+    algorithm => "lexical",
+    tapecycle => 1,
+    changer => $chg);
+$taperscan->{'scan_conf'}->{'new_labeled'} = 'soon';
+$taperscan->{'scan_conf'}->{'new_volume'} = 'soon';
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-15", $ACCESS_WRITE ],
+         "autolabel soon")
+         or diag(Dumper(\@results));
+
+$taperscan->{'scan_conf'}->{'new_labeled'} = 'order';
+$taperscan->{'scan_conf'}->{'new_volume'} = 'order';
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-40", $ACCESS_WRITE ],
+         "autolabel order")
+         or diag(Dumper(\@results));
+
+$taperscan->{'scan_conf'}->{'new_labeled'} = 'last';
+$taperscan->{'scan_conf'}->{'new_volume'} = 'last';
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-10", $ACCESS_WRITE ],
+         "autolabel last")
+         or diag(Dumper(\@results));
+
+$taperscan->{'scan_conf'}->{'new_labeled'} = 'last';
+$taperscan->{'scan_conf'}->{'new_volume'} = 'order';
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-40", $ACCESS_WRITE ],
+         "autolabel last")
+         or diag(Dumper(\@results));
+
+$taperscan->{'scan_conf'}->{'new_labeled'} = 'order';
+$taperscan->{'scan_conf'}->{'new_volume'} = 'soon';
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-40", $ACCESS_WRITE ],
+         "autolabel last")
+         or diag(Dumper(\@results));
+$taperscan->quit();
+
+# test new_volume with autolabel
+reset_taperoot(5);
+$tapelist->clear_tapelist();
+$tapelist->write();
+label_slot(1, "TEST-10", "20090424173011", "reuse", 1);
+label_slot(2, "TEST-20", "20090424173033", "reuse", 1);
+label_slot(4, "TEST-30", "20090424173022", "reuse", 1);
+set_current_slot(2);
+
+$chg = Amanda::Changer->new("chg-disk:$taperoot", tapelist => $tapelist,
+                            autolabel => { 'template'     => "TEST-%0",
+                                           'empty'        => 1,
+                                           'volume_error' => 1});
+set_current_slot(1);
+
+$taperscan = Amanda::Taper::Scan->new(
+    tapelist  => $tapelist,
+    algorithm => "lexical",
+    tapecycle => 1,
+    changer => $chg);
+$taperscan->{'scan_conf'}->{'new_labeled'} = 'soon';
+$taperscan->{'scan_conf'}->{'new_volume'} = 'soon';
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-40", $ACCESS_WRITE ],
+         "autolabel soon")
+         or diag(Dumper(\@results));
+
+$taperscan->{'scan_conf'}->{'new_labeled'} = 'order';
+$taperscan->{'scan_conf'}->{'new_volume'} = 'order';
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-30", $ACCESS_WRITE ],
+         "autolabel order")
+         or diag(Dumper(\@results));
+
+$taperscan->{'scan_conf'}->{'new_labeled'} = 'last';
+$taperscan->{'scan_conf'}->{'new_volume'} = 'last';
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-30", $ACCESS_WRITE ],
+         "autolabel last")
+         or diag(Dumper(\@results));
+$taperscan->quit();
+
+$chg = Amanda::Changer->new("chg-disk:$taperoot", tapelist => $tapelist,
+                            autolabel => { 'template'     => "TEST-%0",
+                                           'empty'        => 1,
+                                           'volume_error' => 1});
+$taperscan = Amanda::Taper::Scan->new(
+    tapelist  => $tapelist,
+    algorithm => "lexical",
+    tapecycle => 4,
+    changer => $chg);
+$taperscan->{'scan_conf'}->{'new_labeled'} = 'soon';
+$taperscan->{'scan_conf'}->{'new_volume'} = 'soon';
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-40", $ACCESS_WRITE ],
+         "autolabel soon")
+         or diag(Dumper(\@results));
+
+$taperscan->{'scan_conf'}->{'new_labeled'} = 'order';
+$taperscan->{'scan_conf'}->{'new_volume'} = 'order';
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-40", $ACCESS_WRITE ],
+         "autolabel order")
+         or diag(Dumper(\@results));
+
+$taperscan->{'scan_conf'}->{'new_labeled'} = 'last';
+$taperscan->{'scan_conf'}->{'new_volume'} = 'last';
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-40", $ACCESS_WRITE ],
+         "autolabel last")
+         or diag(Dumper(\@results));
+$taperscan->quit();
+
+# test skipping no-reuse tapes
+reset_taperoot(5);
+$tapelist->clear_tapelist();
+$tapelist->write();
+label_slot(1, "TEST-1", "20090424173001", "no-reuse", 1);
+label_slot(2, "TEST-2", "20090424173002", "reuse", 1);
+label_slot(3, "TEST-3", "20090424173003", "reuse", 1);
+label_slot(4, "TEST-4", "20090424173004", "reuse", 1);
+
+$chg = Amanda::Changer->new("chg-disk:$taperoot", tapelist => $tapelist);
+set_current_slot(1);
+
+$taperscan = Amanda::Taper::Scan->new(
+    tapelist  => $tapelist,
+    algorithm => "lexical",
+    tapecycle => 2,
+    tapecycle => 1,
+    changer => $chg);
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-2", $ACCESS_WRITE ],
+         "skips a no-reuse volume")
+         or diag(Dumper(\@results));
+$taperscan->quit();
+
+rmtree($taperoot);
+unlink($tapelist);
diff --git a/installcheck/Amanda_Taper_Scan_oldest.pl b/installcheck/Amanda_Taper_Scan_oldest.pl
new file mode 100644 (file)
index 0000000..fd218ac
--- /dev/null
@@ -0,0 +1,545 @@
+# Copyright (c) 2010 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, 465 S. Mathilda Ave., Suite 300
+# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
+
+use Test::More tests => 27;
+use File::Path;
+use Data::Dumper;
+use strict;
+use warnings;
+
+use lib "@amperldir@";
+use Installcheck;
+use Installcheck::Config;
+use Installcheck::Changer;
+use Amanda::Device qw( :constants );
+use Amanda::Debug;
+use Amanda::MainLoop;
+use Amanda::Config qw( :init :getconf config_dir_relative );
+use Amanda::Changer;
+use Amanda::Taper::Scan;
+
+# set up debugging so debug output doesn't interfere with test results
+Amanda::Debug::dbopen("installcheck");
+Installcheck::log_test_output();
+
+# and disable Debug's die() and warn() overrides
+Amanda::Debug::disable_die_override();
+
+my $taperoot = "$Installcheck::TMP/Amanda_Taper_Scan_oldest";
+my $tapelist_filename = "$Installcheck::TMP/tapelist";
+`cat /dev/null > $Installcheck::TMP/tapelist`;
+my $tapelist = Amanda::Tapelist->new($tapelist_filename);
+
+# vtape support
+my %slot_label;
+
+sub reset_taperoot {
+    my ($nslots) = @_;
+
+    if (-d $taperoot) {
+       rmtree($taperoot);
+    }
+    mkpath($taperoot);
+
+    for my $slot (1 .. $nslots) {
+       mkdir("$taperoot/slot$slot")
+           or die("Could not mkdir: $!");
+    }
+
+    # clear out the tapefile
+    open(my $fh, ">", $tapelist_filename) or die("opening tapelist_filename: $!");
+    %slot_label = ();
+}
+
+sub label_slot {
+    my ($slot, $label, $stamp, $reuse, $update_tapelist) = @_;
+
+    my $drivedir = "$taperoot/tmp";
+    -d $drivedir and rmtree($drivedir);
+    mkpath($drivedir);
+    symlink("$taperoot/slot$slot", "$drivedir/data");
+
+    my $dev = Amanda::Device->new("file:$drivedir");
+    die $dev->error_or_status() unless $dev->status == $DEVICE_STATUS_SUCCESS;
+
+    if (defined $label){
+       if (!$dev->start($ACCESS_WRITE, $label, $stamp)) {
+           die $dev->error_or_status();
+       }
+    } else {
+       $dev->erase();
+    }
+
+    rmtree($drivedir);
+
+    if ($update_tapelist) {
+       if (exists $slot_label{$slot}) {
+           $tapelist->remove_tapelabel($slot_label{$slot});
+           delete $slot_label{$slot};
+       }
+       # tapelist uses '0' for new tapes; devices use 'X'..
+       $stamp = '0' if ($stamp eq 'X');
+       $reuse = $reuse ne 'no-reuse';
+       $tapelist->remove_tapelabel($label);
+       $tapelist->add_tapelabel($stamp, $label, "", $reuse);
+       $tapelist->write();
+       $slot_label{$slot} = $label;
+       #open(my $fh, ">>", $tapelist_filename) or die("opening tapelist_filename: $!");
+       #print $fh "$stamp $label $reuse\n";
+       #close($fh);
+    }
+}
+
+# run the mainloop around a scan
+sub run_scan {
+    my ($ts) = @_;
+    my ($error, $res, $label, $mode);
+
+    my $result_cb = make_cb(result_cb => sub {
+       ($error, $res, $label, $mode) = @_;
+
+       $error = "$error" if defined $error;
+       if ($res) {
+           $res->release(finished_cb => sub {
+               Amanda::MainLoop::quit();
+           });
+       } else {
+           Amanda::MainLoop::quit();
+       }
+    });
+
+    $ts->scan(result_cb => $result_cb);
+    Amanda::MainLoop::run();
+    return $error, $label, $mode;
+}
+
+# set the current slot on the changer
+sub set_current_slot {
+    my ($slot) = @_;
+
+    unlink("$taperoot/data");
+    symlink("slot$slot", "$taperoot/data");
+}
+
+# set up and load a config
+my $testconf = Installcheck::Config->new();
+$testconf->add_param("tapelist", "\"$tapelist\"");
+$testconf->add_param("labelstr", "\"TEST-[0-9]+\"");
+$testconf->write();
+my $cfg_result = config_init($CONFIG_INIT_EXPLICIT_NAME, 'TESTCONF');
+if ($cfg_result != $CFGERR_OK) {
+    my ($level, @errors) = Amanda::Config::config_errors();
+    die(join "\n", @errors);
+}
+
+reset_taperoot(6);
+$tapelist->clear_tapelist();
+$tapelist->write();
+label_slot(1, "TEST-10", "20090424173011", "reuse", 1);
+label_slot(2, "TEST-20", "20090424173022", "reuse", 1);
+label_slot(3, "TEST-30", "20090424173033", "reuse", 1);
+
+my $chg;
+my $taperscan;
+my @results;
+
+# set up a oldest taperscan
+$chg = Amanda::Changer->new("chg-disk:$taperoot", tapelist => $tapelist);
+$taperscan = Amanda::Taper::Scan->new(
+    tapelist  => $tapelist,
+    algorithm => "oldest",
+    tapecycle => 4,
+    changer => $chg);
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ "No acceptable volumes found", undef, undef ],
+         "no reusable tapes -> error")
+         or diag(Dumper(\@results));
+$taperscan->quit();
+
+$chg = Amanda::Changer->new("chg-disk:$taperoot", tapelist => $tapelist);
+$taperscan = Amanda::Taper::Scan->new(
+    tapelist  => $tapelist,
+    algorithm => "oldest",
+    tapecycle => 3,
+    changer => $chg);
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-10", $ACCESS_WRITE ],
+         "finds the best reusable tape")
+         or diag(Dumper(\@results));
+$taperscan->quit();
+
+$chg = Amanda::Changer->new("chg-disk:$taperoot", tapelist => $tapelist);
+set_current_slot(2);
+$taperscan = Amanda::Taper::Scan->new(
+    tapelist  => $tapelist,
+    algorithm => "oldest",
+    tapecycle => 1,
+    changer => $chg);
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-10", $ACCESS_WRITE ],
+         "finds the first reusable tape")
+         or diag(Dumper(\@results));
+$taperscan->quit();
+
+label_slot(4, "TEST-40", "20090424173030", "reuse", 1);
+$chg = Amanda::Changer->new("chg-disk:$taperoot", tapelist => $tapelist);
+$taperscan = Amanda::Taper::Scan->new(
+    tapelist  => $tapelist,
+    algorithm => "oldest",
+    tapecycle => 1,
+    changer => $chg);
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-10", $ACCESS_WRITE ],
+         "finds the first reusable tape")
+         or diag(Dumper(\@results));
+$taperscan->quit();
+
+label_slot(4, "TEST-40", "X", "reuse", 1);
+label_slot(5, "TEST-35", "X", "reuse", 1);
+$chg = Amanda::Changer->new("chg-disk:$taperoot", tapelist => $tapelist);
+$taperscan = Amanda::Taper::Scan->new(
+    tapelist  => $tapelist,
+    algorithm => "oldest",
+    tapecycle => 2,
+    changer => $chg);
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-35", $ACCESS_WRITE ],
+         "finds the first reusable tape")
+         or diag(Dumper(\@results));
+$taperscan->quit();
+
+$chg = Amanda::Changer->new("chg-disk:$taperoot",
+                       tapelist => $tapelist,
+                       autolabel => { 'template'     => "TEST-%0",
+                                      'empty'        => 1,
+                                      'volume_error' => 1});
+$taperscan = Amanda::Taper::Scan->new(
+    tapelist  => $tapelist,
+    algorithm => "oldest",
+    tapecycle => 2,
+    changer => $chg);
+$taperscan->{'scan_conf'}->{'new_labeled'} = 'order';
+$taperscan->{'scan_conf'}->{'new_volume'} = 'soon';
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-50", $ACCESS_WRITE ],
+         "labels new tapes in blank slots")
+         or diag(Dumper(\@results));
+$taperscan->quit();
+
+$chg = Amanda::Changer->new("chg-disk:$taperoot",
+                       tapelist => $tapelist);
+$taperscan->{'scan_conf'}->{'new_labeled'} = 'order';
+$taperscan->{'scan_conf'}->{'new_volume'} = 'soon';
+# simulate "amlabel"
+label_slot(1, "TEST-60", "X", "reuse", 1);
+$taperscan = Amanda::Taper::Scan->new(
+    tapelist  => $tapelist,
+    algorithm => "oldest",
+    tapecycle => 2,
+    changer => $chg);
+set_current_slot(2);
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-35", $ACCESS_WRITE ],
+         "scans for volumes, even with a newly labeled volume available")
+         or diag(Dumper(\@results));
+$taperscan->quit();
+
+# test new_labeled with autolabel
+reset_taperoot(5);
+$tapelist->clear_tapelist();
+$tapelist->write();
+label_slot(1, "TEST-10", "20090424173011", "reuse", 1);
+label_slot(2, "TEST-20", "20090424173033", "reuse", 1);
+label_slot(4, "TEST-30", "20090424173022", "reuse", 1);
+label_slot(3, "TEST-15", "X", "reuse", 1);
+label_slot(5, "TEST-25", "X", "reuse", 1);
+set_current_slot(2);
+
+$chg = Amanda::Changer->new("chg-disk:$taperoot", tapelist => $tapelist,
+                            autolabel => { 'template'     => "TEST-%0",
+                                           'empty'        => 1,
+                                           'volume_error' => 1});
+set_current_slot(1);
+
+$taperscan = Amanda::Taper::Scan->new(
+    tapelist  => $tapelist,
+    algorithm => "oldest",
+    tapecycle => 1,
+    changer => $chg);
+$taperscan->{'scan_conf'}->{'new_labeled'} = 'soon';
+$taperscan->{'scan_conf'}->{'new_volume'} = 'soon';
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-25", $ACCESS_WRITE ],
+         "autolabel soon")
+         or diag(Dumper(\@results));
+
+$taperscan->{'scan_conf'}->{'new_labeled'} = 'order';
+$taperscan->{'scan_conf'}->{'new_volume'} = 'order';
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-25", $ACCESS_WRITE ],
+         "autolabel order")
+         or diag(Dumper(\@results));
+
+$taperscan->{'scan_conf'}->{'new_labeled'} = 'last';
+$taperscan->{'scan_conf'}->{'new_volume'} = 'last';
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-10", $ACCESS_WRITE ],
+         "autolabel last")
+         or diag(Dumper(\@results));
+$taperscan->quit();
+
+# test new_labeled with autolabel
+reset_taperoot(5);
+$tapelist->clear_tapelist();
+$tapelist->write();
+label_slot(1, "TEST-10", "20090424173011", "reuse", 1);
+label_slot(2, "TEST-20", "20090424173033", "reuse", 1);
+label_slot(4, "TEST-30", "20090424173022", "reuse", 1);
+label_slot(3, "TEST-15", "X", "reuse", 1);
+set_current_slot(2);
+
+$chg = Amanda::Changer->new("chg-disk:$taperoot", tapelist => $tapelist,
+                            autolabel => { 'template'     => "TEST-%0",
+                                           'empty'        => 1,
+                                           'volume_error' => 1});
+set_current_slot(1);
+
+$taperscan = Amanda::Taper::Scan->new(
+    tapelist  => $tapelist,
+    algorithm => "oldest",
+    tapecycle => 1,
+    changer => $chg);
+$taperscan->{'scan_conf'}->{'new_labeled'} = 'soon';
+$taperscan->{'scan_conf'}->{'new_volume'} = 'soon';
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-15", $ACCESS_WRITE ],
+         "autolabel soon")
+         or diag(Dumper(\@results));
+
+$taperscan->{'scan_conf'}->{'new_labeled'} = 'order';
+$taperscan->{'scan_conf'}->{'new_volume'} = 'order';
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-40", $ACCESS_WRITE ],
+         "autolabel order")
+         or diag(Dumper(\@results));
+
+$taperscan->{'scan_conf'}->{'new_labeled'} = 'last';
+$taperscan->{'scan_conf'}->{'new_volume'} = 'last';
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-10", $ACCESS_WRITE ],
+         "autolabel last")
+         or diag(Dumper(\@results));
+
+$taperscan->{'scan_conf'}->{'new_labeled'} = 'last';
+$taperscan->{'scan_conf'}->{'new_volume'} = 'order';
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-40", $ACCESS_WRITE ],
+         "autolabel last")
+         or diag(Dumper(\@results));
+
+$taperscan->{'scan_conf'}->{'new_labeled'} = 'order';
+$taperscan->{'scan_conf'}->{'new_volume'} = 'soon';
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-40", $ACCESS_WRITE ],
+         "autolabel last")
+         or diag(Dumper(\@results));
+$taperscan->quit();
+
+# test new_labeled with autolabel
+reset_taperoot(5);
+$tapelist->clear_tapelist();
+$tapelist->write();
+label_slot(1, "TEST-10", "20090424173011", "reuse", 1);
+label_slot(2, "TEST-20", "20090424173022", "reuse", 1);
+label_slot(4, "TEST-30", "20090424173033", "reuse", 1);
+label_slot(3, "TEST-15", "X", "reuse", 1);
+set_current_slot(2);
+
+$chg = Amanda::Changer->new("chg-disk:$taperoot", tapelist => $tapelist,
+                            autolabel => { 'template'     => "TEST-%0",
+                                           'empty'        => 1,
+                                           'volume_error' => 1});
+set_current_slot(1);
+
+$taperscan = Amanda::Taper::Scan->new(
+    tapelist  => $tapelist,
+    algorithm => "oldest",
+    tapecycle => 1,
+    changer => $chg);
+$taperscan->{'scan_conf'}->{'new_labeled'} = 'soon';
+$taperscan->{'scan_conf'}->{'new_volume'} = 'soon';
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-15", $ACCESS_WRITE ],
+         "autolabel soon")
+         or diag(Dumper(\@results));
+
+$taperscan->{'scan_conf'}->{'new_labeled'} = 'order';
+$taperscan->{'scan_conf'}->{'new_volume'} = 'order';
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-40", $ACCESS_WRITE ],
+         "autolabel order")
+         or diag(Dumper(\@results));
+
+$taperscan->{'scan_conf'}->{'new_labeled'} = 'last';
+$taperscan->{'scan_conf'}->{'new_volume'} = 'last';
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-10", $ACCESS_WRITE ],
+         "autolabel last")
+         or diag(Dumper(\@results));
+
+$taperscan->{'scan_conf'}->{'new_labeled'} = 'last';
+$taperscan->{'scan_conf'}->{'new_volume'} = 'order';
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-40", $ACCESS_WRITE ],
+         "autolabel last")
+         or diag(Dumper(\@results));
+
+$taperscan->{'scan_conf'}->{'new_labeled'} = 'order';
+$taperscan->{'scan_conf'}->{'new_volume'} = 'soon';
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-40", $ACCESS_WRITE ],
+         "autolabel last")
+         or diag(Dumper(\@results));
+$taperscan->quit();
+
+# test new_volume with autolabel
+reset_taperoot(5);
+$tapelist->clear_tapelist();
+$tapelist->write();
+label_slot(1, "TEST-10", "20090424173011", "reuse", 1);
+label_slot(2, "TEST-20", "20090424173033", "reuse", 1);
+label_slot(4, "TEST-30", "20090424173022", "reuse", 1);
+set_current_slot(2);
+
+$chg = Amanda::Changer->new("chg-disk:$taperoot", tapelist => $tapelist,
+                            autolabel => { 'template'     => "TEST-%0",
+                                           'empty'        => 1,
+                                           'volume_error' => 1});
+set_current_slot(1);
+
+$taperscan = Amanda::Taper::Scan->new(
+    tapelist  => $tapelist,
+    algorithm => "oldest",
+    tapecycle => 1,
+    changer => $chg);
+$taperscan->{'scan_conf'}->{'new_labeled'} = 'soon';
+$taperscan->{'scan_conf'}->{'new_volume'} = 'soon';
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-40", $ACCESS_WRITE ],
+         "autolabel soon")
+         or diag(Dumper(\@results));
+
+$taperscan->{'scan_conf'}->{'new_labeled'} = 'order';
+$taperscan->{'scan_conf'}->{'new_volume'} = 'order';
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-40", $ACCESS_WRITE ],
+         "autolabel order")
+         or diag(Dumper(\@results));
+
+$taperscan->{'scan_conf'}->{'new_labeled'} = 'last';
+$taperscan->{'scan_conf'}->{'new_volume'} = 'last';
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-10", $ACCESS_WRITE ],
+         "autolabel last")
+         or diag(Dumper(\@results));
+$taperscan->quit();
+
+$chg = Amanda::Changer->new("chg-disk:$taperoot", tapelist => $tapelist,
+                            autolabel => { 'template'     => "TEST-%0",
+                                           'empty'        => 1,
+                                           'volume_error' => 1});
+$taperscan = Amanda::Taper::Scan->new(
+    tapelist  => $tapelist,
+    algorithm => "oldest",
+    tapecycle => 4,
+    changer => $chg);
+$taperscan->{'scan_conf'}->{'new_labeled'} = 'soon';
+$taperscan->{'scan_conf'}->{'new_volume'} = 'soon';
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-40", $ACCESS_WRITE ],
+         "autolabel soon")
+         or diag(Dumper(\@results));
+
+$taperscan->{'scan_conf'}->{'new_labeled'} = 'order';
+$taperscan->{'scan_conf'}->{'new_volume'} = 'order';
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-40", $ACCESS_WRITE ],
+         "autolabel order")
+         or diag(Dumper(\@results));
+
+$taperscan->{'scan_conf'}->{'new_labeled'} = 'last';
+$taperscan->{'scan_conf'}->{'new_volume'} = 'last';
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-40", $ACCESS_WRITE ],
+         "autolabel last")
+         or diag(Dumper(\@results));
+$taperscan->quit();
+
+# test skipping no-reuse tapes
+reset_taperoot(5);
+$tapelist->clear_tapelist();
+$tapelist->write();
+label_slot(1, "TEST-1", "20090424173001", "no-reuse", 1);
+label_slot(2, "TEST-2", "20090424173002", "reuse", 1);
+label_slot(3, "TEST-3", "20090424173003", "reuse", 1);
+label_slot(4, "TEST-4", "20090424173004", "reuse", 1);
+
+$chg = Amanda::Changer->new("chg-disk:$taperoot", tapelist => $tapelist);
+set_current_slot(1);
+
+$taperscan = Amanda::Taper::Scan->new(
+    tapelist  => $tapelist,
+    algorithm => "oldest",
+    tapecycle => 2,
+    tapecycle => 1,
+    changer => $chg);
+@results = run_scan($taperscan);
+is_deeply([ @results ],
+         [ undef, "TEST-2", $ACCESS_WRITE ],
+         "skips a no-reuse volume")
+         or diag(Dumper(\@results));
+$taperscan->quit();
+
+rmtree($taperoot);
+unlink($tapelist);
index 8083eee9cab84b54e9ec6454e6030e6dc86e8c95..97f3595f622ccf917dcee316111a0bf522fff487 100644 (file)
@@ -41,7 +41,8 @@ Installcheck::log_test_output();
 Amanda::Debug::disable_die_override();
 
 my $taperoot = "$Installcheck::TMP/Amanda_Taper_Scan_traditional";
-my $tapelist = "$Installcheck::TMP/tapelist";
+my $tapelist_filename = "$Installcheck::TMP/tapelist";
+my $tapelist = Amanda::Tapelist->new($tapelist_filename);
 
 # vtape support
 
@@ -59,7 +60,7 @@ sub reset_taperoot {
     }
 
     # clear out the tapefile
-    open(my $fh, ">", $tapelist) or die("opening tapelist: $!");
+    open(my $fh, ">", $tapelist_filename) or die("opening tapelist_filename: $!");
 }
 
 sub label_slot {
@@ -86,7 +87,7 @@ sub label_slot {
     if ($update_tapelist) {
        # tapelist uses '0' for new tapes; devices use 'X'..
        $stamp = '0' if ($stamp eq 'X');
-       open(my $fh, ">>", $tapelist) or die("opening tapelist: $!");
+       open(my $fh, ">>", $tapelist_filename) or die("opening tapelist_filename: $!");
        print $fh "$stamp $label $reuse\n";
        close($fh);
     }
@@ -143,30 +144,37 @@ my $taperscan;
 my @results;
 
 # set up a traditional taperscan
+$chg = Amanda::Changer->new("chg-disk:$taperoot", tapelist => $tapelist);
 $taperscan = Amanda::Taper::Scan->new(
+    tapelist  => $tapelist,
     algorithm => "traditional",
     tapecycle => 4,
-    changer => Amanda::Changer->new("chg-disk:$taperoot"));
+    changer => $chg);
 @results = run_scan($taperscan);
 is_deeply([ @results ],
          [ "No acceptable volumes found", undef, undef ],
          "no reusable tapes -> error")
          or diag(Dumper(\@results));
+$taperscan->quit();
 
+$chg = Amanda::Changer->new("chg-disk:$taperoot", tapelist => $tapelist);
 $taperscan = Amanda::Taper::Scan->new(
+    tapelist  => $tapelist,
     algorithm => "traditional",
     tapecycle => 3,
-    changer => Amanda::Changer->new("chg-disk:$taperoot"));
+    changer => $chg);
 @results = run_scan($taperscan);
 is_deeply([ @results ],
          [ undef, "TEST-1", $ACCESS_WRITE ],
          "finds the best reusable tape")
          or diag(Dumper(\@results));
+$taperscan->quit();
 
-$chg = Amanda::Changer->new("chg-disk:$taperoot");
+$chg = Amanda::Changer->new("chg-disk:$taperoot", tapelist => $tapelist);
 $chg->{'support_fast_search'} = 0; # no fast search -> skip stage 1
 set_current_slot(2); # slot 2 is acceptable, so it should be returned
 $taperscan = Amanda::Taper::Scan->new(
+    tapelist  => $tapelist,
     algorithm => "traditional",
     tapecycle => 1,
     changer => $chg);
@@ -175,64 +183,85 @@ is_deeply([ @results ],
          [ undef, "TEST-2", $ACCESS_WRITE ],
          "finds the first reusable tape when fast_search is false")
          or diag(Dumper(\@results));
+$taperscan->quit();
+
+$chg = Amanda::Changer->new("chg-disk:$taperoot", tapelist => $tapelist);
+$chg->{'support_fast_search'} = 1;
 
 label_slot(1); # remove TEST-1
 label_slot(4, "TEST-4", "20090424183004", "reuse", 1);
 set_current_slot(1);
 $taperscan = Amanda::Taper::Scan->new(
+    tapelist  => $tapelist,
     algorithm => "traditional",
     tapecycle => 2,
-    changer => Amanda::Changer->new("chg-disk:$taperoot"));
+    changer => $chg);
 @results = run_scan($taperscan);
 is_deeply([ @results ],
          [ undef, "TEST-2", $ACCESS_WRITE ],
          "uses the first usable tape it finds when oldest is missing")
          or diag(Dumper(\@results));
+$taperscan->quit();
+
+$chg = Amanda::Changer->new("chg-disk:$taperoot", tapelist => $tapelist);
 
 set_current_slot(3);
 $taperscan = Amanda::Taper::Scan->new(
+    tapelist  => $tapelist,
     algorithm => "traditional",
     tapecycle => 2,
-    changer => Amanda::Changer->new("chg-disk:$taperoot"));
+    changer => $chg);
 @results = run_scan($taperscan);
 is_deeply([ @results ],
          [ undef, "TEST-3", $ACCESS_WRITE ],
          "starts sequential scan at 'current'")
          or diag(Dumper(\@results));
+$taperscan->quit();
 
-set_current_slot(5);
+$chg = Amanda::Changer->new("chg-disk:$taperoot",
+                       tapelist => $tapelist,
+                       autolabel => { 'template'     => "TEST-%",
+                                      'empty'        => 1,
+                                      'volume_error' => 1});
 $taperscan = Amanda::Taper::Scan->new(
+    tapelist  => $tapelist,
     algorithm => "traditional",
     tapecycle => 2,
-    autolabel => { 'template'     => "TEST-%",
-                   'empty'        => 1,
-                   'volume_error' => 1},
-    changer => Amanda::Changer->new("chg-disk:$taperoot"));
+    changer => $chg);
+set_current_slot(5);
 @results = run_scan($taperscan);
 is_deeply([ @results ],
          [ undef, "TEST-5", $ACCESS_WRITE ],
          "labels new tapes in blank slots")
          or diag(Dumper(\@results));
+$taperscan->quit();
 
-set_current_slot(6);
+$chg = Amanda::Changer->new("chg-disk:$taperoot",
+                       tapelist => $tapelist,
+                       autolabel => { });
 $taperscan = Amanda::Taper::Scan->new(
+    tapelist  => $tapelist,
     algorithm => "traditional",
     tapecycle => 1,
-    autolabel => { },
-    changer => Amanda::Changer->new("chg-disk:$taperoot"));
+    changer => $chg);
+set_current_slot(6);
 @results = run_scan($taperscan);
 is_deeply([ @results ],
          [ undef, "TEST-2", $ACCESS_WRITE ],
          "handles an invalid current slot by going to the next")
          or diag(Dumper(\@results));
+$taperscan->quit();
 
+$chg = Amanda::Changer->new("chg-disk:$taperoot",
+                       tapelist => $tapelist);
 # simulate "amlabel"
 label_slot(1, "TEST-6", "X", "reuse", 1);
-set_current_slot(2);
 $taperscan = Amanda::Taper::Scan->new(
+    tapelist  => $tapelist,
     algorithm => "traditional",
     tapecycle => 2,
-    changer => Amanda::Changer->new("chg-disk:$taperoot"));
+    changer => $chg);
+set_current_slot(2);
 @results = run_scan($taperscan);
 is_deeply([ @results ],
          [ undef, "TEST-2", $ACCESS_WRITE ],
@@ -245,17 +274,22 @@ label_slot(1, "TEST-1", "20090424173001", "no-reuse", 1);
 label_slot(2, "TEST-2", "20090424173002", "reuse", 1);
 label_slot(3, "TEST-3", "20090424173003", "reuse", 1);
 label_slot(4, "TEST-4", "20090424173004", "reuse", 1);
+$taperscan->quit();
+
+$chg = Amanda::Changer->new("chg-disk:$taperoot", tapelist => $tapelist);
 set_current_slot(1);
 
 $taperscan = Amanda::Taper::Scan->new(
+    tapelist  => $tapelist,
     algorithm => "traditional",
     tapecycle => 2,
-    changer => Amanda::Changer->new("chg-disk:$taperoot"));
+    changer => $chg);
 @results = run_scan($taperscan);
 is_deeply([ @results ],
          [ undef, "TEST-2", $ACCESS_WRITE ],
          "skips a no-reuse volume")
          or diag(Dumper(\@results));
+$taperscan->quit();
 
 rmtree($taperoot);
 unlink($tapelist);
index 0aeb002014293cca75d8d16a8d911433ccc9601d..607013aee9e7739cf69ba968772586dea0695d1a 100644 (file)
@@ -105,8 +105,7 @@ sub new {
     my $class = shift;
     my %params = @_;
     my @slots = @{ $params{'slots'} || [] };
-    my $chg =  Amanda::Changer->new("chg-disk:$taperoot");
-    die $chg if $chg->isa("Amanda::Changer::Error");
+    my $chg =  $params{'changer'};
 
     # wedge in an extra device property to disable LEOM support, if requested
     if ($params{'disable_leom'}) {
@@ -122,6 +121,10 @@ sub new {
     }, $class;
 }
 
+sub quit {
+    my $self = shift;
+}
+
 sub make_new_tape_label {
     return "FAKELABEL";
 }
@@ -206,6 +209,7 @@ sub scribe_notif_tape_done {
     main::event("scribe_notif_tape_done",
        $params{'volume_label'}, $params{'num_files'},
        $params{'size'});
+    $params{'finished_cb'}->();
 }
 
 
@@ -291,7 +295,8 @@ sub run_devh {
 }
 
 reset_taperoot(1);
-run_devh(3, Mock::Taperscan->new(), Mock::Feedback->new({allow => 1}, {allow => 1}, {allow => 1}));
+my $chg =  Amanda::Changer->new("chg-disk:$taperoot");
+run_devh(3, Mock::Taperscan->new(changer => $chg), Mock::Feedback->new({allow => 1}, {allow => 1}, {allow => 1}));
 is_deeply([ @events ], [
       [ 'start' ],
       [ 'scan' ], # scan starts *before* get_volume
@@ -320,7 +325,7 @@ is_deeply([ @events ], [
     ], "correct event sequence for basic run of DevHandling")
     or diag(Dumper([@events]));
 
-run_devh(1, Mock::Taperscan->new(), Mock::Feedback->new({cause => 'config', message => 'no-can-do'}));
+run_devh(1, Mock::Taperscan->new(changer => $chg), Mock::Feedback->new({cause => 'config', message => 'no-can-do'}));
 is_deeply([ @events ], [
       [ 'start' ],
       [ 'scan' ],
@@ -334,7 +339,7 @@ is_deeply([ @events ], [
     ], "correct event sequence for a run without permission")
     or diag(Dumper([@events]));
 
-run_devh(1, Mock::Taperscan->new(slots => ["bogus"]), Mock::Feedback->new({allow => 1}));
+run_devh(1, Mock::Taperscan->new(slots => ["bogus"], changer => $chg), Mock::Feedback->new({allow => 1}));
 is_deeply([ @events ], [
       [ 'start' ],
       [ 'scan' ],
@@ -348,7 +353,7 @@ is_deeply([ @events ], [
     ], "correct event sequence for a run with a changer error")
     or diag(Dumper([@events]));
 
-run_devh(1, Mock::Taperscan->new(slots => ["bogus"]),
+run_devh(1, Mock::Taperscan->new(slots => ["bogus"], changer => $chg),
            Mock::Feedback->new({cause => 'config', message => "not this time"}));
 is_deeply([ @events ], [
       [ 'start' ],
@@ -363,7 +368,7 @@ is_deeply([ @events ], [
     ], "correct event sequence for a run with no permission AND a changer config denial")
     or diag(Dumper([@events]));
 
-run_devh(1, Mock::Taperscan->new(slots => ["bogus"]), Mock::Feedback->new({cause => 'error', message => "frobnicator exploded!"}));
+run_devh(1, Mock::Taperscan->new(slots => ["bogus"], changer => $chg), Mock::Feedback->new({cause => 'error', message => "frobnicator exploded!"}));
 is_deeply([ @events ], [
       [ 'start' ],
       [ 'scan' ],
@@ -404,6 +409,7 @@ sub run_scribe_xfer_async {
 
        # set up a transfer
        my $xdt = $scribe->get_xfer_dest(
+           allow_split => 1,
            max_memory => 1024 * 64,
            part_size => (defined $params{'part_size'})? $params{'part_size'} : (1024 * 128),
             part_cache_type => $params{'part_cache_type'} || 'memory',
@@ -476,7 +482,7 @@ my $experr;
 
 reset_taperoot(1);
 $main::scribe = Amanda::Taper::Scribe->new(
-    taperscan => Mock::Taperscan->new(disable_leom => 1),
+    taperscan => Mock::Taperscan->new(disable_leom => 1, changer => $chg),
     feedback => Mock::Feedback->new({allow => 1}));
 
 reset_events();
@@ -513,7 +519,7 @@ is_deeply([ @events ], [
 
 reset_taperoot(1);
 $main::scribe = Amanda::Taper::Scribe->new(
-    taperscan => Mock::Taperscan->new(),
+    taperscan => Mock::Taperscan->new(changer => $chg),
     feedback => Mock::Feedback->new({ allow => 1 }));
 
 reset_events();
@@ -544,7 +550,7 @@ is_deeply([ @events ], [
 
 reset_taperoot(2);
 $main::scribe = Amanda::Taper::Scribe->new(
-    taperscan => Mock::Taperscan->new(disable_leom => 1),
+    taperscan => Mock::Taperscan->new(disable_leom => 1, changer => $chg),
     feedback => Mock::Feedback->new({ allow => 1 }, { allow => 1 }));
 
 reset_events();
@@ -577,14 +583,14 @@ is_deeply([ @events ], [
 
       [ 'dump_cb', 'DONE', [], undef, bi(655360) ],
       [ 'scribe_notif_tape_done', 'FAKELABEL', bi(3), bi(262144) ],
-    ], "correct event sequence for a multipart scribe of more than a whole volume, without LEOM")
+    ], "correct event sequence for a multipart scribe of more than a whole volume, without LEOM" . Data::Dumper::Dumper(@events))
     or print (Dumper([@events]));
 
 # same test, but with LEOM support
 
 reset_taperoot(2);
 $main::scribe = Amanda::Taper::Scribe->new(
-    taperscan => Mock::Taperscan->new(),
+    taperscan => Mock::Taperscan->new(changer => $chg),
     feedback => Mock::Feedback->new({ allow => 1 },{ allow => 1 }));
 
 reset_events();
@@ -621,7 +627,7 @@ is_deeply([ @events ], [
 
 reset_taperoot(1);
 $main::scribe = Amanda::Taper::Scribe->new(
-    taperscan => Mock::Taperscan->new(slots => ["1", "bogus"], disable_leom => 1),
+    taperscan => Mock::Taperscan->new(slots => ["1", "bogus"], disable_leom => 1, changer => $chg),
     feedback => Mock::Feedback->new({ allow => 1 },{ allow => 1 }));
 
 reset_events();
@@ -655,7 +661,7 @@ is_deeply([ @events ], [
 
 reset_taperoot(1);
 $main::scribe = Amanda::Taper::Scribe->new(
-    taperscan => Mock::Taperscan->new(slots => ["1", "bogus"]),
+    taperscan => Mock::Taperscan->new(slots => ["1", "bogus"], changer => $chg),
     feedback => Mock::Feedback->new({ allow => 1 }, { allow => 1 }));
 
 reset_events();
@@ -690,7 +696,7 @@ is_deeply([ @events ], [
 
 reset_taperoot(2);
 $main::scribe = Amanda::Taper::Scribe->new(
-    taperscan => Mock::Taperscan->new(),
+    taperscan => Mock::Taperscan->new(changer => $chg),
     feedback => Mock::Feedback->new({ allow => 1 }, { cause => 'config', message => "sorry!" }));
 
 reset_events();
@@ -722,7 +728,7 @@ is_deeply([ @events ], [
 
 reset_taperoot(2);
 $main::scribe = Amanda::Taper::Scribe->new(
-    taperscan => Mock::Taperscan->new(disable_leom => 1),
+    taperscan => Mock::Taperscan->new(disable_leom => 1, changer => $chg),
     feedback => Mock::Feedback->new({ allow => 1 }));
 
 reset_events();
@@ -744,7 +750,7 @@ is_deeply([ @events ], [
 
 reset_taperoot(2);
 $main::scribe = Amanda::Taper::Scribe->new(
-    taperscan => Mock::Taperscan->new(),
+    taperscan => Mock::Taperscan->new(changer => $chg),
     feedback => Mock::Feedback->new({ allow => 1 }));
 $Amanda::Config::debug_taper = 9;
 reset_events();
@@ -772,8 +778,8 @@ my $maxint64 = Math::BigInt->new("9223372036854775808");
 is_deeply(
     { get_splitting_args_from_config(
     ) },
-    { },
-    "default is no params");
+    { allow_split => 0 },
+    "default is only allow_split set to 0");
 
 is_deeply(
     { get_splitting_args_from_config(
@@ -781,7 +787,7 @@ is_deeply(
        dle_split_diskbuffer => $Installcheck::TMP,
        dle_fallback_splitsize => 100,
     ) },
-    { part_size => 0, part_cache_type => 'none' },
+    { allow_split => 0, part_size => 0, part_cache_type => 'none' },
     "tape_splitsize = 0 indicates no splitting");
 
 is_deeply(
@@ -790,7 +796,7 @@ is_deeply(
        part_size => 100,
        part_cache_dir => "/tmp",
     ) },
-    { },
+    { allow_split => 0 },
     "default if dle_allow_split is false, no splitting");
 
 is_deeply(
@@ -798,14 +804,14 @@ is_deeply(
        dle_tape_splitsize => 200,
        dle_fallback_splitsize => 150,
     ) },
-    { part_cache_type => 'memory', part_size => 200, part_cache_max_size => 150 },
+    { allow_split => 1,part_cache_type => 'memory', part_size => 200, part_cache_max_size => 150 },
     "when cache_inform is available, tape_splitsize is used, not fallback");
 
 is_deeply(
     { get_splitting_args_from_config(
        dle_tape_splitsize => 200,
     ) },
-    { part_size => 200, part_cache_type => 'memory', part_cache_max_size => 1024*1024*10, },
+    { allow_split => 1, part_size => 200, part_cache_type => 'memory', part_cache_max_size => 1024*1024*10, },
     "no split_diskbuffer and no fallback_splitsize, fall back to default (10M)");
 
 is_deeply(
@@ -814,7 +820,7 @@ is_deeply(
        dle_split_diskbuffer => "$Installcheck::TMP/does!not!exist!",
        dle_fallback_splitsize => 150,
     ) },
-    { part_size => 200, part_cache_type => 'memory', part_cache_max_size => 150 },
+    { allow_split => 1, part_size => 200, part_cache_type => 'memory', part_cache_max_size => 150 },
     "invalid split_diskbuffer => fall back (silently)");
 
 is_deeply(
@@ -822,7 +828,7 @@ is_deeply(
        dle_tape_splitsize => 200,
        dle_split_diskbuffer => "$Installcheck::TMP/does!not!exist!",
     ) },
-    { part_size => 200, part_cache_type => 'memory', part_cache_max_size => 1024*1024*10 },
+    { allow_split => 1, part_size => 200, part_cache_type => 'memory', part_cache_max_size => 1024*1024*10 },
     ".. even to the default fallback (10M)");
 
 is_deeply(
@@ -831,7 +837,7 @@ is_deeply(
        dle_split_diskbuffer => "$Installcheck::TMP",
        dle_fallback_splitsize => 250,
     ) },
-    { part_size => $maxint64, part_cache_type => 'memory', part_cache_max_size => 250,
+    { allow_split => 1, part_size => $maxint64, part_cache_type => 'memory', part_cache_max_size => 250,
       warning => "falling back to memory buffer for splitting: " .
                 "insufficient space in disk cache directory" },
     "not enough space in split_diskbuffer => fall back (with warning)");
@@ -843,7 +849,7 @@ is_deeply(
        dle_split_diskbuffer => "$Installcheck::TMP",
        dle_fallback_splitsize => 150,
     ) },
-    { part_size => 200, part_cache_type => 'disk', part_cache_dir => "$Installcheck::TMP" },
+    { allow_split => 1, part_size => 200, part_cache_type => 'disk', part_cache_dir => "$Installcheck::TMP" },
     "if split_diskbuffer exists and splitsize is nonzero, use it");
 
 is_deeply(
@@ -852,7 +858,7 @@ is_deeply(
        dle_split_diskbuffer => "$Installcheck::TMP",
        dle_fallback_splitsize => 250,
     ) },
-    { part_size => 0, part_cache_type => 'none' },
+    { allow_split => 0, part_size => 0, part_cache_type => 'none' },
     ".. but if splitsize is zero, no splitting");
 
 is_deeply(
@@ -860,7 +866,7 @@ is_deeply(
        dle_split_diskbuffer => "$Installcheck::TMP",
        dle_fallback_splitsize => 250,
     ) },
-    { part_size => 0, part_cache_type => 'none' },
+    { allow_split => 0, part_size => 0, part_cache_type => 'none' },
     ".. and if splitsize is missing, no splitting");
 
 is_deeply(
@@ -868,7 +874,7 @@ is_deeply(
        part_size => 300,
        part_cache_type => 'none',
     ) },
-    { part_size => 300, part_cache_type => 'none' },
+    { allow_split => 1, part_size => 300, part_cache_type => 'none' },
     "part_* parameters handled correctly when missing");
 
 is_deeply(
@@ -878,7 +884,7 @@ is_deeply(
        part_cache_dir => $Installcheck::TMP,
        part_cache_max_size => 250,
     ) },
-    { part_size => 300, part_cache_type => 'disk',
+    { allow_split => 1, part_size => 300, part_cache_type => 'disk',
       part_cache_dir => $Installcheck::TMP, part_cache_max_size => 250, },
     "part_* parameters handled correctly when specified");
 
@@ -889,10 +895,11 @@ is_deeply(
        part_cache_dir => "$Installcheck::TMP/does!not!exist!",
        part_cache_max_size => 250,
     ) },
-    { part_size => 300, part_cache_type => 'none',
+    { allow_split => 1, part_size => 300, part_cache_type => 'none',
       part_cache_max_size => 250,
       warning => "part-cache-dir '$Installcheck::TMP/does!not!exist! does not exist; "
               . "using part cache type 'none'"},
     "part_* parameters handled correctly when specified");
 
+$chg->quit();
 rmtree($taperoot);
index e2359b7e2403adf478e64e2a897cea5108bd739a..7a97c378e51976e679e48a9819852ff751434e0d 100644 (file)
@@ -267,9 +267,9 @@ pass("Two simultaneous transfers run to completion");
     my $xfer = Amanda::Xfer->new([
        Amanda::Xfer::Source::Random->new(1024*1024, $RANDOM_SEED),
        Amanda::Xfer::Filter::Process->new(
-           [ $Amanda::Constants::COMPRESS_PATH, $Amanda::Constants::COMPRESS_BEST_OPT ], 0, 1),
+           [ $Amanda::Constants::COMPRESS_PATH, $Amanda::Constants::COMPRESS_BEST_OPT ], 0),
        Amanda::Xfer::Filter::Process->new(
-           [ $Amanda::Constants::UNCOMPRESS_PATH, $Amanda::Constants::UNCOMPRESS_OPT ], 0, 1),
+           [ $Amanda::Constants::UNCOMPRESS_PATH, $Amanda::Constants::UNCOMPRESS_OPT ], 0),
        Amanda::Xfer::Dest::Null->new($RANDOM_SEED),
     ]);
 
@@ -299,7 +299,7 @@ pass("Two simultaneous transfers run to completion");
     my $xfer = Amanda::Xfer->new([
        Amanda::Xfer::Source::Fd->new($zerofd),
        Amanda::Xfer::Filter::Process->new(
-           [ $Amanda::Constants::COMPRESS_PATH, $Amanda::Constants::COMPRESS_BEST_OPT ], 0, 1),
+           [ $Amanda::Constants::COMPRESS_PATH, $Amanda::Constants::COMPRESS_BEST_OPT ], 0),
        Amanda::Xfer::Dest::Null->new(0),
     ]);
 
index 2fc3918677f6996d0d2171a67c2ea133142b15ce..835bcf934f6372d543ef9a6919b97f56c4533e29 100644 (file)
@@ -203,6 +203,8 @@ sub remove_param {
 =item C<add_script($name, $values_arrayref)>
 =item C<add_device($name, $values_arrayref)>
 =item C<add_changer($name, $values_arrayref)>
+=item C<add_interactivity($name, $values_arrayref)>
+=item C<add_taperscan($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.
@@ -278,6 +280,18 @@ sub add_changer {
     $self->_add_subsec("changers", $name, 1, $values);
 }
 
+sub add_interactivity {
+    my $self = shift;
+    my ($name, $values) = @_;
+    $self->_add_subsec("interactivities", $name, 1, $values);
+}
+
+sub add_taperscan {
+    my $self = shift;
+    my ($name, $values) = @_;
+    $self->_add_subsec("taperscans", $name, 1, $values);
+}
+
 =item C<add_text($text)>
 
 Add arbitrary text to the config file.
@@ -371,9 +385,14 @@ sub _write_amanda_conf {
     # write key/value pairs
     my @params = @{$self->{'params'}};
     my $saw_tapetype = 0;
+    my $taperscan;
     while (@params) {
        $param = shift @params;
        $value = shift @params;
+       if ($param eq 'taperscan') {
+           $taperscan = $value;
+           next;
+       }
        print $amanda_conf "$param $value\n";
        $saw_tapetype = 1 if ($param eq "tapetype");
     }
@@ -392,7 +411,10 @@ sub _write_amanda_conf {
     $self->_write_amanda_conf_subsection($amanda_conf, "holdingdisk", $self->{"holdingdisks"});
     $self->_write_amanda_conf_subsection($amanda_conf, "device", $self->{"devices"});
     $self->_write_amanda_conf_subsection($amanda_conf, "changer", $self->{"changers"});
+    $self->_write_amanda_conf_subsection($amanda_conf, "interactivity", $self->{"interactivities"});
+    $self->_write_amanda_conf_subsection($amanda_conf, "taperscan", $self->{"taperscans"});
     print $amanda_conf "\n", $self->{'text'}, "\n";
+    print $amanda_conf "taperscan $taperscan\n" if $taperscan;
 
     close($amanda_conf);
 }
index 5bf1b1067ec260090ce11e3a036fcac3b113688b..4b1d3a2680dd51e3cbd9207b468f976febc93f0e 100644 (file)
@@ -190,13 +190,15 @@ our $holdingdir ="$Installcheck::TMP/holding";
 
 sub setup {
     my $new_vtapes = shift;
+    my $nb_slot = shift;
     my $testconf = Installcheck::Config->new();
 
+    $nb_slot = 3 if !defined $nb_slot;
     (-d $diskname) or setup_backmeup();
     if ($new_vtapes) {
-       setup_new_vtapes($testconf, 3);
+       setup_new_vtapes($testconf, $nb_slot);
     } else {
-       setup_vtapes($testconf, 3);
+       setup_vtapes($testconf, $nb_slot);
     }
     setup_holding($testconf, 25);
     setup_disklist($testconf);
index 2611f48785908ea6209df6c2861b8512524d09ef..7914cda72abdd8d08fa36a461c73388d5925ec99 100644 (file)
@@ -49,6 +49,8 @@ server_tests = \
        Amanda_Report \
        Amanda_Tapelist \
        Amanda_Taper_Scan \
+       Amanda_Taper_Scan_lexical \
+       Amanda_Taper_Scan_oldest \
        Amanda_Taper_Scan_traditional \
        Amanda_Taper_Scribe \
        bigint \
@@ -68,6 +70,7 @@ full_tests = \
        amcheckdump \
        amdevcheck \
        amdump \
+       amdump_client \
        amflush \
        amoverview \
        amreport \
index d2c25857060347431e675d9f319b82b08612f6a5..072d47eeda36c1fbe2a86a3831c821ea3e35e74a 100644 (file)
@@ -162,6 +162,7 @@ am__aclocal_m4_deps =  \
        $(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/as_needed.m4 \
        $(top_srcdir)/config/amanda/bsd-security.m4 \
        $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
        $(top_srcdir)/config/amanda/bsdudp-security.m4 \
@@ -332,6 +333,7 @@ APPLICATION_DIR = @APPLICATION_DIR@
 AR = @AR@
 ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
 ASSERTIONS = @ASSERTIONS@
+AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -805,6 +807,7 @@ LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
 MKDIR_P = @MKDIR_P@
+MOUNT = @MOUNT@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
@@ -1002,6 +1005,7 @@ STDBOOL_H = @STDBOOL_H@
 STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
+SUNTAR = @SUNTAR@
 SVN = @SVN@
 SWIG = @SWIG@
 SWIG_LIB = @SWIG_LIB@
@@ -1009,6 +1013,7 @@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TCPPORTRANGE = @TCPPORTRANGE@
 TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
 UDPPORTRANGE = @UDPPORTRANGE@
+UMOUNT = @UMOUNT@
 UNCOMPRESS_OPT = @UNCOMPRESS_OPT@
 UNCOMPRESS_PATH = @UNCOMPRESS_PATH@
 UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
@@ -1160,6 +1165,8 @@ server_tests = \
        Amanda_Report \
        Amanda_Tapelist \
        Amanda_Taper_Scan \
+       Amanda_Taper_Scan_lexical \
+       Amanda_Taper_Scan_oldest \
        Amanda_Taper_Scan_traditional \
        Amanda_Taper_Scribe \
        bigint \
@@ -1178,6 +1185,7 @@ full_tests = \
        amcheckdump \
        amdevcheck \
        amdump \
+       amdump_client \
        amflush \
        amoverview \
        amreport \
index 800748554d07980174808cf4933404cad292833c..38681174096643c454ba26532ea1f025d9a08522 100644 (file)
@@ -16,7 +16,7 @@
 # Contact information: Zmanda Inc, 465 S Mathilda Ave, Suite 300
 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
 
-use Test::More tests => 16;
+use Test::More tests => 17;
 use strict;
 use warnings;
 
@@ -117,3 +117,6 @@ like(run_get('amadmin TESTCONF force localhost share-\*'),
 amadmin: localhost:\\\\windows\\share-b is set to a forced level 0 at next run.$/,
    "shell 12");
 
+like(run_get('amadmin TESTCONF force localhost share-a share-a'),
+   qr/^amadmin: localhost:\\\\windows\\share-a is set to a forced level 0 at next run.$/,
+   "shell 13");
index 23184ffe67cd8d96427ff68f835b9645aa3be2fb..b26f4871041d1e9abffd883a543d793a172bf2d4 100644 (file)
@@ -103,5 +103,4 @@ is_deeply([ sort split "\n",
            run_get('amdevcheck', 'TESTCONF', 'file:'.$Installcheck::Run::taperoot) ],
          [ sort "SUCCESS" ],
     "used vtape described as SUCCESS");
-
 Installcheck::Run::cleanup();
diff --git a/installcheck/amdump_client.pl b/installcheck/amdump_client.pl
new file mode 100644 (file)
index 0000000..893a9e5
--- /dev/null
@@ -0,0 +1,63 @@
+# Copyright (c) 2008, 2010 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, 465 S. Mathilda Ave., Suite 300
+# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
+
+use Test::More tests => 3;
+use strict;
+use warnings;
+
+use lib "@amperldir@";
+use Installcheck::Dumpcache;
+use Installcheck::Config;
+use Installcheck::Run qw(run run_err $diskname amdump_diag);
+use Amanda::Config qw( :init );
+use Amanda::Paths;
+use Sys::Hostname;
+
+my $testconf;
+
+# Just run amdump.
+
+$testconf = Installcheck::Run::setup();
+$testconf->add_param('autolabel', '"TESTCONF%%" empty volume_error');
+
+my $hostname = hostname;
+$testconf->add_client_param('auth', '"local"');
+$testconf->add_client_param('amdump_server', "\"$hostname\"");
+
+# and one with the amgtar application
+$testconf->add_dle(<<EODLE);
+$hostname diskname $diskname {
+    installcheck-test
+    program "APPLICATION"
+    dump-limit server
+    application {
+       plugin "amgtar"
+       property "ATIME-PRESERVE" "NO"
+    }
+}
+EODLE
+$testconf->write();
+
+ok(run('amdump_client', '--config', 'TESTCONF', 'list'), "'amdump_client list' runs successfully");
+is($Installcheck::Run::stdout,
+    "config: TESTCONF\ndiskname\n",
+    "'amdump_client list' list diskname");
+ok(run('amdump_client', '--config', 'TESTCONF', 'dump'), "'amdump_client dump' runs successfully")
+    or amdump_diag();
+
+Installcheck::Run::cleanup();
index 9bb9cfb8788a2c501d15615e0f9ec987013722bb..791f232b083dd65eeebc0093086199086b30a850 100644 (file)
@@ -16,7 +16,7 @@
 # Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300
 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
 
-use Test::More tests => 19;
+use Test::More tests => 24;
 use strict;
 use warnings;
 
@@ -35,7 +35,8 @@ my $testconf;
 Amanda::Debug::dbopen("installcheck");
 Installcheck::log_test_output();
 
-$testconf = Installcheck::Run::setup();
+$testconf = Installcheck::Run::setup(1, 4);
+$testconf->add_param('autolabel', '"TESTCONF%%" any');
 $testconf->write();
 
 config_init($CONFIG_INIT_EXPLICIT_NAME, "TESTCONF");
@@ -79,7 +80,8 @@ like(run_get('amlabel', 'TESTCONF', 'TESTCONF92'),
 $tl->reload();
 is_deeply($tl->{'tles'}->[0], {
        'reuse' => 1,
-       'barcode' => undef,
+       'barcode' => undef,
+       'meta' => undef,
        'comment' => undef,
        'position' => 1,
        'label' => 'TESTCONF92',
@@ -134,3 +136,41 @@ Writing label 'TESTCONF88'/,
 
 ok(run('amlabel', 'TESTCONF', 'TESTCONF88', '-f', 'slot', '2'),
     "-f option doesn't have to follow 'amlabel'");
+
+ok(run('amlabel', 'TESTCONF', 'TESTCONF88', '--meta', 'meta-01', '--barcode', 'bar-01', '--assign'),
+    "--assign works");
+
+$tl->reload();
+is_deeply($tl->{'tles'}->[0], {
+       'reuse' => 1,
+       'barcode' => 'bar-01',
+       'meta' => 'meta-01',
+       'comment' => undef,
+       'position' => 1,
+       'label' => 'TESTCONF88',
+       'datestamp' => '0'
+     },
+    "tapelist correctly updated after --assign");
+
+ok(run('amlabel', 'TESTCONF', 'slot', '4'),
+    "amlabel works without a label");
+like($Installcheck::Run::stdout,
+     qr/Reading label\.\.\.
+Found an empty tape\.
+Writing label 'TESTCONF01'\.\.\.
+Checking label\.\.\.
+Success!/,
+     "amlabel without label use autolabel");
+
+$tl->reload();
+is_deeply($tl->{'tles'}->[0], {
+       'reuse' => 1,
+       'barcode' => undef,
+       'meta' => 'meta-01',
+       'comment' => undef,
+       'position' => 1,
+       'label' => 'TESTCONF01',
+       'datestamp' => '0'
+     },
+    "tapelist correctly updated after autolabel");
+
index 5b61ae3a3e8afd6f15a33fd04cf60d2f8d8f69b3..22e7c1818b010ac577fac5cf1d6f5e238bf72bff 100644 (file)
@@ -16,7 +16,7 @@
 # Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300
 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
 
-use Test::More tests => 8;
+use Test::More tests => 10;
 
 use lib "@amperldir@";
 use File::Path;
@@ -45,19 +45,28 @@ sub config_ok {
 Installcheck::Run::cleanup();
 ok(run("$sbindir/amserverconfig", 'TESTCONF', '--template', 'S3'),
     "amserverconfig with S3 template")
-    or diag($Installcheck::Run::stderr);
+    or diag($Installcheck::Run::stdout);
 config_ok();
 
 Installcheck::Run::cleanup();
 ok(run("$sbindir/amserverconfig", 'TESTCONF', '--template', 'harddisk'),
     "amserverconfig with harddisk template")
-    or diag($Installcheck::Run::stderr);
+    or diag($Installcheck::Run::stdout);
+config_ok();
+
+Installcheck::Run::cleanup();
+mkpath(Installcheck::Run::vtape_dir());
+ok(run("$sbindir/amserverconfig", 'TESTCONF', '--template', 'harddisk',
+                   '--tapecycle', '2',
+                   '--tapedev', Installcheck::Run::vtape_dir()),
+    "amserverconfig with harddisk template and tapedev and tapecycle")
+    or diag($Installcheck::Run::stdout);
 config_ok();
 
 Installcheck::Run::cleanup();
 ok(run("$sbindir/amserverconfig", 'TESTCONF', '--template', 'single-tape'),
     "amserverconfig with single-tape template")
-    or diag($Installcheck::Run::stderr);
+    or diag($Installcheck::Run::stdout);
 config_ok();
 
 SKIP: {
@@ -66,7 +75,7 @@ SKIP: {
     Installcheck::Run::cleanup();
     ok(run("$sbindir/amserverconfig", 'TESTCONF', '--template', 'tape-changer'),
        "amserverconfig with tape-changer template")
-       or diag($Installcheck::Run::stderr);
+       or diag($Installcheck::Run::stdout);
     config_ok();
 }
 
index 51ea4842d3e50d4fb984281ee56d28cebe8f024b..cc7efd6e5a5bfb8093e27a6ab947cbb28aae13ab 100644 (file)
@@ -215,7 +215,7 @@ like($Installcheck::Run::stderr,
 ok(run('amtape', 'TESTCONF', 'inventory'),
     "'amtape TESTCONF inventory'");
 like($Installcheck::Run::stdout,
-    qr/slot +1: blank\nslot +2: label MyTape\nslot +3/,
+    qr/slot +1: blank\nslot +2: label MyTape \(current\)\nslot +3/,
     "..result correct");
 
 ok(run('amtape', 'TESTCONF', 'taper'),
index 370b23be10b615380ab44d860e76aff81964c760..b8a3971fe6db89355bedd67b3f89d7050470513a 100644 (file)
@@ -96,7 +96,6 @@ ok(run("$sbindir/amvault",
                'TESTCONF'),
     "amvault runs!")
     or diag($Installcheck::Run::stderr);
-
 my @tert_files = glob("$vtape_root/slot1/0*");
 ok(@tert_files > 0,
     "..and files appear on the tertiary volume!");
@@ -237,6 +236,7 @@ EOF
     };
     Amanda::MainLoop::call_later(sub { $chg->inventory(inventory_cb => $inventory_cb); });
     Amanda::MainLoop::run();
+    $chg->quit();
 
     # find TESTCONF02 in the inventory, and check that it is in an i/e slot
     my $notfound = "tertiary volume not found";
index a7eaecd9332566ae5541cd88ccfe698d4a9dd506..886fd089c0e7c35719b78a90d801d437f6c5fe6c 100644 (file)
@@ -93,12 +93,14 @@ my %version_classes = (
     '>=1.16' => $numeric_version >= 11591,
     '>=1.16-no-wc' => $numeric_version >= 11591 && !$wc_default_changed, # normal
     '>=1.16-wc' => $numeric_version >= 11591 && $wc_default_changed, # stupid distros screw things up!
+    '1.16..<1.25' => $numeric_version >= 11591 && $numeric_version < 12500,
 
     '<1.23' => $numeric_version < 12300,
     '>=1.23' => $numeric_version >= 12300,
     '*' => 1,
     '1.23' => ($numeric_version >= 12290 and $numeric_version <= 12300),
-    '!1.23' => ($numeric_version < 12290 || $numeric_version > 12300),
+    '!1.23' => ($numeric_version < 12290 || ($numeric_version > 12300 && $numeric_version < 12500)),
+    '>=1.25' => $numeric_version >= 12500.
 );
 
 # include and exclude all use the same set of patterns and filenames
@@ -131,28 +133,30 @@ my $named_expectations = [
            'gamma',
               'delta',
                  'epsilon',
-                    'empty', ],
-    #  al be ga de ep empty
-    [  1, 1, 1, 1, 1, 1,     ], # './A*A' =>   'A*A',
-    [  1, 1, 1, 1, 0, 0,     ], # './A*A' =>   'AxA',
-    [  1, 1, 1, 1, 1, 1,     ], # './B?B' =>   'B?B',
-    [  1, 1, 1, 1, 0, 0,     ], # './B?B' =>   'BxB',
-    [  0, 0, 0, 0, 1, 1,     ], # './C[C' =>   'C[C',
-    [  1, 1, 1, 1, 1, 1,     ], # './D]D' =>   'D]D',
-    [  1, 0, 0, 1, 1, 1,     ], # './E\\E' =>  'E\\E',
-    [  1, 1, 1, 1, 1, 1,     ], # './F\'F' =>  'F\'F',
-    [  1, 1, 1, 1, 1, 1,     ], # './G"G' =>   'G"G',
-    [  1, 1, 1, 1, 1, 1,     ], # './H H' =>   'H H',
-    [  1, 1, 1, 0, 0, 0,     ], # './A\\*A' => 'A*A',
-    [  0, 0, 0, 0, 0, 0,     ], # './A\\*A' => 'AxA',
-    [  0, 0, 1, 0, 0, 0,     ], # './B\\?B' => 'B?B',
-    [  0, 0, 0, 0, 0, 0,     ], # './B\\?B' => 'BxB',
-    [  1, 1, 1, 0, 0, 0,     ], # './C\\[C' => 'C[C',
-    [  0, 1, 1, 0, 0, 0,     ], # './D\\]D' => 'D]D',
-    [  1, 0, 1, 0, 1, 0,     ], # './E\\\\E' =>        'E\\E',
-    [  0, 1, 1, 0, 0, 0,     ], # './F\\\'F' =>        'F\'F',
-    [  0, 1, 1, 0, 0, 0,     ], # './G\\"G' => 'G"G',
-    [  0, 1, 1, 0, 0, 0,     ], # './H\\ H' => 'H H',
+                    'zeta',
+                       'eta',
+                          'empty', ],
+    #  al be ga de ep ze et empty
+    [  1, 1, 1, 1, 1, 1, 1, 1,     ], # './A*A' =>     'A*A',
+    [  1, 1, 1, 1, 0, 1, 1, 0,     ], # './A*A' =>     'AxA',
+    [  1, 1, 1, 1, 1, 1, 1, 1,     ], # './B?B' =>     'B?B',
+    [  1, 1, 1, 1, 0, 1, 1, 0,     ], # './B?B' =>     'BxB',
+    [  0, 0, 0, 0, 1, 1, 1, 1,     ], # './C[C' =>     'C[C',
+    [  1, 1, 1, 1, 1, 1, 1, 1,     ], # './D]D' =>     'D]D',
+    [  1, 0, 0, 1, 1, 0, 0, 1,     ], # './E\\E' =>    'E\\E',
+    [  1, 1, 1, 1, 1, 1, 1, 1,     ], # './F\'F' =>    'F\'F',
+    [  1, 1, 1, 1, 1, 1, 1, 1,     ], # './G"G' =>     'G"G',
+    [  1, 1, 1, 1, 1, 1, 1, 1,     ], # './H H' =>     'H H',
+    [  1, 1, 1, 0, 0, 1, 1, 0,     ], # './A\\*A' =>   'A*A',
+    [  0, 0, 0, 0, 0, 0, 0, 0,     ], # './A\\*A' =>   'AxA',
+    [  0, 0, 1, 0, 0, 0, 1, 0,     ], # './B\\?B' =>   'B?B',
+    [  0, 0, 0, 0, 0, 0, 0, 0,     ], # './B\\?B' =>   'BxB',
+    [  1, 1, 1, 0, 0, 1, 1, 0,     ], # './C\\[C' =>   'C[C',
+    [  0, 1, 1, 0, 0, 1, 1, 0,     ], # './D\\]D' =>   'D]D',
+    [  1, 0, 1, 0, 1, 0, 1, 0,     ], # './E\\\\E' =>  'E\\E',
+    [  0, 1, 1, 0, 0, 1, 1, 0,     ], # './F\\\'F' =>  'F\'F',
+    [  0, 1, 1, 0, 0, 1, 1, 0,     ], # './G\\"G' =>   'G"G',
+    [  0, 1, 1, 0, 0, 1, 1, 0,     ], # './H\\ H' =>   'H H',
 ];
 
 sub get_expectation {
@@ -345,7 +349,8 @@ test_gnutar_inclusion(
     extra_args => [ '--wildcards' ],
     expectations => {
        '<1.16' => 'alpha',
-       '>=1.16' => 'beta',
+       '1.16..<1.25' => 'beta',
+       '>=1.25' => 'zeta',
     },
 );
 
@@ -353,7 +358,8 @@ test_gnutar_inclusion(
     extra_args => [ '--wildcards', '--no-unquote' ],
     expectations => {
        '<1.16' => undef,
-       '>=1.16' => 'gamma',
+       '1.16..<1.25' => 'gamma',
+       '>=1.25' => 'eta',
     },
 );
 
@@ -464,6 +470,7 @@ test_gnutar_exclusion(
     expectations => {
        '!1.23' => 'gamma',
        '1.23' => 'delta',
+       '>=1.25' => 'eta',
     },
 );
 
index ee0ea9ac29ad5e3f274f71472a70f6486466282a..311e6331a9fcf326e15265242be581dfacdff5e9 100644 (file)
@@ -140,6 +140,24 @@ localhost diskname2 $diskname {
     }
     script {
        plugin "amlog-script"
+       single-execution yes
+       execute-where server
+       execute-on pre-host-amcheck, post-host-amcheck, pre-host-estimate, post-host-estimate, pre-host-backup, post-host-backup
+       property "logfile" "$templog"
+    }
+}
+EODLE
+$testconf->add_dle(<<EODLE);
+localhost diskname3 $diskname {
+    installcheck-test
+    program "APPLICATION"
+    application {
+       plugin "amgtar"
+       property "atime-preserve" "no"
+    }
+    script {
+       plugin "amlog-script"
+       single-execution yes
        execute-where server
        execute-on pre-host-amcheck, post-host-amcheck, pre-host-estimate, post-host-estimate, pre-host-backup, post-host-backup
        property "logfile" "$templog"
@@ -152,8 +170,8 @@ unlink $templog;
 ok(run('amcheck', '-c', 'TESTCONF'), "amcheck runs successfully for server scripts.");
 
 verify_log("amcheck invokes correct script commands",
-    "check TESTCONF pre-host-amcheck server localhost diskname2 $diskname",
-    "check TESTCONF post-host-amcheck server localhost diskname2 $diskname",
+    "check TESTCONF pre-host-amcheck server localhost diskname3 $diskname",
+    "check TESTCONF post-host-amcheck server localhost diskname3 $diskname",
 );
 
 unlink $templog;
@@ -161,10 +179,10 @@ ok(run('amdump', 'TESTCONF'), "amdump runs successfully for server scripts.")
     or amdump_diag();
 
 verify_log("amdump invokes correct script commands",
-    "estimate TESTCONF pre-host-estimate server localhost diskname2 $diskname 0",
-    "estimate TESTCONF post-host-estimate server localhost diskname2 $diskname 0",
-    "backup TESTCONF pre-host-backup server localhost diskname2 $diskname",
-    "backup TESTCONF post-host-backup server localhost diskname2 $diskname",
+    "estimate TESTCONF pre-host-estimate server localhost diskname3 $diskname",
+    "estimate TESTCONF post-host-estimate server localhost diskname3 $diskname",
+    "backup TESTCONF pre-host-backup server localhost diskname3 $diskname",
+    "backup TESTCONF post-host-backup server localhost diskname3 $diskname",
 );
 
 unlink $templog;
index 3cb4b2a73e7de3a21a1b389aab9dea68d4672f83..17a63e437d75a42d5f33527fddfc8cd754f9ff30 100644 (file)
@@ -16,7 +16,7 @@
 # Contact information: Zmanda Inc, 465 S. Mathilda Ave., Suite 300
 # Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
 
-use Test::More tests => 201;
+use Test::More tests => 269;
 use strict;
 use warnings;
 
@@ -87,6 +87,14 @@ sub run_taper {
        $testconf->add_tapetype('TEST-TAPE', [
            'length' =>  "$length",
            ]);
+       if ($params{'taperscan'}) {
+           $testconf->add_param('taperscan', "\"$params{'taperscan'}\"");
+           $testconf->add_taperscan($params{'taperscan'}, [
+                       'comment' => '"my taperscan is mine, not yours"',
+                       'plugin'  => "\"$params{'taperscan'}\"",
+                       ]);
+
+       }
        $testconf->write();
     }
 
@@ -303,9 +311,9 @@ taper_cmd("START-SCAN worker0 $handle");
 taper_cmd("NEW-TAPE worker0 $handle");
 like(taper_reply, qr/^NEW-TAPE $handle TESTCONF01$/,
        "got proper NEW-TAPE worker0 $handle") or die;
-like(taper_reply, qr/^PARTDONE $handle TESTCONF01 1 1024 "\[sec [\d.]+ kb 1024 kps [\d.]+ orig-kb 12\]"$/,
+like(taper_reply, qr/^PARTDONE $handle TESTCONF01 1 1024 "\[sec [\d.]+ bytes 1048576 kps [\d.]+ orig-kb 12\]"$/,
        "got PARTDONE") or die;
-like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ kb 1024 kps [\d.]+ orig-kb 12\]" "" ""$/,
+like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ bytes 1048576 kps [\d.]+ orig-kb 12\]" "" ""$/,
        "got DONE") or die;
 
 ##
@@ -315,22 +323,23 @@ like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ kb 1024 kp
 $handle = '11-22222';
 make_holding_file(1024*1024, "localhost", "/usr");
 taper_cmd("FILE-WRITE worker0 $handle \"$test_filename\" localhost /usr 0 $datestamp 524288 \"\" \"\" 1 \"\" \"\" \"\" \"\" 512");
-like(taper_reply, qr/^PARTDONE $handle TESTCONF01 2 512 "\[sec [\d.]+ kb 512 kps [\d.]+ orig-kb 512\]"$/,
+like(taper_reply, qr/^PARTDONE $handle TESTCONF01 2 512 "\[sec [\d.]+ bytes 524288 kps [\d.]+ orig-kb 512\]"$/,
        "got PARTDONE for filenum 2") or die;
-like(taper_reply, qr/^PARTDONE $handle TESTCONF01 3 512 "\[sec [\d.]+ kb 512 kps [\d.]+ orig-kb 512\]"$/,
+like(taper_reply, qr/^PARTDONE $handle TESTCONF01 3 512 "\[sec [\d.]+ bytes 524288 kps [\d.]+ orig-kb 512\]"$/,
        "got PARTDONE for filenum 3") or die;
-like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ kb 1024 kps [\d.]+ orig-kb 512\]" "" ""$/,
+like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ bytes 1048576 kps [\d.]+ orig-kb 512\]" "" ""$/,
        "got DONE") or die;
 taper_cmd("QUIT");
 wait_for_exit();
 
 check_logs([
+    qr(^INFO taper Slot 1 without label can be labeled$),
     qr(^START taper datestamp $datestamp label TESTCONF01 tape 1$),
-    qr(^PART taper TESTCONF01 1 localhost /home $datestamp 1/-1 0 \[sec [\d.]+ kb 1024 kps [\d.]+ orig-kb 12\]$),
-    qr(^DONE taper localhost /home $datestamp 1 0 \[sec [\d.]+ kb 1024 kps [\d.]+ orig-kb 12\]$),
-    qr(^PART taper TESTCONF01 2 localhost /usr $datestamp 1/-1 0 \[sec [\d.]+ kb 512 kps [\d.]+ orig-kb 512\]$),
-    qr(^PART taper TESTCONF01 3 localhost /usr $datestamp 2/-1 0 \[sec [\d.]+ kb 512 kps [\d.]+ orig-kb 512\]$),
-    qr(^DONE taper localhost /usr $datestamp 2 0 \[sec [\d.]+ kb 1024 kps [\d.]+ orig-kb 512\]$),
+    qr(^PART taper TESTCONF01 1 localhost /home $datestamp 1/-1 0 \[sec [\d.]+ bytes 1048576 kps [\d.]+ orig-kb 12\]$),
+    qr(^DONE taper localhost /home $datestamp 1 0 \[sec [\d.]+ bytes 1048576 kps [\d.]+ orig-kb 12\]$),
+    qr(^PART taper TESTCONF01 2 localhost /usr $datestamp 1/-1 0 \[sec [\d.]+ bytes 524288 kps [\d.]+ orig-kb 512\]$),
+    qr(^PART taper TESTCONF01 3 localhost /usr $datestamp 2/-1 0 \[sec [\d.]+ bytes 524288 kps [\d.]+ orig-kb 512\]$),
+    qr(^DONE taper localhost /usr $datestamp 2 0 \[sec [\d.]+ bytes 1048576 kps [\d.]+ orig-kb 512\]$),
     qr(^INFO taper tape TESTCONF01 kb 2048 fm 4 \[OK\]$),
 ], "single-part and multi-part dump logged correctly");
 
@@ -404,35 +413,36 @@ taper_cmd("START-SCAN worker0 $handle");
 taper_cmd("NEW-TAPE worker0 $handle");
 like(taper_reply, qr/^NEW-TAPE $handle TESTCONF01$/,
        "got proper NEW-TAPE worker0 $handle") or die;
-like(taper_reply, qr/^PARTDONE $handle TESTCONF01 1 384 "\[sec [\d.]+ kb 384 kps [\d.]+\]"$/,
+like(taper_reply, qr/^PARTDONE $handle TESTCONF01 1 384 "\[sec [\d.]+ bytes 393216 kps [\d.]+\]"$/,
        "got PARTDONE for filenum 1") or die;
-like(taper_reply, qr/^PARTDONE $handle TESTCONF01 2 384 "\[sec [\d.]+ kb 384 kps [\d.]+\]"$/,
+like(taper_reply, qr/^PARTDONE $handle TESTCONF01 2 384 "\[sec [\d.]+ bytes 393216 kps [\d.]+\]"$/,
        "got PARTDONE for filenum 2") or die;
-like(taper_reply, qr/^PARTDONE $handle TESTCONF01 3 384 "\[sec [\d.]+ kb 384 kps [\d.]+\]"$/,
+like(taper_reply, qr/^PARTDONE $handle TESTCONF01 3 384 "\[sec [\d.]+ bytes 393216 kps [\d.]+\]"$/,
        "got PARTDONE for filenum 3") or die;
-like(taper_reply, qr/^PARTDONE $handle TESTCONF01 4 384 "\[sec [\d.]+ kb 384 kps [\d.]+\]"$/,
+like(taper_reply, qr/^PARTDONE $handle TESTCONF01 4 384 "\[sec [\d.]+ bytes 393216 kps [\d.]+\]"$/,
        "got PARTDONE for filenum 4") or die;
-like(taper_reply, qr/^PARTDONE $handle TESTCONF01 5 384 "\[sec [\d.]+ kb 384 kps [\d.]+\]"$/,
+like(taper_reply, qr/^PARTDONE $handle TESTCONF01 5 384 "\[sec [\d.]+ bytes 393216 kps [\d.]+\]"$/,
        "got PARTDONE for filenum 5") or die;
-like(taper_reply, qr/^PARTDONE $handle TESTCONF01 6 96 "\[sec [\d.]+ kb 96 kps [\d.]+\]"$/,
+like(taper_reply, qr/^PARTDONE $handle TESTCONF01 6 96 "\[sec [\d.]+ bytes 98304 kps [\d.]+\]"$/,
        "got PARTDONE for filenum 6") or die;
 like(taper_reply, qr/^DUMPER-STATUS $handle$/,
        "got DUMPER-STATUS request") or die;
 taper_cmd("DONE worker0 $handle 712");
-like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ kb 2016 kps [\d.]+ orig-kb 712\]" "" ""$/,
+like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ bytes 2064384 kps [\d.]+ orig-kb 712\]" "" ""$/,
        "got DONE") or die;
 taper_cmd("QUIT");
 wait_for_exit();
 
 check_logs([
+    qr(^INFO taper Slot 1 without label can be labeled$),
     qr(^START taper datestamp $datestamp label TESTCONF01 tape 1$),
-    qr(^PART taper TESTCONF01 1 localhost /var $datestamp 1/-1 0 \[sec [\d.]+ kb 384 kps [\d.]+\]$),
-    qr(^PART taper TESTCONF01 2 localhost /var $datestamp 2/-1 0 \[sec [\d.]+ kb 384 kps [\d.]+\]$),
-    qr(^PART taper TESTCONF01 3 localhost /var $datestamp 3/-1 0 \[sec [\d.]+ kb 384 kps [\d.]+\]$),
-    qr(^PART taper TESTCONF01 4 localhost /var $datestamp 4/-1 0 \[sec [\d.]+ kb 384 kps [\d.]+\]$),
-    qr(^PART taper TESTCONF01 5 localhost /var $datestamp 5/-1 0 \[sec [\d.]+ kb 384 kps [\d.]+\]$),
-    qr(^PART taper TESTCONF01 6 localhost /var $datestamp 6/-1 0 \[sec [\d.]+ kb 96 kps [\d.]+\]$),
-    qr(^DONE taper localhost /var $datestamp 6 0 \[sec [\d.]+ kb 2016 kps [\d.]+ orig-kb 712\]$),
+    qr(^PART taper TESTCONF01 1 localhost /var $datestamp 1/-1 0 \[sec [\d.]+ bytes 393216 kps [\d.]+\]$),
+    qr(^PART taper TESTCONF01 2 localhost /var $datestamp 2/-1 0 \[sec [\d.]+ bytes 393216 kps [\d.]+\]$),
+    qr(^PART taper TESTCONF01 3 localhost /var $datestamp 3/-1 0 \[sec [\d.]+ bytes 393216 kps [\d.]+\]$),
+    qr(^PART taper TESTCONF01 4 localhost /var $datestamp 4/-1 0 \[sec [\d.]+ bytes 393216 kps [\d.]+\]$),
+    qr(^PART taper TESTCONF01 5 localhost /var $datestamp 5/-1 0 \[sec [\d.]+ bytes 393216 kps [\d.]+\]$),
+    qr(^PART taper TESTCONF01 6 localhost /var $datestamp 6/-1 0 \[sec [\d.]+ bytes 98304 kps [\d.]+\]$),
+    qr(^DONE taper localhost /var $datestamp 6 0 \[sec [\d.]+ bytes 2064384 kps [\d.]+ orig-kb 712\]$),
     qr(^INFO taper tape TESTCONF01 kb 2016 fm 6 \[OK\]$),
 ], "multipart PORT-WRITE logged correctly");
 
@@ -455,6 +465,7 @@ taper_cmd("QUIT");
 wait_for_exit();
 
 check_logs([
+    qr(^INFO taper Slot 1 without label can be labeled$),
     qr(^ERROR taper no-tape config \[sorry\]$),
     qr(^FAIL taper localhost /home $datestamp 0 config sorry$),
 ], "NO-NEW-TAPE logged correctly");
@@ -477,7 +488,7 @@ taper_cmd("START-SCAN worker0 $handle");
 taper_cmd("NEW-TAPE worker0 $handle");
 like(taper_reply, qr/^NEW-TAPE $handle TESTCONF01$/,
        "got proper NEW-TAPE worker0 $handle") or die;
-like(taper_reply, qr/^PARTDONE $handle TESTCONF01 1 768 "\[sec [\d.]+ kb 768 kps [\d.]+\]"$/,
+like(taper_reply, qr/^PARTDONE $handle TESTCONF01 1 768 "\[sec [\d.]+ bytes 786432 kps [\d.]+\]"$/,
        "got PARTDONE for filenum 1") or die;
 like(taper_reply, qr/^REQUEST-NEW-TAPE $handle$/,
        "got REQUEST-NEW-TAPE worker0 $handle") or die;
@@ -485,28 +496,30 @@ taper_cmd("START-SCAN worker0 $handle");
 taper_cmd("NEW-TAPE worker0 $handle");
 like(taper_reply, qr/^NEW-TAPE $handle TESTCONF02$/,
        "got proper NEW-TAPE worker0 $handle") or die;
-like(taper_reply, qr/^PARTDONE $handle TESTCONF02 1 768 "\[sec [\d.]+ kb 768 kps [\d.]+\]"$/,
+like(taper_reply, qr/^PARTDONE $handle TESTCONF02 1 768 "\[sec [\d.]+ bytes 786432 kps [\d.]+\]"$/,
        "got PARTDONE for filenum 1 on second tape") or die;
-like(taper_reply, qr/^PARTDONE $handle TESTCONF02 2 3 "\[sec [\d.]+ kb 3 kps [\d.]+\]"$/,
+like(taper_reply, qr/^PARTDONE $handle TESTCONF02 2 3 "\[sec [\d.]+ bytes 3072 kps [\d.]+\]"$/,
        "got PARTDONE for filenum 2 on second tape") or die;
 like(taper_reply, qr/^DUMPER-STATUS $handle$/,
        "got DUMPER-STATUS request") or die;
 taper_cmd("DONE worker0 $handle 1012");
-like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ kb 1539 kps [\d.]+ orig-kb 1012\]" "" ""$/,
+like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ bytes 1575936 kps [\d.]+ orig-kb 1012\]" "" ""$/,
        "got DONE") or die;
 taper_cmd("QUIT");
 wait_for_exit();
 
 check_logs([
+    qr(^INFO taper Slot 1 without label can be labeled$),
     qr(^START taper datestamp $datestamp label TESTCONF01 tape 1$),
-    qr(^PART taper TESTCONF01 1 localhost /usr/local $datestamp 1/-1 0 \[sec [\d.]+ kb 768 kps [\d.]+\]$),
-    qr(^PARTPARTIAL taper TESTCONF01 2 localhost /usr/local $datestamp 2/-1 0 \[sec [\d.]+ kb 160 kps [\d.]+\] "No space left on device"$),
+    qr(^PART taper TESTCONF01 1 localhost /usr/local $datestamp 1/-1 0 \[sec [\d.]+ bytes 786432 kps [\d.]+\]$),
+    qr(^PARTPARTIAL taper TESTCONF01 2 localhost /usr/local $datestamp 2/-1 0 \[sec [\d.]+ bytes 163840 kps [\d.]+\] "No space left on device"$),
     qr(^INFO taper Will request retry of failed split part\.$),
     qr(^INFO taper tape TESTCONF01 kb 768 fm 2 \[OK\]$),
+    qr(^INFO taper Slot 2 without label can be labeled$),
     qr(^START taper datestamp $datestamp label TESTCONF02 tape 2$),
-    qr(^PART taper TESTCONF02 1 localhost /usr/local $datestamp 2/-1 0 \[sec [\d.]+ kb 768 kps [\d.]+\]$),
-    qr(^PART taper TESTCONF02 2 localhost /usr/local $datestamp 3/-1 0 \[sec [\d.]+ kb 3 kps [\d.]+\]$),
-    qr(^DONE taper localhost /usr/local $datestamp 3 0 \[sec [\d.]+ kb 1539 kps [\d.]+ orig-kb 1012\]$),
+    qr(^PART taper TESTCONF02 1 localhost /usr/local $datestamp 2/-1 0 \[sec [\d.]+ bytes 786432 kps [\d.]+\]$),
+    qr(^PART taper TESTCONF02 2 localhost /usr/local $datestamp 3/-1 0 \[sec [\d.]+ bytes 3072 kps [\d.]+\]$),
+    qr(^DONE taper localhost /usr/local $datestamp 3 0 \[sec [\d.]+ bytes 1575936 kps [\d.]+ orig-kb 1012\]$),
     qr(^INFO taper tape TESTCONF02 kb 771 fm 2 \[OK\]$),
 ], "multivolume PORT-WRITE logged correctly");
 
@@ -526,7 +539,7 @@ taper_cmd("START-SCAN worker0 $handle");
 taper_cmd("NEW-TAPE worker0 $handle");
 like(taper_reply, qr/^NEW-TAPE $handle TESTCONF01$/,
        "got proper NEW-TAPE worker0 $handle") or die;
-like(taper_reply, qr/^PARTDONE $handle TESTCONF01 1 768 "\[sec [\d.]+ kb 768 kps [\d.]+ orig-kb 1112\]"$/,
+like(taper_reply, qr/^PARTDONE $handle TESTCONF01 1 768 "\[sec [\d.]+ bytes 786432 kps [\d.]+ orig-kb 1112\]"$/,
        "got PARTDONE for filenum 1") or die;
 like(taper_reply, qr/^REQUEST-NEW-TAPE $handle$/,
        "got REQUEST-NEW-TAPE worker0 $handle") or die;
@@ -534,25 +547,27 @@ taper_cmd("START-SCAN worker0 $handle");
 taper_cmd("NEW-TAPE worker0 $handle");
 like(taper_reply, qr/^NEW-TAPE $handle TESTCONF02$/,
        "got proper NEW-TAPE worker0 $handle") or die;
-like(taper_reply, qr/^PARTDONE $handle TESTCONF02 1 768 "\[sec [\d.]+ kb 768 kps [\d.]+ orig-kb 1112\]"$/,
+like(taper_reply, qr/^PARTDONE $handle TESTCONF02 1 768 "\[sec [\d.]+ bytes 786432 kps [\d.]+ orig-kb 1112\]"$/,
        "got PARTDONE for filenum 1 on second tape") or die;
-like(taper_reply, qr/^PARTDONE $handle TESTCONF02 2 3 "\[sec [\d.]+ kb 3 kps [\d.]+ orig-kb 1112\]"$/,
+like(taper_reply, qr/^PARTDONE $handle TESTCONF02 2 3 "\[sec [\d.]+ bytes 3072 kps [\d.]+ orig-kb 1112\]"$/,
        "got PARTDONE for filenum 2 on second tape") or die;
-like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ kb 1539 kps [\d.]+ orig-kb 1112\]" "" ""$/,
+like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ bytes 1575936 kps [\d.]+ orig-kb 1112\]" "" ""$/,
        "got DONE") or die;
 taper_cmd("QUIT");
 wait_for_exit();
 
 check_logs([
+    qr(^INFO taper Slot 1 without label can be labeled$),
     qr(^START taper datestamp $datestamp label TESTCONF01 tape 1$),
-    qr(^PART taper TESTCONF01 1 localhost /usr $datestamp 1/-1 0 \[sec [\d.]+ kb 768 kps [\d.]+ orig-kb 1112\]$),
-    qr(^PARTPARTIAL taper TESTCONF01 2 localhost /usr $datestamp 2/-1 0 \[sec [\d.]+ kb 160 kps [\d.]+ orig-kb 1112\] "No space left on device"$),
+    qr(^PART taper TESTCONF01 1 localhost /usr $datestamp 1/-1 0 \[sec [\d.]+ bytes 786432 kps [\d.]+ orig-kb 1112\]$),
+    qr(^PARTPARTIAL taper TESTCONF01 2 localhost /usr $datestamp 2/-1 0 \[sec [\d.]+ bytes 163840 kps [\d.]+ orig-kb 1112\] "No space left on device"$),
     qr(^INFO taper Will request retry of failed split part\.$),
     qr(^INFO taper tape TESTCONF01 kb 768 fm 2 \[OK\]$),
+    qr(^INFO taper Slot 2 without label can be labeled$),
     qr(^START taper datestamp $datestamp label TESTCONF02 tape 2$),
-    qr(^PART taper TESTCONF02 1 localhost /usr $datestamp 2/-1 0 \[sec [\d.]+ kb 768 kps [\d.]+ orig-kb 1112\]$),
-    qr(^PART taper TESTCONF02 2 localhost /usr $datestamp 3/-1 0 \[sec [\d.]+ kb 3 kps [\d.]+ orig-kb 1112\]$),
-    qr(^DONE taper localhost /usr $datestamp 3 0 \[sec [\d.]+ kb 1539 kps [\d.]+ orig-kb 1112\]$),
+    qr(^PART taper TESTCONF02 1 localhost /usr $datestamp 2/-1 0 \[sec [\d.]+ bytes 786432 kps [\d.]+ orig-kb 1112\]$),
+    qr(^PART taper TESTCONF02 2 localhost /usr $datestamp 3/-1 0 \[sec [\d.]+ bytes 3072 kps [\d.]+ orig-kb 1112\]$),
+    qr(^DONE taper localhost /usr $datestamp 3 0 \[sec [\d.]+ bytes 1575936 kps [\d.]+ orig-kb 1112\]$),
     qr(^INFO taper tape TESTCONF02 kb 771 fm 2 \[OK\]$),
 ], "multivolume FILE-WRITE logged correctly");
 
@@ -574,7 +589,7 @@ taper_cmd("START-SCAN worker0 $handle");
 taper_cmd("NEW-TAPE worker0 $handle");
 like(taper_reply, qr/^NEW-TAPE $handle TESTCONF01$/,
        "got proper NEW-TAPE worker0 $handle") or die;
-like(taper_reply, qr/^PARTDONE $handle TESTCONF01 1 768 "\[sec [\d.]+ kb 768 kps [\d.]+\]"$/,
+like(taper_reply, qr/^PARTDONE $handle TESTCONF01 1 768 "\[sec [\d.]+ bytes 786432 kps [\d.]+\]"$/,
        "got PARTDONE for filenum 1") or die;
 like(taper_reply, qr/^REQUEST-NEW-TAPE $handle$/,
        "got REQUEST-NEW-TAPE worker0 $handle") or die;
@@ -582,28 +597,30 @@ taper_cmd("START-SCAN worker0 $handle");
 taper_cmd("NEW-TAPE worker0 $handle");
 like(taper_reply, qr/^NEW-TAPE $handle TESTCONF02$/,
        "got proper NEW-TAPE worker0 $handle") or die;
-like(taper_reply, qr/^PARTDONE $handle TESTCONF02 1 768 "\[sec [\d.]+ kb 768 kps [\d.]+\]"$/,
+like(taper_reply, qr/^PARTDONE $handle TESTCONF02 1 768 "\[sec [\d.]+ bytes 786432 kps [\d.]+\]"$/,
        "got PARTDONE for filenum 1 on second tape") or die;
-like(taper_reply, qr/^PARTDONE $handle TESTCONF02 2 3 "\[sec [\d.]+ kb 3 kps [\d.]+\]"$/,
+like(taper_reply, qr/^PARTDONE $handle TESTCONF02 2 3 "\[sec [\d.]+ bytes 3072 kps [\d.]+\]"$/,
        "got PARTDONE for filenum 2 on second tape") or die;
 like(taper_reply, qr/^DUMPER-STATUS $handle$/,
        "got DUMPER-STATUS request") or die;
 taper_cmd("DONE worker0 $handle 1212");
-like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ kb 1539 kps [\d.]+ orig-kb 1212\]" "" ""$/,
+like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ bytes 1575936 kps [\d.]+ orig-kb 1212\]" "" ""$/,
        "got DONE") or die;
 taper_cmd("QUIT");
 wait_for_exit();
 
 check_logs([
+    qr(^INFO taper Slot 1 without label can be labeled$),
     qr(^START taper datestamp $datestamp label TESTCONF01 tape 1$),
-    qr(^PART taper TESTCONF01 1 localhost /usr/local $datestamp 1/-1 0 \[sec [\d.]+ kb 768 kps [\d.]+\]$),
-    qr(^PARTPARTIAL taper TESTCONF01 2 localhost /usr/local $datestamp 2/-1 0 \[sec [\d.]+ kb 160 kps [\d.]+\] "No space left on device"$),
+    qr(^PART taper TESTCONF01 1 localhost /usr/local $datestamp 1/-1 0 \[sec [\d.]+ bytes 786432 kps [\d.]+\]$),
+    qr(^PARTPARTIAL taper TESTCONF01 2 localhost /usr/local $datestamp 2/-1 0 \[sec [\d.]+ bytes 163840 kps [\d.]+\] "No space left on device"$),
     qr(^INFO taper Will request retry of failed split part\.$),
     qr(^INFO taper tape TESTCONF01 kb 768 fm 2 \[OK\]$),
+    qr(^INFO taper Slot 2 without label can be labeled$),
     qr(^START taper datestamp $datestamp label TESTCONF02 tape 2$),
-    qr(^PART taper TESTCONF02 1 localhost /usr/local $datestamp 2/-1 0 \[sec [\d.]+ kb 768 kps [\d.]+\]$),
-    qr(^PART taper TESTCONF02 2 localhost /usr/local $datestamp 3/-1 0 \[sec [\d.]+ kb 3 kps [\d.]+\]$),
-    qr(^DONE taper localhost /usr/local $datestamp 3 0 \[sec [\d.]+ kb 1539 kps [\d.]+ orig-kb 1212\]$),
+    qr(^PART taper TESTCONF02 1 localhost /usr/local $datestamp 2/-1 0 \[sec [\d.]+ bytes 786432 kps [\d.]+\]$),
+    qr(^PART taper TESTCONF02 2 localhost /usr/local $datestamp 3/-1 0 \[sec [\d.]+ bytes 3072 kps [\d.]+\]$),
+    qr(^DONE taper localhost /usr/local $datestamp 3 0 \[sec [\d.]+ bytes 1575936 kps [\d.]+ orig-kb 1212\]$),
     qr(^INFO taper tape TESTCONF02 kb 771 fm 2 \[OK\]$),
 ], "multivolume PORT-WRITE (disk cache) logged correctly");
 
@@ -626,7 +643,7 @@ taper_cmd("START-SCAN worker0 $handle");
 taper_cmd("NEW-TAPE worker0 $handle");
 like(taper_reply, qr/^NEW-TAPE $handle TESTCONF01$/,
        "got proper NEW-TAPE worker0 $handle") or die;
-like(taper_reply, qr/^PARTIAL $handle INPUT-GOOD TAPE-ERROR "\[sec [\d.]+ kb 0 kps [\d.]+\]" "" "No space left on device"$/,
+like(taper_reply, qr/^PARTIAL $handle INPUT-GOOD TAPE-ERROR "\[sec [\d.]+ bytes 0 kps [\d.]+\]" "" "No space left on device, splitting not enabled"$/,
        "got PARTIAL") or die;
 # retry on the next tape
 $handle = "11-88899";
@@ -640,24 +657,26 @@ taper_cmd("START-SCAN worker0 $handle");
 taper_cmd("NEW-TAPE worker0 $handle");
 like(taper_reply, qr/^NEW-TAPE $handle TESTCONF02$/,
        "got proper NEW-TAPE worker0 $handle") or die;
-like(taper_reply, qr/^PARTDONE $handle TESTCONF02 1 64 "\[sec [\d.]+ kb 64 kps [\d.]+\]"$/,
+like(taper_reply, qr/^PARTDONE $handle TESTCONF02 1 64 "\[sec [\d.]+ bytes 65536 kps [\d.]+\]"$/,
        "got PARTDONE for filenum 1 on second tape") or die;
 like(taper_reply, qr/^DUMPER-STATUS $handle$/,
        "got DUMPER-STATUS request") or die;
 taper_cmd("DONE worker0 $handle 64");
-like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ kb 64 kps [\d.]+ orig-kb 64\]" "" ""$/,
+like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ bytes 65536 kps [\d.]+ orig-kb 64\]" "" ""$/,
        "got DONE") or die;
 taper_cmd("QUIT");
 wait_for_exit();
 
 check_logs([
+    qr(^INFO taper Slot 1 without label can be labeled$),
     qr(^START taper datestamp $datestamp label TESTCONF01 tape 1$),
-    qr(^PARTPARTIAL taper TESTCONF01 1 localhost /var/log $datestamp 1/-1 0 \[sec [\d.]+ kb 960 kps [\d.]+\] "No space left on device"$),
-    qr(^PARTIAL taper localhost /var/log $datestamp 1 0 \[sec [\d.]+ kb 0 kps [\d.]+\] "No space left on device"$),
+    qr(^PARTPARTIAL taper TESTCONF01 1 localhost /var/log $datestamp 1/-1 0 \[sec [\d.]+ bytes 983040 kps [\d.]+\] "No space left on device"$),
+    qr(^PARTIAL taper localhost /var/log $datestamp 1 0 \[sec [\d.]+ bytes 0 kps [\d.]+\] "No space left on device, splitting not enabled"$),
     qr(^INFO taper tape TESTCONF01 kb 0 fm 1 \[OK\]$),
+    qr(^INFO taper Slot 2 without label can be labeled$),
     qr(^START taper datestamp $datestamp label TESTCONF02 tape 2$),
-    qr(^PART taper TESTCONF02 1 localhost /boot $datestamp 1/-1 0 \[sec [\d.]+ kb 64 kps [\d.]+\]$),
-    qr(^DONE taper localhost /boot $datestamp 1 0 \[sec [\d.]+ kb 64 kps [\d.]+ orig-kb 64\]$),
+    qr(^PART taper TESTCONF02 1 localhost /boot $datestamp 1/-1 0 \[sec [\d.]+ bytes 65536 kps [\d.]+\]$),
+    qr(^DONE taper localhost /boot $datestamp 1 0 \[sec [\d.]+ bytes 65536 kps [\d.]+ orig-kb 64\]$),
     qr(^INFO taper tape TESTCONF02 kb 64 fm 1 \[OK\]$),
 ], "failure on EOT (no cache) with subsequent dump logged correctly");
 
@@ -677,24 +696,25 @@ taper_cmd("START-SCAN worker0 $handle");
 taper_cmd("NEW-TAPE worker0 $handle");
 like(taper_reply, qr/^NEW-TAPE $handle TESTCONF01$/,
        "got proper NEW-TAPE worker0 $handle") or die;
-like(taper_reply, qr/^PARTDONE $handle TESTCONF01 1 256 "\[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1312\]"$/,
+like(taper_reply, qr/^PARTDONE $handle TESTCONF01 1 256 "\[sec [\d.]+ bytes 262144 kps [\d.]+ orig-kb 1312\]"$/,
        "got PARTDONE for filenum 1 on first tape") or die;
 like(taper_reply, qr/^REQUEST-NEW-TAPE $handle$/,
        "got REQUEST-NEW-TAPE worker0 $handle") or die;
 taper_cmd("NO-NEW-TAPE worker0 $handle \"that's enough\"");
-like(taper_reply, qr/^PARTIAL $handle INPUT-GOOD TAPE-ERROR "\[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1312\]" "" "that's enough"$/,
+like(taper_reply, qr/^PARTIAL $handle INPUT-GOOD TAPE-ERROR "\[sec [\d.]+ bytes 262144 kps [\d.]+ orig-kb 1312\]" "" "that's enough"$/,
        "got PARTIAL") or die;
 taper_cmd("QUIT");
 wait_for_exit();
 
 check_logs([
+    qr(^INFO taper Slot 1 without label can be labeled$),
     qr(^START taper datestamp $datestamp label TESTCONF01 tape 1$),
-    qr(^PART taper TESTCONF01 1 localhost /music $datestamp 1/-1 0 \[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1312\]$),
-    qr(^PARTPARTIAL taper TESTCONF01 2 localhost /music $datestamp 2/-1 0 \[sec [\d.]+ kb 160 kps [\d.]+ orig-kb 1312\] "No space left on device"$),
+    qr(^PART taper TESTCONF01 1 localhost /music $datestamp 1/-1 0 \[sec [\d.]+ bytes 262144 kps [\d.]+ orig-kb 1312\]$),
+    qr(^PARTPARTIAL taper TESTCONF01 2 localhost /music $datestamp 2/-1 0 \[sec [\d.]+ bytes 163840 kps [\d.]+ orig-kb 1312\] "No space left on device"$),
     qr(^INFO taper Will request retry of failed split part\.$),
     qr(^INFO taper tape TESTCONF01 kb 256 fm 2 \[OK\]$),
     qr(^ERROR taper no-tape config \[that's enough\]$),
-    qr(^PARTIAL taper localhost /music $datestamp 2 0 \[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1312\] "that's enough"$),
+    qr(^PARTIAL taper localhost /music $datestamp 2 0 \[sec [\d.]+ bytes 262144 kps [\d.]+ orig-kb 1312\] "that's enough"$),
 ], "running out of tapes (simulating runtapes=1) logged correctly");
 
 ##
@@ -715,29 +735,30 @@ taper_cmd("START-SCAN worker0 $handle");
 taper_cmd("NEW-TAPE worker0 $handle");
 like(taper_reply, qr/^NEW-TAPE $handle TESTCONF01$/,
        "got proper NEW-TAPE worker0 $handle") or die;
-like(taper_reply, qr/^PARTDONE $handle TESTCONF01 1 640 "\[sec [\d.]+ kb 640 kps [\d.]+\]"$/,
+like(taper_reply, qr/^PARTDONE $handle TESTCONF01 1 640 "\[sec [\d.]+ bytes 655360 kps [\d.]+\]"$/,
        "got PARTDONE for filenum 1") or die;
-like(taper_reply, qr/^PARTDONE $handle TESTCONF01 2 640 "\[sec [\d.]+ kb 640 kps [\d.]+\]"$/,
+like(taper_reply, qr/^PARTDONE $handle TESTCONF01 2 640 "\[sec [\d.]+ bytes 655360 kps [\d.]+\]"$/,
        "got PARTDONE for filenum 2") or die;
-like(taper_reply, qr/^PARTDONE $handle TESTCONF01 3 640 "\[sec [\d.]+ kb 640 kps [\d.]+\]"$/,
+like(taper_reply, qr/^PARTDONE $handle TESTCONF01 3 640 "\[sec [\d.]+ bytes 655360 kps [\d.]+\]"$/,
        "got PARTDONE for filenum 3") or die;
-like(taper_reply, qr/^PARTDONE $handle TESTCONF01 4 96 "\[sec [\d.]+ kb 96 kps [\d.]+\]"$/,
+like(taper_reply, qr/^PARTDONE $handle TESTCONF01 4 96 "\[sec [\d.]+ bytes 98304 kps [\d.]+\]"$/,
        "got PARTDONE for filenum 4") or die;
 like(taper_reply, qr/^DUMPER-STATUS $handle$/,
        "got DUMPER-STATUS request") or die;
 taper_cmd("FAILED worker0 $handle");
-like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ kb 2016 kps [\d.]+\]" "" ""$/,
+like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ bytes 2064384 kps [\d.]+\]" "" ""$/,
        "got DONE") or die;
 taper_cmd("QUIT");
 wait_for_exit();
 
 check_logs([
+    qr(^INFO taper Slot 1 without label can be labeled$),
     qr(^START taper datestamp $datestamp label TESTCONF01 tape 1$),
-    qr(^PART taper TESTCONF01 1 localhost /sbin $datestamp 1/-1 0 \[sec [\d.]+ kb 640 kps [\d.]+\]$),
-    qr(^PART taper TESTCONF01 2 localhost /sbin $datestamp 2/-1 0 \[sec [\d.]+ kb 640 kps [\d.]+\]$),
-    qr(^PART taper TESTCONF01 3 localhost /sbin $datestamp 3/-1 0 \[sec [\d.]+ kb 640 kps [\d.]+\]$),
-    qr(^PART taper TESTCONF01 4 localhost /sbin $datestamp 4/-1 0 \[sec [\d.]+ kb 96 kps [\d.]+\]$),
-    qr(^PARTIAL taper localhost /sbin $datestamp 4 0 \[sec [\d.]+ kb 2016 kps [\d.]+\]$), # note no error message
+    qr(^PART taper TESTCONF01 1 localhost /sbin $datestamp 1/-1 0 \[sec [\d.]+ bytes 655360 kps [\d.]+\]$),
+    qr(^PART taper TESTCONF01 2 localhost /sbin $datestamp 2/-1 0 \[sec [\d.]+ bytes 655360 kps [\d.]+\]$),
+    qr(^PART taper TESTCONF01 3 localhost /sbin $datestamp 3/-1 0 \[sec [\d.]+ bytes 655360 kps [\d.]+\]$),
+    qr(^PART taper TESTCONF01 4 localhost /sbin $datestamp 4/-1 0 \[sec [\d.]+ bytes 98304 kps [\d.]+\]$),
+    qr(^PARTIAL taper localhost /sbin $datestamp 4 0 \[sec [\d.]+ bytes 2064384 kps [\d.]+\]$), # note no error message
     qr(^INFO taper tape TESTCONF01 kb 2016 fm 4 \[OK\]$),
 ], "DUMPER_STATUS => FAILED logged correctly");
 
@@ -757,16 +778,16 @@ taper_cmd("START-SCAN worker0 $handle");
 taper_cmd("NEW-TAPE worker0 $handle");
 like(taper_reply, qr/^NEW-TAPE $handle TESTCONF01$/,
        "got proper NEW-TAPE worker0 $handle") or die;
-like(taper_reply, qr/^PARTDONE $handle TESTCONF01 1 256 "\[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1412\]"$/,
+like(taper_reply, qr/^PARTDONE $handle TESTCONF01 1 256 "\[sec [\d.]+ bytes 262144 kps [\d.]+ orig-kb 1412\]"$/,
        "got PARTDONE for filenum 1") or die;
-like(taper_reply, qr/^PARTDONE $handle TESTCONF01 2 232 "\[sec [\d.]+ kb 232 kps [\d.]+ orig-kb 1412\]"$/,
+like(taper_reply, qr/^PARTDONE $handle TESTCONF01 2 232 "\[sec [\d.]+ bytes 237856 kps [\d.]+ orig-kb 1412\]"$/,
        "got PARTDONE for filenum 2") or die;
-like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ kb 488 kps [\d.]+ orig-kb 1412\]" "" ""$/,
+like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ bytes 500000 kps [\d.]+ orig-kb 1412\]" "" ""$/,
        "got DONE") or die;
 $handle = "33-22222";
 make_holding_file(614400, "localhost", "/u02");
 taper_cmd("FILE-WRITE worker0 $handle \"$test_filename\" localhost /u02 0 $datestamp 262144 \"\" \"\" \"\" \"\" \"\" \"\" \"\" 1512");
-like(taper_reply, qr/^PARTDONE $handle TESTCONF01 3 256 "\[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1512\]"$/,
+like(taper_reply, qr/^PARTDONE $handle TESTCONF01 3 256 "\[sec [\d.]+ bytes 262144 kps [\d.]+ orig-kb 1512\]"$/,
        "got PARTDONE for filenum 3") or die;
 like(taper_reply, qr/^REQUEST-NEW-TAPE $handle$/,
        "got REQUEST-NEW-TAPE worker0 $handle") or die;
@@ -774,28 +795,30 @@ taper_cmd("START-SCAN worker0 $handle");
 taper_cmd("NEW-TAPE worker0 $handle");
 like(taper_reply, qr/^NEW-TAPE $handle TESTCONF02$/,
        "got proper NEW-TAPE worker0 $handle") or die;
-like(taper_reply, qr/^PARTDONE $handle TESTCONF02 1 256 "\[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1512\]"$/,
+like(taper_reply, qr/^PARTDONE $handle TESTCONF02 1 256 "\[sec [\d.]+ bytes 262144 kps [\d.]+ orig-kb 1512\]"$/,
        "got PARTDONE for filenum 1 on second tape") or die;
-like(taper_reply, qr/^PARTDONE $handle TESTCONF02 2 88 "\[sec [\d.]+ kb 88 kps [\d.]+ orig-kb 1512\]"$/,
+like(taper_reply, qr/^PARTDONE $handle TESTCONF02 2 88 "\[sec [\d.]+ bytes 90112 kps [\d.]+ orig-kb 1512\]"$/,
        "got PARTDONE for filenum 2 on second tape") or die;
-like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ kb 600 kps [\d.]+ orig-kb 1512\]" "" ""$/,
+like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ bytes 614400 kps [\d.]+ orig-kb 1512\]" "" ""$/,
        "got DONE") or die;
 taper_cmd("QUIT");
 wait_for_exit();
 
 check_logs([
+    qr(^INFO taper Slot 1 without label can be labeled$),
     qr(^START taper datestamp $datestamp label TESTCONF01 tape 1$),
-    qr(^PART taper TESTCONF01 1 localhost /u01 $datestamp 1/-1 0 \[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1412\]$),
-    qr(^PART taper TESTCONF01 2 localhost /u01 $datestamp 2/-1 0 \[sec [\d.]+ kb 232 kps [\d.]+ orig-kb 1412\]$),
-    qr(^DONE taper localhost /u01 $datestamp 2 0 \[sec [\d.]+ kb 488 kps [\d.]+ orig-kb 1412\]$),
-    qr(^PART taper TESTCONF01 3 localhost /u02 $datestamp 1/-1 0 \[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1512\]$),
-    qr(^PARTPARTIAL taper TESTCONF01 4 localhost /u02 $datestamp 2/-1 0 \[sec [\d.]+ kb 96 kps [\d.]+ orig-kb 1512\] "No space left on device"$),
+    qr(^PART taper TESTCONF01 1 localhost /u01 $datestamp 1/-1 0 \[sec [\d.]+ bytes 262144 kps [\d.]+ orig-kb 1412\]$),
+    qr(^PART taper TESTCONF01 2 localhost /u01 $datestamp 2/-1 0 \[sec [\d.]+ bytes 237856 kps [\d.]+ orig-kb 1412\]$),
+    qr(^DONE taper localhost /u01 $datestamp 2 0 \[sec [\d.]+ bytes 500000 kps [\d.]+ orig-kb 1412\]$),
+    qr(^PART taper TESTCONF01 3 localhost /u02 $datestamp 1/-1 0 \[sec [\d.]+ bytes 262144 kps [\d.]+ orig-kb 1512\]$),
+    qr(^PARTPARTIAL taper TESTCONF01 4 localhost /u02 $datestamp 2/-1 0 \[sec [\d.]+ bytes 98304 kps [\d.]+ orig-kb 1512\] "No space left on device"$),
     qr(^INFO taper Will request retry of failed split part\.$),
     qr(^INFO taper tape TESTCONF01 kb 744 fm 4 \[OK\]$),
+    qr(^INFO taper Slot 2 without label can be labeled$),
     qr(^START taper datestamp $datestamp label TESTCONF02 tape 2$),
-    qr(^PART taper TESTCONF02 1 localhost /u02 $datestamp 2/-1 0 \[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1512\]$),
-    qr(^PART taper TESTCONF02 2 localhost /u02 $datestamp 3/-1 0 \[sec [\d.]+ kb 88 kps [\d.]+ orig-kb 1512\]$),
-    qr(^DONE taper localhost /u02 $datestamp 3 0 \[sec [\d.]+ kb 600 kps [\d.]+ orig-kb 1512\]$),
+    qr(^PART taper TESTCONF02 1 localhost /u02 $datestamp 2/-1 0 \[sec [\d.]+ bytes 262144 kps [\d.]+ orig-kb 1512\]$),
+    qr(^PART taper TESTCONF02 2 localhost /u02 $datestamp 3/-1 0 \[sec [\d.]+ bytes 90112 kps [\d.]+ orig-kb 1512\]$),
+    qr(^DONE taper localhost /u02 $datestamp 3 0 \[sec [\d.]+ bytes 614400 kps [\d.]+ orig-kb 1512\]$),
     qr(^INFO taper tape TESTCONF02 kb 344 fm 2 \[OK\]$),
 ], "first taper invocation in sequence logged correctly");
 cleanup_log();
@@ -813,18 +836,18 @@ taper_cmd("START-SCAN worker0 $handle");
 taper_cmd("NEW-TAPE worker0 $handle");
 like(taper_reply, qr/^NEW-TAPE $handle TESTCONF03$/,
        "got proper NEW-TAPE worker0 $handle") or die;
-like(taper_reply, qr/^PARTDONE $handle TESTCONF03 1 256 "\[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1612\]"$/,
+like(taper_reply, qr/^PARTDONE $handle TESTCONF03 1 256 "\[sec [\d.]+ bytes 262144 kps [\d.]+ orig-kb 1612\]"$/,
        "got PARTDONE for filenum 1") or die;
-like(taper_reply, qr/^PARTDONE $handle TESTCONF03 2 36 "\[sec [\d.]+ kb 36 kps [\d.]+ orig-kb 1612\]"$/,
+like(taper_reply, qr/^PARTDONE $handle TESTCONF03 2 36 "\[sec [\d.]+ bytes 37856 kps [\d.]+ orig-kb 1612\]"$/,
        "got PARTDONE for filenum 2") or die;
-like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ kb 292 kps [\d.]+ orig-kb 1612\]" "" ""$/,
+like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ bytes 300000 kps [\d.]+ orig-kb 1612\]" "" ""$/,
        "got DONE") or die;
 $handle = "33-44444";
 make_holding_file(614400, "localhost", "/u02");
 taper_cmd("FILE-WRITE worker0 $handle \"$test_filename\" localhost /u02 0 $datestamp 262144 \"\" \"\" \"\" \"\" \"\" \"\" \"\" 1712");
-like(taper_reply, qr/^PARTDONE $handle TESTCONF03 3 256 "\[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1712\]"$/,
+like(taper_reply, qr/^PARTDONE $handle TESTCONF03 3 256 "\[sec [\d.]+ bytes 262144 kps [\d.]+ orig-kb 1712\]"$/,
        "got PARTDONE for filenum 3") or die;
-like(taper_reply, qr/^PARTDONE $handle TESTCONF03 4 256 "\[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1712\]"$/,
+like(taper_reply, qr/^PARTDONE $handle TESTCONF03 4 256 "\[sec [\d.]+ bytes 262144 kps [\d.]+ orig-kb 1712\]"$/,
        "got PARTDONE for filenum 4") or die;
 like(taper_reply, qr/^REQUEST-NEW-TAPE $handle$/,
        "got REQUEST-NEW-TAPE worker0 $handle") or die;
@@ -832,26 +855,29 @@ taper_cmd("START-SCAN worker0 $handle");
 taper_cmd("NEW-TAPE worker0 $handle");
 like(taper_reply, qr/^NEW-TAPE $handle TESTCONF01$/,
        "got proper NEW-TAPE worker0 $handle") or die;
-like(taper_reply, qr/^PARTDONE $handle TESTCONF01 1 88 "\[sec [\d.]+ kb 88 kps [\d.]+ orig-kb 1712\]"$/,
+like(taper_reply, qr/^PARTDONE $handle TESTCONF01 1 88 "\[sec [\d.]+ bytes 90112 kps [\d.]+ orig-kb 1712\]"$/,
        "got PARTDONE for filenum 1 on second tape") or die;
-like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ kb 600 kps [\d.]+ orig-kb 1712\]" "" ""$/,
+like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ bytes 614400 kps [\d.]+ orig-kb 1712\]" "" ""$/,
        "got DONE") or die;
 taper_cmd("QUIT");
 wait_for_exit();
 
 check_logs([
+    qr(^INFO taper Slot 2 with label TESTCONF02 is not reusable$),
+    qr(^INFO taper Slot 3 without label can be labeled$),
     qr(^START taper datestamp $datestamp label TESTCONF03 tape 1$),
-    qr(^PART taper TESTCONF03 1 localhost /u01 $datestamp 1/-1 0 \[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1612\]$),
-    qr(^PART taper TESTCONF03 2 localhost /u01 $datestamp 2/-1 0 \[sec [\d.]+ kb 36 kps [\d.]+ orig-kb 1612\]$),
-    qr(^DONE taper localhost /u01 $datestamp 2 0 \[sec [\d.]+ kb 292 kps [\d.]+ orig-kb 1612\]$),
-    qr(^PART taper TESTCONF03 3 localhost /u02 $datestamp 1/-1 0 \[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1712\]$),
-    qr(^PART taper TESTCONF03 4 localhost /u02 $datestamp 2/-1 0 \[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1712\]$),
-    qr(^PARTPARTIAL taper TESTCONF03 5 localhost /u02 $datestamp 3/-1 0 \[sec [\d.]+ kb 0 kps [\d.]+ orig-kb 1712\] "No space left on device"$),
+    qr(^PART taper TESTCONF03 1 localhost /u01 $datestamp 1/-1 0 \[sec [\d.]+ bytes 262144 kps [\d.]+ orig-kb 1612\]$),
+    qr(^PART taper TESTCONF03 2 localhost /u01 $datestamp 2/-1 0 \[sec [\d.]+ bytes 37856 kps [\d.]+ orig-kb 1612\]$),
+    qr(^DONE taper localhost /u01 $datestamp 2 0 \[sec [\d.]+ bytes 300000 kps [\d.]+ orig-kb 1612\]$),
+    qr(^PART taper TESTCONF03 3 localhost /u02 $datestamp 1/-1 0 \[sec [\d.]+ bytes 262144 kps [\d.]+ orig-kb 1712\]$),
+    qr(^PART taper TESTCONF03 4 localhost /u02 $datestamp 2/-1 0 \[sec [\d.]+ bytes 262144 kps [\d.]+ orig-kb 1712\]$),
+    qr(^PARTPARTIAL taper TESTCONF03 5 localhost /u02 $datestamp 3/-1 0 \[sec [\d.]+ bytes 0 kps [\d.]+ orig-kb 1712\] "No space left on device"$),
     qr(^INFO taper Will request retry of failed split part\.$),
     qr(^INFO taper tape TESTCONF03 kb 804 fm 5 \[OK\]$),
+    qr(^INFO taper Slot 1 with label TESTCONF01 is usable$),
     qr(^START taper datestamp $datestamp label TESTCONF01 tape 2$),
-    qr(^PART taper TESTCONF01 1 localhost /u02 $datestamp 3/-1 0 \[sec [\d.]+ kb 88 kps [\d.]+ orig-kb 1712\]$),
-    qr(^DONE taper localhost /u02 $datestamp 3 0 \[sec [\d.]+ kb 600 kps [\d.]+ orig-kb 1712\]$),
+    qr(^PART taper TESTCONF01 1 localhost /u02 $datestamp 3/-1 0 \[sec [\d.]+ bytes 90112 kps [\d.]+ orig-kb 1712\]$),
+    qr(^DONE taper localhost /u02 $datestamp 3 0 \[sec [\d.]+ bytes 614400 kps [\d.]+ orig-kb 1712\]$),
     qr(^INFO taper tape TESTCONF01 kb 88 fm 1 \[OK\]$),
 ], "second taper invocation in sequence logged correctly");
 cleanup_log();
@@ -919,11 +945,11 @@ taper_cmd("START-SCAN worker0 $handle0");
 taper_cmd("NEW-TAPE worker0 $handle0");
 like(taper_reply, qr/^NEW-TAPE $handle0 TESTCONF01$/,
        "got proper NEW-TAPE worker0 $handle0") or die;
-like(taper_reply, qr/^PARTDONE $handle0 TESTCONF01 1 256 "\[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1612\]"$/,
+like(taper_reply, qr/^PARTDONE $handle0 TESTCONF01 1 256 "\[sec [\d.]+ bytes 262144 kps [\d.]+ orig-kb 1612\]"$/,
        "got PARTDONE for filenum 1") or die;
-like(taper_reply, qr/^PARTDONE $handle0 TESTCONF01 2 36 "\[sec [\d.]+ kb 36 kps [\d.]+ orig-kb 1612\]"$/,
+like(taper_reply, qr/^PARTDONE $handle0 TESTCONF01 2 36 "\[sec [\d.]+ bytes 37856 kps [\d.]+ orig-kb 1612\]"$/,
        "got PARTDONE for filenum 2") or die;
-like(taper_reply, qr/^DONE $handle0 INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ kb 292 kps [\d.]+ orig-kb 1612\]" "" ""$/,
+like(taper_reply, qr/^DONE $handle0 INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ bytes 300000 kps [\d.]+ orig-kb 1612\]" "" ""$/,
        "got DONE") or die;
 make_holding_file(614400, "localhost", "/u02");
 taper_cmd("FILE-WRITE worker1 $handle1 \"$test_filename\" localhost /u02 0 $datestamp 262144 \"\" \"\" \"\" \"\" \"\" \"\" \"\" 1712");
@@ -933,27 +959,29 @@ taper_cmd("START-SCAN worker1 $handle1");
 taper_cmd("NEW-TAPE worker1 $handle1");
 like(taper_reply, qr/^NEW-TAPE $handle1 TESTCONF02$/,
        "got proper NEW-TAPE worker1 $handle1") or die;
-like(taper_reply, qr/^PARTDONE $handle1 TESTCONF02 1 256 "\[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1712\]"$/,
+like(taper_reply, qr/^PARTDONE $handle1 TESTCONF02 1 256 "\[sec [\d.]+ bytes 262144 kps [\d.]+ orig-kb 1712\]"$/,
        "got PARTDONE for filenum 1 on second tape") or die;
-like(taper_reply, qr/^PARTDONE $handle1 TESTCONF02 2 256 "\[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1712\]"$/,
+like(taper_reply, qr/^PARTDONE $handle1 TESTCONF02 2 256 "\[sec [\d.]+ bytes 262144 kps [\d.]+ orig-kb 1712\]"$/,
        "got PARTDONE for filenum 2 on second tape") or die;
-like(taper_reply, qr/^PARTDONE $handle1 TESTCONF02 3 88 "\[sec [\d.]+ kb 88 kps [\d.]+ orig-kb 1712\]"$/,
+like(taper_reply, qr/^PARTDONE $handle1 TESTCONF02 3 88 "\[sec [\d.]+ bytes 90112 kps [\d.]+ orig-kb 1712\]"$/,
        "got PARTDONE for filenum 3 on second tape") or die;
-like(taper_reply, qr/^DONE $handle1 INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ kb 600 kps [\d.]+ orig-kb 1712\]" "" ""$/,
+like(taper_reply, qr/^DONE $handle1 INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ bytes 614400 kps [\d.]+ orig-kb 1712\]" "" ""$/,
        "got DONE") or die;
 taper_cmd("QUIT");
 wait_for_exit();
 
 check_logs([
+    qr(^INFO taper Slot 1 without label can be labeled$),
+    qr(^INFO taper Slot 2 without label can be labeled$),
     qr(^START taper datestamp $datestamp label TESTCONF01 tape 1$),
-    qr(^PART taper TESTCONF01 1 localhost /u01 $datestamp 1/-1 0 \[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1612\]$),
-    qr(^PART taper TESTCONF01 2 localhost /u01 $datestamp 2/-1 0 \[sec [\d.]+ kb 36 kps [\d.]+ orig-kb 1612\]$),
-    qr(^DONE taper localhost /u01 $datestamp 2 0 \[sec [\d.]+ kb 292 kps [\d.]+ orig-kb 1612\]$),
+    qr(^PART taper TESTCONF01 1 localhost /u01 $datestamp 1/-1 0 \[sec [\d.]+ bytes 262144 kps [\d.]+ orig-kb 1612\]$),
+    qr(^PART taper TESTCONF01 2 localhost /u01 $datestamp 2/-1 0 \[sec [\d.]+ bytes 37856 kps [\d.]+ orig-kb 1612\]$),
+    qr(^DONE taper localhost /u01 $datestamp 2 0 \[sec [\d.]+ bytes 300000 kps [\d.]+ orig-kb 1612\]$),
     qr(^START taper datestamp $datestamp label TESTCONF02 tape 2$),
-    qr(^PART taper TESTCONF02 1 localhost /u02 $datestamp 1/-1 0 \[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1712\]$),
-    qr(^PART taper TESTCONF02 2 localhost /u02 $datestamp 2/-1 0 \[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1712\]$),
-    qr(^PART taper TESTCONF02 3 localhost /u02 $datestamp 3/-1 0 \[sec [\d.]+ kb 88 kps [\d.]+ orig-kb 1712\]$),
-    qr(^DONE taper localhost /u02 $datestamp 3 0 \[sec [\d.]+ kb 600 kps [\d.]+ orig-kb 1712\]$),
+    qr(^PART taper TESTCONF02 1 localhost /u02 $datestamp 1/-1 0 \[sec [\d.]+ bytes 262144 kps [\d.]+ orig-kb 1712\]$),
+    qr(^PART taper TESTCONF02 2 localhost /u02 $datestamp 2/-1 0 \[sec [\d.]+ bytes 262144 kps [\d.]+ orig-kb 1712\]$),
+    qr(^PART taper TESTCONF02 3 localhost /u02 $datestamp 3/-1 0 \[sec [\d.]+ bytes 90112 kps [\d.]+ orig-kb 1712\]$),
+    qr(^DONE taper localhost /u02 $datestamp 3 0 \[sec [\d.]+ bytes 614400 kps [\d.]+ orig-kb 1712\]$),
     qr(^INFO taper tape TESTCONF01 kb 292 fm 2 \[OK\]$),
     qr(^INFO taper tape TESTCONF02 kb 600 fm 3 \[OK\]$),
 ], "two workers logged correctly");
@@ -977,11 +1005,11 @@ taper_cmd("START-SCAN worker0 $handle");
 taper_cmd("NEW-TAPE worker0 $handle");
 like(taper_reply, qr/^NEW-TAPE $handle TESTCONF01$/,
        "got proper NEW-TAPE worker0 $handle") or die;
-like(taper_reply, qr/^PARTDONE $handle TESTCONF01 1 256 "\[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1612\]"$/,
+like(taper_reply, qr/^PARTDONE $handle TESTCONF01 1 256 "\[sec [\d.]+ bytes 262144 kps [\d.]+ orig-kb 1612\]"$/,
        "got PARTDONE for filenum 1") or die;
-like(taper_reply, qr/^PARTDONE $handle TESTCONF01 2 256 "\[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1612\]"$/,
+like(taper_reply, qr/^PARTDONE $handle TESTCONF01 2 256 "\[sec [\d.]+ bytes 262144 kps [\d.]+ orig-kb 1612\]"$/,
        "got PARTDONE for filenum 2") or die;
-like(taper_reply, qr/^PARTDONE $handle TESTCONF01 3 256 "\[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1612\]"$/,
+like(taper_reply, qr/^PARTDONE $handle TESTCONF01 3 256 "\[sec [\d.]+ bytes 262144 kps [\d.]+ orig-kb 1612\]"$/,
        "got PARTDONE for filenum 3") or die;
 like(taper_reply, qr/^REQUEST-NEW-TAPE $handle$/,
        "got REQUEST-NEW-TAPE worker0 $handle") or die;
@@ -992,24 +1020,26 @@ taper_cmd("START-SCAN worker0 $handle");
 taper_cmd("NEW-TAPE worker0 $handle");
 like(taper_reply, qr/^NEW-TAPE $handle TESTCONF02$/,
        "got proper NEW-TAPE worker0 $handle") or die;
-like(taper_reply, qr/^PARTDONE $handle TESTCONF02 1 208 "\[sec [\d.]+ kb 208 kps [\d.]+ orig-kb 1612\]"$/,
+like(taper_reply, qr/^PARTDONE $handle TESTCONF02 1 208 "\[sec [\d.]+ bytes 213568 kps [\d.]+ orig-kb 1612\]"$/,
        "got PARTDONE for filenum 4") or die;
-like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ kb 976 kps [\d.]+ orig-kb 1612\]" "" ""$/,
+like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ bytes 1000000 kps [\d.]+ orig-kb 1612\]" "" ""$/,
        "got DONE") or die;
 taper_cmd("QUIT");
 wait_for_exit();
 
 check_logs([
+    qr(^INFO taper Slot 1 without label can be labeled$),
+    qr(^INFO taper Slot 2 without label can be labeled$),
     qr(^START taper datestamp $datestamp label TESTCONF01 tape 1$),
-    qr(^PART taper TESTCONF01 1 localhost /u01 $datestamp 1/-1 0 \[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1612\]$),
-    qr(^PART taper TESTCONF01 2 localhost /u01 $datestamp 2/-1 0 \[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1612\]$),
-    qr(^PART taper TESTCONF01 3 localhost /u01 $datestamp 3/-1 0 \[sec [\d.]+ kb 256 kps [\d.]+ orig-kb 1612\]$),
-    qr(^PARTPARTIAL taper TESTCONF01 4 localhost /u01 $datestamp 4/-1 0 \[sec [\d.]+ kb 96 kps [\d.]+ orig-kb 1612\] \"No space left on device\"$),
+    qr(^PART taper TESTCONF01 1 localhost /u01 $datestamp 1/-1 0 \[sec [\d.]+ bytes 262144 kps [\d.]+ orig-kb 1612\]$),
+    qr(^PART taper TESTCONF01 2 localhost /u01 $datestamp 2/-1 0 \[sec [\d.]+ bytes 262144 kps [\d.]+ orig-kb 1612\]$),
+    qr(^PART taper TESTCONF01 3 localhost /u01 $datestamp 3/-1 0 \[sec [\d.]+ bytes 262144 kps [\d.]+ orig-kb 1612\]$),
+    qr(^PARTPARTIAL taper TESTCONF01 4 localhost /u01 $datestamp 4/-1 0 \[sec [\d.]+ bytes 98304 kps [\d.]+ orig-kb 1612\] \"No space left on device\"$),
     qr(^INFO taper Will request retry of failed split part.$),
     qr(^INFO taper tape TESTCONF01 kb 768 fm 4 \[OK\]$),
     qr(^START taper datestamp $datestamp label TESTCONF02 tape 2$),
-    qr(^PART taper TESTCONF02 1 localhost /u01 $datestamp 4/-1 0 \[sec [\d.]+ kb 208 kps [\d.]+ orig-kb 1612\]$),
-    qr(^DONE taper localhost /u01 $datestamp 4 0 \[sec [\d.]+ kb 976 kps [\d.]+ orig-kb 1612\]$),
+    qr(^PART taper TESTCONF02 1 localhost /u01 $datestamp 4/-1 0 \[sec [\d.]+ bytes 213568 kps [\d.]+ orig-kb 1612\]$),
+    qr(^DONE taper localhost /u01 $datestamp 4 0 \[sec [\d.]+ bytes 1000000 kps [\d.]+ orig-kb 1612\]$),
     qr(^INFO taper tape TESTCONF02 kb 208 fm 1 \[OK\]$),
 ], "TAKE-SCRIBE logged correctly");
 cleanup_log();
@@ -1043,11 +1073,11 @@ SKIP : {
     taper_cmd("NEW-TAPE worker0 $handle");
     like(taper_reply, qr/^NEW-TAPE $handle TESTCONF01$/,
            "got proper NEW-TAPE worker0 $handle") or die;
-    like(taper_reply, qr/^PARTDONE $handle TESTCONF01 1 384 "\[sec [\d.]+ kb 384 kps [\d.]+\]"$/,
+    like(taper_reply, qr/^PARTDONE $handle TESTCONF01 1 384 "\[sec [\d.]+ bytes 393216 kps [\d.]+\]"$/,
            "got PARTDONE for part 1") or die;
-    like(taper_reply, qr/^PARTDONE $handle TESTCONF01 2 384 "\[sec [\d.]+ kb 384 kps [\d.]+\]"$/,
+    like(taper_reply, qr/^PARTDONE $handle TESTCONF01 2 384 "\[sec [\d.]+ bytes 393216 kps [\d.]+\]"$/,
            "got PARTDONE for part 2") or die;
-    like(taper_reply, qr/^PARTDONE $handle TESTCONF01 3 64 "\[sec [\d.]+ kb 64 kps [\d.]+\]"$/,
+    like(taper_reply, qr/^PARTDONE $handle TESTCONF01 3 64 "\[sec [\d.]+ bytes 65536 kps [\d.]+\]"$/,
            "got PARTDONE for part 3 (short part)") or die;
     like(taper_reply, qr/^REQUEST-NEW-TAPE $handle$/,
            "got REQUEST-NEW-TAPE worker0 $handle") or die;
@@ -1055,43 +1085,45 @@ SKIP : {
     taper_cmd("NEW-TAPE worker0 $handle");
     like(taper_reply, qr/^NEW-TAPE $handle TESTCONF02$/,
            "got proper NEW-TAPE worker0 $handle") or die;
-    like(taper_reply, qr/^PARTDONE $handle TESTCONF02 1 384 "\[sec [\d.]+ kb 384 kps [\d.]+\]"$/,
+    like(taper_reply, qr/^PARTDONE $handle TESTCONF02 1 384 "\[sec [\d.]+ bytes 393216 kps [\d.]+\]"$/,
            "got PARTDONE for part 4") or die;
-    like(taper_reply, qr/^PARTDONE $handle TESTCONF02 2 32 "\[sec [\d.]+ kb 32 kps [\d.]+\]"$/,
+    like(taper_reply, qr/^PARTDONE $handle TESTCONF02 2 32 "\[sec [\d.]+ bytes 32768 kps [\d.]+\]"$/,
            "got PARTDONE for part 5") or die;
     like(taper_reply, qr/^DUMPER-STATUS $handle$/,
            "got DUMPER-STATUS request") or die;
     taper_cmd("DONE worker0 $handle 1912");
-    like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ kb 1248 kps [\d.]+ orig-kb 1912\]" "" ""$/,
+    like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ bytes 1277952 kps [\d.]+ orig-kb 1912\]" "" ""$/,
            "got DONE") or die;
     $handle = "55-22222";
     taper_cmd("PORT-WRITE worker0 $handle localhost /etc 0 $datestamp 524288 \"\" 393216 \"\" \"\" \"\" \"\" \"\" DIRECTTCP");
     like(taper_reply, qr/^PORT worker0 $handle (\d+) "?(\d+\.\d+\.\d+\.\d+:\d+;?)+"?$/,
            "got PORT with data address");
     write_to_port($last_taper_reply, 300*1024, "localhost", "/etc", 0);
-    like(taper_reply, qr/^PARTDONE $handle TESTCONF02 3 320 "\[sec [\d.]+ kb 320 kps [\d.]+\]"$/,
+    like(taper_reply, qr/^PARTDONE $handle TESTCONF02 3 320 "\[sec [\d.]+ bytes 327680 kps [\d.]+\]"$/,
            "got PARTDONE for part 1") or die;
     like(taper_reply, qr/^DUMPER-STATUS $handle$/,
            "got DUMPER-STATUS request") or die;
     taper_cmd("DONE worker0 $handle 2012");
-    like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ kb 320 kps [\d.]+ orig-kb 2012\]" "" ""$/,
+    like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ bytes 327680 kps [\d.]+ orig-kb 2012\]" "" ""$/,
            "got DONE") or die;
     taper_cmd("QUIT");
     wait_for_exit();
 
     check_logs([
+        qr(^INFO taper Slot 3 without label can be labeled$),
        qr(^START taper datestamp $datestamp label TESTCONF01 tape 1$),
-       qr(^PART taper TESTCONF01 1 localhost /var $datestamp 1/-1 0 \[sec [\d.]+ kb 384 kps [\d.]+\]$),
-       qr(^PART taper TESTCONF01 2 localhost /var $datestamp 2/-1 0 \[sec [\d.]+ kb 384 kps [\d.]+\]$),
-       qr(^PART taper TESTCONF01 3 localhost /var $datestamp 3/-1 0 \[sec [\d.]+ kb 64 kps [\d.]+\]$),
+       qr(^PART taper TESTCONF01 1 localhost /var $datestamp 1/-1 0 \[sec [\d.]+ bytes 393216 kps [\d.]+\]$),
+       qr(^PART taper TESTCONF01 2 localhost /var $datestamp 2/-1 0 \[sec [\d.]+ bytes 393216 kps [\d.]+\]$),
+       qr(^PART taper TESTCONF01 3 localhost /var $datestamp 3/-1 0 \[sec [\d.]+ bytes 65536 kps [\d.]+\]$),
        # note no "Will retry.."
        qr(^INFO taper tape TESTCONF01 kb 832 fm 3 \[OK\]$),
+        qr(^INFO taper Slot 4 without label can be labeled$),
        qr(^START taper datestamp $datestamp label TESTCONF02 tape 2$),
-       qr(^PART taper TESTCONF02 1 localhost /var $datestamp 4/-1 0 \[sec [\d.]+ kb 384 kps [\d.]+\]$),
-       qr(^PART taper TESTCONF02 2 localhost /var $datestamp 5/-1 0 \[sec [\d.]+ kb 32 kps [\d.]+\]$),
-       qr(^DONE taper localhost /var $datestamp 5 0 \[sec [\d.]+ kb 1248 kps [\d.]+ orig-kb 1912\]$),
-       qr(^PART taper TESTCONF02 3 localhost /etc $datestamp 1/-1 0 \[sec [\d.]+ kb 320 kps [\d.]+\]$),
-       qr(^DONE taper localhost /etc $datestamp 1 0 \[sec [\d.]+ kb 320 kps [\d.]+ orig-kb 2012\]$),
+       qr(^PART taper TESTCONF02 1 localhost /var $datestamp 4/-1 0 \[sec [\d.]+ bytes 393216 kps [\d.]+\]$),
+       qr(^PART taper TESTCONF02 2 localhost /var $datestamp 5/-1 0 \[sec [\d.]+ bytes 32768 kps [\d.]+\]$),
+       qr(^DONE taper localhost /var $datestamp 5 0 \[sec [\d.]+ bytes 1277952 kps [\d.]+ orig-kb 1912\]$),
+       qr(^PART taper TESTCONF02 3 localhost /etc $datestamp 1/-1 0 \[sec [\d.]+ bytes 327680 kps [\d.]+\]$),
+       qr(^DONE taper localhost /etc $datestamp 1 0 \[sec [\d.]+ bytes 327680 kps [\d.]+ orig-kb 2012\]$),
        qr(^INFO taper tape TESTCONF02 kb 736 fm 3 \[OK\]$),
     ], "multipart directtcp PORT-WRITE logged correctly");
 
@@ -1112,9 +1144,9 @@ SKIP : {
     taper_cmd("NEW-TAPE worker0 $handle");
     like(taper_reply, qr/^NEW-TAPE $handle TESTCONF01$/,
            "got proper NEW-TAPE worker0 $handle") or die;
-    like(taper_reply, qr/^PARTDONE $handle TESTCONF01 1 416 "\[sec [\d.]+ kb 416 kps [\d.]+\]"$/,
+    like(taper_reply, qr/^PARTDONE $handle TESTCONF01 1 416 "\[sec [\d.]+ bytes 425984 kps [\d.]+\]"$/,
            "got PARTDONE for part 1") or die;
-    like(taper_reply, qr/^PARTDONE $handle TESTCONF01 2 416 "\[sec [\d.]+ kb 416 kps [\d.]+\]"$/,
+    like(taper_reply, qr/^PARTDONE $handle TESTCONF01 2 416 "\[sec [\d.]+ bytes 425984 kps [\d.]+\]"$/,
            "got PARTDONE for part 2") or die;
     # note: zero-byte part is not reported as PARTDONE
     like(taper_reply, qr/^REQUEST-NEW-TAPE $handle$/,
@@ -1123,28 +1155,30 @@ SKIP : {
     taper_cmd("NEW-TAPE worker0 $handle");
     like(taper_reply, qr/^NEW-TAPE $handle TESTCONF02$/,
            "got proper NEW-TAPE worker0 $handle") or die;
-    like(taper_reply, qr/^PARTDONE $handle TESTCONF02 1 416 "\[sec [\d.]+ kb 416 kps [\d.]+\]"$/,
+    like(taper_reply, qr/^PARTDONE $handle TESTCONF02 1 416 "\[sec [\d.]+ bytes 425984 kps [\d.]+\]"$/,
            "got PARTDONE for part 3") or die;
-    like(taper_reply, qr/^PARTDONE $handle TESTCONF02 2 384 "\[sec [\d.]+ kb 384 kps [\d.]+\]"$/,
+    like(taper_reply, qr/^PARTDONE $handle TESTCONF02 2 384 "\[sec [\d.]+ bytes 393216 kps [\d.]+\]"$/,
            "got PARTDONE for part 4") or die;
     like(taper_reply, qr/^DUMPER-STATUS $handle$/,
            "got DUMPER-STATUS request") or die;
     taper_cmd("DONE worker0 $handle 2112");
-    like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ kb 1632 kps [\d.]+ orig-kb 2112\]" "" ""$/,
+    like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ bytes 1671168 kps [\d.]+ orig-kb 2112\]" "" ""$/,
            "got DONE") or die;
     taper_cmd("QUIT");
     wait_for_exit();
 
     check_logs([
+        qr(^INFO taper Slot 3 without label can be labeled$),
        qr(^START taper datestamp $datestamp label TESTCONF01 tape 1$),
-       qr(^PART taper TESTCONF01 1 localhost /var $datestamp 1/-1 0 \[sec [\d.]+ kb 416 kps [\d.]+\]$),
-       qr(^PART taper TESTCONF01 2 localhost /var $datestamp 2/-1 0 \[sec [\d.]+ kb 416 kps [\d.]+\]$),
+       qr(^PART taper TESTCONF01 1 localhost /var $datestamp 1/-1 0 \[sec [\d.]+ bytes 425984 kps [\d.]+\]$),
+       qr(^PART taper TESTCONF01 2 localhost /var $datestamp 2/-1 0 \[sec [\d.]+ bytes 425984 kps [\d.]+\]$),
        # Note: zero-byte part is not logged, but is counted in this INFO line's 'fm' field
        qr(^INFO taper tape TESTCONF01 kb 832 fm 3 \[OK\]$),
+        qr(^INFO taper Slot 4 without label can be labeled$),
        qr(^START taper datestamp $datestamp label TESTCONF02 tape 2$),
-       qr(^PART taper TESTCONF02 1 localhost /var $datestamp 3/-1 0 \[sec [\d.]+ kb 416 kps [\d.]+\]$),
-       qr(^PART taper TESTCONF02 2 localhost /var $datestamp 4/-1 0 \[sec [\d.]+ kb 384 kps [\d.]+\]$),
-       qr(^DONE taper localhost /var $datestamp 4 0 \[sec [\d.]+ kb 1632 kps [\d.]+ orig-kb 2112\]$),
+       qr(^PART taper TESTCONF02 1 localhost /var $datestamp 3/-1 0 \[sec [\d.]+ bytes 425984 kps [\d.]+\]$),
+       qr(^PART taper TESTCONF02 2 localhost /var $datestamp 4/-1 0 \[sec [\d.]+ bytes 393216 kps [\d.]+\]$),
+       qr(^DONE taper localhost /var $datestamp 4 0 \[sec [\d.]+ bytes 1671168 kps [\d.]+ orig-kb 2112\]$),
        qr(^INFO taper tape TESTCONF02 kb 800 fm 2 \[OK\]$),
     ], "multipart directtcp PORT-WRITE with a zero-byte part logged correctly");
     cleanup_log();
@@ -1152,4 +1186,303 @@ SKIP : {
     $ndmp->cleanup();
 } # end of ndmp SKIP
 
+##
+# A run without LEOM and without allow-split
+$handle = "77-11111";
+$datestamp = "20090302020000";
+run_taper(1024, "without LEOM and without allow-split", new_vtapes => 1);
+make_holding_file(1024*1024, "localhost", "/usr");
+like(taper_reply, qr/^TAPER-OK worker0$/,
+       "got TAPER-OK") or die;
+taper_cmd("FILE-WRITE worker0 $handle \"$test_filename\" localhost /usr 0 $datestamp 262144 \"\" \"\" \"0\" \"\" \"\" \"\" \"\" 1612");
+like(taper_reply, qr/^REQUEST-NEW-TAPE $handle$/,
+       "got REQUEST-NEW-TAPE worker0 $handle") or die;
+taper_cmd("START-SCAN worker0 $handle");
+taper_cmd("NEW-TAPE worker0 $handle");
+like(taper_reply, qr/^NEW-TAPE $handle TESTCONF01$/,
+       "got proper NEW-TAPE worker0 $handle") or die;
+like(taper_reply, qr/^PARTIAL $handle INPUT-GOOD TAPE-ERROR "\[sec [\d.]+ bytes \d* kps [\d.]+ orig-kb 1612\]" "" "No space left on device, splitting not enabled"$/,
+       "got PARTIAL for filenum 1") or die;
+taper_cmd("QUIT");
+wait_for_exit();
+
+check_logs([
+    qr(^INFO taper Slot 1 without label can be labeled$),
+    qr(^START taper datestamp $datestamp label TESTCONF01 tape 1$),
+    qr(^PARTPARTIAL taper TESTCONF01 1 localhost /usr $datestamp 1/-1 0 \[sec [\d.]+ bytes 983040 kps [\d.]+ orig-kb 1612\] \"No space left on device\"$),
+    qr(^PARTIAL taper localhost /usr $datestamp 1 0 \[sec [\d.]+ bytes 0 kps [\d.]+ orig-kb 1612\] "No space left on device, splitting not enabled"$),
+    qr(^INFO taper tape TESTCONF01 kb 0 fm 1 \[OK\]$),
+], "without LEOM and without allow-split logged correctly");
+cleanup_log();
+
+##
+# A run with LEOM and without allow-split
+$handle = "77-11112";
+$datestamp = "20090303020000";
+run_taper(1024, "with LEOM and without allow-split", new_vtapes => 1, leom => 1);
+make_holding_file(1024*1024, "localhost", "/usr");
+like(taper_reply, qr/^TAPER-OK worker0$/,
+       "got TAPER-OK") or die;
+taper_cmd("FILE-WRITE worker0 $handle \"$test_filename\" localhost /usr 0 $datestamp 262144 \"\" \"\" \"0\" \"\" \"\" \"\" \"\" 1612");
+like(taper_reply, qr/^REQUEST-NEW-TAPE $handle$/,
+       "got REQUEST-NEW-TAPE worker0 $handle") or die;
+taper_cmd("START-SCAN worker0 $handle");
+taper_cmd("NEW-TAPE worker0 $handle");
+like(taper_reply, qr/^NEW-TAPE $handle TESTCONF01$/,
+       "got proper NEW-TAPE worker0 $handle") or die;
+like(taper_reply, qr/^PARTDONE $handle TESTCONF01 1 864 "\[sec [\d.]+ bytes 884736 kps [\d.]+ orig-kb 1612\]"$/,
+       "got PARTDONE for filenum 1") or die;
+like(taper_reply, qr/^PARTIAL $handle INPUT-GOOD TAPE-ERROR "\[sec [\d.]+ bytes 884736 kps [\d.]+ orig-kb 1612\]" "" "No space left on device, splitting not enabled"$/,
+       "got PARTIAL") or die;
+taper_cmd("QUIT");
+wait_for_exit();
+
+check_logs([
+    qr(^INFO taper Slot 1 without label can be labeled$),
+    qr(^START taper datestamp $datestamp label TESTCONF01 tape 1$),
+    qr(^PART taper TESTCONF01 1 localhost /usr $datestamp 1/-1 0 \[sec [\d.]+ bytes 884736 kps [\d.]+ orig-kb 1612\]$),
+    qr(^PARTIAL taper localhost /usr $datestamp 1 0 \[sec [\d.]+ bytes 884736 kps [\d.]+ orig-kb 1612\] "No space left on device, splitting not enabled"$),
+    qr(^INFO taper tape TESTCONF01 kb 864 fm 1 \[OK\]$),
+], "with LEOM and without allow-split logged correctly");
+cleanup_log();
+
+## test lexical with new changer
+
+##
+# A simple, one-part FILE-WRITE
+$handle = "11-11111";
+$datestamp = "20070102030405";
+run_taper(4096, "single-part and multipart FILE-WRITE", taperscan => "lexical", new_vtapes => 1);
+like(taper_reply, qr/^TAPER-OK worker0$/,
+       "got TAPER-OK") or die;
+make_holding_file(1024*1024, "localhost", "/home");
+taper_cmd("FILE-WRITE worker0 $handle \"$test_filename\" localhost /home 0 $datestamp \"\" \"\" \"\" \"\" \"\" \"\" \"\" \"\" 12");
+like(taper_reply, qr/^REQUEST-NEW-TAPE $handle$/,
+       "got REQUEST-NEW-TAPE worker0 $handle") or die;
+taper_cmd("START-SCAN worker0 $handle");
+taper_cmd("NEW-TAPE worker0 $handle");
+like(taper_reply, qr/^NEW-TAPE $handle TESTCONF01$/,
+       "got proper NEW-TAPE worker0 $handle") or die;
+like(taper_reply, qr/^PARTDONE $handle TESTCONF01 1 1024 "\[sec [\d.]+ bytes 1048576 kps [\d.]+ orig-kb 12\]"$/,
+       "got PARTDONE") or die;
+like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ bytes 1048576 kps [\d.]+ orig-kb 12\]" "" ""$/,
+       "got DONE") or die;
+
+##
+# A multipart FILE-WRITE, using the same taper instance
+#  (note that the third part is of length 0, and is not logged)
+
+$handle = '11-22222';
+make_holding_file(1024*1024, "localhost", "/usr");
+taper_cmd("FILE-WRITE worker0 $handle \"$test_filename\" localhost /usr 0 $datestamp 524288 \"\" \"\" 1 \"\" \"\" \"\" \"\" 512");
+like(taper_reply, qr/^PARTDONE $handle TESTCONF01 2 512 "\[sec [\d.]+ bytes 524288 kps [\d.]+ orig-kb 512\]"$/,
+       "got PARTDONE for filenum 2") or die;
+like(taper_reply, qr/^PARTDONE $handle TESTCONF01 3 512 "\[sec [\d.]+ bytes 524288 kps [\d.]+ orig-kb 512\]"$/,
+       "got PARTDONE for filenum 3") or die;
+like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ bytes 1048576 kps [\d.]+ orig-kb 512\]" "" ""$/,
+       "got DONE") or die;
+taper_cmd("QUIT");
+wait_for_exit();
+
+check_logs([
+    qr(^INFO taper Slot 1 without label can be labeled$),
+    qr(^START taper datestamp $datestamp label TESTCONF01 tape 1$),
+    qr(^PART taper TESTCONF01 1 localhost /home $datestamp 1/-1 0 \[sec [\d.]+ bytes 1048576 kps [\d.]+ orig-kb 12\]$),
+    qr(^DONE taper localhost /home $datestamp 1 0 \[sec [\d.]+ bytes 1048576 kps [\d.]+ orig-kb 12\]$),
+    qr(^PART taper TESTCONF01 2 localhost /usr $datestamp 1/-1 0 \[sec [\d.]+ bytes 524288 kps [\d.]+ orig-kb 512\]$),
+    qr(^PART taper TESTCONF01 3 localhost /usr $datestamp 2/-1 0 \[sec [\d.]+ bytes 524288 kps [\d.]+ orig-kb 512\]$),
+    qr(^DONE taper localhost /usr $datestamp 2 0 \[sec [\d.]+ bytes 1048576 kps [\d.]+ orig-kb 512\]$),
+    qr(^INFO taper tape TESTCONF01 kb 2048 fm 4 \[OK\]$),
+], "single-part and multi-part dump logged correctly");
+
+##
+# Test a sequence of writes to the same set of tapes
+
+$handle = "33-11111";
+$datestamp = "20090101010000";
+run_taper(1024, "first in a sequence", taperscan => "lexical", new_vtapes => 1);
+like(taper_reply, qr/^TAPER-OK worker0$/,
+       "got TAPER-OK") or die;
+make_holding_file(500000, "localhost", "/u01");
+taper_cmd("FILE-WRITE worker0 $handle \"$test_filename\" localhost /u01 0 $datestamp 262144 \"\" \"\" \"\" \"\" \"\" \"\" \"\" 1412");
+like(taper_reply, qr/^REQUEST-NEW-TAPE $handle$/,
+       "got REQUEST-NEW-TAPE worker0 $handle") or die;
+taper_cmd("START-SCAN worker0 $handle");
+taper_cmd("NEW-TAPE worker0 $handle");
+like(taper_reply, qr/^NEW-TAPE $handle TESTCONF01$/,
+       "got proper NEW-TAPE worker0 $handle") or die;
+like(taper_reply, qr/^PARTDONE $handle TESTCONF01 1 256 "\[sec [\d.]+ bytes 262144 kps [\d.]+ orig-kb 1412\]"$/,
+       "got PARTDONE for filenum 1") or die;
+like(taper_reply, qr/^PARTDONE $handle TESTCONF01 2 232 "\[sec [\d.]+ bytes 237856 kps [\d.]+ orig-kb 1412\]"$/,
+       "got PARTDONE for filenum 2") or die;
+like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ bytes 500000 kps [\d.]+ orig-kb 1412\]" "" ""$/,
+       "got DONE") or die;
+$handle = "33-22222";
+make_holding_file(614400, "localhost", "/u02");
+taper_cmd("FILE-WRITE worker0 $handle \"$test_filename\" localhost /u02 0 $datestamp 262144 \"\" \"\" \"\" \"\" \"\" \"\" \"\" 1512");
+like(taper_reply, qr/^PARTDONE $handle TESTCONF01 3 256 "\[sec [\d.]+ bytes 262144 kps [\d.]+ orig-kb 1512\]"$/,
+       "got PARTDONE for filenum 3") or die;
+like(taper_reply, qr/^REQUEST-NEW-TAPE $handle$/,
+       "got REQUEST-NEW-TAPE worker0 $handle") or die;
+taper_cmd("START-SCAN worker0 $handle");
+taper_cmd("NEW-TAPE worker0 $handle");
+like(taper_reply, qr/^NEW-TAPE $handle TESTCONF02$/,
+       "got proper NEW-TAPE worker0 $handle") or die;
+like(taper_reply, qr/^PARTDONE $handle TESTCONF02 1 256 "\[sec [\d.]+ bytes 262144 kps [\d.]+ orig-kb 1512\]"$/,
+       "got PARTDONE for filenum 1 on second tape") or die;
+like(taper_reply, qr/^PARTDONE $handle TESTCONF02 2 88 "\[sec [\d.]+ bytes 90112 kps [\d.]+ orig-kb 1512\]"$/,
+       "got PARTDONE for filenum 2 on second tape") or die;
+like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ bytes 614400 kps [\d.]+ orig-kb 1512\]" "" ""$/,
+       "got DONE") or die;
+taper_cmd("QUIT");
+wait_for_exit();
+
+check_logs([
+    qr(^INFO taper Slot 1 without label can be labeled$),
+    qr(^START taper datestamp $datestamp label TESTCONF01 tape 1$),
+    qr(^PART taper TESTCONF01 1 localhost /u01 $datestamp 1/-1 0 \[sec [\d.]+ bytes 262144 kps [\d.]+ orig-kb 1412\]$),
+    qr(^PART taper TESTCONF01 2 localhost /u01 $datestamp 2/-1 0 \[sec [\d.]+ bytes 237856 kps [\d.]+ orig-kb 1412\]$),
+    qr(^DONE taper localhost /u01 $datestamp 2 0 \[sec [\d.]+ bytes 500000 kps [\d.]+ orig-kb 1412\]$),
+    qr(^PART taper TESTCONF01 3 localhost /u02 $datestamp 1/-1 0 \[sec [\d.]+ bytes 262144 kps [\d.]+ orig-kb 1512\]$),
+    qr(^PARTPARTIAL taper TESTCONF01 4 localhost /u02 $datestamp 2/-1 0 \[sec [\d.]+ bytes 98304 kps [\d.]+ orig-kb 1512\] "No space left on device"$),
+    qr(^INFO taper Will request retry of failed split part\.$),
+    qr(^INFO taper tape TESTCONF01 kb 744 fm 4 \[OK\]$),
+    qr(^INFO taper Slot 2 without label can be labeled$),
+    qr(^START taper datestamp $datestamp label TESTCONF02 tape 2$),
+    qr(^PART taper TESTCONF02 1 localhost /u02 $datestamp 2/-1 0 \[sec [\d.]+ bytes 262144 kps [\d.]+ orig-kb 1512\]$),
+    qr(^PART taper TESTCONF02 2 localhost /u02 $datestamp 3/-1 0 \[sec [\d.]+ bytes 90112 kps [\d.]+ orig-kb 1512\]$),
+    qr(^DONE taper localhost /u02 $datestamp 3 0 \[sec [\d.]+ bytes 614400 kps [\d.]+ orig-kb 1512\]$),
+    qr(^INFO taper tape TESTCONF02 kb 344 fm 2 \[OK\]$),
+], "first taper invocation in sequence logged correctly");
+cleanup_log();
+
+$handle = "33-33333";
+$datestamp = "20090202020000";
+run_taper(1024, "second in a sequence", keep_config => 1);
+like(taper_reply, qr/^TAPER-OK worker0$/,
+       "got TAPER-OK") or die;
+make_holding_file(300000, "localhost", "/u01");
+taper_cmd("FILE-WRITE worker0 $handle \"$test_filename\" localhost /u01 0 $datestamp 262144 \"\" \"\" \"\" \"\" \"\" \"\" \"\" 1612");
+like(taper_reply, qr/^REQUEST-NEW-TAPE $handle$/,
+       "got REQUEST-NEW-TAPE worker0 $handle") or die;
+taper_cmd("START-SCAN worker0 $handle");
+taper_cmd("NEW-TAPE worker0 $handle");
+like(taper_reply, qr/^NEW-TAPE $handle TESTCONF03$/,
+       "got proper NEW-TAPE worker0 $handle") or die;
+like(taper_reply, qr/^PARTDONE $handle TESTCONF03 1 256 "\[sec [\d.]+ bytes 262144 kps [\d.]+ orig-kb 1612\]"$/,
+       "got PARTDONE for filenum 1") or die;
+like(taper_reply, qr/^PARTDONE $handle TESTCONF03 2 36 "\[sec [\d.]+ bytes 37856 kps [\d.]+ orig-kb 1612\]"$/,
+       "got PARTDONE for filenum 2") or die;
+like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ bytes 300000 kps [\d.]+ orig-kb 1612\]" "" ""$/,
+       "got DONE") or die;
+$handle = "33-44444";
+make_holding_file(614400, "localhost", "/u02");
+taper_cmd("FILE-WRITE worker0 $handle \"$test_filename\" localhost /u02 0 $datestamp 262144 \"\" \"\" \"\" \"\" \"\" \"\" \"\" 1712");
+like(taper_reply, qr/^PARTDONE $handle TESTCONF03 3 256 "\[sec [\d.]+ bytes 262144 kps [\d.]+ orig-kb 1712\]"$/,
+       "got PARTDONE for filenum 3") or die;
+like(taper_reply, qr/^PARTDONE $handle TESTCONF03 4 256 "\[sec [\d.]+ bytes 262144 kps [\d.]+ orig-kb 1712\]"$/,
+       "got PARTDONE for filenum 4") or die;
+like(taper_reply, qr/^REQUEST-NEW-TAPE $handle$/,
+       "got REQUEST-NEW-TAPE worker0 $handle") or die;
+taper_cmd("START-SCAN worker0 $handle");
+taper_cmd("NEW-TAPE worker0 $handle");
+like(taper_reply, qr/^NEW-TAPE $handle TESTCONF01$/,
+       "got proper NEW-TAPE worker0 $handle") or die;
+like(taper_reply, qr/^PARTDONE $handle TESTCONF01 1 88 "\[sec [\d.]+ bytes 90112 kps [\d.]+ orig-kb 1712\]"$/,
+       "got PARTDONE for filenum 1 on second tape") or die;
+like(taper_reply, qr/^DONE $handle INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ bytes 614400 kps [\d.]+ orig-kb 1712\]" "" ""$/,
+       "got DONE") or die;
+taper_cmd("QUIT");
+wait_for_exit();
+
+check_logs([
+    qr(^INFO taper Slot 3 without label can be labeled$),
+    qr(^START taper datestamp $datestamp label TESTCONF03 tape 1$),
+    qr(^PART taper TESTCONF03 1 localhost /u01 $datestamp 1/-1 0 \[sec [\d.]+ bytes 262144 kps [\d.]+ orig-kb 1612\]$),
+    qr(^PART taper TESTCONF03 2 localhost /u01 $datestamp 2/-1 0 \[sec [\d.]+ bytes 37856 kps [\d.]+ orig-kb 1612\]$),
+    qr(^DONE taper localhost /u01 $datestamp 2 0 \[sec [\d.]+ bytes 300000 kps [\d.]+ orig-kb 1612\]$),
+    qr(^PART taper TESTCONF03 3 localhost /u02 $datestamp 1/-1 0 \[sec [\d.]+ bytes 262144 kps [\d.]+ orig-kb 1712\]$),
+    qr(^PART taper TESTCONF03 4 localhost /u02 $datestamp 2/-1 0 \[sec [\d.]+ bytes 262144 kps [\d.]+ orig-kb 1712\]$),
+    qr(^PARTPARTIAL taper TESTCONF03 5 localhost /u02 $datestamp 3/-1 0 \[sec [\d.]+ bytes 0 kps [\d.]+ orig-kb 1712\] "No space left on device"$),
+    qr(^INFO taper Will request retry of failed split part\.$),
+    qr(^INFO taper tape TESTCONF03 kb 804 fm 5 \[OK\]$),
+    qr(^INFO taper Slot 1 with label TESTCONF01 is usable$),
+    qr(^START taper datestamp $datestamp label TESTCONF01 tape 2$),
+    qr(^PART taper TESTCONF01 1 localhost /u02 $datestamp 3/-1 0 \[sec [\d.]+ bytes 90112 kps [\d.]+ orig-kb 1712\]$),
+    qr(^DONE taper localhost /u02 $datestamp 3 0 \[sec [\d.]+ bytes 614400 kps [\d.]+ orig-kb 1712\]$),
+    qr(^INFO taper tape TESTCONF01 kb 88 fm 1 \[OK\]$),
+], "second taper invocation in sequence logged correctly");
+cleanup_log();
+
+##
+# A run with a bogus tapedev/tpchanger
+$handle = "44-11111";
+$datestamp = "20070102030405";
+run_taper(4096, "no tapedev", notapedev => 1, taperscan => "lexical", new_vtapes => 1);
+like(taper_reply, qr/^TAPE-ERROR SETUP "You must specify one of 'tapedev' or 'tpchanger'"$/,
+       "got TAPE-ERROR") or die;
+wait_for_exit();
+
+##
+# A run with 2 workers
+$handle0 = "66-00000";
+$handle1 = "66-11111";
+$datestamp = "20090202020000";
+run_taper(1024, "with 2 workers", new_vtapes => 1, taperscan => "lexical", new_vtapes => 1);
+like(taper_reply, qr/^TAPER-OK worker0$/,
+       "got TAPER-OK") or die;
+taper_cmd("START-TAPER worker1 $datestamp");
+like(taper_reply, qr/^TAPER-OK worker1$/,
+       "got TAPER-OK") or die;
+make_holding_file(300000, "localhost", "/u01");
+taper_cmd("FILE-WRITE worker0 $handle0 \"$test_filename\" localhost /u01 0 $datestamp 262144 \"\" \"\" \"\" \"\" \"\" \"\" \"\" 1612");
+like(taper_reply, qr/^REQUEST-NEW-TAPE $handle0$/,
+       "got REQUEST-NEW-TAPE worker0 $handle0") or die;
+taper_cmd("START-SCAN worker0 $handle0");
+taper_cmd("NEW-TAPE worker0 $handle0");
+like(taper_reply, qr/^NEW-TAPE $handle0 TESTCONF01$/,
+       "got proper NEW-TAPE worker0 $handle0") or die;
+like(taper_reply, qr/^PARTDONE $handle0 TESTCONF01 1 256 "\[sec [\d.]+ bytes 262144 kps [\d.]+ orig-kb 1612\]"$/,
+       "got PARTDONE for filenum 1") or die;
+like(taper_reply, qr/^PARTDONE $handle0 TESTCONF01 2 36 "\[sec [\d.]+ bytes 37856 kps [\d.]+ orig-kb 1612\]"$/,
+       "got PARTDONE for filenum 2") or die;
+like(taper_reply, qr/^DONE $handle0 INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ bytes 300000 kps [\d.]+ orig-kb 1612\]" "" ""$/,
+       "got DONE") or die;
+make_holding_file(614400, "localhost", "/u02");
+taper_cmd("FILE-WRITE worker1 $handle1 \"$test_filename\" localhost /u02 0 $datestamp 262144 \"\" \"\" \"\" \"\" \"\" \"\" \"\" 1712");
+like(taper_reply, qr/^REQUEST-NEW-TAPE $handle1$/,
+       "got REQUEST-NEW-TAPE worker1 $handle1") or die;
+taper_cmd("START-SCAN worker1 $handle1");
+taper_cmd("NEW-TAPE worker1 $handle1");
+like(taper_reply, qr/^NEW-TAPE $handle1 TESTCONF02$/,
+       "got proper NEW-TAPE worker1 $handle1") or die;
+like(taper_reply, qr/^PARTDONE $handle1 TESTCONF02 1 256 "\[sec [\d.]+ bytes 262144 kps [\d.]+ orig-kb 1712\]"$/,
+       "got PARTDONE for filenum 1 on second tape") or die;
+like(taper_reply, qr/^PARTDONE $handle1 TESTCONF02 2 256 "\[sec [\d.]+ bytes 262144 kps [\d.]+ orig-kb 1712\]"$/,
+       "got PARTDONE for filenum 2 on second tape") or die;
+like(taper_reply, qr/^PARTDONE $handle1 TESTCONF02 3 88 "\[sec [\d.]+ bytes 90112 kps [\d.]+ orig-kb 1712\]"$/,
+       "got PARTDONE for filenum 3 on second tape") or die;
+like(taper_reply, qr/^DONE $handle1 INPUT-GOOD TAPE-GOOD "\[sec [\d.]+ bytes 614400 kps [\d.]+ orig-kb 1712\]" "" ""$/,
+       "got DONE") or die;
+taper_cmd("QUIT");
+wait_for_exit();
+
+check_logs([
+    qr(^INFO taper Slot 1 without label can be labeled$),
+    qr(^INFO taper Slot 1 is already in use by drive.*$),
+    qr(^INFO taper Slot 2 without label can be labeled$),
+    qr(^START taper datestamp $datestamp label TESTCONF01 tape 1$),
+    qr(^PART taper TESTCONF01 1 localhost /u01 $datestamp 1/-1 0 \[sec [\d.]+ bytes 262144 kps [\d.]+ orig-kb 1612\]$),
+    qr(^PART taper TESTCONF01 2 localhost /u01 $datestamp 2/-1 0 \[sec [\d.]+ bytes 37856 kps [\d.]+ orig-kb 1612\]$),
+    qr(^DONE taper localhost /u01 $datestamp 2 0 \[sec [\d.]+ bytes 300000 kps [\d.]+ orig-kb 1612\]$),
+    qr(^START taper datestamp $datestamp label TESTCONF02 tape 2$),
+    qr(^PART taper TESTCONF02 1 localhost /u02 $datestamp 1/-1 0 \[sec [\d.]+ bytes 262144 kps [\d.]+ orig-kb 1712\]$),
+    qr(^PART taper TESTCONF02 2 localhost /u02 $datestamp 2/-1 0 \[sec [\d.]+ bytes 262144 kps [\d.]+ orig-kb 1712\]$),
+    qr(^PART taper TESTCONF02 3 localhost /u02 $datestamp 3/-1 0 \[sec [\d.]+ bytes 90112 kps [\d.]+ orig-kb 1712\]$),
+    qr(^DONE taper localhost /u02 $datestamp 3 0 \[sec [\d.]+ bytes 614400 kps [\d.]+ orig-kb 1712\]$),
+    qr(^INFO taper tape TESTCONF01 kb 292 fm 2 \[OK\]$),
+    qr(^INFO taper tape TESTCONF02 kb 600 fm 3 \[OK\]$),
+], "two workers logged correctly");
+cleanup_log();
+
 cleanup_taper();
index f43fcdcecd24696a430fd72594217fa27b63cd5d..9e428d59dba614db01abbda1c3cc0eef8f813ab3 100644 (file)
@@ -14,10 +14,12 @@ COMMON_MAN_PAGES =  amanda.8 \
                    amanda-auth.7 \
                    amanda-match.7 \
                    amarchiver.8 \
+                   amservice.8 \
                    script-email.8
 
 CLIENT_MAN_PAGES = \
     amanda-applications.7 \
+    amdump_client.8 \
     amgtar.8 \
     ampgsql.8 \
     amraw.8 \
@@ -31,6 +33,7 @@ SERVER_MAN_PAGES =  \
     amanda-devices.7 \
     amanda-compatibility.7 \
     amanda-changers.7 \
+    amanda-interactivity.7 \
     amanda-taperscan.7 \
     amaddclient.8    \
     amadmin.8 \
@@ -53,7 +56,6 @@ SERVER_MAN_PAGES =  \
     amreport.8 \
     amrmtape.8 \
     amserverconfig.8 \
-    amservice.8 \
     amstatus.8 \
     amtape.8 \
     amtapetype.8 \
index ed09b52e1c5442c8d9c32b46768a9f596844dfc5..bfae62edae84c105b7f2e0e00909a2f61fa45179 100644 (file)
@@ -53,6 +53,7 @@ am__aclocal_m4_deps =  \
        $(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/as_needed.m4 \
        $(top_srcdir)/config/amanda/bsd-security.m4 \
        $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
        $(top_srcdir)/config/amanda/bsdudp-security.m4 \
@@ -251,6 +252,7 @@ APPLICATION_DIR = @APPLICATION_DIR@
 AR = @AR@
 ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
 ASSERTIONS = @ASSERTIONS@
+AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -724,6 +726,7 @@ LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
 MKDIR_P = @MKDIR_P@
+MOUNT = @MOUNT@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
@@ -921,6 +924,7 @@ STDBOOL_H = @STDBOOL_H@
 STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
+SUNTAR = @SUNTAR@
 SVN = @SVN@
 SWIG = @SWIG@
 SWIG_LIB = @SWIG_LIB@
@@ -928,6 +932,7 @@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TCPPORTRANGE = @TCPPORTRANGE@
 TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
 UDPPORTRANGE = @UDPPORTRANGE@
+UMOUNT = @UMOUNT@
 UNCOMPRESS_OPT = @UNCOMPRESS_OPT@
 UNCOMPRESS_PATH = @UNCOMPRESS_PATH@
 UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
@@ -1028,10 +1033,12 @@ COMMON_MAN_PAGES = amanda.8 \
                    amanda-auth.7 \
                    amanda-match.7 \
                    amarchiver.8 \
+                   amservice.8 \
                    script-email.8
 
 CLIENT_MAN_PAGES = \
     amanda-applications.7 \
+    amdump_client.8 \
     amgtar.8 \
     ampgsql.8 \
     amraw.8 \
@@ -1045,6 +1052,7 @@ SERVER_MAN_PAGES = \
     amanda-devices.7 \
     amanda-compatibility.7 \
     amanda-changers.7 \
+    amanda-interactivity.7 \
     amanda-taperscan.7 \
     amaddclient.8    \
     amadmin.8 \
@@ -1067,7 +1075,6 @@ SERVER_MAN_PAGES = \
     amreport.8 \
     amrmtape.8 \
     amserverconfig.8 \
-    amservice.8 \
     amstatus.8 \
     amtape.8 \
     amtapetype.8 \
index 006f348f214e04eada6e53f153b768d7dd58c6fa..0e2fd999a06b795ffd718fbf4c3a656e8b474f36 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amaddclient
 .\"    Author: Kevin Till <kevin.till@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMADDCLIENT" "8" "12/14/2010" "Amanda 3\&.2\&.1" "System Administration Commands"
+.TH "AMADDCLIENT" "8" "06/02/2011" "Amanda 3\&.3\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index 7fd5aede820175dba68c5caaebf89bd746405085..c31b2ac67f9b24523e7c9344375c3675b80cf478 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amadmin
 .\"    Author: James da Silva <jds@amanda.org>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMADMIN" "8" "12/14/2010" "Amanda 3\&.2\&.1" "System Administration Commands"
+.TH "AMADMIN" "8" "06/02/2011" "Amanda 3\&.3\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index a06bfc6c8989ec85cc02471bbdcdf7c0533198fb..8f3cb0286d2e6bd91c18d1bec0f02c030bb23185 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amaespipe
 .\"    Author: Kevin Till <kevin.till@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMAESPIPE" "8" "12/14/2010" "Amanda 3\&.2\&.1" "System Administration Commands"
+.TH "AMAESPIPE" "8" "06/02/2011" "Amanda 3\&.3\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index 671775a81e32eae30a9c3c3a44c88aa012e621e0..8500a830e80e2ad5c453034c2dfb5d0950eeb5fe 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amanda-applications
 .\"    Author: Jean-Louis Martineau <martineau@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: Miscellanea
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMANDA\-APPLICATIONS" "7" "12/14/2010" "Amanda 3\&.2\&.1" "Miscellanea"
+.TH "AMANDA\-APPLICATIONS" "7" "06/02/2011" "Amanda 3\&.3\&.0" "Miscellanea"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index a5ba39da798939fa3b8980c873cb335368eb99dc..3656ce284063de9ffb8fd3c8f2b71d03b5d481a6 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amanda-archive-format
 .\"    Author: Dustin J. Mitchell <dustin@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: File formats and conventions
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMANDA\-ARCHIVE\-FOR" "5" "12/14/2010" "Amanda 3\&.2\&.1" "File formats and conventions"
+.TH "AMANDA\-ARCHIVE\-FOR" "5" "06/02/2011" "Amanda 3\&.3\&.0" "File formats and conventions"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index 9f89c18b450354b1304e81eb392fe193cbefe537..098d5d8fa3d676870f6dcc8130b18b34b1e31ad5 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amanda-auth
 .\"    Author: Jean-Louis Martineau <martineau@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: Miscellanea
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMANDA\-AUTH" "7" "12/14/2010" "Amanda 3\&.2\&.1" "Miscellanea"
+.TH "AMANDA\-AUTH" "7" "06/02/2011" "Amanda 3\&.3\&.0" "Miscellanea"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
@@ -47,7 +47,7 @@ parameter in the dumptype for each disklist entry (DLE)\&. The
 parameter thus may be easily and globally specified in the "global" dumptype\&. If
 \fIauth\fR
 is not specified, the
-\fBbsd\fR
+\fBbsdtcp\fR
 communication method is used\&. See
 \fBamanda.conf\fR(5)
 for more information on Amanda configuration and dumptypes, and
index 1577369618b3dd0767f57d53d7bcf6faaf2fd529..0e4da92e5b8d22d7ce59f758b04ad3bd18af6c48 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amanda-changers
 .\"    Author: Dustin J. Mitchell <dustin@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: Miscellanea
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMANDA\-CHANGERS" "7" "12/14/2010" "Amanda 3\&.2\&.1" "Miscellanea"
+.TH "AMANDA\-CHANGERS" "7" "06/02/2011" "Amanda 3\&.3\&.0" "Miscellanea"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
@@ -103,9 +103,38 @@ Global device properties always apply\&. If the changer specifies a device by al
 .SH "CHANGER DRIVERS"
 .PP
 This section lists the changer drivers included with Amanda, and basic instructions for using them\&. For complete How\-To information, consult the Amanda wiki at http://wiki\&.zmanda\&.com\&.
+.SS "chg\-aggregate:changer (new)"
+.nf
+define changer robot0 {
+  tpchanger "chg\-robot:/dev/sg0"
+  property "tape\-device" "0=tape:/dev/rmt/0" "1=tape:/dev/rmt/1"
+}
+define changer robot1 {
+  tpchanger "chg\-robot:/dev/sg1"
+  property "tape\-device" "0=tape:/dev/rmt/2" "1=tape:/dev/rmt/3"
+}
+define changer single {
+  tpchanger "chg\-single:/dev/rmt/4"
+}
+define changer aggregate {
+  tpchanger "chg\-aggregate:{robot0,robot1,single}"
+  property "state\-filename" "/etc/amanda/CONF/aggregate\&.state"
+
+}
+tpchanger "aggregate"
+.fi
+.PP
+This changer driver allow to use two or more changers or standalone drive in sequence\&.
 .SS "chg\-disk:VTAPEROOT (new)"
 .nf
-tpchanger "chg\-disk:/u01/vtapes"
+tpchanger "chg\-disk:/var/mnt/vtapes"
+property "num\-slot" "10"
+property "auto\-create\-slot" "yes"
+property "removable" "yes"
+property "mount" "yes"
+property "umount" "yes"
+property "umount\-lockfile" "/etc/amanda/conf/vtapes\-lock"
+property "umount\-idle" "1"
 .fi
 .PP
 This changer driver replaces the old
@@ -118,6 +147,53 @@ The current slot can be accessed using the device name
 file:VTAPEROOT\&. This is useful for the
 \fBamrestore\fR(8)
 command line\&.
+.SS "Properties"
+.PP
+AUTO\-CREATE\-SLOT
+.RS 4
+
+If a slotN directory in the range 1 to NUM\-SLOT does not already exist, and this property is true, then the changer will create the directory\&.
+.RE
+.PP
+MOUNT
+.RS 4
+
+If this property is true, the changer try to mount the removable disk if nothing is mounted\&. The system must be configured to allow the amanda user to mount it\&.
+.RE
+.PP
+NUM\-SLOT
+.RS 4
+
+The minimum number of slots in the changer, where the first slot is slot1\&.  If additional slot directories exist, they will also be used\&.
+.RE
+.PP
+REMOVABLE
+.RS 4
+
+If this property is true, then the changer will verify that the changer
+directory (e\&.g\&., /var/mnt/vtapes) is on a different
+filesystem from its parent directory (e\&.g\&., /var/mnt)\&.
+This is useful for removable disks, as it will prevent Amanda from creating
+slot directories when the removable disk is not mounted\&.
+.RE
+.PP
+UMOUNT
+.RS 4
+
+If this property is true, the changer try to umount the removable disk when it exit\&. The system must be configured to allow the amanda user to umount it\&.
+.RE
+.PP
+UMOUNT\-LOCKFILE
+.RS 4
+
+If UMOUNT is set, it require a lockfile outside of the mount point to prevent race\&.
+.RE
+.PP
+UMOUNT\-IDLE
+.RS 4
+
+If set, the changer try to umount the removable disk when it is not in use\&. The umount\-idle value is a delay in second to wait before doing the umount\&. A value >= 1 is required to prevent useless mount/umount\&.
+.RE
 .SS "chg\-disk (old)"
 .nf
 tapedev "file:/u01/vtapes"
index 6d0bc0b0643dd8ed9481535a853388a6503e02ba..135901688237bf09c625fe70a7dba61a4b9dce69 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amanda-client.conf
 .\"    Author: James da Silva <jds@amanda.org>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: File formats and conventions
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMANDA\-CLIENT\&.CON" "5" "12/14/2010" "Amanda 3\&.2\&.1" "File formats and conventions"
+.TH "AMANDA\-CLIENT\&.CON" "5" "06/02/2011" "Amanda 3\&.3\&.0" "File formats and conventions"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
@@ -82,7 +82,7 @@ Default:
 \fBauth\fR \fIstring\fR
 .RS 4
 Default:
-\fB"bsd"\fR\&. Type of authorization to perform between tape server and backup client hosts\&.
+\fB"bsdtcp"\fR\&. Type of authorization to perform between tape server and backup client hosts\&.
 .sp
 \fB"bsd"\fR, bsd authorization with udp initial connection and one tcp connection by data stream\&.
 .sp
@@ -234,7 +234,7 @@ Adds a global property for this client host, useful for e\&.g\&., Application AP
 .SH "APPLICATION SECTION"
 .PP
 The
-\fBamanda\&.conf\fR
+\fBamanda\-client\&.conf\fR
 file may define multiple types of application\&. The information is entered in a
 \fBapplication\fR
 section, which looks like this:
@@ -246,11 +246,28 @@ define application "\fIname\fR" {
 .fi
 .PP
 \fIname\fR
-is the name of this type of application\&. It is referenced from the
-\fBdumptype\fR
+is the name of this type of application\&.
+.PP
+The setting from an application is merged with the dle setting if the
+\fIname\fR
+is the same as the
+\fBclient\-application\-name\fR
+from the dle or if the
+\fBclient\-application\-name\fR
+from the dle is not set and the
+\fIname\fR
+is the same as the
+\fBplugin\fR
+from the dle\&.
 .PP
 The application options and values are:
 .PP
+\fBclient\-application\-name\fR \fIstring\fR
+.RS 4
+Default:
+\fInone\fR\&. Not use on the client\&.
+.RE
+.PP
 \fBcomment\fR \fIstring\fR
 .RS 4
 Default:
@@ -261,7 +278,8 @@ Default:
 .RS 4
 No default\&. Must be set to the name of the program\&. This program must be in the
 \fI$libexecdir/amanda/application\fR
-directory on the client\&.
+directory on the client\&. If set, it must be the same as the dle
+\fBplugin\fR\&.
 .RE
 .PP
 \fBproperty\fR [\fBappend\fR] [\fBpriority\fR] \fIstring\fR \fIstring\fR+
@@ -275,7 +293,7 @@ keyword disallow the setting of that property on the server\&.
 .SH "SCRIPT SECTION"
 .PP
 The
-\fBamanda\&.conf\fR
+\fBamanda\-client\&.conf\fR
 file may define multiple types of script\&. The information is entered in a
 \fBscript\fR
 section, which looks like this:
@@ -287,11 +305,28 @@ define script "\fIname\fR" {
 .fi
 .PP
 \fIname\fR
-is the name of this type of script\&. It is referenced from the
-\fBdumptype\fR
+is the name of this type of script\&.
+.PP
+The setting from a script is merged with the dle setting if the
+\fIname\fR
+is the same as the
+\fBclient\-script\-name\fR
+from the dle or if the
+\fBclient\-script\-name\fR
+from the dle is not set and the
+\fIname\fR
+is the same as the
+\fBplugin\fR
+from the dle\&.
 .PP
 The script options and values are:
 .PP
+\fBclient\-script\-name\fR \fIstring\fR
+.RS 4
+Default:
+\fInone\fR\&. Not used on the client\&.
+.RE
+.PP
 \fBcomment\fR \fIstring\fR
 .RS 4
 Default:
@@ -302,15 +337,14 @@ Default:
 .RS 4
 No default\&. Must be set to the name of the program\&. This program must be in the
 \fI$libdir/amanda/application\fR
-directory on the client and/or server\&.
+directory on the client\&. If set, it must be the same as the dle
+\fBplugin\fR\&.
 .RE
 .PP
-\fBexecute\-where\fR [ \fBclient\fR | \fBserver\fR ]
+\fBexecute\-where\fR \fBclient\fR
 .RS 4
 Default:
-\fBclient\fR\&. Where the script must be executed, on the client or server\&. Only
-\fBclient\fR
-is valid\&.
+\fBclient\fR\&. Value can\'t be changed\&.
 .RE
 .PP
 \fBexecute\-on\fR \fIexecute_on\fR[,\fIexecute_on\fR]*
@@ -362,21 +396,11 @@ Execute after the estimate command for all dle for the client\&.
 Execute before the backup command for the dle\&.
 .RE
 .PP
-\fBpre\-host\-backup\fR
-.RS 4
-Execute before the backup command for all dle for the client\&.
-.RE
-.PP
 \fBpost\-dle\-backup\fR
 .RS 4
 Execute after the backup command for the dle\&.
 .RE
 .PP
-\fBpost\-host\-backup\fR
-.RS 4
-Execute after the backup command for all dle for the client\&.
-.RE
-.PP
 \fBpre\-recover\fR
 .RS 4
 Execute before any level is recovered\&.
index 6839da9ea35baae45101e0dd695ef41ae58633a8..a9b8b9858a65e70778c08f31b4e59d1e019671d1 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amanda-compatibility
 .\"    Author: Dustin J. Mitchell <dustin@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: Miscellanea
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMANDA\-COMPATIBILIT" "7" "12/14/2010" "Amanda 3\&.2\&.1" "Miscellanea"
+.TH "AMANDA\-COMPATIBILIT" "7" "06/02/2011" "Amanda 3\&.3\&.0" "Miscellanea"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index 6ff0a898ae4b5e511e56555fc962496f36854a15..ef52fcb66c17615f7919751d94b22223b9763f14 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amanda-devices
 .\"    Author: Ian Turner <ian@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: Miscellanea
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMANDA\-DEVICES" "7" "12/14/2010" "Amanda 3\&.2\&.1" "Miscellanea"
+.TH "AMANDA\-DEVICES" "7" "06/02/2011" "Amanda 3\&.3\&.0" "Miscellanea"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
@@ -238,6 +238,12 @@ MAX_VOLUME_USAGE
  (read\-write) 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\&.  The tapetype parameter \fIlength\fR sets this property\&.
 .RE
 .PP
+ENFORCE_MAX_VOLUME_USAGE
+.RS 4
+
+ (read\-write) If this property is false, limit set by MAX_VOLUME_USAGE property (and thus the tapetype LENGTH parameter) will not be verified while writing to device, allowing the volume to expand without limit\&. If this property is true, then MAX_VOLUME_USAGE willbe enforced, limiting the total size of the volume\&. This property is not available on all devices; see below\&.
+.RE
+.PP
 PARTIAL_DELETION
 .RS 4
 
@@ -344,7 +350,7 @@ The S3 device driver uploads data to the Amazon S3 "storage cloud"\&. Its device
 .PP
 The access and secret keys used to authenticate to Amazon S3 are provided as properties\&.
 .PP
-The S3 device driver stores each block in a distinct S3 object\&. Due to high HTTP overhead for each request, use of larger than normal block sizes (> 1 megabyte) is reccomended with the S3 device\&.
+The S3 device driver stores each block in a distinct S3 object\&. Due to high HTTP overhead for each request, use of larger than normal block sizes (> 1 megabyte) is recommended with the S3 device\&.
 .PP
 Amanda automatically creates a bucket when writing, if the bucket doesn\'t already exist\&. At that time, it specifies where Amazon should store the data based on the S3_BUCKET_LOCATION property\&. If this property is not set, Amazon\'s default value (equivalent to "*") is used\&. The bucket location has both billing and legal concerns, so you are encouraged to consult Amazon\'s documentation for details\&.
 .PP
@@ -369,6 +375,8 @@ If a location constraint is set, the bucket name must consist only of lower\-cas
 This driver supports the VERBOSE property, but use it carefully \-\- it produces a great deal of output, and may cause spurious failures by filling your debug log partition\&. Its logging is generally only useful for developers chasing down a problem in communications with Amazon\'s servers\&.
 .PP
 Since Amazon storage is unlimited, the device never encounteres EOM, so LEOM detection is trivially enabled for this device\&.
+.PP
+This driver supports the ENFORCE_MAX_VOLUME_USAGE property\&. Default value is false\&. See COMMON_PROPERTIES, above\&.
 .SS "Device-Specific Properties"
 .PP
 In addition to the common properties, the S3 device supports the properties listed in this section\&.
@@ -396,6 +404,18 @@ data to S3\&.  If the average speed exceeds this value, the device will stop
 writing long enough to bring the average below this value\&.
 .RE
 .PP
+NB_THREADS_BACKUP
+.RS 4
+
+(read\-write) The number of thread that send data to the s3 device, higher value can provide more throutput\&.
+.RE
+.PP
+NB_THREADS_RECOVERY
+.RS 4
+
+(read\-write) The number of thread that read data from the s3 device, higher value can provide more throutput\&.
+.RE
+.PP
 S3_ACCESS_KEY
 .RS 4
 
@@ -422,10 +442,22 @@ If NSS is being used, then it is the directory that the database resides in\&.
 The value is passed to curl_easy_setopt(3) as CURLOPT_CAINFO\&.
 .RE
 .PP
+S3_HOST
+.RS 4
+
+(read\-write) The host name to connect, in the form "hostname:port" or "ip:port", default is "s3\&.amazonaws\&.com"
+.RE
+.PP
 S3_SECRET_KEY
 .RS 4
 
- (read\-write) This property gives the Amazon S3 secret key used to access the service\&.
+(read\-write) This property gives the Amazon S3 secret key used to access the service\&.
+.RE
+.PP
+S3_SERVICE_PATH
+.RS 4
+
+(read\-write) A path to add at the beginning of the URL\&.
 .RE
 .PP
 S3_STORAGE_CLASS
@@ -440,20 +472,32 @@ for the most up\-to\-date list\&.
 S3_SSL
 .RS 4
 
- (read\-write) Whether or not to use SSL/TLS to secure communications with Amazon S3\&.
+(read\-write) Whether or not to use SSL/TLS to secure communications with Amazon S3\&.
+.RE
+.PP
+S3_SUBDOMAIN
+.RS 4
+
+ (read\-write) Whether or not to use subdomain hostname\&.
 .RE
 .PP
 S3_USER_TOKEN
 .RS 4
 
- (read\-write) This property specifies the user token for Amanda Enterprise Edition customers\&.
+(read\-write) This property specifies the user token for Amanda Enterprise Edition customers\&.
 .RE
 .PP
 VERBOSE
 .RS 4
 
- (read\-write) If true, verbose data about each HTTP transaction is sent to the debug log\&.
+(read\-write) If true, verbose data about each HTTP transaction is sent to the debug log\&.
 .RE
+.SS "S3 URL"
+
+     SSL &&  SUBDOMAIN:   https://bucket\&.host/service_path/file
+     SSL && !SUBDOMAIN:   https://host/service_path/bucket/file
+    !SSL &&  SUBDOMAIN:   http://bucket\&.host/service_path/file
+    !SSL && !SUBDOMAIN:   http://host/service_path/bucket/file
 .SS "Tape Device"
 .nf
 tapedev "tape:/dev/nst0"
@@ -593,6 +637,8 @@ The VFS device driver stores data on a UNIX filesystem\&. Note that although one
 The device name specifies a path to a directory which must exist and contain a "data/" subdirectory\&. Each tape file is stored as a distinct file in this directory, the name of which reflects the Amanda header in the tape file\&. Block boundaries are not maintained: the driver supports reads of arbitrary size, regardless of the blocksize used to write the data\&.
 .PP
 This device supports LEOM detection\&. LEOM will be indicated when the MAX_VOLUME_USAGE is nearly met, or when the filesystem is nearly out of space\&. The latter circumstance is detected by monitoring the available space on the filesystem, and this monitoring can be disabled with the MONITOR_FREE_SPACE property\&. Note that the device cannot detect other circumstances that may cause a write to fail, such as a filesystem quota\&. LEOM detection can be disabled by setting the LEOM property to false\&.
+.PP
+This device supports the ENFORCE_MAX_VOLUME_USAGE property\&. Default value is true\&. See COMMON PROPERTIES, above\&.
 .SS "Device-Specific Properties"
 .PP
 MONITOR_FREE_SPACE
diff --git a/man/amanda-interactivity.7 b/man/amanda-interactivity.7
new file mode 100644 (file)
index 0000000..d0fb89a
--- /dev/null
@@ -0,0 +1,144 @@
+'\" t
+.\"     Title: amanda-interactivity
+.\"    Author: Jean-Louis Martineau <martineau@zmanda.com>
+.\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
+.\"      Date: 06/02/2011
+.\"    Manual: Miscellanea
+.\"    Source: Amanda 3.3.0
+.\"  Language: English
+.\"
+.TH "AMANDA\-INTERACTIVIT" "7" "06/02/2011" "Amanda 3\&.3\&.0" "Miscellanea"
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
+amanda-interactivity \- Configuring Interactivity with Amanda Amanda
+.SH "DESCRIPTION"
+.PP
+Amanda uses interactivity to ask user to load specific volumes when they are needed\&. This manual page describes the interactivity modules included with Amanda\&.
+.PP
+This is a
+\fIuser\-level\fR
+description of the API, and does not address details that are only of concern to developers of new interactivity plugins\&. For that purpose, consult the Amanda source code, perldoc \'Amanda::Interactivity\' and http://wiki\&.zmanda\&.com\&.
+.SH "DEFINING INTERACTIVITY"
+.PP
+Interactivity is specified in
+\fBamanda.conf\fR(5)
+as follows:
+.sp
+.nf
+define interactivity $interactivity_name {
+   comment "$comment"
+   plugin "$pluginname"
+   property "$PROPERTY_NAME" "$PROPERTY_VALUE"
+   \&.\&.\&.
+}
+.fi
+and then referenced in the global section as
+.sp
+.nf
+  interactivity "$interactivity_name"
+.fi
+.PP
+Interactivity properties, like Amanda configuration parameters, are insensitive to case, and
+\-
+(dash) and
+_
+(underscore) may be used interchangeably\&.
+.PP
+See the individual plugin sections, below for properties applicable to each plugin\&.
+.SH "INTERACTIVITY MODULES"
+.PP
+Amanda provides three interactivity modules,
+\fItty\fR,
+\fIemail\fR
+and
+\fItty_email\fR\&.
+.SS "TTY"
+.PP
+The
+\fItty\fR
+interactivity module uses the tty to communicate with the user, it works only if a terminal is available, which is the case if amanda is executed from a command line\&.
+.PP
+When promted for a volume, the user must put the requested volume in the changer and type <enter>\&. User can type the name of another changer if the volume is available in that changer\&. Typing \'abort\' will abort the operation\&.
+.SS "EMAIL"
+.PP
+The
+\fIemail\fR
+interactivity module uses email to send requests to the user, and reads replies from the filesystem\&.
+.PP
+The
+\fIemail\fR
+module has many properties:
+.PP
+check\-file
+.RS 4
+
+If set, amanda will check this file for user input\&.  The user can touch the
+file to tell amanda that the requested volume was inserted in the changer\&.  If the user
+writes the name of a changer into the file, Amanda will use that changer\&.  If the user
+writes the word \'abort\' into the file, the scan will be aborted\&.
+.RE
+.PP
+check\-file\-delay
+.RS 4
+
+Default: 10\&. This integer property indicates the time in seconds between each check of the check\-file\&.
+.RE
+.PP
+mailto
+.RS 4
+
+Default: global value of \fBmailto\fR\&.  The email addresses to which
+the email should be sent\&.  If multiple addresses are given, they should be
+separated by spaces\&. 
+.RE
+.PP
+resend\-delay
+.RS 4
+
+Default 0\&. The time in seconds between emails\&.  Amanda will resend the same
+email at this frequency, which can be useful if \fBmailto\fR
+is a pager or phone\&.  If set to 0, only one email is sent\&.
+.RE
+.SS "TTY_EMAIL"
+.PP
+The
+\fItty_email\fR
+interactivity module uses the
+\fItty\fR
+module if a terminal is available and uses the
+\fIemail\fR
+module otherwise\&. Its properties are a combination of properties from each module\&.
+.SH "EXAMPLE"
+.PP
+.nf
+  define interactivity "by\-tty\-or\-email" {
+    comment "Send email on runs from cron; use terminal on command line"
+    plugin "tty_email"
+    property "mailto" "admin1" "admin2" "me@home"
+    property "resend\-delay" "1800"               #every 30 minutes
+    property "check\-file" "/tmp/email_input"
+    property "check\-file\-delay" "10"             #every 10 seconds
+  }
+.fi
+.SH "SEE ALSO"
+.PP
+\fBamanda\fR(8),
+\fBamanda.conf\fR(5)
+.PP
+The Amanda Wiki:
+: http://wiki.zmanda.com/
+.SH "AUTHOR"
+.PP
+\fBJean\-Louis Martineau\fR <\&martineau@zmanda\&.com\&>
+.RS 4
+Zmanda, Inc\&. (http://www\&.zmanda\&.com)
+.RE
index 9774c769ab9ffdb2a0a62111e1907efb24a8ef51..7ed42362b5b6a94c4098502fc775d31d6cd530db 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amanda-match
 .\"    Author: Dustin J. Mitchell <dustin@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: Miscellanea
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMANDA\-MATCH" "7" "12/14/2010" "Amanda 3\&.2\&.1" "Miscellanea"
+.TH "AMANDA\-MATCH" "7" "06/02/2011" "Amanda 3\&.3\&.0" "Miscellanea"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index bd432284c1333d69b033d8af2cb6bea71956aec0..eeef59fa374c32fbf8bda85f647daae499d7d95e 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amanda-scripts
 .\"    Author: Jean-Louis Martineau <martineau@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: Miscellanea
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMANDA\-SCRIPTS" "7" "12/14/2010" "Amanda 3\&.2\&.1" "Miscellanea"
+.TH "AMANDA\-SCRIPTS" "7" "06/02/2011" "Amanda 3\&.3\&.0" "Miscellanea"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
@@ -56,6 +56,9 @@ Script properties work just like application properties: they are insensitive to
 (dash) and
 _
 (underscore) may be used interchangeably\&.
+.SH "SCRIPTS OUTPUT PROPERTY"
+.PP
+A pre\-dle\-amcheck, pre\-dle\-estimate or pre\-dle\-backup executed on the client can output property on stdout that are sent to the application\&. If the output line matches "PROPERTY str1 str2", Amanda sets a property called "str1" by the value of "str2", that property is sent to the application\&.
 .SH "SEE ALSO"
 .PP
 \fBamanda\fR(8),
index b4b50825c9aa966ee8d26f74948c9be0ebb4780a..90d66b504919325f840db79025906bf4919b2f02 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amanda-taperscan
 .\"    Author: Dustin J. Mitchell <dustin@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: Miscellanea
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMANDA\-TAPERSCAN" "7" "12/14/2010" "Amanda 3\&.2\&.1" "Miscellanea"
+.TH "AMANDA\-TAPERSCAN" "7" "06/02/2011" "Amanda 3\&.3\&.0" "Miscellanea"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
@@ -35,9 +35,36 @@ Taperscan algorithms are implemented as perl packages with the prefix
 Amanda::Taper::Scan::\&. See the perl documentation for
 Amanda::Taper::Scan
 for more information\&.
+.SH "DEFINING A TAPERSCAN"
+.PP
+An taperscan is defined in
+\fBamanda.conf\fR(5)
+as follows:
+.sp
+.nf
+define taperscan $taperscan_name {
+   comment "$comment"
+   plugin "$pluginname"
+   property "$PROPERTY_NAME" "$PROPERTY_VALUE"
+   \&.\&.\&.
+}
+.fi
+and then referenced in the global section as
+.sp
+.nf
+  taperscan "$taperscan_name"
+.fi
+.PP
+Taperscan properties, like Amanda configuration parameters, are insensitive to case, and
+\-
+(dash) and
+_
+(underscore) may be used interchangeably\&.
+.PP
+See the individual plugin documentation below for properties applicable to each plugin\&.
 .SH "TAPERSCAN ALGORITHMS"
 .PP
-In general, these volumes will only select reusable volumes\&. These are volumes which are listed in the
+In general, these algorithms will only select reusable volumes\&. These are volumes which are listed in the
 \fBtapelist\fR(5)
 with the
 \fIreuse\fR
@@ -84,12 +111,38 @@ algorithm are used and new tapes may be unexpectedly excluded\&.  If this causes
 an undesirable change in behavior, consider one of the other taperscan
 algorithms\&..sp .5v
 .RE
+.SS "oldest"
+.PP
+This algorithm works with the Changer API (see
+\fBamanda-changers\fR(7)), using the inventory returned by the changer to locate the oldest acceptable volume available\&. Note that this will not work with changers that do not support inventory (old changers)\&. The algorithms scans unknown slots only if no known usable volume is found in the inventory\&.
+.PP
+An acceptable volume is a reusable volume, a new labeled volume or an unlabeled volume that can be labeled according to
+\fBautolabel\fR\&. Note that changers do not always know the contents of every slot \- for example, a tape with an unknown barcode will not be considered usable\&.
+.PP
+Use
+\fBamtape CONF inventory\fR
+to see the changer\'s inventory, and use
+\fBamtape CONF update\fR
+to update it\&.
+.SS "lexical"
+.PP
+This algorithm also works with the Changer API, using the inventory to determine the acceptable volumes; it then uses the volume which follows the last\-used volume in lexical order\&. For volume labels containing leading zeros, e\&.g\&.,
+CORP\-010, this algorithm will run through the volumes in the natural order\&.
+.PP
+It scans unknown slots only if no usable volume is found in the inventory\&.
+.PP
+See
+\fBoldest\fR, above, for a definition of acceptable volumes\&.
+
+
+>>>>>>> 6a40a39\&.\&.\&. manpage edits
 .SH "SEE ALSO"
 .PP
 \fBamanda\fR(8),
 \fBamanda.conf\fR(5),
 \fBtapelist\fR(5),
-\fBamanda-changers\fR(7)
+\fBamanda-changers\fR(7),
+\fBamanda-interactivity\fR(7)
 .PP
 The Amanda Wiki:
 : http://wiki.zmanda.com/
index ec2d04cb4bcefd2eeffebb64ef4eb68e7ea020d2..31c37356e569d14713033708c2e508dda104fc23 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amanda
 .\"    Author: James da Silva <jds@amanda.org>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMANDA" "8" "12/14/2010" "Amanda 3\&.2\&.1" "System Administration Commands"
+.TH "AMANDA" "8" "06/02/2011" "Amanda 3\&.3\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
@@ -599,6 +599,17 @@ Here are all the Amanda commands\&. Each one has its own manual page\&. See them
 .sp -1
 .IP \(bu 2.3
 .\}
+\fBamanda-interactivity\fR(7),
+.RE
+.sp
+.RS 4
+.ie n \{\
+\h'-04'\(bu\h'+03'\c
+.\}
+.el \{\
+.sp -1
+.IP \(bu 2.3
+.\}
 \fBamanda-match\fR(7),
 .RE
 .sp
index e326db218969718b21dd0ba457fc2880f5b8c9cd..ea3267d315a5e280251b3a944592c448de76dedc 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amanda.conf
 .\"    Author: James da Silva <jds@amanda.org>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: File formats and conventions
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMANDA\&.CONF" "5" "12/14/2010" "Amanda 3\&.2\&.1" "File formats and conventions"
+.TH "AMANDA\&.CONF" "5" "06/02/2011" "Amanda 3\&.3\&.0" "File formats and conventions"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
@@ -370,8 +370,20 @@ Default: not set\&. When set, this directive will cause Amanda to automatically
 .RS 4
 Default: not set\&. When set, this directive will cause Amanda to automatically write an Amanda tape label to most volume she encounters\&. This option is DANGEROUS because when set, Amanda may erase near\-failing tapes or tapes accidentally loaded in the wrong slot\&.
 .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:
-\fBautolabel "DailySet1\-%%%" empty\fR
+When using this directive, specify the template for new tape labels\&. The template can contains many variables that are substituted by their values:
+.sp
+.nf
+    $c : config name
+    $o : org configuration
+    $b : barcode of the volume
+    $m : meta label
+.fi
+.sp
+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:
+\fB"DailySet1\-%%%"\fR,
+\fB"$c\-%%%"\fR,
+\fB"$m\-%%%"\fR,
+\fB"$m\-$b"\fR
 .sp
 Note that many devices cannot distinguish an empty tape from an error condition, so it may is often necessary to include
 \fBvolume\-error\fR
@@ -408,6 +420,24 @@ Label volumes where a read returns 0 bytes\&.
 .RE
 .RE
 .PP
+\fBmeta\-autolabel\fR \fIstring\fR
+.RS 4
+Default: not set\&. When set and if the changer support meta\-label, this directive will cause Amanda to automatically add a meta\-label to a meta\-volume\&.
+.sp
+A meta\-volume is a containers that contains many volumes, eg\&. a removable hard\-disk for use with chg\-disk, each hard disk have many slots (volume)\&. The meta\-label is the label to put on the meta\-volume\&.
+.sp
+When using this directive, specify the template for new meta labels\&. The template can contains many variables that are substituted by their values:
+.sp
+.nf
+    $c : config name
+    $o : org configuration
+.fi
+.sp
+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 meta labels\&. Example:
+\fB"DailySet1\-%%%"\fR,
+\fB"$o\-%%%"\fR,
+.RE
+.PP
 \fBdumpuser\fR \fIstring\fR
 .RS 4
 Default:
@@ -463,6 +493,20 @@ gives the name of an old changer script\&. See
 for more information on configuring changers\&.
 .RE
 .PP
+\fBinteractivity\fR \fIstring\fR
+.RS 4
+Default: not set\&. The interactivity module Amanda should use to interact with the user\&. See
+\fBamanda-interactivity\fR(7)
+for a list of modules\&.
+.RE
+.PP
+\fBtaperscan\fR \fIstring\fR
+.RS 4
+Default: traditional\&. The taperscan module amanda should use to find a tape to write to\&. See
+\fBamanda-taperscan\fR(7)
+for a list of modules\&.
+.RE
+.PP
 \fBchangerdev\fR \fIstring\fR
 .RS 4
 Default:
@@ -780,10 +824,12 @@ Default:
 \fI100\fR\&. 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 \fIbool\fR
+\fBautoflush\fR \fBno\fR|\fByes\fR|\fBall\fR
 .RS 4
 Default:
-\fBoff\fR\&. Whether an amdump run will flush the dumps from holding disk to tape\&.
+\fBno\fR\&. Whether an amdump run will flush the dumps from holding disk to tape\&. With
+\fByes\fR, only dump matching the command line argument are flushed\&. With
+\fBall\fR, all dump are flushed\&.
 .RE
 .PP
 \fBamrecover\-do\-fsf\fR \fIbool\fR
@@ -1033,11 +1079,18 @@ Default: \-\-with\-tcpportrange or
 \fI1024,65535\fR\&. Unreserved tcp port that will be used (bsd, bsdudp)\&. Range is inclusive\&.
 .RE
 .PP
-\fBrecovery\-limit\fR [ \fIstring\fR | \fBsame\-host\fR ]
+\fBrecovery\-limit\fR [ \fIstring\fR | \fBsame\-host\fR | \fBserver\fR]
 .RS 4
-Default: none (no limitations)\&. This parameter limits the hosts that may do remote recoveries\&. Hosts are identified by their authenticated peer name, as described in
+Default: none (no limitations)\&. This parameter limits the hosts that may do recoveries\&. Hosts are identified by their authenticated peer name, as described in
 \fBamanda-auth\fR(7); if this is not available and the recovery\-limit parameter is present, recovery will be denied\&. The arguments to the parameter are strings giving host match expressions (see
-\fBamanda-match\fR(7)) or the special keyword same\-host, which requires an exact match to the hostname of the DLE being recovered\&. Specifying no arguments at all will disable all recoveries from any host\&.
+\fBamanda-match\fR(7)) or the special keywords
+\fBsame\-host\fR
+or
+\fBserver\fR\&. The
+\fBsame\-host\fR
+keyword requires an exact match to the hostname of the DLE being recovered\&. The
+\fBserver\fR
+keyword require the connection come from the fqdn of the server\&. Specifying no arguments at all will disable all recoveries from any host\&.
 .sp
 Note that match expressions can be constructed to be forgiving of e\&.g\&., fully\-qualified vs\&. unqualified hostnames, but
 \fBsame\-host\fR
@@ -1138,7 +1191,7 @@ The dumptype options and values are:
 \fBauth\fR \fIstring\fR
 .RS 4
 Default:
-\fI"bsd"\fR\&. Type of authorization to perform between tape server and backup client hosts\&. See
+\fI"bsdtcp"\fR\&. Type of authorization to perform between tape server and backup client hosts\&. See
 \fBamanda-auth\fR(7)
 for more detail\&.
 .RE
@@ -1721,13 +1774,25 @@ Default:
 is specified, or when it is too small or does not exist, and thus the maximum amount of memory consumed for in\-memory splitting\&. The default unit is Kbytes if it is not specified\&.
 .RE
 .PP
-\fBrecovery\-limit\fR [ \fBsame\-host\fR | \fIstring\fR ]*
+\fBrecovery\-limit\fR [ \fBserver\fR | \fBsame\-host\fR | \fIstring\fR ]*
 .RS 4
 Default: global value\&. This parameter overrides the global
 \fBrecovery\-limit\fR
 parameter for DLEs of this dumptype\&.
 .RE
 .PP
+\fBdump\-limit\fR [ \fBserver\fR | \fBsame\-host\fR ]*
+.RS 4
+Default:
+\fBserver\fR\&. Specify which host can initiate a backup of the dle\&. With
+\fBserver\fR, the server can initiate a backup with the
+\fBamdump\fR
+command\&. With
+\fBsame\-host\fR, the client can initiate a backup with the
+\fBamdump_client\fR
+command\&.
+.RE
+.PP
 The following
 \fBdumptype\fR
 entries are predefined by Amanda:
@@ -1745,7 +1810,10 @@ define dumptype "srvcompress" {
     compress server fast
 }
 define dumptype "bsd\-auth" {
-    auth bsd
+    auth "bsd"
+}
+define dumptype "bsdtcp\-auth" {
+    auth "bsdtcp"
 }
 define dumptype "no\-record" {
     record no
@@ -1980,6 +2048,17 @@ is the name of this type of application\&. It is referenced from the
 .PP
 The application options and values are:
 .PP
+\fBclient\-name\fR \fIstring\fR
+.RS 4
+No default, specifies an application name that is in the amanda\-client\&.conf on the client\&. The setting from that application will be merged with the current application\&. If
+\fBclient\-name\fR
+is set then it is an error if that application is not defined on the client\&.
+.sp
+If
+\fBclient\-name\fR
+is not set then the merge is done with the application that have the name equal to the plugin\&. eg\&. if the plugin is \'amgtar\', then the setting from the application \'amgtar\' is used if it is defined\&.
+.RE
+.PP
 \fBcomment\fR \fIstring\fR
 .RS 4
 Default: not set\&. A comment string describing this application\&.
@@ -2022,6 +2101,17 @@ is the name of this type of script\&. It is referenced from the
 .PP
 The script options and values are:
 .PP
+\fBclient\-name\fR \fIstring\fR
+.RS 4
+No default, specifies a script name that is in the amanda\-client\&.conf on the client\&. The setting from that script will be merged with the currect script\&. If
+\fBclient\-name\fR
+is set then it is an error if that script is not defined on the client\&.
+.sp
+If
+\fBclient\-name\fR
+is not set then the merge is done with the script that have the name equal to the plugin\&. eg\&. if the plugin is \'amlog\-script\', then the setting from the script \'amlog\-script\' is used\&.
+.RE
+.PP
 \fBcomment\fR \fIstring\fR
 .RS 4
 Default: not set\&. A comment string describing this script\&.
@@ -2040,6 +2130,13 @@ Default:
 \fI5000\fR\&. Scripts are executed in that order, it is useful if you have many scripts and they must be executed in a spefific order\&.
 .RE
 .PP
+\fBsingle\-execution\fR \fIboolean\fR
+.RS 4
+Default:
+\fIno\fR\&. The script is executed for each dle\&. If
+\fIyes\fR, the script is executed one time only\&.
+.RE
+.PP
 \fBexecute\-where\fR [ \fBclient\fR | \fBserver\fR ]
 .RS 4
 Default:
@@ -2050,6 +2147,11 @@ Default:
 .RS 4
 No default\&. When the script must be executed, you can specify many of them:
 .PP
+\fBpre\-amcheck\fR
+.RS 4
+Execute before the amcheck command for all dle\&. Can only be run on server\&.
+.RE
+.PP
 \fBpre\-dle\-amcheck\fR
 .RS 4
 Execute before the amcheck command for the dle\&.
@@ -2060,6 +2162,11 @@ Execute before the amcheck command for the dle\&.
 Execute before the amcheck command for all dle for the client\&.
 .RE
 .PP
+\fBpost\-amcheck\fR
+.RS 4
+Execute after the amcheck command for all dle\&. Can only be run on server\&.
+.RE
+.PP
 \fBpost\-dle\-amcheck\fR
 .RS 4
 Execute after the amcheck command for the dle\&.
@@ -2070,6 +2177,11 @@ Execute after the amcheck command for the dle\&.
 Execute after the amcheck command for all dle for the client\&.
 .RE
 .PP
+\fBpre\-estimate\fR
+.RS 4
+Execute before the estimate command for all dle\&. Can only be run on server\&.
+.RE
+.PP
 \fBpre\-dle\-estimate\fR
 .RS 4
 Execute before the estimate command for the dle\&.
@@ -2080,6 +2192,11 @@ Execute before the estimate command for the dle\&.
 Execute before the estimate command for all dle for the client\&.
 .RE
 .PP
+\fBpost\-estimate\fR
+.RS 4
+Execute after the estimate command for all dle\&. Can only be run on server\&.
+.RE
+.PP
 \fBpost\-dle\-estimate\fR
 .RS 4
 Execute after the estimate command for the dle\&.
@@ -2090,6 +2207,11 @@ Execute after the estimate command for the dle\&.
 Execute after the estimate command for all dle for the client\&.
 .RE
 .PP
+\fBpre\-backup\fR
+.RS 4
+Execute before the backup command for all dle\&. Can only be run on server\&.
+.RE
+.PP
 \fBpre\-dle\-backup\fR
 .RS 4
 Execute before the backup command for the dle\&.
@@ -2100,6 +2222,11 @@ Execute before the backup command for the dle\&.
 Execute before the backup command for all dle for the client\&. It can\'t be run on client, it must be run on server
 .RE
 .PP
+\fBpost\-backup\fR
+.RS 4
+Execute after the backup command for all dle\&. Can only be run on server\&.
+.RE
+.PP
 \fBpost\-dle\-backup\fR
 .RS 4
 Execute after the backup command for the dle\&.
@@ -2211,6 +2338,93 @@ is the user\-specified name of this device\&. The remaining parameters are speci
 See
 \fBamanda-changers\fR(7)
 for more information on configuring changers\&.
+.SH "INTERACTIVITY SECTION"
+.PP
+The
+\fBamanda\&.conf\fR
+file may define multiple interactivyt methods, although only one will be used \- that specified by the
+\fBinteractivity\fR
+parameter\&. The information is entered in a
+\fBinteractivity\fR
+section, which looks like this:
+.nf
+define interactivity \fIname\fR {
+    \fIinteractivity\-option\fR \fIinteractivity\-value\fR
+    \&.\&.\&.
+}
+.fi
+.PP
+The { must appear at the end of a line, and the } on its own line\&.
+.PP
+\fIname\fR
+is the user\-specified name of this interactivity\&. The remaining parameters are specific to the interactivity type selected\&.
+.PP
+The interactivity options and values are:
+.PP
+\fBcomment\fR \fIstring\fR
+.RS 4
+Default: not set\&. A comment string describing this interactivity\&.
+.RE
+.PP
+\fBplugin\fR \fIstring\fR
+.RS 4
+No default\&. Must be set to the name of the interactivity module, as described in
+\fBamanda-interactivity\fR(7)\&.
+.RE
+.PP
+\fBproperty\fR [\fBappend\fR] \fIstring\fR \fIstring\fR+
+.RS 4
+No default\&. You can set arbitrary properties for the interactivity\&. Each interactivity module has a different set of properties\&. The first string contains the name of the property to set, and the others contains its values\&. All strings should be quoted\&. The
+\fBappend\fR
+keyword appends the given values to an existing list of values for that property\&.
+.RE
+.PP
+See
+\fBamanda-interactivity\fR(7)
+for more information on configuring interactivity methods\&.
+.SH "TAPERSCAN SECTION"
+.PP
+The
+\fBamanda\&.conf\fR
+file may define multiple taperscan methods, although only one will be used \- that specified by the
+\fBtaperscan\fR
+parameter\&. The information is entered in a
+\fBtaperscan\fR
+section, which looks like this:
+.nf
+define taperscan \fIname\fR {
+    \fItaperscan\-option\fR \fItaperscan\-value\fR
+    \&.\&.\&.
+}
+.fi
+.PP
+The { must appear at the end of a line, and the } on its own line\&.
+.PP
+\fIname\fR
+is the user\-specified name of this taperscan\&. The remaining parameters are specific to the taperscan type selected\&.
+.PP
+The taperscan options and values are:
+.PP
+\fBcomment\fR \fIstring\fR
+.RS 4
+Default: not set\&. A comment string describing this taperscan\&.
+.RE
+.PP
+\fBplugin\fR \fIstring\fR
+.RS 4
+No default\&. Must be set to the name of the taperscan module\&. See
+<man></man>
+for a list of defined taperscan modules\&.
+.RE
+.PP
+\fBproperty\fR [\fBappend\fR] \fIstring\fR \fIstring\fR+
+.RS 4
+No default\&. Operates just like properties for interactivity methods, above\&.
+.RE
+.PP
+See
+\fBamanda-taperscan\fR(7)
+for more information on configuring taperscan\&.
 .SH "DUMP SPLITTING CONFIGURATION"
 .PP
 Amanda can "split" dumps into parts while writing them to storage media\&. This allows Amanda to recover gracefully from a failure while writing a part to a volume, by simply selecting a new volume and re\-writing the dump from the beginning of the failed part\&. Parts also allow Amanda to seek directly to the required data, although this functionality is not yet used\&.
@@ -2247,7 +2461,9 @@ parameters describe how to behave when caching is required (on PORT\-WRITE)\&. F
 \fBamanda-auth\fR(7),
 \fBamanda-changers\fR(7),
 \fBamanda-devices\fR(7),
-\fBamanda-scripts\fR(7)
+\fBamanda-interactivity\fR(7),
+\fBamanda-scripts\fR(7),
+\fBamanda-taperscan\fR(7)
 .PP
 The Amanda Wiki:
 : http://wiki.zmanda.com/
index cc2f4b2bae98763e9c111a50d2471e4ad727f488..c2cf0e57c97dd9d83575773886a315694d2bf3bc 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amarchiver
 .\"    Author: Dustin J. Mitchell <dustin@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMARCHIVER" "8" "12/14/2010" "Amanda 3\&.2\&.1" "System Administration Commands"
+.TH "AMARCHIVER" "8" "06/02/2011" "Amanda 3\&.3\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index 714bac8ed1d59a8186eea20d063a578ac06b708a..2ac9b741468b80a8c0fdb2d8c6a722bb7ea752d5 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amcheck
 .\"    Author: James da Silva <jds@amanda.org>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMCHECK" "8" "12/14/2010" "Amanda 3\&.2\&.1" "System Administration Commands"
+.TH "AMCHECK" "8" "06/02/2011" "Amanda 3\&.3\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index 4be4ee8f30c45aaa835b3150bf751a19f4b9957a..0bece920530e3771139362e21135d30626e116c2 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amcheckdb
 .\"    Author: Adrian T. Filipi-Martin <atf3r@cs.virginia.edu>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMCHECKDB" "8" "12/14/2010" "Amanda 3\&.2\&.1" "System Administration Commands"
+.TH "AMCHECKDB" "8" "06/02/2011" "Amanda 3\&.3\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index 40f7d747b11a1d56c3f600ec9990f1379040f3be..ec4b4c803ae095bd2f5f79ed2c7004e691b827e7 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amcheckdump
 .\"    Author: Ian Turner <ian@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMCHECKDUMP" "8" "12/14/2010" "Amanda 3\&.2\&.1" "System Administration Commands"
+.TH "AMCHECKDUMP" "8" "06/02/2011" "Amanda 3\&.3\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index c33779710dea7d74c33e03b55cd889a57e4d62fc..6906d802191f6cdd65d62cd0e3b7670c5d0d77a5 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amcleanup
 .\"    Author: James da Silva <jds@amanda.org>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMCLEANUP" "8" "12/14/2010" "Amanda 3\&.2\&.1" "System Administration Commands"
+.TH "AMCLEANUP" "8" "06/02/2011" "Amanda 3\&.3\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index 5a6c0b07233eadc3a1cba15559fb5d73afd98adb..34d2c95f9215b4d20622f6c455b586fc9cd23cab 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amcrypt-ossl-asym
 .\"    Author: Kevin Till <kevin.till@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMCRYPT\-OSSL\-ASYM" "8" "12/14/2010" "Amanda 3\&.2\&.1" "System Administration Commands"
+.TH "AMCRYPT\-OSSL\-ASYM" "8" "06/02/2011" "Amanda 3\&.3\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index 9022e6000f3e748db394f1f1a7f8e5933a89d256..a0ef05e1a4d6efda6de3ded20273549cd9f40334 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amcrypt-ossl
 .\"    Author: Kevin Till <kevin.till@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMCRYPT\-OSSL" "8" "12/14/2010" "Amanda 3\&.2\&.1" "System Administration Commands"
+.TH "AMCRYPT\-OSSL" "8" "06/02/2011" "Amanda 3\&.3\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index af811b082067280aaf207ff21becb3a03a7eaa33..ac2ce1bf4c57e574df57a37a37b0a1780d0ed595 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amcrypt
 .\"    Author: Kevin Till <kevin.till@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMCRYPT" "8" "12/14/2010" "Amanda 3\&.2\&.1" "System Administration Commands"
+.TH "AMCRYPT" "8" "06/02/2011" "Amanda 3\&.3\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index accf385214b215c6a9ebcf201e8317ff96edf6af..41465d57be97a5d4b3d72f84399988a23497ae9c 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amcryptsimple
 .\"    Author: Kevin Till <kevin.till@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMCRYPTSIMPLE" "8" "12/14/2010" "Amanda 3\&.2\&.1" "System Administration Commands"
+.TH "AMCRYPTSIMPLE" "8" "06/02/2011" "Amanda 3\&.3\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index baeb1b5bd0e054fa8fd0af9db7f4ac4dd8811708..029838220901a7640fe63d979b1810a290d57a33 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amdevcheck
 .\"    Author: Ian Turner <ian@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMDEVCHECK" "8" "12/14/2010" "Amanda 3\&.2\&.1" "System Administration Commands"
+.TH "AMDEVCHECK" "8" "06/02/2011" "Amanda 3\&.3\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index dc5c0e5fbebf37b473db6cb2086effa3cfabfd21..c1e54270aea1c780db93a9f1c4f9674e6a03cba7 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amdump
 .\"    Author: James da Silva <jds@amanda.org>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMDUMP" "8" "12/14/2010" "Amanda 3\&.2\&.1" "System Administration Commands"
+.TH "AMDUMP" "8" "06/02/2011" "Amanda 3\&.3\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
diff --git a/man/amdump_client.8 b/man/amdump_client.8
new file mode 100644 (file)
index 0000000..454dfa4
--- /dev/null
@@ -0,0 +1,58 @@
+'\" t
+.\"     Title: amdump_client
+.\"    Author: Jean-Louis Martineau <martineau@zmanda.com>
+.\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
+.\"      Date: 06/02/2011
+.\"    Manual: System Administration Commands
+.\"    Source: Amanda 3.3.0
+.\"  Language: English
+.\"
+.TH "AMDUMP_CLIENT" "8" "06/02/2011" "Amanda 3\&.3\&.0" "System Administration Commands"
+.\" -----------------------------------------------------------------
+.\" * set default formatting
+.\" -----------------------------------------------------------------
+.\" disable hyphenation
+.nh
+.\" disable justification (adjust text to left margin only)
+.ad l
+.\" -----------------------------------------------------------------
+.\" * MAIN CONTENT STARTS HERE *
+.\" -----------------------------------------------------------------
+.SH "NAME"
+amdump_client \- back up all disks in an Amanda configuration
+.SH "SYNOPSIS"
+.HP \w'\fBamdump_client\fR\ 'u
+\fBamdump_client\fR [\fB\-o\fR\ \fIconfigoption\fR...] [\fB\-\-config\fR\ \fIconfig\fR] \fICMD\fR [\fIdiskname\fR...]
+.SH "DESCRIPTION"
+.PP
+\fBAmdump_client\fR
+initiate backup on the client\&. There are two commands (CMD):
+.PP
+\fBlist\fR
+.RS 4
+list all diskname that can be dumped\&.
+.RE
+.PP
+\fBcheck\fR
+.RS 4
+Check the configuration of the client and disk\&.
+.RE
+.PP
+\fBdump\fR
+.RS 4
+Start a backup of the specified diskname, or all diskname if none are specified\&.
+.RE
+.SH "SEE ALSO"
+.PP
+\fBamanda\fR(8),
+\fBamdump\fR(8),
+\fBamanda-match\fR(7)
+.PP
+The Amanda Wiki:
+: http://wiki.zmanda.com/
+.SH "AUTHOR"
+.PP
+\fBJean\-Louis Martineau\fR <\&martineau@zmanda\&.com\&>
+.RS 4
+Zmanda, Inc\&. (http://www\&.zmanda\&.com)
+.RE
index d5a7b94b89a7b05b91465905357da377000495f5..b9ad3ca367ca4d6e1473c37b0e7e994ccffb2631 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amfetchdump
 .\"    Author: John Stange <building@nap.edu>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMFETCHDUMP" "8" "12/14/2010" "Amanda 3\&.2\&.1" "System Administration Commands"
+.TH "AMFETCHDUMP" "8" "06/02/2011" "Amanda 3\&.3\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index d1e81119b67c37a2becad26c091adf095c1ceece..38f861592ad5c640d452a6edb75d32c2e8af2ca7 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amflush
 .\"    Author: James da Silva <jds@amanda.org>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMFLUSH" "8" "12/14/2010" "Amanda 3\&.2\&.1" "System Administration Commands"
+.TH "AMFLUSH" "8" "06/02/2011" "Amanda 3\&.3\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index 579801621346eeedf1385d8b7480a2d7adc9e806..20121ad043d180ad13e07710082f0d70f07973c1 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amgetconf
 .\"    Author: Jean-Louis Martineau <martineau@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMGETCONF" "8" "12/14/2010" "Amanda 3\&.2\&.1" "System Administration Commands"
+.TH "AMGETCONF" "8" "06/02/2011" "Amanda 3\&.3\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index d29603a297b6e6b9d2a0c0633427cad7765bbd26..5c75837e435cbaa9eb727293e26dc36e360cf3e4 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amgpgcrypt
 .\"    Author: Kevin Till <kevin.till@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMGPGCRYPT" "8" "12/14/2010" "Amanda 3\&.2\&.1" "System Administration Commands"
+.TH "AMGPGCRYPT" "8" "06/02/2011" "Amanda 3\&.3\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index 432d82815d3e2064c5b862330786443c5da1931d..5af9bcb8bd51a93b93a229ca95844f4929de0d3f 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amgtar
 .\"    Author: Jean-Louis Martineau <martineau@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMGTAR" "8" "12/14/2010" "Amanda 3\&.2\&.1" "System Administration Commands"
+.TH "AMGTAR" "8" "06/02/2011" "Amanda 3\&.3\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index 8384170e4c2727b1151e7be9daffc12fa1a2d223..3327b5c4d1b55858d1e310394ee183048cabaca9 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amlabel
 .\"    Author: James da Silva <jds@amanda.org>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMLABEL" "8" "12/14/2010" "Amanda 3\&.2\&.1" "System Administration Commands"
+.TH "AMLABEL" "8" "06/02/2011" "Amanda 3\&.3\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
@@ -22,7 +22,7 @@
 amlabel \- label an Amanda tape
 .SH "SYNOPSIS"
 .HP \w'\fBamlabel\fR\ 'u
-\fBamlabel\fR [\fB\-f\fR] [\fB\-\-version\fR] [\fB\-o\fR\ \fIconfigoption\fR...] \fIconfig\fR \fIlabel\fR [slot\ \fIslot\fR]
+\fBamlabel\fR [\fB\-\-barcode\ \fR\fB\fIbarcode\fR\fR] [\fB\-\-meta\ \fR\fB\fImeta\-label\fR\fR] [\fB\-\-assign\fR] [\fB\-f\fR] [\fB\-\-version\fR] [\fB\-o\fR\ \fIconfigoption\fR...] \fIconfig\fR [\fIlabel\fR] [slot\ \fIslot\fR]
 .SH "DESCRIPTION"
 .PP
 This command applies a label to an Amanda volume, erasing the volume in the process\&.
@@ -35,15 +35,28 @@ verify the label before writing to make sure the proper volume is loaded, and th
 .PP
 If no
 [\fIslot\fR]
+and no
+[\fIbarcode\fR]
 is given, then
 \fBamlabel\fR
-labels the tape in the current slot of the default changer\&. If a slot is given, it labels the volume in that slot\&.
+labels the tape in the current slot of the default changer\&. If a slot is given, it labels the volume in that slot\&. If a barcode is given, it labels the volume with that barcode\&.
 \fILabel\fR
 may be any string that does not contain whitespace and that matches the
 \fBlabelstr\fR
 (see
 \fBamanda.conf\fR(5))\&.
 .PP
+If
+[\fIlabel\fR]
+is not given, an autolabel is generated, see
+\fBautolabel\fR
+in
+\fBamanda.conf\fR(5)\&.
+.PP
+If
+[\fB\-\-assign\fR]
+is given, the barcode and meta\-label are assigned to the label without labeling the volume\&. The label must already be in the tapelist file\&.
+.PP
 This command also appends the new volume to the
 \fBtapelist\fR(5)
 file, so that they will be used in the order they are labeled (depending on the taperscan in use \(em see
@@ -56,6 +69,23 @@ will not write a label if the volume already contains an active label or if the
 (force) flag bypasses these verifications\&.
 .SH "OPTIONS"
 .PP
+\fB\-\-barcode \fR\fB\fIbarcode\fR\fR
+.RS 4
+With
+[\-\-assign], assign the barcode to the label\&. Without
+[\-\-assign], label the volume with that barcode\&.
+.RE
+.PP
+\fB\-\-meta \fR\fB\fImeta\-label\fR\fR
+.RS 4
+Assign the meta label to the label after labeling the volume\&.
+.RE
+.PP
+\fB\-\-assign\fR
+.RS 4
+Assign the barcode or meta\-label to the label without labeling the volume\&. The label must already be in the tapelist file\&.
+.RE
+.PP
 \fB\-f\fR
 .RS 4
 Force the label operation; see above
index ce5124805dd7a6fc0319f3527ac7e79ddbc150d7..854a9417b2d9dabba3d185dcff9fe714db0fe200 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amoverview
 .\"    Author: Stefan G. Weichinger <sgw@amanda.org>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMOVERVIEW" "8" "12/14/2010" "Amanda 3\&.2\&.1" "System Administration Commands"
+.TH "AMOVERVIEW" "8" "06/02/2011" "Amanda 3\&.3\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
@@ -36,8 +36,7 @@ man page for more details about Amanda\&.
 \fB\-\-config\fR \fIconfig\fR
 .RS 4
 Use configuration
-\fIconfig\fR
-instead of configuration daily\&.
+\fIconfig\fR\&.
 .RE
 .PP
 \fB\-\-hostwidth\fR \fIwidth\fR
index 91583529cedad7fec3b604d71b7c153ca252bcdb..9252f494306e22883cd1c8d8c7b55521593218af 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: ampgsql
 .\"    Author: Nikolas Coukouma <atrus@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMPGSQL" "8" "12/14/2010" "Amanda 3\&.2\&.1" "System Administration Commands"
+.TH "AMPGSQL" "8" "06/02/2011" "Amanda 3\&.3\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index c809db2c0d4f4fd0bb8394b1c90bf268aae3c5c1..4aed6a1606600f47acda3269c45de0435234bb3a 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amplot
 .\"    Author: Olafur Gudmundsson <ogud@tis.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMPLOT" "8" "12/14/2010" "Amanda 3\&.2\&.1" "System Administration Commands"
+.TH "AMPLOT" "8" "06/02/2011" "Amanda 3\&.3\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index fdb11aa987a9b971dd3088f2e5cae2f9777ec3f8..c672104ae0a9481690209f727a7de9c73c7123d8 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amraw
 .\"    Author: Jean-Louis Martineau <martineau@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMRAW" "8" "12/14/2010" "Amanda 3\&.2\&.1" "System Administration Commands"
+.TH "AMRAW" "8" "06/02/2011" "Amanda 3\&.3\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index 58d81a3dab38ea4a6013d84da974d7a2c06e85f6..47849976bf860ddc2435b457d9f545f733a444ce 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amrecover
 .\"    Author: Alan M. McIvor <alan@kauri.auck.irl.cri.nz>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMRECOVER" "8" "12/14/2010" "Amanda 3\&.2\&.1" "System Administration Commands"
+.TH "AMRECOVER" "8" "06/02/2011" "Amanda 3\&.3\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
@@ -94,6 +94,13 @@ Hostname to begin restoring; defaults to the system\'s hostname\&.
 See the "\fBCONFIGURATION OVERRIDE\fR" section in
 \fBamanda\fR(8)\&.
 .RE
+.SH "AUTH"
+.PP
+The default
+\fBauth\fR
+is \'BSDTCP\', you can set a different auth in the
+\fBamanda\-client\&.conf\fR
+file or by specifying the \'\-oauth=bsd\' command line argument\&.
 .SH "COMMANDS"
 .PP
 \fBAmrecover\fR
index a36acbfffa5a14651cd314be2c6afa294bc0fb96..691227df973c746c241afb2f99338dd6c85e6b2a 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amreport
 .\"    Author: Stefan G. Weichinger <sgw@amanda.org>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMREPORT" "8" "12/14/2010" "Amanda 3\&.2\&.1" "System Administration Commands"
+.TH "AMREPORT" "8" "06/02/2011" "Amanda 3\&.3\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index 42190458d3290dfced1f01f93f3367ed4acb4f5f..24fdfb8eb731a26a1ad654d6ea89393d9702c4a1 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amrestore
 .\"    Author: James da Silva <jds@amanda.org>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMRESTORE" "8" "12/14/2010" "Amanda 3\&.2\&.1" "System Administration Commands"
+.TH "AMRESTORE" "8" "06/02/2011" "Amanda 3\&.3\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index 1441c76fb52c269730a9496e34b9eddd2853b79d..118d4dd6a9d873e8d443e218e85486b37e704960 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amrmtape
 .\"    Author: Adrian T. Filipi-Martin <atf3r@cs.virginia.edu>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMRMTAPE" "8" "12/14/2010" "Amanda 3\&.2\&.1" "System Administration Commands"
+.TH "AMRMTAPE" "8" "06/02/2011" "Amanda 3\&.3\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index 51e430ad8bc5e9fc7637b388d227f50f460ce471..95be24d412503551acd392f897c792bd34ccc5d0 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amsamba
 .\"    Author: Jean-Louis Martineau <martineau@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMSAMBA" "8" "12/14/2010" "Amanda 3\&.2\&.1" "System Administration Commands"
+.TH "AMSAMBA" "8" "06/02/2011" "Amanda 3\&.3\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index b7d34071b676610b919aa3729265e09aec9111d1..d6082a3b975a15de3debabc03958f7035e1778e0 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amserverconfig
 .\"    Author: Kevin Till <kevin.till@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMSERVERCONFIG" "8" "12/14/2010" "Amanda 3\&.2\&.1" "System Administration Commands"
+.TH "AMSERVERCONFIG" "8" "06/02/2011" "Amanda 3\&.3\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index e8650f12d62679194709d1a36a854925594aa6bf..35b751e090ee75f96e2be04adf19d279ff01d21b 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amservice
 .\"    Author: Jean-Louis Martineau <martineau@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMSERVICE" "8" "12/14/2010" "Amanda 3\&.2\&.1" "System Administration Commands"
+.TH "AMSERVICE" "8" "06/02/2011" "Amanda 3\&.3\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
@@ -22,7 +22,7 @@
 amservice \- run an amanda service on a client
 .SH "SYNOPSIS"
 .HP \w'\fBamservice\fR\ 'u
-\fBamservice\fR [\-f\ \fIinput_file\fR] [\fB\-o\fR\ \fIconfigoption\fR...] \fIhostname\fR \fIauth\fR \fIservice\fR
+\fBamservice\fR [\-f\ \fIinput_file\fR\ [\-s]] [\fB\-o\fR\ \fIconfigoption\fR...] \fIhostname\fR \fIauth\fR \fIservice\fR
 .SH "DESCRIPTION"
 .PP
 \fBAmservice\fR
@@ -53,6 +53,11 @@ The amanda service to execute on the client\&. One of noop, selfcheck or sendsiz
 Use the file input_file instead of stdin to read the REQ packet from\&.
 .RE
 .PP
+\fB\-s\fR
+.RS 4
+Redirect the first connected stream to stdin/stdout\&. The \-f argument is required for the REQ packet, the REP packet is not printed on stdout\&.
+.RE
+.PP
 \fB\-o \fR\fB\fIconfigoption\fR\fR
 .RS 4
 See the "CONFIGURATION OVERRIDE" section in
@@ -62,7 +67,8 @@ See the "CONFIGURATION OVERRIDE" section in
 .PP
 The noop service is easy to execute because it does not require a REQ packet:
 .nf
-amservice hostname bsdtcp noop < /dev/null.fi
+amservice hostname bsdtcp noop < /dev/null
+.fi
 .PP
 The example executes the noop service on the client using bsdtcp auth\&. This is useful for debugging connection problems\&. It print an OPTIONS line upon success\&.
 .PP
index d240d11f41c20b5f2118c6ad89c338e365dc0c50..9b1d9ce71a2dff53d1bafb2285c43ff7cbc68dd8 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amstar
 .\"    Author: Jean-Louis Martineau <martineau@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMSTAR" "8" "12/14/2010" "Amanda 3\&.2\&.1" "System Administration Commands"
+.TH "AMSTAR" "8" "06/02/2011" "Amanda 3\&.3\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
@@ -23,12 +23,23 @@ amstar \- Amanda Application to interface with star
 .SH "DESCRIPTION"
 .PP
 Amstar is an Amanda Application API script\&. It should not be run by users directly\&. It uses star to backup and restore data\&.
+.SH "INCLUDE - EXCLUDE"
+.PP
+amstar doesn\'t support include\&. Both \'exclude list\' and \'exclude file\' are supported\&. There is a maximum of 100 patterns (limit of star)\&.
+.PP
+Moving directories into and out of directories on the exclude list causes incremental backups to not contain the files in the moved directories until the next full backup unless the moved files are modified after the move\&.
 .SH "PROPERTIES"
 .PP
 This section lists the properties that control amstar\'s functionality\&. See
 \fBamanda-applications\fR(7)
 for information on application properties and how they are configured\&.
 .PP
+ACL
+.RS 4
+
+If "YES" (the default), amstar will store files acl by passing the \fI\-acl\fR argument to star\&. If "NO", then the \fI\-acl\fR option is not given to star, and it will not try to backup the acl\&.
+.RE
+.PP
 COMMAND\-OPTIONS
 .RS 4
 If set, theses options are passed asis to star\&. Each option must be a different value of the property\&. Some option can break how amanda do backup, use it with care\&.
index 4ea7141b4ec8bc36263eca3ffa8a5434d425d3af..fbe18716910ef93a6d2b2b18edc2d313c08d41b3 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amstatus
 .\"    Author: Stefan G. Weichinger <sgw@amanda.org>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMSTATUS" "8" "12/14/2010" "Amanda 3\&.2\&.1" "System Administration Commands"
+.TH "AMSTATUS" "8" "06/02/2011" "Amanda 3\&.3\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index c5668a0388ad2e4919293fb838ea75d9d628db5b..a7479ca95001f89f8926ce0b90028acd96c31493 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amsuntar
 .\"    Author: Satya Ganga <gast@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMSUNTAR" "8" "12/14/2010" "Amanda 3\&.2\&.1" "System Administration Commands"
+.TH "AMSUNTAR" "8" "06/02/2011" "Amanda 3\&.3\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
@@ -57,6 +57,12 @@ is maintained with a  granularity of microseconds,Long file names and file
 sizes greater than 8GB can be archived\&. The default is YES\&.
 .RE
 .PP
+SUNTAR\-PATH
+.RS 4
+
+The path to the suntar binary\&. The default is set when Amanda is built\&.
+.RE
+.PP
 LANG
 .RS 4
 
index e2059d2cb9360c6f24762c818b46be04a556c380..28caa8c6955a7c7c43293f1630ca781860549b91 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amtape
 .\"    Author: Dustin J. Mitchell <dustin@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMTAPE" "8" "12/14/2010" "Amanda 3\&.2\&.1" "System Administration Commands"
+.TH "AMTAPE" "8" "06/02/2011" "Amanda 3\&.3\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index 6563ef4cd36db0650f4610d9bbe5476095b9cd23..1a4eba7c44001a2e8be544b517a485c44487cca4 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amtapetype
 .\"    Author: Dustin J. Mitchell <dustin@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMTAPETYPE" "8" "12/14/2010" "Amanda 3\&.2\&.1" "System Administration Commands"
+.TH "AMTAPETYPE" "8" "06/02/2011" "Amanda 3\&.3\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index 2cd8cb7315839b5b3fe6f2058b2b3e5330cdb37f..c80948b8d4336139fe3db80112fc792f8555f7ce 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amtoc
 .\"    Author: Nicolas Mayencourt <Nicolas.Mayencourt@cui.unige.ch>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMTOC" "8" "12/14/2010" "Amanda 3\&.2\&.1" "System Administration Commands"
+.TH "AMTOC" "8" "06/02/2011" "Amanda 3\&.3\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index 175209882fd12a076c636a211c080fe4421ed21f..2a97c4073cf615a6f7064b34ad8c6b45be460bd5 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amvault
 .\"    Author: Dustin J. Mitchell <dustin@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMVAULT" "8" "12/14/2010" "Amanda 3\&.2\&.1" "System Administration Commands"
+.TH "AMVAULT" "8" "06/02/2011" "Amanda 3\&.3\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index 38c4df8e1388d31538bd9bb80fbd066a54544a0a..61c6ba2c8e47ec54909f54d29977feda04a74d31 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amzfs-sendrecv
 .\"    Author: Jean-Louis Martineau <martineau@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMZFS\-SENDRECV" "8" "12/14/2010" "Amanda 3\&.2\&.1" "System Administration Commands"
+.TH "AMZFS\-SENDRECV" "8" "06/02/2011" "Amanda 3\&.3\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index a62b054c089f02be7034f8787765f4e4eaca04de..11e9e981568341a3406ceff405313d87e0facba5 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: amzfs-snapshot
 .\"    Author: Jean-Louis Martineau <martineau@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "AMZFS\-SNAPSHOT" "8" "12/14/2010" "Amanda 3\&.2\&.1" "System Administration Commands"
+.TH "AMZFS\-SNAPSHOT" "8" "06/02/2011" "Amanda 3\&.3\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index 652ba8df06528155ef9fe32c7b780116c051f6ab..0f28f3c91290176edf7f8db084b160af26dc8fb0 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: disklist
 .\"    Author: James da Silva <jds@amanda.org>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: File formats and conventions
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "DISKLIST" "5" "12/14/2010" "Amanda 3\&.2\&.1" "File formats and conventions"
+.TH "DISKLIST" "5" "06/02/2011" "Amanda 3\&.3\&.0" "File formats and conventions"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index 9fbfd0189d2074830354116b34f1496e681b0aeb..cf2a1c4dff58d2e23bb342ad9117f017f2445e0b 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: script-email
 .\"    Author: Jean-Louis Martineau <martineau@zmanda.com>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: System Administration Commands
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "SCRIPT\-EMAIL" "8" "12/14/2010" "Amanda 3\&.2\&.1" "System Administration Commands"
+.TH "SCRIPT\-EMAIL" "8" "06/02/2011" "Amanda 3\&.3\&.0" "System Administration Commands"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
index 29088aed23714035b2c9d4a758300e45d9fda89e..e1d082aaf95826bf5d0847e541fd04219fad352c 100644 (file)
@@ -2,12 +2,12 @@
 .\"     Title: tapelist
 .\"    Author: James da Silva <jds@amanda.org>
 .\" Generator: DocBook XSL Stylesheets vsnapshot_8273 <http://docbook.sf.net/>
-.\"      Date: 12/14/2010
+.\"      Date: 06/02/2011
 .\"    Manual: File formats and conventions
-.\"    Source: Amanda 3.2.1
+.\"    Source: Amanda 3.3.0
 .\"  Language: English
 .\"
-.TH "TAPELIST" "5" "12/14/2010" "Amanda 3\&.2\&.1" "File formats and conventions"
+.TH "TAPELIST" "5" "06/02/2011" "Amanda 3\&.3\&.0" "File formats and conventions"
 .\" -----------------------------------------------------------------
 .\" * set default formatting
 .\" -----------------------------------------------------------------
@@ -27,7 +27,7 @@ The
 file contains the list of tapes in active use\&. This file is not ordinarily ordinarily edited or examined manually\&. Its format may change, or it may be removed altogether, in future versions of Amanda\&. It contains lines of the form:
 .PP
 .nf
-YYYYMMDD label flags [BARCODE:barcode] [#comment]
+YYYYMMDD label flags [BARCODE:barcode] [META:meta] [#comment]
 .fi
 .PP
 Where
@@ -43,7 +43,7 @@ is one of "reuse" or "no\-reuse" and tells Amanda whether the tape may be reused
 dumps\&. See the
 \fBreuse\fR
 options of
-\fBamadmin\fR(8)\&. The optional barcode is prefixed with \'BARCODE\' if the volume have a barcode\&. The optional comment is prefixed with a \'#\' and continues to the end of the line\&. Amanda will maintain this comment until the tape is overwritten\&. Note that comments are not allowed on blank lines\&.
+\fBamadmin\fR(8)\&. The optional barcode is prefixed with \'BARCODE\' if the volume have a barcode\&. The optional meta label is prefixed with \'META\' if the volume is on a meta volume\&. The optional comment is prefixed with a \'#\' and continues to the end of the line\&. Amanda will maintain this comment until the tape is overwritten\&. Note that comments are not allowed on blank lines\&.
 .PP
 The file is sorted such that the most\-recently used tape appears on the first line, and the oldest tape appears on the last line\&.
 .PP
index 44b8730d37301efdfc7ff0ed0737c539f20a7b89..3d27fbbeaeb9a5e4dd7aa0560e9978c9e6273a46 100644 (file)
@@ -33,7 +33,7 @@
 </refsect1>
 
 <refsect1><title>COMPILATION AND GENERAL INFORMATION</title>
-  <para>The communication method and thus type of authentication that will be used by the Amanda server is specified by the <emphasis remap='I'>auth</emphasis> parameter in the dumptype for each disklist entry (DLE).  The <emphasis remap='I'>auth</emphasis> parameter thus may be easily and globally specified in the "global" dumptype.  If <emphasis remap='I'>auth</emphasis> is not specified, the <emphasis remap='B'>bsd</emphasis> communication method is used.  See &amconf; for more information on Amanda configuration and dumptypes, and &disklist; for more information on disklists.</para>
+  <para>The communication method and thus type of authentication that will be used by the Amanda server is specified by the <emphasis remap='I'>auth</emphasis> parameter in the dumptype for each disklist entry (DLE).  The <emphasis remap='I'>auth</emphasis> parameter thus may be easily and globally specified in the "global" dumptype.  If <emphasis remap='I'>auth</emphasis> is not specified, the <emphasis remap='B'>bsdtcp</emphasis> communication method is used.  See &amconf; for more information on Amanda configuration and dumptypes, and &disklist; for more information on disklists.</para>
 
 <para>On the client side, the Amanda daemon &amandad; validates the connection depending on the value of the <emphasis remap='B'>auth</emphasis> argument passed to it (see Amanda(8)).  Also, when it comes to recovery, the <emphasis remap='B'>auth</emphasis> parameter can be specified in the &amclientconf; file to specify the communication method to be used by the client to the server.</para>
 
index 4827e08113970ff7f3070e5834087867744135f7..1520f278b47b60a902f29d1b1d7a478ad308dc86 100644 (file)
@@ -134,9 +134,42 @@ specified by an alias, then properties from that definition applied.</para>
 
 <para>This section lists the changer drivers included with Amanda, and basic instructions for using them.  For complete How-To information, consult the Amanda wiki at http://wiki.zmanda.com.</para>
 
+<refsect2><title>chg-aggregate:changer (new)</title>
+<programlisting>
+define changer robot0 {
+  tpchanger "chg-robot:/dev/sg0"
+  property "tape-device" "0=tape:/dev/rmt/0" "1=tape:/dev/rmt/1"
+}
+define changer robot1 {
+  tpchanger "chg-robot:/dev/sg1"
+  property "tape-device" "0=tape:/dev/rmt/2" "1=tape:/dev/rmt/3"
+}
+define changer single {
+  tpchanger "chg-single:/dev/rmt/4"
+}
+define changer aggregate {
+  tpchanger "chg-aggregate:{robot0,robot1,single}"
+  property "state-filename" "/etc/amanda/CONF/aggregate.state"
+
+}
+tpchanger "aggregate"
+</programlisting>
+
+<para>This changer driver allow to use two or more changers or standalone
+drive in sequence.</para>
+
+</refsect2>
+
 <refsect2><title>chg-disk:VTAPEROOT (new)</title>
 <programlisting>
-tpchanger "chg-disk:/u01/vtapes"
+tpchanger "chg-disk:/var/mnt/vtapes"
+property "num-slot" "10"
+property "auto-create-slot" "yes"
+property "removable" "yes"
+property "mount" "yes"
+property "umount" "yes"
+property "umount-lockfile" "/etc/amanda/conf/vtapes-lock"
+property "umount-idle" "1"
 </programlisting>
 
 <para>This changer driver replaces the old <command>chg-disk</command>,
@@ -149,6 +182,45 @@ supporting parallel access to vtapes stored in directories named
 <computeroutput>file:VTAPEROOT</computeroutput>. This is useful for the <manref
 name="amrestore" vol="8" /> command line.</para>
 
+<refsect3><title>Properties</title>
+<!-- PLEASE KEEP THIS LIST IN ALPHABETICAL ORDER -->
+
+<variablelist>
+<!-- ==== -->
+<varlistentry><term>AUTO-CREATE-SLOT</term><listitem>
+If a <computeroutput>slotN</computeroutput> directory in the range 1 to NUM-SLOT does not already exist, and this property is true, then the changer will create the directory.
+</listitem></varlistentry>
+<!-- ==== -->
+<varlistentry><term>MOUNT</term><listitem>
+If this property is true, the changer try to mount the removable disk if nothing is mounted. The system must be configured to allow the amanda user to mount it.
+</listitem></varlistentry>
+<!-- ==== -->
+<varlistentry><term>NUM-SLOT</term><listitem>
+The minimum number of slots in the changer, where the first slot is <computeroutput>slot1</computeroutput>.  If additional slot directories exist, they will also be used.
+</listitem></varlistentry>
+<!-- ==== -->
+<varlistentry><term>REMOVABLE</term><listitem>
+If this property is true, then the changer will verify that the changer
+directory (e.g., <filename>/var/mnt/vtapes</filename>) is on a different
+filesystem from its parent directory (e.g., <filename>/var/mnt</filename>).
+This is useful for removable disks, as it will prevent Amanda from creating
+slot directories when the removable disk is not mounted.
+</listitem></varlistentry>
+<!-- ==== -->
+<varlistentry><term>UMOUNT</term><listitem>
+If this property is true, the changer try to umount the removable disk when it exit. The system must be configured to allow the amanda user to umount it.
+</listitem></varlistentry>
+<!-- ==== -->
+<varlistentry><term>UMOUNT-LOCKFILE</term><listitem>
+If UMOUNT is set, it require a lockfile outside of the mount point to prevent race.
+</listitem></varlistentry>
+<!-- ==== -->
+<varlistentry><term>UMOUNT-IDLE</term><listitem>
+If set, the changer try to umount the removable disk when it is not in use. The umount-idle value is a delay in second to wait before doing the umount. A value &gt;= 1 is required to prevent useless mount/umount.
+</listitem></varlistentry>
+
+</variablelist>
+</refsect3>
 </refsect2>
 
 <refsect2><title>chg-disk (old)</title>
index 40e53cb8b697e08f540809909d163b02c762fcce..2a1dcddea26dff73cb97f79b1a5c68dcd037d9d6 100644 (file)
@@ -103,7 +103,7 @@ The tapedev amrecover will use.</para>
   <term><amkeyword>auth</amkeyword> <amtype>string</amtype></term>
   <listitem>
 <para>Default:
-<amkeyword>"bsd"</amkeyword>.
+<amkeyword>"bsdtcp"</amkeyword>.
 Type of authorization to perform between tape server and backup client hosts.</para>
 <para><amkeyword>"bsd"</amkeyword>, bsd authorization with udp initial
 connection and one tcp connection by data stream.</para>
@@ -322,7 +322,7 @@ Unreserved tcp port that will be used (bsd, bsdudp)</para>
 
 <refsect1><title>APPLICATION SECTION</title>
 <para>The
-<emphasis remap='B'>amanda.conf</emphasis>
+<emphasis remap='B'>amanda-client.conf</emphasis>
 file may define multiple types of application.
 The information is entered in a <amkeyword>application</amkeyword>
 section, which looks like this:</para>
@@ -335,11 +335,22 @@ define application "<amtype>name</amtype>" {
 </programlisting>
 
 <para><amtype>name</amtype>
-is the name of this type of application. It is referenced from the
-<amkeyword>dumptype</amkeyword></para>
+is the name of this type of application.</para>
+<para>
+The setting from an application is merged with the dle setting
+  if the <amtype>name</amtype> is the same as the <amkeyword>client-application-name</amkeyword> from the dle
+  or if the <amkeyword>client-application-name</amkeyword> from the dle is not set and the <amtype>name</amtype> is the same as the <amkeyword>plugin</amkeyword> from the dle.</para>
 
 <para>The application options and values are:</para>
 <variablelist remap='TP'>
+  <varlistentry>
+  <term><amkeyword>client-application-name</amkeyword> <amtype>string</amtype></term>
+  <listitem>
+<para>Default:
+<amdefault>none</amdefault>.
+Not use on the client.</para>
+  </listitem>
+  </varlistentry>
   <varlistentry>
   <term><amkeyword>comment</amkeyword> <amtype>string</amtype></term>
   <listitem>
@@ -353,7 +364,7 @@ A comment string describing this application.</para>
   <listitem>
 <para>No default. Must be set to the name of the program. This program must be
 in the <emphasis remap='I'>$libexecdir/amanda/application</emphasis> directory
-on the client.</para>
+on the client. If set, it must be the same as the dle <amkeyword>plugin</amkeyword>.</para>
   </listitem>
   </varlistentry>
   <varlistentry>
@@ -371,7 +382,7 @@ the property to set, and the others contains its values.
 
 <refsect1><title>SCRIPT SECTION</title>
 <para>The
-<emphasis remap='B'>amanda.conf</emphasis>
+<emphasis remap='B'>amanda-client.conf</emphasis>
 file may define multiple types of script.
 The information is entered in a <emphasis remap='B'>script</emphasis>
 section, which looks like this:</para>
@@ -384,11 +395,22 @@ define script "<amtype>name</amtype>" {
 </programlisting>
 
 <para><amtype>name</amtype>
-is the name of this type of script. It is referenced from the
-<amkeyword>dumptype</amkeyword></para>
+is the name of this type of script.</para>
+<para>
+The setting from a script is merged with the dle setting
+  if the <amtype>name</amtype> is the same as the <amkeyword>client-script-name</amkeyword> from the dle
+  or if the <amkeyword>client-script-name</amkeyword> from the dle is not set and the <amtype>name</amtype> is the same as the <amkeyword>plugin</amkeyword> from the dle.</para>
 
 <para>The script options and values are:</para>
 <variablelist remap='TP'>
+  <varlistentry>
+  <term><amkeyword>client-script-name</amkeyword> <amtype>string</amtype></term>
+  <listitem>
+<para>Default:
+<amdefault>none</amdefault>.
+Not used on the client.</para>
+  </listitem>
+  </varlistentry>
   <varlistentry>
   <term><amkeyword>comment</amkeyword> <amtype>string</amtype></term>
   <listitem>
@@ -400,13 +422,14 @@ A comment string describing this script.</para>
   <varlistentry>
   <term><amkeyword>plugin</amkeyword> <amtype>string</amtype></term>
   <listitem>
-<para>No default. Must be set to the name of the program. This program must be in the <emphasis remap='I'>$libdir/amanda/application</emphasis> directory on the client and/or server.</para>
+<para>No default. Must be set to the name of the program. This program must be in the <emphasis remap='I'>$libdir/amanda/application</emphasis> directory on the client. If set, it must be the same as the dle <amkeyword>plugin</amkeyword>.</para>
   </listitem>
   </varlistentry>
   <varlistentry>
-  <term><amkeyword>execute-where</amkeyword> [ <amkeyword>client</amkeyword> | <amkeyword>server</amkeyword> ]</term>
+  <term><amkeyword>execute-where</amkeyword> <amkeyword>client</amkeyword></term>
   <listitem>
-<para>Default: <amkeyword>client</amkeyword>. Where the script must be executed, on the client or server. Only <amkeyword>client</amkeyword> is valid.</para>
+<para>Default: <amkeyword>client</amkeyword>.
+Value can't be changed.</para>
   </listitem>
   </varlistentry>
   <varlistentry>
@@ -467,24 +490,12 @@ A comment string describing this script.</para>
       <term><amkeyword>pre-dle-backup</amkeyword></term>
       <listitem>
 <para>Execute before the backup command for the dle.</para>
-      </listitem>
-      </varlistentry>
-      <varlistentry>
-      <term><amkeyword>pre-host-backup</amkeyword></term>
-      <listitem>
-<para>Execute before the backup command for all dle for the client.</para>
       </listitem>
       </varlistentry>
       <varlistentry>
       <term><amkeyword>post-dle-backup</amkeyword></term>
       <listitem>
 <para>Execute after the backup command for the dle.</para>
-      </listitem>
-      </varlistentry>
-      <varlistentry>
-      <term><amkeyword>post-host-backup</amkeyword></term>
-      <listitem>
-<para>Execute after the backup command for all dle for the client.</para>
       </listitem>
       </varlistentry>
       <varlistentry>
index f1792bdc6922edc849a664066412c15c91d722b9..170b90128c6df6869dbe847d1634e8d2f346d94c 100644 (file)
@@ -202,6 +202,10 @@ for future expansion.  Not all devices implement all of these properties.</para>
  <!-- ==== -->
  <varlistentry><term>MAX_VOLUME_USAGE</term><listitem>
  (read-write) 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.  The tapetype parameter <emphasis>length</emphasis> sets this property.
+</listitem></varlistentry>
+ <!-- ==== -->
+ <varlistentry><term>ENFORCE_MAX_VOLUME_USAGE</term><listitem>
+ (read-write) If this property is false, limit set by MAX_VOLUME_USAGE property (and thus the tapetype LENGTH parameter) will not be verified while writing to device, allowing the volume to expand without limit. If this property is true, then MAX_VOLUME_USAGE willbe enforced, limiting the total size of the volume. This property is not available on all devices; see below.
 </listitem></varlistentry>
  <!-- ==== -->
  <varlistentry><term>PARTIAL_DELETION</term><listitem>
@@ -371,7 +375,7 @@ as properties.</para>
 
 <para>The S3 device driver stores each block in a distinct S3 object.  Due to
 high HTTP overhead for each request, use of larger than normal block
-  sizes (&gt; 1 megabyte) is reccomended with the S3 device.</para>
+  sizes (&gt; 1 megabyte) is recommended with the S3 device.</para>
 
 <para>
 Amanda automatically creates a bucket when writing, if the bucket doesn't
@@ -401,6 +405,8 @@ chasing down a problem in communications with Amazon's servers.</para>
 <para>Since Amazon storage is unlimited, the device never encounteres EOM, so
 LEOM detection is trivially enabled for this device.</para>
 
+<para>This driver supports the ENFORCE_MAX_VOLUME_USAGE property. Default value is false. See COMMON_PROPERTIES, above.</para>
+
 <refsect3><title>Device-Specific Properties</title>
 
 <para>In addition to the common properties, the S3 device supports the
@@ -428,6 +434,14 @@ reading long enough to bring the average below this value.
 (read-write) Maximum speed, in bytes per second, that this device will send
 data to S3.  If the average speed exceeds this value, the device will stop
 writing long enough to bring the average below this value.
+</listitem></varlistentry>
+ <!-- ==== -->
+ <varlistentry><term>NB_THREADS_BACKUP</term><listitem>
+(read-write) The number of thread that send data to the s3 device, higher value can provide more throutput.
+</listitem></varlistentry>
+ <!-- ==== -->
+ <varlistentry><term>NB_THREADS_RECOVERY</term><listitem>
+(read-write) The number of thread that read data from the s3 device, higher value can provide more throutput.
 </listitem></varlistentry>
  <!-- ==== -->
  <varlistentry><term>S3_ACCESS_KEY</term><listitem>
@@ -450,10 +464,18 @@ if OpenSSL or GnuTLS is being used with libcurl. Multiple certificates can be
 bundled together simply by concatenating them.
 If NSS is being used, then it is the directory that the database resides in.
 The value is passed to curl_easy_setopt(3) as CURLOPT_CAINFO.
+</listitem></varlistentry>
+ <!-- ==== -->
+ <varlistentry><term>S3_HOST</term><listitem>
+(read-write) The host name to connect, in the form "hostname:port" or "ip:port", default is "s3.amazonaws.com"
 </listitem></varlistentry>
  <!-- ==== -->
  <varlistentry><term>S3_SECRET_KEY</term><listitem>
- (read-write) This property gives the Amazon S3 secret key used to access the service.
+(read-write) This property gives the Amazon S3 secret key used to access the service.
+</listitem></varlistentry>
+ <!-- ==== -->
+ <varlistentry><term>S3_SERVICE_PATH</term><listitem>
+(read-write) A path to add at the beginning of the URL.
 </listitem></varlistentry>
  <!-- ==== -->
  <varlistentry><term>S3_STORAGE_CLASS</term><listitem>
@@ -464,20 +486,30 @@ for the most up-to-date list.
 </listitem></varlistentry>
  <!-- ==== -->
  <varlistentry><term>S3_SSL</term><listitem>
- (read-write) Whether or not to use SSL/TLS to secure communications with Amazon S3.
+(read-write) Whether or not to use SSL/TLS to secure communications with Amazon S3.
+</listitem></varlistentry>
+ <!-- ==== -->
+ <varlistentry><term>S3_SUBDOMAIN</term><listitem>
+ (read-write) Whether or not to use subdomain hostname.
 </listitem></varlistentry>
  <!-- ==== -->
  <varlistentry><term>S3_USER_TOKEN</term><listitem>
- (read-write) This property specifies the user token for Amanda Enterprise Edition customers.
+(read-write) This property specifies the user token for Amanda Enterprise Edition customers.
 </listitem></varlistentry>
  <!-- ==== -->
  <varlistentry><term>VERBOSE</term><listitem>
- (read-write) If true, verbose data about each HTTP transaction is sent to the debug log.
+(read-write) If true, verbose data about each HTTP transaction is sent to the debug log.
 </listitem></varlistentry>
  <!-- ==== -->
 </variablelist>
 
 </refsect3>
+<refsect3><title>S3 URL</title>
+     SSL &amp;&amp;  SUBDOMAIN:   https://bucket.host/service_path/file
+     SSL &amp;&amp; !SUBDOMAIN:   https://host/service_path/bucket/file
+    !SSL &amp;&amp;  SUBDOMAIN:   http://bucket.host/service_path/file
+    !SSL &amp;&amp; !SUBDOMAIN:   http://host/service_path/bucket/file
+</refsect3>
 
 </refsect2>
 
@@ -639,6 +671,7 @@ size, regardless of the blocksize used to write the data.</para>
     LEOM detection can be disabled by setting the LEOM property to
     false.</para>
 
+<para>This device supports the ENFORCE_MAX_VOLUME_USAGE property. Default value is true. See COMMON PROPERTIES, above.</para>
 <refsect3><title>Device-Specific Properties</title>
 
 <variablelist>
diff --git a/man/xml-source/amanda-interactivity.7.xml b/man/xml-source/amanda-interactivity.7.xml
new file mode 100644 (file)
index 0000000..66616f7
--- /dev/null
@@ -0,0 +1,148 @@
+<?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 'global.entities'>
+  %global_entities;
+]>
+
+<refentry id='amanda-interactivity.7'>
+
+<refmeta>
+<refentrytitle>amanda-interactivity</refentrytitle>
+<manvolnum>7</manvolnum>
+&rmi.source;
+&rmi.version;
+&rmi.manual.7;
+</refmeta>
+<refnamediv>
+<refname>amanda-interactivity</refname>
+<refpurpose>Configuring Interactivity with Amanda Amanda</refpurpose>
+</refnamediv>
+<refentryinfo>
+&author.jlm;
+</refentryinfo>
+<!-- body begins here -->
+
+<refsect1><title>DESCRIPTION</title>
+
+<para>Amanda uses interactivity to ask user to load specific volumes when
+they are needed.  This manual page describes the interactivity modules
+included with Amanda.</para>
+
+<para>This is a <emphasis>user-level</emphasis> description of the API, and
+does not address details that are only of concern to developers of new
+interactivity plugins.  For that purpose, consult the Amanda source code,
+perldoc 'Amanda::Interactivity' and http://wiki.zmanda.com.</para>
+
+</refsect1>
+
+<refsect1><title>DEFINING INTERACTIVITY</title>
+
+<para>Interactivity is specified in &amconf; as follows:
+
+<programlisting>
+define interactivity $interactivity_name {
+   comment "$comment"
+   plugin "$pluginname"
+   property "$PROPERTY_NAME" "$PROPERTY_VALUE"
+   ...
+}
+</programlisting>
+and then referenced in the global section as
+<programlisting>
+  interactivity "$interactivity_name"
+</programlisting></para>
+
+<para>Interactivity properties, like Amanda configuration parameters, are
+insensitive to case, and <literal>-</literal> (dash) and
+<literal>_</literal> (underscore) may be used interchangeably.</para>
+
+<para>See the individual plugin sections, below for properties applicable to
+each plugin.</para>
+
+</refsect1>
+
+<refsect1><title>INTERACTIVITY MODULES</title>
+
+<para>Amanda provides three interactivity modules, <emphasis>tty</emphasis>,
+<emphasis>email</emphasis> and <emphasis>tty_email</emphasis>.</para>
+
+<refsect2><title>TTY</title>
+
+<para>The <emphasis>tty</emphasis> interactivity module uses the tty to
+communicate with the user, it works only if a terminal is available, which is
+the case if amanda is executed from a command line.</para>
+
+<para>When promted for a volume, the user must put the requested volume
+in the changer and type &lt;enter&gt;. User can type the name of another
+changer if the volume is available in that changer. Typing 'abort' will
+abort the operation.</para>
+
+</refsect2>
+
+<refsect2><title>EMAIL</title>
+
+<para>The <emphasis>email</emphasis> interactivity module uses email to send requests to the user, and reads replies from the filesystem.</para>
+
+<para>The <emphasis>email</emphasis> module has many properties:</para>
+
+<variablelist>
+ <!-- ==== -->
+ <varlistentry><term>check-file</term><listitem>
+If set, amanda will check this file for user input.  The user can touch the
+file to tell amanda that the requested volume was inserted in the changer.  If the user
+writes the name of a changer into the file, Amanda will use that changer.  If the user
+writes the word 'abort' into the file, the scan will be aborted.
+</listitem></varlistentry>
+ <!-- ==== -->
+ <varlistentry><term>check-file-delay</term><listitem>
+Default: 10. This integer property indicates the time in seconds between each check of the check-file.
+</listitem></varlistentry>
+ <!-- ==== -->
+ <varlistentry><term>mailto</term><listitem>
+Default: global value of <amkeyword>mailto</amkeyword>.  The email addresses to which
+the email should be sent.  If multiple addresses are given, they should be
+separated by spaces. 
+</listitem></varlistentry>
+ <!-- ==== -->
+ <varlistentry><term>resend-delay</term><listitem>
+Default 0. The time in seconds between emails.  Amanda will resend the same
+email at this frequency, which can be useful if <amkeyword>mailto</amkeyword>
+is a pager or phone.  If set to 0, only one email is sent.
+</listitem></varlistentry>
+</variablelist>
+
+</refsect2>
+
+<refsect2><title>TTY_EMAIL</title>
+
+<para>The <emphasis>tty_email</emphasis> interactivity module uses the
+<emphasis>tty</emphasis> module if a terminal is available and uses the
+<emphasis>email</emphasis> module otherwise.  Its properties are a
+combination of properties from each module.</para>
+
+</refsect2>
+</refsect1>
+
+<refsect1><title>EXAMPLE</title>
+
+<para><programlisting>
+  define interactivity "by-tty-or-email" {
+    comment "Send email on runs from cron; use terminal on command line"
+    plugin "tty_email"
+    property "mailto" "admin1" "admin2" "me@home"
+    property "resend-delay" "1800"               #every 30 minutes
+    property "check-file" "/tmp/email_input"
+    property "check-file-delay" "10"             #every 10 seconds
+  }
+</programlisting></para>
+
+</refsect1>
+
+<seealso>
+<manref name="amanda.conf" vol="5"/>,
+</seealso>
+
+</refentry>
index 07dbbc1f7baddc70eb822e6f04d23dfe1a88ba27..0ad2378bc6a7092c8dd145e1e483d201d2d276ff 100644 (file)
@@ -56,6 +56,15 @@ insensitive to case, and <literal>-</literal> (dash) and
 
 </refsect1>
 
+<refsect1><title>SCRIPTS OUTPUT PROPERTY</title>
+
+<para>A pre-dle-amcheck, pre-dle-estimate or pre-dle-backup executed on the
+client can output property on stdout that are sent to the application.
+If the output line matches "PROPERTY str1 str2", Amanda sets a property called
+"str1" by the value of "str2", that property is sent to the application.</para>
+
+</refsect1>
+
 <seealso>
 <manref name="amanda.conf" vol="5"/>
 </seealso>
index 6e206971d7897f026f754bab8143671b42d7aead..6c53d4eafa18fd4a6bb61f5f1d90debbd012fe0c 100644 (file)
@@ -43,9 +43,35 @@ remap='B'>taperscan</emphasis> parameter, which has a default value of
 
 </refsect1>
 
+<refsect1><title>DEFINING A TAPERSCAN</title>
+
+<para>An taperscan is defined in &amconf; as follows:
+
+<programlisting>
+define taperscan $taperscan_name {
+   comment "$comment"
+   plugin "$pluginname"
+   property "$PROPERTY_NAME" "$PROPERTY_VALUE"
+   ...
+}
+</programlisting>
+and then referenced in the global section as
+<programlisting>
+  taperscan "$taperscan_name"
+</programlisting></para>
+
+<para>Taperscan properties, like Amanda configuration parameters, are
+insensitive to case, and <literal>-</literal> (dash) and
+<literal>_</literal> (underscore) may be used interchangeably.</para>
+
+<para>See the individual plugin documentation below for properties applicable to each
+plugin.</para>
+
+</refsect1>
+
 <refsect1><title>TAPERSCAN ALGORITHMS</title>
 
-<para>In general, these volumes will only select reusable volumes.  These are
+<para>In general, these algorithms will only select reusable volumes.  These are
 volumes which are listed in the &tapelist; with the <emphasis>reuse</emphasis>
 flag, and which are not among the <emphasis>tapecycle-1</emphasis> most recent
 volumes in the list.  Put another way, reusable volumes do not contain data
@@ -93,12 +119,49 @@ algorithms.</note>
 
 </refsect2>
 
+<refsect2><title>oldest</title>
+
+<para>This algorithm works with the Changer API (see <manref
+name="amanda-changers" vol="7" />), using the inventory returned by the
+changer to locate the oldest acceptable volume available. Note that this
+will not work with changers that do not support inventory (old
+changers).  The algorithms scans
+unknown slots only if no known usable volume is found in the inventory.</para>
+
+<para>An acceptable volume is a reusable volume, a new labeled volume or an
+unlabeled volume that can be labeled according to <amkeyword>autolabel</amkeyword>.
+Note that changers do not always know the contents of every slot - for
+example, a tape with an unknown barcode will not be considered usable.</para>
+
+<para>Use <command>amtape CONF inventory</command> to see the changer's inventory, and use
+<command>amtape CONF update</command> to update it.</para>
+
+</refsect2>
+
+<refsect2><title>lexical</title>
+
+<para>This algorithm also works with the Changer API, using the inventory to
+determine the acceptable volumes; it then uses the volume which follows the
+last-used volume in lexical order.  For volume labels containing leading
+zeros, e.g., <filename>CORP-010</filename>, this algorithm will run through
+the volumes in the natural order.</para>
+
+<para>It scans unknown slots only if no usable volume
+is found in the inventory.</para>
+
+<para>See <amkeyword>oldest</amkeyword>, above, for a definition of acceptable
+volumes.</para>
+
+>>>>>>> 6a40a39... manpage edits
+</refsect2>
+
 </refsect1>
 
 <seealso>
 <manref name="amanda.conf" vol="5"/>,
 <manref name="tapelist" vol="5"/>,
 <manref name="amanda-changers" vol="7"/>,
+<manref name="amanda-interactivity" vol="7"/>,
 </seealso>
 
 </refentry>
index 7162c175c1f38bc9a7df8235a772421e87e9695b..1ab71bf72196bc8febf3c883baa6361afa9f0f68 100644 (file)
@@ -205,6 +205,9 @@ configuration files for quick reference.</para>
 <manref name="amanda-devices" vol="7"/>,
 </listitem>
 <listitem>
+<manref name="amanda-interactivity" vol="7"/>,
+</listitem>
+<listitem>
 <manref name="amanda-match" vol="7"/>,
 </listitem>
 <listitem>
index 6964303686c760ddcf3e7d3d3bb331d6f7440eea..7c63bcc7ec267685dafbb6819286753cb2c8b037 100644 (file)
@@ -460,11 +460,22 @@ tape label to most volume she encounters. This option is DANGEROUS
 because when set, Amanda may erase near-failing tapes or tapes accidentally
 loaded in the wrong slot.</para>
 <para>When using this directive, specify the template for new tape
-labels. The template should contain some number of contiguous '%'
+labels. The template can contains many variables that are substituted by their
+values:
+<programlisting>
+    $c : config name
+    $o : org configuration
+    $b : barcode of the volume
+    $m : meta label
+</programlisting></para>
+<para>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:
-<markup>autolabel &quot;DailySet1-%%%&quot; empty</markup>
+<markup>&quot;DailySet1-%%%&quot;</markup>,
+<markup>&quot;$c-%%%&quot;</markup>,
+<markup>&quot;$m-%%%&quot;</markup>,
+<markup>&quot;$m-$b&quot;</markup>
 </para>
 <para>Note that many devices cannot distinguish an empty tape from an error
 condition, so it may is often necessary to include
@@ -504,6 +515,31 @@ Danger: this may erase arbitrary volumes due to transient errors.
 </listitem>
 </varlistentry>
 
+  <varlistentry>
+  <term><amkeyword>meta-autolabel</amkeyword>
+        <amtype>string</amtype></term>
+  <listitem>
+<para>Default: not set. When set and if the changer support meta-label, this directive will cause Amanda to automatically add a meta-label to a meta-volume.</para>
+<para>A meta-volume is a containers that contains many volumes, eg. a removable
+hard-disk for use with chg-disk, each hard disk have many slots (volume).
+The meta-label is the label to put on the meta-volume.</para>
+<para>When using this directive, specify the template for new meta
+labels. The template can contains many variables that are substituted by their
+values:
+<programlisting>
+    $c : config name
+    $o : org configuration
+</programlisting></para>
+<para>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 meta labels.
+Example:
+<markup>&quot;DailySet1-%%%&quot;</markup>,
+<markup>&quot;$o-%%%&quot;</markup>,
+</para>
+  </listitem>
+  </varlistentry>
+
   <varlistentry>
   <term><amkeyword>dumpuser</amkeyword> <amtype>string</amtype></term>
   <listitem>
@@ -580,6 +616,24 @@ configuring changers.</para>
   </listitem>
   </varlistentry>
 
+  <varlistentry>
+  <term><amkeyword>interactivity</amkeyword> <amtype>string</amtype></term>
+  <listitem>
+<para>Default: not set.  The interactivity module Amanda should use to interact with
+the user.  See <manref name="amanda-interactivity" vol="7" /> for a list of
+modules.</para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><amkeyword>taperscan</amkeyword> <amtype>string</amtype></term>
+  <listitem>
+<para>Default: traditional.  The taperscan module amanda should use to find a tape
+to write to. See <manref name="amanda-taperscan" vol="7" /> for a list of
+modules.</para>
+  </listitem>
+  </varlistentry>
+
   <varlistentry>
   <term><amkeyword>changerdev</amkeyword> <amtype>string</amtype></term>
   <listitem>
@@ -1040,11 +1094,13 @@ the amount of holding disk space reserved for incrementals should be lowered.</p
   </listitem>
   </varlistentry>
   <varlistentry>
-  <term><amkeyword>autoflush</amkeyword> <amtype>bool</amtype></term>
+  <term><amkeyword>autoflush</amkeyword> <amkeyword>no</amkeyword>|<amkeyword>yes</amkeyword>|<amkeyword>all</amkeyword></term>
   <listitem>
 <para>Default:
-<amkeyword>off</amkeyword>.
-Whether an amdump run will flush the dumps from holding disk to tape.</para>
+<amkeyword>no</amkeyword>.
+Whether an amdump run will flush the dumps from holding disk to tape.
+With <amkeyword>yes</amkeyword>, only dump matching the command line argument are flushed.
+With <amkeyword>all</amkeyword>, all dump are flushed.</para>
   </listitem>
   </varlistentry>
   <varlistentry>
@@ -1349,16 +1405,20 @@ Range is inclusive.</para>
   </varlistentry>
 
   <varlistentry>
-  <term><amkeyword>recovery-limit</amkeyword> [ <amtype>string</amtype> | <amkeyword>same-host</amkeyword> ]</term>
+  <term><amkeyword>recovery-limit</amkeyword> [ <amtype>string</amtype> | <amkeyword>same-host</amkeyword> | <amkeyword>server</amkeyword>]</term>
   <listitem>
 <para>Default: none (no limitations).  This parameter limits the hosts
-    that may do remote recoveries.  Hosts are identified by their authenticated
+    that may do recoveries.  Hosts are identified by their authenticated
     peer name, as described in <manref name="amanda-auth" vol="7"/>; if this is
     not available and the recovery-limit parameter is present, recovery will be
     denied.  The arguments to the parameter are strings giving host match
     expressions (see <manref name="amanda-match" vol="7"/>) or the special
-    keyword same-host, which requires an exact match to the hostname of the
-    DLE being recovered.  Specifying no arguments at all will disable all
+    keywords <amkeyword>same-host</amkeyword> or <amkeyword>server</amkeyword>.
+    The <amkeyword>same-host</amkeyword> keyword requires an exact
+    match to the hostname of the DLE being recovered.
+    The <amkeyword>server</amkeyword> keyword require the connection come from
+    the fqdn of the server.
+    Specifying no arguments at all will disable all
     recoveries from any host.</para>
 
 <para>Note that match expressions can be constructed to be
@@ -1505,7 +1565,7 @@ are defined.</para>
   <term><amkeyword>auth</amkeyword> <amtype>string</amtype></term>
   <listitem>
 <para>Default:
-<amdefault>&quot;bsd&quot;</amdefault>.
+<amdefault>&quot;bsdtcp&quot;</amdefault>.
 Type of authorization to perform between tape server and backup client hosts.  See <manref name="amanda-auth" vol="7"/> for more detail.</para>
   </listitem>
   </varlistentry>
@@ -1540,6 +1600,7 @@ Specifies the port to connect to on the client.  It can be a service name or a n
   </listitem>
   </varlistentry>
 
+
 <!-- bumping parameters yanked from the global section above -->
 
   <varlistentry>
@@ -2223,7 +2284,7 @@ The default unit is Kbytes if it is not specified.</para>
 
   <varlistentry>
       <term><amkeyword>recovery-limit</amkeyword>
-           [ <amkeyword>same-host</amkeyword> | <amtype>string</amtype> ]*</term>
+           [ <amkeyword>server</amkeyword> | <amkeyword>same-host</amkeyword> | <amtype>string</amtype> ]*</term>
   <listitem>
 
 <para>Default: global value.  This parameter overrides the global
@@ -2232,6 +2293,20 @@ The default unit is Kbytes if it is not specified.</para>
 
   </listitem>
   </varlistentry>
+
+  <varlistentry>
+      <term><amkeyword>dump-limit</amkeyword>
+           [ <amkeyword>server</amkeyword> | <amkeyword>same-host</amkeyword> ]*</term>
+  <listitem>
+
+<para>Default: <amkeyword>server</amkeyword>. Specify which host can initiate
+ a backup of the dle.  With <amkeyword>server</amkeyword>, the server
+ can initiate a backup with the <command>amdump</command> command.
+ With <amkeyword>same-host</amkeyword>, the client can initiate a backup with
+ the <command>amdump_client</command> command.</para>
+
+  </listitem>
+  </varlistentry>
 </variablelist>
 
 <para>The following <amkeyword>dumptype</amkeyword> entries are predefined by Amanda:</para>
@@ -2250,7 +2325,10 @@ define dumptype "srvcompress" {
     compress server fast
 }
 define dumptype "bsd-auth" {
-    auth bsd
+    auth "bsd"
+}
+define dumptype "bsdtcp-auth" {
+    auth "bsdtcp"
 }
 define dumptype "no-record" {
     record no
@@ -2558,6 +2636,21 @@ is the name of this type of application. It is referenced from the
 
 <para>The application options and values are:</para>
 <variablelist remap='TP'>
+  <varlistentry>
+  <term><amkeyword>client-name</amkeyword> <amtype>string</amtype></term>
+  <listitem>
+<para>No default,
+specifies an application name that is in the amanda-client.conf on the client.
+The setting from that application will be merged with the current application.
+If <amkeyword>client-name</amkeyword> is set then it is an error
+if that application is not defined on the client.</para>
+<para>If <amkeyword>client-name</amkeyword> is not set then the
+merge is done with the application that have the name equal to the plugin.
+eg. if the plugin is 'amgtar', then the setting from the application 'amgtar'
+is used if it is defined.
+</para>
+  </listitem>
+  </varlistentry>
   <varlistentry>
   <term><amkeyword>comment</amkeyword> <amtype>string</amtype></term>
   <listitem>
@@ -2605,6 +2698,20 @@ is the name of this type of script. It is referenced from the
 
 <para>The script options and values are:</para>
 <variablelist remap='TP'>
+  <varlistentry>
+  <term><amkeyword>client-name</amkeyword> <amtype>string</amtype></term>
+  <listitem>
+<para>No default,
+specifies a script name that is in the amanda-client.conf on the client.
+The setting from that script will be merged with the currect script.
+If <amkeyword>client-name</amkeyword> is set then it is an error if that script is not defined on the client.</para>
+<para>If <amkeyword>client-name</amkeyword> is not set then the
+merge is done with the script that have the name equal to the plugin.
+eg. if the plugin is 'amlog-script', then the setting from the script
+'amlog-script' is used.
+</para>
+  </listitem>
+  </varlistentry>
   <varlistentry>
   <term><amkeyword>comment</amkeyword> <amtype>string</amtype></term>
   <listitem>
@@ -2622,6 +2729,12 @@ A comment string describing this script.</para>
   <term><amkeyword>order</amkeyword> <amtype>int</amtype></term>
   <listitem>
 <para>Default: <amdefault>5000</amdefault>. Scripts are executed in that order, it is useful if you have many scripts and they must be executed in a spefific order.</para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><amkeyword>single-execution</amkeyword> <amtype>boolean</amtype></term>
+  <listitem>
+<para>Default: <amdefault>no</amdefault>. The script is executed for each dle. If <amdefault>yes</amdefault>, the script is executed one time only.</para>
   </listitem>
   </varlistentry>
   <varlistentry>
@@ -2636,6 +2749,12 @@ A comment string describing this script.</para>
 <para>No default. When the script must be executed, you can specify many of them:</para>
     <!-- .RS -->
     <variablelist remap='TP'>
+      <varlistentry>
+      <term><amkeyword>pre-amcheck</amkeyword></term>
+      <listitem>
+<para>Execute before the amcheck command for all dle. Can only be run on server.</para>
+      </listitem>
+      </varlistentry>
       <varlistentry>
       <term><amkeyword>pre-dle-amcheck</amkeyword></term>
       <listitem>
@@ -2646,6 +2765,12 @@ A comment string describing this script.</para>
       <term><amkeyword>pre-host-amcheck</amkeyword></term>
       <listitem>
 <para>Execute before the amcheck command for all dle for the client.</para>
+      </listitem>
+      </varlistentry>
+      <varlistentry>
+      <term><amkeyword>post-amcheck</amkeyword></term>
+      <listitem>
+<para>Execute after the amcheck command for all dle. Can only be run on server.</para>
       </listitem>
       </varlistentry>
       <varlistentry>
@@ -2658,6 +2783,12 @@ A comment string describing this script.</para>
       <term><amkeyword>post-host-amcheck</amkeyword></term>
       <listitem>
 <para>Execute after the amcheck command for all dle for the client.</para>
+      </listitem>
+      </varlistentry>
+      <varlistentry>
+      <term><amkeyword>pre-estimate</amkeyword></term>
+      <listitem>
+<para>Execute before the estimate command for all dle. Can only be run on server.</para>
       </listitem>
       </varlistentry>
       <varlistentry>
@@ -2670,6 +2801,12 @@ A comment string describing this script.</para>
       <term><amkeyword>pre-host-estimate</amkeyword></term>
       <listitem>
 <para>Execute before the estimate command for all dle for the client.</para>
+      </listitem>
+      </varlistentry>
+      <varlistentry>
+      <term><amkeyword>post-estimate</amkeyword></term>
+      <listitem>
+<para>Execute after the estimate command for all dle. Can only be run on server.</para>
       </listitem>
       </varlistentry>
       <varlistentry>
@@ -2682,6 +2819,12 @@ A comment string describing this script.</para>
       <term><amkeyword>post-host-estimate</amkeyword></term>
       <listitem>
 <para>Execute after the estimate command for all dle for the client.</para>
+      </listitem>
+      </varlistentry>
+      <varlistentry>
+      <term><amkeyword>pre-backup</amkeyword></term>
+      <listitem>
+<para>Execute before the backup command for all dle. Can only be run on server.</para>
       </listitem>
       </varlistentry>
       <varlistentry>
@@ -2694,6 +2837,12 @@ A comment string describing this script.</para>
       <term><amkeyword>pre-host-backup</amkeyword></term>
       <listitem>
 <para>Execute before the backup command for all dle for the client. It can't be run on client, it must be run on server</para>
+      </listitem>
+      </varlistentry>
+      <varlistentry>
+      <term><amkeyword>post-backup</amkeyword></term>
+      <listitem>
+<para>Execute after the backup command for all dle. Can only be run on server.</para>
       </listitem>
       </varlistentry>
       <varlistentry>
@@ -2821,6 +2970,105 @@ device. The remaining parameters are specific to the changer type selected.
 
 </refsect1>
 
+<refsect1><title>INTERACTIVITY SECTION</title>
+<para>The
+<emphasis remap='B'>amanda.conf</emphasis>
+file may define multiple interactivyt methods, although only one will be used - that specified
+by the <amkeyword>interactivity</amkeyword> parameter.
+The information is entered in a <amkeyword>interactivity</amkeyword>
+section, which looks like this:</para>
+
+<programlisting>
+define interactivity <emphasis remap='I'>name</emphasis> {
+    <emphasis remap='I'>interactivity-option</emphasis> <emphasis remap='I'>interactivity-value</emphasis>
+    <literal>...</literal>
+}
+</programlisting>
+
+<para>The { must appear at the end of a line, and the } on its own line.</para>
+<para><emphasis remap='I'>name</emphasis> is the user-specified name of this
+interactivity. The remaining parameters are specific to the interactivity type
+selected.
+</para>
+
+<para>The interactivity options and values are:</para>
+<variablelist remap='TP'>
+  <varlistentry>
+  <term><amkeyword>comment</amkeyword> <amtype>string</amtype></term>
+  <listitem>
+<para>Default: not set.
+A comment string describing this interactivity.</para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><amkeyword>plugin</amkeyword> <amtype>string</amtype></term>
+  <listitem>
+<para>No default. Must be set to the name of the interactivity module, as described in <manref name="amanda-interactivity" vol="7" />.</para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><amkeyword>property</amkeyword> [<amkeyword>append</amkeyword>] <amtype>string</amtype> <amtype>string</amtype>+</term>
+  <listitem>
+<para>No default. You can set arbitrary properties for the interactivity.  Each interactivity module has a different set of properties. The first string contains the name of
+the property to set, and the others contains its values.  All strings should be quoted.
+The <amkeyword>append</amkeyword> keyword appends the given values to an existing list of values for that property.
+</para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>See <manref name="amanda-interactivity" vol="7" /> for more information on configuring interactivity methods.</para>
+
+</refsect1>
+
+<refsect1><title>TAPERSCAN SECTION</title>
+<para>The
+<emphasis remap='B'>amanda.conf</emphasis>
+file may define multiple taperscan methods, although only one will be used - that specified
+by the <amkeyword>taperscan</amkeyword> parameter.
+The information is entered in a <amkeyword>taperscan</amkeyword>
+section, which looks like this:</para>
+
+<programlisting>
+define taperscan <emphasis remap='I'>name</emphasis> {
+    <emphasis remap='I'>taperscan-option</emphasis> <emphasis remap='I'>taperscan-value</emphasis>
+    <literal>...</literal>
+}
+</programlisting>
+
+<para>The { must appear at the end of a line, and the } on its own line.</para>
+<para><emphasis remap='I'>name</emphasis> is the user-specified name of this
+taperscan. The remaining parameters are specific to the taperscan type
+selected.
+</para>
+
+<para>The taperscan options and values are:</para>
+<variablelist remap='TP'>
+  <varlistentry>
+  <term><amkeyword>comment</amkeyword> <amtype>string</amtype></term>
+  <listitem>
+<para>Default: not set.
+A comment string describing this taperscan.</para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><amkeyword>plugin</amkeyword> <amtype>string</amtype></term>
+  <listitem>
+<para>No default. Must be set to the name of the taperscan module.  See <man name="amanda-taperscan" vol="7" /> for a list of defined taperscan modules.</para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><amkeyword>property</amkeyword> [<amkeyword>append</amkeyword>] <amtype>string</amtype> <amtype>string</amtype>+</term>
+  <listitem>
+<para>No default.  Operates just like properties for interactivity methods, above.</para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+
+<para>See <manref name="amanda-taperscan" vol="7" /> for more information on configuring taperscan.</para>
+
+</refsect1>
+
 <refsect1><title>Dump Splitting Configuration</title>
 
     <para>Amanda can "split" dumps into parts while writing them to storage
@@ -2881,7 +3129,9 @@ device. The remaining parameters are specific to the changer type selected.
 <manref name="amanda-auth" vol="7"/>,
 <manref name="amanda-changers" vol="7"/>,
 <manref name="amanda-devices" vol="7"/>,
+<manref name="amanda-interactivity" vol="7"/>,
 <manref name="amanda-scripts" vol="7"/>
+<manref name="amanda-taperscan" vol="7"/>
 </seealso>
 
 
diff --git a/man/xml-source/amdump_client.8.xml b/man/xml-source/amdump_client.8.xml
new file mode 100644 (file)
index 0000000..6827b5b
--- /dev/null
@@ -0,0 +1,67 @@
+<?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 'global.entities'>
+  %global_entities;
+]>
+
+<!-- lifted from troff+man by doclifter -->
+<refentry id='amdump_client.8'>
+
+<refmeta>
+<refentrytitle>amdump_client</refentrytitle>
+<manvolnum>8</manvolnum>
+&rmi.source;
+&rmi.version;
+&rmi.manual.8;
+</refmeta>
+<refnamediv>
+<refname>amdump_client</refname>
+<refpurpose>back up all disks in an Amanda configuration</refpurpose>
+</refnamediv>
+<refentryinfo>
+&author.jlm;
+</refentryinfo>
+<!-- body begins here -->
+<refsynopsisdiv>
+<cmdsynopsis>
+  <command>amdump_client</command>
+    &configoverride.synopsis;
+    <arg choice='opt'><option>--config</option> <replaceable>config</replaceable></arg>
+    <arg choice='plain'><replaceable>CMD</replaceable></arg>
+    <arg choice='opt' rep='repeat'><replaceable>diskname</replaceable></arg>
+</cmdsynopsis>
+</refsynopsisdiv>
+
+
+<refsect1><title>DESCRIPTION</title>
+<para><emphasis remap='B'>Amdump_client</emphasis> initiate backup on the client. There are two commands (CMD):</para>
+<variablelist remap='TP'>
+
+  <varlistentry><term><amkeyword>list</amkeyword></term>
+  <listitem><para>list all diskname that can be dumped.</para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry><term><amkeyword>check</amkeyword></term>
+  <listitem><para>Check the configuration of the client and disk.</para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry><term><amkeyword>dump</amkeyword></term>
+  <listitem><para>Start a backup of the specified diskname, or all diskname if none are specified.</para>
+  </listitem>
+  </varlistentry>
+
+</variablelist>
+</refsect1>
+
+<seealso>
+<manref name="amdump" vol="8"/>,
+<manref name="amanda-match" vol="7"/>
+</seealso>
+
+</refentry>
+
index 66046ac4fc259872538636fb22e4cb3bcb661292..62b677369bbd20b3643bd125a4541442b3314729 100644 (file)
 <refsynopsisdiv>
 <cmdsynopsis>
   <command>amlabel</command>    
+    <arg choice='opt'><option>--barcode <replaceable>barcode</replaceable></option></arg>
+    <arg choice='opt'><option>--meta <replaceable>meta-label</replaceable></option></arg>
+    <arg><option>--assign</option></arg>
     <arg><option>-f</option></arg>
     &version.synopsis;
     &configoverride.synopsis;
     <arg choice='plain'><replaceable>config</replaceable></arg>
-    <arg choice='plain'><replaceable>label</replaceable></arg>
+    <arg choice='opt'><replaceable>label</replaceable></arg>
     <arg choice='opt'>slot <replaceable>slot</replaceable></arg>
 </cmdsynopsis>
 </refsynopsisdiv>
@@ -49,13 +52,17 @@ and <manref name="amflush" vol="8" /> verify the label before writing to make
 sure the proper volume is loaded, and the recovery programs use the label to
 ensure they are reading the data they expect.</para>
 
-<para>If no <arg choice="opt"><replaceable>slot</replaceable></arg> is given,
+<para>If no <arg choice="opt"><replaceable>slot</replaceable></arg> and no <arg choice="opt"><replaceable>barcode</replaceable></arg> is given,
 then <command>amlabel</command> labels the tape in the current slot of the
-default changer.  If a slot is given, it labels the volume in that slot.
+default changer.  If a slot is given, it labels the volume in that slot. If a barcode is given, it labels the volume with that barcode.
 <emphasis remap='I'>Label</emphasis> may be any string that does not contain
 whitespace and that matches the <emphasis remap='B'>labelstr</emphasis> (see
 <manref name="amanda.conf" vol="5" />).</para>
 
+<para>If <arg choice="opt"><replaceable>label</replaceable></arg> is not given, an autolabel is
+generated, see <emphasis remap='B'>autolabel</emphasis> in <manref name="amanda.conf" vol="5"/>.</para>
+
+<para>If <arg><option>--assign</option></arg> is given, the barcode and meta-label are assigned to the label without labeling the volume. The label must already be in the tapelist file.</para>
 <para>This command also appends the new volume to the &tapelist; file, so that
 they will be used in the order they are labeled (depending on the taperscan in
 use &mdash; see <manref name="amanda-taperscan" vol="7" />).</para>
@@ -69,6 +76,28 @@ verifications.</para>
 <refsect1><title>OPTIONS</title>
 <variablelist remap='TP'>
 
+  <varlistentry>
+  <term><option>--barcode <replaceable>barcode</replaceable></option></term>
+  <listitem>
+  <para>With <arg choice="opt">--assign</arg>, assign the barcode to the label.
+Without <arg choice="opt">--assign</arg>, label the volume with that barcode.</para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><option>--meta <replaceable>meta-label</replaceable></option></term>
+  <listitem>
+  <para>Assign the meta label to the label after labeling the volume.</para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><option>--assign</option></term>
+  <listitem>
+  <para>Assign the barcode or meta-label to the label without labeling the volume. The label must already be in the tapelist file.</para>
+  </listitem>
+  </varlistentry>
+
   <varlistentry>
   <term><option>-f</option></term>
   <listitem>
index 8d913fd82ba3b8583d2aa1aa1a7226be82b5f348..b81f7669e6ed8673d8a76d8a57c69040c1b949a9 100644 (file)
@@ -56,8 +56,7 @@ man page for more details about Amanda.</para>
   <term><option>--config</option> <replaceable>config</replaceable></term>
   <listitem>
 <para>Use configuration
-<emphasis remap='I'>config</emphasis>
-instead of configuration daily.</para>
+<emphasis remap='I'>config</emphasis>.</para>
   </listitem>
   </varlistentry>
   <varlistentry>
index 5e8b1bc475e6f7dee05ecb4f044dbc8e46a6fb2e..bc760e0518c86b65c595ba7a559c5ab8ce9f14c1 100644 (file)
@@ -108,6 +108,12 @@ client-custom-compressed tapes.</para>
 </variablelist>
 </refsect1>
 
+<refsect1><title>AUTH</title>
+<para>The default <emphasis remap='B'>auth</emphasis> is 'BSDTCP', you can set
+a different auth in the <emphasis remap='B'>amanda-client.conf</emphasis> file
+or by specifying the '-oauth=bsd' command line argument.</para>
+</refsect1>
+
 <refsect1><title>COMMANDS</title>
 <para><emphasis remap='B'>Amrecover</emphasis>
 connects to the index server and then presents a command line prompt.
index 4bd3cd8813da8bab4c518025f9b6a745440f8d3e..d0817572939539e9b0f3ff7b341e32765b653202 100644 (file)
@@ -29,7 +29,7 @@
 <refsynopsisdiv>
 <cmdsynopsis>
   <command>amservice</command>    
-    <arg choice='opt'><arg choice='plain'>-f</arg><arg choice='plain'><replaceable>input_file</replaceable></arg></arg>
+    <arg choice='opt'><arg choice='plain'>-f</arg><arg choice='plain'><replaceable>input_file</replaceable></arg><arg choice='opt'>-s</arg></arg>
     &configoverride.synopsis;
     <arg choice='plain'><replaceable>hostname</replaceable></arg>
     <arg choice='plain'><replaceable>auth</replaceable></arg>
@@ -77,6 +77,13 @@ The client must be configured with this auth.</para>
   </listitem>
   </varlistentry>
 
+  <varlistentry>
+  <term><option>-s</option></term>
+  <listitem>
+<para>Redirect the first connected stream to stdin/stdout. The -f argument is required for the REQ packet, the REP packet is not printed on stdout.</para>
+  </listitem>
+  </varlistentry>
+
   &configoverride.varlistentry;
 
 </variablelist>
@@ -85,7 +92,8 @@ The client must be configured with this auth.</para>
 <refsect1><title>EXAMPLE</title>
 
 <para>The noop service is easy to execute because it does not require a REQ packet:</para>
-<programlisting>amservice hostname bsdtcp noop &lt; /dev/null</programlisting>
+<programlisting>amservice hostname bsdtcp noop &lt; /dev/null
+</programlisting>
 <para>The example executes the noop service on the client using bsdtcp auth.
 This is useful for debugging connection problems.
 It print an OPTIONS line upon success.</para>
index ca4c52d72f2f4d88378a551580fcb4d4c6956eab..4e5d44e7951652028b75c9a55c1fb694d8df2e9b 100644 (file)
@@ -33,6 +33,14 @@ by users directly.  It uses star to backup and restore data.</para>
 
 </refsect1>
 
+<refsect1><title>INCLUDE - EXCLUDE</title>
+
+<para>amstar doesn't support include. Both 'exclude list' and 'exclude file' are supported. There is a maximum of 100 patterns (limit of star).</para>
+
+<para>Moving directories into and out of directories on the exclude list
+causes incremental backups to not contain the files in the moved directories until the next full backup unless the moved files are modified after the move.</para>
+</refsect1>
+
 <refsect1><title>PROPERTIES</title>
 
 <para>This section lists the properties that control amstar's functionality.
@@ -41,6 +49,10 @@ for information on application properties and how they are configured.</para>
 
 <!-- PLEASE KEEP THIS LIST IN ALPHABETICAL ORDER -->
 <variablelist>
+ <!-- ==== -->
+ <varlistentry><term>ACL</term><listitem>
+If "YES" (the default), amstar will store files acl by passing the <emphasis>-acl</emphasis> argument to star. If "NO", then the <emphasis>-acl</emphasis> option is not given to star, and it will not try to backup the acl.
+</listitem></varlistentry>
  <!-- ==== -->
  <varlistentry><term>COMMAND-OPTIONS</term><listitem>
 <para>If set, theses options are passed asis to star. Each option must be a different value of the property. Some option can break how amanda do backup, use it with care.</para>
index f29a93103ec55bb8c82353f4c3454792c5b62cb0..cff7b3d85044aefd0110355392d55989289b5a29 100644 (file)
@@ -71,6 +71,11 @@ Include extended attributes in archive.  The default is YES.
 Write tar file with extended headers. With this optiion the modification time
 is maintained with a  granularity of microseconds,Long file names and file 
 sizes greater than 8GB can be archived. The default is YES.
+</listitem></varlistentry>
+
+ <!-- ==== -->
+ <varlistentry><term>SUNTAR-PATH</term><listitem>
+The path to the suntar binary. The default is set when Amanda is built.
 </listitem></varlistentry>
 
  <!-- ==== -->
index 56683c62a19dbedfdb2059092bfaf0b5df440fe9..d7b5617bd8fb1eda805d966ec70e4171221b533f 100644 (file)
@@ -34,7 +34,8 @@ tapes in active use.  This file is not ordinarily ordinarily edited or examined
 manually.  Its format may change, or it may be removed altogether, in future
 versions of Amanda.  It contains lines of the form:</para>
 
-<para><programlisting>YYYYMMDD label flags [BARCODE:barcode] [#comment]
+<para><programlisting>
+YYYYMMDD label flags [BARCODE:barcode] [META:meta] [#comment]
 </programlisting></para>
 
 <para>Where
@@ -52,6 +53,7 @@ remap='B'>dumpcycle</emphasis> dumps.  See the
 options of
 <manref name="amadmin" vol="8"/>.
 The optional barcode is prefixed with 'BARCODE' if the volume have a barcode.
+The optional meta label is prefixed with 'META' if the volume is on a meta volume.
 The optional comment is prefixed with a '#' and continues to the end of the line.  Amanda
 will maintain this comment until the tape is overwritten.  Note that comments are not
 allowed on blank lines.</para>
index 343e7d3f57d01432fc7a7686ed068c2c853e60cb..a5b1b00ce84927ae4f1b39984e78300d49fb637b 100644 (file)
@@ -166,7 +166,7 @@ libndmjlo = \
        ndmos.c \
        ndmos_common.c
 
-libndmlib_la_LDFLAGS = -release $(VERSION)
+libndmlib_la_LDFLAGS = -release $(VERSION) $(AS_NEEDED_FLAGS)
 libndmlib_la_SOURCES = \
        $(libndmjll) \
        $(libndmjlp) \
@@ -179,7 +179,7 @@ libndmjob_la_SOURCES = \
        $(libndmjla) \
        $(libndmjlr)
 
-libndmjob_la_LDFLAGS = -release $(VERSION)
+libndmjob_la_LDFLAGS = -release $(VERSION) $(AS_NEEDED_FLAGS)
 libndmjob_la_LIBADD = libndmlib.la
 
 ##
index b024d9cc8084e410d258aeadff0d53a2083afe21..dccd1f10393fe2032979369903006debe4acb632 100644 (file)
@@ -195,6 +195,7 @@ am__aclocal_m4_deps =  \
        $(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/as_needed.m4 \
        $(top_srcdir)/config/amanda/bsd-security.m4 \
        $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
        $(top_srcdir)/config/amanda/bsdudp-security.m4 \
@@ -454,6 +455,7 @@ APPLICATION_DIR = @APPLICATION_DIR@
 AR = @AR@
 ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
 ASSERTIONS = @ASSERTIONS@
+AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -927,6 +929,7 @@ LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
 MKDIR_P = @MKDIR_P@
+MOUNT = @MOUNT@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
@@ -1124,6 +1127,7 @@ STDBOOL_H = @STDBOOL_H@
 STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
+SUNTAR = @SUNTAR@
 SVN = @SVN@
 SWIG = @SWIG@
 SWIG_LIB = @SWIG_LIB@
@@ -1131,6 +1135,7 @@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TCPPORTRANGE = @TCPPORTRANGE@
 TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
 UDPPORTRANGE = @UDPPORTRANGE@
+UMOUNT = @UMOUNT@
 UNCOMPRESS_OPT = @UNCOMPRESS_OPT@
 UNCOMPRESS_PATH = @UNCOMPRESS_PATH@
 UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
@@ -1362,7 +1367,7 @@ libndmjlo = \
        ndmos.c \
        ndmos_common.c
 
-libndmlib_la_LDFLAGS = -release $(VERSION)
+libndmlib_la_LDFLAGS = -release $(VERSION) $(AS_NEEDED_FLAGS)
 libndmlib_la_SOURCES = \
        $(libndmjll) \
        $(libndmjlp) \
@@ -1375,7 +1380,7 @@ libndmjob_la_SOURCES = \
        $(libndmjla) \
        $(libndmjlr)
 
-libndmjob_la_LDFLAGS = -release $(VERSION)
+libndmjob_la_LDFLAGS = -release $(VERSION) $(AS_NEEDED_FLAGS)
 libndmjob_la_LIBADD = libndmlib.la
 ndmjob_SOURCES = ndmjob_main.c \
                      ndmjob_args.c \
index 6e665dbd66163e6010e976d16ca4dca7ad559d57..60bde1c606b0578ac6fc0531711736b83501fdd3 100644 (file)
@@ -447,7 +447,7 @@ ndmos_tape_read (struct ndm_session *sess,
 
        nb = count;
 
-       rc = read (ta->tape_fd, buf, nb);
+       rc = full_read (ta->tape_fd, buf, nb);
        if (rc < 0) {
                return NDMP9_IO_ERR;
        }
index b27c1cb05e10c8b5ef37eefa580d045ee8d84b36..c3271acb3b2598bc29da03c18c33f8128c716739 100644 (file)
@@ -468,8 +468,8 @@ ndmta_write_quantum (struct ndm_session *sess)
        ndmp9_error             error;
 
   again:
-       n_read = n_avail = ndmchan_n_avail (ch);
-       if (n_avail == 0) {
+       n_read = n_avail = ndmchan_n_avail_record (ch, count);
+       if (n_avail < count) {
                /* allow to drain */
                return did_something;
        }
@@ -487,7 +487,7 @@ ndmta_write_quantum (struct ndm_session *sess)
        if (n_read > ta->mover_state.bytes_left_to_read)
                n_read = ta->mover_state.bytes_left_to_read;
 
-       if (n_read == 0) {
+       if (n_read < count) {
                /* Active, but paused awaiting MOVER_READ request */
                return did_something;   /* mover blocked */
        }
@@ -587,6 +587,10 @@ ndmta_write_quantum (struct ndm_session *sess)
        n_avail = ta->mover_state.record_size - record_off;
        if (n_read > n_avail)
                n_read = n_avail;
+       if (n_read != done_count) {
+               dbprintf("lost %lu bytes %lu %u\n", done_count - n_read, done_count, n_read);
+               n_read = done_count;
+       }
 
        data = &ta->tape_buffer[record_off];
 
index ebfeabc8eef12aba78f283428661ddddbf884f95..55e1e16527bb32455773b8f21ea7459c649c7c48 100644 (file)
@@ -374,6 +374,17 @@ ndmchan_n_avail (struct ndmchan *ch) {
        return ch->data_size - ch->end_ix;
 }
 
+int
+ndmchan_n_avail_record (struct ndmchan *ch, unsigned long size) {
+       if (ch->end_ix == ch->beg_ix)
+               ch->end_ix = ch->beg_ix = 0;
+
+       if (ch->end_ix >= ch->data_size - size) {
+               ndmchan_compress (ch);
+       }
+       return ch->data_size - ch->end_ix;
+}
+
 int
 ndmchan_n_avail_total (struct ndmchan *ch) {
        if (ch->end_ix == ch->beg_ix)
index a7f768f37d3198ee772b39d099f0438db6a20588..30c3dedc2cc5a6bff309c486e359168450385ce8 100644 (file)
@@ -196,6 +196,7 @@ extern int  ndmchan_pre_poll (struct ndmchan *chtab[], unsigned n_chtab);
 extern int     ndmchan_post_poll (struct ndmchan *chtab[], unsigned n_chtab);
 extern void    ndmchan_compress (struct ndmchan *ch);
 extern int     ndmchan_n_avail (struct ndmchan *ch);
+extern int     ndmchan_n_avail_record (struct ndmchan *ch, unsigned long size);
 extern int     ndmchan_n_avail_total (struct ndmchan *ch);
 extern int     ndmchan_n_ready (struct ndmchan *ch);
 extern enum ndmchan_read_interpretation
index 9f9a45274a615829b9aeb0fb5f92e54350ab3f0a..1fe040a922b6548e75f077f33bcc502f82118de6 100644 (file)
@@ -19,6 +19,7 @@
  */
 
 #include "amanda.h"
+#include "sockaddr-util.h"
 #include "ndmpconnobj.h"
 
 /*
@@ -480,8 +481,9 @@ ndmp_connection_mover_listen(
            *addrs = g_new0(DirectTCPAddr, naddrs+1);
            for (i = 0; i < naddrs; i++) {
                ndmp4_tcp_addr *na = &reply->connect_addr.ndmp4_addr_u.tcp_addr.tcp_addr_val[i];
-               (*addrs)[i].ipv4 = na->ip_addr;
-               (*addrs)[i].port = na->port;
+               (*addrs)[i].sin.sin_family = AF_INET;
+               (*addrs)[i].sin.sin_addr.s_addr = htonl(na->ip_addr);
+               SU_SET_PORT(addrs[i], na->port);
            }
        }
        NDMP_FREE();
@@ -501,13 +503,13 @@ ndmp_connection_mover_connect(
 
     /* count addrs */
     g_assert(addrs);
-    for (naddrs = 0; addrs[naddrs].ipv4; naddrs++) ;
+    for (naddrs = 0; SU_GET_FAMILY(&addrs[naddrs]) != 0; naddrs++) ;
 
     /* convert addrs to an ndmp4_tcp_addr */
     na = g_new0(ndmp4_tcp_addr, naddrs);
     for (i = 0; i < naddrs; i++) {
-       na[i].ip_addr = addrs[i].ipv4;
-       na[i].port = addrs[i].port;
+       na[i].ip_addr = ntohl(addrs[i].sin.sin_addr.s_addr);
+       na[i].port = SU_GET_PORT(&addrs[i]);
     }
 
 
index 2fa3eb6abe18283d7288f4fac2686cbaaa40d60c..fe14d12e7ceef8f78e59441396596fb1300bd578 100644 (file)
@@ -131,6 +131,7 @@ am__aclocal_m4_deps =  \
        $(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/as_needed.m4 \
        $(top_srcdir)/config/amanda/bsd-security.m4 \
        $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
        $(top_srcdir)/config/amanda/bsdudp-security.m4 \
@@ -335,6 +336,7 @@ APPLICATION_DIR = @APPLICATION_DIR@
 AR = @AR@
 ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
 ASSERTIONS = @ASSERTIONS@
+AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -808,6 +810,7 @@ LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
 MKDIR_P = @MKDIR_P@
+MOUNT = @MOUNT@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
@@ -1005,6 +1008,7 @@ STDBOOL_H = @STDBOOL_H@
 STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
+SUNTAR = @SUNTAR@
 SVN = @SVN@
 SWIG = @SWIG@
 SWIG_LIB = @SWIG_LIB@
@@ -1012,6 +1016,7 @@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TCPPORTRANGE = @TCPPORTRANGE@
 TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
 UDPPORTRANGE = @UDPPORTRANGE@
+UMOUNT = @UMOUNT@
 UNCOMPRESS_OPT = @UNCOMPRESS_OPT@
 UNCOMPRESS_PATH = @UNCOMPRESS_PATH@
 UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
index bdc04f24150d222b99e6669de7a30b91db9449fd..7a4b834ae81b395742a334f52bc7d9cec4b44506 100644 (file)
@@ -47,6 +47,7 @@ am__aclocal_m4_deps =  \
        $(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/as_needed.m4 \
        $(top_srcdir)/config/amanda/bsd-security.m4 \
        $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
        $(top_srcdir)/config/amanda/bsdudp-security.m4 \
@@ -216,6 +217,7 @@ APPLICATION_DIR = @APPLICATION_DIR@
 AR = @AR@
 ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
 ASSERTIONS = @ASSERTIONS@
+AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -689,6 +691,7 @@ LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
 MKDIR_P = @MKDIR_P@
+MOUNT = @MOUNT@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
@@ -886,6 +889,7 @@ STDBOOL_H = @STDBOOL_H@
 STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
+SUNTAR = @SUNTAR@
 SVN = @SVN@
 SWIG = @SWIG@
 SWIG_LIB = @SWIG_LIB@
@@ -893,6 +897,7 @@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TCPPORTRANGE = @TCPPORTRANGE@
 TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
 UDPPORTRANGE = @UDPPORTRANGE@
+UMOUNT = @UMOUNT@
 UNCOMPRESS_OPT = @UNCOMPRESS_OPT@
 UNCOMPRESS_PATH = @UNCOMPRESS_PATH@
 UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
index 874ce4bc0cf2032957c7b4629acf8196606e53d8..5d25b481d0ad5b16b70ab1657ebe33f756788c71 100644 (file)
@@ -2,7 +2,7 @@ Source: amanda
 Section: utils
 Priority: optional
 Maintainer: Zmanda Inc <support@zmanda.com>
-Build-Depends: debhelper, dump, fakeroot, flex, gnuplot|gnuplot-nox, libtool,
+Build-Depends: debhelper, dump, fakeroot, flex, gnuplot-nox|gnuplot, libtool,
        mailx|bsd-mailx, mtx, perl (>=5.6.0), procps, smbclient, libcurl-dev,
        libglib2.0-dev, libncurses5-dev, libreadline5-dev|libreadline-dev,
        libssl-dev
@@ -11,7 +11,8 @@ Standards-Version: 3.6.1
 Package: amanda-backup-server
 Architecture: any
 Depends: ca-certificates, xinetd, perl (>=5.6.0), mailx|bsd-mailx,
-       gnuplot|gnuplot-nox, tar (>=1.15), ${shlibs:Depends}, ${perl:Depends}
+       tar (>=1.15), ${shlibs:Depends}, ${perl:Depends}
+Suggests: gnuplot-nox|gnuplot
 Conflicts: amanda-client, amanda-common, amanda-server, amanda-backup-client
 Description: Amanda Network Backup and Archiving software
  .
index 4fbc099919f7e784677d02a2f49c44ad43ee19c7..1d75bbed5ea1022b5c5f9aed109538a1b8f628f5 100755 (executable)
@@ -52,7 +52,7 @@ build-stamp: /sbin/dump /usr/bin/smbclient
                MAKEFLAGS="-j1 " \
                CFLAGS="-pipe " \
                MAILER=/usr/bin/mail \
-               LDFLAGS="-Wl,--as-needed" \
+               --enable-as-needed \
                --quiet \
                --host=$(DEB_HOST_GNU_TYPE) \
                --build=$(DEB_BUILD_GNU_TYPE) \
@@ -158,7 +158,8 @@ binary-arch: build
                $(server)/$(AMLIBEXECDIR)/calcsize \
                $(server)/$(AMLIBEXECDIR)/dumper \
                $(server)/$(AMLIBEXECDIR)/planner \
-               $(server)/usr/sbin/amcheck
+               $(server)/usr/sbin/amcheck \
+               $(server)/usr/sbin/amservice
        chmod u=srwx,g=rx,o=r \
                $(client)/$(AMLIBEXECDIR)/application/amgtar \
                $(client)/$(AMLIBEXECDIR)/application/amstar \
@@ -174,7 +175,8 @@ binary-arch: build
                $(server)$(AMLIBEXECDIR)/calcsize \
                $(server)$(AMLIBEXECDIR)/dumper \
                $(server)$(AMLIBEXECDIR)/planner \
-               $(server)/usr/sbin/amcheck
+               $(server)/usr/sbin/amcheck \
+               $(server)/usr/sbin/amservice
        echo "Amanda version $(AMVER)" >  $(server)/$(AMANDAHOMEDIR)/amanda-release 
        echo "Amanda version $(AMVER)" >  $(client)/$(AMANDAHOMEDIR)/amanda-release 
        install -o root -g root -m 0644 debian/amanda-backup-client.lintian \
index 291c44f505c36ec8ed619cedc68efbf32fa46c98..d79078607bf9cbed11176d06053de75414f25c10 100644 (file)
@@ -33,7 +33,7 @@
 
 # LDFLAGS: newer gnu linkers can use "-Wl,--as-needed", while older ones,
 # like rhel3 and sles9 can't.
-%define LDFLAGS -Wl,--as-needed
+%define enable_as_needed --enable-as-needed
 
 # Define which Distribution we are building:
 # Try to detect the distribution we are building:
        %define requires_libtermcap Requires: libtermcap.so.2
        %define curl curl
        %define without_ipv6 --without-ipv6
-       %undefine LDFLAGS
     %endif
     %if %(awk '$1 == "Red" && $7 ~ /4.*/ { exit 1; }' /etc/redhat-release; echo $?)
         %define dist redhat
        # as integers.
        %define curl curl
        %if "%{distver}" == "9"
-           %undefine LDFLAGS
+           %undefine enable_as_needed
        %endif
     %endif
 %endif
@@ -369,10 +368,13 @@ Amanda Documentation is available at: http://wiki.zmanda.com/
 # the platform detection bits.
 # without_ipv6 should only be defined on rhel3.
 # LDFLAGS macro is defined except on rhel3.
+# --enable-as-needed must be conditional until configure tests whether
+# ld can accept --as-needed.
 ./configure \
         %{?PKG_CONFIG_PATH: PKG_CONFIG_PATH=%PKG_CONFIG_PATH} \
         CFLAGS="%{optflags} -g -pipe" CXXFLAGS="%{optflags}" \
         %{?LDFLAGS:LDFLAGS="${LDFLAGS} %{?LDFLAGS:%LDFLAGS}"} \
+       %{?enable_as_needed:%{enable_as_needed}} \
         --quiet \
         --prefix=%{PREFIX} \
         --sysconfdir=%{SYSCONFDIR} \
@@ -1595,6 +1597,7 @@ echo "Amanda installation log can be found in '${INSTALL_LOG}' and errors (if an
 %{AMLIBEXECDIR}/dumper
 %{AMLIBEXECDIR}/planner
 %{SBINDIR}/amcheck
+%{SBINDIR}/amservice
 %defattr(0750,%{amanda_user},%{amanda_group},0750)
 %{LOGDIR}
 %{SYSCONFDIR}/amanda
index 250b1ea19f3bb4d7f56e615f8de1330fb692edf5..6fd92b20d5c8f9c87a49787bbed866b9fd6a7a51 100644 (file)
@@ -197,11 +197,7 @@ sub zfs_set_value {
 
     }
 
-    if ($self->{action} eq 'check') {
-      $self->{snapshot} = $self->zfs_build_snapshotname($device, -1);
-    } else {
-      $self->{snapshot} = $self->zfs_build_snapshotname($device);
-    }
+    $self->{snapshot} = $self->zfs_build_snapshotname($device);
     if (defined $self->{mountpoint}) {
        if ($device =~ /^$self->{mountpoint}/) {
             $self->{dir} = $device;
@@ -310,7 +306,7 @@ sub zfs_rename_snapshot {
     my $device = $self->{device};
     $device = $self->{directory} if defined $self->{directory};
     my $newsnapshotname = $self->zfs_build_snapshotname($device, $level);
-    my $cmd = "$self->{pfexec_cmd} $self->{zfs_path} rename $self->{filesystem}\@$self->{snapshot} $newsnapshotname";
+    my $cmd = "$self->{pfexec_cmd} $self->{zfs_path} rename $self->{filesystem}\@$self->{snapshot} $self->{filesystem}\@$newsnapshotname";
     debug "running: $cmd|";
     my($wtr, $rdr, $err, $pid);
     my($msg, $errmsg);
@@ -380,15 +376,13 @@ sub zfs_build_snapshotname {
 
     my $snapshotname = "";
 
-    if (!defined $level) {
-      $snapshotname = "amanda-" . Amanda::Util::sanitise_filename($self->{disk}) . "-current";
-    } else {
-      if ($level < 0) {
+    if ($self->{action} eq 'check') {
        $snapshotname = "amanda-" . Amanda::Util::sanitise_filename($self->{disk}) . "-check";
-      } else {
-        $snapshotname = "amanda-" . Amanda::Util::sanitise_filename($self->{disk}) . "-" . $level;
-      }
-    } 
+    } elsif (!defined $level) {
+       $snapshotname = "amanda-" . Amanda::Util::sanitise_filename($self->{disk}) . "-current";
+    } else {
+       $snapshotname = "amanda-" . Amanda::Util::sanitise_filename($self->{disk}) . "-" . $level;
+    }
 
     return $snapshotname;
 }
index 9c6e88fd05941f8babc9382378df61311ee68b8a..2a80135e412280d1a13943a050a4e83e0ff97b5a 100644 (file)
@@ -28,7 +28,7 @@ use vars qw( @ISA );
 
 use Amanda::Paths;
 use Amanda::Util;
-use Amanda::Config qw( :getconf string_to_boolean );
+use Amanda::Config qw( :getconf );
 use Amanda::Device qw( :constants );
 use Amanda::Debug qw( debug );
 use Amanda::MainLoop;
@@ -59,6 +59,9 @@ Amanda::Changer -- interface to changer scripts
     # later..
     $reservation->release(finished_cb => $start_next_volume);
 
+    # later..
+    $chg->quit();
+
 =head1 INTERFACE
 
 All operations in the module return immediately, and take as an argument a
@@ -69,12 +72,20 @@ continue.
 
 A new object is created with the C<new> function as follows:
 
-  my $chg = Amanda::Changer->new($changer_name);
+  my $chg = Amanda::Changer->new($changer_name,
+                                tapelist       => $tapelist,
+                                labelstr       => $labelstr,
+                                autolabel      => $autolabel,
+                                meta_autolabel => $meta_autolabel);
 
 to create a named changer (a name provided by the user, either specifying a
 changer directly or specifying a changer definition), or
 
-  my $chg = Amanda::Changer->new();
+  my $chg = Amanda::Changer->new(undef,
+                                tapelist       => $tapelist,
+                                labelstr       => $labelstr,
+                                autolabel      => $autolabel,
+                                meta_autolabel => $meta_autolabel);
 
 to run the default changer.  This function handles the many ways a user can
 configure a changer.
@@ -88,6 +99,13 @@ creating a new changer is
     die("Error creating changer $changer_name: $chg");
   }
 
+C<tapelist> must be an Amanda::Tapelist object. It is required if you want to
+use $chg->volume_is_labelable(), $chg->make_new_tape_label(),
+$chg->make_new_meta_label(), $res->make_new_tape_label() or
+$res->make_new_meta_label().
+C<labelstr> must be like getconf($CNF_LABELSTR), that value is used if C<labelstr> is not set.
+C<autolabel> must be like getconf($CNF_AUTOLABEL), that value is used if C<autolabel> is not set.
+C<meta_autolabel> must be like getconf($CNF_META_AUTOLABEL), that value is used if C<meta_autolabel> is not set.
 =head2 MEMBER VARIABLES
 
 Note that these variables are not set until after the subclass constructor is
@@ -167,6 +185,7 @@ has one of the following values:
   volinuse          The requested volume or slot is already in use
   driveinuse        All drives are in use
   unknown           Unknown reason
+  empty             The slot is empty
 
 Like types, checks for particular reasons should use the methods, to avoid
 undetected typos:
@@ -191,6 +210,10 @@ C<relative_slot> parameter to C<load>.
 
 =head2 CHANGER OBJECTS
 
+=head3 quit
+
+To terminate a changer object.
+
 =head3 load
 
 The most common operation with a tape changer is to load a volume.  The C<load>
@@ -359,6 +382,33 @@ change, but some entries can be added or removed.
 
 Each slot is represented by a hash with the following keys:
 
+=head3 make_new_tape_label
+
+  $chg->make_new_tape_label(barcode => $barcode,
+                           meta    => $meta);
+
+To devise a new name for a volume using the C<barcode> and C<meta> arguments.
+This will return C<undef> if no label could be created.
+
+=head3 make_new_meta_label
+
+  $chg->make_new_meta_label();
+
+To devise a new meta name for a meta volume.
+This will return C<undef> if no label could be created.
+
+=head3 have_inventory
+
+  $chg->have_inventory() 
+
+Return True if the changer have the inventory method.
+
+=head3 volume_is_labelable
+
+  $chg->volume_is_labelable($device_status, $f_type, $label);
+
+Return 1 if the volume is labelable acording to the autolabel setting.
+
 =over 4
 
 =item slot
@@ -426,6 +476,12 @@ user, and have meaning for the changer.
 
 =head2 RESERVATION OBJECTS
 
+=head3 Methods
+
+=head3 $res->{'chg'}
+
+This is the changer object.
+
 =head3 $res->{'device'}
 
 This is the fully configured device for the reserved volume.  The device is not
@@ -442,6 +498,16 @@ access this field after the reservation has been released.
 If this changer supports barcodes, then this is the barcode of the reserved
 volume.  This can be helpful for labeling tapes using their barcode.
 
+=head3 $label = $res->make_new_tape_label()
+
+To devise a new name for a volume.
+This will return C<undef> if no label could be created.
+
+=head3 $meta = $res->make_new_meta_label()
+
+To devise a new meta name for a meta volume.
+This will return C<undef> if no label could be created.
+
 =head3 $res->release(finished_cb => $cb, eject => $eject)
 
 This is how an Amanda application indicates that it no longer needs the
@@ -489,14 +555,6 @@ including a regular C<info_cb> callback.  The C<info> method will wait for
 all C<info_key> invocations to finish, then collect the results or errors that
 occur.
 
-=head2 PROPERTY PARSING
-
-Many properties are boolean, and Amanda has a habit of accepting a number of
-different ways of writing boolean values.  The method
-C<< $self->get_boolean_property($config, $prop, $default) >> will parse such a
-property, returning 0 or 1 if the property is specified, C<$default> if it is
-not specified, or C<undef> if the property cannot be parsed.
-
 =head2 ERROR HANDLING
 
 To create a new error object, use C<< $self->make_error($type, $cb, %args) >>.
@@ -587,6 +645,12 @@ property, ignoring its the priority and other attributes.  In a list context,
 it returns all values for the property; in a scalar context, it returns the
 first value specified.
 
+Many properties are boolean, and Amanda has a habit of accepting a number of
+different ways of writing boolean values.  The method
+C<< $config->get_boolean_property($prop, $default) >> will parse such a
+property, returning 0 or 1 if the property is specified, C<$default> if it is
+not specified, or C<undef> if the property cannot be parsed.
+
 =head2 PERSISTENT STATE AND LOCKING
 
 Many changer subclasses need to track state across invocations and between
@@ -658,23 +722,24 @@ our %EXPORT_TAGS = (
 sub new {
     shift eq 'Amanda::Changer'
        or die("Do not call the Amanda::Changer constructor from subclasses");
-    my ($name) = @_;
+    my ($name) = shift;
+    my %params = @_;
     my ($uri, $cc);
 
     # creating a named changer is a bit easier
     if (defined($name)) {
        # first, is it a changer alias?
        if (($uri,$cc) = _changer_alias_to_uri($name)) {
-           return _new_from_uri($uri, $cc, $name);
+           return _new_from_uri($uri, $cc, $name, %params);
        }
 
        # maybe a straight-up changer URI?
        if (_uri_to_pkgname($name)) {
-           return _new_from_uri($name, undef, $name);
+           return _new_from_uri($name, undef, $name, %params);
        }
 
        # assume it's a device name or alias, and invoke the single-changer
-       return _new_from_uri("chg-single:$name", undef, $name);
+       return _new_from_uri("chg-single:$name", undef, $name, %params);
     } else { # !defined($name)
        if ((getconf_linenum($CNF_TPCHANGER) == -2 ||
             (getconf_seen($CNF_TPCHANGER) &&
@@ -684,7 +749,7 @@ sub new {
 
            # first, is it an old changer script?
            if ($uri = _old_script_to_uri($tpchanger)) {
-               return _new_from_uri($uri, undef, $tpchanger);
+               return _new_from_uri($uri, undef, $tpchanger, %params);
            }
 
            # if not, then there had better be no tapdev
@@ -699,33 +764,33 @@ sub new {
 
            # maybe a changer alias?
            if (($uri,$cc) = _changer_alias_to_uri($tpchanger)) {
-               return _new_from_uri($uri, $cc, $tpchanger);
+               return _new_from_uri($uri, $cc, $tpchanger, %params);
            }
 
            # maybe a straight-up changer URI?
            if (_uri_to_pkgname($tpchanger)) {
-               return _new_from_uri($tpchanger, undef, $tpchanger);
+               return _new_from_uri($tpchanger, undef, $tpchanger, %params);
            }
 
            # assume it's a device name or alias, and invoke the single-changer
-           return _new_from_uri("chg-single:$tpchanger", undef, $tpchanger);
+           return _new_from_uri("chg-single:$tpchanger", undef, $tpchanger, %params);
        } elsif (getconf_seen($CNF_TAPEDEV) and getconf($CNF_TAPEDEV) ne '') {
            my $tapedev = getconf($CNF_TAPEDEV);
 
            # first, is it a changer alias?
            if (($uri,$cc) = _changer_alias_to_uri($tapedev)) {
-               return _new_from_uri($uri, $cc, $tapedev);
+               return _new_from_uri($uri, $cc, $tapedev, %params);
            }
 
            # maybe a straight-up changer URI?
            if (_uri_to_pkgname($tapedev)) {
-               return _new_from_uri($tapedev, undef, $tapedev);
+               return _new_from_uri($tapedev, undef, $tapedev, %params);
            }
 
            # assume it's a device name or alias, and invoke chg-single.
            # chg-single will check the device immediately and error out
            # if the device name is invalid.
-           return _new_from_uri("chg-single:$tapedev", undef, $tapedev);
+           return _new_from_uri("chg-single:$tapedev", undef, $tapedev, %params);
        } else {
            return Amanda::Changer::Error->new('fatal',
                message => "You must specify one of 'tapedev' or 'tpchanger'");
@@ -733,6 +798,21 @@ sub new {
     }
 }
 
+sub DESTROY {
+    my $self = shift;
+
+    debug("Changer '$self->{'chg_name'}' not quit") if defined $self->{'chg_name'};
+}
+
+# do nothing in quit
+sub quit {
+    my $self = shift;
+
+    foreach (keys %$self) {
+        delete $self->{$_};
+    }
+}
+
 # helper functions for new
 
 sub _changer_alias_to_uri {
@@ -821,12 +901,11 @@ sub _uri_to_pkgname {
     return $pkgname;
 }
 
-# already-instantiated changer objects (using 'our' so that the installcheck
-# and reset this list as necessary)
-our %changers_by_uri_cc = ();
-
 sub _new_from_uri { # (note: this sub is patched by the installcheck)
-    my ($uri, $cc, $name) = @_;
+    my $uri = shift;
+    my $cc = shift;
+    my $name = shift;
+    my %params = @_;
 
     # as a special case, if the URI came back as an error, just pass
     # that along.  This lets the _xxx_to_uri methods return errors more
@@ -845,17 +924,14 @@ sub _new_from_uri { # (note: this sub is patched by the installcheck)
 
     # return a pre-existing changer, if possible
 
-    if (exists($changers_by_uri_cc{$uri_cc})) {
-       return $changers_by_uri_cc{$uri_cc};
-    }
-
     # look up the type and load the class
     my $pkgname = _uri_to_pkgname($uri);
     if (!$pkgname) {
        die $@;
     }
 
-    my $rv = $pkgname->new(Amanda::Changer::Config->new($cc), $uri);
+    my $rv = eval {$pkgname->new(Amanda::Changer::Config->new($cc), $uri);};
+    die "$pkgname->new return undef" if $@;
     die "$pkgname->new did not return an Amanda::Changer object or an Amanda::Changer::Error"
        unless ($rv->isa("Amanda::Changer") or $rv->isa("Amanda::Changer::Error"));
 
@@ -866,11 +942,18 @@ sub _new_from_uri { # (note: this sub is patched by the installcheck)
     if ($rv->isa("Amanda::Changer")) {
        # add an instance variable or two
        $rv->{'fatal_error'} = undef;
-
-       # store this in our cache for next time
-       $changers_by_uri_cc{$uri_cc} = $rv;
     }
 
+    $rv->{'tapelist'} = $params{'tapelist'};
+    $rv->{'autolabel'} = $params{'autolabel'};
+    $rv->{'autolabel'} = getconf($CNF_AUTOLABEL)
+       unless defined $rv->{'autolabel'};
+    $rv->{'labelstr'} = $params{'labelstr'};
+    $rv->{'labelstr'} = getconf($CNF_LABELSTR)
+       unless defined $rv->{'labelstr'};
+    $rv->{'meta_autolabel'} = $params{'meta_autolabel'};
+    $rv->{'meta_autolabel'} = getconf($CNF_META_AUTOLABEL)
+       unless defined $rv->{'meta_autolabel'};
     $rv->{'chg_name'} = $name;
     return $rv;
 }
@@ -895,6 +978,14 @@ sub eject { _stubop("eject", "finished_cb", @_); }
 sub update { _stubop("update", "finished_cb", @_); }
 sub inventory { _stubop("inventory", "inventory_cb", @_); }
 sub move { _stubop("move", "finished_cb", @_); }
+sub set_meta_label { _stubop("set_meta_label", "finished_cb", @_); }
+sub get_meta_label { _stubop("get_meta_label", "finished_cb", @_); }
+
+sub have_inventory {
+    my $self = shift;
+
+    return $self->can("inventory") ne \&Amanda::Changer::inventory;
+}
 
 # info calls out to info_setup and info_key; see POD above
 sub info {
@@ -979,18 +1070,6 @@ sub info {
 
 # subclass helpers
 
-sub get_boolean_property {
-    my ($self) = shift;
-    my ($config, $propname, $default) = @_;
-
-    return $default
-       unless (exists $config->{'properties'}->{$propname});
-
-    my $propinfo = $config->{'properties'}->{$propname};
-    return undef unless @{$propinfo->{'values'}} == 1;
-    return string_to_boolean($propinfo->{'values'}->[0]);
-}
-
 sub make_error {
     my $self = shift;
     my ($type, $cb, %args) = @_;
@@ -1167,6 +1246,179 @@ sub validate_params {
     }
 }
 
+sub make_new_tape_label {
+    my $self = shift;
+    my %params = @_;
+
+    my $tl = $self->{'tapelist'};
+    die ("make_new_tape_label: no tapelist") if !$tl;
+    return undef if !defined $self->{'autolabel'}->{'template'};
+    return undef if !defined $self->{'labelstr'};
+    my $template = $self->{'autolabel'}->{'template'};
+    my $labelstr = $self->{'labelstr'};
+
+    if (!$template) {
+       return (undef, "template is not set, you must set autolabel");
+    }
+    $template =~ s/\$\$/SUBSTITUTE_DOLLAR/g;
+    $template =~ s/\$b/SUBSTITUTE_BARCODE/g;
+    $template =~ s/\$m/SUBSTITUTE_META/g;
+    $template =~ s/\$o/SUBSTITUTE_ORG/g;
+    $template =~ s/\$c/SUBSTITUTE_CONFIG/g;
+
+    my $org = getconf($CNF_ORG);
+    my $config = Amanda::Config::get_config_name();
+    my $barcode = $params{'barcode'};
+    $barcode = '' if !defined $barcode;
+    my $meta = $params{'meta'};
+    $meta = $self->make_new_meta_label(%params) if !defined $meta;
+    $meta = '' if !defined $meta;
+
+    $template =~ s/SUBSTITUTE_DOLLAR/\$/g;
+    $template =~ s/SUBSTITUTE_ORG/$org/g;
+    $template =~ s/SUBSTITUTE_CONFIG/$config/g;
+    $template =~ s/SUBSTITUTE_META/$meta/g;
+    # Do not susbtitute the barcode now
+
+    (my $npercents =
+       $template) =~ s/[^%]*(%+)[^%]*/length($1)/e;
+    my $nlabels = 10 ** $npercents;
+
+    my $label;
+    if ($npercents == 0) {
+       if ($template =~ /SUBSTITUTE_BARCODE/ && defined $barcode) {
+            $label = $template;
+            $label =~ s/SUBSTITUTE_BARCODE/$barcode/g;
+            if ($tl->lookup_tapelabel($label)) {
+               return (undef, "Label '$label' already exists");
+            }
+       } elsif ($template =~ /SUBSTITUTE_BARCODE/ && !defined $barcode) {
+           return (undef, "Can't generate new label because volume have no barcode");
+       } else {
+           return (undef, "autolabel require at least one '%'");
+       }
+    } else {
+       # make up a sprintf pattern
+       (my $sprintf_pat =
+           $template) =~ s/(%+)/"%0" . length($1) . "d"/e;
+
+       my %existing_labels;
+       for my $tle (@{$tl->{'tles'}}) {
+           if (defined $tle && defined $tle->{'label'}) {
+               my $tle_label = $tle->{'label'};
+               my $tle_barcode = $tle->{'barcode'};
+               if (defined $tle_barcode) {
+                   $tle_label =~ s/$tle_barcode/SUBSTITUTE_BARCODE/g;
+               }
+               $existing_labels{$tle_label} = 1 if defined $tle_label;
+           }
+       }
+
+       my ($i);
+       for ($i = 1; $i < $nlabels; $i++) {
+           $label = sprintf($sprintf_pat, $i);
+           last unless (exists $existing_labels{$label});
+       }
+       # susbtitute the barcode
+
+       $label =~ s/SUBSTITUTE_BARCODE/$barcode/g;
+
+       # bail out if we didn't find an unused label
+       return (undef, "Can't label unlabeled volume: All label used")
+               if ($i >= $nlabels);
+    }
+
+    # verify $label matches $labelstr
+    if ($label !~ /$labelstr/) {
+        return (undef, "Newly-generated label '$label' does not match labelstr '$labelstr'");
+    }
+
+    if (!$label) {
+       return (undef, "Generated label is empty");
+    }
+
+    return $label;
+}
+
+sub make_new_meta_label {
+    my $self = shift;
+    my %params = @_;
+
+    my $tl = $self->{'tapelist'};
+    die ("make_new_meta_label: no tapelist") if !$tl;
+    return undef if !defined $self->{'meta_autolabel'};
+    my $template = $self->{'meta_autolabel'};
+    return if !defined $template;
+
+    if (!$template) {
+       return (undef, "template is not set, you must set meta-autolabel");
+    }
+    $template =~ s/\$\$/SUBSTITUTE_DOLLAR/g;
+    $template =~ s/\$o/SUBSTITUTE_ORG/g;
+    $template =~ s/\$c/SUBSTITUTE_CONFIG/g;
+
+    my $org = getconf($CNF_ORG);
+    my $config = Amanda::Config::get_config_name();
+
+    $template =~ s/SUBSTITUTE_DOLLAR/\$/g;
+    $template =~ s/SUBSTITUTE_ORG/$org/g;
+    $template =~ s/SUBSTITUTE_CONFIG/$config/g;
+
+    (my $npercents =
+       $template) =~ s/[^%]*(%+)[^%]*/length($1)/e;
+    my $nlabels = 10 ** $npercents;
+
+    # make up a sprintf pattern
+    (my $sprintf_pat = $template) =~ s/(%+)/"%0" . length($1) . "d"/e;
+
+    my %existing_meta_labels =
+       map { $_->{'meta'} => 1 } @{$tl->{'tles'}};
+
+    my ($i, $meta);
+    for ($i = 1; $i < $nlabels; $i++) {
+       $meta = sprintf($sprintf_pat, $i);
+       last unless (exists $existing_meta_labels{$meta});
+    }
+
+    # bail out if we didn't find an unused label
+    return (undef, "Can't label unlabeled meta volume: All meta label used")
+               if ($i >= $nlabels);
+
+    if (!$meta) {
+       return (undef, "Generated meta-label is empty");
+    }
+
+    return $meta;
+}
+
+sub volume_is_labelable {
+    my $self = shift;
+    my $dev_status  = shift;
+    my $f_type = shift;
+    my $label = shift;
+    my $autolabel = $self->{'autolabel'};
+
+    if (!defined $dev_status) {
+       return 0;
+    } elsif ($dev_status & $DEVICE_STATUS_VOLUME_UNLABELED and
+       $f_type == $Amanda::Header::F_EMPTY) {
+       return 0 if (!$autolabel->{'empty'});
+    } elsif ($dev_status & $DEVICE_STATUS_VOLUME_UNLABELED and
+            $f_type == $Amanda::Header::F_WEIRD) {
+       return 0 if (!$autolabel->{'non_amanda'});
+    } elsif ($dev_status & $DEVICE_STATUS_VOLUME_ERROR) {
+       return 0 if (!$autolabel->{'volume_error'});
+    } elsif ($dev_status != $DEVICE_STATUS_SUCCESS) {
+       return 0;
+    } elsif ($dev_status & $DEVICE_STATUS_SUCCESS and
+            $f_type == $Amanda::Header::F_TAPESTART and
+            $label !~ /$self->{'labelstr'}/) {
+       return 0 if (!$autolabel->{'other_config'});
+    }
+
+    return 1;
+}
+
 package Amanda::Changer::Error;
 use Amanda::Debug qw( :logging );
 use Carp qw( cluck );
@@ -1176,7 +1428,7 @@ use overload
     'cmp' => sub { $_[0]->{'message'} cmp $_[1]; };
 
 my %known_err_types = map { ($_, 1) } qw( fatal failed );
-my %known_err_reasons = map { ($_, 1) } qw( notfound invalid notimpl driveinuse volinuse unknown device );
+my %known_err_reasons = map { ($_, 1) } qw( notfound invalid notimpl driveinuse volinuse unknown device empty );
 
 sub new {
     my $class = shift; # ignore class
@@ -1217,6 +1469,9 @@ sub new {
     return bless (\%info, $class);
 }
 
+# do nothing in quit
+sub quit {}
+
 # types
 sub fatal { $_[0]->{'type'} eq 'fatal'; }
 sub failed { $_[0]->{'type'} eq 'failed'; }
@@ -1228,12 +1483,14 @@ sub notimpl { $_[0]->failed && $_[0]->{'reason'} eq 'notimpl'; }
 sub driveinuse { $_[0]->failed && $_[0]->{'reason'} eq 'driveinuse'; }
 sub volinuse { $_[0]->failed && $_[0]->{'reason'} eq 'volinuse'; }
 sub unknown { $_[0]->failed && $_[0]->{'reason'} eq 'unknown'; }
+sub empty { $_[0]->failed && $_[0]->{'reason'} eq 'empty'; }
 
 # slot accessor
 sub slot { $_[0]->{'slot'}; }
 
 package Amanda::Changer::Reservation;
 # this is a simple base class with stub method or two.
+use Amanda::Config qw( :getconf );
 
 sub new {
     my $class = shift;
@@ -1294,8 +1551,47 @@ sub do_release {
     }
 }
 
+sub get_meta_label {
+    my $self = shift;
+    my %params = @_;
+
+    # this is the one subclasses should override
+
+    if (exists $params{'finished_cb'}) {
+       $params{'finished_cb'}->(undef) if $params{'finished_cb'};
+    }
+}
+
+sub set_meta_label {
+    my $self = shift;
+    my %params = @_;
+
+    # this is the one subclasses should override
+
+    if (exists $params{'finished_cb'}) {
+       $params{'finished_cb'}->(undef) if $params{'finished_cb'};
+    }
+}
+
+sub make_new_tape_label {
+    my $self = shift;
+    my %params = @_;
+
+    $params{'barcode'} = $self->{'barcode'} if !defined $params{'barcode'};
+    $params{'meta'} = $self->{'meta'} if !defined $params{'meta'};
+    return $self->{'chg'}->make_new_tape_label(%params);
+}
+
+
+sub make_new_meta_label {
+    my $self = shift;
+    my %params = @_;
+
+    return $self->{'chg'}->make_new_meta_label(%params);
+}
+
 package Amanda::Changer::Config;
-use Amanda::Config qw( :getconf );
+use Amanda::Config qw( :getconf string_to_boolean );
 use Amanda::Device;
 
 sub new {
@@ -1382,6 +1678,18 @@ sub get_property {
     return wantarray? @{$prophash->{'values'}} : $prophash->{'values'}->[0];
 }
 
+sub get_boolean_property {
+    my ($self) = shift;
+    my ($propname, $default) = @_;
+
+    return $default
+       unless (exists $self->{'properties'}->{$propname});
+
+    my $propinfo = $self->{'properties'}->{$propname};
+    return undef unless @{$propinfo->{'values'}} == 1;
+    return string_to_boolean($propinfo->{'values'}->[0]);
+}
+
 sub _get_implicit_properties {
     my $self = shift;
     my $props = {};
diff --git a/perl/Amanda/Changer/aggregate.pm b/perl/Amanda/Changer/aggregate.pm
new file mode 100644 (file)
index 0000000..a7c333d
--- /dev/null
@@ -0,0 +1,765 @@
+# Copyright (c) 2009,2010 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., 465 S. Mathilda Ave., Suite 300
+# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+
+package Amanda::Changer::aggregate;
+
+use strict;
+use warnings;
+use vars qw( @ISA );
+@ISA = qw( Amanda::Changer );
+
+use File::Glob qw( :glob );
+use File::Path;
+use Amanda::Config qw( :getconf );
+use Amanda::Paths;
+use Amanda::Debug qw( debug warning );
+use Amanda::Util qw( :alternates );
+use Amanda::Changer;
+use Amanda::MainLoop;
+use Amanda::Device qw( :constants );
+
+=head1 NAME
+
+Amanda::Changer::aggregate
+
+=head1 DESCRIPTION
+
+This changer operates several child changers.
+Slot are numbered:
+  0:0  changer 0 slot 0
+  0:1  changer 0 slot 1
+  1:0  changer 1 slot 0
+  3:4  changer 3 slot 4
+
+See the amanda-changers(7) manpage for usage information.
+
+=cut
+
+sub new {
+    my $class = shift;
+    my ($config, $tpchanger) = @_;
+    my ($kidspecs) = ( $tpchanger =~ /chg-aggregate:(.*)/ );
+
+    my @kidspecs = Amanda::Util::expand_braced_alternates($kidspecs);
+    if (@kidspecs < 2) {
+       return Amanda::Changer->make_error("fatal", undef,
+           message => "chg-aggregate needs at least two child changers");
+    }
+
+    my @children = map {
+       ($_ eq "ERROR")? "ERROR" : Amanda::Changer->new($_)
+    } @kidspecs;
+
+    my $fail_on_error;
+    if (defined $config->{'properties'}->{'fail-on-error'}) {
+       $fail_on_error = string_to_boolean($config->{'properties'}->{'fail-on-error'}->{'values'}[0]);
+    } else {
+       $fail_on_error = 1;
+    }
+
+    if (grep { $_->isa("Amanda::Changer::Error") } @children) {
+       my @annotated_errs;
+       my $valid = 0;
+       for my $i (0 .. @children-1) {
+           if ($children[$i]->isa("Amanda::Changer::Error")) {
+               push @annotated_errs,
+                   [ $kidspecs[$i], $children[$i] ];
+           } else {
+               $valid++;
+           }
+       }
+       if ($valid == 0 || $fail_on_error) {
+           return Amanda::Changer->make_combined_error(
+               "fatal", [ @annotated_errs ]);
+       }
+    }
+
+    my $state_filename;
+    my $state_filename_prop = $config->{'properties'}->{'state_filename'};
+
+    if (defined $state_filename_prop) {
+       $state_filename = $state_filename_prop->{'values'}[0];
+    }
+    if (!defined $state_filename) {
+       $state_filename = $Amanda::Paths::CONFIG_DIR . '/' . $config->{'name'} . ".state";
+    }
+
+    my $self = {
+       config => $config,
+       child_names => \@kidspecs,
+       children => \@children,
+       num_children => scalar @children,
+       current_slot => undef,
+       state_filename => $state_filename,
+    };
+    bless ($self, $class);
+    return $self;
+}
+
+sub quit {
+    my $self = shift;
+
+    # quit each child
+    foreach my $child (@{$self->{'children'}}) {
+        $child->quit();
+    }
+
+    $self->SUPER::quit();
+}
+
+sub _get_current_slot
+{
+    my $self = shift;
+    my $cb = shift;
+
+    $self->with_locked_state($self->{'state_filename'}, $cb, sub {
+       my ($state, $cb) = @_;
+       $self->{'current_slot'} = $state->{'current_slot'};
+       $self->{'current_slot'} = "0:first" if !defined $self->{'current_slot'};
+       $cb->();
+    });
+}
+
+sub _set_current_slot
+{
+    my $self = shift;
+    my $cb = shift;
+
+    $self->with_locked_state($self->{'state_filename'}, $cb, sub {
+       my ($state, $cb) = @_;
+       $state->{'current_slot'} = $self->{'current_slot'};
+       $cb->();
+    });
+}
+
+sub load {
+    my $self = shift;
+    my %params = @_;
+    my $aggregate_res;
+
+    return if $self->check_error($params{'res_cb'});
+
+    my $res_cb = $params{'res_cb'};
+    my $orig_slot = $params{'slot'};
+    $self->validate_params('load', \%params);
+
+    my $steps = define_steps
+       cb_ref => \$res_cb;
+
+    step which_slot => sub {
+       if (exists $params{'relative_slot'} &&
+           $params{'relative_slot'} eq "current") {
+           if (defined $self->{'current_slot'}) {
+               return $steps->{'set_from_current'}->();
+           } else {
+               return $self->_get_current_slot($steps->{'set_from_current'});
+           }
+       } elsif (exists $params{'relative_slot'} &&
+                $params{'relative_slot'} eq "next") {
+           if (defined $self->{'current_slot'}) {
+               return $steps->{'get_inventory_next'}->();
+           } else {
+               return $self->_get_current_slot($steps->{'get_inventory_next'});
+           }
+       } elsif (exists $params{'label'}) {
+           return $self->inventory(inventory_cb => $steps->{'got_inventory_label'});
+       }
+       return $steps->{'slot_set'}->();
+    };
+
+    step get_inventory_next => sub {
+       return $self->inventory(inventory_cb => $steps->{'got_inventory_next'})
+    };
+
+    step got_inventory_next => sub {
+       my ($err, $inv) = @_;
+       my $slot;
+       if ($err) {
+           $res_cb->($err);
+       }
+       my $found = -1;
+       for my $i (0.. scalar(@$inv)-1) {
+           $slot = @$inv[$i]->{'slot'};
+           if ($slot eq $self->{'current_slot'}) {
+               $found = $i;
+           } elsif ($found >= 0 && (!exists $params{'except_slots'} ||
+                               !exists $params{'except_slots'}->{$slot})) {
+               $orig_slot = $slot;
+               return $steps->{'slot_set'}->();
+           }
+       }
+       if ($found >= 0) {
+           for my $i (0..($found-1)) {
+               $slot = @$inv[$i]->{'slot'};
+               if (!exists($params{'except_slots'}) ||
+                   !exists($params{'except_slots'}->{$slot})) {
+                   $orig_slot = $slot;
+                   return $steps->{'slot_set'}->();
+               }
+           }
+       }
+       return $self->make_error("failed", $res_cb,
+               reason => "notfound",
+               message => "all slots have been loaded");
+    };
+
+    step got_inventory_label => sub {
+       my ($err, $inv) = @_;
+       my $slot;
+       if ($err) {
+           $res_cb->($err);
+       }
+       for my $i (0.. scalar(@$inv)-1) {
+           my $slot = @$inv[$i]->{'slot'};
+           my $label = @$inv[$i]->{'label'};
+           if ($label eq $params{'label'}) {
+               $orig_slot = $slot;
+               return $steps->{'slot_set'}->();
+           }
+       }
+       return $self->make_error("failed", $res_cb,
+               reason => "notfound",
+               message => "label $params{'label'} not found");
+    };
+
+    step set_from_current => sub {
+       $orig_slot = $self->{'current_slot'};
+       return $steps->{'slot_set'}->();
+    };
+
+    step slot_set => sub {
+       my ($kid, $slot) = split(':', $orig_slot, 2);
+       my $child = $self->{'children'}[$kid];
+       if (!defined $child) {
+           return $self->make_error("failed", $res_cb,
+               reason => "invalid",
+               message => "no changer $kid");
+       }
+       delete $params{'relative_slot'};
+       $params{'slot'} = $slot;
+       $params{'res_cb'} = sub {
+           my ($err, $res) = @_;
+           if ($res) {
+               if ($slot ne "first" && $res->{'this_slot'} != $slot) {
+                   return $self->make_error("failed", $res_cb,
+                       reason => "invalid",
+                       message => "slot doesn't match: $res->{'this_slot'} != $slot");
+               } else {
+                   $self->{'current_slot'} = "$kid:$res->{'this_slot'}";
+                   $aggregate_res = Amanda::Changer::aggregate::Reservation->new($self, $res, $self->{'current_slot'});
+                   return $self->_set_current_slot($steps->{'done'});
+               }
+           }
+           return $res_cb->($err, undef);
+       };
+       return $child->load(%params);
+    };
+
+    step done => sub {
+       $res_cb->(undef, $aggregate_res);
+    };
+}
+
+sub info_key {
+    my $self = shift;
+    my ($key, %params) = @_;
+
+    return if $self->check_error($params{'info_cb'});
+
+    my $check_and_report_errors = sub {
+       my ($kid_results) = @_;
+
+       if (grep { defined($_->[0]) } @$kid_results) {
+           # we have errors, so collect them and make a "combined" error.
+           my @annotated_errs;
+           my @err_slots;
+           for my $i (0 .. $self->{'num_children'}-1) {
+               my $kr = $kid_results->[$i];
+               next unless defined($kr->[0]);
+               push @annotated_errs,
+                   [ $self->{'child_names'}[$i], $kr->[0] ];
+               push @err_slots, $kr->[0]->{'slot'}
+                   if (defined $kr->[0] and defined $kr->[0]->{'slot'});
+           }
+
+           my @slotarg;
+           if (@err_slots == $self->{'num_children'}) {
+               @slotarg = (slot => collapse_braced_alternates([@err_slots]));
+           }
+
+           $self->make_combined_error(
+               $params{'info_cb'}, [ @annotated_errs ],
+               @slotarg);
+           return 1;
+       }
+    };
+
+    if ($key eq 'num_slots') {
+       my $all_kids_done_cb = sub {
+           my ($kid_results) = @_;
+           return if ($check_and_report_errors->($kid_results));
+
+           # Sum the result
+           my $num_slots;
+           for (@$kid_results) {
+               my ($err, %kid_info) = @$_;
+               next unless exists($kid_info{'num_slots'});
+               my $kid_num_slots = $kid_info{'num_slots'};
+               $num_slots += $kid_num_slots;
+           }
+           $params{'info_cb'}->(undef, num_slots => $num_slots) if $params{'info_cb'};
+       };
+
+       $self->_for_each_child(
+           oksub => sub {
+               my ($kid_chg, $kid_cb) = @_;
+               $kid_chg->info(info => [ 'num_slots' ], info_cb => $kid_cb);
+           },
+           errsub => undef,
+           parent_cb => $all_kids_done_cb,
+       );
+    } elsif ($key eq "vendor_string") {
+       my $all_kids_done_cb = sub {
+           my ($kid_results) = @_;
+           return if ($check_and_report_errors->($kid_results));
+
+           my @kid_vendors =
+               grep { defined($_) }
+               map { my ($e, %r) = @$_; $r{'vendor_string'} }
+               @$kid_results;
+           my $vendor_string;
+           if (@kid_vendors) {
+               $vendor_string = collapse_braced_alternates([@kid_vendors]);
+               $params{'info_cb'}->(undef, vendor_string => $vendor_string) if $params{'info_cb'};
+           } else {
+               $params{'info_cb'}->(undef) if $params{'info_cb'};
+           }
+       };
+
+       $self->_for_each_child(
+           oksub => sub {
+               my ($kid_chg, $kid_cb) = @_;
+               $kid_chg->info(info => [ 'vendor_string' ], info_cb => $kid_cb);
+           },
+           errsub => undef,
+           parent_cb => $all_kids_done_cb,
+       );
+    } elsif ($key eq 'fast_search') {
+       my $all_kids_done_cb = sub {
+           my ($kid_results) = @_;
+           return if ($check_and_report_errors->($kid_results));
+
+           my @kid_fastness =
+               grep { defined($_) }
+               map { my ($e, %r) = @$_; $r{'fast_search'} }
+               @$kid_results;
+           if (@kid_fastness) {
+               my $fast_search = 1;
+               # conduct a logical AND of all child fastnesses
+               for my $f (@kid_fastness) {
+                   $fast_search = $fast_search && $f;
+               }
+               $params{'info_cb'}->(undef, fast_search => $fast_search) if $params{'info_cb'};
+           } else {
+               $params{'info_cb'}->(undef, fast_search => 0) if $params{'info_cb'};
+           }
+       };
+
+       $self->_for_each_child(
+           oksub => sub {
+               my ($kid_chg, $kid_cb) = @_;
+               $kid_chg->info(info => [ 'fast_search' ], info_cb => $kid_cb);
+           },
+           errsub => undef,
+           parent_cb => $all_kids_done_cb,
+       );
+    }
+}
+
+# reset, clean, etc. are all *very* similar to one another, so we create them
+# generically
+sub _mk_simple_op {
+    my ($op, $has_drive) = @_;
+    sub {
+       my $self = shift;
+       my %params = @_;
+
+       return if $self->check_error($params{'finished_cb'});
+
+       if (exists $params{'drive'}) {
+           return $self->make_error("failed", $params{'finished_cb'},
+                   reason => "notimpl",
+                   message => "Can't specify drive fo $op command");
+       }
+
+       my $all_kids_done_cb = sub {
+           my ($kid_results) = @_;
+           if (grep { defined($_->[0]) } @$kid_results) {
+               # we have errors, so collect them and make a "combined" error.
+               my @annotated_errs;
+               for my $i (0 .. $self->{'num_children'}-1) {
+                   my $kr = $kid_results->[$i];
+                   next unless defined($kr->[0]);
+                   push @annotated_errs,
+                       [ $self->{'child_names'}[$i], $kr->[0] ];
+               }
+               $self->make_combined_error(
+                   $params{'finished_cb'}, [ @annotated_errs ]);
+               return 1;
+           }
+           $params{'finished_cb'}->() if $params{'finished_cb'};
+       };
+
+       $self->_for_each_child(
+           oksub => sub {
+               my ($kid_chg, $kid_cb) = @_;
+               $kid_chg->$op(%params, finished_cb => $kid_cb);
+           },
+           errsub => undef,
+           parent_cb => $all_kids_done_cb,
+       );
+    };
+}
+
+{
+    # perl doesn't like that these symbols are only mentioned once
+    no warnings;
+
+    *reset = _mk_simple_op("reset");
+    *clean = _mk_simple_op("clean");
+    *eject = _mk_simple_op("eject");
+}
+
+sub update {
+    my $self = shift;
+    my %params = @_;
+    my %changed;
+    my @kid_args;
+
+    my $user_msg_fn = $params{'user_msg_fn'};
+    $user_msg_fn ||= sub { Amanda::Debug::info("chg-aggregate: " . $_[0]); };
+
+    if (exists $params{'changed'}) {
+       for my $range (split ',', $params{'changed'}) {
+           my ($first, $last) = ($range =~ /([:\d]+)(?:-([:\d]+))?/);
+           $last = $first unless defined($last);
+           if ($first =~ /:/) {
+               my ($f_kid, $f_slot) = split(':', $first, 2);
+               my ($l_kid, $l_slot) = split(':', $last, 2);
+               if ($f_kid != $l_kid) {
+                   return;
+               }
+               if ($changed{$f_kid} != 1) {
+                   for my $slot ($f_slot..$l_slot) {
+                       $changed{$f_kid}{$slot} = 1;
+                   }
+               }
+           } else {
+               for my $kid ($first..$last) {
+                   $changed{$kid} = 1;
+               }
+           }
+       }
+       for my $kid (0..$self->{'num_children'}-1) {
+           if ($changed{$kid} == 1) {
+               $kid_args[$kid] = "ALL";
+           } elsif (keys %{$changed{$kid}} > 0) {
+               $kid_args[$kid] = { changed => join(',',sort(keys %{$changed{$kid}})) };
+           } else {
+               $kid_args[$kid] = "NONE";
+           }
+       }
+    } else {
+       for my $kid (0..$self->{'num_children'}-1) {
+           $kid_args[$kid] = "ALL";
+       }
+    }
+
+    my $all_kids_done_cb = sub {
+       my ($kid_results) = @_;
+       if (grep { defined($_->[0]) } @$kid_results) {
+           # we have errors, so collect them and make a "combined" error.
+           my @annotated_errs;
+           for my $i (0 .. $self->{'num_children'}-1) {
+               my $kr = $kid_results->[$i];
+               next unless defined($kr->[0]);
+               push @annotated_errs,
+                   [ $self->{'child_names'}[$i], $kr->[0] ];
+           }
+           $self->make_combined_error(
+               $params{'finished_cb'}, [ @annotated_errs ]);
+           return 1;
+       }
+       $params{'finished_cb'}->() if $params{'finished_cb'};
+    };
+
+    $self->_for_each_child(
+       oksub => sub {
+           my ($kid_chg, $kid_cb, $args) = @_;
+           if (ref($args) eq "HASH") {
+               $kid_chg->update(%params, finished_cb => $kid_cb, %$args);
+           } elsif ($args eq "ALL") {
+               $kid_chg->update(%params, finished_cb => $kid_cb);
+           } else {
+               $kid_cb->();
+           }
+       },
+       errsub => undef,
+       parent_cb => $all_kids_done_cb,
+       args => \@kid_args,
+    );
+}
+
+sub inventory {
+    my $self = shift;
+    my %params = @_;
+
+    return if $self->check_error($params{'inventory_cb'});
+
+    my $steps = define_steps
+       cb_ref => \$params{'inventory_cb'};
+
+    step get_current => sub {
+       return $self->_get_current_slot($steps->{'got_current_slot'});
+    };
+
+    step got_current_slot => sub {
+       $self->_for_each_child(
+           oksub => sub {
+               my ($kid_chg, $kid_cb) = @_;
+               $kid_chg->inventory(inventory_cb => $kid_cb);
+           },
+           errsub => undef,
+           parent_cb => $steps->{'all_kids_done_cb'},
+       );
+    };
+
+    step all_kids_done_cb => sub {
+       my ($kid_results) = @_;
+       if (grep { defined($_->[0]) } @$kid_results) {
+           # we have errors, so collect them and make a "combined" error.
+           my @annotated_errs;
+           for my $i (0 .. $self->{'num_children'}-1) {
+               my $kr = $kid_results->[$i];
+               next unless defined($kr->[0]);
+               push @annotated_errs,
+                   [ $self->{'child_names'}[$i], $kr->[0] ];
+           }
+           return $self->make_combined_error(
+               $params{'inventory_cb'}, [ @annotated_errs ]);
+       }
+
+       my $inv = $self->_merge_inventories($kid_results);
+       if (!defined $inv) {
+           return $self->make_error("failed", $params{'inventory_cb'},
+                   reason => "notimpl",
+                   message => "could not generate consistent inventory from aggregate child changers");
+       }
+
+       $params{'inventory_cb'}->(undef, $inv);
+    };
+
+}
+
+sub set_meta_label {
+    my $self = shift;
+    my %params = @_;
+    my $state;
+
+    return if $self->check_error($params{'finished_cb'});
+
+    my $finished_cb = $params{'finished_cb'};
+    my $orig_slot = $params{'slot'};
+
+    if (!defined $params{'slot'}) {
+       return $self->make_error("failed", $finished_cb,
+           reason => "invalid",
+           message => "no 'slot' params set.");
+    }
+
+    if (!defined $params{'meta'}) {
+       return $self->make_error("failed", $finished_cb,
+           reason => "invalid",
+           message => "no 'meta' params set.");
+    }
+
+    my ($kid, $slot) = split(':', $orig_slot, 2);
+    my $child = $self->{'children'}[$kid];
+    if (!defined $child) {
+       return $self->make_error("failed", $finished_cb,
+           reason => "invalid",
+           message => "no changer $kid");
+    }
+
+    $params{'slot'} = $slot;
+    return $child->set_meta_label(%params);
+}
+
+sub get_meta_label {
+    my $self = shift;
+    my %params = @_;
+    my $state;
+
+    return if $self->check_error($params{'finished_cb'});
+
+    my $finished_cb = $params{'finished_cb'};
+    my $orig_slot = $params{'slot'};
+
+    if (!defined $params{'slot'}) {
+       return $self->make_error("failed", $finished_cb,
+           reason => "invalid",
+           message => "no 'slot' params set.");
+    }
+
+    my ($kid, $slot) = split(':', $orig_slot, 2);
+    my $child = $self->{'children'}[$kid];
+    if (!defined $child) {
+       return $self->make_error("failed", $finished_cb,
+           reason => "invalid",
+           message => "no changer $kid");
+    }
+
+    $params{'slot'} = $slot;
+    return $child->get_meta_label(%params);
+}
+
+# Takes keyword parameters 'oksub', 'errsub', 'parent_cb', and 'args'.  For
+# each child, runs $oksub (or, if the child is "ERROR", $errsub), passing it
+# the changer, an aggregating callback, and the corresponding element from
+# @$args (if specified).  The callback combines its results with the results
+# from other changers, and when all results are available, calls $parent_cb.
+#
+# This forms a kind of "AND" combinator for a parallel operation on multiple
+# changers, providing the caller with a simple collection of the results of
+# the operation. The parent_cb is called as
+#   $parent_cb->([ [ <chg_1_results> ], [ <chg_2_results> ], .. ]).
+sub _for_each_child {
+    my $self = shift;
+    my %params = @_;
+    my ($oksub, $errsub, $parent_cb, $args) =
+       ($params{'oksub'}, $params{'errsub'}, $params{'parent_cb'}, $params{'args'});
+
+    if (defined($args)) {
+       die "number of args did not match number of children"
+           unless (@$args == $self->{'num_children'});
+    } else {
+       $args = [ ( undef ) x $self->{'num_children'} ];
+    }
+
+    my $remaining = $self->{'num_children'};
+    my @results = ( undef ) x $self->{'num_children'};
+    my $maybe_done = sub {
+       return if (--$remaining);
+       $parent_cb->([ @results ]);
+    };
+
+    for my $i (0 .. $self->{'num_children'}-1) {
+       my $child = $self->{'children'}[$i];
+       my $arg = @$args? $args->[$i] : undef;
+
+       my $child_cb = sub {
+           $results[$i] = [ @_ ];
+           $maybe_done->();
+       };
+
+       if ($child eq "ERROR") {
+           if (defined $errsub) {
+               $errsub->("ERROR", $child_cb, $arg);
+           } else {
+               # no errsub; just call $child_cb directly
+               $child_cb->(undef) if $child_cb;
+           }
+       } else {
+           $oksub->($child, $child_cb, $arg) if $oksub;
+       }
+    }
+}
+
+sub _merge_inventories {
+    my $self = shift;
+    my ($kid_results) = @_;
+
+    my @combined;
+    my $nb = 0;
+    for my $kid_result (@$kid_results) {
+       my $kid_inv = $kid_result->[1];
+
+       for my $x (@$kid_inv) {
+           my $slotname = "$nb:" . $x->{'slot'};
+           my $current = $slotname eq $self->{'current_slot'};
+           push @combined, {
+                   state => $x->{'state'},
+                   device_status => $x->{'device_status'},
+                   f_type => $x->{'f_type'},
+                   label => $x->{'label'},
+                   barcode => $x->{'barcode'},
+                   reserved => $x->{'reserved'},
+                   slot => $slotname,
+                   import_export => $x->{'import_export'},
+                   loaded_in => $x->{'loaded_in'},
+                   current => $current,
+               };
+       }
+       $nb++;
+    }
+
+    return [ @combined ];
+}
+
+package Amanda::Changer::aggregate::Reservation;
+use vars qw( @ISA );
+@ISA = qw( Amanda::Changer::Reservation );
+
+sub new {
+    my $class = shift;
+    my ($chg, $kid_res, $slot) = @_;
+    my $self = Amanda::Changer::Reservation::new($class);
+
+    $self->{'chg'} = $chg;
+    $self->{'kid_res'} = $kid_res;
+    $self->{'device'} = $kid_res->{'device'};
+    $self->{'barcode'} = $kid_res->{'barcode'};
+    $self->{'this_slot'} = $slot;
+
+    return $self;
+}
+
+sub do_release {
+    my $self = shift;
+    my %params = @_;
+
+    # unref the device, for good measure
+    $self->{'device'} = undef;
+
+    $self->{'kid_res'}->release(%params);
+    $self->{'kid_res'} = undef;
+}
+
+sub get_meta_label {
+    my $self = shift;
+    my %params = @_;
+
+    $self->{'kid_res'}->get_meta_label(%params);
+}
+
+sub set_meta_label {
+    my $self = shift;
+    my %params = @_;
+
+    $self->{'kid_res'}->set_meta_label(%params);
+}
index a04fd0def83e370f2cf7d0791d7a3fe61f959f4f..5b5b3b9416aa895069d2e4ae15ec9ba9b83e7a00 100644 (file)
@@ -25,7 +25,8 @@ use vars qw( @ISA );
 
 use File::Glob qw( :glob );
 use File::Path;
-use Amanda::Config qw( :getconf );
+use File::Basename;
+use Amanda::Config qw( :getconf string_to_boolean );
 use Amanda::Debug;
 use Amanda::Changer;
 use Amanda::MainLoop;
@@ -80,11 +81,7 @@ sub new {
     my $class = shift;
     my ($config, $tpchanger) = @_;
     my ($dir) = ($tpchanger =~ /chg-disk:(.*)/);
-
-    unless (-d $dir) {
-       return Amanda::Changer->make_error("fatal", undef,
-           message => "directory '$dir' does not exist");
-    }
+    my $properties = $config->{'properties'};
 
     # note that we don't track outstanding Reservation objects -- we know
     # they're gone when they delete their drive directory
@@ -93,15 +90,48 @@ sub new {
        config => $config,
        state_filename => "$dir/state",
 
+       # list of all reservations
+       reservation => {},
+
        # this is set to 0 by various test scripts,
        # notably Amanda_Taper_Scan_traditional
        support_fast_search => 1,
     };
 
     bless ($self, $class);
+
+    $self->{'num-slot'} = $config->get_property('num-slot');
+    $self->{'auto-create-slot'} = $config->get_boolean_property(
+                                       'auto-create-slot', 0);
+    $self->{'removable'} = $config->get_boolean_property('removable', 0);
+    $self->{'mount'} = $config->get_boolean_property('mount', 0);
+    $self->{'umount'} = $config->get_boolean_property('umount', 0);
+    $self->{'umount_lockfile'} = $config->get_property('umount-lockfile');
+    $self->{'umount_idle'} = $config->get_property('umount-idle');
+    if (defined $self->{'umount_lockfile'}) {
+       $self->{'fl'} = Amanda::Util::file_lock->new($self->{'umount_lockfile'})
+    }
+
+    $self->_validate();
+    return $self->{'fatal_error'} if defined $self->{'fatal_error'};
+
     return $self;
 }
 
+sub DESTROY {
+    my $self = shift;
+
+    $self->SUPER::DESTROY();
+}
+
+sub quit {
+    my $self = shift;
+
+    $self->force_unlock();
+    delete $self->{'fl'};
+    $self->SUPER::quit();
+}
+
 sub load {
     my $self = shift;
     my %params = @_;
@@ -112,8 +142,7 @@ sub load {
 
     return if $self->check_error($params{'res_cb'});
 
-    $self->with_locked_state($self->{'state_filename'},
-                                    $params{'res_cb'}, sub {
+    $self->with_disk_locked_state($params{'res_cb'}, sub {
        my ($state, $res_cb) = @_;
        $params{'state'} = $state;
 
@@ -132,21 +161,34 @@ sub info_key {
     my $self = shift;
     my ($key, %params) = @_;
     my %results;
+    my $info_cb = $params{'info_cb'};
 
-    return if $self->check_error($params{'info_cb'});
+    return if $self->check_error($info_cb);
 
-    # no need for synchronization -- all of these values are static
+    my $steps = define_steps
+       cb_ref => \$info_cb;
 
-    if ($key eq 'num_slots') {
-       my @slots = $self->_all_slots();
-       $results{$key} = scalar @slots;
-    } elsif ($key eq 'vendor_string') {
-       $results{$key} = 'chg-disk'; # mostly just for testing
-    } elsif ($key eq 'fast_search') {
-       $results{$key} = $self->{'support_fast_search'};
-    }
+    step init => sub {
+       $self->try_lock($steps->{'locked'});
+    };
+
+    step locked => sub {
+       return if $self->check_error($info_cb);
+
+       # no need for synchronization -- all of these values are static
+
+       if ($key eq 'num_slots') {
+           my @slots = $self->_all_slots();
+           $results{$key} = scalar @slots;
+       } elsif ($key eq 'vendor_string') {
+           $results{$key} = 'chg-disk'; # mostly just for testing
+       } elsif ($key eq 'fast_search') {
+           $results{$key} = $self->{'support_fast_search'};
+       }
 
-    $params{'info_cb'}->(undef, %results) if $params{'info_cb'};
+       $self->try_unlock();
+       $info_cb->(undef, %results) if $info_cb;
+    }
 }
 
 sub reset {
@@ -157,8 +199,7 @@ sub reset {
 
     return if $self->check_error($params{'finished_cb'});
 
-    $self->with_locked_state($self->{'state_filename'},
-                                    $params{'finished_cb'}, sub {
+    $self->with_disk_locked_state($params{'finished_cb'}, sub {
        my ($state, $finished_cb) = @_;
 
        $slot = (scalar @slots)? $slots[0] : 0;
@@ -174,13 +215,11 @@ sub inventory {
 
     return if $self->check_error($params{'inventory_cb'});
 
-    my @slots = $self->_all_slots();
-
-    $self->with_locked_state($self->{'state_filename'},
-                            $params{'inventory_cb'}, sub {
+    $self->with_disk_locked_state($params{'inventory_cb'}, sub {
        my ($state, $finished_cb) = @_;
        my @inventory;
 
+       my @slots = $self->_all_slots();
        my $current = $self->_get_current();
        for my $slot (@slots) {
            my $s = { slot => $slot, state => Amanda::Changer::SLOT_FULL };
@@ -202,6 +241,54 @@ sub inventory {
     });
 }
 
+sub set_meta_label {
+    my $self = shift;
+    my %params = @_;
+
+    return if $self->check_error($params{'finished_cb'});
+
+    $self->with_disk_locked_state($params{'finished_cb'}, sub {
+       my ($state, $finished_cb) = @_;
+
+       $state->{'meta'} = $params{'meta'};
+       $finished_cb->(undef);
+    });
+}
+
+sub with_disk_locked_state {
+    my $self = shift;
+    my ($cb, $sub) = @_;
+
+    my $steps = define_steps
+       cb_ref => \$cb;
+
+    step init => sub {
+       $self->try_lock($steps->{'locked'});
+    };
+
+    step locked => sub {
+       $self->with_locked_state($self->{'state_filename'},
+           sub { my @args = @_;
+                 $self->try_unlock();
+                 $cb->(@args);
+               },
+           $sub);
+    };
+}
+
+sub get_meta_label {
+    my $self = shift;
+    my %params = @_;
+
+    return if $self->check_error($params{'finished_cb'});
+
+    $self->with_disk_locked_state($params{'finished_cb'}, sub {
+       my ($state, $finished_cb) = @_;
+
+       $finished_cb->(undef, $state->{'meta'});
+    });
+}
+
 sub _load_by_slot {
     my $self = shift;
     my %params = @_;
@@ -487,7 +574,7 @@ sub _set_current {
     my ($self, $slot) = @_;
     my $curlink = $self->{'dir'} . "/data";
 
-    if (-e $curlink) {
+    if (-l $curlink or -e $curlink) {
         unlink($curlink)
             or warn("Could not unlink '$curlink'");
     }
@@ -503,6 +590,172 @@ sub _quote_glob {
     return $filename;
 }
 
+sub _validate() {
+    my $self = shift;
+    my $dir = $self->{'dir'};
+
+    unless (-d $dir) {
+       $self->{'fatal_error'} = Amanda::Changer->make_error("fatal", undef,
+           message => "directory '$dir' does not exist");
+       return;
+    }
+
+    if ($self->{'removable'}) {
+       my ($dev, $ino) = stat $dir;
+       my $parentdir = dirname $dir;
+       my ($pdev, $pino) = stat $parentdir;
+       if ($dev == $pdev) {
+           if ($self->{'mount'}) {
+               system $Amanda::Constants::MOUNT, $dir;
+               ($dev, $ino) = stat $dir;
+           }
+       }
+       if ($dev == $pdev) {
+           $self->{'fatal_error'} = Amanda::Changer->make_error("fatal", undef,
+               message => "No removable disk mounted on '$dir'");
+           return;
+       }
+    }
+
+    if ($self->{'num-slot'}) {
+       for my $i (1..$self->{'num-slot'}) {
+           my $slot_dir = "$dir/slot$i";
+           if (!-e $slot_dir) {
+               if ($self->{'auto-create-slot'}) {
+                   if (!mkdir ($slot_dir)) {
+                       $self->{'fatal_error'} = Amanda::Changer->make_error("fatal", undef,
+                           message => "Can't create '$slot_dir': $!");
+                       return;
+                   }
+               } else {
+                   $self->{'fatal_error'} = Amanda::Changer->make_error("fatal", undef,
+                       message => "slot $i doesn't exists '$slot_dir'");
+                   return;
+               }
+           }
+       }
+    } else {
+       if ($self->{'auto-create-slot'}) {
+           $self->{'fatal_error'} = Amanda::Changer->make_error("fatal", undef,
+               message => "property 'auto-create-slot' set but property 'num-slot' is not set");
+           return;
+       }
+    }
+}
+
+sub try_lock {
+    my $self = shift;
+    my $cb = shift;
+    my $poll = 0; # first delay will be 0.1s; see below
+
+    my $steps = define_steps
+       cb_ref => \$cb;
+
+    step init => sub {
+       if ($self->{'mount'} && defined $self->{'fl'} &&
+           !$self->{'fl'}->locked()) {
+           return $steps->{'lock'}->();
+       }
+       $steps->{'done'}->();
+    };
+
+    step lock => sub {
+       my $rv = $self->{'fl'}->lock_rd();
+       if ($rv == 1) {
+           # loop until we get the lock, increasing $poll to 10s
+           $poll += 100 unless $poll >= 10000;
+           return Amanda::MainLoop::call_after($poll, $steps->{'lock'});
+       } elsif ($rv == -1) {
+           return $self->make_error("fatal", $cb,
+               message => "Error locking '$self->{'umount_lockfile'}'");
+       } elsif ($rv == 0) {
+           if (defined $self->{'umount_src'}) {
+               $self->{'umount_src'}->remove();
+               $self->{'umount_src'} = undef;
+           }
+           return $steps->{'done'}->();
+       }
+    };
+
+    step done => sub {
+       $self->_validate();
+       $cb->();
+    };
+
+}
+
+sub try_umount {
+    my $self = shift;
+
+    my $dir = $self->{'dir'};
+    if ($self->{'removable'} && $self->{'umount'}) {
+       my ($dev, $ino) = stat $dir;
+       my $parentdir = dirname $dir;
+       my ($pdev, $pino) = stat $parentdir;
+       if ($dev != $pdev) {
+           system $Amanda::Constants::UMOUNT, $dir;
+       }
+    }
+}
+
+sub force_unlock {
+    my $self = shift;
+
+    if (keys( %{$self->{'reservation'}}) == 0 ) {
+       if ($self->{'fl'}) {
+           if ($self->{'fl'}->locked()) {
+               $self->{'fl'}->unlock();
+           }
+           if ($self->{'umount'}) {
+               if (defined $self->{'umount_src'}) {
+                   $self->{'umount_src'}->remove();
+                   $self->{'umount_src'} = undef;
+               }
+               if ($self->{'fl'}->lock_wr() == 0) {
+                   $self->try_umount();
+                   $self->{'fl'}->unlock();
+               }
+           }
+       }
+    }
+}
+
+sub try_unlock {
+    my $self = shift;
+
+    my $do_umount = sub {
+       local $?;
+
+       $self->{'umount_src'} = undef;
+       if ($self->{'fl'}->lock_wr() == 0) {
+           $self->try_umount();
+           $self->{'fl'}->unlock();
+       }
+    };
+
+    if (defined $self->{'umount_idle'}) {
+       if ($self->{'umount_idle'} == 0) {
+           return $self->force_unlock();
+       }
+       if (defined $self->{'fl'}) {
+           if (keys( %{$self->{'reservation'}}) == 0 ) {
+               if ($self->{'fl'}->locked()) {
+                   $self->{'fl'}->unlock();
+               }
+               if ($self->{'umount'}) {
+                   if (defined $self->{'umount_src'}) {
+                       $self->{'umount_src'}->remove();
+                       $self->{'umount_src'} = undef;
+                   }
+                   $self->{'umount_src'} = Amanda::MainLoop::call_after(
+                                               0+$self->{'umount_idle'},
+                                               $do_umount);
+               }
+           }
+       }
+    }
+}
+
 package Amanda::Changer::disk::Reservation;
 use vars qw( @ISA );
 @ISA = qw( Amanda::Changer::Reservation );
@@ -518,6 +771,7 @@ sub new {
     $self->{'device'} = $device;
     $self->{'this_slot'} = $slot;
 
+    $self->{'chg'}->{'reservation'}->{$slot} += 1;
     return $self;
 }
 
@@ -533,15 +787,26 @@ sub do_release {
 
     # unref the device, for good measure
     $self->{'device'} = undef;
+    my $slot = $self->{'this_slot'};
+
+    my $finish = sub {
+       $self->{'chg'}->{'reservation'}->{$slot} -= 1;
+       delete $self->{'chg'}->{'reservation'}->{$slot} if
+               $self->{'chg'}->{'reservation'}->{$slot} == 0;
+       $self->{'chg'}->try_unlock();
+       delete $self->{'chg'};
+       $self = undef;
+       return $params{'finished_cb'}->();
+    };
 
     if (exists $params{'unlocked'}) {
         my $state = $params{state};
        delete $state->{drives}->{$drive}->{pid};
-        return $params{'finished_cb'}->();
+       return $finish->();
     }
 
     $self->{chg}->with_locked_state($self->{chg}->{'state_filename'},
-                                   $params{'finished_cb'}, sub {
+                                   $finish, sub {
        my ($state, $finished_cb) = @_;
 
        delete $state->{drives}->{$drive}->{pid};
@@ -549,3 +814,19 @@ sub do_release {
        $finished_cb->();
     });
 }
+
+sub get_meta_label {
+    my $self = shift;
+    my %params = @_;
+
+    $params{'slot'} = $self->{'this_slot'};
+    $self->{'chg'}->get_meta_label(%params);
+}
+
+sub set_meta_label {
+    my $self = shift;
+    my %params = @_;
+
+    $params{'slot'} = $self->{'this_slot'};
+    $self->{'chg'}->set_meta_label(%params);
+}
index 5a8a0c9c99aef1086c4ef43d3713961b8cd7e55e..26486bc495ce99d5e9c0a92feccb55cf8e2b8e75 100644 (file)
@@ -64,8 +64,12 @@ sub new {
        my @annotated_errs;
        for my $i (0 .. @children-1) {
            next unless $children[$i]->isa("Amanda::Changer::Error");
-           push @annotated_errs,
-               [ $kidspecs[$i], $children[$i] ];
+           if ($children[$i]->isa("Amanda::Changer::Error")) {
+               push @annotated_errs,
+                   [ $kidspecs[$i], $children[$i] ];
+           } elsif ($children[$i]->isa("Amanda::Changer")) {
+               $children[$i]->quit();
+           }
        }
        return Amanda::Changer->make_combined_error(
                "fatal", [ @annotated_errs ]);
@@ -81,6 +85,17 @@ sub new {
     return $self;
 }
 
+sub quit {
+    my $self = shift;
+
+    # quit each child
+    foreach my $child (@{$self->{'children'}}) {
+       $child->quit() if $child ne "ERROR";
+    }
+
+    $self->SUPER::quit();
+}
+
 # private method to help handle slot input
 sub _kid_slots_ok {
     my ($self, $res_cb, $slot, $kid_slots_ref, $err_ref) = @_;
index 924b2101b2ca6cf5fbcaa2de72ab1b15f6b10e7d..aa53f982ada680ea2e30e11daa68391529659c9b 100644 (file)
@@ -193,7 +193,7 @@ sub new {
     }
 
     # eject-before-unload
-    my $ebu = $self->get_boolean_property($self->{'config'},
+    my $ebu = $self->{'config'}->get_boolean_property(
                                            "eject-before-unload", 0);
     if (!defined $ebu) {
        return Amanda::Changer->make_error("fatal", undef,
@@ -202,7 +202,7 @@ sub new {
     $self->{'eject_before_unload'} = $ebu;
 
     # fast-search
-    my $fast_search = $self->get_boolean_property($self->{'config'},
+    my $fast_search = $self->{'config'}->get_boolean_property(
                                                "fast-search", 1);
     if (!defined $fast_search) {
        return Amanda::Changer->make_error("fatal", undef,
@@ -287,7 +287,7 @@ sub new {
        $self->{$key} = $time;
     }
 
-    my $ignore_barcodes = $self->get_boolean_property($self->{'config'},
+    my $ignore_barcodes = $self->{'config'}->get_boolean_property(
                                            "ignore-barcodes", 0);
     if (!defined $ignore_barcodes) {
        return Amanda::Changer->make_error("fatal", undef,
@@ -416,7 +416,7 @@ sub load_unlocked {
 
        if ($state->{'slots'}->{$slot}->{'state'} eq Amanda::Changer::SLOT_EMPTY) {
            return $self->make_error("failed", $params{'res_cb'},
-                   reason => "notfound",
+                   reason => "empty",
                    message => "slot $slot is empty");
        }
 
index 2725aa9d44298ecad72e13c0e1a0a2c20a201cf9..dbc4f7aeb84fa971f0b236fafe428557346eead2 100644 (file)
@@ -1487,14 +1487,16 @@ SWIG_Perl_SetModule(swig_module_info *module) {
 #define SWIGTYPE_p_float swig_types[7]
 #define SWIGTYPE_p_holdingdisk_t swig_types[8]
 #define SWIGTYPE_p_int swig_types[9]
-#define SWIGTYPE_p_interface_t swig_types[10]
-#define SWIGTYPE_p_p_GSList swig_types[11]
-#define SWIGTYPE_p_p_char swig_types[12]
-#define SWIGTYPE_p_pp_script_t swig_types[13]
-#define SWIGTYPE_p_tapetype_t swig_types[14]
-#define SWIGTYPE_p_unsigned_char swig_types[15]
-static swig_type_info *swig_types[17];
-static swig_module_info swig_module = {swig_types, 16, 0, 0, 0, 0};
+#define SWIGTYPE_p_interactivity_t swig_types[10]
+#define SWIGTYPE_p_interface_t swig_types[11]
+#define SWIGTYPE_p_p_GSList swig_types[12]
+#define SWIGTYPE_p_p_char swig_types[13]
+#define SWIGTYPE_p_pp_script_t swig_types[14]
+#define SWIGTYPE_p_taperscan_t swig_types[15]
+#define SWIGTYPE_p_tapetype_t swig_types[16]
+#define SWIGTYPE_p_unsigned_char swig_types[17]
+static swig_type_info *swig_types[19];
+static swig_module_info swig_module = {swig_types, 18, 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)
 
@@ -1635,6 +1637,7 @@ val_t_to_sv(val_t *val, SV **results) {
                return 1;
 
            case CONFTYPE_BOOLEAN:          /* all same as INT.. */
+           case CONFTYPE_NO_YES_ALL:
            case CONFTYPE_COMPRESS:
            case CONFTYPE_ENCRYPT:
            case CONFTYPE_STRATEGY:
@@ -1688,14 +1691,16 @@ val_t_to_sv(val_t *val, SV **results) {
                return 1;
            }
 
-           case CONFTYPE_RECOVERY_LIMIT: {
+           case CONFTYPE_HOST_LIMIT: {
                AV *av;
                GSList *iter;
-               recovery_limit_t *rl = &val_t__recovery_limit(val);
+               host_limit_t *rl = &val_t__host_limit(val);
 
                av = newAV();
                if (rl->same_host)
-                   av_push(av, &PL_sv_undef);
+                   av_push(av, newSVpv("SAMEHOST-SAMEHOST-SAMEHOST", 0));
+               if (rl->server)
+                   av_push(av, newSVpv("SERVER-SERVER-SERVER", 0));
                for (iter=rl->match_pats; iter != NULL; iter = iter->next) {
                    av_push(av, newSVpv((char *)iter->data, 0));
                }
@@ -4007,6 +4012,336 @@ XS(_wrap_changer_config_seen) {
 }
 
 
+XS(_wrap_lookup_interactivity) {
+  {
+    char *arg1 = (char *) 0 ;
+    int res1 ;
+    char *buf1 = 0 ;
+    int alloc1 = 0 ;
+    int argvi = 0;
+    interactivity_t *result = 0 ;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: lookup_interactivity(identifier);");
+    }
+    res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "lookup_interactivity" "', argument " "1"" of type '" "char *""'");
+    }
+    arg1 = (char *)(buf1);
+    result = (interactivity_t *)lookup_interactivity(arg1);
+    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_interactivity_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_interactivity_getconf) {
+  {
+    interactivity_t *arg1 = (interactivity_t *) 0 ;
+    interactivity_key arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    val_t *result = 0 ;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: interactivity_getconf(app,key);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_interactivity_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "interactivity_getconf" "', argument " "1"" of type '" "interactivity_t *""'"); 
+    }
+    arg1 = (interactivity_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 *)interactivity_getconf(arg1,arg2);
+    {
+      SV *results[3], **iter;
+      int nresults;
+      
+      /* save the stack, since val_t_to_sv may invoke arbitrary Perl code */
+      SP += argvi; PUTBACK;
+      nresults = val_t_to_sv(result, results);
+      SPAGAIN; SP -= argvi;
+      
+      /* add val_t_to_sv's results to the stack */
+      for (iter = results; nresults; iter++, nresults--) {
+        ST(argvi) = *iter;
+        argvi++;
+      }
+    }
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_interactivity_name) {
+  {
+    interactivity_t *arg1 = (interactivity_t *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    char *result = 0 ;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: interactivity_name(app);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_interactivity_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "interactivity_name" "', argument " "1"" of type '" "interactivity_t *""'"); 
+    }
+    arg1 = (interactivity_t *)(argp1);
+    result = (char *)interactivity_name(arg1);
+    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_interactivity_seen) {
+  {
+    interactivity_t *arg1 = (interactivity_t *) 0 ;
+    interactivity_key arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    gboolean result;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: interactivity_seen(app,key);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_interactivity_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "interactivity_seen" "', argument " "1"" of type '" "interactivity_t *""'"); 
+    }
+    arg1 = (interactivity_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)interactivity_seen(arg1,arg2);
+    {
+      if (result)
+      ST(argvi) = &PL_sv_yes;
+      else
+      ST(argvi) = &PL_sv_no;
+      argvi++;
+    }
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_lookup_taperscan) {
+  {
+    char *arg1 = (char *) 0 ;
+    int res1 ;
+    char *buf1 = 0 ;
+    int alloc1 = 0 ;
+    int argvi = 0;
+    taperscan_t *result = 0 ;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: lookup_taperscan(identifier);");
+    }
+    res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "lookup_taperscan" "', argument " "1"" of type '" "char *""'");
+    }
+    arg1 = (char *)(buf1);
+    result = (taperscan_t *)lookup_taperscan(arg1);
+    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_taperscan_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_taperscan_getconf) {
+  {
+    taperscan_t *arg1 = (taperscan_t *) 0 ;
+    taperscan_key arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    val_t *result = 0 ;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: taperscan_getconf(app,key);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_taperscan_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "taperscan_getconf" "', argument " "1"" of type '" "taperscan_t *""'"); 
+    }
+    arg1 = (taperscan_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 *)taperscan_getconf(arg1,arg2);
+    {
+      SV *results[3], **iter;
+      int nresults;
+      
+      /* save the stack, since val_t_to_sv may invoke arbitrary Perl code */
+      SP += argvi; PUTBACK;
+      nresults = val_t_to_sv(result, results);
+      SPAGAIN; SP -= argvi;
+      
+      /* add val_t_to_sv's results to the stack */
+      for (iter = results; nresults; iter++, nresults--) {
+        ST(argvi) = *iter;
+        argvi++;
+      }
+    }
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_taperscan_name) {
+  {
+    taperscan_t *arg1 = (taperscan_t *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    char *result = 0 ;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: taperscan_name(app);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_taperscan_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "taperscan_name" "', argument " "1"" of type '" "taperscan_t *""'"); 
+    }
+    arg1 = (taperscan_t *)(argp1);
+    result = (char *)taperscan_name(arg1);
+    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_taperscan_seen) {
+  {
+    taperscan_t *arg1 = (taperscan_t *) 0 ;
+    taperscan_key arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    gboolean result;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: taperscan_seen(app,key);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_taperscan_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "taperscan_seen" "', argument " "1"" of type '" "taperscan_t *""'"); 
+    }
+    arg1 = (taperscan_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)taperscan_seen(arg1,arg2);
+    {
+      if (result)
+      ST(argvi) = &PL_sv_yes;
+      else
+      ST(argvi) = &PL_sv_no;
+      argvi++;
+    }
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
 XS(_wrap_getconf_unit_divisor) {
   {
     int argvi = 0;
@@ -4634,11 +4969,13 @@ static swig_type_info _swigt__p_double = {"_p_double", "double *|gdouble *", 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", "application_key *|strategy_t *|pp_script_key *|int *|autolabel_enum_t *|comp_t *|dump_holdingdisk_t *|device_config_key *|changer_config_key *|confparm_key *|interface_key *|holdingdisk_key *|dumptype_key *|tapetype_key *|part_cache_type_t *|cfgerr_level_t *|encrypt_t *|taperalgo_t *|gboolean *|data_path_t *|execute_on_t *|send_amreport_on_t *|estimate_t *|config_init_flags *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_int = {"_p_int", "taperscan_key *|application_key *|strategy_t *|pp_script_key *|int *|autolabel_enum_t *|comp_t *|dump_holdingdisk_t *|changer_config_key *|confparm_key *|interface_key *|device_config_key *|holdingdisk_key *|dumptype_key *|tapetype_key *|interactivity_key *|part_cache_type_t *|cfgerr_level_t *|encrypt_t *|taperalgo_t *|gboolean *|data_path_t *|execute_on_t *|send_amreport_on_t *|estimate_t *|config_init_flags *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_interactivity_t = {"_p_interactivity_t", "interactivity_t *", 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_GSList = {"_p_p_GSList", "GSList **", 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_pp_script_t = {"_p_pp_script_t", "pp_script_t *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_taperscan_t = {"_p_taperscan_t", "taperscan_t *", 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};
 
@@ -4653,10 +4990,12 @@ static swig_type_info *swig_type_initial[] = {
   &_swigt__p_float,
   &_swigt__p_holdingdisk_t,
   &_swigt__p_int,
+  &_swigt__p_interactivity_t,
   &_swigt__p_interface_t,
   &_swigt__p_p_GSList,
   &_swigt__p_p_char,
   &_swigt__p_pp_script_t,
+  &_swigt__p_taperscan_t,
   &_swigt__p_tapetype_t,
   &_swigt__p_unsigned_char,
 };
@@ -4671,10 +5010,12 @@ static swig_cast_info _swigc__p_dumptype_t[] = {  {&_swigt__p_dumptype_t, 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_interactivity_t[] = {  {&_swigt__p_interactivity_t, 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_GSList[] = {  {&_swigt__p_p_GSList, 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_pp_script_t[] = {  {&_swigt__p_pp_script_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_taperscan_t[] = {  {&_swigt__p_taperscan_t, 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}};
 
@@ -4689,10 +5030,12 @@ static swig_cast_info *swig_cast_initial[] = {
   _swigc__p_float,
   _swigc__p_holdingdisk_t,
   _swigc__p_int,
+  _swigc__p_interactivity_t,
   _swigc__p_interface_t,
   _swigc__p_p_GSList,
   _swigc__p_p_char,
   _swigc__p_pp_script_t,
+  _swigc__p_taperscan_t,
   _swigc__p_tapetype_t,
   _swigc__p_unsigned_char,
 };
@@ -4767,6 +5110,14 @@ static swig_command_info swig_commands[] = {
 {"Amanda::Configc::changer_config_getconf", _wrap_changer_config_getconf},
 {"Amanda::Configc::changer_config_name", _wrap_changer_config_name},
 {"Amanda::Configc::changer_config_seen", _wrap_changer_config_seen},
+{"Amanda::Configc::lookup_interactivity", _wrap_lookup_interactivity},
+{"Amanda::Configc::interactivity_getconf", _wrap_interactivity_getconf},
+{"Amanda::Configc::interactivity_name", _wrap_interactivity_name},
+{"Amanda::Configc::interactivity_seen", _wrap_interactivity_seen},
+{"Amanda::Configc::lookup_taperscan", _wrap_lookup_taperscan},
+{"Amanda::Configc::taperscan_getconf", _wrap_taperscan_getconf},
+{"Amanda::Configc::taperscan_name", _wrap_taperscan_name},
+{"Amanda::Configc::taperscan_seen", _wrap_taperscan_seen},
 {"Amanda::Configc::getconf_unit_divisor", _wrap_getconf_unit_divisor},
 {"Amanda::Configc::config_init", _wrap_config_init},
 {"Amanda::Configc::config_uninit", _wrap_config_uninit},
@@ -5092,6 +5443,11 @@ XS(SWIG_init) {
     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.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_AMDUMP_SERVER", TRUE | 0x2 | GV_ADDMULTI);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_AMDUMP_SERVER)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
   /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "CNF_INDEX_SERVER", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_INDEX_SERVER)));
@@ -5187,6 +5543,11 @@ XS(SWIG_init) {
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_AUTOLABEL)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_META_AUTOLABEL", TRUE | 0x2 | GV_ADDMULTI);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_META_AUTOLABEL)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
   /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "CNF_TAPELIST", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_TAPELIST)));
@@ -5522,6 +5883,16 @@ XS(SWIG_init) {
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_RECOVERY_LIMIT)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_INTERACTIVITY", TRUE | 0x2 | GV_ADDMULTI);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_INTERACTIVITY)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "CNF_TAPERSCAN", TRUE | 0x2 | GV_ADDMULTI);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CNF_TAPERSCAN)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
   /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "TAPETYPE_COMMENT", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(TAPETYPE_COMMENT)));
@@ -5802,6 +6173,11 @@ XS(SWIG_init) {
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_RECOVERY_LIMIT)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "DUMPTYPE_DUMP_LIMIT", TRUE | 0x2 | GV_ADDMULTI);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DUMPTYPE_DUMP_LIMIT)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
   /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "INTER_COMMENT", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(INTER_COMMENT)));
@@ -5847,6 +6223,11 @@ XS(SWIG_init) {
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(APPLICATION_PROPERTY)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "APPLICATION_CLIENT_NAME", TRUE | 0x2 | GV_ADDMULTI);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(APPLICATION_CLIENT_NAME)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
   /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "PP_SCRIPT_COMMENT", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PP_SCRIPT_COMMENT)));
@@ -5877,6 +6258,16 @@ XS(SWIG_init) {
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PP_SCRIPT_ORDER)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "PP_SCRIPT_SINGLE_EXECUTION", TRUE | 0x2 | GV_ADDMULTI);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PP_SCRIPT_SINGLE_EXECUTION)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "PP_SCRIPT_CLIENT_NAME", TRUE | 0x2 | GV_ADDMULTI);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(PP_SCRIPT_CLIENT_NAME)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
   /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "DEVICE_CONFIG_COMMENT", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(DEVICE_CONFIG_COMMENT)));
@@ -5927,6 +6318,36 @@ XS(SWIG_init) {
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(CHANGER_CONFIG_DEVICE_PROPERTY)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "INTERACTIVITY_COMMENT", TRUE | 0x2 | GV_ADDMULTI);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(INTERACTIVITY_COMMENT)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "INTERACTIVITY_PLUGIN", TRUE | 0x2 | GV_ADDMULTI);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(INTERACTIVITY_PLUGIN)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "INTERACTIVITY_PROPERTY", TRUE | 0x2 | GV_ADDMULTI);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(INTERACTIVITY_PROPERTY)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "TAPERSCAN_COMMENT", TRUE | 0x2 | GV_ADDMULTI);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(TAPERSCAN_COMMENT)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "TAPERSCAN_PLUGIN", TRUE | 0x2 | GV_ADDMULTI);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(TAPERSCAN_PLUGIN)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "TAPERSCAN_PROPERTY", TRUE | 0x2 | GV_ADDMULTI);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(TAPERSCAN_PROPERTY)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
   /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "HOLD_NEVER", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(HOLD_NEVER)));
@@ -6097,6 +6518,11 @@ XS(SWIG_init) {
     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.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "EXECUTE_ON_PRE_AMCHECK", TRUE | 0x2 | GV_ADDMULTI);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(EXECUTE_ON_PRE_AMCHECK)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
   /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "EXECUTE_ON_PRE_DLE_AMCHECK", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(EXECUTE_ON_PRE_DLE_AMCHECK)));
@@ -6107,6 +6533,11 @@ XS(SWIG_init) {
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(EXECUTE_ON_PRE_HOST_AMCHECK)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "EXECUTE_ON_POST_AMCHECK", TRUE | 0x2 | GV_ADDMULTI);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(EXECUTE_ON_POST_AMCHECK)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
   /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "EXECUTE_ON_POST_DLE_AMCHECK", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(EXECUTE_ON_POST_DLE_AMCHECK)));
@@ -6117,6 +6548,11 @@ XS(SWIG_init) {
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(EXECUTE_ON_POST_HOST_AMCHECK)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "EXECUTE_ON_PRE_ESTIMATE", TRUE | 0x2 | GV_ADDMULTI);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(EXECUTE_ON_PRE_ESTIMATE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
   /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "EXECUTE_ON_PRE_DLE_ESTIMATE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(EXECUTE_ON_PRE_DLE_ESTIMATE)));
@@ -6127,6 +6563,11 @@ XS(SWIG_init) {
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(EXECUTE_ON_PRE_HOST_ESTIMATE)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "EXECUTE_ON_POST_ESTIMATE", TRUE | 0x2 | GV_ADDMULTI);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(EXECUTE_ON_POST_ESTIMATE)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
   /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "EXECUTE_ON_POST_DLE_ESTIMATE", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(EXECUTE_ON_POST_DLE_ESTIMATE)));
@@ -6137,6 +6578,11 @@ XS(SWIG_init) {
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(EXECUTE_ON_POST_HOST_ESTIMATE)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "EXECUTE_ON_PRE_BACKUP", TRUE | 0x2 | GV_ADDMULTI);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(EXECUTE_ON_PRE_BACKUP)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
   /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "EXECUTE_ON_PRE_DLE_BACKUP", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(EXECUTE_ON_PRE_DLE_BACKUP)));
@@ -6147,6 +6593,11 @@ XS(SWIG_init) {
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(EXECUTE_ON_PRE_HOST_BACKUP)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "EXECUTE_ON_POST_BACKUP", TRUE | 0x2 | GV_ADDMULTI);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(EXECUTE_ON_POST_BACKUP)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
   /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "EXECUTE_ON_POST_DLE_BACKUP", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(EXECUTE_ON_POST_DLE_BACKUP)));
index f4ce4d7787f82d4768a7b2ee394ae3d6a07dc1f9..d76971cc959503c0982ca842147f8ed2bf45b439 100644 (file)
@@ -89,6 +89,14 @@ package Amanda::Config;
 *changer_config_getconf = *Amanda::Configc::changer_config_getconf;
 *changer_config_name = *Amanda::Configc::changer_config_name;
 *changer_config_seen = *Amanda::Configc::changer_config_seen;
+*lookup_interactivity = *Amanda::Configc::lookup_interactivity;
+*interactivity_getconf = *Amanda::Configc::interactivity_getconf;
+*interactivity_name = *Amanda::Configc::interactivity_name;
+*interactivity_seen = *Amanda::Configc::interactivity_seen;
+*lookup_taperscan = *Amanda::Configc::lookup_taperscan;
+*taperscan_getconf = *Amanda::Configc::taperscan_getconf;
+*taperscan_name = *Amanda::Configc::taperscan_name;
+*taperscan_seen = *Amanda::Configc::taperscan_seen;
 *getconf_unit_divisor = *Amanda::Configc::getconf_unit_divisor;
 *config_init = *Amanda::Configc::config_init;
 *config_uninit = *Amanda::Configc::config_uninit;
@@ -117,6 +125,7 @@ package Amanda::Config;
 
 *CNF_ORG = *Amanda::Configc::CNF_ORG;
 *CNF_CONF = *Amanda::Configc::CNF_CONF;
+*CNF_AMDUMP_SERVER = *Amanda::Configc::CNF_AMDUMP_SERVER;
 *CNF_INDEX_SERVER = *Amanda::Configc::CNF_INDEX_SERVER;
 *CNF_TAPE_SERVER = *Amanda::Configc::CNF_TAPE_SERVER;
 *CNF_AUTH = *Amanda::Configc::CNF_AUTH;
@@ -136,6 +145,7 @@ package Amanda::Config;
 *CNF_CHANGERFILE = *Amanda::Configc::CNF_CHANGERFILE;
 *CNF_LABELSTR = *Amanda::Configc::CNF_LABELSTR;
 *CNF_AUTOLABEL = *Amanda::Configc::CNF_AUTOLABEL;
+*CNF_META_AUTOLABEL = *Amanda::Configc::CNF_META_AUTOLABEL;
 *CNF_TAPELIST = *Amanda::Configc::CNF_TAPELIST;
 *CNF_DISKFILE = *Amanda::Configc::CNF_DISKFILE;
 *CNF_INFOFILE = *Amanda::Configc::CNF_INFOFILE;
@@ -203,6 +213,8 @@ package Amanda::Config;
 *CNF_SEND_AMREPORT_ON = *Amanda::Configc::CNF_SEND_AMREPORT_ON;
 *CNF_TAPER_PARALLEL_WRITE = *Amanda::Configc::CNF_TAPER_PARALLEL_WRITE;
 *CNF_RECOVERY_LIMIT = *Amanda::Configc::CNF_RECOVERY_LIMIT;
+*CNF_INTERACTIVITY = *Amanda::Configc::CNF_INTERACTIVITY;
+*CNF_TAPERSCAN = *Amanda::Configc::CNF_TAPERSCAN;
 *TAPETYPE_COMMENT = *Amanda::Configc::TAPETYPE_COMMENT;
 *TAPETYPE_LBL_TEMPL = *Amanda::Configc::TAPETYPE_LBL_TEMPL;
 *TAPETYPE_BLOCKSIZE = *Amanda::Configc::TAPETYPE_BLOCKSIZE;
@@ -259,6 +271,7 @@ package Amanda::Config;
 *DUMPTYPE_DATA_PATH = *Amanda::Configc::DUMPTYPE_DATA_PATH;
 *DUMPTYPE_ALLOW_SPLIT = *Amanda::Configc::DUMPTYPE_ALLOW_SPLIT;
 *DUMPTYPE_RECOVERY_LIMIT = *Amanda::Configc::DUMPTYPE_RECOVERY_LIMIT;
+*DUMPTYPE_DUMP_LIMIT = *Amanda::Configc::DUMPTYPE_DUMP_LIMIT;
 *INTER_COMMENT = *Amanda::Configc::INTER_COMMENT;
 *INTER_MAXUSAGE = *Amanda::Configc::INTER_MAXUSAGE;
 *HOLDING_COMMENT = *Amanda::Configc::HOLDING_COMMENT;
@@ -268,12 +281,15 @@ package Amanda::Config;
 *APPLICATION_COMMENT = *Amanda::Configc::APPLICATION_COMMENT;
 *APPLICATION_PLUGIN = *Amanda::Configc::APPLICATION_PLUGIN;
 *APPLICATION_PROPERTY = *Amanda::Configc::APPLICATION_PROPERTY;
+*APPLICATION_CLIENT_NAME = *Amanda::Configc::APPLICATION_CLIENT_NAME;
 *PP_SCRIPT_COMMENT = *Amanda::Configc::PP_SCRIPT_COMMENT;
 *PP_SCRIPT_PLUGIN = *Amanda::Configc::PP_SCRIPT_PLUGIN;
 *PP_SCRIPT_PROPERTY = *Amanda::Configc::PP_SCRIPT_PROPERTY;
 *PP_SCRIPT_EXECUTE_ON = *Amanda::Configc::PP_SCRIPT_EXECUTE_ON;
 *PP_SCRIPT_EXECUTE_WHERE = *Amanda::Configc::PP_SCRIPT_EXECUTE_WHERE;
 *PP_SCRIPT_ORDER = *Amanda::Configc::PP_SCRIPT_ORDER;
+*PP_SCRIPT_SINGLE_EXECUTION = *Amanda::Configc::PP_SCRIPT_SINGLE_EXECUTION;
+*PP_SCRIPT_CLIENT_NAME = *Amanda::Configc::PP_SCRIPT_CLIENT_NAME;
 *DEVICE_CONFIG_COMMENT = *Amanda::Configc::DEVICE_CONFIG_COMMENT;
 *DEVICE_CONFIG_TAPEDEV = *Amanda::Configc::DEVICE_CONFIG_TAPEDEV;
 *DEVICE_CONFIG_DEVICE_PROPERTY = *Amanda::Configc::DEVICE_CONFIG_DEVICE_PROPERTY;
@@ -284,6 +300,12 @@ package Amanda::Config;
 *CHANGER_CONFIG_CHANGERFILE = *Amanda::Configc::CHANGER_CONFIG_CHANGERFILE;
 *CHANGER_CONFIG_PROPERTY = *Amanda::Configc::CHANGER_CONFIG_PROPERTY;
 *CHANGER_CONFIG_DEVICE_PROPERTY = *Amanda::Configc::CHANGER_CONFIG_DEVICE_PROPERTY;
+*INTERACTIVITY_COMMENT = *Amanda::Configc::INTERACTIVITY_COMMENT;
+*INTERACTIVITY_PLUGIN = *Amanda::Configc::INTERACTIVITY_PLUGIN;
+*INTERACTIVITY_PROPERTY = *Amanda::Configc::INTERACTIVITY_PROPERTY;
+*TAPERSCAN_COMMENT = *Amanda::Configc::TAPERSCAN_COMMENT;
+*TAPERSCAN_PLUGIN = *Amanda::Configc::TAPERSCAN_PLUGIN;
+*TAPERSCAN_PROPERTY = *Amanda::Configc::TAPERSCAN_PROPERTY;
 *HOLD_NEVER = *Amanda::Configc::HOLD_NEVER;
 *HOLD_AUTO = *Amanda::Configc::HOLD_AUTO;
 *HOLD_REQUIRED = *Amanda::Configc::HOLD_REQUIRED;
@@ -318,16 +340,22 @@ package Amanda::Config;
 *ALGO_LARGESTFIT = *Amanda::Configc::ALGO_LARGESTFIT;
 *ALGO_SMALLEST = *Amanda::Configc::ALGO_SMALLEST;
 *ALGO_LAST = *Amanda::Configc::ALGO_LAST;
+*EXECUTE_ON_PRE_AMCHECK = *Amanda::Configc::EXECUTE_ON_PRE_AMCHECK;
 *EXECUTE_ON_PRE_DLE_AMCHECK = *Amanda::Configc::EXECUTE_ON_PRE_DLE_AMCHECK;
 *EXECUTE_ON_PRE_HOST_AMCHECK = *Amanda::Configc::EXECUTE_ON_PRE_HOST_AMCHECK;
+*EXECUTE_ON_POST_AMCHECK = *Amanda::Configc::EXECUTE_ON_POST_AMCHECK;
 *EXECUTE_ON_POST_DLE_AMCHECK = *Amanda::Configc::EXECUTE_ON_POST_DLE_AMCHECK;
 *EXECUTE_ON_POST_HOST_AMCHECK = *Amanda::Configc::EXECUTE_ON_POST_HOST_AMCHECK;
+*EXECUTE_ON_PRE_ESTIMATE = *Amanda::Configc::EXECUTE_ON_PRE_ESTIMATE;
 *EXECUTE_ON_PRE_DLE_ESTIMATE = *Amanda::Configc::EXECUTE_ON_PRE_DLE_ESTIMATE;
 *EXECUTE_ON_PRE_HOST_ESTIMATE = *Amanda::Configc::EXECUTE_ON_PRE_HOST_ESTIMATE;
+*EXECUTE_ON_POST_ESTIMATE = *Amanda::Configc::EXECUTE_ON_POST_ESTIMATE;
 *EXECUTE_ON_POST_DLE_ESTIMATE = *Amanda::Configc::EXECUTE_ON_POST_DLE_ESTIMATE;
 *EXECUTE_ON_POST_HOST_ESTIMATE = *Amanda::Configc::EXECUTE_ON_POST_HOST_ESTIMATE;
+*EXECUTE_ON_PRE_BACKUP = *Amanda::Configc::EXECUTE_ON_PRE_BACKUP;
 *EXECUTE_ON_PRE_DLE_BACKUP = *Amanda::Configc::EXECUTE_ON_PRE_DLE_BACKUP;
 *EXECUTE_ON_PRE_HOST_BACKUP = *Amanda::Configc::EXECUTE_ON_PRE_HOST_BACKUP;
+*EXECUTE_ON_POST_BACKUP = *Amanda::Configc::EXECUTE_ON_POST_BACKUP;
 *EXECUTE_ON_POST_DLE_BACKUP = *Amanda::Configc::EXECUTE_ON_POST_DLE_BACKUP;
 *EXECUTE_ON_POST_HOST_BACKUP = *Amanda::Configc::EXECUTE_ON_POST_HOST_BACKUP;
 *SEND_AMREPORT_ALL = *Amanda::Configc::SEND_AMREPORT_ALL;
@@ -708,9 +736,9 @@ sub confparm_key_to_string {
     return $enumval;
 }
 
-push @EXPORT_OK, qw( $CNF_ORG $CNF_CONF $CNF_INDEX_SERVER $CNF_TAPE_SERVER $CNF_AUTH $CNF_SSH_KEYS $CNF_AMANDAD_PATH $CNF_CLIENT_USERNAME $CNF_CLIENT_PORT $CNF_GNUTAR_LIST_DIR $CNF_AMANDATES $CNF_MAILER $CNF_MAILTO $CNF_DUMPUSER $CNF_TAPEDEV $CNF_DEVICE_PROPERTY $CNF_PROPERTY $CNF_CHANGERDEV $CNF_CHANGERFILE $CNF_LABELSTR $CNF_AUTOLABEL $CNF_TAPELIST $CNF_DISKFILE $CNF_INFOFILE $CNF_LOGDIR $CNF_INDEXDIR $CNF_TAPETYPE $CNF_DUMPCYCLE $CNF_RUNSPERCYCLE $CNF_TAPECYCLE $CNF_NETUSAGE $CNF_INPARALLEL $CNF_DUMPORDER $CNF_BUMPPERCENT $CNF_BUMPSIZE $CNF_BUMPMULT $CNF_BUMPDAYS $CNF_TPCHANGER $CNF_RUNTAPES $CNF_MAXDUMPS $CNF_ETIMEOUT $CNF_DTIMEOUT $CNF_CTIMEOUT $CNF_DEVICE_OUTPUT_BUFFER_SIZE $CNF_PRINTER $CNF_AUTOFLUSH $CNF_RESERVE $CNF_MAXDUMPSIZE $CNF_COLUMNSPEC $CNF_AMRECOVER_DO_FSF $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 $CNF_LABEL_NEW_TAPES $CNF_USETIMESTAMPS $CNF_REP_TRIES $CNF_CONNECT_TRIES $CNF_REQ_TRIES $CNF_DEBUG_AMANDAD $CNF_DEBUG_RECOVERY $CNF_DEBUG_AMIDXTAPED $CNF_DEBUG_AMINDEXD $CNF_DEBUG_AMRECOVER $CNF_DEBUG_AUTH $CNF_DEBUG_EVENT $CNF_DEBUG_HOLDING $CNF_DEBUG_PROTOCOL $CNF_DEBUG_PLANNER $CNF_DEBUG_DRIVER $CNF_DEBUG_DUMPER $CNF_DEBUG_CHUNKER $CNF_DEBUG_TAPER $CNF_DEBUG_SELFCHECK $CNF_DEBUG_SENDSIZE $CNF_DEBUG_SENDBACKUP $CNF_RESERVED_UDP_PORT $CNF_RESERVED_TCP_PORT $CNF_UNRESERVED_TCP_PORT $CNF_HOLDINGDISK $CNF_SEND_AMREPORT_ON $CNF_TAPER_PARALLEL_WRITE $CNF_RECOVERY_LIMIT);
-push @{$EXPORT_TAGS{"confparm_key"}}, qw( $CNF_ORG $CNF_CONF $CNF_INDEX_SERVER $CNF_TAPE_SERVER $CNF_AUTH $CNF_SSH_KEYS $CNF_AMANDAD_PATH $CNF_CLIENT_USERNAME $CNF_CLIENT_PORT $CNF_GNUTAR_LIST_DIR $CNF_AMANDATES $CNF_MAILER $CNF_MAILTO $CNF_DUMPUSER $CNF_TAPEDEV $CNF_DEVICE_PROPERTY $CNF_PROPERTY $CNF_CHANGERDEV $CNF_CHANGERFILE $CNF_LABELSTR $CNF_AUTOLABEL $CNF_TAPELIST $CNF_DISKFILE $CNF_INFOFILE $CNF_LOGDIR $CNF_INDEXDIR $CNF_TAPETYPE $CNF_DUMPCYCLE $CNF_RUNSPERCYCLE $CNF_TAPECYCLE $CNF_NETUSAGE $CNF_INPARALLEL $CNF_DUMPORDER $CNF_BUMPPERCENT $CNF_BUMPSIZE $CNF_BUMPMULT $CNF_BUMPDAYS $CNF_TPCHANGER $CNF_RUNTAPES $CNF_MAXDUMPS $CNF_ETIMEOUT $CNF_DTIMEOUT $CNF_CTIMEOUT $CNF_DEVICE_OUTPUT_BUFFER_SIZE $CNF_PRINTER $CNF_AUTOFLUSH $CNF_RESERVE $CNF_MAXDUMPSIZE $CNF_COLUMNSPEC $CNF_AMRECOVER_DO_FSF $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 $CNF_LABEL_NEW_TAPES $CNF_USETIMESTAMPS $CNF_REP_TRIES $CNF_CONNECT_TRIES $CNF_REQ_TRIES $CNF_DEBUG_AMANDAD $CNF_DEBUG_RECOVERY $CNF_DEBUG_AMIDXTAPED $CNF_DEBUG_AMINDEXD $CNF_DEBUG_AMRECOVER $CNF_DEBUG_AUTH $CNF_DEBUG_EVENT $CNF_DEBUG_HOLDING $CNF_DEBUG_PROTOCOL $CNF_DEBUG_PLANNER $CNF_DEBUG_DRIVER $CNF_DEBUG_DUMPER $CNF_DEBUG_CHUNKER $CNF_DEBUG_TAPER $CNF_DEBUG_SELFCHECK $CNF_DEBUG_SENDSIZE $CNF_DEBUG_SENDBACKUP $CNF_RESERVED_UDP_PORT $CNF_RESERVED_TCP_PORT $CNF_UNRESERVED_TCP_PORT $CNF_HOLDINGDISK $CNF_SEND_AMREPORT_ON $CNF_TAPER_PARALLEL_WRITE $CNF_RECOVERY_LIMIT);
-      foreach (qw(  CNF_ORG CNF_CONF CNF_INDEX_SERVER CNF_TAPE_SERVER CNF_AUTH CNF_SSH_KEYS CNF_AMANDAD_PATH CNF_CLIENT_USERNAME CNF_CLIENT_PORT CNF_GNUTAR_LIST_DIR CNF_AMANDATES CNF_MAILER CNF_MAILTO CNF_DUMPUSER CNF_TAPEDEV CNF_DEVICE_PROPERTY CNF_PROPERTY CNF_CHANGERDEV CNF_CHANGERFILE CNF_LABELSTR CNF_AUTOLABEL CNF_TAPELIST CNF_DISKFILE CNF_INFOFILE CNF_LOGDIR CNF_INDEXDIR CNF_TAPETYPE CNF_DUMPCYCLE CNF_RUNSPERCYCLE CNF_TAPECYCLE CNF_NETUSAGE CNF_INPARALLEL CNF_DUMPORDER CNF_BUMPPERCENT CNF_BUMPSIZE CNF_BUMPMULT CNF_BUMPDAYS CNF_TPCHANGER CNF_RUNTAPES CNF_MAXDUMPS CNF_ETIMEOUT CNF_DTIMEOUT CNF_CTIMEOUT CNF_DEVICE_OUTPUT_BUFFER_SIZE CNF_PRINTER CNF_AUTOFLUSH CNF_RESERVE CNF_MAXDUMPSIZE CNF_COLUMNSPEC CNF_AMRECOVER_DO_FSF 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 CNF_LABEL_NEW_TAPES CNF_USETIMESTAMPS CNF_REP_TRIES CNF_CONNECT_TRIES CNF_REQ_TRIES CNF_DEBUG_AMANDAD CNF_DEBUG_RECOVERY CNF_DEBUG_AMIDXTAPED CNF_DEBUG_AMINDEXD CNF_DEBUG_AMRECOVER CNF_DEBUG_AUTH CNF_DEBUG_EVENT CNF_DEBUG_HOLDING CNF_DEBUG_PROTOCOL CNF_DEBUG_PLANNER CNF_DEBUG_DRIVER CNF_DEBUG_DUMPER CNF_DEBUG_CHUNKER CNF_DEBUG_TAPER CNF_DEBUG_SELFCHECK CNF_DEBUG_SENDSIZE CNF_DEBUG_SENDBACKUP CNF_RESERVED_UDP_PORT CNF_RESERVED_TCP_PORT CNF_UNRESERVED_TCP_PORT CNF_HOLDINGDISK CNF_SEND_AMREPORT_ON CNF_TAPER_PARALLEL_WRITE CNF_RECOVERY_LIMIT)) {       $_confparm_key_VALUES{$_} = $$_;      }  
+push @EXPORT_OK, qw( $CNF_ORG $CNF_CONF $CNF_AMDUMP_SERVER $CNF_INDEX_SERVER $CNF_TAPE_SERVER $CNF_AUTH $CNF_SSH_KEYS $CNF_AMANDAD_PATH $CNF_CLIENT_USERNAME $CNF_CLIENT_PORT $CNF_GNUTAR_LIST_DIR $CNF_AMANDATES $CNF_MAILER $CNF_MAILTO $CNF_DUMPUSER $CNF_TAPEDEV $CNF_DEVICE_PROPERTY $CNF_PROPERTY $CNF_CHANGERDEV $CNF_CHANGERFILE $CNF_LABELSTR $CNF_AUTOLABEL $CNF_META_AUTOLABEL $CNF_TAPELIST $CNF_DISKFILE $CNF_INFOFILE $CNF_LOGDIR $CNF_INDEXDIR $CNF_TAPETYPE $CNF_DUMPCYCLE $CNF_RUNSPERCYCLE $CNF_TAPECYCLE $CNF_NETUSAGE $CNF_INPARALLEL $CNF_DUMPORDER $CNF_BUMPPERCENT $CNF_BUMPSIZE $CNF_BUMPMULT $CNF_BUMPDAYS $CNF_TPCHANGER $CNF_RUNTAPES $CNF_MAXDUMPS $CNF_ETIMEOUT $CNF_DTIMEOUT $CNF_CTIMEOUT $CNF_DEVICE_OUTPUT_BUFFER_SIZE $CNF_PRINTER $CNF_AUTOFLUSH $CNF_RESERVE $CNF_MAXDUMPSIZE $CNF_COLUMNSPEC $CNF_AMRECOVER_DO_FSF $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 $CNF_LABEL_NEW_TAPES $CNF_USETIMESTAMPS $CNF_REP_TRIES $CNF_CONNECT_TRIES $CNF_REQ_TRIES $CNF_DEBUG_AMANDAD $CNF_DEBUG_RECOVERY $CNF_DEBUG_AMIDXTAPED $CNF_DEBUG_AMINDEXD $CNF_DEBUG_AMRECOVER $CNF_DEBUG_AUTH $CNF_DEBUG_EVENT $CNF_DEBUG_HOLDING $CNF_DEBUG_PROTOCOL $CNF_DEBUG_PLANNER $CNF_DEBUG_DRIVER $CNF_DEBUG_DUMPER $CNF_DEBUG_CHUNKER $CNF_DEBUG_TAPER $CNF_DEBUG_SELFCHECK $CNF_DEBUG_SENDSIZE $CNF_DEBUG_SENDBACKUP $CNF_RESERVED_UDP_PORT $CNF_RESERVED_TCP_PORT $CNF_UNRESERVED_TCP_PORT $CNF_HOLDINGDISK $CNF_SEND_AMREPORT_ON $CNF_TAPER_PARALLEL_WRITE $CNF_RECOVERY_LIMIT  $CNF_INTERACTIVITY  $CNF_TAPERSCAN);
+push @{$EXPORT_TAGS{"confparm_key"}}, qw( $CNF_ORG $CNF_CONF $CNF_AMDUMP_SERVER $CNF_INDEX_SERVER $CNF_TAPE_SERVER $CNF_AUTH $CNF_SSH_KEYS $CNF_AMANDAD_PATH $CNF_CLIENT_USERNAME $CNF_CLIENT_PORT $CNF_GNUTAR_LIST_DIR $CNF_AMANDATES $CNF_MAILER $CNF_MAILTO $CNF_DUMPUSER $CNF_TAPEDEV $CNF_DEVICE_PROPERTY $CNF_PROPERTY $CNF_CHANGERDEV $CNF_CHANGERFILE $CNF_LABELSTR $CNF_AUTOLABEL $CNF_META_AUTOLABEL $CNF_TAPELIST $CNF_DISKFILE $CNF_INFOFILE $CNF_LOGDIR $CNF_INDEXDIR $CNF_TAPETYPE $CNF_DUMPCYCLE $CNF_RUNSPERCYCLE $CNF_TAPECYCLE $CNF_NETUSAGE $CNF_INPARALLEL $CNF_DUMPORDER $CNF_BUMPPERCENT $CNF_BUMPSIZE $CNF_BUMPMULT $CNF_BUMPDAYS $CNF_TPCHANGER $CNF_RUNTAPES $CNF_MAXDUMPS $CNF_ETIMEOUT $CNF_DTIMEOUT $CNF_CTIMEOUT $CNF_DEVICE_OUTPUT_BUFFER_SIZE $CNF_PRINTER $CNF_AUTOFLUSH $CNF_RESERVE $CNF_MAXDUMPSIZE $CNF_COLUMNSPEC $CNF_AMRECOVER_DO_FSF $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 $CNF_LABEL_NEW_TAPES $CNF_USETIMESTAMPS $CNF_REP_TRIES $CNF_CONNECT_TRIES $CNF_REQ_TRIES $CNF_DEBUG_AMANDAD $CNF_DEBUG_RECOVERY $CNF_DEBUG_AMIDXTAPED $CNF_DEBUG_AMINDEXD $CNF_DEBUG_AMRECOVER $CNF_DEBUG_AUTH $CNF_DEBUG_EVENT $CNF_DEBUG_HOLDING $CNF_DEBUG_PROTOCOL $CNF_DEBUG_PLANNER $CNF_DEBUG_DRIVER $CNF_DEBUG_DUMPER $CNF_DEBUG_CHUNKER $CNF_DEBUG_TAPER $CNF_DEBUG_SELFCHECK $CNF_DEBUG_SENDSIZE $CNF_DEBUG_SENDBACKUP $CNF_RESERVED_UDP_PORT $CNF_RESERVED_TCP_PORT $CNF_UNRESERVED_TCP_PORT $CNF_HOLDINGDISK $CNF_SEND_AMREPORT_ON $CNF_TAPER_PARALLEL_WRITE $CNF_RECOVERY_LIMIT  $CNF_INTERACTIVITY  $CNF_TAPERSCAN);
+      foreach (qw(  CNF_ORG CNF_CONF CNF_AMDUMP_SERVER CNF_INDEX_SERVER CNF_TAPE_SERVER CNF_AUTH CNF_SSH_KEYS CNF_AMANDAD_PATH CNF_CLIENT_USERNAME CNF_CLIENT_PORT CNF_GNUTAR_LIST_DIR CNF_AMANDATES CNF_MAILER CNF_MAILTO CNF_DUMPUSER CNF_TAPEDEV CNF_DEVICE_PROPERTY CNF_PROPERTY CNF_CHANGERDEV CNF_CHANGERFILE CNF_LABELSTR CNF_AUTOLABEL CNF_META_AUTOLABEL CNF_TAPELIST CNF_DISKFILE CNF_INFOFILE CNF_LOGDIR CNF_INDEXDIR CNF_TAPETYPE CNF_DUMPCYCLE CNF_RUNSPERCYCLE CNF_TAPECYCLE CNF_NETUSAGE CNF_INPARALLEL CNF_DUMPORDER CNF_BUMPPERCENT CNF_BUMPSIZE CNF_BUMPMULT CNF_BUMPDAYS CNF_TPCHANGER CNF_RUNTAPES CNF_MAXDUMPS CNF_ETIMEOUT CNF_DTIMEOUT CNF_CTIMEOUT CNF_DEVICE_OUTPUT_BUFFER_SIZE CNF_PRINTER CNF_AUTOFLUSH CNF_RESERVE CNF_MAXDUMPSIZE CNF_COLUMNSPEC CNF_AMRECOVER_DO_FSF 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 CNF_LABEL_NEW_TAPES CNF_USETIMESTAMPS CNF_REP_TRIES CNF_CONNECT_TRIES CNF_REQ_TRIES CNF_DEBUG_AMANDAD CNF_DEBUG_RECOVERY CNF_DEBUG_AMIDXTAPED CNF_DEBUG_AMINDEXD CNF_DEBUG_AMRECOVER CNF_DEBUG_AUTH CNF_DEBUG_EVENT CNF_DEBUG_HOLDING CNF_DEBUG_PROTOCOL CNF_DEBUG_PLANNER CNF_DEBUG_DRIVER CNF_DEBUG_DUMPER CNF_DEBUG_CHUNKER CNF_DEBUG_TAPER CNF_DEBUG_SELFCHECK CNF_DEBUG_SENDSIZE CNF_DEBUG_SENDBACKUP CNF_RESERVED_UDP_PORT CNF_RESERVED_TCP_PORT CNF_UNRESERVED_TCP_PORT CNF_HOLDINGDISK CNF_SEND_AMREPORT_ON CNF_TAPER_PARALLEL_WRITE CNF_RECOVERY_LIMIT  CNF_INTERACTIVITY  CNF_TAPERSCAN)) {        $_confparm_key_VALUES{$_} = $$_;      }  
 #copy symbols in confparm_key to getconf
 push @{$EXPORT_TAGS{"getconf"}},  @{$EXPORT_TAGS{"confparm_key"}};
 
@@ -719,7 +747,7 @@ use Amanda::Config::FoldingHash;
 
 =pod
 
-Global Parameters:       C<$CNF_ORG> C<$CNF_CONF> C<$CNF_INDEX_SERVER> C<$CNF_TAPE_SERVER> C<$CNF_AUTH> C<$CNF_SSH_KEYS> C<$CNF_AMANDAD_PATH> C<$CNF_CLIENT_USERNAME> C<$CNF_CLIENT_PORT> C<$CNF_GNUTAR_LIST_DIR> C<$CNF_AMANDATES> C<$CNF_MAILER> C<$CNF_MAILTO> C<$CNF_DUMPUSER> C<$CNF_TAPEDEV> C<$CNF_DEVICE_PROPERTY> C<$CNF_PROPERTY> C<$CNF_CHANGERDEV> C<$CNF_CHANGERFILE> C<$CNF_LABELSTR> C<$CNF_AUTOLABEL> C<$CNF_TAPELIST> C<$CNF_DISKFILE> C<$CNF_INFOFILE> C<$CNF_LOGDIR> C<$CNF_INDEXDIR> C<$CNF_TAPETYPE> C<$CNF_DUMPCYCLE> C<$CNF_RUNSPERCYCLE> C<$CNF_TAPECYCLE> C<$CNF_NETUSAGE> C<$CNF_INPARALLEL> C<$CNF_DUMPORDER> C<$CNF_BUMPPERCENT> C<$CNF_BUMPSIZE> C<$CNF_BUMPMULT> C<$CNF_BUMPDAYS> C<$CNF_TPCHANGER> C<$CNF_RUNTAPES> C<$CNF_MAXDUMPS> C<$CNF_ETIMEOUT> C<$CNF_DTIMEOUT> C<$CNF_CTIMEOUT> C<$CNF_DEVICE_OUTPUT_BUFFER_SIZE> C<$CNF_PRINTER> C<$CNF_AUTOFLUSH> C<$CNF_RESERVE> C<$CNF_MAXDUMPSIZE> C<$CNF_COLUMNSPEC> C<$CNF_AMRECOVER_DO_FSF> C<$CNF_AMRECOVER_CHECK_LABEL> C<$CNF_AMRECOVER_CHANGER> C<$CNF_TAPERALGO> C<$CNF_FLUSH_THRESHOLD_DUMPED> C<$CNF_FLUSH_THRESHOLD_SCHEDULED> C<$CNF_TAPERFLUSH> C<$CNF_DISPLAYUNIT> C<$CNF_KRB5KEYTAB> C<$CNF_KRB5PRINCIPAL> C<$CNF_LABEL_NEW_TAPES> C<$CNF_USETIMESTAMPS> C<$CNF_REP_TRIES> C<$CNF_CONNECT_TRIES> C<$CNF_REQ_TRIES> C<$CNF_DEBUG_AMANDAD> C<$CNF_DEBUG_RECOVERY> C<$CNF_DEBUG_AMIDXTAPED> C<$CNF_DEBUG_AMINDEXD> C<$CNF_DEBUG_AMRECOVER> C<$CNF_DEBUG_AUTH> C<$CNF_DEBUG_EVENT> C<$CNF_DEBUG_HOLDING> C<$CNF_DEBUG_PROTOCOL> C<$CNF_DEBUG_PLANNER> C<$CNF_DEBUG_DRIVER> C<$CNF_DEBUG_DUMPER> C<$CNF_DEBUG_CHUNKER> C<$CNF_DEBUG_TAPER> C<$CNF_DEBUG_SELFCHECK> C<$CNF_DEBUG_SENDSIZE> C<$CNF_DEBUG_SENDBACKUP> C<$CNF_RESERVED_UDP_PORT> C<$CNF_RESERVED_TCP_PORT> C<$CNF_UNRESERVED_TCP_PORT> C<$CNF_HOLDINGDISK> C<$CNF_SEND_AMREPORT_ON> C<$CNF_TAPER_PARALLEL_WRITE> C<$CNF_RECOVERY_LIMIT>
+Global Parameters:       C<$CNF_ORG> C<$CNF_CONF> C<$CNF_AMDUMP_SERVER> C<$CNF_INDEX_SERVER> C<$CNF_TAPE_SERVER> C<$CNF_AUTH> C<$CNF_SSH_KEYS> C<$CNF_AMANDAD_PATH> C<$CNF_CLIENT_USERNAME> C<$CNF_CLIENT_PORT> C<$CNF_GNUTAR_LIST_DIR> C<$CNF_AMANDATES> C<$CNF_MAILER> C<$CNF_MAILTO> C<$CNF_DUMPUSER> C<$CNF_TAPEDEV> C<$CNF_DEVICE_PROPERTY> C<$CNF_PROPERTY> C<$CNF_CHANGERDEV> C<$CNF_CHANGERFILE> C<$CNF_LABELSTR> C<$CNF_AUTOLABEL> C<$CNF_META_AUTOLABEL> C<$CNF_TAPELIST> C<$CNF_DISKFILE> C<$CNF_INFOFILE> C<$CNF_LOGDIR> C<$CNF_INDEXDIR> C<$CNF_TAPETYPE> C<$CNF_DUMPCYCLE> C<$CNF_RUNSPERCYCLE> C<$CNF_TAPECYCLE> C<$CNF_NETUSAGE> C<$CNF_INPARALLEL> C<$CNF_DUMPORDER> C<$CNF_BUMPPERCENT> C<$CNF_BUMPSIZE> C<$CNF_BUMPMULT> C<$CNF_BUMPDAYS> C<$CNF_TPCHANGER> C<$CNF_RUNTAPES> C<$CNF_MAXDUMPS> C<$CNF_ETIMEOUT> C<$CNF_DTIMEOUT> C<$CNF_CTIMEOUT> C<$CNF_DEVICE_OUTPUT_BUFFER_SIZE> C<$CNF_PRINTER> C<$CNF_AUTOFLUSH> C<$CNF_RESERVE> C<$CNF_MAXDUMPSIZE> C<$CNF_COLUMNSPEC> C<$CNF_AMRECOVER_DO_FSF> C<$CNF_AMRECOVER_CHECK_LABEL> C<$CNF_AMRECOVER_CHANGER> C<$CNF_TAPERALGO> C<$CNF_FLUSH_THRESHOLD_DUMPED> C<$CNF_FLUSH_THRESHOLD_SCHEDULED> C<$CNF_TAPERFLUSH> C<$CNF_DISPLAYUNIT> C<$CNF_KRB5KEYTAB> C<$CNF_KRB5PRINCIPAL> C<$CNF_LABEL_NEW_TAPES> C<$CNF_USETIMESTAMPS> C<$CNF_REP_TRIES> C<$CNF_CONNECT_TRIES> C<$CNF_REQ_TRIES> C<$CNF_DEBUG_AMANDAD> C<$CNF_DEBUG_RECOVERY> C<$CNF_DEBUG_AMIDXTAPED> C<$CNF_DEBUG_AMINDEXD> C<$CNF_DEBUG_AMRECOVER> C<$CNF_DEBUG_AUTH> C<$CNF_DEBUG_EVENT> C<$CNF_DEBUG_HOLDING> C<$CNF_DEBUG_PROTOCOL> C<$CNF_DEBUG_PLANNER> C<$CNF_DEBUG_DRIVER> C<$CNF_DEBUG_DUMPER> C<$CNF_DEBUG_CHUNKER> C<$CNF_DEBUG_TAPER> C<$CNF_DEBUG_SELFCHECK> C<$CNF_DEBUG_SENDSIZE> C<$CNF_DEBUG_SENDBACKUP> C<$CNF_RESERVED_UDP_PORT> C<$CNF_RESERVED_TCP_PORT> C<$CNF_UNRESERVED_TCP_PORT> C<$CNF_HOLDINGDISK> C<$CNF_SEND_AMREPORT_ON> C<$CNF_TAPER_PARALLEL_WRITE> C<$CNF_RECOVERY_LIMIT>  C<$CNF_INTERACTIVITY>  C<$CNF_TAPERSCAN>
 
 =cut
 
@@ -780,9 +808,9 @@ sub dumptype_key_to_string {
     return $enumval;
 }
 
-push @EXPORT_OK, qw( $DUMPTYPE_COMMENT $DUMPTYPE_PROGRAM $DUMPTYPE_SRVCOMPPROG $DUMPTYPE_CLNTCOMPPROG $DUMPTYPE_SRV_ENCRYPT $DUMPTYPE_CLNT_ENCRYPT $DUMPTYPE_AMANDAD_PATH $DUMPTYPE_CLIENT_USERNAME $DUMPTYPE_CLIENT_PORT $DUMPTYPE_SSH_KEYS $DUMPTYPE_AUTH $DUMPTYPE_EXCLUDE $DUMPTYPE_INCLUDE $DUMPTYPE_PRIORITY $DUMPTYPE_DUMPCYCLE $DUMPTYPE_MAXDUMPS $DUMPTYPE_MAXPROMOTEDAY $DUMPTYPE_BUMPPERCENT $DUMPTYPE_BUMPSIZE $DUMPTYPE_BUMPDAYS $DUMPTYPE_BUMPMULT $DUMPTYPE_STARTTIME $DUMPTYPE_STRATEGY $DUMPTYPE_ESTIMATELIST $DUMPTYPE_COMPRESS $DUMPTYPE_ENCRYPT $DUMPTYPE_SRV_DECRYPT_OPT $DUMPTYPE_CLNT_DECRYPT_OPT $DUMPTYPE_COMPRATE $DUMPTYPE_TAPE_SPLITSIZE $DUMPTYPE_FALLBACK_SPLITSIZE $DUMPTYPE_SPLIT_DISKBUFFER $DUMPTYPE_RECORD $DUMPTYPE_SKIP_INCR $DUMPTYPE_SKIP_FULL $DUMPTYPE_HOLDINGDISK $DUMPTYPE_KENCRYPT $DUMPTYPE_IGNORE $DUMPTYPE_INDEX $DUMPTYPE_APPLICATION $DUMPTYPE_SCRIPTLIST $DUMPTYPE_PROPERTY $DUMPTYPE_DATA_PATH $DUMPTYPE_ALLOW_SPLIT $DUMPTYPE_RECOVERY_LIMIT);
-push @{$EXPORT_TAGS{"dumptype_key"}}, qw( $DUMPTYPE_COMMENT $DUMPTYPE_PROGRAM $DUMPTYPE_SRVCOMPPROG $DUMPTYPE_CLNTCOMPPROG $DUMPTYPE_SRV_ENCRYPT $DUMPTYPE_CLNT_ENCRYPT $DUMPTYPE_AMANDAD_PATH $DUMPTYPE_CLIENT_USERNAME $DUMPTYPE_CLIENT_PORT $DUMPTYPE_SSH_KEYS $DUMPTYPE_AUTH $DUMPTYPE_EXCLUDE $DUMPTYPE_INCLUDE $DUMPTYPE_PRIORITY $DUMPTYPE_DUMPCYCLE $DUMPTYPE_MAXDUMPS $DUMPTYPE_MAXPROMOTEDAY $DUMPTYPE_BUMPPERCENT $DUMPTYPE_BUMPSIZE $DUMPTYPE_BUMPDAYS $DUMPTYPE_BUMPMULT $DUMPTYPE_STARTTIME $DUMPTYPE_STRATEGY $DUMPTYPE_ESTIMATELIST $DUMPTYPE_COMPRESS $DUMPTYPE_ENCRYPT $DUMPTYPE_SRV_DECRYPT_OPT $DUMPTYPE_CLNT_DECRYPT_OPT $DUMPTYPE_COMPRATE $DUMPTYPE_TAPE_SPLITSIZE $DUMPTYPE_FALLBACK_SPLITSIZE $DUMPTYPE_SPLIT_DISKBUFFER $DUMPTYPE_RECORD $DUMPTYPE_SKIP_INCR $DUMPTYPE_SKIP_FULL $DUMPTYPE_HOLDINGDISK $DUMPTYPE_KENCRYPT $DUMPTYPE_IGNORE $DUMPTYPE_INDEX $DUMPTYPE_APPLICATION $DUMPTYPE_SCRIPTLIST $DUMPTYPE_PROPERTY $DUMPTYPE_DATA_PATH $DUMPTYPE_ALLOW_SPLIT $DUMPTYPE_RECOVERY_LIMIT);
-      foreach (qw(  DUMPTYPE_COMMENT DUMPTYPE_PROGRAM DUMPTYPE_SRVCOMPPROG DUMPTYPE_CLNTCOMPPROG DUMPTYPE_SRV_ENCRYPT DUMPTYPE_CLNT_ENCRYPT DUMPTYPE_AMANDAD_PATH DUMPTYPE_CLIENT_USERNAME DUMPTYPE_CLIENT_PORT DUMPTYPE_SSH_KEYS DUMPTYPE_AUTH DUMPTYPE_EXCLUDE DUMPTYPE_INCLUDE DUMPTYPE_PRIORITY DUMPTYPE_DUMPCYCLE DUMPTYPE_MAXDUMPS DUMPTYPE_MAXPROMOTEDAY DUMPTYPE_BUMPPERCENT DUMPTYPE_BUMPSIZE DUMPTYPE_BUMPDAYS DUMPTYPE_BUMPMULT DUMPTYPE_STARTTIME DUMPTYPE_STRATEGY DUMPTYPE_ESTIMATELIST DUMPTYPE_COMPRESS DUMPTYPE_ENCRYPT DUMPTYPE_SRV_DECRYPT_OPT DUMPTYPE_CLNT_DECRYPT_OPT DUMPTYPE_COMPRATE DUMPTYPE_TAPE_SPLITSIZE DUMPTYPE_FALLBACK_SPLITSIZE DUMPTYPE_SPLIT_DISKBUFFER DUMPTYPE_RECORD DUMPTYPE_SKIP_INCR DUMPTYPE_SKIP_FULL DUMPTYPE_HOLDINGDISK DUMPTYPE_KENCRYPT DUMPTYPE_IGNORE DUMPTYPE_INDEX DUMPTYPE_APPLICATION DUMPTYPE_SCRIPTLIST DUMPTYPE_PROPERTY DUMPTYPE_DATA_PATH DUMPTYPE_ALLOW_SPLIT DUMPTYPE_RECOVERY_LIMIT)) {         $_dumptype_key_VALUES{$_} = $$_;      }  
+push @EXPORT_OK, qw( $DUMPTYPE_COMMENT $DUMPTYPE_PROGRAM $DUMPTYPE_SRVCOMPPROG $DUMPTYPE_CLNTCOMPPROG $DUMPTYPE_SRV_ENCRYPT $DUMPTYPE_CLNT_ENCRYPT $DUMPTYPE_AMANDAD_PATH $DUMPTYPE_CLIENT_USERNAME $DUMPTYPE_CLIENT_PORT $DUMPTYPE_SSH_KEYS $DUMPTYPE_AUTH $DUMPTYPE_EXCLUDE $DUMPTYPE_INCLUDE $DUMPTYPE_PRIORITY $DUMPTYPE_DUMPCYCLE $DUMPTYPE_MAXDUMPS $DUMPTYPE_MAXPROMOTEDAY $DUMPTYPE_BUMPPERCENT $DUMPTYPE_BUMPSIZE $DUMPTYPE_BUMPDAYS $DUMPTYPE_BUMPMULT $DUMPTYPE_STARTTIME $DUMPTYPE_STRATEGY $DUMPTYPE_ESTIMATELIST $DUMPTYPE_COMPRESS $DUMPTYPE_ENCRYPT $DUMPTYPE_SRV_DECRYPT_OPT $DUMPTYPE_CLNT_DECRYPT_OPT $DUMPTYPE_COMPRATE $DUMPTYPE_TAPE_SPLITSIZE $DUMPTYPE_FALLBACK_SPLITSIZE $DUMPTYPE_SPLIT_DISKBUFFER $DUMPTYPE_RECORD $DUMPTYPE_SKIP_INCR $DUMPTYPE_SKIP_FULL $DUMPTYPE_HOLDINGDISK $DUMPTYPE_KENCRYPT $DUMPTYPE_IGNORE $DUMPTYPE_INDEX $DUMPTYPE_APPLICATION $DUMPTYPE_SCRIPTLIST $DUMPTYPE_PROPERTY $DUMPTYPE_DATA_PATH $DUMPTYPE_ALLOW_SPLIT $DUMPTYPE_RECOVERY_LIMIT  $DUMPTYPE_DUMP_LIMIT);
+push @{$EXPORT_TAGS{"dumptype_key"}}, qw( $DUMPTYPE_COMMENT $DUMPTYPE_PROGRAM $DUMPTYPE_SRVCOMPPROG $DUMPTYPE_CLNTCOMPPROG $DUMPTYPE_SRV_ENCRYPT $DUMPTYPE_CLNT_ENCRYPT $DUMPTYPE_AMANDAD_PATH $DUMPTYPE_CLIENT_USERNAME $DUMPTYPE_CLIENT_PORT $DUMPTYPE_SSH_KEYS $DUMPTYPE_AUTH $DUMPTYPE_EXCLUDE $DUMPTYPE_INCLUDE $DUMPTYPE_PRIORITY $DUMPTYPE_DUMPCYCLE $DUMPTYPE_MAXDUMPS $DUMPTYPE_MAXPROMOTEDAY $DUMPTYPE_BUMPPERCENT $DUMPTYPE_BUMPSIZE $DUMPTYPE_BUMPDAYS $DUMPTYPE_BUMPMULT $DUMPTYPE_STARTTIME $DUMPTYPE_STRATEGY $DUMPTYPE_ESTIMATELIST $DUMPTYPE_COMPRESS $DUMPTYPE_ENCRYPT $DUMPTYPE_SRV_DECRYPT_OPT $DUMPTYPE_CLNT_DECRYPT_OPT $DUMPTYPE_COMPRATE $DUMPTYPE_TAPE_SPLITSIZE $DUMPTYPE_FALLBACK_SPLITSIZE $DUMPTYPE_SPLIT_DISKBUFFER $DUMPTYPE_RECORD $DUMPTYPE_SKIP_INCR $DUMPTYPE_SKIP_FULL $DUMPTYPE_HOLDINGDISK $DUMPTYPE_KENCRYPT $DUMPTYPE_IGNORE $DUMPTYPE_INDEX $DUMPTYPE_APPLICATION $DUMPTYPE_SCRIPTLIST $DUMPTYPE_PROPERTY $DUMPTYPE_DATA_PATH $DUMPTYPE_ALLOW_SPLIT $DUMPTYPE_RECOVERY_LIMIT  $DUMPTYPE_DUMP_LIMIT);
+      foreach (qw(  DUMPTYPE_COMMENT DUMPTYPE_PROGRAM DUMPTYPE_SRVCOMPPROG DUMPTYPE_CLNTCOMPPROG DUMPTYPE_SRV_ENCRYPT DUMPTYPE_CLNT_ENCRYPT DUMPTYPE_AMANDAD_PATH DUMPTYPE_CLIENT_USERNAME DUMPTYPE_CLIENT_PORT DUMPTYPE_SSH_KEYS DUMPTYPE_AUTH DUMPTYPE_EXCLUDE DUMPTYPE_INCLUDE DUMPTYPE_PRIORITY DUMPTYPE_DUMPCYCLE DUMPTYPE_MAXDUMPS DUMPTYPE_MAXPROMOTEDAY DUMPTYPE_BUMPPERCENT DUMPTYPE_BUMPSIZE DUMPTYPE_BUMPDAYS DUMPTYPE_BUMPMULT DUMPTYPE_STARTTIME DUMPTYPE_STRATEGY DUMPTYPE_ESTIMATELIST DUMPTYPE_COMPRESS DUMPTYPE_ENCRYPT DUMPTYPE_SRV_DECRYPT_OPT DUMPTYPE_CLNT_DECRYPT_OPT DUMPTYPE_COMPRATE DUMPTYPE_TAPE_SPLITSIZE DUMPTYPE_FALLBACK_SPLITSIZE DUMPTYPE_SPLIT_DISKBUFFER DUMPTYPE_RECORD DUMPTYPE_SKIP_INCR DUMPTYPE_SKIP_FULL DUMPTYPE_HOLDINGDISK DUMPTYPE_KENCRYPT DUMPTYPE_IGNORE DUMPTYPE_INDEX DUMPTYPE_APPLICATION DUMPTYPE_SCRIPTLIST DUMPTYPE_PROPERTY DUMPTYPE_DATA_PATH DUMPTYPE_ALLOW_SPLIT DUMPTYPE_RECOVERY_LIMIT  DUMPTYPE_DUMP_LIMIT)) {    $_dumptype_key_VALUES{$_} = $$_;      }  
 #copy symbols in dumptype_key to getconf
 push @{$EXPORT_TAGS{"getconf"}},  @{$EXPORT_TAGS{"dumptype_key"}};
 
@@ -791,7 +819,7 @@ use Amanda::Config::FoldingHash;
 
 =pod
 
-Dumptype Parameters:       C<$DUMPTYPE_COMMENT> C<$DUMPTYPE_PROGRAM> C<$DUMPTYPE_SRVCOMPPROG> C<$DUMPTYPE_CLNTCOMPPROG> C<$DUMPTYPE_SRV_ENCRYPT> C<$DUMPTYPE_CLNT_ENCRYPT> C<$DUMPTYPE_AMANDAD_PATH> C<$DUMPTYPE_CLIENT_USERNAME> C<$DUMPTYPE_CLIENT_PORT> C<$DUMPTYPE_SSH_KEYS> C<$DUMPTYPE_AUTH> C<$DUMPTYPE_EXCLUDE> C<$DUMPTYPE_INCLUDE> C<$DUMPTYPE_PRIORITY> C<$DUMPTYPE_DUMPCYCLE> C<$DUMPTYPE_MAXDUMPS> C<$DUMPTYPE_MAXPROMOTEDAY> C<$DUMPTYPE_BUMPPERCENT> C<$DUMPTYPE_BUMPSIZE> C<$DUMPTYPE_BUMPDAYS> C<$DUMPTYPE_BUMPMULT> C<$DUMPTYPE_STARTTIME> C<$DUMPTYPE_STRATEGY> C<$DUMPTYPE_ESTIMATELIST> C<$DUMPTYPE_COMPRESS> C<$DUMPTYPE_ENCRYPT> C<$DUMPTYPE_SRV_DECRYPT_OPT> C<$DUMPTYPE_CLNT_DECRYPT_OPT> C<$DUMPTYPE_COMPRATE> C<$DUMPTYPE_TAPE_SPLITSIZE> C<$DUMPTYPE_FALLBACK_SPLITSIZE> C<$DUMPTYPE_SPLIT_DISKBUFFER> C<$DUMPTYPE_RECORD> C<$DUMPTYPE_SKIP_INCR> C<$DUMPTYPE_SKIP_FULL> C<$DUMPTYPE_HOLDINGDISK> C<$DUMPTYPE_KENCRYPT> C<$DUMPTYPE_IGNORE> C<$DUMPTYPE_INDEX> C<$DUMPTYPE_APPLICATION> C<$DUMPTYPE_SCRIPTLIST> C<$DUMPTYPE_PROPERTY> C<$DUMPTYPE_DATA_PATH> C<$DUMPTYPE_ALLOW_SPLIT> C<$DUMPTYPE_RECOVERY_LIMIT>
+Dumptype Parameters:       C<$DUMPTYPE_COMMENT> C<$DUMPTYPE_PROGRAM> C<$DUMPTYPE_SRVCOMPPROG> C<$DUMPTYPE_CLNTCOMPPROG> C<$DUMPTYPE_SRV_ENCRYPT> C<$DUMPTYPE_CLNT_ENCRYPT> C<$DUMPTYPE_AMANDAD_PATH> C<$DUMPTYPE_CLIENT_USERNAME> C<$DUMPTYPE_CLIENT_PORT> C<$DUMPTYPE_SSH_KEYS> C<$DUMPTYPE_AUTH> C<$DUMPTYPE_EXCLUDE> C<$DUMPTYPE_INCLUDE> C<$DUMPTYPE_PRIORITY> C<$DUMPTYPE_DUMPCYCLE> C<$DUMPTYPE_MAXDUMPS> C<$DUMPTYPE_MAXPROMOTEDAY> C<$DUMPTYPE_BUMPPERCENT> C<$DUMPTYPE_BUMPSIZE> C<$DUMPTYPE_BUMPDAYS> C<$DUMPTYPE_BUMPMULT> C<$DUMPTYPE_STARTTIME> C<$DUMPTYPE_STRATEGY> C<$DUMPTYPE_ESTIMATELIST> C<$DUMPTYPE_COMPRESS> C<$DUMPTYPE_ENCRYPT> C<$DUMPTYPE_SRV_DECRYPT_OPT> C<$DUMPTYPE_CLNT_DECRYPT_OPT> C<$DUMPTYPE_COMPRATE> C<$DUMPTYPE_TAPE_SPLITSIZE> C<$DUMPTYPE_FALLBACK_SPLITSIZE> C<$DUMPTYPE_SPLIT_DISKBUFFER> C<$DUMPTYPE_RECORD> C<$DUMPTYPE_SKIP_INCR> C<$DUMPTYPE_SKIP_FULL> C<$DUMPTYPE_HOLDINGDISK> C<$DUMPTYPE_KENCRYPT> C<$DUMPTYPE_IGNORE> C<$DUMPTYPE_INDEX> C<$DUMPTYPE_APPLICATION> C<$DUMPTYPE_SCRIPTLIST> C<$DUMPTYPE_PROPERTY> C<$DUMPTYPE_DATA_PATH> C<$DUMPTYPE_ALLOW_SPLIT> C<$DUMPTYPE_RECOVERY_LIMIT>  C<$DUMPTYPE_DUMP_LIMIT>
 
 =cut
 
@@ -888,9 +916,9 @@ sub application_key_to_string {
     return $enumval;
 }
 
-push @EXPORT_OK, qw( $APPLICATION_COMMENT $APPLICATION_PLUGIN $APPLICATION_PROPERTY);
-push @{$EXPORT_TAGS{"application_key"}}, qw( $APPLICATION_COMMENT $APPLICATION_PLUGIN $APPLICATION_PROPERTY);
-      foreach (qw(  APPLICATION_COMMENT APPLICATION_PLUGIN APPLICATION_PROPERTY)) {    $_application_key_VALUES{$_} = $$_;      }  
+push @EXPORT_OK, qw( $APPLICATION_COMMENT $APPLICATION_PLUGIN $APPLICATION_PROPERTY  $APPLICATION_CLIENT_NAME);
+push @{$EXPORT_TAGS{"application_key"}}, qw( $APPLICATION_COMMENT $APPLICATION_PLUGIN $APPLICATION_PROPERTY  $APPLICATION_CLIENT_NAME);
+      foreach (qw(  APPLICATION_COMMENT APPLICATION_PLUGIN APPLICATION_PROPERTY  APPLICATION_CLIENT_NAME)) {   $_application_key_VALUES{$_} = $$_;      }  
 #copy symbols in application_key to getconf
 push @{$EXPORT_TAGS{"getconf"}},  @{$EXPORT_TAGS{"application_key"}};
 
@@ -899,7 +927,7 @@ use Amanda::Config::FoldingHash;
 
 =pod
 
-Application Parameters:       C<$APPLICATION_COMMENT> C<$APPLICATION_PLUGIN> C<$APPLICATION_PROPERTY>
+Application Parameters:       C<$APPLICATION_COMMENT> C<$APPLICATION_PLUGIN> C<$APPLICATION_PROPERTY>  C<$APPLICATION_CLIENT_NAME>
 
 =cut
 
@@ -924,9 +952,9 @@ sub pp_script_key_to_string {
     return $enumval;
 }
 
-push @EXPORT_OK, qw( $PP_SCRIPT_COMMENT $PP_SCRIPT_PLUGIN $PP_SCRIPT_PROPERTY $PP_SCRIPT_EXECUTE_ON $PP_SCRIPT_EXECUTE_WHERE $PP_SCRIPT_ORDER);
-push @{$EXPORT_TAGS{"pp_script_key"}}, qw( $PP_SCRIPT_COMMENT $PP_SCRIPT_PLUGIN $PP_SCRIPT_PROPERTY $PP_SCRIPT_EXECUTE_ON $PP_SCRIPT_EXECUTE_WHERE $PP_SCRIPT_ORDER);
-      foreach (qw(  PP_SCRIPT_COMMENT PP_SCRIPT_PLUGIN PP_SCRIPT_PROPERTY PP_SCRIPT_EXECUTE_ON PP_SCRIPT_EXECUTE_WHERE PP_SCRIPT_ORDER)) {     $_pp_script_key_VALUES{$_} = $$_;      }  
+push @EXPORT_OK, qw( $PP_SCRIPT_COMMENT $PP_SCRIPT_PLUGIN $PP_SCRIPT_PROPERTY $PP_SCRIPT_EXECUTE_ON $PP_SCRIPT_EXECUTE_WHERE $PP_SCRIPT_ORDER $PP_SCRIPT_SINGLE_EXECUTION $PP_SCRIPT_CLIENT_NAME);
+push @{$EXPORT_TAGS{"pp_script_key"}}, qw( $PP_SCRIPT_COMMENT $PP_SCRIPT_PLUGIN $PP_SCRIPT_PROPERTY $PP_SCRIPT_EXECUTE_ON $PP_SCRIPT_EXECUTE_WHERE $PP_SCRIPT_ORDER $PP_SCRIPT_SINGLE_EXECUTION $PP_SCRIPT_CLIENT_NAME);
+      foreach (qw(  PP_SCRIPT_COMMENT PP_SCRIPT_PLUGIN PP_SCRIPT_PROPERTY PP_SCRIPT_EXECUTE_ON PP_SCRIPT_EXECUTE_WHERE PP_SCRIPT_ORDER PP_SCRIPT_SINGLE_EXECUTION PP_SCRIPT_CLIENT_NAME)) {    $_pp_script_key_VALUES{$_} = $$_;      }  
 #copy symbols in pp_script_key to getconf
 push @{$EXPORT_TAGS{"getconf"}},  @{$EXPORT_TAGS{"pp_script_key"}};
 
@@ -935,7 +963,7 @@ use Amanda::Config::FoldingHash;
 
 =pod
 
-Pre/Post-Script Parameters:       C<$PP_SCRIPT_COMMENT> C<$PP_SCRIPT_PLUGIN> C<$PP_SCRIPT_PROPERTY> C<$PP_SCRIPT_EXECUTE_ON> C<$PP_SCRIPT_EXECUTE_WHERE> C<$PP_SCRIPT_ORDER>
+Pre/Post-Script Parameters:       C<$PP_SCRIPT_COMMENT> C<$PP_SCRIPT_PLUGIN> C<$PP_SCRIPT_PROPERTY> C<$PP_SCRIPT_EXECUTE_ON> C<$PP_SCRIPT_EXECUTE_WHERE> C<$PP_SCRIPT_ORDER> C<$PP_SCRIPT_SINGLE_EXECUTION> C<$PP_SCRIPT_CLIENT_NAME>
 
 =cut
 
@@ -1011,6 +1039,78 @@ Pre/Post-Script Parameters:       C<$CHANGER_CONFIG_COMMENT> C<$CHANGER_CONFIG_T
 
 =cut
 
+push @EXPORT_OK, qw(interactivity_key_to_string);
+push @{$EXPORT_TAGS{"interactivity_key"}}, qw(interactivity_key_to_string);
+
+my %_interactivity_key_VALUES;
+#Convert an enum value to a single string
+sub interactivity_key_to_string {
+    my ($enumval) = @_;
+
+    for my $k (keys %_interactivity_key_VALUES) {
+       my $v = $_interactivity_key_VALUES{$k};
+
+       #is this a matching flag?
+       if ($enumval == $v) {
+           return $k;
+       }
+    }
+
+#default, just return the number
+    return $enumval;
+}
+
+push @EXPORT_OK, qw( $INTERACTIVITY_COMMENT $INTERACTIVITY_PLUGIN $INTERACTIVITY_PROPERTY);
+push @{$EXPORT_TAGS{"interactivity_key"}}, qw( $INTERACTIVITY_COMMENT $INTERACTIVITY_PLUGIN $INTERACTIVITY_PROPERTY);
+      foreach (qw(  INTERACTIVITY_COMMENT INTERACTIVITY_PLUGIN INTERACTIVITY_PROPERTY)) {      $_interactivity_key_VALUES{$_} = $$_;      }  
+#copy symbols in interactivity_key to getconf
+push @{$EXPORT_TAGS{"getconf"}},  @{$EXPORT_TAGS{"interactivity_key"}};
+
+
+use Amanda::Config::FoldingHash;
+
+=pod
+
+Interactivity Parameters:       C<$INTERACTIVITY_COMMENT> C<$INTERACTIVITY_PLUGIN> C<$INTERACTIVITY_PROPERTY>
+
+=cut
+
+push @EXPORT_OK, qw(taperscan_key_to_string);
+push @{$EXPORT_TAGS{"taperscan_key"}}, qw(taperscan_key_to_string);
+
+my %_taperscan_key_VALUES;
+#Convert an enum value to a single string
+sub taperscan_key_to_string {
+    my ($enumval) = @_;
+
+    for my $k (keys %_taperscan_key_VALUES) {
+       my $v = $_taperscan_key_VALUES{$k};
+
+       #is this a matching flag?
+       if ($enumval == $v) {
+           return $k;
+       }
+    }
+
+#default, just return the number
+    return $enumval;
+}
+
+push @EXPORT_OK, qw( $TAPERSCAN_COMMENT $TAPERSCAN_PLUGIN $TAPERSCAN_PROPERTY);
+push @{$EXPORT_TAGS{"taperscan_key"}}, qw( $TAPERSCAN_COMMENT $TAPERSCAN_PLUGIN $TAPERSCAN_PROPERTY);
+      foreach (qw(  TAPERSCAN_COMMENT TAPERSCAN_PLUGIN TAPERSCAN_PROPERTY)) {          $_taperscan_key_VALUES{$_} = $$_;      }  
+#copy symbols in taperscan_key to getconf
+push @{$EXPORT_TAGS{"getconf"}},  @{$EXPORT_TAGS{"taperscan_key"}};
+
+
+use Amanda::Config::FoldingHash;
+
+=pod
+
+Taperscan Parameters:       C<$TAPERSCAN_COMMENT> C<$TAPERSCAN_PLUGIN> C<$TAPERSCAN_PROPERTY>
+
+=cut
+
 push @EXPORT_OK, qw(dump_holdingdisk_t_to_string);
 push @{$EXPORT_TAGS{"dump_holdingdisk_t"}}, qw(dump_holdingdisk_t_to_string);
 
@@ -1370,6 +1470,11 @@ sub execute_on_t_to_string {
     return $enumval;
 }
 
+push @EXPORT_OK, qw($EXECUTE_ON_PRE_AMCHECK);
+push @{$EXPORT_TAGS{"execute_on_t"}}, qw($EXECUTE_ON_PRE_AMCHECK);
+
+$_execute_on_t_VALUES{"EXECUTE_ON_PRE_AMCHECK"} = $EXECUTE_ON_PRE_AMCHECK;
+
 push @EXPORT_OK, qw($EXECUTE_ON_PRE_DLE_AMCHECK);
 push @{$EXPORT_TAGS{"execute_on_t"}}, qw($EXECUTE_ON_PRE_DLE_AMCHECK);
 
@@ -1380,6 +1485,11 @@ push @{$EXPORT_TAGS{"execute_on_t"}}, qw($EXECUTE_ON_PRE_HOST_AMCHECK);
 
 $_execute_on_t_VALUES{"EXECUTE_ON_PRE_HOST_AMCHECK"} = $EXECUTE_ON_PRE_HOST_AMCHECK;
 
+push @EXPORT_OK, qw($EXECUTE_ON_POST_AMCHECK);
+push @{$EXPORT_TAGS{"execute_on_t"}}, qw($EXECUTE_ON_POST_AMCHECK);
+
+$_execute_on_t_VALUES{"EXECUTE_ON_POST_AMCHECK"} = $EXECUTE_ON_POST_AMCHECK;
+
 push @EXPORT_OK, qw($EXECUTE_ON_POST_DLE_AMCHECK);
 push @{$EXPORT_TAGS{"execute_on_t"}}, qw($EXECUTE_ON_POST_DLE_AMCHECK);
 
@@ -1390,6 +1500,11 @@ push @{$EXPORT_TAGS{"execute_on_t"}}, qw($EXECUTE_ON_POST_HOST_AMCHECK);
 
 $_execute_on_t_VALUES{"EXECUTE_ON_POST_HOST_AMCHECK"} = $EXECUTE_ON_POST_HOST_AMCHECK;
 
+push @EXPORT_OK, qw($EXECUTE_ON_PRE_ESTIMATE);
+push @{$EXPORT_TAGS{"execute_on_t"}}, qw($EXECUTE_ON_PRE_ESTIMATE);
+
+$_execute_on_t_VALUES{"EXECUTE_ON_PRE_ESTIMATE"} = $EXECUTE_ON_PRE_ESTIMATE;
+
 push @EXPORT_OK, qw($EXECUTE_ON_PRE_DLE_ESTIMATE);
 push @{$EXPORT_TAGS{"execute_on_t"}}, qw($EXECUTE_ON_PRE_DLE_ESTIMATE);
 
@@ -1400,6 +1515,11 @@ push @{$EXPORT_TAGS{"execute_on_t"}}, qw($EXECUTE_ON_PRE_HOST_ESTIMATE);
 
 $_execute_on_t_VALUES{"EXECUTE_ON_PRE_HOST_ESTIMATE"} = $EXECUTE_ON_PRE_HOST_ESTIMATE;
 
+push @EXPORT_OK, qw($EXECUTE_ON_POST_ESTIMATE);
+push @{$EXPORT_TAGS{"execute_on_t"}}, qw($EXECUTE_ON_POST_ESTIMATE);
+
+$_execute_on_t_VALUES{"EXECUTE_ON_POST_ESTIMATE"} = $EXECUTE_ON_POST_ESTIMATE;
+
 push @EXPORT_OK, qw($EXECUTE_ON_POST_DLE_ESTIMATE);
 push @{$EXPORT_TAGS{"execute_on_t"}}, qw($EXECUTE_ON_POST_DLE_ESTIMATE);
 
@@ -1410,6 +1530,11 @@ push @{$EXPORT_TAGS{"execute_on_t"}}, qw($EXECUTE_ON_POST_HOST_ESTIMATE);
 
 $_execute_on_t_VALUES{"EXECUTE_ON_POST_HOST_ESTIMATE"} = $EXECUTE_ON_POST_HOST_ESTIMATE;
 
+push @EXPORT_OK, qw($EXECUTE_ON_PRE_BACKUP);
+push @{$EXPORT_TAGS{"execute_on_t"}}, qw($EXECUTE_ON_PRE_BACKUP);
+
+$_execute_on_t_VALUES{"EXECUTE_ON_PRE_BACKUP"} = $EXECUTE_ON_PRE_BACKUP;
+
 push @EXPORT_OK, qw($EXECUTE_ON_PRE_DLE_BACKUP);
 push @{$EXPORT_TAGS{"execute_on_t"}}, qw($EXECUTE_ON_PRE_DLE_BACKUP);
 
@@ -1420,6 +1545,11 @@ push @{$EXPORT_TAGS{"execute_on_t"}}, qw($EXECUTE_ON_PRE_HOST_BACKUP);
 
 $_execute_on_t_VALUES{"EXECUTE_ON_PRE_HOST_BACKUP"} = $EXECUTE_ON_PRE_HOST_BACKUP;
 
+push @EXPORT_OK, qw($EXECUTE_ON_POST_BACKUP);
+push @{$EXPORT_TAGS{"execute_on_t"}}, qw($EXECUTE_ON_POST_BACKUP);
+
+$_execute_on_t_VALUES{"EXECUTE_ON_POST_BACKUP"} = $EXECUTE_ON_POST_BACKUP;
+
 push @EXPORT_OK, qw($EXECUTE_ON_POST_DLE_BACKUP);
 push @{$EXPORT_TAGS{"execute_on_t"}}, qw($EXECUTE_ON_POST_DLE_BACKUP);
 
@@ -1550,6 +1680,9 @@ $_part_cache_type_t_VALUES{"PART_CACHE_TYPE_MEMORY"} = $PART_CACHE_TYPE_MEMORY;
 #copy symbols in part_cache_type_t to getconf
 push @{$EXPORT_TAGS{"getconf"}},  @{$EXPORT_TAGS{"part_cache_type_t"}};
 
+$LIMIT_SAMEHOST="SAMEHOST-SAMEHOST-SAMEHOST";
+$LIMIT_SERVER="SERVER-SERVER-SERVER";
+
 push @EXPORT_OK, qw(getconf getconf_seen getconf_linenum
     getconf_byname getconf_byname_strs
     getconf_list);
@@ -1599,6 +1732,16 @@ push @EXPORT_OK, qw(lookup_changer_config changer_config_getconf changer_config_
 push @{$EXPORT_TAGS{"getconf"}}, qw(lookup_changer_config changer_config_getconf changer_config_name
     changer_config_seen changer_config_seen);
 
+push @EXPORT_OK, qw(lookup_interactivity interactivity_getconf interactivity_name
+    interactivity_seen interactivity_seen);
+push @{$EXPORT_TAGS{"getconf"}}, qw(lookup_interactivity interactivity_getconf interactivity_name
+    interactivity_seen interactivity_seen);
+
+push @EXPORT_OK, qw(lookup_taperscan taperscan_getconf taperscan_name
+    taperscan_seen taperscan_seen);
+push @{$EXPORT_TAGS{"getconf"}}, qw(lookup_taperscan taperscan_getconf taperscan_name
+    taperscan_seen taperscan_seen);
+
 # only those keys with a value of '1' should be shown; the
 # others are deprecated
 our %subsection_names = (
index 6a0b6aa21879c43196383278f44c9079ea44979d..3049a135ae3b5ad8880adb8cad135e0face42f4b 100644 (file)
@@ -54,6 +54,7 @@ DESCRIPTION: amglue_constants_list(FORALL_FN)
 #define FOR_ALL_CONFPARM_KEY(APPLY)\
 APPLY(CNF_ORG)\
 APPLY(CNF_CONF)\
+APPLY(CNF_AMDUMP_SERVER)\
 APPLY(CNF_INDEX_SERVER)\
 APPLY(CNF_TAPE_SERVER)\
 APPLY(CNF_AUTH)\
@@ -73,6 +74,7 @@ APPLY(CNF_CHANGERDEV)\
 APPLY(CNF_CHANGERFILE)\
 APPLY(CNF_LABELSTR)\
 APPLY(CNF_AUTOLABEL)\
+APPLY(CNF_META_AUTOLABEL)\
 APPLY(CNF_TAPELIST)\
 APPLY(CNF_DISKFILE)\
 APPLY(CNF_INFOFILE)\
@@ -139,7 +141,9 @@ APPLY(CNF_UNRESERVED_TCP_PORT)\
 APPLY(CNF_HOLDINGDISK)\
 APPLY(CNF_SEND_AMREPORT_ON)\
 APPLY(CNF_TAPER_PARALLEL_WRITE)\
-APPLY(CNF_RECOVERY_LIMIT)
+APPLY(CNF_RECOVERY_LIMIT) \
+APPLY(CNF_INTERACTIVITY) \
+APPLY(CNF_TAPERSCAN)
 
 amglue_add_enum_tag_fns(confparm_key);
 amglue_add_constants(FOR_ALL_CONFPARM_KEY, confparm_key);
@@ -209,7 +213,8 @@ APPLY(DUMPTYPE_SCRIPTLIST)\
 APPLY(DUMPTYPE_PROPERTY)\
 APPLY(DUMPTYPE_DATA_PATH)\
 APPLY(DUMPTYPE_ALLOW_SPLIT)\
-APPLY(DUMPTYPE_RECOVERY_LIMIT)
+APPLY(DUMPTYPE_RECOVERY_LIMIT) \
+APPLY(DUMPTYPE_DUMP_LIMIT)
 
 amglue_add_enum_tag_fns(dumptype_key);
 amglue_add_constants(FOR_ALL_DUMPTYPE_KEY, dumptype_key);
@@ -239,7 +244,8 @@ constant_pod(Holdingdisk Parameters, FOR_ALL_HOLDINGDISK_KEY)
 #define FOR_ALL_APPLICATION_KEY(APPLY)\
 APPLY(APPLICATION_COMMENT)\
 APPLY(APPLICATION_PLUGIN)\
-APPLY(APPLICATION_PROPERTY)
+APPLY(APPLICATION_PROPERTY) \
+APPLY(APPLICATION_CLIENT_NAME)
 
 amglue_add_enum_tag_fns(application_key);
 amglue_add_constants(FOR_ALL_APPLICATION_KEY, application_key);
@@ -252,7 +258,9 @@ APPLY(PP_SCRIPT_PLUGIN)\
 APPLY(PP_SCRIPT_PROPERTY)\
 APPLY(PP_SCRIPT_EXECUTE_ON)\
 APPLY(PP_SCRIPT_EXECUTE_WHERE)\
-APPLY(PP_SCRIPT_ORDER)
+APPLY(PP_SCRIPT_ORDER)\
+APPLY(PP_SCRIPT_SINGLE_EXECUTION)\
+APPLY(PP_SCRIPT_CLIENT_NAME)
 
 amglue_add_enum_tag_fns(pp_script_key);
 amglue_add_constants(FOR_ALL_PP_SCRIPT_KEY, pp_script_key);
@@ -283,6 +291,26 @@ amglue_add_constants(FOR_ALL_CHANGER_CONFIG_KEY, changer_config_key);
 amglue_copy_to_tag(changer_config_key, getconf);
 constant_pod(Pre/Post-Script Parameters, FOR_ALL_CHANGER_CONFIG_KEY)
 
+#define FOR_ALL_INTERACTIVITY_KEY(APPLY)\
+APPLY(INTERACTIVITY_COMMENT)\
+APPLY(INTERACTIVITY_PLUGIN)\
+APPLY(INTERACTIVITY_PROPERTY)
+
+amglue_add_enum_tag_fns(interactivity_key);
+amglue_add_constants(FOR_ALL_INTERACTIVITY_KEY, interactivity_key);
+amglue_copy_to_tag(interactivity_key, getconf);
+constant_pod(Interactivity Parameters, FOR_ALL_INTERACTIVITY_KEY)
+
+#define FOR_ALL_TAPERSCAN_KEY(APPLY)\
+APPLY(TAPERSCAN_COMMENT)\
+APPLY(TAPERSCAN_PLUGIN)\
+APPLY(TAPERSCAN_PROPERTY)
+
+amglue_add_enum_tag_fns(taperscan_key);
+amglue_add_constants(FOR_ALL_TAPERSCAN_KEY, taperscan_key);
+amglue_copy_to_tag(taperscan_key, getconf);
+constant_pod(Taperscan Parameters, FOR_ALL_TAPERSCAN_KEY)
+
 /*
  * Various enumerated conftypes
  */
@@ -343,16 +371,22 @@ amglue_add_constant(ALGO_LAST, taperalgo_t);
 amglue_copy_to_tag(taperalgo_t, getconf);
 
 amglue_add_enum_tag_fns(execute_on_t);
+amglue_add_constant(EXECUTE_ON_PRE_AMCHECK, execute_on_t);
 amglue_add_constant(EXECUTE_ON_PRE_DLE_AMCHECK, execute_on_t);
 amglue_add_constant(EXECUTE_ON_PRE_HOST_AMCHECK, execute_on_t);
+amglue_add_constant(EXECUTE_ON_POST_AMCHECK, execute_on_t);
 amglue_add_constant(EXECUTE_ON_POST_DLE_AMCHECK, execute_on_t);
 amglue_add_constant(EXECUTE_ON_POST_HOST_AMCHECK, execute_on_t);
+amglue_add_constant(EXECUTE_ON_PRE_ESTIMATE, execute_on_t);
 amglue_add_constant(EXECUTE_ON_PRE_DLE_ESTIMATE, execute_on_t);
 amglue_add_constant(EXECUTE_ON_PRE_HOST_ESTIMATE, execute_on_t);
+amglue_add_constant(EXECUTE_ON_POST_ESTIMATE, execute_on_t);
 amglue_add_constant(EXECUTE_ON_POST_DLE_ESTIMATE, execute_on_t);
 amglue_add_constant(EXECUTE_ON_POST_HOST_ESTIMATE, execute_on_t);
+amglue_add_constant(EXECUTE_ON_PRE_BACKUP, execute_on_t);
 amglue_add_constant(EXECUTE_ON_PRE_DLE_BACKUP, execute_on_t);
 amglue_add_constant(EXECUTE_ON_PRE_HOST_BACKUP, execute_on_t);
+amglue_add_constant(EXECUTE_ON_POST_BACKUP, execute_on_t);
 amglue_add_constant(EXECUTE_ON_POST_DLE_BACKUP, execute_on_t);
 amglue_add_constant(EXECUTE_ON_POST_HOST_BACKUP, execute_on_t);
 amglue_copy_to_tag(execute_on_t, getconf);
@@ -380,7 +414,7 @@ amglue_copy_to_tag(part_cache_type_t, getconf);
  */
 
 /* Typemap to convert a val_t to an SV, using a static function since it's huge.  This converts:
- *  - CONFTYPE_SIZE, CONFTYPE_INT, CONFTYPE_INT64,
+ *  - CONFTYPE_SIZE, CONFTYPE_INT, CONFTYPE_INT64, CONFTYPE_NO_YES_ALL,
  *    CONFTYPE_BOOLEAN -> IV
  *  - CONFTYPE_REAL -> NV
  *  - CONFTYPE_STR, CONFTYPE_IDENT -> PV
@@ -396,9 +430,16 @@ amglue_copy_to_tag(part_cache_type_t, getconf);
  *    and 'optional' (int)
  *  - CONFTYPE_PROPLIST -> hashref of hashref with keys 'append' (IV), 'priority' (IV),
  *                                                     'values' (listref)
- *  - CONFTYPE_RECOVERY_LIMIT -> listref of match expressions; undef in list is taken
- *                 to mean 'same-host'
+ *  - CONFTYPE_HOST_LIMIT -> listref of match expressions;
+ *           "SAMEHOST-SAMEHOST-SAMEHOST" in list is taken to mean 'same-host'
+ *           "SERVER-SERVER-SERVER" in list is taken to mean 'server'
  */
+
+%perlcode %{
+$LIMIT_SAMEHOST="SAMEHOST-SAMEHOST-SAMEHOST";
+$LIMIT_SERVER="SERVER-SERVER-SERVER";
+%}
+
 %{
 static int
 val_t_to_sv(val_t *val, SV **results) {
@@ -480,6 +521,7 @@ val_t_to_sv(val_t *val, SV **results) {
                return 1;
 
            case CONFTYPE_BOOLEAN:          /* all same as INT.. */
+           case CONFTYPE_NO_YES_ALL:
            case CONFTYPE_COMPRESS:
            case CONFTYPE_ENCRYPT:
            case CONFTYPE_STRATEGY:
@@ -533,14 +575,16 @@ val_t_to_sv(val_t *val, SV **results) {
                return 1;
            }
 
-           case CONFTYPE_RECOVERY_LIMIT: {
+           case CONFTYPE_HOST_LIMIT: {
                AV *av;
                GSList *iter;
-               recovery_limit_t *rl = &val_t__recovery_limit(val);
+               host_limit_t *rl = &val_t__host_limit(val);
 
                av = newAV();
                if (rl->same_host)
-                   av_push(av, &PL_sv_undef);
+                   av_push(av, newSVpv("SAMEHOST-SAMEHOST-SAMEHOST", 0));
+               if (rl->server)
+                   av_push(av, newSVpv("SERVER-SERVER-SERVER", 0));
                for (iter=rl->match_pats; iter != NULL; iter = iter->next) {
                    av_push(av, newSVpv((char *)iter->data, 0));
                }
@@ -731,6 +775,24 @@ amglue_export_tag(getconf,
     changer_config_seen changer_config_seen
 );
 
+interactivity_t *lookup_interactivity(char *identifier);
+val_t *interactivity_getconf(interactivity_t *app, interactivity_key key);
+char *interactivity_name(interactivity_t *app);
+gboolean interactivity_seen(interactivity_t *app, interactivity_key key);
+amglue_export_tag(getconf,
+    lookup_interactivity interactivity_getconf interactivity_name
+    interactivity_seen interactivity_seen
+);
+
+taperscan_t *lookup_taperscan(char *identifier);
+val_t *taperscan_getconf(taperscan_t *app, taperscan_key key);
+char *taperscan_name(taperscan_t *app);
+gboolean taperscan_seen(taperscan_t *app, taperscan_key key);
+amglue_export_tag(getconf,
+    lookup_taperscan taperscan_getconf taperscan_name
+    taperscan_seen taperscan_seen
+);
+
 %perlcode %{
 # only those keys with a value of '1' should be shown; the
 # others are deprecated
index bbb61e167d894070f59c842f28fe3c6859d2cf7d..e3692c95c117ca66478f703e02106b41adf5f359 100644 (file)
@@ -78,6 +78,8 @@ $LOCKING = "@LOCKING@";
 $MAILER = "@MAILER@";
 $MT = "@MT@";
 $MTX = "@MTX@";
+$MOUNT = "@MOUNT@";
+$UMOUNT = "@UMOUNT@";
 $LPR = "@LPR@";
 $LPRFLAG = "@LPRFLAG@";
 $PS = "@PS@";
@@ -91,6 +93,7 @@ $SERVER_HOST_KEY_FILE = "@SERVER_HOST_KEY_FILE@";
 $SERVER_HOST_PRINCIPAL = "@SERVER_HOST_PRINCIPAL@";
 $SSH_SECURITY = "@SSH_SECURITY@";
 $STAR = "@STAR@";
+$SUNTAR = "@SUNTAR@";
 $TICKET_LIFETIME = "@TICKET_LIFETIME@";
 $UNCOMPRESS_OPT = "@UNCOMPRESS_OPT@";
 $UNCOMPRESS_PATH = "@UNCOMPRESS_PATH@";
index f541ac503f312f525f12022216a84ed2cbe38078..162c731e87abd1fa2249f618a4827f02f138ea3a 100644 (file)
@@ -101,6 +101,10 @@ have an associated dump row.
 
 (integer) -- number of successful parts in this dump
 
+=item bytes
+
+(integer) -- size (in bytes) of the dump on disk, 0 if the size is not known.
+
 =item kb
 
 (integer) -- size (in kb) of the dump on disk
@@ -646,9 +650,10 @@ sub get_parts_and_dumps {
                    # the rest of these params are unknown until we see a taper
                    # DONE, PARTIAL, or FAIL line, although we count nparts
                    # manually instead of relying on the logfile
-                   nparts => 0,
-                   kb => -1,
-                   sec => -1,
+                   nparts => 0, # $find_result->{'totalparts'}
+                   bytes => -1, # $find_result->{'bytes'}
+                   kb => -1,    # $find_result->{'kb'}
+                   sec => -1,   # $find_result->{'sec'}
                };
            }
 
@@ -679,6 +684,7 @@ sub get_parts_and_dumps {
                );
                # and fix up the dump, too
                $dump->{'status'} = $find_result->{'status'} || 'FAILED';
+               $dump->{'bytes'} = $find_result->{'bytes'};
                $dump->{'kb'} = $find_result->{'kb'};
                $dump->{'sec'} = $find_result->{'sec'};
            }
@@ -723,20 +729,33 @@ sub get_parts_and_dumps {
 
            # now extract the appropriate info; luckily these log lines have the same
            # format, more or less
-           my ($hostname, $diskname, $dump_timestamp, $nparts, $level, $secs, $kb, $message);
+           my ($hostname, $diskname, $dump_timestamp, $nparts, $level, $secs, $kb, $bytes, $message);
            ($hostname, $str) = Amanda::Util::skip_quoted_string($str);
            ($diskname, $str) = Amanda::Util::skip_quoted_string($str);
            ($dump_timestamp, $str) = Amanda::Util::skip_quoted_string($str);
            if ($status ne 'FAIL' and $type != $L_SUCCESS) { # nparts is not in SUCCESS lines
-               ($nparts, $str) = Amanda::Util::skip_quoted_string($str);
+               ($nparts, my $str1) = Amanda::Util::skip_quoted_string($str);
+               if (substr($str1, 0,1) ne '[') {
+                   $str = $str1;
+               } else { # nparts is not in all PARTIAL lines
+                   $nparts = 0;
+               }
+               
            } else {
                $nparts = 0;
            }
            ($level, $str) = Amanda::Util::skip_quoted_string($str);
            if ($status ne 'FAIL') {
                my $s = $str;
-               ($secs, $kb, $str) = ($str =~ /^\[sec ([-0-9.]+) kb (\d+).*\] ?(.*)$/)
+               my $b_unit;
+               ($secs, $b_unit, $kb, $str) = ($str =~ /^\[sec ([-0-9.]+) (kb|bytes) ([-0-9]+).*\] ?(.*)$/)
                    or die("'$s'");
+               if ($b_unit eq 'bytes') {
+                   $bytes = $kb;
+                   $kb /= 1024;
+               } else {
+                   $bytes = 0;
+               }
                $secs = 0.1 if ($secs <= 0);
            }
            if ($status ne 'OK') {
@@ -812,9 +831,11 @@ sub get_parts_and_dumps {
 
            $dump->{'message'} = $message;
            if ($status eq 'FAIL') {
+               $dump->{'bytes'} = 0;
                $dump->{'kb'} = 0;
                $dump->{'sec'} = 0.0;
            } else {
+               $dump->{'bytes'} = $bytes+0;
                $dump->{'kb'} = $kb+0;
                $dump->{'sec'} = $secs+0.0;
            }
index bb3a19d022171735cc56bde5a8b900a415cd2dd5..b3701bd4c3b78728aca48e224f7d600ed0d067cf 100644 (file)
@@ -1542,6 +1542,8 @@ SWIGEXPORT void SWIG_init (CV *cv, CPerlObj *);
 #include "fileheader.h"
 #include "glib-util.h"
 #include "simpleprng.h"
+#include "amanda.h"
+#include "sockaddr-util.h"
 
 
 
@@ -2029,6 +2031,9 @@ SWIGINTERN void Device_property_get(Device *self,DevicePropertyBase *pbase,GValu
        }
 SWIGINTERN gboolean Device_property_set(Device *self,DevicePropertyBase *pbase,SV *sv){
            GValue gval;
+
+           if (!pbase)
+               goto fail;
            memset(&gval, 0, sizeof(gval));
            g_value_init(&gval, pbase->type);
            if (!set_gvalue_from_sv(sv, &gval))
@@ -3078,16 +3083,12 @@ XS(_wrap_Device_listen) {
         AV *av = newAV();
         int i = 0;
         
-        while (iter && iter->ipv4) {
-          struct in_addr in;
-          char *addr;
+        while (iter && SU_GET_FAMILY(iter) != 0) {
+          char *addr = str_sockaddr_no_port(iter);
           AV *tuple = newAV();
           
-          in.s_addr = htonl(iter->ipv4);
-          addr = inet_ntoa(in);
-          g_assert(NULL != av_store(tuple, 0,
-              newSVpv(addr, 0)));
-          g_assert(NULL != av_store(tuple, 1, newSViv(iter->port)));
+          g_assert(NULL != av_store(tuple, 0, newSVpv(addr, 0)));
+          g_assert(NULL != av_store(tuple, 1, newSViv(SU_GET_PORT(iter))));
           g_assert(NULL != av_store(av, i++, newRV_noinc((SV *)tuple)));
           iter++;
         }
@@ -3174,7 +3175,7 @@ XS(_wrap_Device_connect) {
       for (i = 0; i < num_addrs; i++) {
         SV **svp = av_fetch(addrs_av, i, 0);
         AV *addr_av;
-        struct in_addr addr;
+        sockaddr_union addr;
         IV port;
         
         if (!svp || !SvROK(*svp) || SvTYPE(SvRV(*svp)) != SVt_PVAV
@@ -3186,17 +3187,18 @@ XS(_wrap_Device_connect) {
         
         /* get address */
         svp = av_fetch(addr_av, 0, 0);
-        if (!svp || !SvPOK(*svp) || !inet_aton(SvPV_nolen(*svp), &addr)) {
+        if (!svp || !SvPOK(*svp) || !str_to_sockaddr(SvPV_nolen(*svp), &addr)) {
           SWIG_exception_fail(SWIG_TypeError, "invalid IPv4 addr in address");
         }
-        arg3[i].ipv4 = ntohl(addr.s_addr);
         
         /* get port */
         svp = av_fetch(addr_av, 1, 0);
         if (!svp || !SvIOK(*svp) || (port = SvIV(*svp)) <= 0 || port >= 65536) {
           SWIG_exception_fail(SWIG_TypeError, "invalid port in address");
         }
-        arg3[i].port = (guint16)port;
+        SU_SET_PORT(&addr, port);
+        
+        copy_sockaddr(arg3, &addr);
       }
     }
     result = (DirectTCPConnection *)Device_connect(arg1,arg2,arg3);
index 479015d38da21ffffc025d1c39cf4cf2766c49b8..e661934ca2e03aab842eb48004d24075a0d072ad 100644 (file)
@@ -31,6 +31,8 @@
 #include "fileheader.h"
 #include "glib-util.h"
 #include "simpleprng.h"
+#include "amanda.h"
+#include "sockaddr-util.h"
 %}
 
 %init %{
@@ -495,6 +497,9 @@ typedef struct Device {
        gboolean
        property_set(DevicePropertyBase *pbase, SV *sv) {
            GValue gval;
+
+           if (!pbase)
+               goto fail;
            memset(&gval, 0, sizeof(gval));
            g_value_init(&gval, pbase->type);
            if (!set_gvalue_from_sv(sv, &gval))
index af9196278e12443525531e9269eea8e07345617c..6999799f24a6752fcf433178f6b2573f692c8c0b 100644 (file)
@@ -1908,7 +1908,7 @@ static swig_type_info _swigt__p_char = {"_p_char", "gchar *|char *", 0, 0, (void
 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_int = {"_p_int", "application_key *|strategy_t *|pp_script_key *|int *|autolabel_enum_t *|comp_t *|dump_holdingdisk_t *|device_config_key *|changer_config_key *|confparm_key *|interface_key *|holdingdisk_key *|dumptype_key *|tapetype_key *|part_cache_type_t *|cfgerr_level_t *|encrypt_t *|taperalgo_t *|gboolean *|data_path_t *|execute_on_t *|send_amreport_on_t *|estimate_t *|config_init_flags *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_int = {"_p_int", "taperscan_key *|application_key *|strategy_t *|pp_script_key *|int *|autolabel_enum_t *|comp_t *|dump_holdingdisk_t *|changer_config_key *|confparm_key *|interface_key *|device_config_key *|holdingdisk_key *|dumptype_key *|tapetype_key *|interactivity_key *|part_cache_type_t *|cfgerr_level_t *|encrypt_t *|taperalgo_t *|gboolean *|data_path_t *|execute_on_t *|send_amreport_on_t *|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_unsigned_char = {"_p_unsigned_char", "guchar *|unsigned char *", 0, 0, (void*)0, 0};
 
index 77074c5ba5c9e115500da18f9fb46ac424e97741..9b90e8f06a64f892a3464a7226c6d6548ead051e 100644 (file)
@@ -2912,6 +2912,21 @@ XS(SWIG_init) {
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(fe_amindexd_quote_label)));
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "fe_amrecover_receive_unfiltered", TRUE | 0x2 | GV_ADDMULTI);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(fe_amrecover_receive_unfiltered)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "fe_application_client_name", TRUE | 0x2 | GV_ADDMULTI);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(fe_application_client_name)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
+  /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
+    SV *sv = get_sv((char*) SWIG_prefix "fe_script_client_name", TRUE | 0x2 | GV_ADDMULTI);
+    sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(fe_script_client_name)));
+    SvREADONLY_on(sv);
+  } while(0) /*@SWIG@*/;
   /*@SWIG:/usr/share/swig/1.3.39/perl5/perltypemaps.swg,65,%set_constant@*/ do {
     SV *sv = get_sv((char*) SWIG_prefix "last_feature", TRUE | 0x2 | GV_ADDMULTI);
     sv_setsv(sv, SWIG_From_int  SWIG_PERL_CALL_ARGS_1((int)(last_feature)));
index e99ad94755e5778d483ba87ca5528d38f7da2427..7e2fb8c566bdf606209c9a2b84be5736af061fc3 100644 (file)
@@ -195,6 +195,9 @@ package Amanda::Feature;
 *fe_amidxtaped_abort = *Amanda::Featurec::fe_amidxtaped_abort;
 *fe_amrecover_correct_disk_quoting = *Amanda::Featurec::fe_amrecover_correct_disk_quoting;
 *fe_amindexd_quote_label = *Amanda::Featurec::fe_amindexd_quote_label;
+*fe_amrecover_receive_unfiltered = *Amanda::Featurec::fe_amrecover_receive_unfiltered;
+*fe_application_client_name = *Amanda::Featurec::fe_application_client_name;
+*fe_script_client_name = *Amanda::Featurec::fe_script_client_name;
 *last_feature = *Amanda::Featurec::last_feature;
 
 @EXPORT_OK = ();
@@ -415,6 +418,13 @@ those DISK lines should be ignored.
 
 If set, amindexd quote the label (holdingdisk filename)
 
+=item fe_amrecover_receive_unfiltered
+
+ PROTOCOL: amidxtaped
+ FEATURE OF: client
+
+If set, amidxtaped do not decompress/decrypt client compressed/decrypted stream.
+
 =back
 
 =cut
index 21513563377c2a2b80c7f343350b6367ce4df6f1..0d88739639a10369103e9f512f8edf89f2315af5 100644 (file)
@@ -234,6 +234,13 @@ those DISK lines should be ignored.
 
 If set, amindexd quote the label (holdingdisk filename)
 
+=item fe_amrecover_receive_unfiltered
+
+ PROTOCOL: amidxtaped
+ FEATURE OF: client
+
+If set, amidxtaped do not decompress/decrypt client compressed/decrypted stream.
+
 =back
 
 =cut
index 5ad8837adba81fca4eb70594f6602423d26c13df..06c84ec0f95b721243f9df3729cc554e82c75c6e 100644 (file)
@@ -1477,16 +1477,25 @@ SWIG_Perl_SetModule(swig_module_info *module) {
 
 /* -------- 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_off_t swig_types[6]
-#define SWIGTYPE_p_unsigned_char swig_types[7]
-static swig_type_info *swig_types[9];
-static swig_module_info swig_module = {swig_types, 8, 0, 0, 0, 0};
+#define SWIGTYPE_p_GSList swig_types[0]
+#define SWIGTYPE_p_a_STRMAX__char swig_types[1]
+#define SWIGTYPE_p_a_dle_s swig_types[2]
+#define SWIGTYPE_p_char swig_types[3]
+#define SWIGTYPE_p_data_path_t swig_types[4]
+#define SWIGTYPE_p_dle_t swig_types[5]
+#define SWIGTYPE_p_double swig_types[6]
+#define SWIGTYPE_p_dumpfile_t swig_types[7]
+#define SWIGTYPE_p_estimatelist_t swig_types[8]
+#define SWIGTYPE_p_float swig_types[9]
+#define SWIGTYPE_p_int swig_types[10]
+#define SWIGTYPE_p_levellist_t swig_types[11]
+#define SWIGTYPE_p_off_t swig_types[12]
+#define SWIGTYPE_p_proplist_t swig_types[13]
+#define SWIGTYPE_p_scriptlist_t swig_types[14]
+#define SWIGTYPE_p_sl_t swig_types[15]
+#define SWIGTYPE_p_unsigned_char swig_types[16]
+static swig_type_info *swig_types[18];
+static swig_module_info swig_module = {swig_types, 17, 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)
 
@@ -1867,6 +1876,17 @@ static dumpfile_t *C_from_string(const char *string) {
     return result;
 }
 
+
+#include "amxml.h"
+
+SWIGINTERN dle_t *new_dle_t(char *dle_str){
+           char  *errmsg = NULL;
+           dle_t *dle;
+           dle = amxml_parse_node_CHAR(dle_str, &errmsg);
+           amfree(errmsg);
+           
+           return dle;
+       }
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -4172,46 +4192,2412 @@ XS(_wrap_C_from_string) {
 }
 
 
+XS(_wrap_HeaderXML_disk_set) {
+  {
+    dle_t *arg1 = (dle_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: HeaderXML_disk_set(self,disk);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_disk_set" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HeaderXML_disk_set" "', argument " "2"" of type '" "char *""'");
+    }
+    arg2 = (char *)(buf2);
+    if (arg1->disk) free((char*)arg1->disk);
+    if (arg2) {
+      size_t size = strlen((const char *)(arg2)) + 1;
+      arg1->disk = (char *)(char *)memcpy((char *)malloc((size)*sizeof(char)), (const char *)(arg2), sizeof(char)*(size));
+    } else {
+      arg1->disk = 0;
+    }
+    ST(argvi) = sv_newmortal();
+    
+    if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+    XSRETURN(argvi);
+  fail:
+    
+    if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_disk_get) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    char *result = 0 ;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: HeaderXML_disk_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_disk_get" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    result = (char *) ((arg1)->disk);
+    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_device_set) {
+  {
+    dle_t *arg1 = (dle_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: HeaderXML_device_set(self,device);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_device_set" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HeaderXML_device_set" "', argument " "2"" of type '" "char *""'");
+    }
+    arg2 = (char *)(buf2);
+    if (arg1->device) free((char*)arg1->device);
+    if (arg2) {
+      size_t size = strlen((const char *)(arg2)) + 1;
+      arg1->device = (char *)(char *)memcpy((char *)malloc((size)*sizeof(char)), (const char *)(arg2), sizeof(char)*(size));
+    } else {
+      arg1->device = 0;
+    }
+    ST(argvi) = sv_newmortal();
+    
+    if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+    XSRETURN(argvi);
+  fail:
+    
+    if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_device_get) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    char *result = 0 ;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: HeaderXML_device_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_device_get" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    result = (char *) ((arg1)->device);
+    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_program_is_application_api_set) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    int arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: HeaderXML_program_is_application_api_set(self,program_is_application_api);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_program_is_application_api_set" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_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)->program_is_application_api = arg2;
+    ST(argvi) = sv_newmortal();
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_program_is_application_api_get) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    int result;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: HeaderXML_program_is_application_api_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_program_is_application_api_get" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    result = (int) ((arg1)->program_is_application_api);
+    {
+      SV *for_stack;
+      SP += argvi; PUTBACK;
+      for_stack = sv_2mortal(amglue_newSVi64(result));
+      SPAGAIN; SP -= argvi;
+      ST(argvi) = for_stack;
+      argvi++;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_program_set) {
+  {
+    dle_t *arg1 = (dle_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: HeaderXML_program_set(self,program);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_program_set" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HeaderXML_program_set" "', argument " "2"" of type '" "char *""'");
+    }
+    arg2 = (char *)(buf2);
+    if (arg1->program) free((char*)arg1->program);
+    if (arg2) {
+      size_t size = strlen((const char *)(arg2)) + 1;
+      arg1->program = (char *)(char *)memcpy((char *)malloc((size)*sizeof(char)), (const char *)(arg2), sizeof(char)*(size));
+    } else {
+      arg1->program = 0;
+    }
+    ST(argvi) = sv_newmortal();
+    
+    if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+    XSRETURN(argvi);
+  fail:
+    
+    if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_program_get) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    char *result = 0 ;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: HeaderXML_program_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_program_get" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    result = (char *) ((arg1)->program);
+    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_estimatelist_set) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    estimatelist_t arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    void *argp2 ;
+    int res2 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: HeaderXML_estimatelist_set(self,estimatelist);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_estimatelist_set" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    {
+      res2 = SWIG_ConvertPtr(ST(1), &argp2, SWIGTYPE_p_estimatelist_t,  0 );
+      if (!SWIG_IsOK(res2)) {
+        SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HeaderXML_estimatelist_set" "', argument " "2"" of type '" "estimatelist_t""'"); 
+      }  
+      if (!argp2) {
+        SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HeaderXML_estimatelist_set" "', argument " "2"" of type '" "estimatelist_t""'");
+      } else {
+        arg2 = *((estimatelist_t *)(argp2));
+      }
+    }
+    if (arg1) (arg1)->estimatelist = arg2;
+    ST(argvi) = sv_newmortal();
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_estimatelist_get) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    estimatelist_t result;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: HeaderXML_estimatelist_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_estimatelist_get" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    result =  ((arg1)->estimatelist);
+    ST(argvi) = SWIG_NewPointerObj((estimatelist_t *)memcpy((estimatelist_t *)malloc(sizeof(estimatelist_t)),&result,sizeof(estimatelist_t)), SWIGTYPE_p_estimatelist_t, SWIG_POINTER_OWN | 0); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_spindle_set) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    int arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: HeaderXML_spindle_set(self,spindle);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_spindle_set" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_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)->spindle = arg2;
+    ST(argvi) = sv_newmortal();
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_spindle_get) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    int result;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: HeaderXML_spindle_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_spindle_get" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    result = (int) ((arg1)->spindle);
+    {
+      SV *for_stack;
+      SP += argvi; PUTBACK;
+      for_stack = sv_2mortal(amglue_newSVi64(result));
+      SPAGAIN; SP -= argvi;
+      ST(argvi) = for_stack;
+      argvi++;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_compress_set) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    int arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: HeaderXML_compress_set(self,compress);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_compress_set" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_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)->compress = arg2;
+    ST(argvi) = sv_newmortal();
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_compress_get) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    int result;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: HeaderXML_compress_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_compress_get" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    result = (int) ((arg1)->compress);
+    {
+      SV *for_stack;
+      SP += argvi; PUTBACK;
+      for_stack = sv_2mortal(amglue_newSVi64(result));
+      SPAGAIN; SP -= argvi;
+      ST(argvi) = for_stack;
+      argvi++;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_encrypt_set) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    int arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: HeaderXML_encrypt_set(self,encrypt);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_encrypt_set" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_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)->encrypt = arg2;
+    ST(argvi) = sv_newmortal();
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_encrypt_get) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    int result;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: HeaderXML_encrypt_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_encrypt_get" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    result = (int) ((arg1)->encrypt);
+    {
+      SV *for_stack;
+      SP += argvi; PUTBACK;
+      for_stack = sv_2mortal(amglue_newSVi64(result));
+      SPAGAIN; SP -= argvi;
+      ST(argvi) = for_stack;
+      argvi++;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_kencrypt_set) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    int arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: HeaderXML_kencrypt_set(self,kencrypt);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_kencrypt_set" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_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)->kencrypt = arg2;
+    ST(argvi) = sv_newmortal();
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_kencrypt_get) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    int result;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: HeaderXML_kencrypt_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_kencrypt_get" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    result = (int) ((arg1)->kencrypt);
+    {
+      SV *for_stack;
+      SP += argvi; PUTBACK;
+      for_stack = sv_2mortal(amglue_newSVi64(result));
+      SPAGAIN; SP -= argvi;
+      ST(argvi) = for_stack;
+      argvi++;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_levellist_set) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    levellist_t arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    void *argp2 ;
+    int res2 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: HeaderXML_levellist_set(self,levellist);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_levellist_set" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    {
+      res2 = SWIG_ConvertPtr(ST(1), &argp2, SWIGTYPE_p_levellist_t,  0 );
+      if (!SWIG_IsOK(res2)) {
+        SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HeaderXML_levellist_set" "', argument " "2"" of type '" "levellist_t""'"); 
+      }  
+      if (!argp2) {
+        SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HeaderXML_levellist_set" "', argument " "2"" of type '" "levellist_t""'");
+      } else {
+        arg2 = *((levellist_t *)(argp2));
+      }
+    }
+    if (arg1) (arg1)->levellist = arg2;
+    ST(argvi) = sv_newmortal();
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_levellist_get) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    levellist_t result;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: HeaderXML_levellist_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_levellist_get" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    result =  ((arg1)->levellist);
+    ST(argvi) = SWIG_NewPointerObj((levellist_t *)memcpy((levellist_t *)malloc(sizeof(levellist_t)),&result,sizeof(levellist_t)), SWIGTYPE_p_levellist_t, SWIG_POINTER_OWN | 0); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_nb_level_set) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    int arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: HeaderXML_nb_level_set(self,nb_level);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_nb_level_set" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_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)->nb_level = arg2;
+    ST(argvi) = sv_newmortal();
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_nb_level_get) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    int result;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: HeaderXML_nb_level_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_nb_level_get" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    result = (int) ((arg1)->nb_level);
+    {
+      SV *for_stack;
+      SP += argvi; PUTBACK;
+      for_stack = sv_2mortal(amglue_newSVi64(result));
+      SPAGAIN; SP -= argvi;
+      ST(argvi) = for_stack;
+      argvi++;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_dumpdate_set) {
+  {
+    dle_t *arg1 = (dle_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: HeaderXML_dumpdate_set(self,dumpdate);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_dumpdate_set" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HeaderXML_dumpdate_set" "', argument " "2"" of type '" "char *""'");
+    }
+    arg2 = (char *)(buf2);
+    if (arg1->dumpdate) free((char*)arg1->dumpdate);
+    if (arg2) {
+      size_t size = strlen((const char *)(arg2)) + 1;
+      arg1->dumpdate = (char *)(char *)memcpy((char *)malloc((size)*sizeof(char)), (const char *)(arg2), sizeof(char)*(size));
+    } else {
+      arg1->dumpdate = 0;
+    }
+    ST(argvi) = sv_newmortal();
+    
+    if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+    XSRETURN(argvi);
+  fail:
+    
+    if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_dumpdate_get) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    char *result = 0 ;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: HeaderXML_dumpdate_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_dumpdate_get" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    result = (char *) ((arg1)->dumpdate);
+    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_compprog_set) {
+  {
+    dle_t *arg1 = (dle_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: HeaderXML_compprog_set(self,compprog);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_compprog_set" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HeaderXML_compprog_set" "', argument " "2"" of type '" "char *""'");
+    }
+    arg2 = (char *)(buf2);
+    if (arg1->compprog) free((char*)arg1->compprog);
+    if (arg2) {
+      size_t size = strlen((const char *)(arg2)) + 1;
+      arg1->compprog = (char *)(char *)memcpy((char *)malloc((size)*sizeof(char)), (const char *)(arg2), sizeof(char)*(size));
+    } else {
+      arg1->compprog = 0;
+    }
+    ST(argvi) = sv_newmortal();
+    
+    if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+    XSRETURN(argvi);
+  fail:
+    
+    if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_compprog_get) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    char *result = 0 ;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: HeaderXML_compprog_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_compprog_get" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    result = (char *) ((arg1)->compprog);
+    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_srv_encrypt_set) {
+  {
+    dle_t *arg1 = (dle_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: HeaderXML_srv_encrypt_set(self,srv_encrypt);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_srv_encrypt_set" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HeaderXML_srv_encrypt_set" "', argument " "2"" of type '" "char *""'");
+    }
+    arg2 = (char *)(buf2);
+    if (arg1->srv_encrypt) free((char*)arg1->srv_encrypt);
+    if (arg2) {
+      size_t size = strlen((const char *)(arg2)) + 1;
+      arg1->srv_encrypt = (char *)(char *)memcpy((char *)malloc((size)*sizeof(char)), (const char *)(arg2), sizeof(char)*(size));
+    } else {
+      arg1->srv_encrypt = 0;
+    }
+    ST(argvi) = sv_newmortal();
+    
+    if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+    XSRETURN(argvi);
+  fail:
+    
+    if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_srv_encrypt_get) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    char *result = 0 ;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: HeaderXML_srv_encrypt_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_srv_encrypt_get" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    result = (char *) ((arg1)->srv_encrypt);
+    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_clnt_encrypt_set) {
+  {
+    dle_t *arg1 = (dle_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: HeaderXML_clnt_encrypt_set(self,clnt_encrypt);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_clnt_encrypt_set" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HeaderXML_clnt_encrypt_set" "', argument " "2"" of type '" "char *""'");
+    }
+    arg2 = (char *)(buf2);
+    if (arg1->clnt_encrypt) free((char*)arg1->clnt_encrypt);
+    if (arg2) {
+      size_t size = strlen((const char *)(arg2)) + 1;
+      arg1->clnt_encrypt = (char *)(char *)memcpy((char *)malloc((size)*sizeof(char)), (const char *)(arg2), sizeof(char)*(size));
+    } else {
+      arg1->clnt_encrypt = 0;
+    }
+    ST(argvi) = sv_newmortal();
+    
+    if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+    XSRETURN(argvi);
+  fail:
+    
+    if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_clnt_encrypt_get) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    char *result = 0 ;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: HeaderXML_clnt_encrypt_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_clnt_encrypt_get" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    result = (char *) ((arg1)->clnt_encrypt);
+    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_srv_decrypt_opt_set) {
+  {
+    dle_t *arg1 = (dle_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: HeaderXML_srv_decrypt_opt_set(self,srv_decrypt_opt);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_srv_decrypt_opt_set" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HeaderXML_srv_decrypt_opt_set" "', argument " "2"" of type '" "char *""'");
+    }
+    arg2 = (char *)(buf2);
+    if (arg1->srv_decrypt_opt) free((char*)arg1->srv_decrypt_opt);
+    if (arg2) {
+      size_t size = strlen((const char *)(arg2)) + 1;
+      arg1->srv_decrypt_opt = (char *)(char *)memcpy((char *)malloc((size)*sizeof(char)), (const char *)(arg2), sizeof(char)*(size));
+    } else {
+      arg1->srv_decrypt_opt = 0;
+    }
+    ST(argvi) = sv_newmortal();
+    
+    if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+    XSRETURN(argvi);
+  fail:
+    
+    if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_srv_decrypt_opt_get) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    char *result = 0 ;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: HeaderXML_srv_decrypt_opt_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_srv_decrypt_opt_get" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    result = (char *) ((arg1)->srv_decrypt_opt);
+    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_clnt_decrypt_opt_set) {
+  {
+    dle_t *arg1 = (dle_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: HeaderXML_clnt_decrypt_opt_set(self,clnt_decrypt_opt);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_clnt_decrypt_opt_set" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HeaderXML_clnt_decrypt_opt_set" "', argument " "2"" of type '" "char *""'");
+    }
+    arg2 = (char *)(buf2);
+    if (arg1->clnt_decrypt_opt) free((char*)arg1->clnt_decrypt_opt);
+    if (arg2) {
+      size_t size = strlen((const char *)(arg2)) + 1;
+      arg1->clnt_decrypt_opt = (char *)(char *)memcpy((char *)malloc((size)*sizeof(char)), (const char *)(arg2), sizeof(char)*(size));
+    } else {
+      arg1->clnt_decrypt_opt = 0;
+    }
+    ST(argvi) = sv_newmortal();
+    
+    if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+    XSRETURN(argvi);
+  fail:
+    
+    if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_clnt_decrypt_opt_get) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    char *result = 0 ;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: HeaderXML_clnt_decrypt_opt_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_clnt_decrypt_opt_get" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    result = (char *) ((arg1)->clnt_decrypt_opt);
+    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_record_set) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    int arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: HeaderXML_record_set(self,record);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_record_set" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_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)->record = arg2;
+    ST(argvi) = sv_newmortal();
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_record_get) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    int result;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: HeaderXML_record_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_record_get" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    result = (int) ((arg1)->record);
+    {
+      SV *for_stack;
+      SP += argvi; PUTBACK;
+      for_stack = sv_2mortal(amglue_newSVi64(result));
+      SPAGAIN; SP -= argvi;
+      ST(argvi) = for_stack;
+      argvi++;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_create_index_set) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    int arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: HeaderXML_create_index_set(self,create_index);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_create_index_set" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_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)->create_index = arg2;
+    ST(argvi) = sv_newmortal();
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_create_index_get) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    int result;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: HeaderXML_create_index_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_create_index_get" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    result = (int) ((arg1)->create_index);
+    {
+      SV *for_stack;
+      SP += argvi; PUTBACK;
+      for_stack = sv_2mortal(amglue_newSVi64(result));
+      SPAGAIN; SP -= argvi;
+      ST(argvi) = for_stack;
+      argvi++;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_auth_set) {
+  {
+    dle_t *arg1 = (dle_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: HeaderXML_auth_set(self,auth);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_auth_set" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    res2 = SWIG_AsCharPtrAndSize(ST(1), &buf2, NULL, &alloc2);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HeaderXML_auth_set" "', argument " "2"" of type '" "char *""'");
+    }
+    arg2 = (char *)(buf2);
+    if (arg1->auth) free((char*)arg1->auth);
+    if (arg2) {
+      size_t size = strlen((const char *)(arg2)) + 1;
+      arg1->auth = (char *)(char *)memcpy((char *)malloc((size)*sizeof(char)), (const char *)(arg2), sizeof(char)*(size));
+    } else {
+      arg1->auth = 0;
+    }
+    ST(argvi) = sv_newmortal();
+    
+    if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+    XSRETURN(argvi);
+  fail:
+    
+    if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_auth_get) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    char *result = 0 ;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: HeaderXML_auth_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_auth_get" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    result = (char *) ((arg1)->auth);
+    ST(argvi) = SWIG_FromCharPtr((const char *)result); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_exclude_file_set) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    sl_t *arg2 = (sl_t *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    void *argp2 = 0 ;
+    int res2 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: HeaderXML_exclude_file_set(self,exclude_file);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_exclude_file_set" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_sl_t, SWIG_POINTER_DISOWN |  0 );
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HeaderXML_exclude_file_set" "', argument " "2"" of type '" "sl_t *""'"); 
+    }
+    arg2 = (sl_t *)(argp2);
+    if (arg1) (arg1)->exclude_file = arg2;
+    ST(argvi) = sv_newmortal();
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_exclude_file_get) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    sl_t *result = 0 ;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: HeaderXML_exclude_file_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_exclude_file_get" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    result = (sl_t *) ((arg1)->exclude_file);
+    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_sl_t, 0 | 0); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_exclude_list_set) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    sl_t *arg2 = (sl_t *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    void *argp2 = 0 ;
+    int res2 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: HeaderXML_exclude_list_set(self,exclude_list);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_exclude_list_set" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_sl_t, SWIG_POINTER_DISOWN |  0 );
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HeaderXML_exclude_list_set" "', argument " "2"" of type '" "sl_t *""'"); 
+    }
+    arg2 = (sl_t *)(argp2);
+    if (arg1) (arg1)->exclude_list = arg2;
+    ST(argvi) = sv_newmortal();
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_exclude_list_get) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    sl_t *result = 0 ;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: HeaderXML_exclude_list_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_exclude_list_get" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    result = (sl_t *) ((arg1)->exclude_list);
+    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_sl_t, 0 | 0); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_include_file_set) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    sl_t *arg2 = (sl_t *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    void *argp2 = 0 ;
+    int res2 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: HeaderXML_include_file_set(self,include_file);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_include_file_set" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_sl_t, SWIG_POINTER_DISOWN |  0 );
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HeaderXML_include_file_set" "', argument " "2"" of type '" "sl_t *""'"); 
+    }
+    arg2 = (sl_t *)(argp2);
+    if (arg1) (arg1)->include_file = arg2;
+    ST(argvi) = sv_newmortal();
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_include_file_get) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    sl_t *result = 0 ;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: HeaderXML_include_file_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_include_file_get" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    result = (sl_t *) ((arg1)->include_file);
+    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_sl_t, 0 | 0); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_include_list_set) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    sl_t *arg2 = (sl_t *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    void *argp2 = 0 ;
+    int res2 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: HeaderXML_include_list_set(self,include_list);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_include_list_set" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_sl_t, SWIG_POINTER_DISOWN |  0 );
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HeaderXML_include_list_set" "', argument " "2"" of type '" "sl_t *""'"); 
+    }
+    arg2 = (sl_t *)(argp2);
+    if (arg1) (arg1)->include_list = arg2;
+    ST(argvi) = sv_newmortal();
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_include_list_get) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    sl_t *result = 0 ;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: HeaderXML_include_list_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_include_list_get" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    result = (sl_t *) ((arg1)->include_list);
+    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_sl_t, 0 | 0); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_exclude_optional_set) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    int arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: HeaderXML_exclude_optional_set(self,exclude_optional);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_exclude_optional_set" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_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)->exclude_optional = arg2;
+    ST(argvi) = sv_newmortal();
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_exclude_optional_get) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    int result;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: HeaderXML_exclude_optional_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_exclude_optional_get" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    result = (int) ((arg1)->exclude_optional);
+    {
+      SV *for_stack;
+      SP += argvi; PUTBACK;
+      for_stack = sv_2mortal(amglue_newSVi64(result));
+      SPAGAIN; SP -= argvi;
+      ST(argvi) = for_stack;
+      argvi++;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_include_optional_set) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    int arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: HeaderXML_include_optional_set(self,include_optional);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_include_optional_set" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_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)->include_optional = arg2;
+    ST(argvi) = sv_newmortal();
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_include_optional_get) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    int result;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: HeaderXML_include_optional_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_include_optional_get" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    result = (int) ((arg1)->include_optional);
+    {
+      SV *for_stack;
+      SP += argvi; PUTBACK;
+      for_stack = sv_2mortal(amglue_newSVi64(result));
+      SPAGAIN; SP -= argvi;
+      ST(argvi) = for_stack;
+      argvi++;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_application_property_set) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    proplist_t arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    void *argp2 ;
+    int res2 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: HeaderXML_application_property_set(self,application_property);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_application_property_set" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    {
+      res2 = SWIG_ConvertPtr(ST(1), &argp2, SWIGTYPE_p_proplist_t,  0 );
+      if (!SWIG_IsOK(res2)) {
+        SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HeaderXML_application_property_set" "', argument " "2"" of type '" "proplist_t""'"); 
+      }  
+      if (!argp2) {
+        SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HeaderXML_application_property_set" "', argument " "2"" of type '" "proplist_t""'");
+      } else {
+        arg2 = *((proplist_t *)(argp2));
+      }
+    }
+    if (arg1) (arg1)->application_property = arg2;
+    ST(argvi) = sv_newmortal();
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_application_property_get) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    proplist_t result;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: HeaderXML_application_property_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_application_property_get" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    result =  ((arg1)->application_property);
+    ST(argvi) = SWIG_NewPointerObj((proplist_t *)memcpy((proplist_t *)malloc(sizeof(proplist_t)),&result,sizeof(proplist_t)), SWIGTYPE_p_proplist_t, SWIG_POINTER_OWN | 0); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_scriptlist_set) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    scriptlist_t arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    void *argp2 ;
+    int res2 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: HeaderXML_scriptlist_set(self,scriptlist);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_scriptlist_set" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    {
+      res2 = SWIG_ConvertPtr(ST(1), &argp2, SWIGTYPE_p_scriptlist_t,  0 );
+      if (!SWIG_IsOK(res2)) {
+        SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HeaderXML_scriptlist_set" "', argument " "2"" of type '" "scriptlist_t""'"); 
+      }  
+      if (!argp2) {
+        SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HeaderXML_scriptlist_set" "', argument " "2"" of type '" "scriptlist_t""'");
+      } else {
+        arg2 = *((scriptlist_t *)(argp2));
+      }
+    }
+    if (arg1) (arg1)->scriptlist = arg2;
+    ST(argvi) = sv_newmortal();
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_scriptlist_get) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    scriptlist_t result;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: HeaderXML_scriptlist_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_scriptlist_get" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    result =  ((arg1)->scriptlist);
+    ST(argvi) = SWIG_NewPointerObj((scriptlist_t *)memcpy((scriptlist_t *)malloc(sizeof(scriptlist_t)),&result,sizeof(scriptlist_t)), SWIGTYPE_p_scriptlist_t, SWIG_POINTER_OWN | 0); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_data_path_set) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    data_path_t arg2 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    void *argp2 ;
+    int res2 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: HeaderXML_data_path_set(self,data_path);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_data_path_set" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    {
+      res2 = SWIG_ConvertPtr(ST(1), &argp2, SWIGTYPE_p_data_path_t,  0 );
+      if (!SWIG_IsOK(res2)) {
+        SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HeaderXML_data_path_set" "', argument " "2"" of type '" "data_path_t""'"); 
+      }  
+      if (!argp2) {
+        SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "HeaderXML_data_path_set" "', argument " "2"" of type '" "data_path_t""'");
+      } else {
+        arg2 = *((data_path_t *)(argp2));
+      }
+    }
+    if (arg1) (arg1)->data_path = arg2;
+    ST(argvi) = sv_newmortal();
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_data_path_get) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    data_path_t result;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: HeaderXML_data_path_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_data_path_get" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    result =  ((arg1)->data_path);
+    ST(argvi) = SWIG_NewPointerObj((data_path_t *)memcpy((data_path_t *)malloc(sizeof(data_path_t)),&result,sizeof(data_path_t)), SWIGTYPE_p_data_path_t, SWIG_POINTER_OWN | 0); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_directtcp_list_set) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    GSList *arg2 = (GSList *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    void *argp2 = 0 ;
+    int res2 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: HeaderXML_directtcp_list_set(self,directtcp_list);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_directtcp_list_set" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_GSList, SWIG_POINTER_DISOWN |  0 );
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HeaderXML_directtcp_list_set" "', argument " "2"" of type '" "GSList *""'"); 
+    }
+    arg2 = (GSList *)(argp2);
+    if (arg1) (arg1)->directtcp_list = arg2;
+    ST(argvi) = sv_newmortal();
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_directtcp_list_get) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    GSList *result = 0 ;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: HeaderXML_directtcp_list_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_directtcp_list_get" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    result = (GSList *) ((arg1)->directtcp_list);
+    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_GSList, 0 | 0); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_next_set) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    struct a_dle_s *arg2 = (struct a_dle_s *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    void *argp2 = 0 ;
+    int res2 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: HeaderXML_next_set(self,next);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_next_set" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    res2 = SWIG_ConvertPtr(ST(1), &argp2,SWIGTYPE_p_a_dle_s, SWIG_POINTER_DISOWN |  0 );
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "HeaderXML_next_set" "', argument " "2"" of type '" "struct a_dle_s *""'"); 
+    }
+    arg2 = (struct a_dle_s *)(argp2);
+    if (arg1) (arg1)->next = arg2;
+    ST(argvi) = sv_newmortal();
+    
+    
+    XSRETURN(argvi);
+  fail:
+    
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_HeaderXML_next_get) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    struct a_dle_s *result = 0 ;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: HeaderXML_next_get(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "HeaderXML_next_get" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    result = (struct a_dle_s *) ((arg1)->next);
+    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_a_dle_s, 0 | 0); argvi++ ;
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_new_HeaderXML) {
+  {
+    char *arg1 = (char *) 0 ;
+    int res1 ;
+    char *buf1 = 0 ;
+    int alloc1 = 0 ;
+    int argvi = 0;
+    dle_t *result = 0 ;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: new_HeaderXML(dle_str);");
+    }
+    res1 = SWIG_AsCharPtrAndSize(ST(0), &buf1, NULL, &alloc1);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_HeaderXML" "', argument " "1"" of type '" "char *""'");
+    }
+    arg1 = (char *)(buf1);
+    result = (dle_t *)new_dle_t(arg1);
+    ST(argvi) = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_dle_t, 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_HeaderXML__SWIG_1) {
+  {
+    dle_t *arg1 = (dle_t *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: delete_HeaderXML(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_dle_t, SWIG_POINTER_DISOWN |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_HeaderXML" "', argument " "1"" of type '" "dle_t *""'"); 
+    }
+    arg1 = (dle_t *)(argp1);
+    free((char *) arg1);
+    ST(argvi) = sv_newmortal();
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_delete_HeaderXML) {
+  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_dle_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_HeaderXML__SWIG_1); return;
+    }
+  }
+  
+  croak("No matching function for overloaded 'delete_HeaderXML'");
+  XSRETURN(0);
+}
+
+
 
 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
 
+static swig_type_info _swigt__p_GSList = {"_p_GSList", "GSList *", 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_a_dle_s = {"_p_a_dle_s", "struct a_dle_s *", 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_data_path_t = {"_p_data_path_t", "data_path_t *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_dle_t = {"_p_dle_t", "dle_t *", 0, 0, (void*)"Amanda::Header::HeaderXML", 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::Header::Header", 0};
+static swig_type_info _swigt__p_estimatelist_t = {"_p_estimatelist_t", "estimatelist_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_int = {"_p_int", "int *|filetype_t *|gboolean *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_levellist_t = {"_p_levellist_t", "levellist_t *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_off_t = {"_p_off_t", "off_t *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_proplist_t = {"_p_proplist_t", "proplist_t *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_scriptlist_t = {"_p_scriptlist_t", "scriptlist_t *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_sl_t = {"_p_sl_t", "sl_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_GSList,
   &_swigt__p_a_STRMAX__char,
+  &_swigt__p_a_dle_s,
   &_swigt__p_char,
+  &_swigt__p_data_path_t,
+  &_swigt__p_dle_t,
   &_swigt__p_double,
   &_swigt__p_dumpfile_t,
+  &_swigt__p_estimatelist_t,
   &_swigt__p_float,
   &_swigt__p_int,
+  &_swigt__p_levellist_t,
   &_swigt__p_off_t,
+  &_swigt__p_proplist_t,
+  &_swigt__p_scriptlist_t,
+  &_swigt__p_sl_t,
   &_swigt__p_unsigned_char,
 };
 
+static swig_cast_info _swigc__p_GSList[] = {  {&_swigt__p_GSList, 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_a_dle_s[] = {  {&_swigt__p_a_dle_s, 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_data_path_t[] = {  {&_swigt__p_data_path_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_dle_t[] = {  {&_swigt__p_dle_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_dumpfile_t[] = {  {&_swigt__p_dumpfile_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_estimatelist_t[] = {  {&_swigt__p_estimatelist_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_levellist_t[] = {  {&_swigt__p_levellist_t, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_off_t[] = {  {&_swigt__p_off_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_proplist_t[] = {  {&_swigt__p_proplist_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_scriptlist_t[] = {  {&_swigt__p_scriptlist_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_sl_t[] = {  {&_swigt__p_sl_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_GSList,
   _swigc__p_a_STRMAX__char,
+  _swigc__p_a_dle_s,
   _swigc__p_char,
+  _swigc__p_data_path_t,
+  _swigc__p_dle_t,
   _swigc__p_double,
   _swigc__p_dumpfile_t,
+  _swigc__p_estimatelist_t,
   _swigc__p_float,
   _swigc__p_int,
+  _swigc__p_levellist_t,
   _swigc__p_off_t,
+  _swigc__p_proplist_t,
+  _swigc__p_scriptlist_t,
+  _swigc__p_sl_t,
   _swigc__p_unsigned_char,
 };
 
@@ -4288,6 +6674,70 @@ static swig_command_info swig_commands[] = {
 {"Amanda::Headerc::Header_summary", _wrap_Header_summary},
 {"Amanda::Headerc::delete_Header", _wrap_delete_Header},
 {"Amanda::Headerc::C_from_string", _wrap_C_from_string},
+{"Amanda::Headerc::HeaderXML_disk_set", _wrap_HeaderXML_disk_set},
+{"Amanda::Headerc::HeaderXML_disk_get", _wrap_HeaderXML_disk_get},
+{"Amanda::Headerc::HeaderXML_device_set", _wrap_HeaderXML_device_set},
+{"Amanda::Headerc::HeaderXML_device_get", _wrap_HeaderXML_device_get},
+{"Amanda::Headerc::HeaderXML_program_is_application_api_set", _wrap_HeaderXML_program_is_application_api_set},
+{"Amanda::Headerc::HeaderXML_program_is_application_api_get", _wrap_HeaderXML_program_is_application_api_get},
+{"Amanda::Headerc::HeaderXML_program_set", _wrap_HeaderXML_program_set},
+{"Amanda::Headerc::HeaderXML_program_get", _wrap_HeaderXML_program_get},
+{"Amanda::Headerc::HeaderXML_estimatelist_set", _wrap_HeaderXML_estimatelist_set},
+{"Amanda::Headerc::HeaderXML_estimatelist_get", _wrap_HeaderXML_estimatelist_get},
+{"Amanda::Headerc::HeaderXML_spindle_set", _wrap_HeaderXML_spindle_set},
+{"Amanda::Headerc::HeaderXML_spindle_get", _wrap_HeaderXML_spindle_get},
+{"Amanda::Headerc::HeaderXML_compress_set", _wrap_HeaderXML_compress_set},
+{"Amanda::Headerc::HeaderXML_compress_get", _wrap_HeaderXML_compress_get},
+{"Amanda::Headerc::HeaderXML_encrypt_set", _wrap_HeaderXML_encrypt_set},
+{"Amanda::Headerc::HeaderXML_encrypt_get", _wrap_HeaderXML_encrypt_get},
+{"Amanda::Headerc::HeaderXML_kencrypt_set", _wrap_HeaderXML_kencrypt_set},
+{"Amanda::Headerc::HeaderXML_kencrypt_get", _wrap_HeaderXML_kencrypt_get},
+{"Amanda::Headerc::HeaderXML_levellist_set", _wrap_HeaderXML_levellist_set},
+{"Amanda::Headerc::HeaderXML_levellist_get", _wrap_HeaderXML_levellist_get},
+{"Amanda::Headerc::HeaderXML_nb_level_set", _wrap_HeaderXML_nb_level_set},
+{"Amanda::Headerc::HeaderXML_nb_level_get", _wrap_HeaderXML_nb_level_get},
+{"Amanda::Headerc::HeaderXML_dumpdate_set", _wrap_HeaderXML_dumpdate_set},
+{"Amanda::Headerc::HeaderXML_dumpdate_get", _wrap_HeaderXML_dumpdate_get},
+{"Amanda::Headerc::HeaderXML_compprog_set", _wrap_HeaderXML_compprog_set},
+{"Amanda::Headerc::HeaderXML_compprog_get", _wrap_HeaderXML_compprog_get},
+{"Amanda::Headerc::HeaderXML_srv_encrypt_set", _wrap_HeaderXML_srv_encrypt_set},
+{"Amanda::Headerc::HeaderXML_srv_encrypt_get", _wrap_HeaderXML_srv_encrypt_get},
+{"Amanda::Headerc::HeaderXML_clnt_encrypt_set", _wrap_HeaderXML_clnt_encrypt_set},
+{"Amanda::Headerc::HeaderXML_clnt_encrypt_get", _wrap_HeaderXML_clnt_encrypt_get},
+{"Amanda::Headerc::HeaderXML_srv_decrypt_opt_set", _wrap_HeaderXML_srv_decrypt_opt_set},
+{"Amanda::Headerc::HeaderXML_srv_decrypt_opt_get", _wrap_HeaderXML_srv_decrypt_opt_get},
+{"Amanda::Headerc::HeaderXML_clnt_decrypt_opt_set", _wrap_HeaderXML_clnt_decrypt_opt_set},
+{"Amanda::Headerc::HeaderXML_clnt_decrypt_opt_get", _wrap_HeaderXML_clnt_decrypt_opt_get},
+{"Amanda::Headerc::HeaderXML_record_set", _wrap_HeaderXML_record_set},
+{"Amanda::Headerc::HeaderXML_record_get", _wrap_HeaderXML_record_get},
+{"Amanda::Headerc::HeaderXML_create_index_set", _wrap_HeaderXML_create_index_set},
+{"Amanda::Headerc::HeaderXML_create_index_get", _wrap_HeaderXML_create_index_get},
+{"Amanda::Headerc::HeaderXML_auth_set", _wrap_HeaderXML_auth_set},
+{"Amanda::Headerc::HeaderXML_auth_get", _wrap_HeaderXML_auth_get},
+{"Amanda::Headerc::HeaderXML_exclude_file_set", _wrap_HeaderXML_exclude_file_set},
+{"Amanda::Headerc::HeaderXML_exclude_file_get", _wrap_HeaderXML_exclude_file_get},
+{"Amanda::Headerc::HeaderXML_exclude_list_set", _wrap_HeaderXML_exclude_list_set},
+{"Amanda::Headerc::HeaderXML_exclude_list_get", _wrap_HeaderXML_exclude_list_get},
+{"Amanda::Headerc::HeaderXML_include_file_set", _wrap_HeaderXML_include_file_set},
+{"Amanda::Headerc::HeaderXML_include_file_get", _wrap_HeaderXML_include_file_get},
+{"Amanda::Headerc::HeaderXML_include_list_set", _wrap_HeaderXML_include_list_set},
+{"Amanda::Headerc::HeaderXML_include_list_get", _wrap_HeaderXML_include_list_get},
+{"Amanda::Headerc::HeaderXML_exclude_optional_set", _wrap_HeaderXML_exclude_optional_set},
+{"Amanda::Headerc::HeaderXML_exclude_optional_get", _wrap_HeaderXML_exclude_optional_get},
+{"Amanda::Headerc::HeaderXML_include_optional_set", _wrap_HeaderXML_include_optional_set},
+{"Amanda::Headerc::HeaderXML_include_optional_get", _wrap_HeaderXML_include_optional_get},
+{"Amanda::Headerc::HeaderXML_application_property_set", _wrap_HeaderXML_application_property_set},
+{"Amanda::Headerc::HeaderXML_application_property_get", _wrap_HeaderXML_application_property_get},
+{"Amanda::Headerc::HeaderXML_scriptlist_set", _wrap_HeaderXML_scriptlist_set},
+{"Amanda::Headerc::HeaderXML_scriptlist_get", _wrap_HeaderXML_scriptlist_get},
+{"Amanda::Headerc::HeaderXML_data_path_set", _wrap_HeaderXML_data_path_set},
+{"Amanda::Headerc::HeaderXML_data_path_get", _wrap_HeaderXML_data_path_get},
+{"Amanda::Headerc::HeaderXML_directtcp_list_set", _wrap_HeaderXML_directtcp_list_set},
+{"Amanda::Headerc::HeaderXML_directtcp_list_get", _wrap_HeaderXML_directtcp_list_get},
+{"Amanda::Headerc::HeaderXML_next_set", _wrap_HeaderXML_next_set},
+{"Amanda::Headerc::HeaderXML_next_get", _wrap_HeaderXML_next_get},
+{"Amanda::Headerc::new_HeaderXML", _wrap_new_HeaderXML},
+{"Amanda::Headerc::delete_HeaderXML", _wrap_delete_HeaderXML},
 {0,0}
 };
 /* -----------------------------------------------------------------------------
@@ -4623,6 +7073,7 @@ XS(SWIG_init) {
     SvREADONLY_on(sv);
   } while(0) /*@SWIG@*/;
   SWIG_TypeClientData(SWIGTYPE_p_dumpfile_t, (void*) "Amanda::Header::Header");
+  SWIG_TypeClientData(SWIGTYPE_p_dle_t, (void*) "Amanda::Header::HeaderXML");
   ST(0) = &PL_sv_yes;
   XSRETURN(1);
 }
index 32097b207a18393dbe9c4073024dd0404fb5b0c6..f569ae6014a6fbc44d74eb6eeecc76b7eb4c1c2a 100644 (file)
@@ -145,6 +145,105 @@ sub ACQUIRE {
 }
 
 
+############# Class : Amanda::Header::HeaderXML ##############
+
+package Amanda::Header::HeaderXML;
+use vars qw(@ISA %OWNER %ITERATORS %BLESSEDMEMBERS);
+@ISA = qw( Amanda::Header );
+%OWNER = ();
+%ITERATORS = ();
+*swig_disk_get = *Amanda::Headerc::HeaderXML_disk_get;
+*swig_disk_set = *Amanda::Headerc::HeaderXML_disk_set;
+*swig_device_get = *Amanda::Headerc::HeaderXML_device_get;
+*swig_device_set = *Amanda::Headerc::HeaderXML_device_set;
+*swig_program_is_application_api_get = *Amanda::Headerc::HeaderXML_program_is_application_api_get;
+*swig_program_is_application_api_set = *Amanda::Headerc::HeaderXML_program_is_application_api_set;
+*swig_program_get = *Amanda::Headerc::HeaderXML_program_get;
+*swig_program_set = *Amanda::Headerc::HeaderXML_program_set;
+*swig_estimatelist_get = *Amanda::Headerc::HeaderXML_estimatelist_get;
+*swig_estimatelist_set = *Amanda::Headerc::HeaderXML_estimatelist_set;
+*swig_spindle_get = *Amanda::Headerc::HeaderXML_spindle_get;
+*swig_spindle_set = *Amanda::Headerc::HeaderXML_spindle_set;
+*swig_compress_get = *Amanda::Headerc::HeaderXML_compress_get;
+*swig_compress_set = *Amanda::Headerc::HeaderXML_compress_set;
+*swig_encrypt_get = *Amanda::Headerc::HeaderXML_encrypt_get;
+*swig_encrypt_set = *Amanda::Headerc::HeaderXML_encrypt_set;
+*swig_kencrypt_get = *Amanda::Headerc::HeaderXML_kencrypt_get;
+*swig_kencrypt_set = *Amanda::Headerc::HeaderXML_kencrypt_set;
+*swig_levellist_get = *Amanda::Headerc::HeaderXML_levellist_get;
+*swig_levellist_set = *Amanda::Headerc::HeaderXML_levellist_set;
+*swig_nb_level_get = *Amanda::Headerc::HeaderXML_nb_level_get;
+*swig_nb_level_set = *Amanda::Headerc::HeaderXML_nb_level_set;
+*swig_dumpdate_get = *Amanda::Headerc::HeaderXML_dumpdate_get;
+*swig_dumpdate_set = *Amanda::Headerc::HeaderXML_dumpdate_set;
+*swig_compprog_get = *Amanda::Headerc::HeaderXML_compprog_get;
+*swig_compprog_set = *Amanda::Headerc::HeaderXML_compprog_set;
+*swig_srv_encrypt_get = *Amanda::Headerc::HeaderXML_srv_encrypt_get;
+*swig_srv_encrypt_set = *Amanda::Headerc::HeaderXML_srv_encrypt_set;
+*swig_clnt_encrypt_get = *Amanda::Headerc::HeaderXML_clnt_encrypt_get;
+*swig_clnt_encrypt_set = *Amanda::Headerc::HeaderXML_clnt_encrypt_set;
+*swig_srv_decrypt_opt_get = *Amanda::Headerc::HeaderXML_srv_decrypt_opt_get;
+*swig_srv_decrypt_opt_set = *Amanda::Headerc::HeaderXML_srv_decrypt_opt_set;
+*swig_clnt_decrypt_opt_get = *Amanda::Headerc::HeaderXML_clnt_decrypt_opt_get;
+*swig_clnt_decrypt_opt_set = *Amanda::Headerc::HeaderXML_clnt_decrypt_opt_set;
+*swig_record_get = *Amanda::Headerc::HeaderXML_record_get;
+*swig_record_set = *Amanda::Headerc::HeaderXML_record_set;
+*swig_create_index_get = *Amanda::Headerc::HeaderXML_create_index_get;
+*swig_create_index_set = *Amanda::Headerc::HeaderXML_create_index_set;
+*swig_auth_get = *Amanda::Headerc::HeaderXML_auth_get;
+*swig_auth_set = *Amanda::Headerc::HeaderXML_auth_set;
+*swig_exclude_file_get = *Amanda::Headerc::HeaderXML_exclude_file_get;
+*swig_exclude_file_set = *Amanda::Headerc::HeaderXML_exclude_file_set;
+*swig_exclude_list_get = *Amanda::Headerc::HeaderXML_exclude_list_get;
+*swig_exclude_list_set = *Amanda::Headerc::HeaderXML_exclude_list_set;
+*swig_include_file_get = *Amanda::Headerc::HeaderXML_include_file_get;
+*swig_include_file_set = *Amanda::Headerc::HeaderXML_include_file_set;
+*swig_include_list_get = *Amanda::Headerc::HeaderXML_include_list_get;
+*swig_include_list_set = *Amanda::Headerc::HeaderXML_include_list_set;
+*swig_exclude_optional_get = *Amanda::Headerc::HeaderXML_exclude_optional_get;
+*swig_exclude_optional_set = *Amanda::Headerc::HeaderXML_exclude_optional_set;
+*swig_include_optional_get = *Amanda::Headerc::HeaderXML_include_optional_get;
+*swig_include_optional_set = *Amanda::Headerc::HeaderXML_include_optional_set;
+*swig_application_property_get = *Amanda::Headerc::HeaderXML_application_property_get;
+*swig_application_property_set = *Amanda::Headerc::HeaderXML_application_property_set;
+*swig_scriptlist_get = *Amanda::Headerc::HeaderXML_scriptlist_get;
+*swig_scriptlist_set = *Amanda::Headerc::HeaderXML_scriptlist_set;
+*swig_data_path_get = *Amanda::Headerc::HeaderXML_data_path_get;
+*swig_data_path_set = *Amanda::Headerc::HeaderXML_data_path_set;
+*swig_directtcp_list_get = *Amanda::Headerc::HeaderXML_directtcp_list_get;
+*swig_directtcp_list_set = *Amanda::Headerc::HeaderXML_directtcp_list_set;
+*swig_next_get = *Amanda::Headerc::HeaderXML_next_get;
+*swig_next_set = *Amanda::Headerc::HeaderXML_next_set;
+sub new {
+    my $pkg = shift;
+    my $self = Amanda::Headerc::new_HeaderXML(@_);
+    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::Headerc::delete_HeaderXML($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::Header;
@@ -380,6 +479,12 @@ sub from_string {
     return C_from_string(@_);
 }
 
+sub get_dle {
+    my $self = shift;
+
+    return Amanda::Header::HeaderXML->new($self->{'dle_str'});
+}
+
 package Amanda::Header::Header;
 
 # point $hdr->matches_dumpspecs() to Amanda::Cmdline::header_matches_dumpspecs.  When
index b224d38fc2b8e7a243102d35900e9fa08d261169..a7d391b630246cf6c0de37835f12729e2e3c1c57 100644 (file)
@@ -148,6 +148,12 @@ sub from_string {
     return C_from_string(@_);
 }
 
+sub get_dle {
+    my $self = shift;
+
+    return Amanda::Header::HeaderXML->new($self->{'dle_str'});
+}
+
 package Amanda::Header::Header;
 
 # point $hdr->matches_dumpspecs() to Amanda::Cmdline::header_matches_dumpspecs.  When
@@ -159,3 +165,60 @@ sub matches_dumpspecs {
 
 package Amanda::Header;
 %}
+
+%{
+#include "amxml.h"
+%}
+
+%rename(HeaderXML) dle_t;
+typedef struct {
+    char   *disk;
+    char   *device;
+    int     program_is_application_api;
+    char   *program;
+    estimatelist_t estimatelist;
+    int     spindle;
+    int     compress;
+    int     encrypt;
+    int     kencrypt;
+    levellist_t levellist;
+    int     nb_level;
+    char   *dumpdate;
+    char   *compprog;
+    char   *srv_encrypt;
+    char   *clnt_encrypt;
+    char   *srv_decrypt_opt;
+    char   *clnt_decrypt_opt;
+    int     record;
+    int     create_index;
+    char   *auth;
+    sl_t   *exclude_file;
+    sl_t   *exclude_list;
+    sl_t   *include_file;
+    sl_t   *include_list;
+    int     exclude_optional;
+    int     include_optional;
+    proplist_t application_property;
+    scriptlist_t scriptlist;
+    data_path_t  data_path;
+    GSList      *directtcp_list;
+    struct a_dle_s *next;
+
+    %extend {
+       /* constructor */
+       dle_t(char *dle_str) {
+           char  *errmsg = NULL;
+           dle_t *dle;
+           dle = amxml_parse_node_CHAR(dle_str, &errmsg);
+           amfree(errmsg);
+           
+           return dle;
+       }
+
+       /* destructor */
+       ~dle_t(void) {
+           amfree(self);
+       }
+    }
+} dle_t;
+
diff --git a/perl/Amanda/Interactive.pm b/perl/Amanda/Interactive.pm
deleted file mode 100644 (file)
index f038679..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-# Copyright (c) 2010 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., 465 S. Mathilda Ave., Suite 300
-# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
-
-package Amanda::Interactive;
-
-=head1 NAME
-
-Amanda::Interactive -- Parent class for user interactivity modules
-
-=head1 SYNOPSIS
-
-    use Amanda::Interactive;
-
-    my $inter = Amanda::Interactive->new(name => 'stdin',
-                                        inter_conf => $inter_conf);
-    $inter->user_request(
-       message => "Insert Volume labelled 'MY_LABEL-001'",
-       finished_cb => sub {
-           my ($err, $reply) = @_;
-           if ($err) {
-               # error from the script
-           } elsif (!defined $reply) {
-               # request aborted
-           } else {
-               # use reply
-           }
-       });
-
-=head1 SUMMARY
-
-This package provides a way for Amanda programs to communicate interactively
-with the user.  The program can send a message to the user and await a textual
-response.  The package operates asynchronously (see L<Amanda::MainLoop>), so
-the program may continue with other activities while waiting for an answer from
-the user.
-
-Several interactivity modules are (or soon will be) available, and can be
-selected by the user.
-
-=head1 INTERFACE
-
-A new object is create with the C<new> function as follows:
-
-    my $inter = Amanda::Interactive->new(
-       name => $interactive_name,
-       inter_conf => $inter_conf);
-
-Where C<$interactive_name> is the name of the desired interactivity module
-(e.g., C<'stdin'>).
-
-=head2 INTERACTIVE OBJECTS
-
-=head3 user_request
-
-  $inter->user_request(message     => $message,
-                       label       => $label,
-                       err         => $err,
-                       finished_cb => $finished_cb);
-
-This method return immediately.  It sends C<message> to the user and waits for a
-reply.  The C<label> and C<err> parameters .. well, what do they do? (TODO)
-
-The C<user_request> method's C<finished_cb> as parameter is similar to the
-callback of the same name in L<Amanda::Changer>.  In the even of an error, it
-is called with an C<Amanda::Changer::Error> object as first argument.  If the
-request is answered, then the second argument is the user's response.  If the
-request is aborted (see C<abort>, below), then both arguments are C<undef>.
-
-=head3 abort
-
-  $inter->abort()
-
-This method will abort all pending C<user_request> invocations, invoking their
-C<finished_cb> with C<(undef, undef)>.
-
-=cut
-
-sub new {
-    shift eq 'Amanda::Interactive'
-       or return;
-    my %params = @_;
-    my $name = $params{'name'};
-
-    die("No name for Amanda::Interactive->(new)") if !defined $name;
-
-    my $pkgname = "Amanda::Interactive::$name";
-    my $filename = $pkgname;
-    $filename =~ s|::|/|g;
-    $filename .= '.pm';
-
-    if (!exists $INC{$filename}) {
-       eval "use $pkgname;";
-       if ($@) {
-           my $err = $@;
-           die ($err);
-       }
-    }
-
-    my $inter = $pkgname->new(%params);
-
-    return $inter;
-}
-
-1;
diff --git a/perl/Amanda/Interactive/stdin.pm b/perl/Amanda/Interactive/stdin.pm
deleted file mode 100644 (file)
index 2445349..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-# Copyright (c) 2010 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., 465 S. Mathilda Ave., Suite 300
-# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
-
-package Amanda::Interactive::stdin;
-
-use strict;
-use warnings;
-use POSIX qw( :errno_h );
-use vars qw( @ISA );
-@ISA = qw( Amanda::Interactive );
-
-use Amanda::Paths;
-use Amanda::Util;
-use Amanda::Debug qw( debug );
-use Amanda::Changer;
-use Amanda::MainLoop qw( :GIOCondition );
-
-=head1 NAME
-
-Amanda::Interactive::stdin -- Interactive class to read user request from stdin
-
-=head1 SYNOPSIS
-
-Amanda::Interactive class to write user request on stdout and read reply
-from stdin.
-
-=cut
-
-sub new {
-    my $class = shift;
-
-    my $self = {
-       input_src => undef,
-    };
-    return bless ($self, $class);
-}
-
-sub abort {
-    my $self = shift @_;
-
-    if ($self->{'input_src'}) {
-       $self->{'input_src'}->remove();
-       $self->{'input_src'} = undef;
-    }
-}
-
-sub user_request {
-    my $self = shift @_;
-    my %params = @_;
-    my $buffer = "";
-
-    my $message  = $params{'message'};
-    my $label    = $params{'label'};
-    my $err      = $params{'err'};
-    my $chg_name = $params{'chg_name'};
-
-    my $data_in = sub {
-       my $b;
-       my $n_read = POSIX::read(0, $b, 1);
-       if (!defined $n_read) {
-           return if ($! == EINTR);
-           $self->abort();
-           return $params{'finished_cb'}->(
-                       Amanda::Changer::Error->new('fatal',
-                               message => "Fail to read from stdin"));
-       } elsif ($n_read == 0) {
-           $self->abort();
-           return $params{'finished_cb'}->(
-                       Amanda::Changer::Error->new('fatal',
-                               message => "Aborted by user"));
-       } else {
-           $buffer .= $b;
-           if ($b eq "\n") {
-               my $line = $buffer;
-               chomp $line;
-               $buffer = "";
-               $self->abort();
-               return $params{'finished_cb'}->(undef, $line);
-           }
-       }
-    };
-
-    print "$err\n";
-    print "Insert volume labeled '$label' in $chg_name\n";
-    print "and press <enter> enter, or ^D to abort.\n";
-
-    $self->{'input_src'} = Amanda::MainLoop::fd_source(0, $G_IO_IN|$G_IO_HUP|$G_IO_ERR);
-    $self->{'input_src'}->set_callback($data_in);
-    return;
-}
-
-1;
diff --git a/perl/Amanda/Interactivity.pm b/perl/Amanda/Interactivity.pm
new file mode 100644 (file)
index 0000000..25fe79d
--- /dev/null
@@ -0,0 +1,151 @@
+# Copyright (c) 2010 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., 465 S. Mathilda Ave., Suite 300
+# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+
+package Amanda::Interactivity;
+
+=head1 NAME
+
+Amanda::Interactivity -- Parent class for user interactivity modules
+
+=head1 SYNOPSIS
+
+    use Amanda::Interactivity;
+
+    my $inter = Amanda::Interactivity->new(name => 'stdin');
+    $inter->user_request(
+       message => "Insert Volume labelled 'MY_LABEL-001' in changer DLT",
+       label => 'MY_LABEL-001',
+       new_volume => 0,
+       chg_name => 'DLT',
+       err => "Not found in the library",
+       request_cb => sub {
+           my ($err, $reply) = @_;
+           if ($err) {
+               # error from the script
+           } elsif (!defined $reply) {
+               # request aborted
+           } else {
+               # use reply
+           }
+       });
+
+=head1 SUMMARY
+
+This package provides a way for Amanda programs to communicate interactivityly
+with the user.  The program can send a message to the user and await a textual
+response.  The package operates asynchronously (see L<Amanda::MainLoop>), so
+the program may continue with other activities while waiting for an answer from
+the user.
+
+Several interactivity modules are (or soon will be) available, and can be
+selected by the user.
+
+=head1 INTERFACE
+
+A new object is create with the C<new> function as follows:
+
+    my $inter = Amanda::Interactivity->new(
+       name => $interactivity_name);
+
+Where C<$interactivity_name> is the name of the desired interactivity defined
+in the config file.
+
+=head2 INTERACTIVITY OBJECTS
+
+=head3 user_request
+
+  $inter->user_request(message     => $message,
+                       label       => $label,
+                       new_volume  => 0|1,
+                       err         => $err,
+                       chg_name    => $chg_name,
+                       request_cb  => $request_cb);
+
+This method return immediately.  It sends a message to the user and waits for a
+reply.
+ C<err> is the reason why the volume is needed.
+ C<message> is a sentence describing the requested volume.
+ The volume can be describe with many parameters:
+  C<label> is the requested label or the most prefered label.
+  C<new_volume> if a new volume is acceptable.
+  C<chg_name> the name of the changer where amanda expect the volume.
+
+A module can print only C<message> or build something prettier with the values
+of the other parameters.
+
+The C<request_cb> callback take one or two arguments.  In the even of an
+error, it is called with an C<Amanda::Changer::Error> object as first argument.
+If the request is answered, then the first argument is C<undef> and the second
+argument is the user's response.  If the request is aborted (see C<abort>,
+below), then both arguments are C<undef>.
+
+=head3 abort
+
+  $inter->abort()
+
+This method will abort all pending C<user_request> invocations, invoking their
+C<request_cb> with C<(undef, undef)>.
+
+=cut
+
+use Amanda::Config qw( :getconf );
+
+sub new {
+    shift eq 'Amanda::Interactivity'
+       or return;
+    my %params = @_;
+    my $interactivity_name = $params{'name'};
+
+    return undef if !defined $interactivity_name or $interactivity_name eq '';
+
+    my $interactivity = Amanda::Config::lookup_interactivity($interactivity_name);
+    my $plugin;
+    my $property;
+    if ($interactivity) {
+       $plugin = Amanda::Config::interactivity_getconf($interactivity, $INTERACTIVITY_PLUGIN);
+       $property = Amanda::Config::interactivity_getconf($interactivity, $INTERACTIVITY_PROPERTY);
+    } else {
+       $plugin = $interactivity_name;
+    }
+
+    die("No name for Amanda::Interactivity->(new)") if !defined $plugin;
+
+    my $pkgname = "Amanda::Interactivity::$plugin";
+    my $filename = $pkgname;
+    $filename =~ s|::|/|g;
+    $filename .= '.pm';
+
+    if (!exists $INC{$filename}) {
+       eval "use $pkgname;";
+       if ($@) {
+           my $err = $@;
+           die ($err);
+       }
+    }
+
+    my $self = eval {$pkgname->new($property);};
+    if ($@ || !defined $self) {
+       print STDERR "Can't instantiate $pkgname\n";
+       debug("Can't instantiate $pkgname");
+       die("Can't instantiate $pkgname");
+    }
+
+    return $self;
+}
+
+1;
diff --git a/perl/Amanda/Interactivity/email.pm b/perl/Amanda/Interactivity/email.pm
new file mode 100644 (file)
index 0000000..648d969
--- /dev/null
@@ -0,0 +1,166 @@
+# Copyright (c) 2010 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., 465 S. Mathilda Ave., Suite 300
+# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+
+package Amanda::Interactivity::email;
+
+use strict;
+use warnings;
+use POSIX qw( :errno_h );
+use vars qw( @ISA );
+use IPC::Open3;
+@ISA = qw( Amanda::Interactivity );
+
+use Amanda::Paths;
+use Amanda::Util;
+use Amanda::Debug qw( debug );
+use Amanda::Config qw( :getconf );
+use Amanda::Changer;
+use Amanda::MainLoop qw( :GIOCondition );
+
+=head1 NAME
+
+Amanda::Interactivity::email -- Interactivity class to send user request by email
+
+=head1 SYNOPSIS
+
+Amanda::Interactivity class to write user request by email
+
+=cut
+
+sub new {
+    my $class = shift;
+    my $properties = shift;
+
+    my $self = {
+       send_email_src => undef,
+       check_file_src => undef,
+       properties     => $properties,
+    };
+
+    return bless ($self, $class);
+}
+
+sub abort {
+    my $self = shift;
+
+    if ($self->{'send_email_src'}) {
+       $self->{'send_email_src'}->remove();
+    }
+    if ($self->{'check_file_src'}) {
+       $self->{'check_file_src'}->remove();
+    }
+}
+
+sub user_request {
+    my $self = shift;
+    my %params = @_;
+    my $buffer = "";
+
+    my $message    = $params{'message'};
+    my $label      = $params{'label'};
+    my $new_volume = $params{'new_volume'};
+    my $err        = $params{'err'};
+    my $chg_name   = $params{'chg_name'};
+
+    my $resend_delay;
+    if (defined $self->{'properties'}->{'resend-delay'}) {
+       $resend_delay = 1000 * $self->{'properties'}->{'resend-delay'}->{'values'}->[0];
+    }
+    my $check_file;
+    if (defined $self->{'properties'}->{'check-file'}) {
+       $check_file = $self->{'properties'}->{'check-file'}->{'values'}->[0];
+    }
+
+    my $check_file_delay = 10000;
+    if (defined $self->{'properties'}->{'check-file-delay'}) {
+       $check_file_delay = 1000 * $self->{'properties'}->{'check_file-delay'}->{'values'}->[0];
+    }
+
+    my $mailer  = getconf($CNF_MAILER);
+    my $subject;
+    if ($label) {
+       $subject = "AMANDA VOLUME REQUEST: $label";
+    } else {
+       $subject = "AMANDA VOLUME REQUEST: new volume";
+    }
+
+    my $mailto;
+    if (defined $self->{'properties'}->{'mailto'}) {
+       $mailto = $self->{'properties'}->{'mailto'}->{'values'};
+    } else {
+       my $a = getconf($CNF_MAILTO);
+       my @mailto = split (/ /, getconf($CNF_MAILTO));
+       $mailto = \@mailto;
+    }
+    my @cmd = ("$mailer", "-s", $subject, @{$mailto});
+
+    my $send_email_cb;
+    $send_email_cb = sub {
+       $self->{'send_email_src'} = undef;
+       debug("cmd: " . join(" ", @cmd) . "\n");
+       my ($pid, $fh);
+       $pid = open3($fh, ">&2", ">&2", @cmd);
+       print {$fh} "$err\n";
+       if ($label && $new_volume) {
+           print {$fh} "Insert volume labeled '$label' or a new volume in $chg_name\n";
+       } elsif ($label) {
+           print {$fh} "Insert volume labeled '$label' in $chg_name\n";
+       } else {
+           print {$fh} "Insert a new volume in $chg_name\n";
+       }
+       if ($check_file) {
+           print {$fh} "or write the name of a new changer in '$check_file'\n";
+           print {$fh} "or write 'abort' in the file to abort the scan.\n";
+       }
+       close $fh;
+       unlink($check_file);
+
+       if ($resend_delay) {
+           $self->{'send_email_src'} = Amanda::MainLoop::call_after($resend_delay, $send_email_cb);
+       }
+    };
+
+    my $check_file_cb;
+    $check_file_cb = sub {
+       $self->{'check_file_src'} = undef;
+
+       if (-f $check_file) {
+           my $fh;
+           open ($fh, '<' , $check_file);
+           my $line = <$fh>;
+           chomp $line;
+           $self->abort();
+           if ($line =~ /^abort$/i) {
+               return $params{'request_cb'}->(
+                       Amanda::Changer::Error->new('fatal',
+                               message => "Aborted by user"));
+           } else {
+               return $params{'request_cb'}->(undef, $line);
+           }
+       }
+       $self->{'check_file_src'} = Amanda::MainLoop::call_after($check_file_delay, $check_file_cb);
+    };
+
+    $send_email_cb->();
+    if ($check_file) {
+       unlink($check_file);
+       $check_file_cb->();
+    }
+}
+
+1;
diff --git a/perl/Amanda/Interactivity/stdin.pm b/perl/Amanda/Interactivity/stdin.pm
new file mode 100644 (file)
index 0000000..2b67216
--- /dev/null
@@ -0,0 +1,107 @@
+# Copyright (c) 2010 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., 465 S. Mathilda Ave., Suite 300
+# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+
+package Amanda::Interactivity::stdin;
+
+use strict;
+use warnings;
+use POSIX qw( :errno_h );
+use vars qw( @ISA );
+@ISA = qw( Amanda::Interactivity );
+
+use Amanda::Paths;
+use Amanda::Util;
+use Amanda::Debug qw( debug );
+use Amanda::Changer;
+use Amanda::MainLoop qw( :GIOCondition );
+
+=head1 NAME
+
+Amanda::Interactivity::stdin -- Interactivity class to read user request from stdin
+
+=head1 SYNOPSIS
+
+Amanda::Interactivity class to write user request on stdout and read reply
+from stdin.
+
+=cut
+
+sub new {
+    my $class = shift;
+
+    my $self = {
+       input_src => undef,
+    };
+    return bless ($self, $class);
+}
+
+sub abort {
+    my $self = shift @_;
+
+    if ($self->{'input_src'}) {
+       $self->{'input_src'}->remove();
+       $self->{'input_src'} = undef;
+    }
+}
+
+sub user_request {
+    my $self = shift @_;
+    my %params = @_;
+    my $buffer = "";
+
+    my $message  = $params{'message'};
+    my $label    = $params{'label'};
+    my $err      = $params{'err'};
+    my $chg_name = $params{'chg_name'};
+
+    my $data_in = sub {
+       my $b;
+       my $n_read = POSIX::read(0, $b, 1);
+       if (!defined $n_read) {
+           return if ($! == EINTR);
+           $self->abort();
+           return $params{'request_cb'}->(
+                       Amanda::Changer::Error->new('fatal',
+                               message => "Fail to read from stdin"));
+       } elsif ($n_read == 0) {
+           $self->abort();
+           return $params{'request_cb'}->(
+                       Amanda::Changer::Error->new('fatal',
+                               message => "Aborted by user"));
+       } else {
+           $buffer .= $b;
+           if ($b eq "\n") {
+               my $line = $buffer;
+               chomp $line;
+               $buffer = "";
+               $self->abort();
+               return $params{'request_cb'}->(undef, $line);
+           }
+       }
+    };
+
+    print "$err\n";
+    print "Insert volume labeled '$label' in $chg_name\n";
+    print "and press <enter> enter, or ^D to abort.\n";
+
+    $self->{'input_src'} = Amanda::MainLoop::fd_source(0, $G_IO_IN|$G_IO_HUP|$G_IO_ERR);
+    $self->{'input_src'}->set_callback($data_in);
+    return;
+}
+
+1;
diff --git a/perl/Amanda/Interactivity/tty.pm b/perl/Amanda/Interactivity/tty.pm
new file mode 100644 (file)
index 0000000..f3a6904
--- /dev/null
@@ -0,0 +1,149 @@
+# Copyright (c) 2010 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., 465 S. Mathilda Ave., Suite 300
+# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+
+package Amanda::Interactivity::tty;
+
+use strict;
+use warnings;
+use POSIX qw( :errno_h );
+use vars qw( @ISA );
+@ISA = qw( Amanda::Interactivity );
+
+use Amanda::Paths;
+use Amanda::Util;
+use Amanda::Debug qw( debug );
+use Amanda::Changer;
+use Amanda::MainLoop qw( :GIOCondition );
+
+=head1 NAME
+
+Amanda::Interactivity::tty -- Interactivity class to read user request from /dev/tty
+
+=head1 SYNOPSIS
+
+Amanda::Interactivity class to write user request on /dev/tty and read reply
+from /dev/tty.
+
+=cut
+
+sub new {
+    my $class = shift;
+    my $property = shift;
+
+    my $input;
+    my $output;
+    my $abort_message;
+
+    my $r = open($input, '<', "/dev/tty");
+    if (!$r) {
+       $abort_message = "Failed to open /dev/tty: $!";
+    } else {
+        $r = open($output, '>', "/dev/tty");
+       if (!$r) {
+           $abort_message = "Failed to open /dev/tty: $!";
+           close $input;
+           $input = undef;
+       }
+    }
+    my $self = {
+       input_src     => undef,
+       input         => $input,
+       output        => $output,
+       property      => $property,
+       abort_message => $abort_message,
+    };
+    return bless ($self, $class);
+}
+
+sub DESTROY {
+    my $self = shift;
+
+    close($self->{'input'})  if $self->{'input'};
+    close($self->{'output'}) if $self->{'output'};
+}
+
+sub abort {
+    my $self = shift @_;
+
+    if ($self->{'input_src'}) {
+       $self->{'input_src'}->remove();
+       $self->{'input_src'} = undef;
+    }
+}
+
+sub user_request {
+    my $self = shift @_;
+    my %params = @_;
+    my $buffer = "";
+
+    my $message    = $params{'message'};
+    my $label      = $params{'label'};
+    my $new_volume = $params{'new_volume'};
+    my $err        = $params{'err'};
+    my $chg_name   = $params{'chg_name'};
+
+    my $data_in = sub {
+       my $b;
+       my $n_read = POSIX::read(fileno($self->{'input'}), $b, 1);
+       if (!defined $n_read) {
+           return if ($! == EINTR);
+           $self->abort();
+           return $params{'request_cb'}->(
+                       Amanda::Changer::Error->new('fatal',
+                               message => "Fail to read from /dev/tty"));
+       } elsif ($n_read == 0) {
+           $self->abort();
+           return $params{'request_cb'}->(
+                       Amanda::Changer::Error->new('fatal',
+                               message => "Aborted by user"));
+       } else {
+           $buffer .= $b;
+           if ($b eq "\n") {
+               my $line = $buffer;
+               chomp $line;
+               $buffer = "";
+               $self->abort();
+               return $params{'request_cb'}->(undef, $line);
+           }
+       }
+    };
+
+    if ($self->{'abort_message'}) {
+       return $params{'request_cb'}->(
+                       Amanda::Changer::Error->new('fatal',
+                               message => $self->{'abort_message'}));
+    }
+
+    print {$self->{'output'}} "$err\n";
+    if ($label && $new_volume) {
+       print {$self->{'output'}} "Insert volume labeled '$label' or a new volume in $chg_name\n";
+    } elsif ($label) {
+       print {$self->{'output'}} "Insert volume labeled '$label' in $chg_name\n";
+    } else {
+       print {$self->{'output'}} "Insert a new volume in $chg_name\n";
+    }
+    print {$self->{'output'}} "and press <enter> enter, or ^D to abort.\n";
+
+    $self->{'input_src'} = Amanda::MainLoop::fd_source(
+                                               fileno($self->{'input'}),
+                                               $G_IO_IN|$G_IO_HUP|$G_IO_ERR);
+    $self->{'input_src'}->set_callback($data_in);
+    return;
+}
+
+1;
diff --git a/perl/Amanda/Interactivity/tty_email.pm b/perl/Amanda/Interactivity/tty_email.pm
new file mode 100644 (file)
index 0000000..851dc6c
--- /dev/null
@@ -0,0 +1,60 @@
+# Copyright (c) 2010, 2011 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., 465 S. Mathilda Ave., Suite 300
+# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+
+package Amanda::Interactivity::tty_email;
+
+use strict;
+use warnings;
+use POSIX qw( :errno_h );
+use vars qw( @ISA );
+@ISA = qw( Amanda::Interactivity );
+
+use Amanda::Paths;
+use Amanda::Util;
+use Amanda::Debug qw( debug );
+use Amanda::Changer;
+use Amanda::MainLoop qw( :GIOCondition );
+use Amanda::Interactivity::tty;
+use Amanda::Interactivity::email;
+
+=head1 NAME
+
+Amanda::Interactivity::tty_email -- Interactivity class to read user request from /dev/tty
+
+=head1 SYNOPSIS
+
+Amanda::Interactivity class combining tty (when it is available) and email (otherwise).
+
+=cut
+
+sub new {
+    my $class = shift;
+    my $property = shift;
+
+    my $input;
+
+    my $r = open($input, '>', "/dev/tty");
+    if ($r) {
+       close($input);
+       return Amanda::Interactivity::tty->new($property);
+    } else {
+       return Amanda::Interactivity::email->new($property);
+    }
+}
+
+1;
index d997f78a58e23666bd10bf2e668992180bb25162..44bb2ab0edc73dbec3d822cba23b133ba50d9e87 100644 (file)
@@ -2499,6 +2499,41 @@ XS(_wrap_find_result_t_sec_get) {
 }
 
 
+XS(_wrap_find_result_t_bytes_get) {
+  {
+    find_result_t *arg1 = (find_result_t *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    off_t result;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: find_result_t_bytes_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_bytes_get" "', argument " "1"" of type '" "find_result_t *""'"); 
+    }
+    arg1 = (find_result_t *)(argp1);
+    result =  ((arg1)->bytes);
+    {
+      SV *for_stack;
+      SP += argvi; PUTBACK;
+      for_stack = sv_2mortal(amglue_newSVu64(result));
+      SPAGAIN; SP -= argvi;
+      ST(argvi) = for_stack;
+      argvi++;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
 XS(_wrap_find_result_t_kb_get) {
   {
     find_result_t *arg1 = (find_result_t *) 0 ;
@@ -3293,6 +3328,7 @@ static swig_command_info swig_commands[] = {
 {"Amanda::Logfilec::find_result_t_partnum_get", _wrap_find_result_t_partnum_get},
 {"Amanda::Logfilec::find_result_t_totalparts_get", _wrap_find_result_t_totalparts_get},
 {"Amanda::Logfilec::find_result_t_sec_get", _wrap_find_result_t_sec_get},
+{"Amanda::Logfilec::find_result_t_bytes_get", _wrap_find_result_t_bytes_get},
 {"Amanda::Logfilec::find_result_t_kb_get", _wrap_find_result_t_kb_get},
 {"Amanda::Logfilec::find_result_t_orig_kb_get", _wrap_find_result_t_orig_kb_get},
 {"Amanda::Logfilec::new_find_result_t", _wrap_new_find_result_t},
index 8a18a8e4778c4def2cea99d44666890c9e57ff68..c179c43d7be0d40a9f5596811cd3b6cad44c218b 100644 (file)
@@ -110,6 +110,8 @@ sub DESTROY {
 *swig_totalparts_set = *Amanda::Logfilec::find_result_t_totalparts_set;
 *swig_sec_get = *Amanda::Logfilec::find_result_t_sec_get;
 *swig_sec_set = *Amanda::Logfilec::find_result_t_sec_set;
+*swig_bytes_get = *Amanda::Logfilec::find_result_t_bytes_get;
+*swig_bytes_set = *Amanda::Logfilec::find_result_t_bytes_set;
 *swig_kb_get = *Amanda::Logfilec::find_result_t_kb_get;
 *swig_kb_set = *Amanda::Logfilec::find_result_t_kb_set;
 *swig_orig_kb_get = *Amanda::Logfilec::find_result_t_orig_kb_get;
@@ -672,9 +674,9 @@ sub make_stats {
     my $kps = "$kb.0"/$duration; # Perlish cast from BigInt to float
 
     if (defined $orig_kb) {
-       return sprintf("[sec %f kb %d kps %f orig-kb %d]", $duration, $kb, $kps, $orig_kb);
+       return sprintf("[sec %f bytes %s kps %f orig-kb %s]", $duration, $size, $kps, $orig_kb);
     } else {
-       return sprintf("[sec %f kb %d kps %f]", $duration, $kb, $kps);
+       return sprintf("[sec %f bytes %s kps %f]", $duration, $size, $kps);
     }
 }
 
index 69b0846ab720a3b3acf41822412b4cac2ab01f22..9d1a1de48cc253aba84d610c7b97fb095b4b0822 100644 (file)
@@ -153,6 +153,7 @@ typedef struct {
     int partnum;
     int totalparts;
     double sec;
+    off_t bytes;
     off_t kb;
     off_t orig_kb;
     %mutable;
@@ -365,9 +366,9 @@ sub make_stats {
     my $kps = "$kb.0"/$duration; # Perlish cast from BigInt to float
 
     if (defined $orig_kb) {
-       return sprintf("[sec %f kb %d kps %f orig-kb %d]", $duration, $kb, $kps, $orig_kb);
+       return sprintf("[sec %f bytes %s kps %f orig-kb %s]", $duration, $size, $kps, $orig_kb);
     } else {
-       return sprintf("[sec %f kb %d kps %f]", $duration, $kb, $kps);
+       return sprintf("[sec %f bytes %s kps %f]", $duration, $size, $kps);
     }
 }
 
index 5fbec198e81b2f8c0ba64526fd90d2611ad3c346..98ce06f79427f0bf7d70221df006ccb2e721ae56 100644 (file)
@@ -498,6 +498,13 @@ To do the same for a single step, add the same keyword to the C<step> invocation
     step immediate => 1,
         connect => sub { .. };
 
+In some case, you want to execute some code when the step finish, it can
+be done by defining a finalize code in define_steps:
+
+    my $steps = define_steps
+           cb_ref => \$finished_cb,
+           finalize => sub { .. };
+
 =head2 JOINING ASYNCHRONOUS "THREADS"
 
 With slow operations, it is often useful to perform multiple operations
@@ -989,6 +996,7 @@ push @EXPORT_OK, "synchronized";
     sub define_steps (@) {
        my (%params) = @_;
        my $cb_ref = $params{'cb_ref'};
+       my $finalize = $params{'finalize'};
        my %steps;
 
        croak "cb_ref is undefined" unless defined $cb_ref;
@@ -1003,6 +1011,7 @@ push @EXPORT_OK, "synchronized";
        $$cb_ref = sub {
            %steps = ();
            $current_steps = undef;
+           $finalize->() if defined($finalize);
            goto $orig_cb;
        };
 
index d47a732d03eca627a7dcba771ca120daa19b66f3..a47e9c51288068f20c6d6c7d15417a02c0d9f66b 100644 (file)
@@ -408,6 +408,13 @@ To do the same for a single step, add the same keyword to the C<step> invocation
     step immediate => 1,
         connect => sub { .. };
 
+In some case, you want to execute some code when the step finish, it can
+be done by defining a finalize code in define_steps:
+
+    my $steps = define_steps
+           cb_ref => \$finished_cb,
+           finalize => sub { .. };
+
 =head2 JOINING ASYNCHRONOUS "THREADS"
 
 With slow operations, it is often useful to perform multiple operations
index 40c5c05407555d5c6e09de97495ce17acd781fbd..6b66c457b09f18d771e6b02a8978cc7116207a04 100644 (file)
@@ -262,6 +262,7 @@ push @EXPORT_OK, "synchronized";
     sub define_steps (@) {
        my (%params) = @_;
        my $cb_ref = $params{'cb_ref'};
+       my $finalize = $params{'finalize'};
        my %steps;
 
        croak "cb_ref is undefined" unless defined $cb_ref;
@@ -276,6 +277,7 @@ push @EXPORT_OK, "synchronized";
        $$cb_ref = sub {
            %steps = ();
            $current_steps = undef;
+           $finalize->() if defined($finalize);
            goto $orig_cb;
        };
 
index 1c462aca4ab02ea3826d98d86e7c7763af5915aa..810621f792d1a6ce7b81494ad0f0f1c9b16ac975 100644 (file)
@@ -300,18 +300,25 @@ sub handle_xmsg {
 sub quit {
     my $self = shift;
     my %params = @_;
+    my $finished_cb = $params{'finished_cb'};
 
     die "Cannot quit a Clerk while a transfer is in progress"
        if $self->{'xfer_state'};
 
-    # if we have a reservation, we need to release it; otherwise, we can
-    # just call finished_cb
-    if ($self->{'current_res'}) {
-       $self->{'current_dev'}->finish();
-       $self->{'current_res'}->release(finished_cb => $params{'finished_cb'});
-    } else {
-       $params{'finished_cb'}->();
-    }
+    my $steps = define_steps 
+       cb_ref => \$finished_cb,
+       finalize => sub { $self->{'scan'}->quit() if defined $self->{'scan'} };
+
+    step release => sub {
+       # if we have a reservation, we need to release it; otherwise, we can
+       # just call finished_cb
+       if ($self->{'current_res'}) {
+           $self->{'current_dev'}->finish();
+           $self->{'current_res'}->release(finished_cb => $finished_cb);
+       } else {
+           $finished_cb->();
+       }
+    };
 }
 
 sub _xmsg_ready {
index e312d4758d57f2548076e04d56a25b08f7eb02a9..c1d28fb4c6410446e5223c747e85e81a20b9cef2 100644 (file)
@@ -33,13 +33,13 @@ use Amanda::Device qw( :constants );
 use Amanda::Debug qw( debug );
 use Amanda::Changer;
 use Amanda::MainLoop;
-use Amanda::Interactive;
+use Amanda::Interactivity;
 
-use constant SCAN_ASK  => 1;     # call Amanda::Interactive module
+use constant SCAN_ASK  => 1;     # call Amanda::Interactivity module
 use constant SCAN_POLL => 2;     # wait 'poll_delay' and retry the scan.
 use constant SCAN_FAIL => 3;     # abort
 use constant SCAN_CONTINUE => 4; # continue to the next step
-use constant SCAN_ASK_POLL => 5; # call Amanda::Interactive module and
+use constant SCAN_ASK_POLL => 5; # call Amanda::Interactivity module and
                                 # poll at the same time.
 
 =head1 NAME
@@ -52,9 +52,9 @@ Amanda::Recovery::Scan -- interface to scan algorithm
 
     # scan the default changer with no interactivity
     my $scan = Amanda::Recovery::Scan->new();
-    # ..or scan the changer $chg, using $interactive for interactivity
+    # ..or scan the changer $chg, using $interactivity for interactivity
     $scan = Amanda::Recovery::Scan->new(chg => $chg,
-                                        interactive => $interactive);
+                                        interactivity => $interactivity);
 
     $scan->find_volume(
        label => "TAPE-012",
@@ -70,6 +70,9 @@ Amanda::Recovery::Scan -- interface to scan algorithm
     # later..
     $reservation->release(finished_cb => $start_next_volume);
 
+    # later..
+    $scan->quit(); # also quit the changer
+
     
 =head1 OVERVIEW
 
@@ -85,14 +88,14 @@ requires that the caller use L<Amanda::MainLoop> to poll for events.
 
 A new Scan object is created with the C<new> function as follows:
 
-  my $scan = Amanda::Recovery::Scan->new(scan_conf   => $scan_conf,
-                                         chg         => $chg,
-                                         interactive => $interactive);
+  my $scan = Amanda::Recovery::Scan->new(scan_conf     => $scan_conf,
+                                         chg           => $chg,
+                                         interactivity => $interactivity);
 
 C<scan_conf> is the configuration for the scan, which at this point should be
 omitted, as configuration is not yet supported.  The C<chg> parameter specifies
 the changer to start the scan with. The default changer is used if C<chg> is
-omitted. The C<interactive> parameter gives an C<Amanda::Interactive> object.
+omitted. The C<interactivity> parameter gives an C<Amanda::Interactivity> object.
 
 =head2 CALLBACKS
 
@@ -119,6 +122,12 @@ the next section.  As with the C<load> method
 of the changer API, C<set_current> should be set to 1 if you want the scan to
 set the current slot.
 
+=head3 quit
+
+  $scan->quit()
+
+The cleanly terminate a scan objet, the changer quit is also called.
+
 =head3 user_msg_fn
 
 The user_msg_fn take various arguments
@@ -149,21 +158,38 @@ sub new {
     my %params = @_;
     my $scan_conf = $params{'scan_conf'};
     my $chg = $params{'chg'};
-    my $interactive = $params{'interactive'};
+    my $interactivity = $params{'interactivity'};
 
     #until we have a config for it.
     $scan_conf = Amanda::Recovery::Scan::Config->new();
     $chg = Amanda::Changer->new() if !defined $chg;
 
     my $self = {
-       initial_chg => $chg,
-       chg         => $chg,
-       scan_conf   => $scan_conf,
-        interactive => $interactive,
+       initial_chg   => $chg,
+       chg           => $chg,
+       scan_conf     => $scan_conf,
+        interactivity => $interactivity,
     };
     return bless ($self, $class);
 }
 
+sub DESTROY {
+    my $self = shift;
+
+    die("Recovery::Scan detroyed without quit") if defined $self->{'scan_conf'};
+}
+
+sub quit {
+    my $self = shift;
+
+    $self->{'chg'}->quit() if defined $self->{'chg'};
+
+    foreach (keys %$self) {
+       delete $self->{$_};
+    }
+
+}
+
 sub find_volume {
     my $self = shift;
     my %params = @_;
@@ -177,7 +203,7 @@ sub find_volume {
     my $new_slot;
     my $poll_src;
     my $scan_running = 0;
-    my $interactive_running = 0;
+    my $interactivity_running = 0;
     my $restart_scan = 0;
     my $abort_scan = undef;
     my $last_err = undef; # keep the last meaningful error, the one reported
@@ -281,7 +307,7 @@ sub find_volume {
        }
 
        # Remove from seen all slot that have state == SLOT_UNKNOWN
-       # It is done when as scan is restarted from interactive object.
+       # It is done when as scan is restarted from interactivity object.
        if ($remove_undef_state) {
            for my $i (0..(scalar(@$inventory)-1)) {
                my $slot = $inventory->[$i]->{slot};
@@ -508,23 +534,23 @@ sub find_volume {
            }
        }
 
-       if ($scan_method == SCAN_ASK && !defined $self->{'interactive'}) {
+       if ($scan_method == SCAN_ASK && !defined $self->{'interactivity'}) {
            $scan_method = SCAN_FAIL;
        }
 
-       if ($scan_method == SCAN_ASK_POLL && !defined $self->{'interactive'}) {
+       if ($scan_method == SCAN_ASK_POLL && !defined $self->{'interactivity'}) {
            $scan_method = SCAN_FAIL;
        }
 
        if ($scan_method == SCAN_ASK) {
-           return $steps->{'scan_interactive'}->("$message");
+           return $steps->{'scan_interactivity'}->("$message");
        } elsif ($scan_method == SCAN_POLL) {
            $poll_src = Amanda::MainLoop::call_after(
                                $self->{'scan_conf'}->{'poll_delay'},
                                $steps->{'after_poll'});
            return;
        } elsif ($scan_method == SCAN_ASK_POLL) {
-           $steps->{'scan_interactive'}->("$message\n");
+           $steps->{'scan_interactivity'}->("$message\n");
            $poll_src = Amanda::MainLoop::call_after(
                                $self->{'scan_conf'}->{'poll_delay'},
                                $steps->{'after_poll'});
@@ -544,24 +570,24 @@ sub find_volume {
        return $steps->{'restart_scan'}->();
     };
 
-    step scan_interactive => sub {
+    step scan_interactivity => sub {
        my ($err_message) = @_;
-       if (!$interactive_running) {
-           $interactive_running = 1;
+       if (!$interactivity_running) {
+           $interactivity_running = 1;
            my $message = "$err_message\nInsert volume labeled '$label' in changer and type <enter>\nor type \"^D\" to abort\n";
-           $self->{'interactive'}->user_request(
+           $self->{'interactivity'}->user_request(
                                message     => $message,
                                label       => $label,
                                err         => "$err_message",
                                chg_name    => $self->{'chg'}->{'chg_name'},
-                               finished_cb => $steps->{'scan_interactive_cb'});
+                               request_cb  => $steps->{'scan_interactivity_cb'});
        }
        return;
     };
 
-    step scan_interactive_cb => sub {
+    step scan_interactivity_cb => sub {
        my ($err, $message) = @_;
-       $interactive_running = 0;
+       $interactivity_running = 0;
        $poll_src->remove() if defined $poll_src;
        $poll_src = undef;
        $last_err = undef;
@@ -584,8 +610,9 @@ sub find_volume {
                $new_chg = Amanda::Changer->new($message);
            }
            if ($new_chg->isa("Amanda::Changer::Error")) {
-               return $steps->{'scan_interactive'}->("$new_chg");
+               return $steps->{'scan_interactivity'}->("$new_chg");
            }
+           $self->{'chg'}->quit();
            $self->{'chg'} = $new_chg;
            %seen = ();
        } else {
@@ -613,8 +640,8 @@ sub find_volume {
        $abort_scan = undef;
        $poll_src->remove() if defined $poll_src;
        $poll_src = undef;
-       $interactive_running = 0;
-       $self->{'interactive'}->abort() if defined $self->{'interactive'};
+       $interactivity_running = 0;
+       $self->{'interactivity'}->abort() if defined $self->{'interactivity'};
        $params{'res_cb'}->($err, $res);
     };
 }
@@ -693,14 +720,8 @@ sub new {
 
     $self->{'scan_drive'} = 0;
     $self->{'scan_unknown_slot'} = 1;
-    $self->{'scan_interactivity'} = undef;
-    $self->{'poll'} = 0;
-    $self->{'wait'} = 1;
-    $self->{'poll_unknown_slot'} = 0;
-    $self->{'poll_drive'} = 0;
     $self->{'poll_delay'} = 10000; #10 seconds
-    $self->{'user_unknown_slot'} = 1;
-    $self->{'user_drive'} = 0;
+
     $self->{'fatal'} = Amanda::Recovery::Scan::SCAN_CONTINUE;
     $self->{'driveinuse'} = Amanda::Recovery::Scan::SCAN_ASK_POLL;
     $self->{'volinuse'} = Amanda::Recovery::Scan::SCAN_ASK_POLL;
index 94e79e75bc13cc7af8a7374c2da730889a0a89e6..78a3c303425ca1508ab546aea68897eb9bebd44c 100644 (file)
@@ -790,6 +790,7 @@ sub _handle_dumper_line
         my @info = Amanda::Util::split_quoted_strings($str);
         my ( $hostname, $disk, $level ) = @info[ 0 .. 2 ];
         my ( $sec, $kb, $kps, $orig_kb ) = @info[ 4, 6, 8, 10 ];
+       $kb = int($kb/1024) if $info[4] eq 'bytes';
         $orig_kb =~ s{\]$}{};
 
         my $dle    = $disklist->{$hostname}->{$disk};
@@ -817,6 +818,7 @@ sub _handle_dumper_line
         my @info = Amanda::Util::split_quoted_strings($str);
         my ( $hostname, $disk, $timestamp, $level ) = @info[ 0 .. 3 ];
         my ( $sec, $kb, $kps, $orig_kb ) = @info[ 5, 7, 9, 11 ];
+       $kb = int($kb/1024) if $info[6] eq 'bytes';
         $orig_kb =~ s{\]$}{};
 
         my $dle    = $disklist->{$hostname}->{$disk};
@@ -864,6 +866,7 @@ sub _handle_chunker_line
         my @info = Amanda::Util::split_quoted_strings($str);
         my ( $hostname, $disk, $timestamp, $level ) = @info[ 0 .. 3 ];
         my ( $sec, $kb, $kps ) = @info[ 5, 7, 9 ];
+       $kb = int($kb/1024) if $info[6] eq 'bytes';
         $kps =~ s{\]$}{};
 
         my $dle     = $disklist->{$hostname}->{$disk};
@@ -930,6 +933,7 @@ sub _handle_taper_line
         my ( $currpart, $predparts ) = ( $1, $2 );
 
         my ($level, $sec, $kb, $kps, $orig_kb) = @info[ 6, 8, 10, 12, 14 ];
+       $kb = int($kb/1024) if $info[9] eq 'bytes';
         $kps =~ s{\]$}{};
         $orig_kb =~ s{\]$}{} if defined($orig_kb);
 
@@ -967,6 +971,7 @@ sub _handle_taper_line
         my @info = Amanda::Util::split_quoted_strings($str);
         my ( $hostname, $disk, $timestamp, $part_ct, $level ) = @info[ 0 .. 4 ];
         my ( $sec, $kb, $kps, $orig_kb ) = @info[ 6, 8, 10, 12 ];
+       $kb = int($kb/1024) if $info[7] eq 'bytes';
        my $error;
        if ($type == $L_PARTIAL) {
            if ($kps =~ /\]$/) {
diff --git a/perl/Amanda/ScanInventory.pm b/perl/Amanda/ScanInventory.pm
new file mode 100644 (file)
index 0000000..c76fc02
--- /dev/null
@@ -0,0 +1,541 @@
+# Copyright (c) 2010 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., 465 S. Mathilda Ave., Suite 300
+# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+
+package Amanda::ScanInventory;
+
+=head1 NAME
+
+Amanda::ScanInventory
+
+=head1 SYNOPSIS
+
+This package implements a base class for all scan that use the inventory.
+see C<amanda-taperscan(7)>.
+
+=cut
+
+use strict;
+use warnings;
+use Amanda::Tapelist;
+use Carp;
+use POSIX ();
+use Data::Dumper;
+use vars qw( @ISA );
+use base qw(Exporter);
+our @EXPORT_OK = qw($DEFAULT_CHANGER);
+
+use Amanda::Paths;
+use Amanda::Util;
+use Amanda::Device qw( :constants );
+use Amanda::Debug qw( debug );
+use Amanda::Changer;
+use Amanda::MainLoop;
+use Amanda::Interactivity;
+
+use constant SCAN_ASK      => 1; # call Amanda::Interactivity module
+use constant SCAN_POLL     => 2; # wait 'poll_delay' and retry the scan.
+use constant SCAN_FAIL     => 3; # abort
+use constant SCAN_CONTINUE => 4; # continue to the next step
+use constant SCAN_ASK_POLL => 5; # call Amanda::Interactivity module and
+                                # poll at the same time.
+use constant SCAN_LOAD     => 6; # load a slot
+use constant SCAN_DONE     => 7; # successful scan
+
+our $DEFAULT_CHANGER = {};
+
+sub new {
+    my $class = shift;
+    my %params = @_;
+    my $scan_conf = $params{'scan_conf'};
+    my $tapelist = $params{'tapelist'};
+    my $chg = $params{'changer'};
+    my $interactivity = $params{'interactivity'};
+
+    #until we have a config for it.
+    $scan_conf = Amanda::ScanInventory::Config->new();
+    $chg = Amanda::Changer->new() if !defined $chg;
+
+    my $self = {
+       initial_chg => $chg,
+       chg         => $chg,
+       scanning    => 0,
+       scan_conf   => $scan_conf,
+        interactivity => $interactivity,
+       seen        => {},
+       scan_num    => 0
+    };
+    return bless ($self, $class);
+}
+
+
+sub scan {
+    my $self = shift;
+    my %params = @_;
+
+    die "Can only run one scan at a time" if $self->{'scanning'};
+    $self->{'scanning'} = 1;
+    $self->{'user_msg_fn'} = $params{'user_msg_fn'} || sub {};
+
+    # refresh the tapelist at every scan
+    $self->read_tapelist();
+
+    # count the number of scans we do, so we can only load 'current' on the
+    # first scan
+    $self->{'scan_num'}++;
+
+    $self->_scan(%params);
+}
+
+sub _user_msg {
+    my $self = shift;
+    my %params = @_;
+    $self->{'user_msg_fn'}->(%params);
+}
+
+sub _scan {
+    my $self = shift;
+    my %params = @_;
+
+    my $user_msg_fn = $params{'user_msg_fn'} || \&_user_msg_fn;
+    my $action;
+    my $action_slot;
+    my $res;
+    my %seen = ();
+    my $inventory;
+    my $current;
+    my $new_slot;
+    my $poll_src;
+    my $scan_running = 0;
+    my $interactivity_running = 0;
+    my $restart_scan = 0;
+    my $abort_scan = undef;
+    my $last_err = undef; # keep the last meaningful error, the one reported
+                         # to the user, most scan end with the notfound error,
+                         # it's more interesting to report an error from the
+                         # device or ...
+    my $slot_scanned;
+    my $remove_undef_state = 0;
+    my $result_cb = $params{'result_cb'};
+
+    my $steps = define_steps
+       cb_ref => \$result_cb;
+
+    step get_first_inventory => sub {
+       $scan_running = 1;
+       $self->{'chg'}->inventory(inventory_cb => $steps->{'got_first_inventory'});
+    };
+
+    step got_first_inventory => sub {
+       (my $err, $inventory) = @_;
+
+       if ($err && $err->notimpl) {
+           #inventory not implemented
+           die("no inventory");
+       } elsif ($err) {
+           #inventory fail
+           return $steps->{'call_result_cb'}->($err, undef);
+       }
+
+       # continue parsing the inventory
+       $steps->{'parse_inventory'}->($err, $inventory);
+    };
+
+    step restart_scan => sub {
+       $restart_scan = 0;
+       return $steps->{'get_inventory'}->();
+    };
+
+    step get_inventory => sub {
+       $self->{'chg'}->inventory(inventory_cb => $steps->{'parse_inventory'});
+    };
+
+    step parse_inventory => sub {
+       (my $err, $inventory) = @_;
+
+       if ($err && $err->notimpl) {
+           #inventory not implemented
+           die("no inventory");
+       }
+       return $steps->{'handle_error'}->($err, undef) if $err;
+
+       # throw out the inventory result and move on if the situation has
+       # changed while we were waiting
+       return $steps->{'abort_scan'}->() if $abort_scan;
+       return $steps->{'restart_scan'}->() if $restart_scan;
+
+       # Remove from seen all slot that have state == SLOT_UNKNOWN
+       # It is done when a scan is restarted from interactivity object.
+       if ($remove_undef_state) {
+           for my $i (0..(scalar(@$inventory)-1)) {
+               my $slot = $inventory->[$i]->{slot};
+               if (exists($seen{$slot}) &&
+                   !defined($inventory->[$i]->{state})) {
+                   delete $seen{$slot}
+               }
+           }
+           $remove_undef_state = 0;
+       }
+
+       # remove any slots where the state has changed from the list of seen slots
+       for my $i (0..(scalar(@$inventory)-1)) {
+           my $sl = $inventory->[$i];
+           my $slot = $sl->{slot};
+           if ($seen{$slot} &&
+               !defined ($seen{$slot}->{'failed'}) &&
+               defined($sl->{'state'}) &&
+               (($seen{$slot}->{'device_status'} != $sl->{'device_status'}) ||
+                (defined $seen{$slot}->{'device_status'} &&
+                 $seen{$slot}->{'device_status'} == $DEVICE_STATUS_SUCCESS &&
+                 $seen{$slot}->{'f_type'} != $sl->{'f_type'}) ||
+                (defined $seen{$slot}->{'device_status'} &&
+                 $seen{$slot}->{'device_status'} == $DEVICE_STATUS_SUCCESS &&
+                 defined $seen{$slot}->{'f_type'} &&
+                 $seen{$slot}->{'f_type'} == $Amanda::Header::F_TAPESTART &&
+                 $seen{$slot}->{'label'} ne $sl->{'label'}))) {
+               delete $seen{$slot};
+           }
+       }
+
+       ($action, $action_slot) = $self->analyze($inventory, \%seen, $res);
+
+       if ($action == Amanda::ScanInventory::SCAN_DONE) {
+           return $steps->{'call_result_cb'}->(undef, $res);
+       }
+
+       if (defined $res) {
+           $res->release(finished_cb => $steps->{'released'});
+       } else {
+           $steps->{'released'}->();
+       }
+    };
+
+    step released => sub {
+       if ($action == Amanda::ScanInventory::SCAN_LOAD) {
+           $slot_scanned = $action_slot;
+           $self->_user_msg(scan_slot => 1,
+                            slot => $slot_scanned);
+           return $self->{'changer'}->load(
+                       slot => $slot_scanned,
+                       set_current => $params{'set_current'},
+                       res_cb => $steps->{'slot_loaded'});
+       }
+
+       my $err;
+       if ($last_err) {
+           $err = $last_err;
+       } else {
+           $err = Amanda::Changer::Error->new('failed',
+                               reason => 'notfound',
+                               message => "No acceptable volumes found");
+       }
+
+       if ($action == Amanda::ScanInventory::SCAN_FAIL) {
+           return $steps->{'handle_error'}->($err, undef);
+       }
+       $scan_running = 0;
+       $steps->{'scan_next'}->($action, $err);
+    };
+
+    step slot_loaded => sub {
+       (my $err, $res) = @_;
+
+       # we don't responsd to abort_scan or restart_scan here, since we
+       # have an open reservation that we should deal with.
+
+       my $label;
+       if ($res && defined $res->{device} &&
+           $res->{device}->status == $DEVICE_STATUS_SUCCESS) {
+           $label = $res->{device}->volume_label;
+       }
+       $self->_user_msg(slot_result => 1,
+                        slot => $slot_scanned,
+                        label => $label,
+                        err  => $err,
+                        res  => $res);
+       if ($res) {
+           my $f_type;
+           if (defined $res->{device}->volume_header) {
+               $f_type = $res->{device}->volume_header->{type};
+           }
+
+           # The slot did not contain the volume we wanted, so mark it
+           # as seen and try again.
+           $seen{$slot_scanned} = {
+                       device_status => $res->{device}->status,
+                       f_type => $f_type,
+                       label  => $res->{device}->volume_label
+           };
+
+           # notify the user
+           if ($res->{device}->status == $DEVICE_STATUS_SUCCESS) {
+               $last_err = undef;
+           } else {
+               $last_err = Amanda::Changer::Error->new('fatal',
+                               message => $res->{device}->error_or_status());
+           }
+       } else {
+           $seen{$slot_scanned} = { failed => 1 };
+           if ($err->volinuse) {
+               # Scan semantics for volinuse is different than changer.
+               # If a slot with unknown label is loaded then we map
+               # volinuse to driveinuse.
+               $err->{reason} = "driveinuse";
+           }
+           $last_err = $err if $err->fatal || !$err->notfound;
+       }
+       return $steps->{'load_released'}->();
+    };
+
+    step load_released => sub {
+       my ($err) = @_;
+
+       # TODO: handle error
+
+       # throw out the inventory result and move on if the situation has
+       # changed while we were loading a volume
+       return $steps->{'abort_scan'}->() if $abort_scan;
+       return $steps->{'restart_scan'}->() if $restart_scan;
+
+       $new_slot = $current;
+       $steps->{'get_inventory'}->();
+    };
+
+    step handle_error => sub {
+       my ($err, $continue_cb) = @_;
+
+       my $scan_method = undef;
+       $scan_running = 0;
+       my $message;
+
+       $poll_src->remove() if defined $poll_src;
+       $poll_src = undef;
+
+       # prefer to use scan method for $last_err, if present
+       if ($last_err && $err->failed && $err->notfound) {
+           $message = "$last_err";
+       
+           if ($last_err->isa("Amanda::Changer::Error")) {
+               if ($last_err->fatal) {
+                   $scan_method = $self->{'scan_conf'}->{'fatal'};
+               } else {
+                   $scan_method = $self->{'scan_conf'}->{$last_err->{'reason'}};
+               }
+           } elsif ($continue_cb) {
+               $scan_method = SCAN_CONTINUE;
+           }
+       }
+
+       #use scan method for $err
+       if (!defined $scan_method) {
+           if ($err) {
+               $message = "$err" if !defined $message;
+               if ($err->fatal) {
+                   $scan_method = $self->{'scan_conf'}->{'fatal'};
+               } else {
+                   $scan_method = $self->{'scan_conf'}->{$err->{'reason'}};
+               }
+           } else {
+               die("error not defined");
+               $scan_method = SCAN_ASK_POLL;
+           }
+       }
+
+       ## implement the desired scan method
+
+       if ($scan_method == SCAN_CONTINUE && !defined $continue_cb) {
+           $scan_method = $self->{'scan_conf'}->{'notfound'};
+           if ($scan_method == SCAN_CONTINUE) {
+               $scan_method = SCAN_FAIL;
+           }
+       }
+       $steps->{'scan_next'}->($scan_method, $err, $continue_cb);
+    };
+
+    step scan_next => sub {
+       my ($scan_method, $err, $continue_cb) = @_;
+
+       if ($scan_method == SCAN_ASK && !defined $self->{'interactivity'}) {
+           $scan_method = SCAN_FAIL;
+       }
+
+       if ($scan_method == SCAN_ASK_POLL && !defined $self->{'interactivity'}) {
+           $scan_method = SCAN_FAIL;
+       }
+
+       if ($scan_method == SCAN_ASK) {
+           return $steps->{'scan_interactivity'}->("$err");
+       } elsif ($scan_method == SCAN_POLL) {
+           $poll_src = Amanda::MainLoop::call_after(
+                               $self->{'scan_conf'}->{'poll_delay'},
+                               $steps->{'after_poll'});
+           return;
+       } elsif ($scan_method == SCAN_ASK_POLL) {
+           $steps->{'scan_interactivity'}->("$err\n");
+           $poll_src = Amanda::MainLoop::call_after(
+                               $self->{'scan_conf'}->{'poll_delay'},
+                               $steps->{'after_poll'});
+           return;
+       } elsif ($scan_method == SCAN_FAIL) {
+           return $steps->{'call_result_cb'}->($err, undef);
+       } elsif ($scan_method == SCAN_CONTINUE) {
+           return $continue_cb->($err, undef);
+       } else {
+           die("Invalid SCAN_* value:$err:$err->{'reason'}:$scan_method");
+       }
+    };
+
+    step after_poll => sub {
+       $poll_src->remove() if defined $poll_src;
+       $poll_src = undef;
+       return $steps->{'restart_scan'}->();
+    };
+
+    step scan_interactivity => sub {
+       my ($err_message) = @_;
+       if (!$interactivity_running) {
+           $interactivity_running = 1;
+           my $message = "$err_message\n";
+           if ($self->{'most_prefered_label'}) {
+               $message .= "Insert volume labeled '$self->{'most_prefered_label'}'";
+           } else {
+               $message .= "Insert a new volume";
+           }
+           $message .= " in changer and type <enter>\nor type \"^D\" to abort\n";
+           $self->{'interactivity'}->user_request(
+                               message     => $message,
+                               label       => $self->{'most_prefered_label'},
+                               new_volume  => !$self->{'most_prefered_label'},
+                               err         => "$err_message",
+                               chg_name    => $self->{'chg'}->{'chg_name'},
+                               request_cb  => $steps->{'scan_interactivity_cb'});
+       }
+       return;
+    };
+
+    step scan_interactivity_cb => sub {
+       my ($err, $message) = @_;
+       $interactivity_running = 0;
+       $poll_src->remove() if defined $poll_src;
+       $poll_src = undef;
+       $last_err = undef;
+
+       if ($err) {
+           if ($scan_running) {
+               $abort_scan = $err;
+               return;
+           } else {
+               return $steps->{'call_result_cb'}->($err, undef);
+           }
+       }
+
+       if ($message ne '') {
+           # use a new changer
+           my $new_chg;
+           if (ref($message) eq 'HASH' and $message == $DEFAULT_CHANGER) {
+               $new_chg = Amanda::Changer->new();
+           } else {
+               $new_chg = Amanda::Changer->new($message);
+           }
+           if ($new_chg->isa("Amanda::Changer::Error")) {
+               return $steps->{'scan_interactivity'}->("$new_chg");
+           }
+           $self->{'chg'}->quit() if $self->{'chg'} != $self->{'initial_chg'};
+           $self->{'chg'} = $new_chg;
+           %seen = ();
+       } else {
+           $remove_undef_state = 1;
+       }
+
+       if ($scan_running) {
+           $restart_scan = 1;
+           return;
+       } else {
+           return $steps->{'restart_scan'}->();
+       }
+    };
+
+    step abort_scan => sub {
+       if (defined $res) {
+           $res->released(finished_cb => $steps->{'abort_scan_released'});
+       } else {
+           $steps->{'abort_scan_released'}->();
+       }
+    };
+
+    step abort_scan_released => sub {
+       $steps->{'call_result_cb'}->($abort_scan, undef);
+    };
+
+    step call_result_cb => sub {
+       (my $err, $res) = @_;
+
+       # TODO: what happens if the search was aborted or
+       # restarted in the interim?
+
+       $abort_scan = undef;
+       $poll_src->remove() if defined $poll_src;
+       $poll_src = undef;
+       $interactivity_running = 0;
+       $self->{'interactivity'}->abort() if defined $self->{'interactivity'};
+       $self->{'chg'}->quit() if $self->{'chg'} != $self->{'initial_chg'} and !$res;
+       if ($err) {
+           $self->{'scanning'} = 0;
+           return $result_cb->($err, $res);
+       }
+       my $label = $res->{'device'}->volume_label;
+       if (!defined $label) {
+           ($label, my $make_err) = $res->make_new_tape_label();
+           if (!defined $label) {
+               # make this fatal, rather than silently skipping new tapes
+               $self->{'scanning'} = 0;
+               return $result_cb->($make_err, $res);
+           }
+           $self->{'scanning'} = 0;
+           return $result_cb->(undef, $res, $label, $ACCESS_WRITE, 1);
+       }
+       $self->{'scanning'} = 0;
+       return $result_cb->(undef, $res, $label, $ACCESS_WRITE);
+    };
+}
+
+package Amanda::ScanInventory::Config;
+
+sub new {
+    my $class = shift;
+    my ($cc) = @_;
+
+    my $self = bless {}, $class;
+
+    $self->{'poll_delay'} = 10000; #10 seconds
+
+    $self->{'fatal'} = Amanda::ScanInventory::SCAN_CONTINUE;
+    $self->{'driveinuse'} = Amanda::ScanInventory::SCAN_ASK_POLL;
+    $self->{'volinuse'} = Amanda::ScanInventory::SCAN_ASK_POLL;
+    $self->{'notfound'} = Amanda::ScanInventory::SCAN_ASK_POLL;
+    $self->{'unknown'} = Amanda::ScanInventory::SCAN_FAIL;
+    $self->{'invalid'} = Amanda::ScanInventory::SCAN_CONTINUE;
+
+    $self->{'scan'} = 1;
+    $self->{'ask'} = 1;
+    $self->{'new_labeled'} = 'order';
+    $self->{'new_volume'} = 'order';
+
+    return $self;
+}
+
+1;
index c8015d0da3d5a0cd9cc70633b1795ba27ab59b6e..c8333d60f5efe88ad8b5eda26f62a5c8e618ebc0 100644 (file)
@@ -65,17 +65,23 @@ sub new {
 
     $self->{known_commands} = {
         support             => 1,
+        pre_amcheck         => 1,
         pre_dle_amcheck     => 1,
         pre_host_amcheck    => 1,
+        post_amcheck        => 1,
         post_dle_amcheck    => 1,
         post_host_amcheck   => 1,
         pre_dle_estimate    => 1,
+        pre_estimate        => 1,
         pre_host_estimate   => 1,
+        post_estimate       => 1,
         post_dle_estimate   => 1,
         post_host_estimate  => 1,
+        pre_backup          => 1,
         pre_dle_backup      => 1,
         pre_host_backup     => 1,
         post_dle_backup     => 1,
+        post_backup         => 1,
         post_host_backup    => 1,
         pre_recover         => 1,
         post_recover        => 1,
index 2e6026185da7247892a7027cd70051fb738b66cd..0b8c3f992875f8db344be241ad0b6200de847639 100644 (file)
@@ -23,6 +23,7 @@ no warnings;
 no strict;
 $GOOD  = 0;
 $ERROR = 1;
+$FAILURE = 2;
 
 use strict;
 use warnings;
@@ -116,8 +117,10 @@ sub print_to_server {
     } elsif ($self->{action} eq "backup") {
        if ($status == $Amanda::Script_App::GOOD) {
             print {$self->{mesgout}} "| $msg\n";
-       } else {
+       } elsif ($status == $Amanda::Script_App::ERROR) {
             print {$self->{mesgout}} "? $msg\n";
+       } else {
+            print {$self->{mesgout}} "sendbackup: error $msg\n";
        }
     } elsif ($self->{action} eq "restore") {
         print STDERR "$msg\n";
index 4a2d28445a8416a6565356d0921a1ccceb26f02c..b028127ad60882c05382a0745a2f6bd1e10a5737 100644 (file)
@@ -310,17 +310,35 @@ sub remove_tapelabel {
 sub add_tapelabel {
     my $self = shift;
     my ($datestamp, $label, $comment, $reuse, $meta, $barcode) = @_;
-    # $meta is unused
     $reuse = 1 if !defined $reuse;
 
     # prepend this (presumably new) volume to the beginning of the list
-    unshift @{$self->{'tles'}}, {
-       'datestamp' => $datestamp,
-       'label' => $label,
-       'reuse' => $reuse,
-       'barcode' => $barcode,
-       'comment' => $comment,
+    my $tle = {
+        'datestamp' => $datestamp,
+        'label'     => $label,
+        'reuse'     => $reuse,
+        'barcode'   => $barcode,
+        'meta'      => $meta,
+        'comment'   => $comment,
     };
+    my $tles = $self->{'tles'};
+    if (!defined $tles->[0] ||
+       $tles->[0]->{'datestamp'} le $datestamp) {
+       unshift @{$tles}, $tle;
+    } elsif (defined $tles->[0] &&
+       $tles->[@$tles-1]->{'datestamp'} gt $datestamp) {
+       push @{$tles}, $tle;
+    } else {
+       my $added = 0;
+       for my $i (0..(@$tles-1)) {
+           if ($tles->[$i]->{'datestamp'} le $datestamp) {
+               splice @{$tles}, $i, 0, $tle;
+               $added = 1;
+               last;
+           }
+       }
+       push @{$tles}, $tle if !$added;
+    }
     $self->_update_positions();
 }
 
@@ -338,8 +356,9 @@ sub write {
        my $label = $tle->{'label'};
        my $reuse = $tle->{'reuse'} ? 'reuse' : 'no-reuse';
        my $barcode = (defined $tle->{'barcode'})? (" BARCODE:" . $tle->{'barcode'}) : '';
+       my $meta = (defined $tle->{'meta'})? (" META:" . $tle->{'meta'}) : '';
        my $comment = (defined $tle->{'comment'})? (" #" . $tle->{'comment'}) : '';
-       $result &&= print $fhn "$datestamp $label $reuse$barcode$comment\n";
+       $result &&= print $fhn "$datestamp $label $reuse$barcode$meta$comment\n";
     }
     my $result_close = close($fhn);
     $result &&= $result_close;
@@ -391,14 +410,15 @@ sub _read_tapelist {
     my @tles;
     open(my $fh, "<", $self->{'filename'}) or return $self;
     while (my $line = <$fh>) {
-       my ($datestamp, $label, $reuse, $barcode, $comment)
-           = $line =~ m/^([0-9]*)\s([^\s]*)\s(reuse|no-reuse)\s*(?:BARCODE:([^\s]*))?\s*(?:\#(.*))?$/mx;
+       my ($datestamp, $label, $reuse, $barcode, $meta, $comment)
+           = $line =~ m/^([0-9]*)\s([^\s]*)\s(reuse|no-reuse)\s*(?:BARCODE:([^\s]*))?\s*(?:META:([^\s]*))?\s*(?:\#(.*))?$/mx;
        next if !defined $datestamp; # silently filter out bogus lines
        push @tles, {
            'datestamp' => $datestamp,
            'label' => $label,
            'reuse' => ($reuse eq 'reuse'),
            'barcode' => $barcode,
+           'meta' => $meta,
            'comment' => $comment,
        };
     }
index 84eeee6df103a819c923abb8db53d3e898edc6b2..d15217abfc8d09f90f2912153ca261db30a4e5ec 100644 (file)
@@ -125,17 +125,35 @@ sub remove_tapelabel {
 sub add_tapelabel {
     my $self = shift;
     my ($datestamp, $label, $comment, $reuse, $meta, $barcode) = @_;
-    # $meta is unused
     $reuse = 1 if !defined $reuse;
 
     # prepend this (presumably new) volume to the beginning of the list
-    unshift @{$self->{'tles'}}, {
-       'datestamp' => $datestamp,
-       'label' => $label,
-       'reuse' => $reuse,
-       'barcode' => $barcode,
-       'comment' => $comment,
+    my $tle = {
+        'datestamp' => $datestamp,
+        'label'     => $label,
+        'reuse'     => $reuse,
+        'barcode'   => $barcode,
+        'meta'      => $meta,
+        'comment'   => $comment,
     };
+    my $tles = $self->{'tles'};
+    if (!defined $tles->[0] ||
+       $tles->[0]->{'datestamp'} le $datestamp) {
+       unshift @{$tles}, $tle;
+    } elsif (defined $tles->[0] &&
+       $tles->[@$tles-1]->{'datestamp'} gt $datestamp) {
+       push @{$tles}, $tle;
+    } else {
+       my $added = 0;
+       for my $i (0..(@$tles-1)) {
+           if ($tles->[$i]->{'datestamp'} le $datestamp) {
+               splice @{$tles}, $i, 0, $tle;
+               $added = 1;
+               last;
+           }
+       }
+       push @{$tles}, $tle if !$added;
+    }
     $self->_update_positions();
 }
 
@@ -153,8 +171,9 @@ sub write {
        my $label = $tle->{'label'};
        my $reuse = $tle->{'reuse'} ? 'reuse' : 'no-reuse';
        my $barcode = (defined $tle->{'barcode'})? (" BARCODE:" . $tle->{'barcode'}) : '';
+       my $meta = (defined $tle->{'meta'})? (" META:" . $tle->{'meta'}) : '';
        my $comment = (defined $tle->{'comment'})? (" #" . $tle->{'comment'}) : '';
-       $result &&= print $fhn "$datestamp $label $reuse$barcode$comment\n";
+       $result &&= print $fhn "$datestamp $label $reuse$barcode$meta$comment\n";
     }
     my $result_close = close($fhn);
     $result &&= $result_close;
@@ -206,14 +225,15 @@ sub _read_tapelist {
     my @tles;
     open(my $fh, "<", $self->{'filename'}) or return $self;
     while (my $line = <$fh>) {
-       my ($datestamp, $label, $reuse, $barcode, $comment)
-           = $line =~ m/^([0-9]*)\s([^\s]*)\s(reuse|no-reuse)\s*(?:BARCODE:([^\s]*))?\s*(?:\#(.*))?$/mx;
+       my ($datestamp, $label, $reuse, $barcode, $meta, $comment)
+           = $line =~ m/^([0-9]*)\s([^\s]*)\s(reuse|no-reuse)\s*(?:BARCODE:([^\s]*))?\s*(?:META:([^\s]*))?\s*(?:\#(.*))?$/mx;
        next if !defined $datestamp; # silently filter out bogus lines
        push @tles, {
            'datestamp' => $datestamp,
            'label' => $label,
            'reuse' => ($reuse eq 'reuse'),
            'barcode' => $barcode,
+           'meta' => $meta,
            'comment' => $comment,
        };
     }
index cb0e85cfb18ac1822f261324e1398454f2f89fa0..1cf014187f7907a3232c5a410011405dcf4e5751 100644 (file)
@@ -1,4 +1,3 @@
-#! @PERL@
 # Copyright (c) 2009, 2010 Zmanda Inc.  All Rights Reserved.
 #
 # This program is free software; you can redistribute it and/or modify it
@@ -51,6 +50,7 @@ use Amanda::MainLoop;
 use Amanda::Taper::Protocol;
 use Amanda::Taper::Scan;
 use Amanda::Taper::Worker;
+use Amanda::Interactivity;
 use Amanda::Logfile qw( :logtype_t log_add );
 use Amanda::Xfer qw( :constants );
 use Amanda::Util qw( quote_string );
@@ -59,11 +59,13 @@ use File::Temp;
 
 sub new {
     my $class = shift;
+    my %params = @_;
 
     my $self = bless {
 
        # filled in at start
        proto => undef,
+       tapelist => $params{'tapelist'},
 
        worker => {},
     }, $class;
@@ -115,7 +117,7 @@ sub start {
        debug => $Amanda::Config::debug_taper?'driver/taper':'',
     );
 
-    my $changer = Amanda::Changer->new();
+    my $changer = Amanda::Changer->new(undef, tapelist => $self->{'tapelist'});
     if ($changer->isa("Amanda::Changer::Error")) {
        # send a TAPE_ERROR right away
        $self->{'proto'}->send(Amanda::Taper::Protocol::TAPE_ERROR,
@@ -134,7 +136,13 @@ sub start {
        return;
     }
 
-    $self->{'taperscan'} = Amanda::Taper::Scan->new(changer => $changer);
+    my $interactivity = Amanda::Interactivity->new(
+                                       name => getconf($CNF_INTERACTIVITY));
+    my $scan_name = getconf($CNF_TAPERSCAN);
+    $self->{'taperscan'} = Amanda::Taper::Scan->new(algorithm => $scan_name,
+                                           changer => $changer,
+                                           interactivity => $interactivity,
+                                           tapelist => $self->{'tapelist'});
 }
 
 sub quit {
@@ -176,6 +184,7 @@ sub quit {
     };
 
     step done => sub {
+       $self->{'taperscan'}->quit() if defined $self->{'taperscan'};
        if (@errors) {
            $params{'finished_cb'}->(join("; ", @errors));
        } else {
index 4f75ddd9f5a9e30987e56356fe78caa53f3de58e..32fc5c23e7a9c215416c963b844108d97a15d4b4 100644 (file)
@@ -1,4 +1,3 @@
-#! @PERL@
 # Copyright (c) 2009, 2010 Zmanda Inc.  All Rights Reserved.
 #
 # This program is free software; you can redistribute it and/or modify it
index 26c5a6d4c03cf9211f95a72bbd74ee8c6f2c037e..f757b9b8602719b64dc063c2d1859bd899be2dd2 100644 (file)
@@ -43,6 +43,9 @@ This is an abstract base class for taperscan algorithms.
   };
   $taperscan->scan(result_cb => $result_cb, user_msg_fn => $user_msg_fn);
 
+  # later ..
+  $taperscan->quit(); # also quit the changer
+
 =head1 OVERVIEW
 
 C<Amanda::Taper::Scan> subclasses represent algorithms used by
@@ -54,10 +57,11 @@ algorithm.  The constructor takes the following keyword arguments:
 
     changer       Amanda::Changer object to use (required)
     algorithm     Taperscan algorithm to instantiate
-    tapelist_filename
+    tapelist      Amanda::Tapelist
     tapecycle
     labelstr
     autolabel
+    meta_autolabel
 
 The changer object must always be provided, but C<algorithm> may be omitted, in
 which case the class specified by the user in the Amanda configuration file is
@@ -90,6 +94,12 @@ The error message can be a simple string or an C<Amanda::Changer::Error> object
 (see L<Amanda::Changer>).  The C<$label> and C<$access_mode> specify parameters
 for starting the device contained in C<$reservation>.
 
+To cleanly terminate an Amanda::Taper::Scan object:
+
+  $taperscan->quit()
+
+It also terminate the changer by caller $chg->quit().
+
 =head1 SUBCLASS UTILITIES
 
 There are a few common tasks for subclasses that are implemented as methods in
@@ -115,19 +125,6 @@ C<oldest_reusable_volume>:
         new_label_ok => $nlo,    # count newly labeled vols as reusable?
     );
 
-Finally, to devise a new name for a volume, call C<make_new_tape_label>,
-passing a tapelist, a labelstr, and a template.  This will return C<undef>
-if no label could be created.
-
-    $label = $self->make_new_tape_label(
-       labelstr => "foo-[0-9]+",
-        template => "foo-%%%%",
-    );
-
-If no C<template> is provided, the function uses the value of
-C<autolabel> specified when the object was constructed; similarly,
-C<labelstr> defaults to the value specified at object construction.
-
 =head2 user_msg_fn
 
 This interface is temporary and will change in the next release.
@@ -183,6 +180,43 @@ The result if the read label can't be used because it is active:
                    slot        => $slot,
                    res         => $res);
 
+The result if the volume can't be labeled because autolabel is not set:
+
+  user_msg_fn(slot_result => 1,
+                   not_autolabel => 1,
+                   slot          => $slot,
+                   res           => $res);
+
+The result if the volume is empty and can't be labeled because autolabel setting:
+
+  user_msg_fn(slot_result => 1,
+                   empty         => 1,
+                   slot          => $slot,
+                   res           => $res);
+
+The result if the volume is a non-amanda volume and can't be labeled because autolabel setting:
+
+  user_msg_fn(slot_result => 1,
+                   non_amanda    => 1,
+                   slot          => $slot,
+                   res           => $res);
+
+The result if the volume is in error and can't be labeled because autolabel setting:
+
+  user_msg_fn(slot_result => 1,
+                   volume_error  => 1,
+                  err           => $err,
+                   slot          => $slot,
+                   res           => $res);
+
+The result if the volume is in error and can't be labeled because autolabel setting:
+
+  user_msg_fn(slot_result => 1,
+                   not_success   => 1,
+                  err           => $err,
+                   slot          => $slot,
+                   res           => $res);
+
 The scan has failed, possibly with some additional information as to what the
 scan was looking for.
 
@@ -196,6 +230,7 @@ use strict;
 use warnings;
 use Amanda::Config qw( :getconf );
 use Amanda::Tapelist;
+use Amanda::Debug;
 
 sub new {
     my $class = shift;
@@ -203,22 +238,33 @@ sub new {
 
     die "No changer given to Amanda::Taper::Scan->new"
        unless exists $params{'changer'};
-
     # fill in the optional parameters
-    $params{'algorithm'} = "traditional" # TODO: get from a configuration variable
-       unless exists $params{'algorithm'};
+    $params{'algorithm'} = "traditional"
+       unless defined $params{'algorithm'} and $params{'algorithm'} ne '';
     $params{'tapecycle'} = getconf($CNF_TAPECYCLE)
        unless exists $params{'tapecycle'};
-    $params{'tapelist_filename'} =
-       Amanda::Config::config_dir_relative(getconf($CNF_TAPELIST))
-           unless exists $params{'tapelist_filename'};
     $params{'labelstr'} = getconf($CNF_LABELSTR)
        unless exists $params{'labelstr'};
     $params{'autolabel'} = getconf($CNF_AUTOLABEL)
        unless exists $params{'autolabel'};
-
+    $params{'meta_autolabel'} = getconf($CNF_META_AUTOLABEL)
+       unless exists $params{'meta_autolabel'};
+
+    my $plugin;
+    if (!defined $params{'algorithm'} or $params{'algorithm'} eq '') {
+       $params{'algorithm'} = "traditional";
+       $plugin = "traditional";
+    } else {
+       my $taperscan = Amanda::Config::lookup_taperscan($params{'algorithm'});
+       if ($taperscan) {
+           $plugin = Amanda::Config::taperscan_getconf($taperscan, $TAPERSCAN_PLUGIN);
+           $params{'properties'} = Amanda::Config::taperscan_getconf($taperscan, $TAPERSCAN_PROPERTY);
+       } else {
+           $plugin = $params{'algorithm'};
+       }
+    }
     # load the package
-    my $pkgname = "Amanda::Taper::Scan::" . $params{'algorithm'};
+    my $pkgname = "Amanda::Taper::Scan::" . $plugin;
     my $filename = $pkgname;
     $filename =~ s|::|/|g;
     $filename .= '.pm';
@@ -227,30 +273,53 @@ sub new {
        if ($@) {
            # handle compile errors
            die($@) if (exists $INC{$filename});
-           die("No such taperscan algorithm '$params{algorithm}'");
+           die("No such taperscan algorithm '$plugin'");
        }
     }
 
     # instantiate it
-    my $self = $pkgname->new(%params);
+    my $self = eval {$pkgname->new(%params);};
+    if ($@ || !defined $self) {
+       debug("Can't instantiate $pkgname");
+       die("Can't instantiate $pkgname");
+    }
 
     # and set the keys from the parameters
     $self->{'changer'} = $params{'changer'};
     $self->{'algorithm'} = $params{'algorithm'};
+    $self->{'plugin'} = $params{'plugin'};
     $self->{'tapecycle'} = $params{'tapecycle'};
-    $self->{'tapelist_filename'} = $params{'tapelist_filename'};
     $self->{'labelstr'} = $params{'labelstr'};
     $self->{'autolabel'} = $params{'autolabel'};
-    $self->{'tapelist'} = Amanda::Tapelist->new($self->{'tapelist_filename'});
+    $self->{'meta_autolabel'} = $params{'meta_autolabel'};
+    $self->{'tapelist'} = $params{'tapelist'};
 
     return $self;
 }
 
+sub DESTROY {
+    my $self = shift;
+
+    die("Taper::Scan did not quit") if defined $self->{'changer'};
+}
+
+sub quit {
+    my $self = shift;
+
+    if (defined $self->{'chg'} && $self->{'chg'} != $self->{'initial_chg'}) {
+       $self->{'chg'}->quit();
+    }
+    $self->{'changer'}->quit() if defined $self->{'changer'};
+    foreach (keys %$self) {
+        delete $self->{$_};
+    }
+}
+
 sub scan {
     my $self = shift;
     my %params = @_;
 
-    $params{'result_cb'}->("not implemented");
+    $params{'result_cb'}->("scan not implemented");
 }
 
 sub read_tapelist {
@@ -297,44 +366,7 @@ sub is_reusable_volume {
         return 1 if $tle eq $vol_tle;
     }
 
-
     return 0;
 }
 
-sub make_new_tape_label {
-    my $self = shift;
-    my %params = @_;
-
-    my $tl = exists $params{'tapelist'}? $params{'tapelist'} : $self->{'tapelist'};
-    my $template = exists $params{'template'}? $params{'template'} : $self->{'autolabel'}->{'template'};
-    my $labelstr = exists $params{'labelstr'}? $params{'labelstr'} : $self->{'labelstr'};
-
-    (my $npercents =
-       $template) =~ s/[^%]*(%+)[^%]*/length($1)/e;
-    my $nlabels = 10 ** $npercents;
-
-    # make up a sprintf pattern
-    (my $sprintf_pat =
-       $template) =~ s/(%+)/"%0" . length($1) . "d"/e;
-
-    my %existing_labels =
-       map { $_->{'label'} => 1 } @{$tl->{'tles'}};
-
-    my ($i, $label);
-    for ($i = 1; $i < $nlabels; $i++) {
-       $label = sprintf($sprintf_pat, $i);
-       last unless (exists $existing_labels{$label});
-    }
-
-    # bail out if we didn't find an unused label
-    return (undef, "Can't label unlabeled volume: All label used") if ($i >= $nlabels);
-
-    # verify $label matches $labelstr
-    if ($label !~ /$labelstr/) {
-        return (undef, "Newly-generated label '$label' does not match labelstr '$labelstr'");
-    }
-
-    return $label;
-}
-
 1;
diff --git a/perl/Amanda/Taper/Scan/lexical.pm b/perl/Amanda/Taper/Scan/lexical.pm
new file mode 100644 (file)
index 0000000..3070fc8
--- /dev/null
@@ -0,0 +1,281 @@
+# Copyright (c) 2010 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., 465 S. Mathilda Ave., Suite 300
+# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+
+package Amanda::Taper::Scan::lexical;
+
+=head1 NAME
+
+Amanda::Taper::Scan::lexical
+
+=head1 SYNOPSIS
+
+This package implements the "lexical" taperscan algorithm.  See
+C<amanda-taperscan(7)>.
+
+=cut
+
+use strict;
+use warnings;
+use base qw( Amanda::ScanInventory Amanda::Taper::Scan );
+use Amanda::Tapelist;
+use Carp;
+use POSIX ();
+use Data::Dumper;
+use vars qw( @ISA );
+use base qw(Exporter);
+our @EXPORT_OK = qw($DEFAULT_CHANGER);
+
+use Amanda::Paths;
+use Amanda::Util;
+use Amanda::Device qw( :constants );
+use Amanda::Debug qw( debug );
+use Amanda::Changer;
+use Amanda::MainLoop;
+use Amanda::Interactivity;
+use Amanda::Taper::Scan::traditional;
+
+our $DEFAULT_CHANGER = {};
+
+sub new {
+    my $class = shift;
+    my %params = @_;
+
+    my $chg = $params{'changer'};
+    if (!defined $chg) {
+       $chg = Amanda::Changer->new();
+       $params{'changer'} = $chg;
+    }
+    if (!$chg->have_inventory()) {
+       return Amanda::Taper::Scan::traditional->new(%params);
+    }
+    my $self = Amanda::ScanInventory->new(%params);
+    return bless ($self, $class);
+}
+
+sub most_prefered {
+    my $self = shift;
+
+    my $last_label = $self->last_use_label();
+    my $same_label;
+    my $result;
+    for my $tle (@{$self->{'tapelist'}->{'tles'}}) {
+       if (defined $last_label && $last_label eq $tle->{'label'}) {
+           $same_label = $tle if $self->is_reusable_volume(label => $tle->{'label'});
+       } else {
+           $result = $tle if $self->is_reusable_volume(label => $tle->{'label'}) and
+                             (!defined $result or
+                              (!defined $last_label and
+                               $tle->{'label'} lt $result->{'label'}) or
+                              ($tle->{'label'} gt $last_label and
+                               $tle->{'label'} lt $result->{'label'}) or
+                              ($tle->{'label'} gt $last_label and
+                               $result->{'label'} lt $last_label) or
+                              ($result->{'label'} lt $last_label and
+                               $tle->{'label'} lt $result->{'label'}));
+       }
+    }
+    $result = $same_label if !defined $result;
+    return $result->{'label'} if $result;
+    return undef;
+}
+
+sub first_reusable_label {
+    my $self = shift;
+
+    my $label;
+
+    for my $tle (@{$self->{'tapelist'}->{'tles'}}) {
+       $label = $tle->{'label'} if $self->is_reusable_volume(label => $tle->{'label'});
+    }
+    return $label;
+}
+
+sub last_use_label {
+    my $self = shift;
+
+    my $tles = $self->{'tapelist'}->{tles};
+    my $label = $tles->[0]->{'label'};
+}
+
+sub analyze {
+    my $self = shift;
+    my $inventory  = shift;
+    my $seen  = shift;
+    my $res = shift;
+
+    my $most_prefered;
+    my @reusable;
+    my @new_labeled;
+    my $first_new_volume;
+    my $new_volume;
+    my @new_volume;
+    my $first_unknown;
+    my $unknown;
+    my $current;
+    my $label = $self->most_prefered();
+    $self->{'most_prefered_label'} = $label;
+
+    for my $i (0..(scalar(@$inventory)-1)) {
+       my $sl = $inventory->[$i];
+       if ($sl->{current}) {
+           $current = $sl;
+       }
+       next if $seen->{$sl->{slot}} and (!$res || $res->{'this_slot'} ne $sl->{'slot'});
+
+       if (!defined $sl->{'state'} ||
+           $sl->{'state'} == Amanda::Changer::SLOT_UNKNOWN) {
+           $first_unknown = $sl if !$first_unknown;
+           $unknown = $sl if $current && !$unknown;
+       } elsif ($sl->{'state'} == Amanda::Changer::SLOT_EMPTY) {
+       } elsif (defined $sl->{'label'}) {
+           if ($label && $sl->{'label'} eq $label) {
+               $most_prefered = $sl;
+           } elsif ($self->is_reusable_volume(label => $sl->{'label'})) {
+               push @reusable, $sl;
+           } else {
+               my $vol_tle = $self->{'tapelist'}->lookup_tapelabel($sl->{'label'});
+               if ($vol_tle) {
+                   if ($vol_tle->{'datestamp'} eq '0') {
+                       push @new_labeled, $sl;
+                   }
+               } elsif ($self->{'chg'}->volume_is_labelable($sl->{'device_status'},
+                                                            $sl->{'f_type'},
+                                                            $sl->{'label'})) {
+                   $first_new_volume = $sl if !$first_new_volume;
+                   $new_volume = $sl if $current && !$new_volume;
+                   push @new_volume, $sl;
+               }
+           }
+       } elsif ($self->{'chg'}->volume_is_labelable($sl->{'device_status'},
+                                                    $sl->{'f_type'},
+                                                    $sl->{'label'})) {
+           $first_new_volume = $sl if !$first_new_volume;
+           $new_volume = $sl if $current && !$new_volume;
+           push @new_volume, $sl;
+       } elsif (!defined($sl->{device_status}) && !defined($sl->{label})) {
+           $first_unknown = $sl if !$first_unknown;
+           $unknown = $sl if $current && !$unknown;
+       } else {
+       }
+    }
+    $unknown = $first_unknown if !defined $unknown;
+    $new_volume = $first_new_volume if !defined $new_volume;
+
+    my $first_label = $self->first_reusable_label();
+    my $last_label = $self->last_use_label();
+
+    my $reusable;
+    for my $sl (@reusable) {
+       $reusable = $sl if !defined $reusable or
+                          ($sl->{'label'} gt $last_label and
+                           $sl->{'label'} lt $reusable->{'label'}) or
+                          ($sl->{'label'} gt $last_label and
+                           $reusable->{'label'} lt $last_label) or
+                          ($reusable->{'label'} lt $last_label and
+                           $sl->{'label'} lt $reusable->{'label'});
+    }
+
+    my $new_labeled;
+    for my $sl (@new_labeled) {
+       $new_labeled = $sl if !defined $new_labeled or
+                             (!$last_label and
+                              $sl->{'label'} lt $new_labeled->{'label'}) or
+                             ($last_label and
+                              $sl->{'label'} gt $last_label and
+                              $sl->{'label'} lt $new_labeled->{'label'}) or
+                             ($last_label and
+                              $sl->{'label'} gt $last_label and
+                              $new_labeled->{'label'} lt $last_label) or
+                             ($last_label and
+                              $new_labeled->{'label'} lt $last_label and
+                              $sl->{'label'} lt $new_labeled->{'label'});
+    }
+
+    for my $sl (@new_volume) {
+       $sl->{'label'} = $self->{'chg'}->make_new_tape_label(
+                                       barcode => $sl->{'barcode'},
+                                       meta => $sl->{'meta'});
+       $new_volume = $sl if defined $last_label and
+                            $new_volume->{'label'} ne $sl->{'label'} and
+                            (($sl->{'label'} gt $last_label and
+                              $sl->{'label'} lt $new_volume->{'label'}) or
+                             ($sl->{'label'} gt $last_label and
+                              $new_volume->{'label'} lt $last_label) or
+                             ($new_volume->{'label'} lt $last_label and
+                              $sl->{'label'} lt $new_volume->{'label'}));
+    }
+
+    my $use;
+    if ($new_labeled && $self->{'scan_conf'}->{'new_labeled'} eq 'soon') {
+       $use = $new_labeled;
+    } elsif ($new_volume && $self->{'scan_conf'}->{'new_volume'} eq 'soon') {
+       $use = $new_volume;
+    } elsif ($new_labeled &&
+             $self->{'scan_conf'}->{'new_labeled'} eq 'order' and
+             (!$label || !$first_label || !$last_label || !$most_prefered or
+              ($last_label and $most_prefered and
+               $new_labeled->{'label'} gt $last_label and
+               $new_labeled->{'label'} lt $most_prefered->{'label'}) or
+              ($last_label and $most_prefered and
+               $new_labeled->{'label'} gt $last_label and
+               $most_prefered->{'label'} lt $last_label) or
+              ($first_label and $most_prefered and
+               $new_labeled->{'label'} lt $first_label and
+               $new_labeled->{'label'} lt $most_prefered->{'label'}))) {
+       $use = $new_labeled;
+    } elsif ($new_volume and
+            $self->{'scan_conf'}->{'new_volume'} eq 'order' and
+            (!$label || !$first_label || !$last_label || !$most_prefered or
+             ($last_label and $most_prefered and
+              $new_volume->{'label'} gt $last_label and
+              $new_volume->{'label'} lt $most_prefered->{'label'}) or
+             ($last_label and $most_prefered and
+              $new_volume->{'label'} gt $last_label and
+              $most_prefered->{'label'} lt $last_label) or
+             ($first_label and $most_prefered and
+              $new_volume->{'label'} lt $first_label and
+              $new_volume->{'label'} lt $most_prefered->{'label'}))) {
+       $use = $new_volume;
+    } elsif (defined $most_prefered) {
+       $use = $most_prefered;
+    } elsif (defined $reusable) {
+       $use = $reusable;
+    } elsif ($new_labeled and $self->{'scan_conf'}->{'new_labeled'} eq 'last') {
+       $use = $new_labeled;
+    } elsif ($new_volume and $self->{'scan_conf'}->{'new_volume'} eq 'last') {
+       $use = $new_volume;
+    }
+
+    if ($use) {
+       if (defined $res and $res->{'this_slot'} eq $use->{'slot'}) {
+           return (Amanda::ScanInventory::SCAN_DONE);
+       } else {
+           return (Amanda::ScanInventory::SCAN_LOAD,
+                   $use->{'slot'});
+       }
+    } elsif ($unknown and $self->{'scan_conf'}->{'scan'}) {
+       return (Amanda::ScanInventory::SCAN_LOAD,
+               $unknown->{'slot'});
+    } elsif ($self->{'scan_conf'}->{'ask'}) {
+       return (Amanda::ScanInventory::SCAN_ASK_POLL);
+    } else {
+       return (Amanda::ScanInventory::SCAN_FAIL);
+    }
+}
+
+1;
diff --git a/perl/Amanda/Taper/Scan/oldest.pm b/perl/Amanda/Taper/Scan/oldest.pm
new file mode 100644 (file)
index 0000000..3c9fc6a
--- /dev/null
@@ -0,0 +1,256 @@
+# Copyright (c) 2010 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., 465 S. Mathilda Ave., Suite 300
+# Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+
+package Amanda::Taper::Scan::oldest;
+
+=head1 NAME
+
+Amanda::Taper::Scan::oldest
+
+=head1 SYNOPSIS
+
+This package implements the "oldest" taperscan algorithm.  See
+C<amanda-taperscan(7)>.
+
+=cut
+
+use strict;
+use warnings;
+use base qw( Amanda::ScanInventory Amanda::Taper::Scan );
+use Amanda::Tapelist;
+use Carp;
+use POSIX ();
+use Data::Dumper;
+use vars qw( @ISA );
+use base qw(Exporter);
+our @EXPORT_OK = qw($DEFAULT_CHANGER);
+
+use Amanda::Paths;
+use Amanda::Util;
+use Amanda::Device qw( :constants );
+use Amanda::Debug qw( debug );
+use Amanda::Changer;
+use Amanda::MainLoop;
+use Amanda::Interactivity;
+use Amanda::Taper::Scan::traditional;
+
+our $DEFAULT_CHANGER = {};
+
+sub new {
+    my $class = shift;
+    my %params = @_;
+
+    my $chg = $params{'changer'};
+    if (!defined $chg) {
+       $chg = Amanda::Changer->new();
+       $params{'changer'} = $chg;
+    }
+    if (!$chg->have_inventory()) {
+       return Amanda::Taper::Scan::traditional->new(%params);
+    }
+    my $self = Amanda::ScanInventory->new(%params);
+    return bless ($self, $class);
+}
+
+sub most_prefered {
+    my $self = shift;
+    return $self->oldest_reusable_volume();
+}
+
+sub first_reusable_label {
+    my $self = shift;
+
+    my $label;
+
+    for my $tle (@{$self->{'tapelist'}->{'tles'}}) {
+       $label = $tle->{'label'} if $self->is_reusable_volume(label => $tle->{'label'});
+    }
+    return $label;
+}
+
+sub last_use_label {
+    my $self = shift;
+
+    my $tles = $self->{'tapelist'}->{tles};
+    my $label = $tles->[0]->{'label'};
+}
+
+sub analyze {
+    my $self = shift;
+    my $inventory  = shift;
+    my $seen  = shift;
+    my $res = shift;
+
+    my $most_prefered;
+    my @reusable;
+    my @new_labeled;
+    my $first_new_volume;
+    my $new_volume;
+    my @new_volume;
+    my $first_unknown;
+    my $unknown;
+    my $current;
+    my $label = $self->most_prefered();
+    $self->{'most_prefered_label'} = $label;
+
+    for my $i (0..(scalar(@$inventory)-1)) {
+       my $sl = $inventory->[$i];
+       if ($sl->{current}) {
+           $current = $sl;
+       }
+       next if $seen->{$sl->{slot}} and (!$res || $res->{'this_slot'} ne $sl->{'slot'});
+
+       if (!defined $sl->{'state'} ||
+           $sl->{'state'} == Amanda::Changer::SLOT_UNKNOWN) {
+           $first_unknown = $sl if !$first_unknown;
+           $unknown = $sl if $current && !$unknown;
+       } elsif ($sl->{'state'} == Amanda::Changer::SLOT_EMPTY) {
+       } elsif (defined $sl->{'label'}) {
+           if ($label && $sl->{'label'} eq $label) {
+               $most_prefered = $sl;
+           } elsif ($self->is_reusable_volume(label => $sl->{'label'})) {
+               push @reusable, $sl;
+           } else {
+               my $vol_tle = $self->{'tapelist'}->lookup_tapelabel($sl->{'label'});
+               if ($vol_tle) {
+                   if ($vol_tle->{'datestamp'} eq '0') {
+                       push @new_labeled, $sl;
+                   }
+               } elsif ($self->{'chg'}->volume_is_labelable($sl->{'device_status'},
+                                                            $sl->{'f_type'},
+                                                            $sl->{'label'})) {
+                   $first_new_volume = $sl if !$first_new_volume;
+                   $new_volume = $sl if $current && !$new_volume;
+                   push @new_volume, $sl;
+               }
+           }
+       } elsif ($self->{'chg'}->volume_is_labelable($sl->{'device_status'},
+                                                    $sl->{'f_type'},
+                                                    $sl->{'label'})) {
+           $first_new_volume = $sl if !$first_new_volume;
+           $new_volume = $sl if $current && !$new_volume;
+           push @new_volume, $sl;
+       } elsif (!defined($sl->{device_status}) && !defined($sl->{label})) {
+           $first_unknown = $sl if !$first_unknown;
+           $unknown = $sl if $current && !$unknown;
+       } else {
+       }
+    }
+    $unknown = $first_unknown if !defined $unknown;
+    $new_volume = $first_new_volume if !defined $new_volume;
+
+    my $first_label = $self->first_reusable_label();
+    my $last_label = $self->last_use_label();
+
+    my $reusable;
+    for my $sl (@reusable) {
+       my $tle = $self->{'tapelist'}->lookup_tapelabel($sl->{'label'});
+       $sl->{'datestamp'} = $tle->{'datestamp'};
+       $reusable = $sl if !defined $reusable or
+                          $sl->{'datestamp'} < $reusable->{'datestamp'};
+    }
+
+    my $new_labeled;
+    for my $sl (@new_labeled) {
+       $new_labeled = $sl if !defined $new_labeled or
+                             (!$last_label and
+                              $sl->{'label'} lt $new_labeled->{'label'}) or
+                             ($last_label and
+                              $sl->{'label'} gt $last_label and
+                              $sl->{'label'} lt $new_labeled->{'label'}) or
+                             ($last_label and
+                              $sl->{'label'} gt $last_label and
+                              $new_labeled->{'label'} lt $last_label) or
+                             ($last_label and
+                              $new_labeled->{'label'} lt $last_label and
+                              $sl->{'label'} lt $new_labeled->{'label'});
+    }
+
+    for my $sl (@new_volume) {
+       $sl->{'label'} = $self->{'chg'}->make_new_tape_label(
+                                       barcode => $sl->{'barcode'},
+                                       meta => $sl->{'meta'});
+       $new_volume = $sl if defined $last_label and
+                            $new_volume->{'label'} ne $sl->{'label'} and
+                            (($sl->{'label'} gt $last_label and
+                              $sl->{'label'} lt $new_volume->{'label'}) or
+                             ($sl->{'label'} gt $last_label and
+                              $new_volume->{'label'} lt $last_label) or
+                             ($new_volume->{'label'} lt $last_label and
+                              $sl->{'label'} lt $new_volume->{'label'}));
+    }
+
+    my $use;
+    if ($new_labeled && $self->{'scan_conf'}->{'new_labeled'} eq 'soon') {
+       $use = $new_labeled;
+    } elsif ($new_volume && $self->{'scan_conf'}->{'new_volume'} eq 'soon') {
+       $use = $new_volume;
+    } elsif ($new_labeled &&
+             $self->{'scan_conf'}->{'new_labeled'} eq 'order' and
+             (!$label || !$first_label || !$last_label || !$most_prefered or
+              ($last_label and $most_prefered and
+               $new_labeled->{'label'} gt $last_label and
+               $new_labeled->{'label'} lt $most_prefered->{'label'}) or
+              ($last_label and $most_prefered and
+               $new_labeled->{'label'} gt $last_label and
+               $most_prefered->{'label'} lt $last_label) or
+              ($first_label and $most_prefered and
+               $new_labeled->{'label'} lt $first_label and
+               $new_labeled->{'label'} lt $most_prefered->{'label'}))) {
+       $use = $new_labeled;
+    } elsif ($new_volume and
+            $self->{'scan_conf'}->{'new_volume'} eq 'order' and
+            (!$label || !$first_label || !$last_label || !$most_prefered or
+             ($last_label and $most_prefered and
+              $new_volume->{'label'} gt $last_label and
+              $new_volume->{'label'} lt $most_prefered->{'label'}) or
+             ($last_label and $most_prefered and
+              $new_volume->{'label'} gt $last_label and
+              $most_prefered->{'label'} lt $last_label) or
+             ($first_label and $most_prefered and
+              $new_volume->{'label'} lt $first_label and
+              $new_volume->{'label'} lt $most_prefered->{'label'}))) {
+       $use = $new_volume;
+    } elsif (defined $most_prefered) {
+       $use = $most_prefered;
+    } elsif (defined $reusable) {
+       $use = $reusable;
+    } elsif ($new_labeled and $self->{'scan_conf'}->{'new_labeled'} eq 'last') {
+       $use = $new_labeled;
+    } elsif ($new_volume and $self->{'scan_conf'}->{'new_volume'} eq 'last') {
+       $use = $new_volume;
+    }
+
+    if ($use) {
+       if (defined $res and $res->{'this_slot'} eq $use->{'slot'}) {
+           return (Amanda::ScanInventory::SCAN_DONE);
+       } else {
+           return (Amanda::ScanInventory::SCAN_LOAD,
+                   $use->{'slot'});
+       }
+    } elsif ($unknown and $self->{'scan_conf'}->{'scan'}) {
+       return (Amanda::ScanInventory::SCAN_LOAD,
+               $unknown->{'slot'});
+    } elsif ($self->{'scan_conf'}->{'ask'}) {
+       return (Amanda::ScanInventory::SCAN_ASK_POLL);
+    } else {
+       return (Amanda::ScanInventory::SCAN_FAIL);
+    }
+}
+
+1;
index 3fa74cd1b0f3deb7cb406bd1eaf63ee3873d0a8f..9581d263532bfacb704d57e30c273178d7133711 100644 (file)
@@ -75,6 +75,7 @@ sub scan {
 sub _user_msg {
     my $self = shift;
     my %params = @_;
+
     $self->{'user_msg_fn'}->(%params);
 }
 
@@ -227,9 +228,9 @@ sub try_volume {
     my $slot = $res->{'this_slot'};
     my $dev = $res->{'device'};
     my $status = $dev->status;
-    my $labelstr = $self->{'labelstr'};
+    my $labelstr = $res->{'chg'}->{'labelstr'};
     my $label;
-    my $autolabel = $self->{'autolabel'};
+    my $autolabel = $res->{'chg'}->{'autolabel'};
 
     if ($status == $DEVICE_STATUS_SUCCESS) {
         $label = $dev->volume_label;
@@ -240,6 +241,7 @@ sub try_volume {
                                 does_not_match_labelstr => 1,
                                 labelstr                => $labelstr,
                                 slot                    => $slot,
+                                label                   => $label,
                                 res                     => $res);
                return 0;
            }
@@ -250,6 +252,7 @@ sub try_volume {
                $self->_user_msg(slot_result     => 1,
                                 not_in_tapelist => 1,
                                 slot            => $slot,
+                                label           => $label,
                                 res             => $res);
                return 0;
            }
@@ -259,11 +262,13 @@ sub try_volume {
                $self->_user_msg(slot_result => 1,
                                 active      => 1,
                                 slot        => $slot,
+                                label       => $label,
                                 res         => $res);
                return 0;
            }
            $self->_user_msg(slot_result => 1,
                             slot        => $slot,
+                            label       => $label,
                             res         => $res);
            $self->scan_result(res => $res, label => $label,
                    mode => $ACCESS_WRITE, is_new => 0, result_cb => $result_cb);
@@ -273,9 +278,10 @@ sub try_volume {
 
     if (!defined $autolabel->{'template'} ||
        $autolabel->{'template'} eq "") {
-       $self->_user_msg(slot_result => 1,
-                        slot        => $slot,
-                        res         => $res);
+       $self->_user_msg(slot_result  => 1,
+                        not_autolabel => 1,
+                        slot         => $slot,
+                        res          => $res);
        return 0;
     }
 
@@ -284,18 +290,42 @@ sub try_volume {
     if ($status & $DEVICE_STATUS_VOLUME_UNLABELED and
        $dev->volume_header and
        $dev->volume_header->{'type'} == $Amanda::Header::F_EMPTY) {
-       return 0 if (!$autolabel->{'empty'});
+       if (!$autolabel->{'empty'}) {
+           $self->_user_msg(slot_result  => 1,
+                            empty        => 1,
+                            slot         => $slot,
+                            res          => $res);
+           return 0;
+       }
     } elsif ($status & $DEVICE_STATUS_VOLUME_UNLABELED and
        $dev->volume_header and
        $dev->volume_header->{'type'} == $Amanda::Header::F_WEIRD) {
-       return 0 if (!$autolabel->{'non_amanda'});
+       if (!$autolabel->{'non_amanda'}) {
+           $self->_user_msg(slot_result  => 1,
+                            non_amanda   => 1,
+                            slot         => $slot,
+                            res          => $res);
+           return 0;
+       }
     } elsif ($status & $DEVICE_STATUS_VOLUME_ERROR) {
-       return 0 if (!$autolabel->{'volume_error'});
+       if (!$autolabel->{'volume_error'}) {
+           $self->_user_msg(slot_result  => 1,
+                            volume_error => 1,
+                            err          => $dev->error_or_status(),
+                            slot         => $slot,
+                            res          => $res);
+           return 0;
+       }
     } elsif ($status != $DEVICE_STATUS_SUCCESS) {
+       $self->_user_msg(slot_result  => 1,
+                        not_success  => 1,
+                        err          => $dev->error_or_status(),
+                        slot         => $slot,
+                        res          => $res);
        return 0;
     }
 
-    ($label, my $err) = $self->make_new_tape_label();
+    ($label, my $err) = $res->make_new_tape_label();
     if (!defined $label) {
         # make this fatal, rather than silently skipping new tapes
         $self->scan_result(error => $err, res => $res, result_cb => $result_cb);
@@ -371,6 +401,7 @@ sub stage_2 {
        my $loaded_current = $load_current;
        $load_current = 0; # don't load current a second time
 
+       $self->_user_msg(search_result => 1, res => $res, err => $err);
        # bail out immediately if the scan is complete
        if ($err and $err->failed and $err->notfound) {
            # no error, no reservation -> end of the scan
@@ -396,6 +427,7 @@ sub stage_2 {
            # or if we loaded the 'current' slot and it was invalid (this happens if
            # the user changes 'use-slots', for example
            $ignore_error = 1 if ($loaded_current && $err->invalid);
+           $ignore_error = 1 if ($err->empty);
 
            if ($ignore_error) {
                $self->_user_msg(slot_result => 1, err => $err);
index 6447cf992ac42694e81379b2be606494437c2719..dbfce4a493e1de862bcbf4ee75bf9d9e54a88abb 100644 (file)
@@ -34,6 +34,7 @@ Amanda::Taper::Scribe
   step start_xfer => sub {
     my ($err) = @_;
     my $xfer_dest = $scribe->get_xfer_dest(
+       allow_split => 1,
        max_memory => 64 * 1024,
        can_cache_inform => 0,
        part_size => 150 * 1024**2,
@@ -160,6 +161,7 @@ Call C<get_xfer_dest> to get the transfer element, supplying information on how
 the dump should be split:
 
   $xdest = $scribe->get_xfer_dest(
+       allow_split => $allow_split,
         max_memory => $max_memory,
         # .. splitting parameters
         );
@@ -173,6 +175,10 @@ The splitting parameters to C<get_xfer_dest> are:
 
 =over 4
 
+=item C<allow_split>
+
+this dle is allowed or not to split
+
 =item C<part_size>
 
 the split part size to use, or 0 for no splitting
@@ -213,6 +219,7 @@ should know about.
   use Amanda::Taper::Scribe qw( get_splitting_args_from_config );
   my %splitting_args = get_splitting_args_from_config(
     # Amanda dumptype configuration parameters,
+    dle_allow_split => ..,
     dle_tape_splitsize => ..,
     dle_split_diskbuffer => ..,
     dle_fallback_splitsize => ..,
@@ -463,6 +470,7 @@ sub new {
        # information for the current dumpfile
        dump_header => undef,
        retry_part_on_peom => undef,
+       allow_split => undef,
        xfer => undef,
        xdt => undef,
        xdt_ready => undef,
@@ -633,6 +641,7 @@ sub get_xfer_dest {
     # set the callback
     $self->{'dump_cb'} = undef;
     $self->{'retry_part_on_peom'} = 1;
+    $self->{'allow_split'} = 0;
     $self->{'start_part_on_xdt_ready'} = 0;
 
     # start getting parameters together to determine what kind of splitting
@@ -641,6 +650,7 @@ sub get_xfer_dest {
     my ($use_mem_cache, $disk_cache_dirname) = (0, undef);
     my $can_cache_inform = $params{'can_cache_inform'};
     my $part_cache_type = $params{'part_cache_type'} || 'none';
+    my $allow_split = $params{'allow_split'};
 
     my $xdt_first_dev = $self->get_device();
     if (!defined $xdt_first_dev) {
@@ -688,6 +698,19 @@ sub get_xfer_dest {
        $self->{'retry_part_on_peom'} = 0;
     }
 
+    if ($allow_split &&
+       ($can_cache_inform ||
+        !defined($part_cache_type) ||
+        $part_cache_type eq 'disk' ||
+        $part_cache_type eq 'memory' ||
+        $leom_supported)) {
+       $self->{'allow_split'} = 1;
+    } else {
+       $self->{'allow_split'} = 0;
+    }
+
+    $self->{'retry_part_on_peom'} = 0 if !$self->{'allow_split'};
+
     debug("Amanda::Taper::Scribe preparing to write, part size $part_size, "
        . "$dest_text ($dest_type) "
        . ($leom_supported? " (LEOM supported)" : " (no LEOM)"));
@@ -890,7 +913,7 @@ sub _xmsg_part_done {
            }
 
            # if the part failed..
-           if (!$msg->{'successful'}) {
+           if (!$msg->{'successful'} || !$self->{'allow_split'}) {
                # if no caching was going on, then the dump has failed
                if (!$self->{'retry_part_on_peom'}) {
                    # mark this device as at EOM, since we are not going to look
@@ -901,7 +924,7 @@ sub _xmsg_part_done {
                    if ($self->{'device'}->status() != $DEVICE_STATUS_SUCCESS) {
                        $msg = $self->{'device'}->error_or_status();
                    }
-                   $self->_operation_failed(device_error => $msg);
+                   $self->_operation_failed(device_error => "$msg, splitting not enabled");
                    return;
                }
 
@@ -1073,10 +1096,13 @@ sub _release_reservation {
 
        # notify the feedback that we've finished and released a tape
        if ($label) {
-           $self->{'feedback'}->scribe_notif_tape_done(
+           return $self->{'feedback'}->scribe_notif_tape_done(
                volume_label => $label,
                size => $kb * 1024,
-               num_files => $fm);
+               num_files => $fm,
+               finished_cb => sub {
+                $params{'finished_cb'}->(@errors? join("; ", @errors) : undef);
+               });
        }
 
        $params{'finished_cb'}->(@errors? join("; ", @errors) : undef);
@@ -1133,6 +1159,7 @@ sub _volume_cb  {
        $new_scribe->{'dump_cb'} = $self->{'dump_cb'};
        $new_scribe->{'dump_header'} = $self->{'dump_header'};
        $new_scribe->{'retry_part_on_peom'} = $self->{'retry_part_on_peom'};
+       $new_scribe->{'allow_split'} = $self->{'allow_split'};
        $new_scribe->{'split_method'} = $self->{'split_method'};
        $new_scribe->{'xfer'} = $self->{'xfer'};
        $new_scribe->{'xdt'} = $self->{'xdt'};
@@ -1205,75 +1232,91 @@ sub _volume_cb  {
     # inform the xdt about this new device before starting it
     $self->{'xdt'}->use_device($device);
 
-    my $result = $self->_device_start($reservation, $access_mode, $new_label, $is_new);
-    if ($result == 0) {
-       # try reading the label to see whether we erased the tape
-       my $erased = 0;
-       CHECK_READ_LABEL: {
+    my $cbX = sub {};
+    my $steps = define_steps
+       cb_ref => \$cbX;
+
+    step device_start => sub {
+       $self->_device_start($reservation, $access_mode, $new_label, $is_new,
+                            $steps->{'device_started'});
+    };
+
+    step device_started => sub {
+       my $result = shift;
+
+       if ($result == 0) {
+           # try reading the label to see whether we erased the tape
+           my $erased = 0;
+           CHECK_READ_LABEL: {
            # don't worry about erasing new tapes
-           if ($is_new) {
-               last CHECK_READ_LABEL;
-           }
+               if ($is_new) {
+                   last CHECK_READ_LABEL;
+               }
 
-           $device->read_label();
+               $device->finish();
+               $device->read_label();
 
-           # does the device think something is broken now?
-           if (($device->status & ~$DEVICE_STATUS_VOLUME_UNLABELED)
-               and !($device->status & $DEVICE_STATUS_VOLUME_UNLABELED)) {
-               $erased = 1;
-               last CHECK_READ_LABEL;
-           }
+               # does the device think something is broken now?
+               if (($device->status & ~$DEVICE_STATUS_VOLUME_UNLABELED)
+                   and !($device->status & $DEVICE_STATUS_VOLUME_UNLABELED)) {
+                   $erased = 1;
+                   last CHECK_READ_LABEL;
+               }
 
-           # has the label changed?
-           my $vol_label = $device->volume_label;
-           if ((!defined $old_label and defined $vol_label)
-               or (defined $old_label and !defined $vol_label)
-               or (defined $old_label and $old_label ne $vol_label)) {
-               $erased = 1;
-               last CHECK_READ_LABEL;
-           }
+               # has the label changed?
+               my $vol_label = $device->volume_label;
+               if ((!defined $old_label and defined $vol_label)
+                   or (defined $old_label and !defined $vol_label)
+                   or (defined $old_label and $old_label ne $vol_label)) {
+                   $erased = 1;
+                   last CHECK_READ_LABEL;
+               }
 
-           # has the timestamp changed?
-           my $vol_timestamp = $device->volume_time;
-           if ((!defined $old_timestamp and defined $vol_timestamp)
-               or (defined $old_timestamp and !defined $vol_timestamp)
-               or (defined $old_timestamp and $old_timestamp ne $vol_timestamp)) {
-               $erased = 1;
-               last CHECK_READ_LABEL;
+               # has the timestamp changed?
+               my $vol_timestamp = $device->volume_time;
+               if ((!defined $old_timestamp and defined $vol_timestamp)
+                   or (defined $old_timestamp and !defined $vol_timestamp)
+                   or (defined $old_timestamp and $old_timestamp ne $vol_timestamp)) {
+                   $erased = 1;
+                   last CHECK_READ_LABEL;
+               }
            }
+
+           $self->{'feedback'}->scribe_notif_new_tape(
+               error => "while labeling new volume: " . $device->error_or_status(),
+               volume_label => $erased? $new_label : undef);
+
+           $self->_get_new_volume();
+           return $cbX->();
+       } elsif ($result != 1) {
+           $self->{'feedback'}->scribe_notif_new_tape(
+               error => $result,
+               volume_label => undef);
+           $self->_get_new_volume();
+           return $cbX->();
        }
 
-       $self->{'feedback'}->scribe_notif_new_tape(
-           error => "while labeling new volume: " . $device->error_or_status(),
-           volume_label => $erased? $new_label : undef);
+       $new_label = $device->volume_label;
 
-       return $self->_get_new_volume();
-    } elsif ($result != 1) {
+       # success!
        $self->{'feedback'}->scribe_notif_new_tape(
-           error => $result,
-           volume_label => undef);
-       return $self->_get_new_volume();
-    }
+           error => undef,
+           volume_label => $new_label);
 
-    $new_label = $device->volume_label;
-
-    # success!
-    $self->{'feedback'}->scribe_notif_new_tape(
-       error => undef,
-       volume_label => $new_label);
+       $self->{'reservation'}->set_label(label => $new_label,
+           finished_cb => $steps->{'set_labelled'});
+    };
 
-    # notify the changer that we've labeled the tape, and start the part.
-    my $label_set_cb = make_cb(label_set_cb => sub {
+    step set_labelled => sub {
        my ($err) = @_;
        if ($err) {
            $self->{'feedback'}->scribe_notif_log_info(
                message => "Error from set_label: $err");
            # fall through to start_part anyway...
        }
-       return $self->_start_part();
-    });
-    $self->{'reservation'}->set_label(label => $new_label,
-       finished_cb => $label_set_cb);
+       $self->_start_part();
+       return $cbX->();
+    }
 }
 
 # return 0 for device->start error
@@ -1281,53 +1324,82 @@ sub _volume_cb  {
 # return a message for others error
 sub _device_start {
     my $self = shift;
-    my ($reservation, $access_mode, $new_label, $is_new) = @_;
+    my ($reservation, $access_mode, $new_label, $is_new, $finished_cb) = @_;
 
     my $device = $reservation->{'device'};
     my $tl = $self->{'taperscan'}->{'tapelist'};
+    my $meta;
 
     if (!defined $tl) { # For Mock::Taperscan in installcheck
        if (!$device->start($access_mode, $new_label, $self->{'write_timestamp'})) {
-           return 0;
+           return $finished_cb->(0);
        } else {
-           return 1;
+           return $finished_cb->(1);
        }
     }
 
-    if ($is_new) {
-       # generate the new label and write it to the tapelist file
-       $tl->reload(1);
-       ($new_label, my $err) = $self->{'taperscan'}->make_new_tape_label();
-       if (!defined $new_label) {
-           $tl->unlock();
-           return $err;
-       } else {
-           $tl->add_tapelabel('0', $new_label, undef, 0, undef, $reservation->{'barcode'});
-           $tl->write();
-       }
-       $self->dbg("generate new label '$new_label'");
-    }
+    my $steps = define_steps
+       cb_ref => \$finished_cb;
+
+    step setup => sub {
+       return $reservation->get_meta_label(
+                               finished_cb => $steps->{'got_meta_label'});
+    };
+
+    step got_meta_label => sub {
+       my ($err, $meta) = @_;
 
-    # write the label to the device
-    if (!$device->start($access_mode, $new_label, $self->{'write_timestamp'})) {
        if ($is_new) {
-           # remove the generated label from the tapelist file
+           # generate the new label and write it to the tapelist file
            $tl->reload(1);
-           $tl->remove_tapelabel($new_label);
+           ($new_label, my $err) = $reservation->make_new_tape_label();
+           if (!defined $new_label) {
+               $tl->unlock();
+               return $finished_cb->($err);
+           }
+           if (!$meta) {
+               ($meta, $err) = $reservation->make_new_meta_label();
+               if (defined $err) {
+                   $tl->unlock();
+                   return $finished_cb->($err);
+               }
+           }
+           $tl->add_tapelabel('0', $new_label, undef, $meta, $reservation->{'barcode'});
            $tl->write();
-        }
-       return 0;
-    }
+           $self->dbg("generate new label '$new_label'");
+       } elsif (!defined $meta) {
+           $tl->reload(0);
+           my $tle = $tl->lookup_tapelabel($new_label);
+           my $meta = $tle->{'meta'};
+       }
 
-    # rewrite the tapelist file
-    $tl->reload(1);
-    my $tle = $tl->lookup_tapelabel($new_label);
-    $tl->remove_tapelabel($new_label);
-    $tl->add_tapelabel($self->{'write_timestamp'}, $new_label,
-                      $tle? $tle->{'comment'} : undef, 1);
-    $tl->write();
+       # write the label to the device
+       if (!$device->start($access_mode, $new_label, $self->{'write_timestamp'})) {
+           if ($is_new) {
+               # remove the generated label from the tapelist file
+               $tl->reload(1);
+               $tl->remove_tapelabel($new_label);
+               $tl->write();
+            }
+           return $finished_cb->(0);
+       }
 
-    return 1;
+       # rewrite the tapelist file
+       $tl->reload(1);
+       my $tle = $tl->lookup_tapelabel($new_label);
+       $meta = $tle->{'meta'} if !$meta && $tle->{'meta'};
+       $tl->remove_tapelabel($new_label);
+       $tl->add_tapelabel($self->{'write_timestamp'}, $new_label,
+                          $tle? $tle->{'comment'} : undef, 1, $meta);
+       $tl->write();
+
+       $reservation->set_meta_label(meta => $meta,
+                                    finished_cb => $steps->{'set_meta_label'});
+    };
+
+    step set_meta_label => sub {
+       return $finished_cb->(1);
+    }
 }
 
 sub dbg {
@@ -1340,12 +1412,12 @@ sub dbg {
 sub get_splitting_args_from_config {
     my %params = @_;
 
-    use Data::Dumper;
     my %splitting_args;
 
+    $splitting_args{'allow_split'} = 0;
     # if dle_splitting is false, then we don't split - easy.
     if (defined $params{'dle_allow_split'} and !$params{'dle_allow_split'}) {
-       return ();
+       return %splitting_args;
     }
 
     # utility for below
@@ -1356,7 +1428,7 @@ sub get_splitting_args_from_config {
        my $fsusage = Amanda::Util::get_fs_usage($dirname);
        confess "$dirname" if (!$fsusage);
 
-       my $avail = $fsusage->{'blocks'} * $fsusage->{'bavail'};
+       my $avail = $fsusage->{'blocksize'} * $fsusage->{'bavail'};
        if ($avail < $part_size) {
            Amanda::Debug::debug("disk cache has $avail bytes available on $dirname, but " .
                                 "needs $part_size");
@@ -1395,6 +1467,7 @@ sub get_splitting_args_from_config {
 
        # part cache type is memory unless we have a split_diskbuffer that fits the bill
        if ($params{'part_size'}) {
+           $splitting_args{'allow_split'} = 1;
            $params{'part_cache_type'} = 'memory';
            if (defined $params{'dle_split_diskbuffer'}
                    and -d $params{'dle_split_diskbuffer'}) {
@@ -1418,6 +1491,8 @@ sub get_splitting_args_from_config {
        my $ps = $params{'part_size'};
        my $pcms = $params{'part_cache_max_size'};
        $ps = $pcms if (!defined $ps or (defined $pcms and $pcms < $ps));
+       $splitting_args{'allow_split'} = 1 if ((defined $ps and $ps > 0) or
+                                              $params{'leom_supported'});
 
        # fail back from 'disk' to 'none' if the disk isn't set up correctly
        if (defined $params{'part_cache_type'} and
@@ -1468,9 +1543,14 @@ sub request_volume_permission {
 }
 
 sub scribe_notif_new_tape { }
-sub scribe_notif_tape_done { }
 sub scribe_notif_part_done { }
 sub scribe_notif_log_info { }
+sub scribe_notif_tape_done {
+    my $self = shift;
+    my %params = @_;
+
+    $params{'finished_cb'}->();
+}
 
 ##
 ## Device Handling
@@ -1625,7 +1705,57 @@ sub _start_scanning {
 
     $self->{'scan_running'} = 1;
 
-    $self->{'taperscan'}->scan(result_cb => sub {
+    my $_user_msg_fn = sub {
+       my %params = @_;
+       if (exists($params{'slot_result'})) {
+           if ($params{'does_not_match_labelstr'}) {
+               $self->{'feedback'}->scribe_notif_log_info(
+                   message => "Slot $params{'slot'} with label $params{'label'} do not match labelstr");
+           } elsif ($params{'not_in_tapelist'}) {
+               $self->{'feedback'}->scribe_notif_log_info(
+                   message => "Slot $params{'slot'} with label $params{'label'} is not in the tapelist");
+           } elsif ($params{'active'}) {
+               $self->{'feedback'}->scribe_notif_log_info(
+                   message => "Slot $params{'slot'} with label $params{'label'} is not reusable");
+           } elsif ($params{'not_autolabel'}) {
+               if ($params{'label'}) {
+                   $self->{'feedback'}->scribe_notif_log_info(
+                       message => "Slot $params{'slot'} with label $params{'label'} is not labelable ");
+               } else {
+                   $self->{'feedback'}->scribe_notif_log_info(
+                       message => "Slot $params{'slot'} without label is not labelable ");
+               }
+           } elsif ($params{'empty'}) {
+               $self->{'feedback'}->scribe_notif_log_info(
+                   message => "Slot $params{'slot'} is empty");
+           } elsif ($params{'non_amanda'}) {
+               $self->{'feedback'}->scribe_notif_log_info(
+                   message => "Slot $params{'slot'} is a non-amanda volume");
+           } elsif ($params{'volume_error'}) {
+               $self->{'feedback'}->scribe_notif_log_info(
+                   message => "Slot $params{'slot'} is a volume in error: $params{'err'}");
+           } elsif ($params{'not_success'}) {
+               $self->{'feedback'}->scribe_notif_log_info(
+                   message => "Slot $params{'slot'} is a device in error: $params{'err'}");
+           } elsif ($params{'err'}) {
+               $self->{'feedback'}->scribe_notif_log_info(
+                   message => "$params{'err'}");
+           } elsif ($params{'not_labelable'}) {
+               $self->{'feedback'}->scribe_notif_log_info(
+                   message => "Slot $params{'slot'} without label can't be labeled");
+           } elsif (!defined $params{'label'}) {
+               $self->{'feedback'}->scribe_notif_log_info(
+                   message => "Slot $params{'slot'} without label can be labeled");
+           } else {
+               $self->{'feedback'}->scribe_notif_log_info(
+                   message => "Slot $params{'slot'} with label $params{'label'} is usable");
+           }
+       }
+    };
+
+    $self->{'taperscan'}->scan(
+      user_msg_fn => $_user_msg_fn,
+      result_cb => sub {
        my ($error, $reservation, $volume_label, $access_mode, $is_new) = @_;
 
        $self->{'scan_running'} = 0;
index c114a81eb406cfe369d772e795e49761bb78eb3f..08d1f5339fa1f6159351aaa34747d5ad04102778 100644 (file)
@@ -1,4 +1,3 @@
-#! @PERL@
 # Copyright (c) 2009, 2010 Zmanda Inc.  All Rights Reserved.
 #
 # This program is free software; you can redistribute it and/or modify it
@@ -42,6 +41,7 @@ package Amanda::Taper::Worker;
 use POSIX qw( :errno_h );
 use Amanda::Changer;
 use Amanda::Config qw( :getconf config_dir_relative );
+use Amanda::Debug qw( :logging );
 use Amanda::Header;
 use Amanda::Holding;
 use Amanda::MainLoop qw( :GIOCondition );
@@ -373,6 +373,8 @@ sub scribe_notif_new_tape {
 
     # TODO: if $params{error} is set, report it back to the driver
     # (this will be a change to the protocol)
+    log_add($L_INFO, $params{'error'}) if defined $params{'error'};
+
     if ($params{'volume_label'}) {
        $self->{'label'} = $params{'volume_label'};
 
@@ -508,9 +510,6 @@ sub send_port_and_get_header {
        $header_xfer->start($steps->{'header_xfer_xmsg_cb'});
 
        my $header_addrs = $xsrc->get_addrs();
-       $header_addrs = [ grep { $_->[0] eq '127.0.0.1' } @$header_addrs ];
-       die "Source::DirectTCPListen did not return a localhost address"
-           unless @$header_addrs;
        my $header_port = $header_addrs->[0][1];
 
        # and tell the driver which ports we're listening on
@@ -606,18 +605,23 @@ sub setup_and_start_dump {
                if (exists $splitting_args{$_});
        }
 
+       my $device = $self->{'scribe'}->get_device();
+       if (!defined $device) {
+           die "no device is available to create an xfer_dest";
+       }
+       $splitting_args{'leom_supported'} = $device->property_get("leom");
        # and convert those to get_xfer_dest args
         %get_xfer_dest_args = get_splitting_args_from_config(
                %splitting_args);
        $get_xfer_dest_args{'max_memory'} = getconf($CNF_DEVICE_OUTPUT_BUFFER_SIZE);
        if (!getconf_seen($CNF_DEVICE_OUTPUT_BUFFER_SIZE)) {
-           my $device = $self->{'scribe'}->get_device();
            my $block_size4 = $device->block_size * 4;
            if ($block_size4 > $get_xfer_dest_args{'max_memory'}) {
                $get_xfer_dest_args{'max_memory'} = $block_size4;
            }
        }
-       $get_xfer_dest_args{'can_cache_inform'} = ($msgtype eq Amanda::Taper::Protocol::FILE_WRITE);
+       $device = undef;
+       $get_xfer_dest_args{'can_cache_inform'} = ($msgtype eq Amanda::Taper::Protocol::FILE_WRITE and $get_xfer_dest_args{'allow_split'});
 
        # if we're unable to fulfill the user's splitting needs, we can still give
        # the dump a shot - but we'll warn them about the problem
index c3b1725b6d43903d183b5c17181868df0c8dba82..4c5799a66e3d427fc71c4a92aca25d5b5dabf779 100644 (file)
@@ -2469,6 +2469,76 @@ XS(_wrap_file_lock_lock) {
 }
 
 
+XS(_wrap_file_lock_lock_wr) {
+  {
+    file_lock *arg1 = (file_lock *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    int result;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: file_lock_lock_wr(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_file_lock, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "file_lock_lock_wr" "', argument " "1"" of type '" "file_lock *""'"); 
+    }
+    arg1 = (file_lock *)(argp1);
+    result = (int)file_lock_lock_wr(arg1);
+    {
+      SV *for_stack;
+      SP += argvi; PUTBACK;
+      for_stack = sv_2mortal(amglue_newSVi64(result));
+      SPAGAIN; SP -= argvi;
+      ST(argvi) = for_stack;
+      argvi++;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_file_lock_lock_rd) {
+  {
+    file_lock *arg1 = (file_lock *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    int result;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: file_lock_lock_rd(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_file_lock, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "file_lock_lock_rd" "', argument " "1"" of type '" "file_lock *""'"); 
+    }
+    arg1 = (file_lock *)(argp1);
+    result = (int)file_lock_lock_rd(arg1);
+    {
+      SV *for_stack;
+      SP += argvi; PUTBACK;
+      for_stack = sv_2mortal(amglue_newSVi64(result));
+      SPAGAIN; SP -= argvi;
+      ST(argvi) = for_stack;
+      argvi++;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
 XS(_wrap_file_lock_unlock) {
   {
     file_lock *arg1 = (file_lock *) 0 ;
@@ -2504,6 +2574,41 @@ XS(_wrap_file_lock_unlock) {
 }
 
 
+XS(_wrap_file_lock_locked) {
+  {
+    file_lock *arg1 = (file_lock *) 0 ;
+    void *argp1 = 0 ;
+    int res1 = 0 ;
+    int argvi = 0;
+    int result;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: file_lock_locked(self);");
+    }
+    res1 = SWIG_ConvertPtr(ST(0), &argp1,SWIGTYPE_p_file_lock, 0 |  0 );
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "file_lock_locked" "', argument " "1"" of type '" "file_lock *""'"); 
+    }
+    arg1 = (file_lock *)(argp1);
+    result = (int)file_lock_locked(arg1);
+    {
+      SV *for_stack;
+      SP += argvi; PUTBACK;
+      for_stack = sv_2mortal(amglue_newSVi64(result));
+      SPAGAIN; SP -= argvi;
+      ST(argvi) = for_stack;
+      argvi++;
+    }
+    
+    XSRETURN(argvi);
+  fail:
+    
+    SWIG_croak_null();
+  }
+}
+
+
 XS(_wrap_file_lock_write) {
   {
     file_lock *arg1 = (file_lock *) 0 ;
@@ -3185,7 +3290,10 @@ static swig_command_info swig_commands[] = {
 {"Amanda::Utilc::set_blocking", _wrap_set_blocking},
 {"Amanda::Utilc::new_file_lock", _wrap_new_file_lock},
 {"Amanda::Utilc::file_lock_lock", _wrap_file_lock_lock},
+{"Amanda::Utilc::file_lock_lock_wr", _wrap_file_lock_lock_wr},
+{"Amanda::Utilc::file_lock_lock_rd", _wrap_file_lock_lock_rd},
 {"Amanda::Utilc::file_lock_unlock", _wrap_file_lock_unlock},
+{"Amanda::Utilc::file_lock_locked", _wrap_file_lock_locked},
 {"Amanda::Utilc::file_lock_write", _wrap_file_lock_write},
 {"Amanda::Utilc::file_lock_data", _wrap_file_lock_data},
 {"Amanda::Utilc::delete_file_lock", _wrap_delete_file_lock},
index 0a9f143aa37e0bc01b9bf7d677a9b86405b6f220..2334e5775485674e1e7fb3940357ea8e0fcc0a7a 100644 (file)
@@ -90,7 +90,10 @@ sub new {
 }
 
 *lock = *Amanda::Utilc::file_lock_lock;
+*lock_wr = *Amanda::Utilc::file_lock_lock_wr;
+*lock_rd = *Amanda::Utilc::file_lock_lock_rd;
 *unlock = *Amanda::Utilc::file_lock_unlock;
+*locked = *Amanda::Utilc::file_lock_locked;
 *write = *Amanda::Utilc::file_lock_write;
 *data = *Amanda::Utilc::file_lock_data;
 sub DESTROY {
@@ -281,7 +284,7 @@ bytes it read from the file descriptor.
 Return a "safe" environment hash.  For non-setuid programs, this means
 filtering out any localization variables.
 
-=item get_fs_usage(file, disk)
+=item get_fs_usage(file)
 
 This is a wrapper around the Gnulib function of the same name.  On success, it returns
 a hash with keys:
@@ -501,11 +504,17 @@ filename to lock:
 
   my $fl = Amanda::Util::file_lock->new($filename)
 
-then, lock the file:
+then, three ways to lock the file:
 
-  $fl->lock();
+  $fl->lock_wr();       # take a write lock (exclusive)
+  $fl->lock_rd();       # take a read lock
+  $fl->lock();         # take a write lock and reads the contents of
+                        # the file into memory.
 
-which also reads the contents of the file into memory, accessible via
+they return -1 on failure, 0 if the lock is taken or 1 if the lock in not
+taken (you can retry later).
+
+to access the data in memory
 
   my $state = $fl->data();
 
index a78e50a32c23566a79cb8c8e6fef36c379bf0a6c..3ee51aad37e50d9f56121a9d21dd8a524e110ed6 100644 (file)
@@ -163,7 +163,7 @@ bytes it read from the file descriptor.
 Return a "safe" environment hash.  For non-setuid programs, this means
 filtering out any localization variables.
 
-=item get_fs_usage(file, disk)
+=item get_fs_usage(file)
 
 This is a wrapper around the Gnulib function of the same name.  On success, it returns
 a hash with keys:
@@ -383,11 +383,17 @@ filename to lock:
 
   my $fl = Amanda::Util::file_lock->new($filename)
 
-then, lock the file:
+then, three ways to lock the file:
 
-  $fl->lock();
+  $fl->lock_wr();       # take a write lock (exclusive)
+  $fl->lock_rd();       # take a read lock
+  $fl->lock();         # take a write lock and reads the contents of
+                        # the file into memory.
 
-which also reads the contents of the file into memory, accessible via
+they return -1 on failure, 0 if the lock is taken or 1 if the lock in not
+taken (you can retry later).
+
+to access the data in memory
 
   my $state = $fl->data();
 
index e4a3e6b655835fd6c893c5df728bb8078b21b17b..f7ebacaf968241c17d24555aa1be6316e1e61f5b 100644 (file)
@@ -452,7 +452,10 @@ typedef struct file_lock {
        }
 
        int lock();
+       int lock_wr();
+       int lock_rd();
        int unlock();
+       int locked();
 
        %typemap(in) (const char *data, size_t len) {
            $1 = SvPV($input, $2);
index bb83f2ad7bbd6843e67b2648209f3816a3aed0c1..c18c95154aac73c1c3687f4fea8ad2baa86229e9 100644 (file)
@@ -1484,16 +1484,17 @@ SWIG_Perl_SetModule(swig_module_info *module) {
 #define SWIGTYPE_p_char swig_types[4]
 #define SWIGTYPE_p_double swig_types[5]
 #define SWIGTYPE_p_float swig_types[6]
-#define SWIGTYPE_p_gsize swig_types[7]
-#define SWIGTYPE_p_guint32 swig_types[8]
-#define SWIGTYPE_p_guint64 swig_types[9]
-#define SWIGTYPE_p_int swig_types[10]
-#define SWIGTYPE_p_p_XferElement swig_types[11]
-#define SWIGTYPE_p_p_char swig_types[12]
-#define SWIGTYPE_p_p_void swig_types[13]
-#define SWIGTYPE_p_unsigned_char swig_types[14]
-static swig_type_info *swig_types[16];
-static swig_module_info swig_module = {swig_types, 15, 0, 0, 0, 0};
+#define SWIGTYPE_p_gint64 swig_types[7]
+#define SWIGTYPE_p_gsize swig_types[8]
+#define SWIGTYPE_p_guint32 swig_types[9]
+#define SWIGTYPE_p_guint64 swig_types[10]
+#define SWIGTYPE_p_int swig_types[11]
+#define SWIGTYPE_p_p_XferElement swig_types[12]
+#define SWIGTYPE_p_p_char swig_types[13]
+#define SWIGTYPE_p_p_void swig_types[14]
+#define SWIGTYPE_p_unsigned_char swig_types[15]
+static swig_type_info *swig_types[17];
+static swig_module_info swig_module = {swig_types, 16, 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)
 
@@ -1537,6 +1538,8 @@ SWIGEXPORT void SWIG_init (CV *cv, CPerlObj *);
 
 #include "glib-util.h"
 #include "amxfer.h"
+#include "amanda.h"
+#include "sockaddr-util.h"
 
 
 SWIGINTERNINLINE SV *
@@ -2124,16 +2127,24 @@ XS(_wrap_xfer_repr) {
 XS(_wrap_xfer_start) {
   {
     Xfer *arg1 = (Xfer *) 0 ;
+    gint64 arg2 ;
+    gint64 arg3 ;
     int argvi = 0;
     dXSARGS;
     
-    if ((items < 1) || (items > 1)) {
-      SWIG_croak("Usage: xfer_start(xfer);");
+    if ((items < 3) || (items > 3)) {
+      SWIG_croak("Usage: xfer_start(xfer,offset,size);");
     }
     {
       arg1 = xfer_from_sv(ST(0));
     }
-    xfer_start(arg1);
+    {
+      arg2 = amglue_SvI64(ST(1));
+    }
+    {
+      arg3 = amglue_SvI64(ST(2));
+    }
+    xfer_start(arg1,arg2,arg3);
     ST(argvi) = sv_newmortal();
     
     XSRETURN(argvi);
@@ -2452,18 +2463,12 @@ XS(_wrap_xfer_source_directtcp_listen_get_addrs) {
       
       i = 0;
       av = newAV();
-      while (iter && iter->ipv4) {
-        struct in_addr in;
-        char *addr;
-        AV *tuple;
+      while (iter && SU_GET_FAMILY(iter) != 0) {
+        char *addr = str_sockaddr_no_port(iter);
+        AV *tuple = newAV();
         
-        in.s_addr = htonl(iter->ipv4);
-        addr = inet_ntoa(in);
-        
-        tuple = newAV();
-        g_assert(NULL != av_store(tuple, 0,
-            newSVpv(addr, 0)));
-        g_assert(NULL != av_store(tuple, 1, newSViv(iter->port)));
+        g_assert(NULL != av_store(tuple, 0, newSVpv(addr, 0)));
+        g_assert(NULL != av_store(tuple, 1, newSViv(SU_GET_PORT(iter))));
         g_assert(NULL != av_store(av, i++, newRV_noinc((SV *)tuple)));
         iter++;
       }
@@ -2505,7 +2510,7 @@ XS(_wrap_xfer_source_directtcp_connect) {
       for (i = 0; i < num_addrs; i++) {
         SV **svp = av_fetch(addrs_av, i, 0);
         AV *addr_av;
-        struct in_addr addr;
+        sockaddr_union addr;
         IV port;
         
         if (!svp || !SvROK(*svp) || SvTYPE(SvRV(*svp)) != SVt_PVAV
@@ -2517,17 +2522,18 @@ XS(_wrap_xfer_source_directtcp_connect) {
         
         /* get address */
         svp = av_fetch(addr_av, 0, 0);
-        if (!svp || !SvPOK(*svp) || !inet_aton(SvPV_nolen(*svp), &addr)) {
+        if (!svp || !SvPOK(*svp) || !str_to_sockaddr(SvPV_nolen(*svp), &addr)) {
           SWIG_exception_fail(SWIG_TypeError, "invalid IPv4 addr in address");
         }
-        arg1[i].ipv4 = ntohl(addr.s_addr);
         
         /* get port */
         svp = av_fetch(addr_av, 1, 0);
         if (!svp || !SvIOK(*svp) || (port = SvIV(*svp)) <= 0 || port >= 65536) {
           SWIG_exception_fail(SWIG_TypeError, "invalid port in address");
         }
-        arg1[i].port = (guint16)port;
+        SU_SET_PORT(&addr, port);
+        
+        copy_sockaddr(arg1, &addr);
       }
     }
     result = (XferElement *)xfer_source_directtcp_connect(arg1);
@@ -2585,13 +2591,12 @@ XS(_wrap_xfer_filter_process) {
   {
     gchar **arg1 = (gchar **) 0 ;
     gboolean arg2 ;
-    gboolean arg3 ;
     int argvi = 0;
     XferElement *result = 0 ;
     dXSARGS;
     
-    if ((items < 3) || (items > 3)) {
-      SWIG_croak("Usage: xfer_filter_process(argv,need_root,log_stderr);");
+    if ((items < 2) || (items > 2)) {
+      SWIG_croak("Usage: xfer_filter_process(argv,need_root);");
     }
     {
       AV *av;
@@ -2623,17 +2628,13 @@ XS(_wrap_xfer_filter_process) {
     {
       arg2 = SvTRUE(ST(1));
     }
-    {
-      arg3 = SvTRUE(ST(2));
-    }
-    result = (XferElement *)xfer_filter_process(arg1,arg2,arg3);
+    result = (XferElement *)xfer_filter_process(arg1,arg2);
     {
       ST(argvi) = sv_2mortal(new_sv_for_xfer_element(result));
       argvi++;
     }
     
     
-    
     {
       xfer_element_unref(result);
     }
@@ -2641,6 +2642,36 @@ XS(_wrap_xfer_filter_process) {
   fail:
     
     
+    SWIG_croak_null();
+  }
+}
+
+
+XS(_wrap_get_err_fd) {
+  {
+    XferElement *arg1 = (XferElement *) 0 ;
+    int argvi = 0;
+    int result;
+    dXSARGS;
+    
+    if ((items < 1) || (items > 1)) {
+      SWIG_croak("Usage: get_err_fd(elt);");
+    }
+    {
+      arg1 = xfer_element_from_sv(ST(0));
+    }
+    result = (int)get_err_fd(arg1);
+    {
+      SV *for_stack;
+      SP += argvi; PUTBACK;
+      for_stack = sv_2mortal(amglue_newSVi64(result));
+      SPAGAIN; SP -= argvi;
+      ST(argvi) = for_stack;
+      argvi++;
+    }
+    
+    XSRETURN(argvi);
+  fail:
     
     SWIG_croak_null();
   }
@@ -2848,18 +2879,12 @@ XS(_wrap_xfer_dest_directtcp_listen_get_addrs) {
       
       i = 0;
       av = newAV();
-      while (iter && iter->ipv4) {
-        struct in_addr in;
-        char *addr;
-        AV *tuple;
+      while (iter && SU_GET_FAMILY(iter) != 0) {
+        char *addr = str_sockaddr_no_port(iter);
+        AV *tuple = newAV();
         
-        in.s_addr = htonl(iter->ipv4);
-        addr = inet_ntoa(in);
-        
-        tuple = newAV();
-        g_assert(NULL != av_store(tuple, 0,
-            newSVpv(addr, 0)));
-        g_assert(NULL != av_store(tuple, 1, newSViv(iter->port)));
+        g_assert(NULL != av_store(tuple, 0, newSVpv(addr, 0)));
+        g_assert(NULL != av_store(tuple, 1, newSViv(SU_GET_PORT(iter))));
         g_assert(NULL != av_store(av, i++, newRV_noinc((SV *)tuple)));
         iter++;
       }
@@ -2901,7 +2926,7 @@ XS(_wrap_xfer_dest_directtcp_connect) {
       for (i = 0; i < num_addrs; i++) {
         SV **svp = av_fetch(addrs_av, i, 0);
         AV *addr_av;
-        struct in_addr addr;
+        sockaddr_union addr;
         IV port;
         
         if (!svp || !SvROK(*svp) || SvTYPE(SvRV(*svp)) != SVt_PVAV
@@ -2913,17 +2938,18 @@ XS(_wrap_xfer_dest_directtcp_connect) {
         
         /* get address */
         svp = av_fetch(addr_av, 0, 0);
-        if (!svp || !SvPOK(*svp) || !inet_aton(SvPV_nolen(*svp), &addr)) {
+        if (!svp || !SvPOK(*svp) || !str_to_sockaddr(SvPV_nolen(*svp), &addr)) {
           SWIG_exception_fail(SWIG_TypeError, "invalid IPv4 addr in address");
         }
-        arg1[i].ipv4 = ntohl(addr.s_addr);
         
         /* get port */
         svp = av_fetch(addr_av, 1, 0);
         if (!svp || !SvIOK(*svp) || (port = SvIV(*svp)) <= 0 || port >= 65536) {
           SWIG_exception_fail(SWIG_TypeError, "invalid port in address");
         }
-        arg1[i].port = (guint16)port;
+        SU_SET_PORT(&addr, port);
+        
+        copy_sockaddr(arg1, &addr);
       }
     }
     result = (XferElement *)xfer_dest_directtcp_connect(arg1);
@@ -2977,6 +3003,7 @@ static swig_type_info _swigt__p_amglue_Source = {"_p_amglue_Source", "struct amg
 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_gint64 = {"_p_gint64", "gint64 *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_gsize = {"_p_gsize", "gsize *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_guint32 = {"_p_guint32", "guint32 *", 0, 0, (void*)0, 0};
 static swig_type_info _swigt__p_guint64 = {"_p_guint64", "guint64 *", 0, 0, (void*)0, 0};
@@ -2994,6 +3021,7 @@ static swig_type_info *swig_type_initial[] = {
   &_swigt__p_char,
   &_swigt__p_double,
   &_swigt__p_float,
+  &_swigt__p_gint64,
   &_swigt__p_gsize,
   &_swigt__p_guint32,
   &_swigt__p_guint64,
@@ -3011,6 +3039,7 @@ static swig_cast_info _swigc__p_amglue_Source[] = {  {&_swigt__p_amglue_Source,
 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_gint64[] = {  {&_swigt__p_gint64, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_gsize[] = {  {&_swigt__p_gsize, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_guint32[] = {  {&_swigt__p_guint32, 0, 0, 0},{0, 0, 0, 0}};
 static swig_cast_info _swigc__p_guint64[] = {  {&_swigt__p_guint64, 0, 0, 0},{0, 0, 0, 0}};
@@ -3028,6 +3057,7 @@ static swig_cast_info *swig_cast_initial[] = {
   _swigc__p_char,
   _swigc__p_double,
   _swigc__p_float,
+  _swigc__p_gint64,
   _swigc__p_gsize,
   _swigc__p_guint32,
   _swigc__p_guint64,
@@ -3069,6 +3099,7 @@ static swig_command_info swig_commands[] = {
 {"Amanda::Xferc::xfer_source_directtcp_connect", _wrap_xfer_source_directtcp_connect},
 {"Amanda::Xferc::xfer_filter_xor", _wrap_xfer_filter_xor},
 {"Amanda::Xferc::xfer_filter_process", _wrap_xfer_filter_process},
+{"Amanda::Xferc::get_err_fd", _wrap_get_err_fd},
 {"Amanda::Xferc::xfer_dest_null", _wrap_xfer_dest_null},
 {"Amanda::Xferc::xfer_dest_buffer", _wrap_xfer_dest_buffer},
 {"Amanda::Xferc::xfer_dest_buffer_get", _wrap_xfer_dest_buffer_get},
index 724e618ca3cc2470088cdc6263b92d6d6c3f852e..c77c93338e46b8c6771a498254fe8053075aa4f6 100644 (file)
@@ -68,6 +68,7 @@ package Amanda::Xfer;
 *xfer_source_directtcp_connect = *Amanda::Xferc::xfer_source_directtcp_connect;
 *xfer_filter_xor = *Amanda::Xferc::xfer_filter_xor;
 *xfer_filter_process = *Amanda::Xferc::xfer_filter_process;
+*get_err_fd = *Amanda::Xferc::get_err_fd;
 *xfer_dest_null = *Amanda::Xferc::xfer_dest_null;
 *xfer_dest_buffer = *Amanda::Xferc::xfer_dest_buffer;
 *xfer_dest_buffer_get = *Amanda::Xferc::xfer_dest_buffer_get;
@@ -118,7 +119,7 @@ Amanda::Xfer - the transfer architecture
       if ($msg->{'type'} == $XMSG_DONE) {
          Amanda::MainLoop::quit();
       }
-  });
+  }, 0, 0);
   Amanda::MainLoop::run();
 
 See L<http://wiki.zmanda.com/index.php/XFA> for background on the
@@ -134,9 +135,12 @@ The resulting object has the following methods:
 
 =over
 
-=item start($cb)
+=item start($cb, $offset, $size)
 
-Start this transfer.  Processing takes place asynchronously, and messages will
+Start this transfer.  It transfer $size bytes starting from offset $offset.
+$offset must be 0. $size is only supported by Amanda::Xfer::Source::Recovery.
+A size of 0 transfer everything to EOF.
+Processing takes place asynchronously, and messages will
 begin queueing up immediately.  If C<$cb> is given, then it is installed as the
 callback for messages from this transfer.  The callback receives three
 arguments: the event source, the message, and a reference to the controlling
@@ -304,15 +308,18 @@ C<$addrs> and reads the transfer data from the connection.
 
 =head3 Amanda::Xfer::Filter:Process
 
-  Amanda::Xfer::Filter::Process->new([@args], $need_root, $log_stderr);
+  $xfp = Amanda::Xfer::Filter::Process->new([@args], $need_root);
 
 This filter will pipe data through the standard file descriptors of the
 subprocess specified by C<@args>.  If C<$need_root> is true, it will attempt to
-change to uid 0 before executing the process.  Standard output from the process
-is redirected to the debug log.  Note that the process is invoked directly, not
-via a shell, so shell metacharcters (e.g., C<< 2>&1 >>) will not function as
-expected.  If C<$log_stderr> is set, then the filter's standard error is sent
-to the debug log; otherwise, it is sent to the parent process's stderr.
+change to uid 0 before executing the process.  Note that the process is
+invoked directly, not via a shell, so shell metacharcters (e.g., C<< 2>&1 >>)
+will not function as expected. This method create a pipe for the process
+stderr and the caller must read it or a hang may occur.
+
+  $xfp->get_stderr_fd()
+
+Return the file descriptor of the stderr pipe to read from.
 
 =head3 Amanda::Xfer::Filter:Xor
 
@@ -639,7 +646,7 @@ $_xmsg_type_VALUES{"XMSG_READY"} = $XMSG_READY;
 push @{$EXPORT_TAGS{"constants"}},  @{$EXPORT_TAGS{"xmsg_type"}};
 
 sub xfer_start_with_callback {
-    my ($xfer, $cb) = @_;
+    my ($xfer, $cb, $offset, $size) = @_;
     if (defined $cb) {
        my $releasing_cb = sub {
            my ($src, $msg, $xfer) = @_;
@@ -650,7 +657,9 @@ sub xfer_start_with_callback {
        };
        $xfer->get_source()->set_callback($releasing_cb);
     }
-    xfer_start($xfer);
+    $offset = 0 if !defined $offset;
+    $size = 0 if !defined $size;
+    xfer_start($xfer, $offset, $size);
 }
 
 sub xfer_set_callback {
@@ -789,6 +798,7 @@ sub new {
 
     Amanda::Xfer::xfer_filter_process(@_);
 }
+*get_stderr_fd = *Amanda::Xfer::get_err_fd;
 
 package Amanda::Xfer::Dest::Fd;
 
index d09923c7e5c291e32fd16ec0ef95728202072448..f449b517cf4f3bc819067e1fb457e2d091f76a0b 100644 (file)
@@ -42,7 +42,7 @@ Amanda::Xfer - the transfer architecture
       if ($msg->{'type'} == $XMSG_DONE) {
          Amanda::MainLoop::quit();
       }
-  });
+  }, 0, 0);
   Amanda::MainLoop::run();
 
 See L<http://wiki.zmanda.com/index.php/XFA> for background on the
@@ -58,9 +58,12 @@ The resulting object has the following methods:
 
 =over
 
-=item start($cb)
+=item start($cb, $offset, $size)
 
-Start this transfer.  Processing takes place asynchronously, and messages will
+Start this transfer.  It transfer $size bytes starting from offset $offset.
+$offset must be 0. $size is only supported by Amanda::Xfer::Source::Recovery.
+A size of 0 transfer everything to EOF.
+Processing takes place asynchronously, and messages will
 begin queueing up immediately.  If C<$cb> is given, then it is installed as the
 callback for messages from this transfer.  The callback receives three
 arguments: the event source, the message, and a reference to the controlling
@@ -228,15 +231,18 @@ C<$addrs> and reads the transfer data from the connection.
 
 =head3 Amanda::Xfer::Filter:Process
 
-  Amanda::Xfer::Filter::Process->new([@args], $need_root, $log_stderr);
+  $xfp = Amanda::Xfer::Filter::Process->new([@args], $need_root);
 
 This filter will pipe data through the standard file descriptors of the
 subprocess specified by C<@args>.  If C<$need_root> is true, it will attempt to
-change to uid 0 before executing the process.  Standard output from the process
-is redirected to the debug log.  Note that the process is invoked directly, not
-via a shell, so shell metacharcters (e.g., C<< 2>&1 >>) will not function as
-expected.  If C<$log_stderr> is set, then the filter's standard error is sent
-to the debug log; otherwise, it is sent to the parent process's stderr.
+change to uid 0 before executing the process.  Note that the process is
+invoked directly, not via a shell, so shell metacharcters (e.g., C<< 2>&1 >>)
+will not function as expected. This method create a pipe for the process
+stderr and the caller must read it or a hang may occur.
+
+  $xfp->get_stderr_fd()
+
+Return the file descriptor of the stderr pipe to read from.
 
 =head3 Amanda::Xfer::Filter:Xor
 
index f9527ccf3beae000cc5282f6933d50d9e44f7e93..31c5b7dfdb87ad8812d57c0735d9250862db0217 100644 (file)
@@ -29,6 +29,8 @@
 %{
 #include "glib-util.h"
 #include "amxfer.h"
+#include "amanda.h"
+#include "sockaddr-util.h"
 %}
 
 /* The SWIGging of the transfer architecture.
@@ -228,7 +230,7 @@ Xfer *xfer_new(XferElement **elementlist, unsigned int nelements);
 void xfer_unref(Xfer *);
 xfer_status xfer_get_status(Xfer *xfer);
 char *xfer_repr(Xfer *xfer);
-void xfer_start(Xfer *xfer);
+void xfer_start(Xfer *xfer, gint64 offset, gint64 size);
 void xfer_cancel(Xfer *xfer);
 /* xfer_get_source is implemented below */
 
@@ -241,7 +243,7 @@ void xfer_cancel(Xfer *xfer);
  * passed to the GSource's set_callback */
 %perlcode %{
 sub xfer_start_with_callback {
-    my ($xfer, $cb) = @_;
+    my ($xfer, $cb, $offset, $size) = @_;
     if (defined $cb) {
        my $releasing_cb = sub {
            my ($src, $msg, $xfer) = @_;
@@ -252,7 +254,9 @@ sub xfer_start_with_callback {
        };
        $xfer->get_source()->set_callback($releasing_cb);
     }
-    xfer_start($xfer);
+    $offset = 0 if !defined $offset;
+    $size = 0 if !defined $size;
+    xfer_start($xfer, $offset, $size);
 }
 %}
 
@@ -285,6 +289,7 @@ sub xfer_set_callback {
 void xfer_element_unref(XferElement *elt); /* (wrap the macro, above) */
 /* xfer_element_link_to -- private */
 char *xfer_element_repr(XferElement *elt);
+/* xfer_element_set_size -- private */
 /* xfer_element_start -- private */
 /* xfer_element_cancel -- private */
 
@@ -377,8 +382,9 @@ XferElement *xfer_filter_xor(
 %newobject xfer_filter_process;
 XferElement *xfer_filter_process(
     gchar **argv,
-    gboolean need_root,
-    gboolean log_stderr);
+    gboolean need_root);
+int get_err_fd(
+    XferElement *elt);
 
 %newobject xfer_dest_null;
 XferElement *xfer_dest_null(
@@ -613,6 +619,7 @@ DECLARE_CONSTRUCTOR(Amanda::Xfer::xfer_filter_xor)
 PACKAGE(Amanda::Xfer::Filter::Process)
 XFER_ELEMENT_SUBCLASS()
 DECLARE_CONSTRUCTOR(Amanda::Xfer::xfer_filter_process)
+DECLARE_METHOD(get_stderr_fd, Amanda::Xfer::get_err_fd)
 
 /* ---- */
 
index ca02080eb141aeaad9624e7a761b947b796c0aee..f58c9703d851f9387a674c1e5fa56dd48549d0a5 100644 (file)
@@ -212,22 +212,32 @@ MAINTAINERCLEANFILES += Amanda/Feature.c Amanda/Feature.pm
 EXTRA_DIST += Amanda/Feature.swg Amanda/Feature.pm Amanda/Feature.pod
 
 if WANT_SERVER
-# PACKAGE: Amanda::Interactive
-Amanda_DATA += Amanda/Interactive.pm
+# PACKAGE: Amanda::ScanInventory
+Amanda_DATA += Amanda/ScanInventory.pm
 endif
-EXTRA_DIST += Amanda/Interactive.pm
+EXTRA_DIST += Amanda/ScanInventory.pm
+
+if WANT_SERVER
+# PACKAGE: Amanda::Interactivity
+Amanda_DATA += Amanda/Interactivity.pm
+endif
+EXTRA_DIST += Amanda/Interactivity.pm
 
 # PACKAGE: Amanda::ClientService
 Amanda_DATA += Amanda/ClientService.pm
 EXTRA_DIST += Amanda/ClientService.pm
 
 if WANT_SERVER
-# PACKAGE: Amanda::Interactive::*
-AmandaInteractivedir = $(amperldir)/Amanda/Interactive
-AmandaInteractive_DATA = \
-       Amanda/Interactive/stdin.pm
+# PACKAGE: Amanda::Interactivity::*
+AmandaInteractivitydir = $(amperldir)/Amanda/Interactivity
+AmandaInteractivity_DATA = \
+       Amanda/Interactivity/email.pm \
+       Amanda/Interactivity/stdin.pm \
+       Amanda/Interactivity/tty.pm \
+       Amanda/Interactivity/tty_email.pm
 endif
-EXTRA_DIST += $(AmandaInteractive_DATA)
+PM_FILES += $(AmandaInteractivity_DATA)
+EXTRA_DIST += $(AmandaInteractivity_DATA)
 
 if WANT_SERVER
 # PACKAGE: Amanda::Changer
@@ -239,6 +249,7 @@ if WANT_SERVER
 # PACKAGE: Amanda::Changer::*
 AmandaChangerdir = $(amperldir)/Amanda/Changer
 AmandaChanger_DATA = \
+       Amanda/Changer/aggregate.pm \
        Amanda/Changer/compat.pm \
        Amanda/Changer/disk.pm \
        Amanda/Changer/multi.pm \
@@ -297,6 +308,8 @@ if WANT_SERVER
 # PACKAGE: Amanda::Taper::Scan::*
 AmandaTaperScandir = $(amperldir)/Amanda/Taper/Scan
 AmandaTaperScan_DATA = \
+       Amanda/Taper/Scan/lexical.pm \
+       Amanda/Taper/Scan/oldest.pm \
        Amanda/Taper/Scan/traditional.pm
 PM_FILES += $(AmandaTaperScan_DATA)
 endif
index 87aa4abce3656b127b6385340ca25009ec379a1a..12efc10bfdc02897f13350208002dfd8acee812c 100644 (file)
@@ -145,8 +145,11 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
 @WANT_SERVER_TRUE@     Amanda/Tapelist.c Amanda/Tapelist.pm \
 @WANT_SERVER_TRUE@     Amanda/Disklist.c Amanda/Disklist.pm
 
-# PACKAGE: Amanda::Interactive
-@WANT_SERVER_TRUE@am__append_6 = Amanda/Interactive.pm
+# PACKAGE: Amanda::ScanInventory
+
+# PACKAGE: Amanda::Interactivity
+@WANT_SERVER_TRUE@am__append_6 = Amanda/ScanInventory.pm \
+@WANT_SERVER_TRUE@     Amanda/Interactivity.pm
 
 # PACKAGE: Amanda::Changer
 
@@ -187,6 +190,7 @@ am__aclocal_m4_deps =  \
        $(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/as_needed.m4 \
        $(top_srcdir)/config/amanda/bsd-security.m4 \
        $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
        $(top_srcdir)/config/amanda/bsdudp-security.m4 \
@@ -364,7 +368,7 @@ am__installdirs = "$(DESTDIR)$(libApplicationdir)" \
        "$(DESTDIR)$(AmandaApplicationdir)" \
        "$(DESTDIR)$(AmandaChangerdir)" "$(DESTDIR)$(AmandaConfigdir)" \
        "$(DESTDIR)$(AmandaCurinfodir)" "$(DESTDIR)$(AmandaIPCdir)" \
-       "$(DESTDIR)$(AmandaInteractivedir)" \
+       "$(DESTDIR)$(AmandaInteractivitydir)" \
        "$(DESTDIR)$(AmandaRecoverydir)" \
        "$(DESTDIR)$(AmandaReportdir)" "$(DESTDIR)$(AmandaTaperdir)" \
        "$(DESTDIR)$(AmandaTaperScandir)" "$(DESTDIR)$(Amanda_DBdir)"
@@ -601,7 +605,7 @@ RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
        ps-recursive uninstall-recursive
 DATA = $(Amanda_DATA) $(AmandaApplication_DATA) $(AmandaChanger_DATA) \
        $(AmandaConfig_DATA) $(AmandaCurinfo_DATA) $(AmandaIPC_DATA) \
-       $(AmandaInteractive_DATA) $(AmandaRecovery_DATA) \
+       $(AmandaInteractivity_DATA) $(AmandaRecovery_DATA) \
        $(AmandaReport_DATA) $(AmandaTaper_DATA) \
        $(AmandaTaperScan_DATA) $(Amanda_DB_DATA)
 RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive        \
@@ -661,6 +665,7 @@ APPLICATION_DIR = @APPLICATION_DIR@
 AR = @AR@
 ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
 ASSERTIONS = @ASSERTIONS@
+AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -1134,6 +1139,7 @@ LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
 MKDIR_P = @MKDIR_P@
+MOUNT = @MOUNT@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
@@ -1331,6 +1337,7 @@ STDBOOL_H = @STDBOOL_H@
 STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
+SUNTAR = @SUNTAR@
 SVN = @SVN@
 SWIG = @SWIG@
 SWIG_LIB = @SWIG_LIB@
@@ -1338,6 +1345,7 @@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TCPPORTRANGE = @TCPPORTRANGE@
 TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
 UDPPORTRANGE = @UDPPORTRANGE@
+UMOUNT = @UMOUNT@
 UNCOMPRESS_OPT = @UNCOMPRESS_OPT@
 UNCOMPRESS_PATH = @UNCOMPRESS_PATH@
 UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
@@ -1437,21 +1445,21 @@ EXTRA_DIST = $(AMGLUE_SWG) Amanda/Archive.swg Amanda/Archive.pm \
        Amanda/Cmdline.pm Amanda/Cmdline.pod Amanda/Tapelist.swg \
        Amanda/Tapelist.pm Amanda/Tapelist.pod Amanda/Disklist.swg \
        Amanda/Disklist.pm Amanda/Disklist.pod Amanda/Feature.swg \
-       Amanda/Feature.pm Amanda/Feature.pod Amanda/Interactive.pm \
-       Amanda/ClientService.pm $(AmandaInteractive_DATA) \
-       Amanda/Changer.pm $(AmandaChanger_DATA) Amanda/Curinfo.pm \
-       $(AmandaCurinfo_DATA) $(AmandaRecovery_DATA) \
-       $(AmandaTaper_DATA) $(AmandaTaperScan_DATA) \
-       Amanda/DB/Catalog.pm Amanda/Xfer.swg Amanda/Xfer.pm \
-       Amanda/Xfer.pod $(am__append_12) $(am__append_15) \
-       Amanda/BigIntCompat.pm Amanda/Debug.swg Amanda/Debug.pm \
-       Amanda/Debug.pod Amanda/Config.swg Amanda/Config.pm \
-       Amanda/Config.pod $(AmandaConfig_DATA) Amanda/Util.swg \
-       Amanda/Util.pm Amanda/Util.pod Amanda/Header.swg \
-       Amanda/Header.pm Amanda/Header.pod Amanda/Tests.swg \
-       Amanda/Tests.pm Amanda/Tests.pod Amanda/MainLoop.swg \
-       Amanda/MainLoop.pm Amanda/MainLoop.pod $(AmandaIPC_DATA) \
-       Amanda/IPC/Binary.swg Amanda/IPC/Binary.pm \
+       Amanda/Feature.pm Amanda/Feature.pod Amanda/ScanInventory.pm \
+       Amanda/Interactivity.pm Amanda/ClientService.pm \
+       $(AmandaInteractivity_DATA) Amanda/Changer.pm \
+       $(AmandaChanger_DATA) Amanda/Curinfo.pm $(AmandaCurinfo_DATA) \
+       $(AmandaRecovery_DATA) $(AmandaTaper_DATA) \
+       $(AmandaTaperScan_DATA) Amanda/DB/Catalog.pm Amanda/Xfer.swg \
+       Amanda/Xfer.pm Amanda/Xfer.pod $(am__append_12) \
+       $(am__append_15) Amanda/BigIntCompat.pm Amanda/Debug.swg \
+       Amanda/Debug.pm Amanda/Debug.pod Amanda/Config.swg \
+       Amanda/Config.pm Amanda/Config.pod $(AmandaConfig_DATA) \
+       Amanda/Util.swg Amanda/Util.pm Amanda/Util.pod \
+       Amanda/Header.swg Amanda/Header.pm Amanda/Header.pod \
+       Amanda/Tests.swg Amanda/Tests.pm Amanda/Tests.pod \
+       Amanda/MainLoop.swg Amanda/MainLoop.pm Amanda/MainLoop.pod \
+       $(AmandaIPC_DATA) Amanda/IPC/Binary.swg Amanda/IPC/Binary.pm \
        Amanda/IPC/Binary.pod Amanda/Paths.pm.in \
        Amanda/Constants.pm.in Amanda/Script_App.pm Amanda/Holding.pm \
        Amanda/Application.swg Amanda/Application.pm \
@@ -1524,8 +1532,8 @@ SWIG_OPTIONS = -perl5 -proxy -DSWIG_TYPE_TABLE=SWIG_TYPES_Amanda -I$(srcdir)
 # PM_FILES should contain the .pm files from which the HTML should
 # be geneated.  This is just the concatenation of foo_DATA for all $(foodir)
 # into which perl modules are installed.
-PM_FILES = $(Amanda_DATA) $(am__append_9) $(AmandaIPC_DATA) \
-       $(am__append_19)
+PM_FILES = $(Amanda_DATA) $(AmandaInteractivity_DATA) $(am__append_9) \
+       $(AmandaIPC_DATA) $(am__append_19)
 Amandadir = $(amperldir)/Amanda
 
 # PACKAGE: Amanda::Process
@@ -1617,15 +1625,19 @@ libFeature_la_LIBADD = amglue/libamglue.la \
        $(top_builddir)/common-src/libamanda.la
 
 
-# PACKAGE: Amanda::Interactive::*
-@WANT_SERVER_TRUE@AmandaInteractivedir = $(amperldir)/Amanda/Interactive
-@WANT_SERVER_TRUE@AmandaInteractive_DATA = \
-@WANT_SERVER_TRUE@     Amanda/Interactive/stdin.pm
+# PACKAGE: Amanda::Interactivity::*
+@WANT_SERVER_TRUE@AmandaInteractivitydir = $(amperldir)/Amanda/Interactivity
+@WANT_SERVER_TRUE@AmandaInteractivity_DATA = \
+@WANT_SERVER_TRUE@     Amanda/Interactivity/email.pm \
+@WANT_SERVER_TRUE@     Amanda/Interactivity/stdin.pm \
+@WANT_SERVER_TRUE@     Amanda/Interactivity/tty.pm \
+@WANT_SERVER_TRUE@     Amanda/Interactivity/tty_email.pm
 
 
 # PACKAGE: Amanda::Changer::*
 @WANT_SERVER_TRUE@AmandaChangerdir = $(amperldir)/Amanda/Changer
-@WANT_SERVER_TRUE@AmandaChanger_DATA = Amanda/Changer/compat.pm \
+@WANT_SERVER_TRUE@AmandaChanger_DATA = Amanda/Changer/aggregate.pm \
+@WANT_SERVER_TRUE@     Amanda/Changer/compat.pm \
 @WANT_SERVER_TRUE@     Amanda/Changer/disk.pm \
 @WANT_SERVER_TRUE@     Amanda/Changer/multi.pm \
 @WANT_SERVER_TRUE@     Amanda/Changer/null.pm \
@@ -1660,6 +1672,8 @@ libFeature_la_LIBADD = amglue/libamglue.la \
 # PACKAGE: Amanda::Taper::Scan::*
 @WANT_SERVER_TRUE@AmandaTaperScandir = $(amperldir)/Amanda/Taper/Scan
 @WANT_SERVER_TRUE@AmandaTaperScan_DATA = \
+@WANT_SERVER_TRUE@     Amanda/Taper/Scan/lexical.pm \
+@WANT_SERVER_TRUE@     Amanda/Taper/Scan/oldest.pm \
 @WANT_SERVER_TRUE@     Amanda/Taper/Scan/traditional.pm
 
 
@@ -2719,26 +2733,26 @@ uninstall-AmandaIPCDATA:
        test -n "$$files" || exit 0; \
        echo " ( cd '$(DESTDIR)$(AmandaIPCdir)' && rm -f" $$files ")"; \
        cd "$(DESTDIR)$(AmandaIPCdir)" && rm -f $$files
-install-AmandaInteractiveDATA: $(AmandaInteractive_DATA)
+install-AmandaInteractivityDATA: $(AmandaInteractivity_DATA)
        @$(NORMAL_INSTALL)
-       test -z "$(AmandaInteractivedir)" || $(MKDIR_P) "$(DESTDIR)$(AmandaInteractivedir)"
-       @list='$(AmandaInteractive_DATA)'; test -n "$(AmandaInteractivedir)" || list=; \
+       test -z "$(AmandaInteractivitydir)" || $(MKDIR_P) "$(DESTDIR)$(AmandaInteractivitydir)"
+       @list='$(AmandaInteractivity_DATA)'; test -n "$(AmandaInteractivitydir)" || list=; \
        for p in $$list; do \
          if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
          echo "$$d$$p"; \
        done | $(am__base_list) | \
        while read files; do \
-         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(AmandaInteractivedir)'"; \
-         $(INSTALL_DATA) $$files "$(DESTDIR)$(AmandaInteractivedir)" || exit $$?; \
+         echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(AmandaInteractivitydir)'"; \
+         $(INSTALL_DATA) $$files "$(DESTDIR)$(AmandaInteractivitydir)" || exit $$?; \
        done
 
-uninstall-AmandaInteractiveDATA:
+uninstall-AmandaInteractivityDATA:
        @$(NORMAL_UNINSTALL)
-       @list='$(AmandaInteractive_DATA)'; test -n "$(AmandaInteractivedir)" || list=; \
+       @list='$(AmandaInteractivity_DATA)'; test -n "$(AmandaInteractivitydir)" || list=; \
        files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
        test -n "$$files" || exit 0; \
-       echo " ( cd '$(DESTDIR)$(AmandaInteractivedir)' && rm -f" $$files ")"; \
-       cd "$(DESTDIR)$(AmandaInteractivedir)" && rm -f $$files
+       echo " ( cd '$(DESTDIR)$(AmandaInteractivitydir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(AmandaInteractivitydir)" && rm -f $$files
 install-AmandaRecoveryDATA: $(AmandaRecovery_DATA)
        @$(NORMAL_INSTALL)
        test -z "$(AmandaRecoverydir)" || $(MKDIR_P) "$(DESTDIR)$(AmandaRecoverydir)"
@@ -3044,7 +3058,7 @@ check: $(BUILT_SOURCES)
 all-am: Makefile $(LTLIBRARIES) $(DATA)
 installdirs: installdirs-recursive
 installdirs-am:
-       for dir in "$(DESTDIR)$(libApplicationdir)" "$(DESTDIR)$(libArchivedir)" "$(DESTDIR)$(libCmdlinedir)" "$(DESTDIR)$(libConfigdir)" "$(DESTDIR)$(libDebugdir)" "$(DESTDIR)$(libDevicedir)" "$(DESTDIR)$(libDisklistdir)" "$(DESTDIR)$(libFeaturedir)" "$(DESTDIR)$(libHeaderdir)" "$(DESTDIR)$(libIPCBinarydir)" "$(DESTDIR)$(libLogfiledir)" "$(DESTDIR)$(libMainLoopdir)" "$(DESTDIR)$(libNDMPdir)" "$(DESTDIR)$(libTapelistdir)" "$(DESTDIR)$(libTestsdir)" "$(DESTDIR)$(libUtildir)" "$(DESTDIR)$(libXferdir)" "$(DESTDIR)$(libXferServerdir)" "$(DESTDIR)$(Amandadir)" "$(DESTDIR)$(AmandaApplicationdir)" "$(DESTDIR)$(AmandaChangerdir)" "$(DESTDIR)$(AmandaConfigdir)" "$(DESTDIR)$(AmandaCurinfodir)" "$(DESTDIR)$(AmandaIPCdir)" "$(DESTDIR)$(AmandaInteractivedir)" "$(DESTDIR)$(AmandaRecoverydir)" "$(DESTDIR)$(AmandaReportdir)" "$(DESTDIR)$(AmandaTaperdir)" "$(DESTDIR)$(AmandaTaperScandir)" "$(DESTDIR)$(Amanda_DBdir)"; do \
+       for dir in "$(DESTDIR)$(libApplicationdir)" "$(DESTDIR)$(libArchivedir)" "$(DESTDIR)$(libCmdlinedir)" "$(DESTDIR)$(libConfigdir)" "$(DESTDIR)$(libDebugdir)" "$(DESTDIR)$(libDevicedir)" "$(DESTDIR)$(libDisklistdir)" "$(DESTDIR)$(libFeaturedir)" "$(DESTDIR)$(libHeaderdir)" "$(DESTDIR)$(libIPCBinarydir)" "$(DESTDIR)$(libLogfiledir)" "$(DESTDIR)$(libMainLoopdir)" "$(DESTDIR)$(libNDMPdir)" "$(DESTDIR)$(libTapelistdir)" "$(DESTDIR)$(libTestsdir)" "$(DESTDIR)$(libUtildir)" "$(DESTDIR)$(libXferdir)" "$(DESTDIR)$(libXferServerdir)" "$(DESTDIR)$(Amandadir)" "$(DESTDIR)$(AmandaApplicationdir)" "$(DESTDIR)$(AmandaChangerdir)" "$(DESTDIR)$(AmandaConfigdir)" "$(DESTDIR)$(AmandaCurinfodir)" "$(DESTDIR)$(AmandaIPCdir)" "$(DESTDIR)$(AmandaInteractivitydir)" "$(DESTDIR)$(AmandaRecoverydir)" "$(DESTDIR)$(AmandaReportdir)" "$(DESTDIR)$(AmandaTaperdir)" "$(DESTDIR)$(AmandaTaperScandir)" "$(DESTDIR)$(Amanda_DBdir)"; do \
          test -z "$$dir" || $(MKDIR_P) "$$dir"; \
        done
 install: $(BUILT_SOURCES)
@@ -3113,7 +3127,7 @@ info-am:
 install-data-am: install-AmandaApplicationDATA \
        install-AmandaChangerDATA install-AmandaConfigDATA \
        install-AmandaCurinfoDATA install-AmandaDATA \
-       install-AmandaIPCDATA install-AmandaInteractiveDATA \
+       install-AmandaIPCDATA install-AmandaInteractivityDATA \
        install-AmandaRecoveryDATA install-AmandaReportDATA \
        install-AmandaTaperDATA install-AmandaTaperScanDATA \
        install-Amanda_DBDATA install-data-local \
@@ -3176,7 +3190,7 @@ ps-am:
 uninstall-am: uninstall-AmandaApplicationDATA \
        uninstall-AmandaChangerDATA uninstall-AmandaConfigDATA \
        uninstall-AmandaCurinfoDATA uninstall-AmandaDATA \
-       uninstall-AmandaIPCDATA uninstall-AmandaInteractiveDATA \
+       uninstall-AmandaIPCDATA uninstall-AmandaInteractivityDATA \
        uninstall-AmandaRecoveryDATA uninstall-AmandaReportDATA \
        uninstall-AmandaTaperDATA uninstall-AmandaTaperScanDATA \
        uninstall-Amanda_DBDATA uninstall-libApplicationLTLIBRARIES \
@@ -3213,7 +3227,7 @@ uninstall-am: uninstall-AmandaApplicationDATA \
        install install-AmandaApplicationDATA \
        install-AmandaChangerDATA install-AmandaConfigDATA \
        install-AmandaCurinfoDATA install-AmandaDATA \
-       install-AmandaIPCDATA install-AmandaInteractiveDATA \
+       install-AmandaIPCDATA install-AmandaInteractivityDATA \
        install-AmandaRecoveryDATA install-AmandaReportDATA \
        install-AmandaTaperDATA install-AmandaTaperScanDATA \
        install-Amanda_DBDATA install-am install-data install-data-am \
@@ -3238,7 +3252,7 @@ uninstall-am: uninstall-AmandaApplicationDATA \
        uninstall uninstall-AmandaApplicationDATA \
        uninstall-AmandaChangerDATA uninstall-AmandaConfigDATA \
        uninstall-AmandaCurinfoDATA uninstall-AmandaDATA \
-       uninstall-AmandaIPCDATA uninstall-AmandaInteractiveDATA \
+       uninstall-AmandaIPCDATA uninstall-AmandaInteractivityDATA \
        uninstall-AmandaRecoveryDATA uninstall-AmandaReportDATA \
        uninstall-AmandaTaperDATA uninstall-AmandaTaperScanDATA \
        uninstall-Amanda_DBDATA uninstall-am \
index bf964fedc8e49e93f4a1e05864fbded320da2acf..c5cd8630a1cf2a2c0580d9da4a173336567e738c 100644 (file)
@@ -143,6 +143,7 @@ am__aclocal_m4_deps =  \
        $(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/as_needed.m4 \
        $(top_srcdir)/config/amanda/bsd-security.m4 \
        $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
        $(top_srcdir)/config/amanda/bsdudp-security.m4 \
@@ -357,6 +358,7 @@ APPLICATION_DIR = @APPLICATION_DIR@
 AR = @AR@
 ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
 ASSERTIONS = @ASSERTIONS@
+AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -830,6 +832,7 @@ LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
 MKDIR_P = @MKDIR_P@
+MOUNT = @MOUNT@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
@@ -1027,6 +1030,7 @@ STDBOOL_H = @STDBOOL_H@
 STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
+SUNTAR = @SUNTAR@
 SVN = @SVN@
 SWIG = @SWIG@
 SWIG_LIB = @SWIG_LIB@
@@ -1034,6 +1038,7 @@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TCPPORTRANGE = @TCPPORTRANGE@
 TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
 UDPPORTRANGE = @UDPPORTRANGE@
+UMOUNT = @UMOUNT@
 UNCOMPRESS_OPT = @UNCOMPRESS_OPT@
 UNCOMPRESS_PATH = @UNCOMPRESS_PATH@
 UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
index b6804666c629c16166ecea66afa23e6ede65e16b..641b9187d7ad6b473e30a38aca6c5edcc4df5719 100644 (file)
 
     i = 0;
     av = newAV();
-    while (iter && iter->ipv4) {
-       struct in_addr in;
-       char *addr;
-       AV *tuple;
-
-       in.s_addr = htonl(iter->ipv4);
-       addr = inet_ntoa(in);
-
-       tuple = newAV();
-       g_assert(NULL != av_store(tuple, 0,
-               newSVpv(addr, 0)));
-       g_assert(NULL != av_store(tuple, 1, newSViv(iter->port)));
+    while (iter && SU_GET_FAMILY(iter) != 0) {
+       char *addr = str_sockaddr_no_port(iter);
+       AV *tuple = newAV();
+
+       g_assert(NULL != av_store(tuple, 0, newSVpv(addr, 0)));
+       g_assert(NULL != av_store(tuple, 1, newSViv(SU_GET_PORT(iter))));
        g_assert(NULL != av_store(av, i++, newRV_noinc((SV *)tuple)));
        iter++;
     }
        AV *av = newAV();
        int i = 0;
 
-       while (iter && iter->ipv4) {
-           struct in_addr in;
-           char *addr;
+       while (iter && SU_GET_FAMILY(iter) != 0) {
+           char *addr = str_sockaddr_no_port(iter);
            AV *tuple = newAV();
 
-           in.s_addr = htonl(iter->ipv4);
-           addr = inet_ntoa(in);
-           g_assert(NULL != av_store(tuple, 0,
-                   newSVpv(addr, 0)));
-           g_assert(NULL != av_store(tuple, 1, newSViv(iter->port)));
+           g_assert(NULL != av_store(tuple, 0, newSVpv(addr, 0)));
+           g_assert(NULL != av_store(tuple, 1, newSViv(SU_GET_PORT(iter))));
            g_assert(NULL != av_store(av, i++, newRV_noinc((SV *)tuple)));
            iter++;
        }
@@ -96,7 +86,7 @@
     for (i = 0; i < num_addrs; i++) {
         SV **svp = av_fetch(addrs_av, i, 0);
         AV *addr_av;
-        struct in_addr addr;
+        sockaddr_union addr;
         IV port;
 
         if (!svp || !SvROK(*svp) || SvTYPE(SvRV(*svp)) != SVt_PVAV
 
         /* get address */
         svp = av_fetch(addr_av, 0, 0);
-        if (!svp || !SvPOK(*svp) || !inet_aton(SvPV_nolen(*svp), &addr)) {
+        if (!svp || !SvPOK(*svp) || !str_to_sockaddr(SvPV_nolen(*svp), &addr)) {
             SWIG_exception_fail(SWIG_TypeError, "invalid IPv4 addr in address");
         }
-        $1[i].ipv4 = ntohl(addr.s_addr);
 
         /* get port */
         svp = av_fetch(addr_av, 1, 0);
         if (!svp || !SvIOK(*svp) || (port = SvIV(*svp)) <= 0 || port >= 65536) {
             SWIG_exception_fail(SWIG_TypeError, "invalid port in address");
         }
-        $1[i].port = (guint16)port;
+       SU_SET_PORT(&addr, port);
+
+       copy_sockaddr($1, &addr);
     }
 }
index 47e99e803ead58094f52e2a13d63bbb281b4c3ec..21e93fe714715b810fa02e9b91d1d38aba68574c 100644 (file)
@@ -49,6 +49,7 @@ am__aclocal_m4_deps =  \
        $(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/as_needed.m4 \
        $(top_srcdir)/config/amanda/bsd-security.m4 \
        $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
        $(top_srcdir)/config/amanda/bsdudp-security.m4 \
@@ -217,6 +218,7 @@ APPLICATION_DIR = @APPLICATION_DIR@
 AR = @AR@
 ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
 ASSERTIONS = @ASSERTIONS@
+AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -690,6 +692,7 @@ LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
 MKDIR_P = @MKDIR_P@
+MOUNT = @MOUNT@
 MSGFMT = msgfmt
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = msgmerge
@@ -889,6 +892,7 @@ STDBOOL_H = @STDBOOL_H@
 STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
+SUNTAR = @SUNTAR@
 SVN = @SVN@
 SWIG = @SWIG@
 SWIG_LIB = @SWIG_LIB@
@@ -896,6 +900,7 @@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TCPPORTRANGE = @TCPPORTRANGE@
 TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
 UDPPORTRANGE = @UDPPORTRANGE@
+UMOUNT = @UMOUNT@
 UNCOMPRESS_OPT = @UNCOMPRESS_OPT@
 UNCOMPRESS_PATH = @UNCOMPRESS_PATH@
 UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
index f385fb54b67078017b3cef985de47eb6ffc1f7a5..3ba913ba2fc2b5853a779569b4532181e069e65a 100644 (file)
@@ -131,6 +131,7 @@ am__aclocal_m4_deps =  \
        $(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/as_needed.m4 \
        $(top_srcdir)/config/amanda/bsd-security.m4 \
        $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
        $(top_srcdir)/config/amanda/bsdudp-security.m4 \
@@ -335,6 +336,7 @@ APPLICATION_DIR = @APPLICATION_DIR@
 AR = @AR@
 ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
 ASSERTIONS = @ASSERTIONS@
+AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -808,6 +810,7 @@ LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
 MKDIR_P = @MKDIR_P@
+MOUNT = @MOUNT@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
@@ -1005,6 +1008,7 @@ STDBOOL_H = @STDBOOL_H@
 STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
+SUNTAR = @SUNTAR@
 SVN = @SVN@
 SWIG = @SWIG@
 SWIG_LIB = @SWIG_LIB@
@@ -1012,6 +1016,7 @@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TCPPORTRANGE = @TCPPORTRANGE@
 TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
 UDPPORTRANGE = @UDPPORTRANGE@
+UMOUNT = @UMOUNT@
 UNCOMPRESS_OPT = @UNCOMPRESS_OPT@
 UNCOMPRESS_PATH = @UNCOMPRESS_PATH@
 UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
index 9da45bd65065d0fa63867fa94e2b972c60564a1c..9f7217b58654ba19417951fdf589490420bdb5ce 100644 (file)
@@ -45,6 +45,7 @@
 #include "event.h"
 #include "client_util.h"
 #include "security.h"
+#include "pipespawn.h"
 
 typedef struct EXTRACT_LIST_ITEM {
     char *path;
@@ -1956,7 +1957,8 @@ extract_files_child(
            GSList   *scriptlist;
            script_t *script;
 
-           merge_properties(dump_dle->application_property, proplist);
+           merge_properties(dump_dle, NULL, dump_dle->application_property,
+                            proplist, 0);
            application_property_add_to_argv(argv_ptr, dump_dle, NULL,
                                             tapesrv_features);
            for (scriptlist = dump_dle->scriptlist; scriptlist != NULL;
@@ -2843,6 +2845,43 @@ start_processing_data(
        /*NOTREACHED*/
     }
 
+    /* decrypt */
+    if (ctl_data->file.encrypted) {
+       char *argv[3];
+       int  crypt_out;
+       int  errfd = fileno(stderr);
+
+       g_debug("image is encrypted %s %s", ctl_data->file.clnt_encrypt, ctl_data->file.clnt_decrypt_opt);
+       argv[0] = ctl_data->file.clnt_encrypt;
+       argv[1] = ctl_data->file.clnt_decrypt_opt;
+       argv[2] = NULL;
+       pipespawnv(ctl_data->file.clnt_encrypt, STDOUT_PIPE, 0, &ctl_data->child_pipe[0], &crypt_out, &errfd, argv);
+       ctl_data->child_pipe[0] = crypt_out;
+    }
+
+    /* decompress */
+    if (ctl_data->file.compressed) {
+       char *argv[3];
+       int  comp_out;
+       int  errfd = fileno(stderr);
+       char *comp_prog;
+       char *comp_arg;
+
+       g_debug("image is compressed %s", ctl_data->file.clntcompprog);
+       if (strlen(ctl_data->file.clntcompprog) > 0) {
+           comp_prog = ctl_data->file.clntcompprog;
+           comp_arg = "-d";
+       } else {
+           comp_prog = UNCOMPRESS_PATH;
+           comp_arg = UNCOMPRESS_OPT;
+       }
+       argv[0] = comp_prog;
+       argv[1] = comp_arg;
+       argv[2] = NULL;
+       pipespawnv(comp_prog, STDOUT_PIPE, 0, &ctl_data->child_pipe[0], &comp_out, &errfd, argv);
+       ctl_data->child_pipe[0] = comp_out;
+    }
+
     /* okay, ready to extract. fork a child to do the actual work */
     if ((ctl_data->pid = fork()) == 0) {
        /* this is the child process */
index f326b328e5e39e8b88b87178b8665f7f6109b877..1e7a7ed1e14ccec1a5eb63b16a0d7fa75a3fcbc3 100644 (file)
@@ -13,7 +13,7 @@ INCLUDES =    -I$(top_builddir)/common-src \
                -I$(top_srcdir)/gnulib
 
 AM_CFLAGS = $(AMANDA_WARNING_CFLAGS)
-AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
+AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS) $(AS_NEEDED_FLAGS)
 
 LINT=$(AMLINT)
 LINTFLAGS=$(AMLINTFLAGS)
@@ -21,8 +21,7 @@ LINTFLAGS=$(AMLINTFLAGS)
 amlib_LTLIBRARIES =    libamserver.la
 
 sbin_PROGRAMS =                amadmin         amcheck         \
-                       amflush         \
-                       amservice
+                       amflush
 
 amlibexec_PROGRAMS =   amindexd        amtrmidx        \
                        amtrmlog        driver          dumper          \
@@ -31,6 +30,7 @@ amlibexec_PROGRAMS =  amindexd        amtrmidx        \
 
 amlibexec_SCRIPTS_PERL = \
            amlogroll \
+           amdumpd \
            taper \
            amcheck-device
 
@@ -67,7 +67,7 @@ amlibexec_SCRIPTS = $(amlibexec_SCRIPTS_PERL) $(amlibexec_SCRIPTS_SHELL)
 
 INSTALLPERMS_exec = \
        dest=$(sbindir) chown=root:setuid chmod=04750 \
-               amcheck amservice \
+               amcheck \
        dest=$(amlibexecdir) \
                dumper planner
 
@@ -89,7 +89,7 @@ libamserver_la_SOURCES=       amindex.c       \
                        tapefile.c      find.c          server_util.c   \
                         xfer-source-holding.c
 
-libamserver_la_LDFLAGS= -release $(VERSION)
+libamserver_la_LDFLAGS= -release $(VERSION) $(AS_NEEDED_FLAGS)
 libamserver_la_LIBADD= ../device-src/libamdevice.la \
                       ../common-src/libamanda.la
 
index 5570746b4605ec238558379449846a2283de32cc..421f12c68f225de922b6c46b6fd4cab521cc4a95 100644 (file)
@@ -190,8 +190,7 @@ DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
        $(top_srcdir)/config/automake/scripts.am \
        $(top_srcdir)/config/automake/vars.am
 @WANT_INSTALLPERMS_FALSE@am__append_1 = $(installperms_sh)
-sbin_PROGRAMS = amadmin$(EXEEXT) amcheck$(EXEEXT) amflush$(EXEEXT) \
-       amservice$(EXEEXT)
+sbin_PROGRAMS = amadmin$(EXEEXT) amcheck$(EXEEXT) amflush$(EXEEXT)
 amlibexec_PROGRAMS = amindexd$(EXEEXT) amtrmidx$(EXEEXT) \
        amtrmlog$(EXEEXT) driver$(EXEEXT) dumper$(EXEEXT) \
        planner$(EXEEXT) amcleanupdisk$(EXEEXT) chunker$(EXEEXT)
@@ -216,6 +215,7 @@ am__aclocal_m4_deps =  \
        $(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/as_needed.m4 \
        $(top_srcdir)/config/amanda/bsd-security.m4 \
        $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
        $(top_srcdir)/config/amanda/bsdudp-security.m4 \
@@ -420,11 +420,6 @@ am__objects_1 = amindexd.$(OBJEXT) disk_history.$(OBJEXT) \
 am_amindexd_OBJECTS = $(am__objects_1)
 amindexd_OBJECTS = $(am_amindexd_OBJECTS)
 amindexd_DEPENDENCIES = $(LDADD) ../amandad-src/libamandad.la
-amservice_SOURCES = amservice.c
-amservice_OBJECTS = amservice.$(OBJEXT)
-amservice_LDADD = $(LDADD)
-amservice_DEPENDENCIES = ../common-src/libamanda.la libamserver.la \
-       ../device-src/libamdevice.la ../common-src/libamanda.la
 amtrmidx_SOURCES = amtrmidx.c
 amtrmidx_OBJECTS = amtrmidx.$(OBJEXT)
 amtrmidx_LDADD = $(LDADD)
@@ -480,13 +475,13 @@ 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 $(amindexd_SOURCES) amservice.c \
-       amtrmidx.c amtrmlog.c chunker.c $(diskfile_SOURCES) driver.c \
-       dumper.c $(infofile_SOURCES) planner.c
+       amcleanupdisk.c amflush.c $(amindexd_SOURCES) amtrmidx.c \
+       amtrmlog.c chunker.c $(diskfile_SOURCES) driver.c dumper.c \
+       $(infofile_SOURCES) planner.c
 DIST_SOURCES = $(libamserver_la_SOURCES) amadmin.c amcheck.c \
-       amcleanupdisk.c amflush.c $(amindexd_SOURCES) amservice.c \
-       amtrmidx.c amtrmlog.c chunker.c $(diskfile_SOURCES) driver.c \
-       dumper.c $(infofile_SOURCES) planner.c
+       amcleanupdisk.c amflush.c $(amindexd_SOURCES) amtrmidx.c \
+       amtrmlog.c chunker.c $(diskfile_SOURCES) driver.c dumper.c \
+       $(infofile_SOURCES) planner.c
 HEADERS = $(noinst_HEADERS)
 ETAGS = etags
 CTAGS = ctags
@@ -514,6 +509,7 @@ APPLICATION_DIR = @APPLICATION_DIR@
 AR = @AR@
 ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
 ASSERTIONS = @ASSERTIONS@
+AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -987,6 +983,7 @@ LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
 MKDIR_P = @MKDIR_P@
+MOUNT = @MOUNT@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
@@ -1184,6 +1181,7 @@ STDBOOL_H = @STDBOOL_H@
 STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
+SUNTAR = @SUNTAR@
 SVN = @SVN@
 SWIG = @SWIG@
 SWIG_LIB = @SWIG_LIB@
@@ -1191,6 +1189,7 @@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TCPPORTRANGE = @TCPPORTRANGE@
 TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
 UDPPORTRANGE = @UDPPORTRANGE@
+UMOUNT = @UMOUNT@
 UNCOMPRESS_OPT = @UNCOMPRESS_OPT@
 UNCOMPRESS_PATH = @UNCOMPRESS_PATH@
 UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
@@ -1338,11 +1337,11 @@ INCLUDES = -I$(top_builddir)/common-src \
                -I$(top_srcdir)/gnulib
 
 AM_CFLAGS = $(AMANDA_WARNING_CFLAGS)
-AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
+AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS) $(AS_NEEDED_FLAGS)
 LINT = $(AMLINT)
 LINTFLAGS = $(AMLINTFLAGS)
 amlib_LTLIBRARIES = libamserver.la
-amlibexec_SCRIPTS_PERL = amlogroll taper amcheck-device \
+amlibexec_SCRIPTS_PERL = amlogroll amdumpd taper amcheck-device \
        $(am__append_2)
 sbin_SCRIPTS_PERL = amaddclient amoverview amserverconfig amtoc \
        amcheckdump amcleanup amrmtape amlabel amreport amtape amvault \
@@ -1356,7 +1355,7 @@ sbin_SCRIPTS = $(sbin_SCRIPTS_PERL) $(sbin_SCRIPTS_SHELL)
 amlibexec_SCRIPTS = $(amlibexec_SCRIPTS_PERL) $(amlibexec_SCRIPTS_SHELL)
 INSTALLPERMS_exec = \
        dest=$(sbindir) chown=root:setuid chmod=04750 \
-               amcheck amservice \
+               amcheck \
        dest=$(amlibexecdir) \
                dumper planner
 
@@ -1378,7 +1377,7 @@ libamserver_la_SOURCES = amindex.c        \
                        tapefile.c      find.c          server_util.c   \
                         xfer-source-holding.c
 
-libamserver_la_LDFLAGS = -release $(VERSION)
+libamserver_la_LDFLAGS = -release $(VERSION) $(AS_NEEDED_FLAGS)
 libamserver_la_LIBADD = ../device-src/libamdevice.la \
                       ../common-src/libamanda.la
 
@@ -1567,9 +1566,6 @@ amflush$(EXEEXT): $(amflush_OBJECTS) $(amflush_DEPENDENCIES)
 amindexd$(EXEEXT): $(amindexd_OBJECTS) $(amindexd_DEPENDENCIES) 
        @rm -f amindexd$(EXEEXT)
        $(LINK) $(amindexd_OBJECTS) $(amindexd_LDADD) $(LIBS)
-amservice$(EXEEXT): $(amservice_OBJECTS) $(amservice_DEPENDENCIES) 
-       @rm -f amservice$(EXEEXT)
-       $(LINK) $(amservice_OBJECTS) $(amservice_LDADD) $(LIBS)
 amtrmidx$(EXEEXT): $(amtrmidx_OBJECTS) $(amtrmidx_DEPENDENCIES) 
        @rm -f amtrmidx$(EXEEXT)
        $(LINK) $(amtrmidx_OBJECTS) $(amtrmidx_LDADD) $(LIBS)
@@ -1675,7 +1671,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amflush.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amindex.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amindexd.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amservice.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amtrmidx.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amtrmlog.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chunker.Po@am__quote@
index 25df522d5eee3941117004f5a60ad6f7ceadcb71..8c62d0ecd27b8fe34a1951fe83c1d08779a458dc 100755 (executable)
@@ -341,7 +341,7 @@ unless ( defined $dumptype ) {
     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 $mkdir="mkdir -p";
     my $client_conf_dir="$confdir/$config";
     my $amanda_client_conf="$client_conf_dir/amanda-client.conf";
     my $file="$amandahomedir/.amandahosts";
index 7930e0bd2dc86cef8d9d700e758530d47db522dc..216f46ad43f22aa45a343bac8b47205e2b89f887 100644 (file)
@@ -1183,14 +1183,6 @@ find(
                afind->next = new_output_find;
                new_output_find = afind;
            } else {
-               amfree(afind->timestamp);
-               amfree(afind->write_timestamp);
-               amfree(afind->hostname);
-               amfree(afind->diskname);
-               amfree(afind->label);
-               amfree(afind->status);
-               amfree(afind->dump_status);
-               amfree(afind->message);
                amfree(afind);
            }
        }
@@ -1644,13 +1636,16 @@ export_one(
 {
     info_t info;
     int i,l;
+    char *qhost, *qdisk;
 
     if(get_info(dp->host->hostname, dp->name, &info)) {
        g_fprintf(stderr, _("Warning: no curinfo record for %s:%s\n"),
                dp->host->hostname, dp->name);
        return;
     }
-    g_printf(_("host: %s\ndisk: %s\n"), dp->host->hostname, dp->name);
+    qhost = quote_string(dp->host->hostname);
+    qdisk = quote_string(dp->name);
+    g_printf(_("host: %s\ndisk: %s\n"), qhost, qdisk);
     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);
@@ -1682,6 +1677,8 @@ export_one(
               (intmax_t)info.history[l].date);
     }
     g_printf("//\n");
+    amfree(qhost);
+    amfree(qdisk);
 }
 
 /* ----------------------------------------------- */
@@ -1828,9 +1825,9 @@ import_one(void)
     skip_whitespace(s, ch);
     if(ch == '\0') goto parse_err;
     fp = s-1;
-    skip_non_whitespace(s, ch);
+    skip_quoted_string(s, ch);
     s[-1] = '\0';
-    hostname = stralloc(fp);
+    hostname = unquote_string(fp);
     s[-1] = (char)ch;
 
     skip_whitespace(s, ch);
@@ -1845,9 +1842,9 @@ import_one(void)
     skip_whitespace(s, ch);
     if(ch == '\0') goto parse_err;
     fp = s-1;
-    skip_non_whitespace(s, ch);
+    skip_quoted_string(s, ch);
     s[-1] = '\0';
-    diskname = stralloc(fp);
+    diskname = unquote_string(fp);
     s[-1] = (char)ch;
 
     amfree(line);
@@ -2296,6 +2293,15 @@ disklist_one(
        free(*r1);
        }
     }
+    if (dumptype_seen(dtype, DUMPTYPE_DUMP_LIMIT)) {
+       char **rl, **r1;
+       rl = val_t_display_strs(dumptype_getconf((dtype),
+                               DUMPTYPE_DUMP_LIMIT), 1);
+       for(r1 = rl; *r1 != NULL; r1++) {
+           g_printf("        dump-limit %s\n", *r1);
+       free(*r1);
+       }
+    }
     g_printf("        spindle %d\n", dp->spindle);
     pp_scriptlist = dp->pp_scriptlist;
     while (pp_scriptlist != NULL) {
index d9689cb9ad8ae55966b8b1fbf1a805dd0c79009b..a27d006148ba4e4880dd787f20bb3995c01cd55b 100644 (file)
@@ -29,6 +29,7 @@ use Amanda::Device qw( :constants );
 use Amanda::MainLoop;
 use Amanda::Changer;
 use Amanda::Taper::Scan;
+use Amanda::Interactivity;
 use Getopt::Long;
 
 Amanda::Util::setup_application("amcheck-device", "server", $CONTEXT_CMDLINE);
@@ -141,16 +142,23 @@ sub failure {
 sub do_check {
     my ($finished_cb) = @_;
     my ($res, $label, $mode);
+    my $tlf = Amanda::Config::config_dir_relative(getconf($CNF_TAPELIST));
+    my $tl = Amanda::Tapelist->new($tlf);
+    my $chg = Amanda::Changer->new(undef, tapelist => $tl);
+    return failure($chg, $finished_cb) if ($chg->isa("Amanda::Changer::Error"));
+    my $interactivity = Amanda::Interactivity->new(
+                                       name => getconf($CNF_INTERACTIVITY));
+    my $scan_name = getconf($CNF_TAPERSCAN);
+    my $taperscan = Amanda::Taper::Scan->new(algorithm => $scan_name,
+                                            changer => $chg,
+                                            interactivity => $interactivity,
+                                            tapelist => $tl);
 
     my $steps = define_steps
-       cb_ref => \$finished_cb;
+       cb_ref => \$finished_cb,
+       finalize => sub { $taperscan->quit(); };
 
     step start => sub {
-       my $chg = Amanda::Changer->new();
-
-       return failure($chg, $finished_cb) if ($chg->isa("Amanda::Changer::Error"));
-
-       my $taperscan = Amanda::Taper::Scan->new(changer => $chg);
        $taperscan->scan(
            result_cb => $steps->{'result_cb'},
            user_msg_fn => \&_user_msg_fn
@@ -161,15 +169,6 @@ sub do_check {
        (my $err, $res, $label, $mode) = @_;
        return failure($err, $finished_cb) if $err;
 
-       if (defined $res->{'device'}->volume_label()) {
-           $res->set_label(label => $res->{'device'}->volume_label(),
-                           finished_cb => $steps->{'set_labeled'});
-       } else {
-           $steps->{'set_labeled'}->(undef);
-       };
-    };
-
-    step set_labeled => sub {
        my $modestr = ($mode == $ACCESS_APPEND)? "append" : "write";
        my $slot = $res->{'this_slot'};
        if (defined $res->{'device'}->volume_label()) {
index 2c843a9b46b0955efc8e9ebe28c328ec965d1c04..3acb9919fa04b97aa54e1350ab73f369fb34ad71 100644 (file)
@@ -748,8 +748,8 @@ start_server_check(
        }
 
        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_no_yes_all(CNF_AUTOFLUSH)) {
+           g_fprintf(outf, _("WARNING: autoflush must be set to 'yes' or 'all' if taperflush (%d) is greater that 0.\n"),
                      getconf_int(CNF_TAPERFLUSH));
        }
 
@@ -1928,6 +1928,13 @@ start_host(
                            g_fprintf(outf,
                              _("ERROR: application '%s' not found.\n"), dp->application);
                        } else {
+                           char *client_name = application_get_client_name(application);
+                           if (client_name && strlen(client_name) > 0 &&
+                               !am_has_feature(hostp->features, fe_application_client_name)) {
+                               g_fprintf(outf,
+                             _("WARNING: %s:%s does not support client-name in application.\n"),
+                             hostp->hostname, qname);
+                           }
                            xml_app = xml_application(dp, application, hostp->features);
                            vstrextend(&l, xml_app, NULL);
                            amfree(xml_app);
@@ -1938,6 +1945,19 @@ start_host(
                            g_fprintf(outf,
                              _("ERROR: %s:%s does not support SCRIPT-API.\n"),
                              hostp->hostname, qname);
+                       } else {
+                           identlist_t pp_scriptlist;
+                           for (pp_scriptlist = dp->pp_scriptlist; pp_scriptlist != NULL;
+                               pp_scriptlist = pp_scriptlist->next) {
+                               pp_script_t *pp_script = lookup_pp_script((char *)pp_scriptlist->data);
+                               char *client_name = pp_script_get_client_name(pp_script);;
+                               if (client_name && strlen(client_name) > 0 &&
+                                   !am_has_feature(hostp->features, fe_script_client_name)) {
+                                   g_fprintf(outf,
+                                       _("WARNING: %s:%s does not support client-name in script.\n"),
+                                       hostp->hostname, dp->name);
+                               }
+                           }
                        }
                    }
                    es = xml_estimate(dp->estimatelist, hostp->features);
@@ -2035,6 +2055,7 @@ start_client_checks(
     g_fprintf(outf, _("\nAmanda Backup Client Hosts Check\n"));
     g_fprintf(outf,   "--------------------------------\n");
 
+    run_server_global_scripts(EXECUTE_ON_PRE_AMCHECK, get_config_name());
     protocol_init();
 
     hostcount = remote_errors = 0;
@@ -2042,12 +2063,10 @@ start_client_checks(
     for(dp = origq.head; dp != NULL; dp = dp->next) {
        hostp = dp->host;
        if(hostp->up == HOST_READY && dp->todo == 1) {
+           run_server_host_scripts(EXECUTE_ON_PRE_HOST_AMCHECK,
+                                   get_config_name(), hostp);
            for(dp1 = hostp->disks; dp1 != NULL; dp1 = dp1->hostnext) {
-               run_server_scripts(EXECUTE_ON_PRE_HOST_AMCHECK,
-                                  get_config_name(), dp1, -1);
-           }
-           for(dp1 = hostp->disks; dp1 != NULL; dp1 = dp1->hostnext) {
-               run_server_scripts(EXECUTE_ON_PRE_DLE_AMCHECK,
+               run_server_dle_scripts(EXECUTE_ON_PRE_DLE_AMCHECK,
                                   get_config_name(), dp1, -1);
            }
            start_host(hostp);
@@ -2057,6 +2076,7 @@ start_client_checks(
     }
 
     protocol_run();
+    run_server_global_scripts(EXECUTE_ON_POST_AMCHECK, get_config_name());
 
     g_fprintf(outf, plural(_("Client check: %d host checked in %s seconds."), 
                         _("Client check: %d hosts checked in %s seconds."),
@@ -2182,13 +2202,11 @@ handle_result(
     if(hostp->up == HOST_DONE) {
        security_close_connection(sech, hostp->hostname);
        for(dp = hostp->disks; dp != NULL; dp = dp->hostnext) {
-           run_server_scripts(EXECUTE_ON_POST_DLE_AMCHECK,
-                              get_config_name(), dp, -1);
-       }
-       for(dp = hostp->disks; dp != NULL; dp = dp->hostnext) {
-           run_server_scripts(EXECUTE_ON_POST_HOST_AMCHECK,
+           run_server_dle_scripts(EXECUTE_ON_POST_DLE_AMCHECK,
                               get_config_name(), dp, -1);
        }
+       run_server_host_scripts(EXECUTE_ON_POST_HOST_AMCHECK,
+                               get_config_name(), hostp);
     }
     /* try to clean up any defunct processes, since Amanda doesn't wait() for
        them explicitly */
index 95c7fa3426f00ac5b3dfaf20eda15562fb65d163..d8042bc9294d0f62df571419fb4fea096c6f0c6c 100644 (file)
@@ -95,12 +95,12 @@ if ($cfgerr_level >= $CFGERR_WARNINGS) {
 
 Amanda::Util::finish_setup($RUNNING_AS_DUMPUSER);
 
-# Interactive package
-package Amanda::Interactive::amcheckdump;
+# Interactivity package
+package Amanda::Interactivity::amcheckdump;
 use POSIX qw( :errno_h );
 use Amanda::MainLoop qw( :GIOCondition );
 use vars qw( @ISA );
-@ISA = qw( Amanda::Interactive );
+@ISA = qw( Amanda::Interactivity );
 
 sub new {
     my $class = shift;
@@ -135,12 +135,12 @@ sub user_request {
        if (!defined $n_read) {
            return if ($! == EINTR);
            $self->abort();
-           return $params{'finished_cb'}->(
+           return $params{'request_cb'}->(
                Amanda::Changer::Error->new('fatal',
                        message => "Fail to read from stdin"));
        } elsif ($n_read == 0) {
            $self->abort();
-           return $params{'finished_cb'}->(
+           return $params{'request_cb'}->(
                Amanda::Changer::Error->new('fatal',
                        message => "Aborted by user"));
        } else {
@@ -150,7 +150,7 @@ sub user_request {
                chomp $line;
                $buffer = "";
                $self->abort();
-               return $params{'finished_cb'}->(undef, $line);
+               return $params{'request_cb'}->(undef, $line);
            }
        }
     };
@@ -196,6 +196,8 @@ sub clerk_notif_holding {
 
 package main;
 
+use Amanda::MainLoop qw( :GIOCondition );
+
 # Given a dumpfile_t, figure out the command line to validate, specified
 # as an argv array
 sub find_validation_command {
@@ -249,16 +251,20 @@ sub main {
 
     my $tapelist;
     my $chg;
-    my $interactive;
+    my $interactivity;
     my $scan;
     my $clerk;
     my $plan;
     my $timestamp;
     my $all_success = 1;
     my @xfer_errs;
+    my %all_filter;
+    my $check_done;
 
     my $steps = define_steps
-       cb_ref => \$finished_cb;
+       cb_ref => \$finished_cb,
+       finalize => sub { $scan->quit() if defined $scan;
+                         $chg->quit() if defined $chg    };
 
     step start => sub {
        # set up the tapelist
@@ -271,17 +277,17 @@ sub main {
            unless defined $opt_timestamp;
 
        # make an interactivity plugin
-       $interactive = Amanda::Interactive::amcheckdump->new();
+       $interactivity = Amanda::Interactivity::amcheckdump->new();
 
        # make a changer
-       $chg = Amanda::Changer->new();
+       $chg = Amanda::Changer->new(undef, tapelist => $tapelist);
        return $steps->{'quit'}->($chg)
            if $chg->isa("Amanda::Changer::Error");
 
        # make a scan
        $scan = Amanda::Recovery::Scan->new(
                            chg => $chg,
-                           interactive => $interactive);
+                           interactivity => $interactivity);
        return $steps->{'quit'}->($scan)
            if $scan->isa("Amanda::Changer::Error");
 
@@ -357,11 +363,11 @@ sub main {
            if ($hdr->{'srv_encrypt'}) {
                push @filters,
                    Amanda::Xfer::Filter::Process->new(
-                       [ $hdr->{'srv_encrypt'}, $hdr->{'srv_decrypt_opt'} ], 0, 0);
+                       [ $hdr->{'srv_encrypt'}, $hdr->{'srv_decrypt_opt'} ], 0);
            } elsif ($hdr->{'clnt_encrypt'}) {
                push @filters,
                    Amanda::Xfer::Filter::Process->new(
-                       [ $hdr->{'clnt_encrypt'}, $hdr->{'clnt_decrypt_opt'} ], 0, 0);
+                       [ $hdr->{'clnt_encrypt'}, $hdr->{'clnt_decrypt_opt'} ], 0);
            } else {
                return failure("could not decrypt encrypted dump: no program specified",
                            $finished_cb);
@@ -382,17 +388,17 @@ sub main {
                # TODO: this assumes that srvcompprog takes "-d" to decrypt
                push @filters,
                    Amanda::Xfer::Filter::Process->new(
-                       [ $hdr->{'srvcompprog'}, "-d" ], 0, 0);
+                       [ $hdr->{'srvcompprog'}, "-d" ], 0);
            } elsif ($hdr->{'clntcompprog'}) {
                # TODO: this assumes that clntcompprog takes "-d" to decrypt
                push @filters,
                    Amanda::Xfer::Filter::Process->new(
-                       [ $hdr->{'clntcompprog'}, "-d" ], 0, 0);
+                       [ $hdr->{'clntcompprog'}, "-d" ], 0);
            } else {
                push @filters,
                    Amanda::Xfer::Filter::Process->new(
                        [ $Amanda::Constants::UNCOMPRESS_PATH,
-                         $Amanda::Constants::UNCOMPRESS_OPT ], 0, 0);
+                         $Amanda::Constants::UNCOMPRESS_OPT ], 0);
            }
 
            # adjust the header
@@ -404,12 +410,46 @@ sub main {
        # we need to throw out its stdout
        my $argv = find_validation_command($hdr);
        if (defined $argv) {
-           push @filters, Amanda::Xfer::Filter::Process->new($argv, 0, 0);
+           push @filters, Amanda::Xfer::Filter::Process->new($argv, 0);
        }
 
        # we always throw out stdout
        my $xfer_dest = Amanda::Xfer::Dest::Null->new(0);
 
+       # start reading all filter stderr
+       foreach my $filter (@filters) {
+           my $fd = $filter->get_stderr_fd();
+           $fd.="";
+           $fd = int($fd);
+           my $src = Amanda::MainLoop::fd_source($fd,
+                                                 $G_IO_IN|$G_IO_HUP|$G_IO_ERR);
+           my $buffer = "";
+           $all_filter{$src} = 1;
+           $src->set_callback( sub {
+               my $b;
+               my $n_read = POSIX::read($fd, $b, 1);
+               if (!defined $n_read) {
+                   return;
+               } elsif ($n_read == 0) {
+                   delete $all_filter{$src};
+                   $src->remove();
+                   POSIX::close($fd);
+                   if (!%all_filter and $check_done) {
+                       $finished_cb->();
+                   }
+               } else {
+                   $buffer .= $b;
+                   if ($b eq "\n") {
+                       my $line = $buffer;
+                       print STDERR "filter stderr: $line";
+                       chomp $line;
+                       debug("filter stderr: $line");
+                       $buffer = "";
+                   }
+               }
+           });
+       }
+
        my $xfer = Amanda::Xfer->new([ $xfer_src, @filters, $xfer_dest ]);
        $xfer->start($steps->{'handle_xmsg'});
        $clerk->start_recovery(
@@ -458,7 +498,8 @@ sub main {
        if ($err) {
            $exit_code = 1;
            print STDERR $err, "\n";
-           return $clerk->quit(finished_cb => $finished_cb);
+           return $clerk->quit(finished_cb => $steps->{'quit1'}) if defined $clerk;;
+           return $steps->{'quit1'}->();
        }
 
        if ($all_success) {
@@ -468,8 +509,16 @@ sub main {
            $exit_code = 1;
        }
 
-       return $clerk->quit(finished_cb => $finished_cb);
+       return $clerk->quit(finished_cb => $steps->{'quit1'});
     };
+
+    step quit1 => sub {
+       $check_done = 1;
+
+       if (!%all_filter) {
+           $finished_cb->();
+       }
+    }
 }
 
 main(sub { Amanda::MainLoop::quit(); });
index 4caf7182bdcc8dece102e8b454df86de7b874e9f..a86df00f0b8b9a157854eff4fa0b8f2feb529f9d 100644 (file)
@@ -36,7 +36,7 @@ use Amanda::Paths;
 sub usage {
     my ($msg) = @_;
     print STDERR <<EOF;
-Usage: amdump <conf> [--no-taper] [-o configoption]* [host/disk]*
+Usage: amdump <conf> [--no-taper] [--from-client] [-o configoption]* [host/disk]*
 EOF
     print STDERR "$msg\n" if $msg;
     exit 1;
@@ -48,10 +48,12 @@ my $config_overrides = new_config_overrides($#ARGV+1);
 my @config_overrides_opts;
 
 my $opt_no_taper = 0;
+my $opt_from_client = 0;
 Getopt::Long::Configure(qw(bundling));
 GetOptions(
     'help|usage|?' => \&usage,
     'no-taper' => \$opt_no_taper,
+    'from-client' => \$opt_from_client,
     'o=s' => sub {
        push @config_overrides_opts, "-o" . $_[1];
        add_config_override_opt($config_overrides, $_[1]);
@@ -201,6 +203,7 @@ sub planner_driver_pipeline {
     my $planner = "$amlibexecdir/planner";
     my $driver = "$amlibexecdir/driver";
     my @no_taper = $opt_no_taper? ('--no-taper'):();
+    my @from_client = $opt_from_client? ('--from-client'):();
 
     check_exec($planner);
     check_exec($driver);
@@ -222,7 +225,7 @@ sub planner_driver_pipeline {
        close($amdump_log);
        exec $planner,
            # note that @no_taper must follow --starttime
-           $config_name, '--starttime', $timestamp, @no_taper, @config_overrides_opts, @hostdisk;
+           $config_name, '--starttime', $timestamp, @no_taper, @from_client, @config_overrides_opts, @hostdisk;
        die "Could not exec $planner: $!";
     }
     debug(" planner: $pl_pid");
@@ -239,7 +242,7 @@ sub planner_driver_pipeline {
        POSIX::dup2(fileno($amdump_log), 2);
        close($amdump_log);
        exec $driver,
-           $config_name, @no_taper, @config_overrides_opts;
+           $config_name, @no_taper, @from_client, @config_overrides_opts;
        die "Could not exec $driver: $!";
     }
     debug(" driver: $dr_pid");
@@ -305,6 +308,13 @@ wait_for_hold();
 # bail out
 do_amcleanup();
 
+my $crtl_c = 0;
+$SIG{INT} = \&interrupt;
+
+sub interrupt {
+    $crtl_c = 1;
+}
+
 # start up the log file
 start_logfiles();
 
@@ -317,6 +327,14 @@ amdump_log("starttime-locale-independent $starttime_locale_independent");
 # run the planner and driver, the one piped to the other
 planner_driver_pipeline();
 
+if ($crtl_c == 1) {
+    print "Caught a ctrl-c\n";
+    log_add($L_FATAL, "amdump killed by ctrl-c");
+    debug("Caught a ctrl-c");
+    $exit_code = 1;
+}
+$SIG{INT} = 'DEFAULT';
+
 my $end_longdate = strftime "%a %b %e %H:%M:%S %Z %Y", localtime;
 amdump_log("end at $end_longdate");
 
diff --git a/server-src/amdumpd.pl b/server-src/amdumpd.pl
new file mode 100644 (file)
index 0000000..ef9729c
--- /dev/null
@@ -0,0 +1,399 @@
+#! @PERL@
+# Copyright (c) 2010 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., 465 S. Mathilda Ave., Suite 300
+# Sunnyvale, CA 94086, USA, or: http://www.zmanda.com
+
+use lib '@amperldir@';
+use strict;
+use warnings;
+
+use Data::Dumper;
+
+##
+# ClientService class
+
+package main::ClientService;
+use base 'Amanda::ClientService';
+
+use Symbol;
+use IPC::Open3;
+
+use Amanda::Debug qw( debug info warning );
+use Amanda::Util qw( :constants );
+use Amanda::Feature;
+use Amanda::Config qw( :init :getconf config_dir_relative );
+use Amanda::Cmdline;
+use Amanda::Paths;
+use Amanda::Disklist;
+use Amanda::Logfile qw( match_disk match_host );
+
+# Note that this class performs its control IO synchronously.  This is adequate
+# for this service, as it never receives unsolicited input from the remote
+# system.
+
+sub run {
+    my $self = shift;
+
+    $self->{'my_features'} = Amanda::Feature::Set->mine();
+    $self->{'their_features'} = Amanda::Feature::Set->old();
+
+    $self->setup_streams();
+}
+
+sub setup_streams {
+    my $self = shift;
+
+    # always started from amandad.
+    my $req = $self->get_req();
+
+    # make some sanity checks
+    my $errors = [];
+    if (defined $req->{'options'}{'auth'} and defined $self->amandad_auth()
+           and $req->{'options'}{'auth'} ne $self->amandad_auth()) {
+       my $reqauth = $req->{'options'}{'auth'};
+       my $amauth = $self->amandad_auth();
+       push @$errors, "recover program requested auth '$reqauth', " .
+                      "but amandad is using auth '$amauth'";
+       $main::exit_status = 1;
+    }
+
+    # and pull out the features, if given
+    if (defined($req->{'features'})) {
+       $self->{'their_features'} = $req->{'features'};
+    }
+
+    $self->send_rep(['CTL' => 'rw'], $errors);
+    return $self->quit() if (@$errors);
+
+    $self->{'ctl_stream'} = 'CTL';
+
+    $self->read_command();
+}
+
+sub cmd_config {
+    my $self = shift;
+
+    if (defined $self->{'config'}) {
+       $self->sendctlline("ERROR duplicate CONFIG command");
+       $self->{'abort'} = 1;
+       return;
+    }
+    my $config = $1;
+    config_init($CONFIG_INIT_EXPLICIT_NAME, $config);
+    my ($cfgerr_level, @cfgerr_errors) = config_errors();
+    if ($cfgerr_level >= $CFGERR_ERRORS) {
+       $self->sendctlline("ERROR configuration errors; aborting connection");
+       $self->{'abort'} = 1;
+       return;
+    }
+    Amanda::Util::finish_setup($RUNNING_AS_DUMPUSER_PREFERRED);
+
+    # and the disklist
+    my $diskfile = Amanda::Config::config_dir_relative(getconf($CNF_DISKFILE));
+    $cfgerr_level = Amanda::Disklist::read_disklist('filename' => $diskfile);
+    if ($cfgerr_level >= $CFGERR_ERRORS) {
+       $self->sendctlline("ERROR Errors processing disklist");
+       $self->{'abort'} = 1;
+       return;
+    }
+    $self->{'config'} = $config;
+    $self->check_host();
+}
+
+sub cmd_features {
+    my $self = shift;
+    my $features;
+
+    $self->{'their_features'} = Amanda::Feature::Set->from_string($features);
+    my $featreply;
+    my $featurestr = $self->{'my_features'}->as_string();
+    $featreply = "FEATURES $featurestr";
+
+    $self->sendctlline($featreply);
+}
+
+sub cmd_list {
+    my $self = shift;
+
+    if (!defined $self->{'config'}) {
+       $self->sendctlline("CONFIG must be set before listing the disk");
+       return;
+    }
+
+    for my $disk (@{$self->{'host'}->{'disks'}}) {
+       $self->sendctlline(Amanda::Util::quote_string($disk));
+    }
+    $self->sendctlline("ENDLIST");
+}
+
+sub cmd_disk {
+    my $self = shift;
+    my $qdiskname = shift;
+    my $diskname = Amanda::Util::unquote_string($qdiskname);
+    if (!defined $self->{'config'}) {
+       $self->sendctlline("CONFIG must be set before setting the disk");
+       return;
+    }
+
+    for my $disk (@{$self->{'host'}->{'disks'}}) {
+       if ($disk eq $diskname) {
+           push @{$self->{'disk'}}, $diskname;
+           $self->sendctlline("DISK $diskname added");
+           last;
+       }
+    }
+}
+
+sub cmd_dump {
+    my $self = shift;
+
+    if (!defined $self->{'config'}) {
+       $self->sendctlline("CONFIG must be set before doing a backup");
+       return;
+    }
+
+    my $logdir = config_dir_relative(getconf($CNF_LOGDIR));
+    if (-f "$logdir/log" || -f "$logdir/amdump" || -f "$logdir/amflush") {
+       $self->sendctlline("BUSY Amanda is busy, retry later");
+       return;
+    }
+
+    $self->sendctlline("DUMPING");
+    my @command = ("$sbindir/amdump", "--no-taper", "--from-client", $self->{'config'}, $self->{'host'}->{'hostname'});
+    if (defined $self->{'disk'}) {
+       @command = (@command, @{$self->{'disk'}});
+    }
+
+    debug("command: @command");
+    my $amdump_out;
+    my $amdump_in;
+    my $pid = open3($amdump_in, $amdump_out, $amdump_out, @command);
+    close($amdump_in);
+    while (<$amdump_out>) {
+       chomp;
+       $self->sendctlline($_);
+    }
+    $self->sendctlline("ENDDUMP");
+}
+
+sub cmd_check {
+    my $self = shift;
+
+    if (!defined $self->{'config'}) {
+       $self->sendctlline("CONFIG must be set before doing a backup");
+       return;
+    }
+
+    my $logdir = config_dir_relative(getconf($CNF_LOGDIR));
+    if (-f "$logdir/log" || -f "$logdir/amdump" || -f "$logdir/amflush") {
+       $self->sendctlline("BUSY Amanda is busy, retry later");
+       return;
+    }
+
+    $self->sendctlline("CHECKING");
+    my @command = ("$sbindir/amcheck", "-c", $self->{'config'}, $self->{'host'}->{'hostname'});
+    if (defined $self->{'disk'}) {
+       @command = (@command, @{$self->{'disk'}});
+    }
+
+    debug("command: @command");
+    my $amcheck_out;
+    my $amcheck_in;
+    my $pid = open3($amcheck_in, $amcheck_out, $amcheck_out, @command);
+    close($amcheck_in);
+    while (<$amcheck_out>) {
+       chomp;
+       $self->sendctlline($_);
+    }
+    $self->sendctlline("ENDCHECK");
+}
+
+sub read_command {
+    my $self = shift;
+    my $ctl_stream = $self->{'ctl_stream'};
+    my $command = $self->{'command'} = {};
+
+    my @known_commands = qw(
+       CONFIG DUMP FEATURES LIST DISK);
+    while (!$self->{'abort'} and ($_ = $self->getline($ctl_stream))) {
+       $_ =~ s/\r?\n$//g;
+
+       last if /^END$/;
+       last if /^[0-9]+$/;
+
+       if (/^CONFIG (.*)$/) {
+           $self->cmd_config($1);
+       } elsif (/^FEATURES (.*)$/) {
+           $self->cmd_features($1);
+       } elsif (/^LIST$/) {
+           $self->cmd_list();
+       } elsif (/^DISK (.*)$/) {
+           $self->cmd_disk($1);
+       } elsif (/^CHECK$/) {
+           $self->cmd_check();
+       } elsif (/^DUMP$/) {
+           $self->cmd_dump();
+       } elsif (/^END$/) {
+           $self->{'abort'} = 1;
+       } else {
+           $self->sendctlline("invalid command '$_'");
+       }
+    }
+}
+
+sub check_host {
+    my $self = shift;
+
+    my @hosts = Amanda::Disklist::all_hosts();
+    my $peer = $ENV{'AMANDA_AUTHENTICATED_PEER'};
+
+    if (!defined($peer)) {
+       debug("no authenticated peer name is available; rejecting request.");
+       $self->sendctlline("no authenticated peer name is available; rejecting request.");
+       die();
+    }
+
+    # try to find the host that match the connection
+    my $matched = 0;
+    for my $host (@hosts) {
+       if (lc($peer) eq lc($host->{'hostname'})) {
+           $matched = 1;
+           $self->{'host'} = $host;
+           last;
+       }
+    }
+
+    if (!$matched) {
+       debug("The peer host '$peer' doesn't match a host in the disklist.");
+       $self->sendctlline("The peer host '$peer' doesn't match a host in the disklist.");
+       $self->{'abort'} = 1;
+    }
+}
+
+sub get_req {
+    my $self = shift;
+
+    my $req_str = '';
+    while (1) {
+       my $buf = Amanda::Util::full_read($self->rfd('main'), 1024);
+       last unless $buf;
+       $req_str .= $buf;
+    }
+    # we've read main to EOF, so close it
+    $self->close('main', 'r');
+
+    return $self->{'req'} = $self->parse_req($req_str);
+}
+
+sub send_rep {
+    my $self = shift;
+    my ($streams, $errors) = @_;
+    my $rep = '';
+
+    # first, if there were errors in the REQ, report them
+    if (@$errors) {
+       for my $err (@$errors) {
+           $rep .= "ERROR $err\n";
+       }
+    } else {
+       my $connline = $self->connect_streams(@$streams);
+       $rep .= "$connline\n";
+    }
+    # rep needs a empty-line terminator, I think
+    $rep .= "\n";
+
+    # write the whole rep packet, and close main to signal the end of the packet
+    $self->senddata('main', $rep);
+    $self->close('main', 'w');
+}
+
+# helper function to get a line, including the trailing '\n', from a stream.  This
+# reads a character at a time to ensure that no extra characters are consumed.  This
+# could certainly be more efficient! (TODO)
+sub getline {
+    my $self = shift;
+    my ($stream) = @_;
+    my $fd = $self->rfd($stream);
+    my $line = undef;
+
+    while (1) {
+       my $c;
+       my $a = POSIX::read($fd, $c, 1);
+       last if $a != 1;
+       $line .= $c;
+       last if $c eq "\n";
+    }
+
+    if ($line) {
+       my $chopped = $line;
+       $chopped =~ s/[\r\n]*$//g;
+       debug("CTL << $chopped");
+    } else {
+       debug("CTL << EOF");
+    }
+
+    return $line;
+}
+
+# helper function to write a data to a stream.  This does not add newline characters.
+sub senddata {
+    my $self = shift;
+    my ($stream, $data) = @_;
+    my $fd = $self->wfd($stream);
+
+    Amanda::Util::full_write($fd, $data, length($data))
+           or die "writing to $stream: $!";
+}
+
+# send a line on the control stream, or just log it if the ctl stream is gone;
+# async callback is just like for senddata
+sub sendctlline {
+    my $self = shift;
+    my ($msg) = @_;
+
+    if ($self->{'ctl_stream'}) {
+       debug("CTL >> $msg");
+       return $self->senddata($self->{'ctl_stream'}, $msg . "\n");
+    } else {
+       debug("not sending CTL message as CTL is closed >> $msg");
+    }
+}
+
+##
+# main driver
+
+package main;
+use Amanda::Debug qw( debug );
+use Amanda::Util qw( :constants );
+use Amanda::Config qw( :init );
+
+our $exit_status = 0;
+
+sub main {
+    Amanda::Util::setup_application("amdumpd", "server", $CONTEXT_DAEMON);
+    config_init(0, undef);
+    Amanda::Debug::debug_dup_stderr_to_debug();
+
+    my $cs = main::ClientService->new();
+    $cs->run();
+
+    debug("exiting with $exit_status");
+    Amanda::Util::finish_application();
+}
+
+main();
+exit($exit_status);
index 3cf38a002a97ea1e5dfc184941dd29f4bae73877..1e8c21d23fc9cc956d88fd01e57c89ce25499ff7 100644 (file)
@@ -38,12 +38,12 @@ use Amanda::Recovery::Planner;
 use Amanda::Recovery::Clerk;
 use Amanda::Recovery::Scan;
 
-# Interactive package
-package Amanda::Interactive::amfetchdump;
+# Interactivity package
+package Amanda::Interactivity::amfetchdump;
 use POSIX qw( :errno_h );
 use Amanda::MainLoop qw( :GIOCondition );
 use vars qw( @ISA );
-@ISA = qw( Amanda::Interactive );
+@ISA = qw( Amanda::Interactivity );
 
 sub new {
     my $class = shift;
@@ -78,12 +78,12 @@ sub user_request {
        if (!defined $n_read) {
            return if ($! == EINTR);
            $self->abort();
-           return $params{'finished_cb'}->(
+           return $params{'request_cb'}->(
                Amanda::Changer::Error->new('fatal',
                        message => "Fail to read from stdin"));
        } elsif ($n_read == 0) {
            $self->abort();
-           return $params{'finished_cb'}->(
+           return $params{'request_cb'}->(
                Amanda::Changer::Error->new('fatal',
                        message => "Aborted by user"));
        } else {
@@ -93,7 +93,7 @@ sub user_request {
                chomp $line;
                $buffer = "";
                $self->abort();
-               return $params{'finished_cb'}->(undef, $line);
+               return $params{'request_cb'}->(undef, $line);
            }
        }
     };
@@ -229,11 +229,14 @@ sub clerk_notif_holding {
 
 package main;
 
+use Amanda::MainLoop qw( :GIOCondition );
 sub main {
     my ($finished_cb) = @_;
     my $current_dump;
     my $plan;
     my @xfer_errs;
+    my %all_filter;
+    my $fetch_done;
 
     my $steps = define_steps
        cb_ref => \$finished_cb;
@@ -248,7 +251,7 @@ sub main {
            return failure("Cannot chdir to $destdir: $!", $finished_cb);
        }
 
-       my $interactive = Amanda::Interactive::amfetchdump->new();
+       my $interactivity = Amanda::Interactivity::amfetchdump->new();
        # if we have an explicit device, then the clerk doesn't get a changer --
        # we operate the changer via Amanda::Recovery::Scan
        if (defined $opt_device) {
@@ -256,14 +259,14 @@ sub main {
            return failure($chg, $finished_cb) if $chg->isa("Amanda::Changer::Error");
            my $scan = Amanda::Recovery::Scan->new(
                                chg => $chg,
-                               interactive => $interactive);
+                               interactivity => $interactivity);
            return failure($scan, $finished_cb) if $scan->isa("Amanda::Changer::Error");
            $clerk = Amanda::Recovery::Clerk->new(
                feedback => main::Feedback->new($chg, $opt_device),
                scan     => $scan);
        } else {
            my $scan = Amanda::Recovery::Scan->new(
-                               interactive => $interactive);
+                               interactivity => $interactivity);
            return failure($scan, $finished_cb) if $scan->isa("Amanda::Changer::Error");
 
            $clerk = Amanda::Recovery::Clerk->new(
@@ -363,11 +366,11 @@ sub main {
            if ($hdr->{'srv_encrypt'}) {
                push @filters,
                    Amanda::Xfer::Filter::Process->new(
-                       [ $hdr->{'srv_encrypt'}, $hdr->{'srv_decrypt_opt'} ], 0, 0);
+                       [ $hdr->{'srv_encrypt'}, $hdr->{'srv_decrypt_opt'} ], 0);
            } elsif ($hdr->{'clnt_encrypt'}) {
                push @filters,
                    Amanda::Xfer::Filter::Process->new(
-                       [ $hdr->{'clnt_encrypt'}, $hdr->{'clnt_decrypt_opt'} ], 0, 0);
+                       [ $hdr->{'clnt_encrypt'}, $hdr->{'clnt_decrypt_opt'} ], 0);
            } else {
                return failure("could not decrypt encrypted dump: no program specified",
                            $finished_cb);
@@ -388,17 +391,17 @@ sub main {
                # TODO: this assumes that srvcompprog takes "-d" to decrypt
                push @filters,
                    Amanda::Xfer::Filter::Process->new(
-                       [ $hdr->{'srvcompprog'}, "-d" ], 0, 0);
+                       [ $hdr->{'srvcompprog'}, "-d" ], 0);
            } elsif ($hdr->{'clntcompprog'}) {
                # TODO: this assumes that clntcompprog takes "-d" to decrypt
                push @filters,
                    Amanda::Xfer::Filter::Process->new(
-                       [ $hdr->{'clntcompprog'}, "-d" ], 0, 0);
+                       [ $hdr->{'clntcompprog'}, "-d" ], 0);
            } else {
                push @filters,
                    Amanda::Xfer::Filter::Process->new(
                        [ $Amanda::Constants::UNCOMPRESS_PATH,
-                         $Amanda::Constants::UNCOMPRESS_OPT ], 0, 0);
+                         $Amanda::Constants::UNCOMPRESS_OPT ], 0);
            }
 
            # adjust the header
@@ -413,7 +416,7 @@ sub main {
            push @filters,
                Amanda::Xfer::Filter::Process->new(
                    [ $Amanda::Constants::COMPRESS_PATH,
-                     $compress_opt ], 0, 0);
+                     $compress_opt ], 0);
 
            # adjust the header
            $hdr->{'compressed'} = 1;
@@ -436,8 +439,42 @@ sub main {
            syswrite $hdr_fh, $hdr->to_string(32768, 32768), 32768;
        }
 
+       # start reading all filter stderr
+       foreach my $filter (@filters) {
+           my $fd = $filter->get_stderr_fd();
+           $fd.="";
+           $fd = int($fd);
+           my $src = Amanda::MainLoop::fd_source($fd,
+                                                $G_IO_IN|$G_IO_HUP|$G_IO_ERR);
+           my $buffer = "";
+           $all_filter{$src} = 1;
+           $src->set_callback( sub {
+               my $b;
+               my $n_read = POSIX::read($fd, $b, 1);
+               if (!defined $n_read) {
+                   return;
+               } elsif ($n_read == 0) {
+                   delete $all_filter{$src};
+                   $src->remove();
+                   POSIX::close($fd);
+                   if (!%all_filter and $fetch_done) {
+                       $finished_cb->();
+                   }
+               } else {
+                   $buffer .= $b;
+                   if ($b eq "\n") {
+                       my $line = $buffer;
+                       print STDERR "filter stderr: $line";
+                       chomp $line;
+                       debug("filter stderr: $line");
+                       $buffer = "";
+                   }
+               }
+           });
+       }
+
        my $xfer = Amanda::Xfer->new([ $xfer_src, @filters, $xfer_dest ]);
-       $xfer->start($steps->{'handle_xmsg'});
+       $xfer->start($steps->{'handle_xmsg'}, 0, $current_dump->{'bytes'});
        $clerk->start_recovery(
            xfer => $xfer,
            recovery_cb => $steps->{'recovery_cb'});
@@ -480,7 +517,11 @@ sub main {
 
        return failure($err, $finished_cb) if $err;
 
-       $finished_cb->();
+#do all filter are done reading stderr
+       $fetch_done = 1;
+        if (!%all_filter) {
+           $finished_cb->();
+       }
     };
 }
 
index a4f2672fc1c1f96dd215d80382d356534dd7d774..c156a000b52039ad9d38bc3c9788ca91f4583262 100644 (file)
@@ -22,10 +22,10 @@ use strict;
 use warnings;
 
 ##
-# Interactive class
+# Interactivity class
 
-package main::Interactive;
-use base 'Amanda::Interactive';
+package main::Interactivity;
+use base 'Amanda::Interactivity';
 use Amanda::Util qw( weaken_ref );
 use Amanda::MainLoop;
 use Amanda::Feature;
@@ -59,7 +59,7 @@ sub user_request {
     my $buffer = "";
 
     my $steps = define_steps
-       cb_ref => \$params{'finished_cb'};
+       cb_ref => \$params{'request_cb'};
 
     step send_message => sub {
        if ($params{'err'}) {
@@ -73,7 +73,7 @@ sub user_request {
        # note that fe_amrecover_FEEDME implies fe_amrecover_splits
        if (!$self->{'clientservice'}->{'their_features'}->has(
                                    $Amanda::Feature::fe_amrecover_FEEDME)) {
-           return $params{'finished_cb'}->("remote cannot prompt for volumes", undef);
+           return $params{'request_cb'}->("remote cannot prompt for volumes", undef);
        }
        $steps->{'send_feedme'}->();
     };
@@ -84,7 +84,7 @@ sub user_request {
 
     step read_response => sub {
        my ($err, $written) = @_;
-       return $params{'finished_cb'}->($err, undef) if $err;
+       return $params{'request_cb'}->($err, undef) if $err;
 
        $self->{'clientservice'}->getline_async(
                $self->{'clientservice'}->{'ctl_stream'}, $steps->{'got_response'});
@@ -92,18 +92,18 @@ sub user_request {
 
     step got_response => sub {
        my ($err, $line) = @_;
-       return $params{'finished_cb'}->($err, undef) if $err;
+       return $params{'request_cb'}->($err, undef) if $err;
 
        if ($line eq "OK\r\n") {
-           return $params{'finished_cb'}->(undef, undef); # carry on as you were
+           return $params{'request_cb'}->(undef, undef); # carry on as you were
        } elsif ($line =~ /^TAPE (.*)\r\n$/) {
            my $tape = $1;
            if ($tape eq getconf($CNF_AMRECOVER_CHANGER)) {
                $tape = $Amanda::Recovery::Scan::DEFAULT_CHANGER;
            }
-           return $params{'finished_cb'}->(undef, $tape); # use this device
+           return $params{'request_cb'}->(undef, $tape); # use this device
        } else {
-           return $params{'finished_cb'}->("got invalid response from remote", undef);
+           return $params{'request_cb'}->("got invalid response from remote", undef);
        }
     };
 };
@@ -114,7 +114,10 @@ sub user_request {
 package main::ClientService;
 use base 'Amanda::ClientService';
 
+use Sys::Hostname;
+
 use Amanda::Debug qw( debug info warning );
+use Amanda::MainLoop qw( :GIOCondition );
 use Amanda::Util qw( :constants );
 use Amanda::Feature;
 use Amanda::Config qw( :init :getconf );
@@ -138,6 +141,7 @@ sub run {
 
     $self->{'my_features'} = Amanda::Feature::Set->mine();
     $self->{'their_features'} = Amanda::Feature::Set->old();
+    $self->{'all_filter'} = {};
 
     $self->setup_streams();
 }
@@ -332,10 +336,12 @@ sub make_plan {
            $use_default = 1;
        }
 
+       my $tlf = Amanda::Config::config_dir_relative(getconf($CNF_TAPELIST));
+       my $tl = Amanda::Tapelist->new($tlf);
        if ($use_default) {
-           $chg = Amanda::Changer->new();
+           $chg = Amanda::Changer->new(undef, tapelist => $tl);
        } else {
-           $chg = Amanda::Changer->new($self->{'command'}{'DEVICE'});
+           $chg = Amanda::Changer->new($self->{'command'}{'DEVICE'}, tapelist => $tl);
        }
 
        # if we got a bogus changer, log it to the debug log, but allow the
@@ -345,11 +351,15 @@ sub make_plan {
            $chg = Amanda::Changer->new("chg-null:");
        }
     }
-    my $inter = main::Interactive->new(clientservice => $self);
+    $self->{'chg'} = $chg;
+
+    my $interactivity = main::Interactivity->new(clientservice => $self);
 
     my $scan = Amanda::Recovery::Scan->new(
                        chg => $chg,
-                       interactive => $inter);
+                       interactivity => $interactivity);
+    $self->{'scan'} = $scan;
+
     # XXX temporary
     $scan->{'scan_conf'}->{'driveinuse'} = Amanda::Recovery::Scan::SCAN_ASK;
     $scan->{'scan_conf'}->{'volinuse'} = Amanda::Recovery::Scan::SCAN_ASK;
@@ -436,12 +446,20 @@ sub plan_cb {
        }
        my $matched = 0;
        for my $rl (@$recovery_limit) {
-           if (!defined $rl) {
+           if ($rl eq $Amanda::Config::LIMIT_SAMEHOST) {
                # handle same-host with a case-insensitive string compare, not match_host
                if (lc($peer) eq lc($dump->{'hostname'})) {
                    $matched = 1;
                    last;
                }
+           } elsif ($rl eq $Amanda::Config::LIMIT_SERVER) {
+               # handle server with a case-insensitive string compare, not match_host
+               my $myhostname = hostname;
+               debug("myhostname: $myhostname");
+               if (lc($peer) eq lc($myhostname)) {
+                   $matched = 1;
+                   last;
+               }
            } else {
                # otherwise use match_host to allow match expressions
                if (match_host($rl, $peer)) {
@@ -468,8 +486,9 @@ sub plan_cb {
     }
 
     # now set up the transfer
+    $self->{'dump'} = $plan->{'dumps'}[0];
     $self->{'clerk'}->get_xfer_src(
-       dump => $plan->{'dumps'}[0],
+       dump => $self->{'dump'},
        xfer_src_cb => sub { $self->xfer_src_cb(@_); });
 }
 
@@ -496,48 +515,74 @@ sub xfer_src_cb {
        if ($header->{'srv_encrypt'}) {
            push @filters,
                Amanda::Xfer::Filter::Process->new(
-                   [ $header->{'srv_encrypt'}, $header->{'srv_decrypt_opt'} ], 0, 1);
+                   [ $header->{'srv_encrypt'}, $header->{'srv_decrypt_opt'} ], 0);
+           $header->{'encrypted'} = 0;
+           $header->{'srv_encrypt'} = '';
+           $header->{'srv_decrypt_opt'} = '';
+           $header->{'clnt_encrypt'} = '';
+           $header->{'clnt_decrypt_opt'} = '';
+           $header->{'encrypt_suffix'} = 'N';
        } elsif ($header->{'clnt_encrypt'}) {
-           push @filters,
-               Amanda::Xfer::Filter::Process->new(
-                   [ $header->{'clnt_encrypt'}, $header->{'clnt_decrypt_opt'} ], 0, 1);
+           if (!$self->{'their_features'}->has($Amanda::Feature::fe_amrecover_receive_unfiltered)) {
+               push @filters,
+                   Amanda::Xfer::Filter::Process->new(
+                       [ $header->{'clnt_encrypt'},
+                         $header->{'clnt_decrypt_opt'} ], 0);
+               $header->{'encrypted'} = 0;
+               $header->{'srv_encrypt'} = '';
+               $header->{'srv_decrypt_opt'} = '';
+               $header->{'clnt_encrypt'} = '';
+               $header->{'clnt_decrypt_opt'} = '';
+               $header->{'encrypt_suffix'} = 'N';
+           } else {
+               debug("Not decrypting client encrypted stream");
+           }
        } else {
            $self->sendmessage("could not decrypt encrypted dump: no program specified");
            return $self->quit();
        }
 
-       $header->{'encrypted'} = 0;
-       $header->{'srv_encrypt'} = '';
-       $header->{'srv_decrypt_opt'} = '';
-       $header->{'clnt_encrypt'} = '';
-       $header->{'clnt_decrypt_opt'} = '';
-       $header->{'encrypt_suffix'} = 'N';
     }
 
     if ($header->{'compressed'}) {
        # need to uncompress this file
        debug("..with decompression applied");
+       my $dle = $header->get_dle();
 
        if ($header->{'srvcompprog'}) {
            # TODO: this assumes that srvcompprog takes "-d" to decrypt
            push @filters,
                Amanda::Xfer::Filter::Process->new(
-                   [ $header->{'srvcompprog'}, "-d" ], 0, 1);
+                   [ $header->{'srvcompprog'}, "-d" ], 0);
+           # adjust the header
+           $header->{'compressed'} = 0;
+           $header->{'uncompress_cmd'} = '';
+           $header->{'srvcompprog'} = '';
        } elsif ($header->{'clntcompprog'}) {
-           # TODO: this assumes that clntcompprog takes "-d" to decrypt
-           push @filters,
-               Amanda::Xfer::Filter::Process->new(
-                   [ $header->{'clntcompprog'}, "-d" ], 0, 1);
+           if (!$self->{'their_features'}->has($Amanda::Feature::fe_amrecover_receive_unfiltered)) {
+               # TODO: this assumes that clntcompprog takes "-d" to decrypt
+               push @filters,
+                   Amanda::Xfer::Filter::Process->new(
+                       [ $header->{'clntcompprog'}, "-d" ], 0);
+               # adjust the header
+               $header->{'compressed'} = 0;
+               $header->{'uncompress_cmd'} = '';
+               $header->{'clntcompprog'} = '';
+           }
        } else {
-           push @filters,
-               Amanda::Xfer::Filter::Process->new(
-                   [ $Amanda::Constants::UNCOMPRESS_PATH,
-                     $Amanda::Constants::UNCOMPRESS_OPT ], 0, 1);
+           if (!$self->{'their_features'}->has($Amanda::Feature::fe_amrecover_receive_unfiltered) ||
+               $dle->{'compress'} == $Amanda::Config::COMP_SERVER_FAST ||
+               $dle->{'compress'} == $Amanda::Config::COMP_SERVER_BEST) {
+               push @filters,
+                   Amanda::Xfer::Filter::Process->new(
+                       [ $Amanda::Constants::UNCOMPRESS_PATH,
+                         $Amanda::Constants::UNCOMPRESS_OPT ], 0);
+               # adjust the header
+               $header->{'compressed'} = 0;
+               $header->{'uncompress_cmd'} = '';
+           }
        }
 
-       # adjust the header
-       $header->{'compressed'} = 0;
-       $header->{'uncompress_cmd'} = '';
     }
     $self->{'xfer_filters'} = [ @filters ];
 
@@ -627,13 +672,50 @@ sub start_xfer {
        }
     }
 
+    # start reading all filter stderr
+    foreach my $filter (@{$self->{'xfer_filters'}}) {
+       my $fd = $filter->get_stderr_fd();
+       $fd.="";
+       $fd = int($fd);
+       my $src = Amanda::MainLoop::fd_source($fd,
+                                             $G_IO_IN|$G_IO_HUP|$G_IO_ERR);
+       my $buffer = "";
+       $self->{'all_filter'}{$src} = 1;
+       $src->set_callback( sub {
+           my $b;
+           my $n_read = POSIX::read($fd, $b, 1);
+           if (!defined $n_read) {
+               return;
+           } elsif ($n_read == 0) {
+               delete $self->{'all_filter'}->{$src};
+               $src->remove();
+               POSIX::close($fd);
+               if (!%{$self->{'all_filter'}} and $self->{'fetch_done'}) {
+                   Amanda::MainLoop::quit();
+               }
+           } else {
+               $buffer .= $b;
+               if ($b eq "\n") {
+                   my $line = $buffer;
+                   #print STDERR "filter stderr: $line";
+                   chomp $line;
+                   $self->sendmessage("filter stderr: $line");
+                   debug("filter stderr: $line");
+                   $buffer = "";
+               }
+           }
+       });
+    }
+
     # create and start the transfer
     $self->{'xfer'} = Amanda::Xfer->new([
        $self->{'xfer_src'},
        @{$self->{'xfer_filters'}},
        $xfer_dest,
     ]);
-    $self->{'xfer'}->start(sub { $self->handle_xmsg(@_); });
+    my $size = 0;
+    $size = $self->{'dump'}->{'bytes'} if exists $self->{'dump'}->{'bytes'};
+    $self->{'xfer'}->start(sub { $self->handle_xmsg(@_); }, 0, $size);
     debug("started xfer; datapath=$self->{datapath}");
 
     # send the data-path response, if we have a datapath
@@ -702,13 +784,26 @@ sub quit {
     if ($self->{'clerk'}) {
        $self->{'clerk'}->quit(finished_cb => sub {
            my ($err) = @_;
+           $self->{'chg'}->quit() if defined $self->{'chg'};
            if ($err) {
                # it's *way* too late to report this to amrecover now!
                warning("while quitting clerk: $err");
            }
-           Amanda::MainLoop::quit();
+           $self->quit1();
        });
     } else {
+       $self->{'scan'}->quit() if defined $self->{'scan'};
+       $self->{'chg'}->quit() if defined $self->{'chg'};
+       $self->quit1();
+    }
+
+}
+
+sub quit1 {
+    my $self = shift;
+
+    $self->{'fetch_done'} = 1;
+    if (!%{$self->{'all_filter'}}) {
        Amanda::MainLoop::quit();
     }
 }
index 6465685c38ff94d13b1e97e07d002296136af6bb..2e09bfe3c1b55f1126e9eded3cf33b21b3aa535a 100644 (file)
@@ -640,7 +640,7 @@ is_disk_allowed(
     disk_t *disk)
 {
     dumptype_t *dt = disk->config;
-    recovery_limit_t *rl = NULL;
+    host_limit_t *rl = NULL;
     char *peer;
     char *dle_hostname;
     GSList *iter;
@@ -679,6 +679,19 @@ is_disk_allowed(
        }
     }
 
+    /* check server */
+    if (rl->server) {
+       char myhostname[MAX_HOSTNAME_LENGTH+1];
+       if (gethostname(myhostname, MAX_HOSTNAME_LENGTH) == 0) {
+           myhostname[MAX_HOSTNAME_LENGTH] = '\0';
+           g_debug("server hostname: %s", myhostname);
+           if (0 == g_ascii_strcasecmp(peer, myhostname)) {
+               g_debug("peer matched server ('%s')", myhostname);
+               return TRUE;
+           }
+       }
+    }
+
     /* check the match list */
     for (iter = rl->match_pats; iter; iter = iter->next) {
        char *pat = iter->data;
index f9103b8cb1f0d06cbadf0d5257d8376dc60fdeb4..77a5115c49e4b61825d43203ba8032266f2fe066 100644 (file)
@@ -42,7 +42,8 @@ my $exit_status = 0;
 my %subcommands;
 
 sub usage {
-    print STDERR "Usage: amlabel [-f] [-o configoption]* <conf> <label> [slot <slot-number>]\n";
+    print STDERR "Usage: amlabel [--barcode <barcode>] [--meta <meta>] [--assign] [--version]\n"
+              . "               [-f] [-o configoption]* <conf> [<label>] [slot <slot-number>]\n";
     exit(1);
 }
 
@@ -50,27 +51,46 @@ Amanda::Util::setup_application("amlabel", "server", $CONTEXT_CMDLINE);
 
 my $config_overrides = new_config_overrides($#ARGV+1);
 my ($opt_force, $opt_config, $opt_slot, $opt_label);
+my ($opt_barcode, $opt_meta, $opt_assign);
 
 $opt_force = 0;
+$opt_barcode = undef;
+$opt_meta = undef;
+$opt_assign = undef;
 Getopt::Long::Configure(qw(bundling));
 GetOptions(
     'help|usage|?' => \&usage,
-    'o=s' => sub { add_config_override_opt($config_overrides, $_[1]); },
-    'f' => \$opt_force,
-    'version' => \&Amanda::Util::version_opt,
+    'o=s'        => sub { add_config_override_opt($config_overrides, $_[1]); },
+    'f'          => \$opt_force,
+    'barcode=s'  => \$opt_barcode,
+    'meta=s'     => \$opt_meta,
+    'assign'     => \$opt_assign,
+    'version'    => \&Amanda::Util::version_opt,
 ) or usage();
 
-if (@ARGV == 2) {
+if ($opt_assign && (!$opt_meta || !$opt_barcode)) {
+    print STDERR "--assign require --barcode or --meta\n";
+    usage();
+}
+
+usage() if @ARGV == 0;
+$opt_config = $ARGV[0];
+if (@ARGV == 1) {
+    $opt_slot = undef;
+    $opt_label = undef;
+} elsif (@ARGV == 2) {
     $opt_slot = undef;
+    $opt_label = $ARGV[1];
+} elsif (@ARGV == 3 and $ARGV[1] eq 'slot') {
+    $opt_slot = $ARGV[2];
+    $opt_label = undef;
 } elsif (@ARGV == 4 and $ARGV[2] eq 'slot') {
     $opt_slot = $ARGV[3];
+    $opt_label = $ARGV[1];
 } else {
     usage();
 }
 
-$opt_config = $ARGV[0];
-$opt_label = $ARGV[1];
-
 set_config_overrides($config_overrides);
 config_init($CONFIG_INIT_EXPLICIT_NAME, $opt_config);
 my ($cfgerr_level, @cfgerr_errors) = config_errors();
@@ -102,13 +122,18 @@ sub failure {
 
 sub main {
     my ($finished_cb) = @_;
+    my $gerr;
+    my $chg;
+    my $dev;
+    my $dev_ok;
 
     my $steps = define_steps
-       cb_ref => \$finished_cb;
+       cb_ref => \$finished_cb,
+       finalize => sub { $chg->quit() if defined $chg };
 
     step start => sub {
        my $labelstr = getconf($CNF_LABELSTR);
-       if ($opt_label !~ /$labelstr/) {
+       if (defined ($opt_label) && $opt_label !~ /$labelstr/) {
            return failure("Label '$opt_label' doesn't match labelstr '$labelstr'.", $finished_cb);
        }
 
@@ -117,7 +142,17 @@ sub main {
        if (!defined $tl) {
            return failure("Can't load tapelist file ($tlf)", $finished_cb);
        }
-       if (!$opt_force) {
+
+       $chg = Amanda::Changer->new(undef, tapelist => $tl);
+
+       return failure($chg, $finished_cb)
+           if $chg->isa("Amanda::Changer::Error");
+
+       if ($opt_assign) {
+           return $steps->{'assign'}->();
+       }
+
+       if (defined($opt_label) && !$opt_force) {
            if ($tl->lookup_tapelabel($opt_label)) {
                return failure("Label '$opt_label' already on a volume", $finished_cb);
            }
@@ -127,28 +162,48 @@ sub main {
     };
 
     step load => sub {
-       my $chg = Amanda::Changer->new();
-
-       return failure($chg, $finished_cb)
-           if $chg->isa("Amanda::Changer::Error");
-
        print "Reading label...\n";
        if ($opt_slot) {
            $chg->load(slot => $opt_slot, mode => "write",
-                   res_cb => $steps->{'loaded'});
+                      res_cb => $steps->{'loaded'});
+       } elsif ($opt_barcode) {
+           $chg->inventory(inventory_cb => $steps->{'inventory'});
        } else {
            $chg->load(relative_slot => "current", mode => "write",
-                   res_cb => $steps->{'loaded'});
+                      res_cb => $steps->{'loaded'});
        }
     };
 
+    step inventory => sub {
+       my ($err, $inv) = @_;
+
+       return failure($err, $finished_cb) if $err;
+
+       for my $sl (@$inv) {
+           if ($sl->{'barcode'} eq $opt_barcode) {
+               return $chg->load(slot => $sl->{'slot'}, mode => "write",
+                                 res_cb => $steps->{'loaded'});
+           }
+       }
+
+       return failure("No volume with barcode '$opt_barcode' available", $finished_cb);
+    };
+
     step loaded => sub {
        (my $err, $res) = @_;
 
        return failure($err, $finished_cb) if $err;
 
-       my $dev = $res->{'device'};
-       my $dev_ok = 1;
+       if (defined $opt_slot && defined $opt_barcode &&
+           $opt_barcode ne $res->{'barcode'}) {
+           if (defined $res->{'barcode'}) {
+               return failure("Volume in slot $opt_slot have barcode '$res->{'barcode'}, it is not '$opt_barcode'", $finished_cb);
+           } else {
+               return failure("Volume in slot $opt_slot have no barcode", $finished_cb);
+           }
+       }
+       $dev = $res->{'device'};
+       $dev_ok = 1;
        if ($dev->status & $DEVICE_STATUS_VOLUME_UNLABELED) {
            if (!$dev->volume_header or $dev->volume_header->{'type'} == $F_EMPTY) {
                print "Found an empty tape.\n";
@@ -189,10 +244,34 @@ sub main {
            }
        }
 
+       $res->get_meta_label(finished_cb => $steps->{'got_meta'});
+    };
+
+    step got_meta => sub {
+       my ($err, $meta) = @_;
+
+       if (defined $meta && defined $opt_meta && $meta ne $opt_meta) {
+           return failure();
+       }
+       $meta = $opt_meta if !defined $meta;
+       ($meta, my $merr) = $res->make_new_meta_label() if !defined $meta;
+       if (defined $merr) {
+           return failure($merr, $finished_cb);
+       }
+       $opt_meta = $meta;
+
+       my $label = $opt_label;
+       if (!defined($label)) {
+           ($label, my $lerr) = $res->make_new_tape_label(meta => $meta);
+           if (defined $lerr) {
+               return failure($lerr, $finished_cb);
+           }
+       }
+
        if ($dev_ok) {
-           print "Writing label '$opt_label'...\n";
+           print "Writing label '$label'...\n";
 
-           if (!$dev->start($ACCESS_WRITE, $opt_label, "X")) {
+           if (!$dev->start($ACCESS_WRITE, $label, "X")) {
                return failure("Error writing label: " . $dev->error_or_status(), $finished_cb);
            } elsif (!$dev->finish()) {
                return failure("Error finishing device: " . $dev->error_or_status(), $finished_cb);
@@ -205,9 +284,9 @@ sub main {
                        $finished_cb);
            } elsif (!$dev->volume_label) {
                return failure("No label found.", $finished_cb);
-           } elsif ($dev->volume_label ne $opt_label) {
+           } elsif ($dev->volume_label ne $label) {
                my $got = $dev->volume_label;
-               return failure("Read back a different label: got '$got', but expected '$opt_label'",
+               return failure("Read back a different label: got '$got', but expected '$label'",
                        $finished_cb);
            } elsif ($dev->volume_time ne "X") {
                my $got = $dev->volume_time;
@@ -217,33 +296,105 @@ sub main {
 
            # update the tapelist
            $tl->reload(1);
-           $tl->remove_tapelabel($opt_label);
-           $tl->add_tapelabel("0", $opt_label, undef, 1, undef, $res->{'barcode'});
+           $tl->remove_tapelabel($label);
+           $tl->add_tapelabel("0", $label, undef, 1, $meta, $res->{'barcode'});
            $tl->write();
 
            print "Success!\n";
 
            # notify the changer
-           $res->set_label(label => $opt_label, finished_cb => $steps->{'labeled'});
+           $res->set_label(label => $label, finished_cb => $steps->{'set_meta_label'});
        } else {
            return failure("Not writing label.", $finished_cb);
        }
     };
 
+    step set_meta_label => sub {
+       my ($gerr) = @_;
+
+       if ($opt_meta) {
+           return $res->set_meta_label(meta => $opt_meta,
+                                       finished_cb => $steps->{'labeled'});
+       } else {
+           return $steps->{'labeled'}->();
+       }
+    };
+
     step labeled => sub {
        my ($err) = @_;
-       return failure($err, $finished_cb) if $err;
+       $gerr = $err if !$gerr;
 
        $res->release(finished_cb => $steps->{'released'});
     };
 
     step released => sub {
        my ($err) = @_;
+       return failure($gerr, $finished_cb) if $gerr;
        return failure($err, $finished_cb) if $err;
 
        $finished_cb->();
     };
+
+    step assign => sub {
+       my $tle;
+       $tle = $tl->lookup_tapelabel($opt_label);
+       if (defined $tle) {
+           my $meta = $opt_meta;
+           if (defined $meta) {
+               if (defined($tle->{'meta'}) && $meta ne $tle->{'meta'} &&
+                   !$opt_force) {
+                   return failure("Can't change meta-label with --force, old meta-label is '$tle->{'meta'}'");
+               }
+           } else {
+               $meta = $tle->{'meta'};
+           }
+           my $barcode = $opt_barcode;
+           if (defined $barcode) {
+               if (defined($tle->{'barcode'}) &&
+                   $barcode ne $tle->{'barcode'} &&
+                   !$opt_force) {
+                   return failure("Can't change barcode with --force, old barcode is '$tle->{'barcode'}'");
+               }
+           } else {
+               $barcode = $tle->{'barcode'};
+           }
+
+           $tl->reload(1);
+           $tl->remove_tapelabel($opt_label);
+           $tl->add_tapelabel($tle->{'datestamp'}, $tle->{'label'},
+                              $tle->{'comment'}, $tle->{'reuse'}, $meta,
+                              $barcode);
+           $tl->write();
+       } else {
+           return failure("Label '$opt_label' is not in the tapelist file", $finished_cb);
+       }
+
+       $chg->inventory(inventory_cb => $steps->{'assign_inventory'});
+    };
+
+    step assign_inventory => sub {
+       my ($err, $inv) = @_;
+
+       if ($err) {
+           return $finished_cb->() if $err->notimpl;
+           return failure($err, $finished_cb);
+       }
+
+       for my $sl (@$inv) {
+           if (defined $sl->{'label'} && $sl->{'label'} eq $opt_label) {
+               return $chg->set_meta_label(meta => $opt_meta,
+                                           slot => $sl->{'slot'},
+                                           finished_cb => $steps->{'done'});
+           }
+       }
+       $finished_cb->();
+    };
+
+    step done => sub {
+       $finished_cb->();
+    }
 }
+
 main(\&Amanda::MainLoop::quit);
 Amanda::MainLoop::run();
 Amanda::Util::finish_application();
index 20f84b47def913ce160315cd6f738490aeaf28e4..d1c599b00a28650059fbd5ab88648e794ce4bf48 100644 (file)
@@ -32,16 +32,14 @@ use POSIX;
 sub Usage {
     print STDERR <<END;
 Usage: $0 [--hostwidth width] [--diskwidth width] [--skipmissed]
-         [--last] [--num0] [--togo0] [--verbose] [[--config] CONFIG]
+         [--last] [--num0] [--togo0] [--verbose] [--config] <config>
 
 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.
+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;
 }
index 6114336f163f9d59837bda5527d630cb8cb36a53..d7f2421dd6e796539ddb12698323dbf009fb0241 100644 (file)
@@ -30,9 +30,11 @@ use Amanda::Util qw( :constants );
 use Amanda::Changer;
 use Amanda::Constants;
 use Amanda::MainLoop;
+use Amanda::MainLoop qw( :GIOCondition );
 use Amanda::Header;
 use Amanda::Holding;
 use Amanda::Cmdline;
+use Amanda::Tapelist;
 use Amanda::Xfer qw( :constants );
 
 sub usage {
@@ -132,12 +134,16 @@ sub main {
 
     my $dev;
     my $hdr;
+    my $chg;
     my $filenum = $opt_filenum;
     $filenum = 1 if (!$filenum);
     $filenum = 0 + "$filenum"; # convert to integer
+    my %all_filter;
+    my $restore_done;
 
     my $steps = define_steps
-       cb_ref => \$finished_cb;
+       cb_ref => \$finished_cb,
+       finalize => sub { $chg->quit() if defined $chg };
 
     step start => sub {
        # first, return to the original working directory we were started in
@@ -148,7 +154,9 @@ sub main {
        if ($opt_holding) {
            $steps->{'read_header'}->();
        } else {
-           my $chg = Amanda::Changer->new($opt_restore_src);
+           my $tlf = Amanda::Config::config_dir_relative(getconf($CNF_TAPELIST));
+           my $tl = Amanda::Tapelist->new($tlf);
+           $chg = Amanda::Changer->new($opt_restore_src, tapelist => $tl);
            if ($chg->isa("Amanda::Changer::Error")) {
                return failure($chg, $finished_cb);
            }
@@ -175,11 +183,6 @@ sub main {
            return failure($dev->error_or_status, $finished_cb);
        }
 
-       $res->set_label(label => $dev->volume_label,
-                       finished_cb => $steps->{'set_labeled'});
-    };
-
-    step set_labeled => sub {
        if ($opt_label) {
            if ($dev->volume_label ne $opt_label) {
                my $got = $dev->volume_label;
@@ -286,11 +289,11 @@ sub main {
            if ($hdr->{'srv_encrypt'}) {
                push @filters,
                    Amanda::Xfer::Filter::Process->new(
-                       [ $hdr->{'srv_encrypt'}, $hdr->{'srv_decrypt_opt'} ], 0, 0);
+                       [ $hdr->{'srv_encrypt'}, $hdr->{'srv_decrypt_opt'} ], 0);
            } elsif ($hdr->{'clnt_encrypt'}) {
                push @filters,
                    Amanda::Xfer::Filter::Process->new(
-                       [ $hdr->{'clnt_encrypt'}, $hdr->{'clnt_decrypt_opt'} ], 0, 0);
+                       [ $hdr->{'clnt_encrypt'}, $hdr->{'clnt_decrypt_opt'} ], 0);
            } else {
                return failure("could not decrypt encrypted dump: no program specified",
                            $finished_cb);
@@ -310,17 +313,17 @@ sub main {
                # TODO: this assumes that srvcompprog takes "-d" to decompress
                push @filters,
                    Amanda::Xfer::Filter::Process->new(
-                       [ $hdr->{'srvcompprog'}, "-d" ], 0, 0);
+                       [ $hdr->{'srvcompprog'}, "-d" ], 0);
            } elsif ($hdr->{'clntcompprog'}) {
                # TODO: this assumes that clntcompprog takes "-d" to decompress
                push @filters,
                    Amanda::Xfer::Filter::Process->new(
-                       [ $hdr->{'clntcompprog'}, "-d" ], 0, 0);
+                       [ $hdr->{'clntcompprog'}, "-d" ], 0);
            } else {
                push @filters,
                    Amanda::Xfer::Filter::Process->new(
                        [ $Amanda::Constants::UNCOMPRESS_PATH,
-                         $Amanda::Constants::UNCOMPRESS_OPT ], 0, 0);
+                         $Amanda::Constants::UNCOMPRESS_OPT ], 0);
            }
            
            # adjust the header
@@ -335,7 +338,7 @@ sub main {
            @filters = (
                Amanda::Xfer::Filter::Process->new(
                    [ $Amanda::Constants::COMPRESS_PATH,
-                     $compress_opt ], 0, 0),
+                     $compress_opt ], 0),
            );
            
            # adjust the header
@@ -350,6 +353,40 @@ sub main {
            $hdr->{'blocksize'} = Amanda::Holding::DISK_BLOCK_BYTES;
            $dest_fh->syswrite($hdr->to_string(32768, 32768));
        }
+
+       # start reading all filter stderr
+       foreach my $filter (@filters) {
+           my $fd = $filter->get_stderr_fd();
+           $fd.="";
+           $fd = int($fd);
+           my $src = Amanda::MainLoop::fd_source($fd,
+                                                 $G_IO_IN|$G_IO_HUP|$G_IO_ERR);
+           my $buffer = "";
+           $all_filter{$src} = 1;
+           $src->set_callback( sub {
+               my $b;
+               my $n_read = POSIX::read($fd, $b, 1);
+               if (!defined $n_read) {
+                   return;
+               } elsif ($n_read == 0) {
+                   delete $all_filter{$src};
+                   $src->remove();
+                   POSIX::close($fd);
+                   if (!%all_filter and $restore_done) {
+                       $finished_cb->();
+                   }
+               } else {
+                   $buffer .= $b;
+                   if ($b eq "\n") {
+                       my $line = $buffer;
+                       print STDERR "filter stderr: $line";
+                       chomp $line;
+                       debug("filter stderr: $line");
+                       $buffer = "";
+                   }
+               }
+           });
+       }
        
        my $xfer = Amanda::Xfer->new([ $src, @filters, $dest ]);
        my $got_err = undef;
@@ -372,13 +409,14 @@ sub main {
        my ($err) = @_;
        return failure($err, $finished_cb) if $err;
 
-       $steps->{'next_file'}->();
+       $steps->{'next_file'}->('extracted');
     };
 
     step next_file => sub {
-       # amrestore does not loop over multiple files when reading from
-       # holding or when outputting to a pipe
-       if ($opt_holding or $opt_pipe) {
+       my ($extracted) = @_;
+       # amrestore does not loop over multiple files when reading from holding
+       # when outputting to a pipe amrestore extracts only the first file
+       if ($opt_holding or ($opt_pipe and $extracted)) {
            return $steps->{'finished'}->();
        }
 
@@ -397,10 +435,12 @@ sub main {
     step quit => sub {
        my ($err) = @_;
        $res = undef;
-
+       $restore_done = 1;
        return failure($err, $finished_cb) if $err;
 
-       $finished_cb->();
+       if (!%all_filter) {
+           $finished_cb->();
+       }
     };
 }
 main(\&Amanda::MainLoop::quit);
index 27f6d1eafe27dad07ef716fde799361a16fd8a6e..392228f30a1f22c96f29f55edf973e23e9bf0076 100644 (file)
@@ -175,13 +175,14 @@ if ($cfgerr_level >= $CFGERR_ERRORS) {
     die "Errors processing disklist";
 }
 
-my $scrub_db = sub {
-    my $tapelist_file = config_dir_relative(getconf($CNF_TAPELIST));
-    my $tapelist = Amanda::Tapelist->new($tapelist_file, !$dry_run);
-    unless ($tapelist) {
-        die "Could not read the tapelist";
-    }
+my $tapelist_file = config_dir_relative(getconf($CNF_TAPELIST));
+my $tapelist = Amanda::Tapelist->new($tapelist_file, !$dry_run);
+unless ($tapelist) {
+    die "Could not read the tapelist";
+}
 
+
+my $scrub_db = sub {
     my $t = $tapelist->lookup_tapelabel($label);
     if ($keep_label) {
         $t->{'datestamp'} = 0 if $t;
@@ -295,7 +296,7 @@ my $erase_volume = make_cb('erase_volume' => sub {
         open(LOG, ">$log_file");
         print LOG "INFO amrmtape amrmtape pid $$\n";
         close LOG;
-       my $chg = Amanda::Changer->new($changer_name);
+       my $chg = Amanda::Changer->new($changer_name, tapelist => $tapelist);
        $chg->load(
            'label' => $label,
            'res_cb' => sub {
@@ -319,6 +320,8 @@ my $erase_volume = make_cb('erase_volume' => sub {
 
                $resv->release(finished_cb => sub {
                    my ($err) = @_;
+
+                   $chg->quit();
                    die $err if $err;
 
                    $scrub_db->();
index accd2164f378495dfeaa3e035ff04f8c9868709b..b03edd67b84355a013cd4e7e66cad67ea7910079 100755 (executable)
@@ -254,15 +254,16 @@ sub create_vtape {
        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");
+
+               # check space
+               my $fsinfo = Amanda::Util::get_fs_usage($parentdir);
+               my $avail_bytes = $fsinfo->{'blocksize'} * $fsinfo->{'bavail'};
+
+               # mysteriously, we need at least 72k per slot, plus 10k overhead.  The
+               # origin of these numbers is unknown.
+               my $needed_bytes = (($tp_cyclelimit*73728)+10240);
+               if ($avail_bytes < $needed_bytes){
+                       &mprint ("WARNING: Not enough space for vtapes. Need 72k per slot plus 10k ($needed_bytes bytes); have $avail_bytes available.  Creation of vtapes failed\n");
                        $vtape_err++;
                        return;
                }
@@ -409,7 +410,7 @@ sub build_amanda_ssh_key{
     }
       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");
+      &mprint("$amandahomedir/.ssh/client_authorized_keys created. Please append to $amandahomedir/.ssh/authorized_keys file on Amanda clients\n");
       }
   }
 }
diff --git a/server-src/amservice.c b/server-src/amservice.c
deleted file mode 100644 (file)
index a676365..0000000
+++ /dev/null
@@ -1,234 +0,0 @@
-/*
- * 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.
- *
- * Authors: the Amanda Development Team.  Its members are listed in a
- * file named AUTHORS, in the root directory of this distribution.
- */
-/*
- * $Id: amservice.c 11167 2008-05-06 11:53:54Z martineau $
- *
- * Take the REQ packet in stdin and output the REP packet in stdout
- */
-#include "amanda.h"
-#include "util.h"
-#include "conffile.h"
-#include "packet.h"
-#include "protocol.h"
-#include "server_util.h"
-#include "amfeatures.h"
-
-static time_t conf_ctimeout;
-static am_feature_t *our_features = NULL;
-static char *our_feature_string = NULL;
-static int remote_errors = 0;
-
-/* local functions */
-
-void usage(void);
-void client_protocol(char *hostname, char *auth, char *service, FILE *input_file);
-int main(int argc, char **argv);
-
-void
-usage(void)
-{
-    error(_("Usage: amservice [-o configoption]* [-f input_file] host auth service"));
-    /*NOTREACHED*/
-}
-
-int
-main(
-    int                argc,
-    char **    argv)
-{
-    config_overrides_t *cfg_ovr;
-    char *hostname;
-    char *auth;
-    char *service;
-    int opt;
-    extern int optind;
-    extern char *optarg;
-    FILE *input_file;
-
-    /*
-     * 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("amservice");
-    /* drop root privileges */
-    if (!set_root_privs(0)) {
-       error(_("amservice must be run setuid root"));
-    }
-
-    /* Don't die when child closes pipe */
-    signal(SIGPIPE, SIG_IGN);
-
-    dbopen(DBG_SUBDIR_SERVER);
-
-    add_amanda_log_handler(amanda_log_stderr);
-
-    our_features = am_init_feature_set();
-    our_feature_string = am_feature_to_string(our_features);
-
-    /* process arguments */
-
-    cfg_ovr = new_config_overrides(argc/2);
-    input_file = stdin;
-    while((opt = getopt(argc, argv, "o:f:")) != EOF) {
-       switch(opt) {
-       case 'o':       add_config_override_opt(cfg_ovr, optarg);
-                       break;
-       case 'f':       if (*optarg == '/') {
-                           input_file = fopen(optarg, "r");
-                       } else {
-                           char *name = vstralloc(get_original_cwd(), "/",
-                                                  optarg, NULL);
-                           input_file = fopen(name, "r");
-                           amfree(name);
-                       }
-                       if (!input_file)
-                           g_critical("Cannot open output file '%s': %s",
-                               optarg, strerror(errno));
-                       break;
-       }
-    }
-
-    argc -= optind, argv += optind;
-    if(argc < 3) usage();
-
-    /* set a default config */
-    set_config_overrides(cfg_ovr);
-    config_init(CONFIG_INIT_CLIENT, NULL);
-    dbrename(get_config_name(), DBG_SUBDIR_SERVER);
-
-    if (config_errors(NULL) >= CFGERR_WARNINGS) {
-       config_print_errors();
-       if (config_errors(NULL) >= CFGERR_ERRORS) {
-           g_critical(_("errors processing config file"));
-       }
-    }
-
-    conf_ctimeout = (time_t)getconf_int(CNF_CTIMEOUT);
-
-    hostname = argv[0];
-    auth = argv[1];
-    service = argv[2];
-
-    /* start client side checks */
-
-    client_protocol(hostname, auth, service, input_file);
-
-    amfree(our_feature_string);
-    am_release_feature_set(our_features);
-    our_features = NULL;
-
-    dbclose();
-    return(remote_errors != 0);
-}
-
-/* --------------------------------------------------- */
-
-static void handle_result(void *, pkt_t *, security_handle_t *);
-void start_host(char *hostname, char *auth, char *req);
-
-void
-start_host(
-    char *hostname,
-    char *auth,
-    char *req)
-{
-    const security_driver_t *secdrv;
-    secdrv = security_getdriver(auth);
-    if (secdrv == NULL) {
-       fprintf(stderr, _("Could not find security driver \"%s\".\n"), auth);
-    } else {
-       protocol_sendreq(hostname, secdrv, amhost_get_security_conf, 
-                        req, conf_ctimeout, handle_result, NULL);
-    }
-
-}
-
-void
-client_protocol(
-    char *hostname,
-    char *auth,
-    char *service,
-    FILE *input_file)
-{
-    char *req, *req1;
-
-    req = g_strdup_printf("SERVICE %s\nOPTIONS features=%s\n",
-                         service, our_feature_string);
-    req1 = malloc(1024);
-    while(fgets(req1, 1024, input_file) != NULL) {
-       vstrextend(&req, req1, NULL);
-    }
-    protocol_init();
-
-    start_host(hostname, auth, req);
-
-    protocol_run();
-
-    fflush(stdout);
-
-    amfree(our_feature_string);
-
-    return;
-}
-
-static void
-handle_result(
-    G_GNUC_UNUSED void *datap,
-    pkt_t *            pkt,
-    security_handle_t *        sech)
-{
-    char *line;
-    char *s;
-    int ch;
-
-    if (pkt == NULL) {
-       g_fprintf(stdout,
-                 _("Request failed: %s\n"), security_geterror(sech));
-       remote_errors++;
-       return;
-    }
-
-    s = pkt->body;
-    ch = *s++;
-    while(ch) {
-       line = s - 1;
-       skip_quoted_line(s, ch);
-       if (s[-2] == '\n') {
-           s[-2] = '\0';
-       }
-
-       fprintf(stdout, "%s\n", line);
-    }
-    fprintf(stdout, "\n");
-}
index 3fe0ebba286d3a5945722bfa1e6a4739f6f8e8c0..be2b8fe40467e647bdb53201dcae2b9d1051ba5a 100644 (file)
@@ -576,8 +576,12 @@ while($lineX = <AMDUMP>) {
                                        $label=$line[8];
                                        $status_taper = "Idle";
                                        $hostpart=$serial{$serial};
-                                       $line[10] =~ /sec (\S+) kb (\d+) kps/;
-                                       $size=$2 / $unitdivisor;
+                                       $line[10] =~ /sec (\S+) (kb|bytes) (\d+) kps/;
+                                       if ($2 eq 'kb') {
+                                               $size=$3 / $unitdivisor;
+                                  } else {
+                                               $size=$3 / ( $unitdivisor * 1024);
+                                       }
                                        $taper_finished{$hostpart}=1;
                                        $busy_time{"taper"}+=($current_time-$taper_time{$hostpart});
                                        $taper_time{$hostpart}=$current_time;
index df7b176d5025d2f11255b686fc06c7cece0ce1b0..4c8cd36c46c3d11cb1f1300ebc8f05fd20478e14 100644 (file)
@@ -34,9 +34,11 @@ use Amanda::Constants;
 use Amanda::MainLoop;
 use Amanda::Taper::Scan;
 use Amanda::Recovery::Scan;
-use Amanda::Interactive;
+use Amanda::Interactivity;
+use Amanda::Tapelist;
 
 my $exit_status = 0;
+my $tl;
 
 ##
 # Subcommand handling
@@ -93,6 +95,7 @@ sub {
 
     $chg->reset(finished_cb => sub {
            my ($err) = @_;
+           $chg->quit();
            return failure($err, $finished_cb) if $err;
 
            print STDERR "changer is reset\n";
@@ -113,6 +116,7 @@ sub {
     $chg->eject(@drive_args,
        finished_cb => sub {
            my ($err) = @_;
+           $chg->quit();
            return failure($err, $finished_cb) if $err;
 
            print STDERR "drive ejected\n";
@@ -136,6 +140,7 @@ sub {
     $chg->clean(@drive_args,
        finished_cb => sub {
            my ($err) = @_;
+           $chg->quit();
            return failure($err, $finished_cb) if $err;
 
            print STDERR "drive cleaned\n";
@@ -148,16 +153,17 @@ sub {
     my ($finished_cb, @args) = @_;
     my $last_slot;
     my %seen_slots;
-    my $gres;
-
-    my $steps = define_steps
-       cb_ref => \$finished_cb;
+    my $chg;
 
     if (@args != 0) {
        return usage($finished_cb);
     }
 
-    my $chg = load_changer($finished_cb) or return;
+    $chg = load_changer($finished_cb) or return;
+
+    my $steps = define_steps
+       cb_ref => \$finished_cb,
+       finalize => sub { $chg->quit() if defined $chg };
 
     step start => sub {
        $chg->info(info => [ 'num_slots' ], info_cb => $steps->{'info_cb'});
@@ -201,9 +207,6 @@ sub {
                print STDERR sprintf("slot %3s: date %-14s label %s\n",
                        $last_slot, $dev->volume_time(),
                        $dev->volume_label());
-               $gres = $res;
-               return $res->set_label(label => $dev->volume_label(),
-                                      finished_cb => $steps->{'set_labeled'});
            } elsif ($st == $DEVICE_STATUS_VOLUME_UNLABELED) {
                print STDERR sprintf("slot %3s: unlabeled volume\n", $last_slot);
            } else {
@@ -220,10 +223,6 @@ sub {
        }
     };
 
-    step set_labeled => sub {
-       $gres->release(finished_cb => $steps->{'released'});
-    };
-
     step released => sub {
        $chg->load(relative_slot => 'next', slot => $last_slot,
                   except_slots => { %seen_slots }, res_cb => $steps->{'loaded'});
@@ -246,11 +245,16 @@ sub {
        my ($err, $inv) = @_;
        if ($err) {
            if ($err->notimpl) {
-               print STDERR "inventory not supported by this changer\n";
+               if ($err->{'message'}) {
+                   print STDERR "inventory not supported by this changer: $err->{'message'}\n";
+               } else {
+                   print STDERR "inventory not supported by this changer\n";
+               }
            } else {
                print STDERR "$err\n";
            }
 
+           $chg->quit();
            return $finished_cb->();
        }
 
@@ -263,6 +267,10 @@ sub {
            } else {
                if (defined $sl->{label}) {
                    $line .= " label $sl->{label}";
+                   my $tle = $tl->lookup_tapelabel($sl->{label});
+                   if ($tle->{'meta'}) {
+                       $line .= " ($tle->{'meta'})";
+                   }
                } elsif ($sl->{'device_status'} == $DEVICE_STATUS_VOLUME_UNLABELED) {
                    $line .= " blank";
                } elsif ($sl->{'device_status'} != $DEVICE_STATUS_SUCCESS) {
@@ -285,11 +293,15 @@ sub {
            if ($sl->{'import_export'}) {
                $line .= " (import/export slot)";
            }
+           if ($sl->{'current'}) {
+               $line .= " (current)";
+           }
 
            # note that inventory goes to stdout
            print "$line\n";
        }
 
+       $chg->quit();
        $finished_cb->();
     });
     $chg->inventory(inventory_cb => $inventory_cb);
@@ -310,10 +322,11 @@ subcommand("slot", "slot <slot>",
 sub {
     my ($finished_cb, @args) = @_;
     my @slotarg;
-    my $gres;
+    my $chg;
 
     my $steps = define_steps
-       cb_ref => \$finished_cb;
+       cb_ref => \$finished_cb,
+       finalize => sub { $chg->quit() if defined $chg };
 
     # NOTE: the syntax of this subcommand precludes actual slots named
     # 'current' or 'next' ..  when we have a changer using such slot names,
@@ -322,7 +335,7 @@ sub {
     return usage($finished_cb) unless (@args == 1);
     my $slot = shift @args;
 
-    my $chg = load_changer($finished_cb) or return;
+    $chg = load_changer($finished_cb) or return;
 
     step get_slot => sub {
        if ($slot eq 'current' or $slot eq 'next') {
@@ -368,17 +381,7 @@ sub {
        my $gotslot = $res->{'this_slot'};
        print STDERR "changed to slot $gotslot\n";
 
-       if ($res->{device}->volume_label) {
-           $gres = $res;
-           $res->set_label(label => $res->{device}->volume_label(),
-                           finished_cb => $steps->{'set_labeled'});
-       } else {
-           $res->release(finished_cb => $steps->{'released'});
-       }
-    };
-
-    step set_labeled => sub {
-       $gres->release(finished_cb => $steps->{'released'});
+       $res->release(finished_cb => $steps->{'released'});
     };
 
     step released => sub {
@@ -392,15 +395,17 @@ sub {
 subcommand("label", "label <label>", "load the volume with label <label>",
 sub {
     my ($finished_cb, @args) = @_;
-    my $gres;
-    my $inter;
+    my $interactivity;
     my $scan;
+    my $chg;
 
     return usage($finished_cb) unless (@args == 1);
     my $label = shift @args;
 
     my $steps = define_steps
-       cb_ref => \$finished_cb;
+       cb_ref => \$finished_cb,
+       finalize => sub { $scan->quit() if defined $scan;
+                         $chg->quit() if defined $chg };
 
     step start => sub {
        my $_user_msg_fn = sub {
@@ -425,8 +430,10 @@ sub {
            }
        };
 
-       $inter = Amanda::Interactive->new(name => 'stdin');
-       $scan = Amanda::Recovery::Scan->new(interactive => $inter);
+       $interactivity = Amanda::Interactivity->new(name => 'stdin');
+       $chg = load_changer($finished_cb) or return;
+       $scan = Amanda::Recovery::Scan->new(chg => $chg,
+                                           interactivity => $interactivity);
        return failure("$scan", $finished_cb)
            if ($scan->isa("Amanda::Changer::Error"));
 
@@ -445,17 +452,7 @@ sub {
        show_slot($res);
        print STDERR "label $label is now loaded from slot $gotslot\n";
 
-       if ($res->{device}->volume_label) {
-           $gres = $res;
-           $res->set_label(label => $res->{device}->volume_label(),
-                           finished_cb => $steps->{'set_labeled'});
-       } else {
-           $res->release(finished_cb => $steps->{'released'});
-       }
-    };
-
-    step set_labeled => sub {
-       $gres->release(finished_cb => $steps->{'released'});
+       $res->release(finished_cb => $steps->{'released'});
     };
 
     step released => sub {
@@ -528,10 +525,18 @@ sub {
     my $label = shift @args;
 
     my $chg = load_changer($finished_cb) or return;
+    my $interactivity = Amanda::Interactivity->new(name => 'tty');
+    my $scan_name = getconf($CNF_TAPERSCAN);
+    my $taperscan = Amanda::Taper::Scan->new(algorithm => $scan_name,
+                                            changer => $chg,
+                                            tapelist => $tl);
 
     my $result_cb = make_cb(result_cb => sub {
        my ($err, $res, $label, $mode) = @_;
-       return failure($err, $finished_cb) if $err;
+       if ($err) {
+           $taperscan->quit() if defined $taperscan;
+           return failure($err, $finished_cb);
+       }
 
        my $modestr = ($mode == $ACCESS_APPEND)? "append" : "write";
        my $slot = $res->{'this_slot'};
@@ -540,11 +545,11 @@ sub {
            my ($err) = @_;
            die "$err" if $err;
 
+           $taperscan->quit() if defined $taperscan;
            $finished_cb->();
        });
     });
 
-    my $taperscan = Amanda::Taper::Scan->new(changer => $chg);
     $taperscan->scan(
        result_cb => $result_cb,
        user_msg_fn => $taper_user_msg_fn,
@@ -570,6 +575,7 @@ sub {
            return failure($err, $finished_cb) if $err;
 
            print STDERR "update complete\n";
+           $chg->quit();
            $finished_cb->();
        });
 });
@@ -580,7 +586,7 @@ sub {
 sub load_changer {
     my ($finished_cb) = @_;
 
-    my $chg = Amanda::Changer->new();
+    my $chg = Amanda::Changer->new(undef, tapelist => $tl);
     return failure($chg, $finished_cb) if ($chg->isa("Amanda::Changer::Error"));
     return $chg;
 }
@@ -635,6 +641,9 @@ if ($cfgerr_level >= $CFGERR_WARNINGS) {
 
 Amanda::Util::finish_setup($RUNNING_AS_DUMPUSER);
 
+my $tlf = Amanda::Config::config_dir_relative(getconf($CNF_TAPELIST));
+$tl = Amanda::Tapelist->new($tlf);
+
 #make STDOUT not line buffered
 my $previous_fh = select(STDOUT);
 $| = 1;
index 6e20da187e4138c5d304e460feaf6e98aae0bc32..25f7f3efe35b48a81f9b3492c7cf868b293bd46c 100644 (file)
@@ -184,6 +184,7 @@ main(
                dbprintf(_("could not open index directory %s\n"), qindexdir);
                amfree(indexdir);
                amfree(qindexdir);
+               g_slist_free(matching_dp);
                continue;
            }
            name_length = 100;
@@ -289,6 +290,7 @@ main(
                amfree(datestamp);
                amfree(names[i]);
            }
+           g_slist_free(matching_dp);
            amfree(names);
            amfree(indexdir);
            amfree(qindexdir);
index ebfc627e92ad496e1b2d9867f92e5e289937f259..8b2c87a66e6b4fbd20112190c1d521f104d981e6 100644 (file)
@@ -21,11 +21,11 @@ use lib '@amperldir@';
 use strict;
 use warnings;
 
-package main::Interactive;
+package main::Interactivity;
 use POSIX qw( :errno_h );
 use Amanda::MainLoop qw( :GIOCondition );
 use vars qw( @ISA );
-@ISA = qw( Amanda::Interactive );
+@ISA = qw( Amanda::Interactivity );
 
 sub new {
     my $class = shift;
@@ -61,12 +61,12 @@ sub user_request {
        if (!defined $n_read) {
            return if ($! == EINTR);
            $self->abort();
-           return $params{'finished_cb'}->(
+           return $params{'request_cb'}->(
                Amanda::Changer::Error->new('fatal',
                        message => "Fail to read from stdin"));
        } elsif ($n_read == 0) {
            $self->abort();
-           return $params{'finished_cb'}->(
+           return $params{'request_cb'}->(
                Amanda::Changer::Error->new('fatal',
                        message => "Aborted by user"));
        } else {
@@ -76,7 +76,7 @@ sub user_request {
                chomp $line;
                $buffer = "";
                $self->abort();
-               return $params{'finished_cb'}->(undef, $line);
+               return $params{'request_cb'}->(undef, $line);
            }
        }
     };
@@ -178,7 +178,7 @@ sub setup_src {
     my $src = $self->{'src'} = {};
 
     # put together a clerk, which of course requires a changer, scan,
-    # interactive, and feedback
+    # interactivity, and feedback
     my $chg = Amanda::Changer->new();
     return $self->failure("Error opening source changer: $chg")
        if $chg->isa('Amanda::Changer::Error');
@@ -186,11 +186,11 @@ sub setup_src {
 
     $src->{'seen_labels'} = {};
 
-    $src->{'interactive'} = main::Interactive->new();
+    $src->{'interactivity'} = main::Interactivity->new();
 
     $src->{'scan'} = Amanda::Recovery::Scan->new(
            chg => $src->{'chg'},
-           interactive => $src->{'interactive'});
+           interactivity => $src->{'interactivity'});
 
     $src->{'clerk'} = Amanda::Recovery::Clerk->new(
            changer => $src->{'chg'},
@@ -341,17 +341,28 @@ sub plan_cb {
 sub setup_dst {
     my $self = shift;
     my $dst = $self->{'dst'} = {};
+    my $tlf = Amanda::Config::config_dir_relative(getconf($CNF_TAPELIST));
+    my $tl = Amanda::Tapelist->new($tlf);
 
     $dst->{'label'} = undef;
     $dst->{'tape_num'} = 0;
 
-    my $chg = Amanda::Changer->new($self->{'dst_changer'});
+    my $chg = Amanda::Changer->new($self->{'dst_changer'},
+                                  tapelist => $tl,
+                                  labelstr => getconf($CNF_LABELSTR),
+                                  autolabel => $self->{'dst_autolabel'});
     return $self->failure("Error opening destination changer: $chg")
        if $chg->isa('Amanda::Changer::Error');
     $dst->{'chg'} = $chg;
 
+    my $interactivity = Amanda::Interactivity->new(
+                                       name => getconf($CNF_INTERACTIVITY));
+    my $scan_name = getconf($CNF_TAPERSCAN);
     $dst->{'scan'} = Amanda::Taper::Scan->new(
+       algorithm => $scan_name,
        changer => $dst->{'chg'},
+       interactivity => $interactivity,
+       tapelist => $tl,
        labelstr => getconf($CNF_LABELSTR),
        autolabel => $self->{'dst_autolabel'});
 
@@ -461,7 +472,9 @@ sub xfer_dumps {
 
        # create and start the transfer
        $xfer = Amanda::Xfer->new([ $xfer_src, $xfer_dst ]);
-       $xfer->start($steps->{'handle_xmsg'});
+       my $size = 0;
+       $size = $current->{'dump'}->{'bytes'} if exists $current->{'dump'}->{'bytes'};
+       $xfer->start($steps->{'handle_xmsg'}, 0, $size);
 
        # count the "threads" running here (clerk and scribe)
        $n_threads = 2;
@@ -564,6 +577,16 @@ sub quit {
     my $steps = define_steps
            cb_ref => \$exit_cb;
 
+    # the export may not start until we quit the scribe, so wait for it now..
+    step check_exporting => sub {
+       # if we're exporting the final volume, wait for that to complete
+       if ($self->{'exporting'}) {
+           $self->{'call_after_export'} = $steps->{'quit_scribe'};
+       } else {
+           $steps->{'quit_scribe'}->();
+       }
+    };
+
     # we may have several resources to clean up..
     step quit_scribe => sub {
        if ($self->{'cleanup'}{'quit_scribe'}) {
@@ -571,28 +594,19 @@ sub quit {
            $self->{'dst'}{'scribe'}->quit(
                finished_cb => $steps->{'quit_scribe_finished'});
        } else {
-           $steps->{'check_exporting'}->();
+           $steps->{'quit_clerk'}->();
        }
     };
 
     step quit_scribe_finished => sub {
+       $self->{'dst'}{'scan'}->quit();
        my ($err) = @_;
        if ($err) {
            print STDERR "$err\n";
            $exit_status = 1;
        }
 
-       $steps->{'check_exporting'}->();
-    };
-
-    # the export may not start until we quit the scribe, so wait for it now..
-    step check_exporting => sub {
-       # if we're exporting the final volume, wait for that to complete
-       if ($self->{'exporting'}) {
-           $self->{'call_after_export'} = $steps->{'quit_clerk'};
-       } else {
-           $steps->{'quit_clerk'}->();
-       }
+       $steps->{'quit_clerk'}->();
     };
 
     step quit_clerk => sub {
@@ -739,7 +753,7 @@ sub scribe_notif_tape_done {
     # exports are going on simultaneously.
     $self->{'exporting'}++;
 
-    my $finished_cb = sub {};
+    my $finished_cb = $params{'finished_cb'};
     my $steps = define_steps
        cb_ref => \$finished_cb;
 
index 0c4c2b0a0c1f79c293d7f7dc72d277ebdef76aba..488f675886675cbefda2f8f625956015db19848c 100644 (file)
@@ -43,6 +43,7 @@
 #include "util.h"
 #include "holding.h"
 #include "timestamp.h"
+#include "sockaddr-util.h"
 
 #ifndef SEEK_SET
 #define SEEK_SET 0
@@ -440,6 +441,9 @@ startup_chunker(
     int header_socket, data_socket;
     int result;
     struct addrinfo *res;
+    struct addrinfo *res_addr;
+    sockaddr_union  *addr = NULL;
+    sockaddr_union   data_addr;
 
     header_port = 0;
     data_port = 0;
@@ -448,10 +452,26 @@ startup_chunker(
                               gai_strerror(result));
        return -1;
     }
-    header_socket = stream_server(res->ai_family, &header_port, 0,
+    for (res_addr = res; res_addr != NULL; res_addr = res_addr->ai_next) {
+       g_debug("ra: %s\n", str_sockaddr((sockaddr_union*)res_addr->ai_addr));
+       if (res_addr->ai_family == AF_INET) {
+           addr = (sockaddr_union *)res_addr->ai_addr;
+           break;
+       }
+    }
+    if (!addr) {
+       addr = (sockaddr_union *)res->ai_addr;
+       g_debug("addr: %s\n", str_sockaddr(addr));
+    }
+
+    header_socket = stream_server(SU_GET_FAMILY(addr), &header_port, 0,
                                STREAM_BUFSIZE, 0);
-    data_socket = stream_server(res->ai_family, &data_port, 0,
+    data_socket = stream_server(SU_GET_FAMILY(addr), &data_port, 0,
                                STREAM_BUFSIZE, 0);
+    copy_sockaddr(&data_addr, addr);
+
+    SU_SET_PORT(&data_addr, data_port);
+
     if (res) freeaddrinfo(res);
 
     if (header_socket < 0) {
@@ -466,7 +486,7 @@ startup_chunker(
        return -1;
     }
 
-    putresult(PORT, "%d 127.0.0.1:%d\n", header_port, data_port);
+    putresult(PORT, "%d %s\n", header_port, str_sockaddr(&data_addr));
 
     header_fd = stream_accept(header_socket, CONNECT_TIMEOUT, 0,
                              STREAM_BUFSIZE);
index 8a67cbd51de35d57725b5c6a29decf1290ae2555..71e2ef55cb7a54a656e949288e5a44dd2883fe43 100644 (file)
@@ -89,6 +89,12 @@ end:
     return config_errors(NULL);
 }
 
+am_host_t *
+get_hostlist(void)
+{
+    return hostlist;
+}
+
 am_host_t *
 lookup_host(
     const char *hostname)
@@ -703,6 +709,7 @@ parse_diskline(
     disk->comprate[0]       = dumptype_get_comprate(dtype)[0];
     disk->comprate[1]       = dumptype_get_comprate(dtype)[1];
     disk->data_path         = dumptype_get_data_path(dtype);
+    disk->dump_limit        = dumptype_get_dump_limit(dtype);
 
     /*
      * Boolean parameters with no value (Appears here as value 2) defaults
@@ -1584,6 +1591,7 @@ xml_application(
 {
     char       *plugin;
     char       *b64plugin;
+    char       *client_name;
     xml_app_t   xml_app;
     proplist_t  proplist;
 
@@ -1597,6 +1605,13 @@ xml_application(
     proplist = application_get_property(application);
     g_hash_table_foreach(proplist, xml_property, &xml_app);
 
+    client_name = application_get_client_name(application);
+    if (client_name && strlen(client_name) > 0 &&
+       am_has_feature(their_features, fe_application_client_name)) {
+       char *b64client_name = amxml_format_tag("client_name", client_name);
+       vstrextend(&xml_app.result, "    ", b64client_name, "\n", NULL);
+    }
+
     vstrextend(&xml_app.result, "  </backup-program>\n", NULL);
 
     amfree(b64plugin);
@@ -1612,6 +1627,7 @@ xml_scripts(
 {
     char       *plugin;
     char       *b64plugin;
+    char       *client_name;
     char       *xml_scr;
     char       *xml_scr1;
     char       *str = "";
@@ -1648,7 +1664,7 @@ xml_scripts(
 
        execute_on = pp_script_get_execute_on(pp_script);
        sep = "";
-       eo_str = NULL;
+       eo_str = stralloc("");
        if (execute_on & EXECUTE_ON_PRE_DLE_AMCHECK) {
            eo_str = vstrextend(&eo_str, sep, "PRE-DLE-AMCHECK", NULL);
            sep = ",";
@@ -1725,6 +1741,15 @@ xml_scripts(
        proplist = pp_script_get_property(pp_script);
        xml_app.result   = stralloc("");
        g_hash_table_foreach(proplist, xml_property, &xml_app);
+
+       client_name = pp_script_get_client_name(pp_script);
+       if (client_name && strlen(client_name) > 0 &&
+           am_has_feature(their_features, fe_script_client_name)) {
+           char *b64client_name = amxml_format_tag("client_name",
+                                                   client_name);
+           vstrextend(&xml_app.result, "    ", b64client_name, "\n", NULL);
+       }
+
        xml_scr = vstrextend(&xml_scr, xml_scr1, xml_app.result, "  </script>\n", NULL);
        amfree(b64plugin);
        amfree(xml_app.result);
@@ -1793,10 +1818,13 @@ match_disklist(
                        dp->todo = 1;
                        match_a_disk = 1;
                        prev_match = 0;
-                   } else { /* dp->todo == 0 */
+                   } else if (dp->todo == 0) {
                        match_a_disk = 1;
                        prev_match = 0;
                        dp_skip = dp;
+                   } else { /* dp->todo == 1 */
+                       match_a_disk = 1;
+                       prev_match = 0;
                    }
                }
            }
index 5797a18ce262a115e4c8ab7fbd11ff4b1dadc250..e543f650185b6601ecfb84adb05e621884f0161c 100644 (file)
@@ -123,6 +123,7 @@ typedef struct disk_s {
     int                todo;
     char       *application;
     identlist_t pp_scriptlist;
+    host_limit_t *dump_limit;
     void       *up;                    /* generic user pointer */
 } disk_t;
 
@@ -136,6 +137,7 @@ typedef struct disklist_s {
  * value just as you would the return of config_init() */
 cfgerr_level_t read_diskfile(const char *, disklist_t *);
 
+am_host_t *get_hostlist(void);
 am_host_t *lookup_host(const char *hostname);
 disk_t *lookup_disk(const char *hostname, const char *diskname);
 
index 6b257c5d7679b23f986817b86eebc97c89f40424..bb3eace0acc085797d4a794d6fec1258fa9cf3b0 100644 (file)
@@ -140,7 +140,7 @@ 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(disk_t *);
-static int all_taper_idle(void);
+static int no_taper_flushing(void);
 
 typedef enum {
     TAPE_ACTION_NO_ACTION         = 0,
@@ -199,6 +199,7 @@ main(
     find_result_t *holding_files;
     disklist_t holding_disklist = { NULL, NULL };
     int no_taper = FALSE;
+    int from_client = FALSE;
 
     /*
      * Configure program for internationalization:
@@ -267,6 +268,14 @@ main(
        }
     }
 
+    if (argc > 2) {
+       if (strcmp(argv[2], "--from-client") == 0) {
+           from_client = TRUE;
+           argv++;
+           argc--;
+       }
+    }
+
     safe_cd(); /* do this *after* config_init */
 
     check_running_as(RUNNING_AS_DUMPUSER);
@@ -499,6 +508,8 @@ main(
        headqueue_disk(&directq, diskp);
     }
 
+    run_server_global_scripts(EXECUTE_ON_POST_BACKUP, get_config_name());
+
     /* log error for any remaining dumps */
     while(!empty(directq)) {
        diskp = dequeue_disk(&directq);
@@ -914,6 +925,24 @@ startaflush_tape(
                if(dp) remove_disk(&tapeq, dp);
                break;
        }
+       if (!dp) {
+           if (!(result_tape_action & TAPE_ACTION_START_A_FLUSH_FIT)) {
+               if(conf_taperalgo != ALGO_SMALLEST)  {
+                   g_fprintf(stderr,
+                       _("driver: startaflush: Using SMALLEST because nothing fit\n"));
+               }
+               
+               fit = dp = tapeq.head;
+               while (fit != NULL) {
+                   if (sched(fit)->act_size < sched(dp)->act_size &&
+                       strcmp(sched(fit)->datestamp, datestamp) <= 0) {
+                       dp = fit;
+                   }
+                   fit = fit->next;
+               }
+               if(dp) remove_disk(&tapeq, dp);
+           }
+       }
        if (dp) {
            taper->disk = dp;
            taper->dumper = NULL;
@@ -1012,7 +1041,7 @@ allow_dump_dle(
     } else if (!taper && (holdp =
        find_diskspace(sched(diskp)->est_size, cur_idle, NULL)) == NULL) {
        *cur_idle = max(*cur_idle, IDLE_NO_DISKSPACE);
-       if (empty(tapeq) && dumper_to_holding == 0 && rq != &directq && all_taper_idle()) {
+       if (empty(tapeq) && dumper_to_holding == 0 && rq != &directq && no_taper_flushing()) {
            remove_disk(rq, diskp);
            if (diskp->to_holdingdisk != HOLD_REQUIRED) {
                enqueue_disk(&directq, diskp);
@@ -1069,7 +1098,7 @@ start_some_dumps(
 {
     const time_t now = time(NULL);
     int cur_idle;
-    disk_t *diskp, *delayed_diskp, *diskp_accept;
+    disk_t *diskp, *delayed_diskp, *diskp_accept, *diskp_next;
     disk_t *dp;
     assignedhd_t **holdp=NULL, **holdp_accept;
     cmd_t cmd;
@@ -1176,7 +1205,8 @@ start_some_dumps(
                    }
 
                    for (diskp = directq.head; diskp != NULL;
-                                              diskp = diskp->next) {
+                                              diskp = diskp_next) {
+                       diskp_next = diskp->next;
                        allow_dump_dle(diskp, taper, dumptype, &directq, now,
                                       dumper_to_holding, &cur_idle,
                                       &delayed_diskp, &diskp_accept,
@@ -1195,7 +1225,8 @@ start_some_dumps(
        }
 
        if (diskp == NULL) {
-           for(diskp = rq->head; diskp != NULL; diskp = diskp->next) {
+           for(diskp = rq->head; diskp != NULL; diskp = diskp_next) {
+               diskp_next = diskp->next;
                assert(diskp->host != NULL && sched(diskp) != NULL);
 
                allow_dump_dle(diskp, NULL, dumptype, rq, now,
@@ -1289,13 +1320,11 @@ start_some_dumps(
                diskp->dataport_list = stralloc(result_argv[2]);
 
                if (diskp->host->pre_script == 0) {
-                   for (dp=diskp->host->disks; dp != NULL; dp = dp->hostnext) {
-                       run_server_scripts(EXECUTE_ON_PRE_HOST_BACKUP,
-                                          get_config_name(), dp, -1);
-                   }
+                   run_server_host_scripts(EXECUTE_ON_PRE_HOST_BACKUP,
+                                           get_config_name(), diskp->host);
                    diskp->host->pre_script = 1;
                }
-               run_server_scripts(EXECUTE_ON_PRE_DLE_BACKUP,
+               run_server_dle_scripts(EXECUTE_ON_PRE_DLE_BACKUP,
                                   get_config_name(), diskp,
                                   sched(diskp)->level);
                dumper_cmd(dumper, PORT_DUMP, diskp, NULL);
@@ -1485,15 +1514,17 @@ continue_port_dumps(void)
        if( dumper->busy ) {
            busy_dumpers++;
            if( !find_disk(&roomq, dumper->dp) ) {
-               active_dumpers++;
-           } else if( !dp || 
+               if (dumper->chunker) {
+                   active_dumpers++;
+               }
+           } else if( !dp ||
                       sched(dp)->est_size > sched(dumper->dp)->est_size ) {
                dp = dumper->dp;
            }
        }
     }
-    if((dp != NULL) && (active_dumpers == 0) && (busy_dumpers > 0) && 
-        ((all_taper_idle() && empty(tapeq)) || degraded_mode) &&
+    if((dp != NULL) && (active_dumpers == 0) && (busy_dumpers > 0) &&
+        ((no_taper_flushing() && empty(tapeq)) || degraded_mode) &&
        pending_aborts == 0 ) { /* case b */
        sched(dp)->no_space = 1;
        /* At this time, dp points to the dump with the smallest est_size.
@@ -1511,7 +1542,7 @@ static void
 handle_taper_result(
        void *cookie G_GNUC_UNUSED)
 {
-    disk_t *dp = NULL, *dp1;
+    disk_t *dp = NULL;
     dumper_t *dumper;
     cmd_t cmd;
     int result_argc;
@@ -1674,6 +1705,12 @@ handle_taper_result(
            if (s) {
                s += 4;
                sched(dp)->dumpsize = atol(s);
+           } else {
+               s = strstr(result_argv[4], " bytes ");
+               if (s) {
+                   s += 7;
+                   sched(dp)->dumpsize = atol(s)/1024;
+               }
            }
 
            taper->result = cmd;
@@ -1704,6 +1741,12 @@ handle_taper_result(
            if (s) {
                s += 4;
                partsize = atol(s);
+           } else {
+               s = strstr(result_argv[5], " bytes ");
+               if (s) {
+                   s += 7;
+                   partsize = atol(s)/1024;
+               }
            }
            taper->left -= partsize;
 
@@ -1718,11 +1761,15 @@ handle_taper_result(
 
            dp = serial2disk(result_argv[1]);
            taper = sched(dp)->taper;
-           taper->state &= ~TAPER_STATE_TAPE_STARTED;
-           taper->state |= TAPER_STATE_TAPE_REQUESTED;
+           if (taper->state & TAPER_STATE_DONE) {
+               taper_cmd(NO_NEW_TAPE, taper->disk, "taper found no tape", 0, NULL);
+           } else {
+               taper->state &= ~TAPER_STATE_TAPE_STARTED;
+               taper->state |= TAPER_STATE_TAPE_REQUESTED;
 
-           start_some_dumps(&runq);
-           startaflush();
+               start_some_dumps(&runq);
+               startaflush();
+           }
            break;
 
        case NEW_TAPE: /* NEW-TAPE <handle> <label> */
@@ -1842,13 +1889,11 @@ handle_taper_result(
            taper->state |= TAPER_STATE_DUMP_TO_TAPE;
 
            if (dp->host->pre_script == 0) {
-               for (dp1=dp->host->disks; dp1 != NULL; dp1 = dp1->hostnext) {
-                   run_server_scripts(EXECUTE_ON_PRE_HOST_BACKUP,
-                                      get_config_name(), dp1, -1);
-               }
+               run_server_host_scripts(EXECUTE_ON_PRE_HOST_BACKUP,
+                                       get_config_name(), dp->host);
                dp->host->pre_script = 1;
            }
-           run_server_scripts(EXECUTE_ON_PRE_DLE_BACKUP,
+           run_server_dle_scripts(EXECUTE_ON_PRE_DLE_BACKUP,
                               get_config_name(), dp,
                               sched(dp)->level);
            /* tell the dumper to dump to a port */
@@ -1872,6 +1917,7 @@ handle_taper_result(
              * checks. If there are dumps waiting for diskspace to be freed,
              * cancel one.
              */
+           taper_started = 1;
             if(!nodump) {
                 log_add(L_WARNING,
                         _("going into degraded mode because of taper component error."));
@@ -1927,6 +1973,7 @@ handle_taper_result(
        }
 
     } while(areads_dataready(taper_fd));
+    start_some_dumps(&runq);
     startaflush();
 }
 
@@ -2364,7 +2411,7 @@ handle_dumper_result(
            int last_dump = 1;
            dumper_t *dumper;
 
-           run_server_scripts(EXECUTE_ON_POST_DLE_BACKUP,
+           run_server_dle_scripts(EXECUTE_ON_POST_DLE_BACKUP,
                               get_config_name(), dp, sched(dp)->level);
            /* check dump not yet started */
            for (dp1=runq.head; dp1 != NULL; dp1 = dp1->next) {
@@ -2384,10 +2431,8 @@ handle_dumper_result(
            }
            if (last_dump && dp->host->post_script == 0) {
                if (dp->host->post_script == 0) {
-                   for (dp1=dp->host->disks; dp1 != NULL; dp1 = dp1->hostnext) {
-                       run_server_scripts(EXECUTE_ON_POST_HOST_BACKUP,
-                                          get_config_name(), dp1, -1);
-                   }
+                   run_server_host_scripts(EXECUTE_ON_POST_HOST_BACKUP,
+                                           get_config_name(), dp->host);
                    dp->host->post_script = 1;
                }
            }
@@ -3128,6 +3173,7 @@ read_schedule(
        log_add(L_WARNING, _("WARNING: got empty schedule from planner"));
     if(need_degraded==1) start_degraded_mode(&runq);
     schedule_done = 1;
+    run_server_global_scripts(EXECUTE_ON_PRE_BACKUP, get_config_name());
     if (empty(runq)) force_flush = 1;
     start_some_dumps(&runq);
     startaflush();
@@ -3665,11 +3711,12 @@ tape_action(
     off_t sched_size;
     off_t dump_to_disk_size;
     int   dump_to_disk_terminated;
-    off_t my_flush_threshold_dumped;
-    off_t my_flush_threshold_scheduled;
-    off_t my_taperflush;
     int   nb_taper_active = nb_sent_new_tape;
     int   nb_taper_flushing = 0;
+    off_t data_next_tape = 0;
+    off_t data_free = 0;
+    off_t data_lost = 0;
+    off_t data_lost_next_tape = 0;
 
     dumpers_size = 0;
     for(dumper = dmptable; dumper < (dmptable+inparallel); dumper++) {
@@ -3710,13 +3757,27 @@ tape_action(
            tapeq_size -= taper1->left;
        }
        if (taper1->disk) {
+           off_t data_to_go;
            if (taper1->dumper) {
-               tapeq_size += sched(taper1->disk)->est_size - taper1->written;
+               data_to_go = sched(taper1->disk)->est_size - taper1->written;
            } else {
-               tapeq_size += sched(taper1->disk)->act_size - taper1->written;
+               data_to_go = sched(taper1->disk)->act_size - taper1->written;
            }
+           if (data_to_go > taper1->left) {
+               data_next_tape += data_to_go - taper1->left;
+               data_lost += taper1->written + taper1->left;
+           } else {
+               data_free += taper1->left - data_to_go;
+           }
+           tapeq_size += data_to_go;
        }
     }
+    data_lost_next_tape = tape_length + data_free - data_next_tape - runq_size - directq_size - tapeq_size;
+    driver_debug(1, _("data_lost: %lld\n"), (long long)data_lost);
+    driver_debug(1, _("data_free: %lld\n"), (long long)data_free);
+    driver_debug(1, _("data_next_tape: %lld\n"), (long long)data_next_tape);
+    driver_debug(1, _("data_lost_next_tape: %lld\n"), (long long)data_lost_next_tape);
+;
     driver_debug(1, _("tapeq_size: %lld\n"), (long long)tapeq_size);
 
     sched_size = runq_size + directq_size + tapeq_size + dumpers_size;
@@ -3733,19 +3794,6 @@ tape_action(
            nb_taper_active++;
        }
     }
-    if (nb_taper_active >= 1) {
-    my_flush_threshold_dumped = flush_threshold_dumped +
-                               (nb_taper_active-nb_taper_active) * tape_length;
-    my_flush_threshold_scheduled = flush_threshold_scheduled +
-                                  (nb_taper_active-nb_taper_active) * tape_length;
-    my_taperflush = taperflush + (nb_taper_active-nb_taper_active) * tape_length;
-    } else {
-    my_flush_threshold_dumped = flush_threshold_dumped +
-                               nb_taper_active * tape_length;
-    my_flush_threshold_scheduled = flush_threshold_scheduled +
-                                  nb_taper_active * tape_length;
-    my_taperflush = taperflush + nb_taper_active * tape_length;
-    }
 
     // Changing conditionals can produce a driver hang, take care.
     // 
@@ -3758,8 +3806,9 @@ tape_action(
            result |= TAPE_ACTION_NO_NEW_TAPE;
        } else if (current_tape < conf_runtapes &&
                   taper_nb_scan_volume == 0 &&
-                  ((my_flush_threshold_dumped < tapeq_size &&
-                    my_flush_threshold_scheduled < sched_size) ||
+                  ((flush_threshold_dumped < tapeq_size &&
+                    flush_threshold_scheduled < sched_size) ||
+                   (data_lost > data_lost_next_tape) ||
                    nb_taper_active == 0) &&
                   (last_started_taper == NULL ||
                    last_started_taper == taper)) {
@@ -3772,16 +3821,17 @@ tape_action(
         !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
-         (my_flush_threshold_dumped < tapeq_size &&    // flush-threshold-dumped &&
-         my_flush_threshold_scheduled < sched_size) || //  flush-threshold-scheduled
-        (my_taperflush < tapeq_size &&                 // taperflush
+         (flush_threshold_dumped < tapeq_size &&       // flush-threshold-dumped &&
+         flush_threshold_scheduled < sched_size) ||    //  flush-threshold-scheduled
+        (data_lost > data_lost_next_tape) ||
+        (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) &&
-              (my_taperflush >= tapeq_size &&          // taperflush criteria
+              (taperflush >= tapeq_size &&             // taperflush criteria
               (force_flush == 1 ||                     //  if force_flush
                dump_to_disk_terminated))               //  or all dump to disk
              ) {
@@ -3802,9 +3852,9 @@ tape_action(
            (taper->state & TAPER_STATE_TAPE_STARTED ||         // tape already started 
              !empty(roomq) ||                                  // holding disk constraint
              idle_reason == IDLE_NO_DISKSPACE ||               // holding disk constraint
-             (my_flush_threshold_dumped < tapeq_size &&                // flush-threshold-dumped &&
-             my_flush_threshold_scheduled < sched_size) ||     //  flush-threshold-scheduled
-             (force_flush == 1 && my_taperflush < tapeq_size))) {      // taperflush if force_flush
+             (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
 
            if (nb_taper_flushing == 0) {
                result |= TAPE_ACTION_START_A_FLUSH;
@@ -3817,14 +3867,13 @@ tape_action(
 }
 
 static int
-all_taper_idle(void)
+no_taper_flushing(void)
 {
     taper_t *taper;
 
     for (taper = tapetable; taper < tapetable + conf_taper_parallel_write;
         taper++) {
-       if (taper->state & TAPER_STATE_DUMP_TO_TAPE ||
-           taper->state & TAPER_STATE_FILE_TO_TAPE)
+       if (taper->state & TAPER_STATE_FILE_TO_TAPE)
            return 0;
     }
     return 1;
index 1cfb530dddd5d78b53c1142fb29bdb284af7d00c..ddaaeda2f634843dc0ab58123aad61467dc199b0 100644 (file)
@@ -804,7 +804,7 @@ chunker_cmd(
                                " ", disk2serial(dp),
                                "\n",  NULL);
        } else {
-           cmdline = vstralloc(cmdstr[cmd], "\n");
+           cmdline = vstralloc(cmdstr[cmd], "\n", NULL);
        }
        break;
     default:
index 13c8b65fdc8d6a7799aafc76645fe7536a6bab80..407628bba83f9d08dfcdd8f5383438b17fb78c3d 100644 (file)
@@ -1491,7 +1491,11 @@ read_mesgfd(
        /* Use the first in the dataport_list */
        in_port_t data_port;
        char *data_host = dataport_list;
-       char *s= strchr(dataport_list, ':');
+       char *s;
+
+       s = strchr(dataport_list, ',');
+       if (s) *s = '\0';  /* use first data_port */
+       s = strrchr(dataport_list, ':');
        *s = '\0';
        s++;
        data_port = atoi(s);
index 74b712c464865e9f3a3f177c750a8c5a7ac9d961..0edd6af8bfd3c28f2f981a6d86fdb4ad94549eeb 100644 (file)
@@ -48,6 +48,7 @@ static gboolean logfile_has_tape(char * label, char * datestamp,
                                  char * logfile);
 
 static char *find_sort_order = NULL;
+static GStringChunk *string_chunk = NULL;
 
 find_result_t * find_dump(disklist_t* diskqp) {
     char *conf_logdir, *logfile = NULL;
@@ -57,6 +58,9 @@ find_result_t * find_dump(disklist_t* diskqp) {
     find_result_t *output_find = NULL;
     gboolean *tape_seen = NULL;
 
+    if (string_chunk == NULL) {
+       string_chunk = g_string_chunk_new(32768);
+    }
     conf_logdir = config_dir_relative(getconf_str(CNF_LOGDIR));
     maxtape = lookup_nb_tape();
     tape_seen = g_new0(gboolean, maxtape+1);
@@ -225,6 +229,10 @@ search_holding_disk(
 
     holding_file_list = holding_get_files(NULL, 1);
 
+    if (string_chunk == NULL) {
+       string_chunk = g_string_chunk_new(32768);
+    }
+
     for(e = holding_file_list; e != NULL; e = e->next) {
        dumpfile_t file;
 
@@ -263,24 +271,26 @@ search_holding_disk(
        if(find_match(file.name,file.disk)) {
            find_result_t *new_output_find = g_new0(find_result_t, 1);
            new_output_find->next=*output_find;
-           new_output_find->timestamp = stralloc(file.datestamp);
-           new_output_find->write_timestamp = stralloc("00000000000000");
-           new_output_find->hostname = stralloc(file.name);
-           new_output_find->diskname = stralloc(file.disk);
+           new_output_find->timestamp = g_string_chunk_insert_const(string_chunk, file.datestamp);
+           new_output_find->write_timestamp = g_string_chunk_insert_const(string_chunk, "00000000000000");
+           new_output_find->hostname = g_string_chunk_insert_const(string_chunk, file.name);
+           new_output_find->diskname = g_string_chunk_insert_const(string_chunk, file.disk);
            new_output_find->level=file.dumplevel;
-           new_output_find->label=stralloc(holding_file);
+           new_output_find->label=g_string_chunk_insert_const(string_chunk, holding_file);
            new_output_find->partnum = -1;
            new_output_find->totalparts = -1;
            new_output_find->filenum=0;
            if (file.is_partial) {
-               new_output_find->status=stralloc("PARTIAL");
-               new_output_find->dump_status=stralloc("PARTIAL");
+               new_output_find->status="PARTIAL";
+               new_output_find->dump_status="PARTIAL";
            } else {
-               new_output_find->status=stralloc("OK");
-               new_output_find->dump_status=stralloc("OK");
+               new_output_find->status="OK";
+               new_output_find->dump_status="OK";
            }
-           new_output_find->message=stralloc("");
+           new_output_find->message="";
            new_output_find->kb = holding_file_size(holding_file, 1);
+           new_output_find->bytes = 0;
+
            new_output_find->orig_kb = file.orig_size;
 
            *output_find=new_output_find;
@@ -513,14 +523,6 @@ free_find_result(
            output_find_result;
            output_find_result=output_find_result->next) {
        amfree(prev);
-       amfree(output_find_result->timestamp);
-       amfree(output_find_result->write_timestamp);
-       amfree(output_find_result->hostname);
-       amfree(output_find_result->diskname);
-       amfree(output_find_result->label);
-       amfree(output_find_result->status);
-       amfree(output_find_result->dump_status);
-       amfree(output_find_result->message);
        prev = output_find_result;
     }
     amfree(prev);
@@ -624,9 +626,10 @@ parse_taper_datestamp_log(
        return 0;
     }
     *label = s - 1;
-    skip_non_whitespace(s, ch);
+    skip_quoted_string(s, ch);
     s[-1] = '\0';
 
+    *label = unquote_string(*label);
     return 1;
 }
 
@@ -634,7 +637,7 @@ parse_taper_datestamp_log(
 static gboolean logfile_has_tape(char * label, char * datestamp,
                                  char * logfile) {
     FILE * logf;
-    char * ck_datestamp, *ck_label;
+    char * ck_datestamp, *ck_label = NULL;
     if((logf = fopen(logfile, "r")) == NULL) {
        error(_("could not open logfile %s: %s"), logfile, strerror(errno));
        /*NOTREACHED*/
@@ -648,9 +651,11 @@ static gboolean logfile_has_tape(char * label, char * datestamp,
                          logfile, curstr);
            } else if(strcmp(ck_datestamp, datestamp) == 0
                      && strcmp(ck_label, label) == 0) {
+               amfree(ck_label);
                 afclose(logf);
                 return TRUE;
            }
+           amfree(ck_label);
        }
     }
 
@@ -718,12 +723,16 @@ search_logfile(
     gboolean found_something = FALSE;
     double sec;
     off_t kb;
+    off_t bytes;
     off_t orig_kb;
     int   taper_part = 0;
 
     g_return_val_if_fail(output_find != NULL, 0);
     g_return_val_if_fail(logfile != NULL, 0);
 
+    if (string_chunk == NULL) {
+       string_chunk = g_string_chunk_new(32768);
+    }
     valid_label = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL);
     part_by_dle = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL);
     datestamp = g_strdup(passed_datestamp);
@@ -746,6 +755,7 @@ search_logfile(
                 if (strcmp(datestamp, ck_datestamp) != 0) {
                     g_printf(_("Log file %s stamped %s, expecting %s!\n"),
                              logfile, ck_datestamp, datestamp);
+                   amfree(ck_label);
                     break;
                 }
             }
@@ -759,7 +769,7 @@ search_logfile(
                found_something = TRUE;
            }
             amfree(current_label);
-            current_label = g_strdup(ck_label);
+            current_label = ck_label;
             if (datestamp == NULL) {
                 datestamp = g_strdup(ck_datestamp);
             }
@@ -791,15 +801,19 @@ search_logfile(
            }
 
            if (curlog == L_PART || curlog == L_PARTPARTIAL) {
-               char * part_label = s - 1;
+               char *part_label;
+               char *qpart_label = s - 1;
                taper_part++;
-               skip_non_whitespace(s, ch);
+               skip_quoted_string(s, ch);
                s[-1] = '\0';
 
-               if (!g_hash_table_lookup(valid_label, part_label))
+               part_label = unquote_string(qpart_label);
+               if (!g_hash_table_lookup(valid_label, part_label)) {
+                   amfree(part_label);
                    continue;
+               }
                amfree(current_label);
-               current_label = stralloc(part_label);
+               current_label = part_label;
 
                skip_whitespace(s, ch);
                if(ch == '\0') {
@@ -858,26 +872,37 @@ search_logfile(
                level = atoi(date);
                date = stralloc(datestamp);
                partnum = 1;
-               totalparts =1;
+               totalparts = 1;
            } else {
                if (curprog == P_TAPER &&
                        (curlog == L_CHUNK || curlog == L_PART ||
                         curlog == L_PARTPARTIAL || curlog == L_PARTIAL ||
                         curlog == L_DONE)) {
+                   char *s1, ch1;
                    skip_whitespace(s, ch);
                    number = s - 1;
                    skip_non_whitespace(s, ch);
-                   s[-1] = '\0';
-                   sscanf(number, "%d/%d", &partnum, &totalparts);
-                   if (partnum > maxparts)
-                       maxparts = partnum;
-                   if (totalparts > maxparts)
-                       maxparts = totalparts;
+                   s1 = &s[-1];
+                   ch1 = *s1;
+                   skip_whitespace(s, ch);
+                   if (*(s-1) != '[') {
+                       *s1 = ch1;
+                       sscanf(number, "%d/%d", &partnum, &totalparts);
+                       if (partnum > maxparts)
+                           maxparts = partnum;
+                       if (totalparts > maxparts)
+                           maxparts = totalparts;
+                   } else { /* nparts is not in all PARTIAL lines */
+                       partnum = 1;
+                       totalparts = 1;
+                       s = number + 1;
+                   }
+               } else {
+                   skip_whitespace(s, ch);
                }
-               skip_whitespace(s, ch);
                if(ch == '\0' || sscanf(s - 1, "%d", &level) != 1) {
-                   g_printf(_("strange log line in %s \"%s\"\n"),
-                   logfile, curstr);
+                   g_printf(_("Fstrange log line in %s \"%s\"\n"),
+                   logfile, s-1);
                    continue;
                }
                skip_integer(s, ch);
@@ -907,7 +932,8 @@ search_logfile(
                skip_non_whitespace(s, ch);
                rest_undo = s - 1;
                *rest_undo = '\0';
-               if (strcmp(rest, "kb") != 0) {
+               if (strcmp(rest, "kb") != 0 &&
+                   strcmp(rest, "bytes") != 0) {
                    g_printf(_("Bstrange log line in %s \"%s\"\n"),
                             logfile, curstr);
                    continue;
@@ -919,7 +945,13 @@ search_logfile(
                              logfile, curstr);
                     continue;
                }
-               kb = atof(s - 1);
+               if (strcmp(rest, "kb") == 0) {
+                   kb = atof(s - 1);
+                   bytes = 0;
+               } else {
+                   bytes = atof(s - 1);
+                   kb = bytes / 1024;
+               }
                skip_non_whitespace(s, ch);
                skip_whitespace(s, ch);
                rest = s - 1;
@@ -960,6 +992,7 @@ search_logfile(
            } else {
                sec = 0;
                kb = 0;
+               bytes = 0;
                orig_kb = 0;
                *rest_undo = ' ';
            }
@@ -982,25 +1015,37 @@ search_logfile(
                                        host, disk, date, level);
                    find_result_t *new_output_find = g_new0(find_result_t, 1);
                    part_find = g_hash_table_lookup(part_by_dle, key);
-                   new_output_find->timestamp = stralloc(date);
-                   new_output_find->write_timestamp = stralloc(datestamp);
-                   new_output_find->hostname=stralloc(host);
-                   new_output_find->diskname=stralloc(disk);
+                   maxparts = partnum;
+                   if (maxparts < totalparts)
+                       maxparts = totalparts;
+                   for (a_part_find = part_find;
+                        a_part_find;
+                        a_part_find = a_part_find->next) {
+                       if (maxparts < a_part_find->partnum)
+                           maxparts = a_part_find->partnum;
+                       if (maxparts < a_part_find->totalparts)
+                           maxparts = a_part_find->totalparts;
+                   }
+                   new_output_find->timestamp = g_string_chunk_insert_const(string_chunk, date);
+                   new_output_find->write_timestamp = g_string_chunk_insert_const(string_chunk, datestamp);
+                   new_output_find->hostname=g_string_chunk_insert_const(string_chunk, host);
+                   new_output_find->diskname=g_string_chunk_insert_const(string_chunk, disk);
                    new_output_find->level=level;
                    new_output_find->partnum = partnum;
                    new_output_find->totalparts = totalparts;
-                    new_output_find->label=stralloc(current_label);
+                   new_output_find->label=g_string_chunk_insert_const(string_chunk, current_label);
                    new_output_find->status=NULL;
                    new_output_find->dump_status=NULL;
-                   new_output_find->message=stralloc("");
+                   new_output_find->message="";
                    new_output_find->filenum=filenum;
                    new_output_find->sec=sec;
                    new_output_find->kb=kb;
+                   new_output_find->bytes=bytes;
                    new_output_find->orig_kb=orig_kb;
                    new_output_find->next=NULL;
                    if (curlog == L_SUCCESS) {
-                       new_output_find->status = stralloc("OK");
-                       new_output_find->dump_status = stralloc("OK");
+                       new_output_find->status = "OK";
+                       new_output_find->dump_status = "OK";
                        new_output_find->next = *output_find;
                        new_output_find->partnum = 1; /* L_SUCCESS is pre-splitting */
                        *output_find = new_output_find;
@@ -1013,13 +1058,11 @@ search_logfile(
                            for (a_part_find = part_find;
                                 a_part_find;
                                 a_part_find = a_part_find->next) {
-                               amfree(a_part_find->dump_status);
                                if (curlog == L_PARTIAL)
-                                   a_part_find->dump_status = stralloc("PARTIAL");
+                                   a_part_find->dump_status = "PARTIAL";
                                else {
-                                   a_part_find->dump_status = stralloc("FAIL");
-                                   amfree(a_part_find->message);
-                                   a_part_find->message = stralloc(rest);
+                                   a_part_find->dump_status = "FAIL";
+                                   a_part_find->message = g_string_chunk_insert_const(string_chunk, rest);
                                }
                            }
                        } else {
@@ -1037,16 +1080,12 @@ search_logfile(
                                for (a_part_find = part_find;
                                     a_part_find;
                                     a_part_find = a_part_find->next) {
-                                   amfree(a_part_find->dump_status);
                                    if (num_part == 0) {
-                                       a_part_find->dump_status =
-                                               stralloc("OK");
+                                       a_part_find->dump_status = "OK";
                                    } else {
-                                       a_part_find->dump_status =
-                                               stralloc("FAIL");
-                                       amfree(a_part_find->message);
+                                       a_part_find->dump_status = "FAIL";
                                        a_part_find->message =
-                                               stralloc("Missing part");
+                                               g_string_chunk_insert_const(string_chunk, "Missing part");
                                    }
                                }
                            }
@@ -1079,11 +1118,11 @@ search_logfile(
                        free_find_result(&new_output_find);
                    } else { /* part line */
                        if (curlog == L_PART || curlog == L_CHUNK) {
-                           new_output_find->status=stralloc("OK");
-                           new_output_find->dump_status=stralloc("OK");
+                           new_output_find->status = "OK";
+                           new_output_find->dump_status = "OK";
                        } else { /* PARTPARTIAL */
-                           new_output_find->status=stralloc("PARTIAL");
-                           new_output_find->dump_status=stralloc("PARTIAL");
+                           new_output_find->status = "PARTIAL";
+                           new_output_find->dump_status = "PARTIAL";
                        }
                        /* Add to part_find list */
                        if (part_find) {
@@ -1100,16 +1139,17 @@ search_logfile(
                    amfree(key);
                }
                else if(curlog == L_FAIL) {
+                   char *status_failed;
                    /* print other failures too -- this is a hack to ensure that failures which
                     * did not make it to tape are also listed in the output of 'amadmin x find';
                     * users that do not want this information (e.g., Amanda::DB::Catalog) should
                     * filter dumps with a NULL label. */
                    find_result_t *new_output_find = g_new0(find_result_t, 1);
                    new_output_find->next = *output_find;
-                   new_output_find->timestamp = stralloc(date);
+                   new_output_find->timestamp = g_string_chunk_insert_const(string_chunk, date);
                    new_output_find->write_timestamp = g_strdup("00000000000000"); /* dump was not written.. */
-                   new_output_find->hostname=stralloc(host);
-                   new_output_find->diskname=stralloc(disk);
+                   new_output_find->hostname=g_string_chunk_insert_const(string_chunk, host);
+                   new_output_find->diskname=g_string_chunk_insert_const(string_chunk, disk);
                    new_output_find->level=level;
                    new_output_find->label=NULL;
                    new_output_find->partnum=partnum;
@@ -1117,15 +1157,18 @@ search_logfile(
                    new_output_find->filenum=0;
                    new_output_find->sec=sec;
                    new_output_find->kb=kb;
-                   new_output_find->kb=orig_kb;
-                   new_output_find->status=vstralloc(
+                   new_output_find->bytes=bytes;
+                   new_output_find->orig_kb=orig_kb;
+                   status_failed = vstralloc(
                         "FAILED (",
                         program_str[(int)curprog],
                         ") ",
                         rest,
                         NULL);
-                   new_output_find->dump_status=stralloc("");
-                   new_output_find->message=stralloc("");
+                   new_output_find->status = g_string_chunk_insert_const(string_chunk, status_failed);
+                   amfree(status_failed);
+                   new_output_find->dump_status="";
+                   new_output_find->message="";
                    *output_find=new_output_find;
                     found_something = TRUE;
                    maxparts = -1;
@@ -1179,19 +1222,20 @@ dumps_match(
            find_result_t *curmatch = g_new0(find_result_t, 1);
            memcpy(curmatch, cur_result, SIZEOF(find_result_t));
 
-           curmatch->timestamp = stralloc(cur_result->timestamp);
-           curmatch->write_timestamp = stralloc(cur_result->write_timestamp);
-           curmatch->hostname = stralloc(cur_result->hostname);
-           curmatch->diskname = stralloc(cur_result->diskname);
+           curmatch->timestamp = cur_result->timestamp;
+           curmatch->write_timestamp = cur_result->write_timestamp;
+           curmatch->hostname = cur_result->hostname;
+           curmatch->diskname = cur_result->diskname;
            curmatch->level = cur_result->level;
-           curmatch->label = cur_result->label? stralloc(cur_result->label) : NULL;
+           curmatch->label = cur_result->label? cur_result->label : NULL;
            curmatch->filenum = cur_result->filenum;
            curmatch->sec = cur_result->sec;
            curmatch->kb = cur_result->kb;
+           curmatch->bytes = cur_result->bytes;
            curmatch->orig_kb = cur_result->orig_kb;
-           curmatch->status = stralloc(cur_result->status);
-           curmatch->dump_status = stralloc(cur_result->dump_status);
-           curmatch->message = stralloc(cur_result->message);
+           curmatch->status = cur_result->status;
+           curmatch->dump_status = cur_result->dump_status;
+           curmatch->message = cur_result->message;
            curmatch->partnum = cur_result->partnum;
            curmatch->totalparts = cur_result->totalparts;
            curmatch->next = matches;
@@ -1257,16 +1301,16 @@ dumps_match_dumpspecs(
                find_result_t *curmatch = alloc(SIZEOF(find_result_t));
                memcpy(curmatch, cur_result, SIZEOF(find_result_t));
 
-               curmatch->timestamp = stralloc(cur_result->timestamp);
-               curmatch->write_timestamp = stralloc(cur_result->write_timestamp);
-               curmatch->hostname = stralloc(cur_result->hostname);
-               curmatch->diskname = stralloc(cur_result->diskname);
+               curmatch->timestamp = cur_result->timestamp;
+               curmatch->write_timestamp = cur_result->write_timestamp;
+               curmatch->hostname = cur_result->hostname;
+               curmatch->diskname = cur_result->diskname;
                curmatch->level = cur_result->level;
-               curmatch->label = cur_result->label? stralloc(cur_result->label) : NULL;
+               curmatch->label = cur_result->label? cur_result->label : NULL;
                curmatch->filenum = cur_result->filenum;
-               curmatch->status = stralloc(cur_result->status);
-               curmatch->dump_status = stralloc(cur_result->dump_status);
-               curmatch->message = stralloc(cur_result->message);
+               curmatch->status = cur_result->status;
+               curmatch->dump_status =  cur_result->dump_status;
+               curmatch->message = cur_result->message;
                curmatch->partnum = cur_result->partnum;
                curmatch->totalparts = cur_result->totalparts;
 
index ac97c3af9562d42247dc8d871d5f2546c81a934f..c9c1d193b0f8802d0015fa37215b328bd14db5b6 100644 (file)
@@ -20,6 +20,7 @@ typedef struct find_result_s {
     int partnum;       /* -1 for holding files */
     int totalparts;    /* -1 for holding files */
     double sec;                /* may be 0.0 for older log files or holding files */
+    off_t bytes;       /* may be 0 for older log files, can be compressed */
     off_t kb;          /* may be 0 for older log files, can be compressed */
     off_t orig_kb;      /* native size */
     void *user_ptr;
index 060f07f8e44dd2eccbf1033be75c101f4863f90c..283141192aa2ebe9e16f63a03904f73b9b0a59f4 100644 (file)
@@ -89,8 +89,10 @@ add_dir_list_item(
        return 0; /* added */
     }
 
-    if(strcmp(path,dir_last->path) == 0)
+    if (strcmp(path, "/") != 0 &&
+       strcmp(path, dir_last->path) == 0) {
        return 0; /* found */
+    }
 
     /* add at head of list */
     if(strcmp(path,dir_list->path) < 0)
index e2c1497c76f221d5eedcb5aca31423de0c06d9a9..eceb2bc9bd04a06c6c14677fae06985e65c7b0ad 100644 (file)
@@ -191,6 +191,7 @@ main(
     int    planner_setuid;
     int exit_status = EXIT_SUCCESS;
     gboolean no_taper = FALSE;
+    gboolean from_client = FALSE;
 
     /*
      * Configure program for internationalization:
@@ -265,7 +266,13 @@ main(
        no_taper = TRUE;
        diskarg_offset += 1;
     }
+    if (argc - diskarg_offset > 0 && strcmp(argv[diskarg_offset], "--from-client") == 0) {
+       from_client = TRUE;
+       diskarg_offset += 1;
+    }
+
 
+    run_server_global_scripts(EXECUTE_ON_PRE_ESTIMATE, get_config_name());
 
     /*
      * 1. Networking Setup
@@ -315,7 +322,7 @@ main(
     conf_tapecycle = getconf_int(CNF_TAPECYCLE);
     conf_etimeout = (time_t)getconf_int(CNF_ETIMEOUT);
     conf_reserve  = getconf_int(CNF_RESERVE);
-    conf_autoflush = getconf_boolean(CNF_AUTOFLUSH);
+    conf_autoflush = getconf_no_yes_all(CNF_AUTOFLUSH);
     conf_usetimestamps = getconf_boolean(CNF_USETIMESTAMPS);
 
     today = time(0);
@@ -341,6 +348,19 @@ main(
        g_fprintf(stderr,"%s",errstr);
         exit_status = EXIT_FAILURE;
     }
+
+    for (dp = origq.head; dp != NULL; dp = dp->next) {
+       if (dp->todo) {
+           if (from_client) {
+               if (!dp->dump_limit || !dp->dump_limit->same_host)
+                   dp->todo = 0;
+           } else {
+               if (dp->dump_limit && !dp->dump_limit->server)
+                   dp->todo = 0;
+           }
+       }
+    }
+
     nb_disk = 0;
     for (dp = origq.head; dp != NULL; dp = dp->next) {
        if (dp->todo) {
@@ -436,7 +456,8 @@ main(
            }
 
            /* see if this matches the command-line arguments */
-           if (!match_dumpfile(&file, argc-diskarg_offset,
+           if (conf_autoflush == 1 &&
+               !match_dumpfile(&file, argc-diskarg_offset,
                                       argv+diskarg_offset)) {
                continue;
            }
@@ -552,6 +573,8 @@ main(
     while(!empty(estq)) analyze_estimate(dequeue_disk(&estq));
     while(!empty(failq)) handle_failed(dequeue_disk(&failq));
 
+    run_server_global_scripts(EXECUTE_ON_POST_ESTIMATE, get_config_name());
+
     /*
      * At this point, all the disks are on schedq sorted by priority.
      * The total estimated size of the backups is in total_size.
@@ -1321,15 +1344,11 @@ static void get_estimates(void)
            hostp = dp->host;
            if(hostp->up == HOST_READY) {
                something_started = 1;
+               run_server_host_scripts(EXECUTE_ON_PRE_HOST_ESTIMATE,
+                                       get_config_name(), hostp);
                for(dp1 = hostp->disks; dp1 != NULL; dp1 = dp1->hostnext) {
                    if (dp1->todo)
-                       run_server_scripts(EXECUTE_ON_PRE_HOST_ESTIMATE,
-                                          get_config_name(), dp1,
-                                          est(dp1)->estimate[0].level);
-               }
-               for(dp1 = hostp->disks; dp1 != NULL; dp1 = dp1->hostnext) {
-                   if (dp1->todo)
-                       run_server_scripts(EXECUTE_ON_PRE_DLE_ESTIMATE,
+                       run_server_dle_scripts(EXECUTE_ON_PRE_DLE_ESTIMATE,
                                           get_config_name(), dp1,
                                           est(dp1)->estimate[0].level);
                }
@@ -1809,8 +1828,12 @@ static void handle_result(
     hostp->up = HOST_READY;
 
     if (pkt == NULL) {
-       errbuf = vstrallocf(_("Request to %s failed: %s"),
+       if (strcmp(security_geterror(sech), "timeout waiting for REP") == 0) {
+           errbuf = vstrallocf("Some estimate timeout on %s, using server estimate if possible", hostp->hostname);
+       } else {
+           errbuf = vstrallocf(_("Request to %s failed: %s"),
                        hostp->hostname, security_geterror(sech));
+       }
        goto error_return;
     }
     if (pkt->type == P_NAK) {
@@ -2064,7 +2087,7 @@ static void handle_result(
                est(dp)->estimate[1].nsize > (gint64)0) &&
              (est(dp)->estimate[2].level == -1 ||
                est(dp)->estimate[2].nsize > (gint64)0)))) {
-           run_server_scripts(EXECUTE_ON_POST_DLE_ESTIMATE,
+           run_server_dle_scripts(EXECUTE_ON_POST_DLE_ESTIMATE,
                               get_config_name(), dp,
                                est(dp)->estimate[0].level);
            est(dp)->post_dle = 1;
@@ -2073,13 +2096,9 @@ static void handle_result(
     }
 
     if(hostp->up == HOST_DONE) {
-       for(dp = hostp->disks; dp != NULL; dp = dp->hostnext) {
-           if (dp->todo)
-               if (pkt->type == P_REP) {
-                   run_server_scripts(EXECUTE_ON_POST_HOST_ESTIMATE,
-                                      get_config_name(), dp,
-                                       est(dp)->estimate[0].level);
-           }
+       if (pkt->type == P_REP) {
+           run_server_host_scripts(EXECUTE_ON_POST_HOST_ESTIMATE,
+                                   get_config_name(), hostp);
        }
     }
 
@@ -2263,7 +2282,15 @@ static void analyze_estimate(
        lev0size = est_tape_size(dp, 0);
        if(lev0size == (gint64)-1) lev0size = ep->last_lev0size;
 
-       balanced_size += (double)(lev0size / (gint64)runs_per_cycle);
+       if (dp->strategy == DS_NOINC) {
+           balanced_size += (double)lev0size;
+       } else if (dp->dumpcycle == 0) {
+           balanced_size += (double)(lev0size * conf_dumpcycle / (gint64)runs_per_cycle);
+       } else if (dp->dumpcycle != conf_dumpcycle) {
+           balanced_size += (double)(lev0size * (conf_dumpcycle / dp->dumpcycle) / (gint64)runs_per_cycle);
+       } else {
+           balanced_size += (double)(lev0size / (gint64)runs_per_cycle);
+       }
     }
 
     g_fprintf(stderr,_("total size %lld total_lev0 %1.0lf balanced-lev0size %1.0lf\n"),
@@ -2464,7 +2491,7 @@ static void delay_dumps(void)
 
     for(dp = schedq.head; dp != NULL; dp = ndp) {
        int avail_tapes = 1;
-       if (dp->splitsize > (gint64)0)
+       if (dp->splitsize > (gint64)0 || dp->allow_split)
            avail_tapes = conf_runtapes;
 
        ndp = dp->next; /* remove_disk zaps this */
index 24a91ff9625ac2af1a2ea47b9ecdf3422a4eaa23..4ef6e884bcda74f6f3753b4cea6745c0759c9955 100644 (file)
@@ -244,6 +244,8 @@ run_server_script(
     char      *line;
     char      *plugin;
     char       level_number[NUM_STR_SIZE];
+    struct stat cmd_stat;
+    int         result;
 
     if ((pp_script_get_execute_on(pp_script) & execute_on) == 0)
        return;
@@ -251,40 +253,78 @@ run_server_script(
        return;
 
     plugin = pp_script_get_plugin(pp_script);
+
     cmd = vstralloc(APPLICATION_DIR, "/", plugin, NULL);
+    result = stat(cmd, &cmd_stat);
+    if (result == -1) {
+       dbprintf("Can't stat script '%s': %s\n", cmd, strerror(errno));
+       amfree(cmd);
+       cmd = vstralloc(get_config_dir(), "/application/", plugin, NULL);
+       result = stat(cmd, &cmd_stat);
+       if (result == -1) {
+           dbprintf("Can't stat script '%s': %s\n", cmd, strerror(errno));
+           amfree(cmd);
+           cmd = vstralloc(CONFIG_DIR, "/application/", plugin, NULL);
+           result = stat(cmd, &cmd_stat);
+           if (result == -1) {
+               dbprintf("Can't stat script '%s': %s\n", cmd, strerror(errno));
+               amfree(cmd);
+               cmd = vstralloc(APPLICATION_DIR, "/", plugin, NULL);
+           }
+       }
+    }
+
     g_ptr_array_add(argv_ptr, stralloc(plugin));
 
     switch (execute_on) {
+    case EXECUTE_ON_PRE_AMCHECK:
+       command = "PRE-AMCHECK";
+       break;
     case EXECUTE_ON_PRE_DLE_AMCHECK:
        command = "PRE-DLE-AMCHECK";
        break;
     case EXECUTE_ON_PRE_HOST_AMCHECK:
        command = "PRE-HOST-AMCHECK";
        break;
+    case EXECUTE_ON_POST_AMCHECK:
+       command = "POST-AMCHECK";
+       break;
     case EXECUTE_ON_POST_DLE_AMCHECK:
        command = "POST-DLE-AMCHECK";
        break;
     case EXECUTE_ON_POST_HOST_AMCHECK:
        command = "POST-HOST-AMCHECK";
        break;
+    case EXECUTE_ON_PRE_ESTIMATE:
+       command = "PRE-ESTIMATE";
+       break;
     case EXECUTE_ON_PRE_DLE_ESTIMATE:
        command = "PRE-DLE-ESTIMATE";
        break;
     case EXECUTE_ON_PRE_HOST_ESTIMATE:
        command = "PRE-HOST-ESTIMATE";
        break;
+    case EXECUTE_ON_POST_ESTIMATE:
+       command = "POST-ESTIMATE";
+       break;
     case EXECUTE_ON_POST_DLE_ESTIMATE:
        command = "POST-DLE-ESTIMATE";
        break;
     case EXECUTE_ON_POST_HOST_ESTIMATE:
        command = "POST-HOST-ESTIMATE";
        break;
+    case EXECUTE_ON_PRE_BACKUP:
+       command = "PRE-BACKUP";
+       break;
     case EXECUTE_ON_PRE_DLE_BACKUP:
        command = "PRE-DLE-BACKUP";
        break;
     case EXECUTE_ON_PRE_HOST_BACKUP:
        command = "PRE-HOST-BACKUP";
        break;
+    case EXECUTE_ON_POST_BACKUP:
+       command = "POST-BACKUP";
+       break;
     case EXECUTE_ON_POST_DLE_BACKUP:
        command = "POST-DLE-BACKUP";
        break;
@@ -352,7 +392,7 @@ run_server_script(
 
 
 void
-run_server_scripts(
+run_server_dle_scripts(
     execute_on_t  execute_on,
     char         *config,
     disk_t      *dp,
@@ -368,6 +408,84 @@ run_server_scripts(
     }
 }
 
+void
+run_server_host_scripts(
+    execute_on_t  execute_on,
+    char         *config,
+    am_host_t   *hostp)
+{
+    identlist_t pp_scriptlist;
+    disk_t *dp;
+
+    GHashTable* executed = g_hash_table_new_full(g_str_hash, g_str_equal,
+                                                NULL, NULL);
+    for (dp = hostp->disks; dp != NULL; dp = dp->hostnext) {
+       if (dp->todo) {
+           for (pp_scriptlist = dp->pp_scriptlist; pp_scriptlist != NULL;
+                pp_scriptlist = pp_scriptlist->next) {
+               int todo = 1;
+               pp_script_t *pp_script = lookup_pp_script((char *)pp_scriptlist->data);
+               g_assert(pp_script != NULL);
+               if (pp_script_get_single_execution(pp_script)) {
+                   todo = g_hash_table_lookup(executed,
+                                              pp_script_get_plugin(pp_script))
+                          == NULL;
+               }
+               if (todo) {
+                   run_server_script(pp_script, execute_on, config, dp, -1);
+                   if (pp_script_get_single_execution(pp_script)) {
+                       g_hash_table_insert(executed,
+                                           pp_script_get_plugin(pp_script),
+                                           GINT_TO_POINTER(1));
+                   }
+               }
+           }
+       }
+    }
+
+    g_hash_table_destroy(executed);
+}
+
+void
+run_server_global_scripts(
+    execute_on_t  execute_on,
+    char         *config)
+{
+    identlist_t  pp_scriptlist;
+    disk_t      *dp;
+    am_host_t   *host;
+
+    GHashTable* executed = g_hash_table_new_full(g_str_hash, g_str_equal,
+                                                NULL, NULL);
+    for (host = get_hostlist(); host != NULL; host = host->next) {
+       for (dp = host->disks; dp != NULL; dp = dp->hostnext) {
+           if (dp->todo) {
+               for (pp_scriptlist = dp->pp_scriptlist; pp_scriptlist != NULL;
+                    pp_scriptlist = pp_scriptlist->next) {
+                   int todo = 1;
+                   pp_script_t *pp_script =
+                                lookup_pp_script((char *)pp_scriptlist->data);
+                   g_assert(pp_script != NULL);
+                   if (pp_script_get_single_execution(pp_script)) {
+                       todo = g_hash_table_lookup(executed,
+                               pp_script_get_plugin(pp_script)) == NULL;
+                   }
+                   if (todo) {
+                       run_server_script(pp_script, execute_on, config,
+                                         dp, -1);
+                       if (pp_script_get_single_execution(pp_script)) {
+                           g_hash_table_insert(executed,
+                                       pp_script_get_plugin(pp_script),
+                                       GINT_TO_POINTER(1));
+                       }
+                   }
+               }
+           }
+       }
+    }
+    g_hash_table_destroy(executed);
+}
+
 void
 run_amcleanup(
     char *config_name)
index e7a2606edf4601ffe5cc08c853717225152b1faa..46eec8c8f58db125a40de68f1488b249acd2f271 100644 (file)
@@ -83,10 +83,15 @@ void run_server_script(pp_script_t  *pp_script,
                       char         *config,
                       disk_t       *dp,
                       int           level);
-void run_server_scripts(execute_on_t  execute_on,
-                       char         *config,
-                       disk_t       *dp,
-                       int           level);
+void run_server_dle_scripts(execute_on_t  execute_on,
+                           char         *config,
+                           disk_t       *dp,
+                           int           level);
+void run_server_host_scripts(execute_on_t  execute_on,
+                            char         *config,
+                            am_host_t    *hostp);
+void run_server_global_scripts(execute_on_t  execute_on,
+                              char         *config);
 
 void run_amcleanup(char *config_name);
 char *get_master_process(char *logfile);
index 406a0c426ee6e1d5340b3030799101d6c562b61b..b4212e5894238b47bc4d49e9801938ba26f4d78e 100644 (file)
@@ -104,6 +104,8 @@ write_tapelist(
        else g_fprintf(tapef, " no-reuse");
        if (tp->barcode)
            g_fprintf(tapef, " BARCODE:%s", tp->barcode);
+       if (tp->meta)
+           g_fprintf(tapef, " META:%s", tp->meta);
        if (tp->comment)
            g_fprintf(tapef, " #%s", tp->comment);
        g_fprintf(tapef, "\n");
@@ -398,6 +400,7 @@ parse_tapeline(
        s[-1] = '\0';
        skip_whitespace(s, ch);
     }
+
     if (strncmp_const(s - 1, "BARCODE:") == 0) {
        s1 = s - 1 + 8;
        skip_non_whitespace(s, ch);
@@ -408,6 +411,15 @@ parse_tapeline(
        tp->barcode = NULL;
     }
 
+    if (strncmp_const(s - 1, "META:") == 0) {
+       s1 = s - 1 + 5;
+       skip_non_whitespace(s, ch);
+       s[-1] = '\0';
+       skip_whitespace(s, ch);
+       tp->meta = stralloc(s1);
+    } else {
+       tp->meta = NULL;
+    }
 
     if (*(s - 1) == '#') {
        tp->comment = stralloc(s); /* skip leading '#' */
index 960edfb68171908583b1e44d7f5798fd6e43baeb..ac84417de6f7a0d7d5cc973b2de5b559c4eca10e 100644 (file)
@@ -41,6 +41,7 @@ typedef struct tape_s {
     int reuse;
     char *label;
     char *barcode;
+    char *meta;
     char *comment;
 } tape_t;
 
index 3b1c0092f9818747fdf29356af297c44c7e84f89..1ee47b21af5030a3ed4b49c548bbcd634f08756c 100644 (file)
@@ -24,7 +24,7 @@ use warnings;
 package main;
 
 use Amanda::Util qw( :constants );
-use Amanda::Config qw( :init );
+use Amanda::Config qw( :init :getconf );
 use Amanda::Logfile qw( :logtype_t log_add $amanda_log_trace_log );
 use Amanda::Debug;
 use Amanda::Taper::Controller;
@@ -63,8 +63,10 @@ Amanda::Debug::add_amanda_log_handler($amanda_log_trace_log);
 
 Amanda::Util::finish_setup($RUNNING_AS_DUMPUSER);
 
+my $tlf = Amanda::Config::config_dir_relative(getconf($CNF_TAPELIST));
+my $tl = Amanda::Tapelist->new($tlf);
 # transfer control to the Amanda::Taper::Controller class implemented above
-my $controller = Amanda::Taper::Controller->new();
+my $controller = Amanda::Taper::Controller->new(tapelist => $tl);
 $controller->start();
 Amanda::MainLoop::run();
 
index f481fd2af6962dc159b49e45e5a5003a784eabc5..441e841350300d986373319c90dac4cb990f6e70 100644 (file)
@@ -9,7 +9,7 @@ INCLUDES =      -I$(top_srcdir)/gnulib \
                -I$(top_srcdir)/common-src
 
 AM_CFLAGS = $(AMANDA_WARNING_CFLAGS)
-AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
+AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS) $(AS_NEEDED_FLAGS)
 
 amlib_LTLIBRARIES =    libamxfer.la
 
@@ -34,7 +34,7 @@ libamxfer_la_SOURCES = \
        xfer.c \
        xmsg.c
 
-libamxfer_la_LDFLAGS = -release $(VERSION)
+libamxfer_la_LDFLAGS = -release $(VERSION) $(AS_NEEDED_FLAGS)
 libamxfer_la_LIBADD = \
        ../common-src/libamanda.la
 
index 4dd0add20e9c78399907360ce9d36b4779200ebb..d7235266597f92ccf0793fd0596b7f7a85ea79d4 100644 (file)
@@ -132,6 +132,7 @@ am__aclocal_m4_deps =  \
        $(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/as_needed.m4 \
        $(top_srcdir)/config/amanda/bsd-security.m4 \
        $(top_srcdir)/config/amanda/bsdtcp-security.m4 \
        $(top_srcdir)/config/amanda/bsdudp-security.m4 \
@@ -358,6 +359,7 @@ APPLICATION_DIR = @APPLICATION_DIR@
 AR = @AR@
 ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
 ASSERTIONS = @ASSERTIONS@
+AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
@@ -831,6 +833,7 @@ LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
 MKDIR_P = @MKDIR_P@
+MOUNT = @MOUNT@
 MSGFMT = @MSGFMT@
 MSGFMT_015 = @MSGFMT_015@
 MSGMERGE = @MSGMERGE@
@@ -1028,6 +1031,7 @@ STDBOOL_H = @STDBOOL_H@
 STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
+SUNTAR = @SUNTAR@
 SVN = @SVN@
 SWIG = @SWIG@
 SWIG_LIB = @SWIG_LIB@
@@ -1035,6 +1039,7 @@ SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TCPPORTRANGE = @TCPPORTRANGE@
 TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
 UDPPORTRANGE = @UDPPORTRANGE@
+UMOUNT = @UMOUNT@
 UNCOMPRESS_OPT = @UNCOMPRESS_OPT@
 UNCOMPRESS_PATH = @UNCOMPRESS_PATH@
 UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
@@ -1174,7 +1179,7 @@ INCLUDES = -I$(top_srcdir)/gnulib \
                -I$(top_srcdir)/common-src
 
 AM_CFLAGS = $(AMANDA_WARNING_CFLAGS)
-AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS)
+AM_LDFLAGS = $(AMANDA_STATIC_LDFLAGS) $(AS_NEEDED_FLAGS)
 amlib_LTLIBRARIES = libamxfer.la
 LINT = $(AMLINT)
 LINTFLAGS = $(AMLINTFLAGS)
@@ -1196,7 +1201,7 @@ libamxfer_la_SOURCES = \
        xfer.c \
        xmsg.c
 
-libamxfer_la_LDFLAGS = -release $(VERSION)
+libamxfer_la_LDFLAGS = -release $(VERSION) $(AS_NEEDED_FLAGS)
 libamxfer_la_LIBADD = \
        ../common-src/libamanda.la
 
index d42ef76724794631d45a32aa32c7cd6d338d7cef..1d41e5a6644caaf91f86cbdf8d21a591a89900c2 100644 (file)
@@ -139,8 +139,8 @@ class_init(
     XferElementClass *klass = XFER_ELEMENT_CLASS(selfc);
     GObjectClass *goc = G_OBJECT_CLASS(selfc);
     static xfer_element_mech_pair_t mech_pairs[] = {
-       { XFER_MECH_PUSH_BUFFER, XFER_MECH_NONE, 0, 0},
-       { XFER_MECH_NONE, XFER_MECH_NONE, 0, 0},
+       { XFER_MECH_PUSH_BUFFER, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) },
+       { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) },
     };
 
     selfc->get = get_impl;
index ed867249fdfe5be121b2e90e1d845a4c9db0d176..72c59613890de9fdbed17df91ba6671019cca9ff 100644 (file)
@@ -69,7 +69,7 @@ setup_impl(
 {
     XferDestDirectTCPConnect *self = (XferDestDirectTCPConnect *)elt;
 
-    g_assert(self->addrs && self->addrs->ipv4);
+    g_assert(self->addrs && SU_GET_FAMILY(self->addrs) != 0);
     elt->input_listen_addrs = self->addrs;
 
     return TRUE;
@@ -96,8 +96,8 @@ class_init(
     XferElementClass *klass = XFER_ELEMENT_CLASS(selfc);
     GObjectClass *goc = G_OBJECT_CLASS(selfc);
     static xfer_element_mech_pair_t mech_pairs[] = {
-       { XFER_MECH_DIRECTTCP_LISTEN, XFER_MECH_NONE, 0, 0},
-       { XFER_MECH_NONE, XFER_MECH_NONE, 0, 0},
+       { XFER_MECH_DIRECTTCP_LISTEN, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) },
+       { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) },
     };
 
     klass->setup = setup_impl;
@@ -146,7 +146,7 @@ xfer_dest_directtcp_connect(
 
     g_assert(addrs != NULL);
 
-    for (i = 0; addrs[i].port; i++) ;
+    for (i = 0; SU_GET_FAMILY(&addrs[i]) != 0; i++);
     self->addrs = g_memdup(addrs, (i+1) * sizeof(*addrs));
 
     return elt;
index 0fb7983fe681e51e1bdad2f76da9775735b87990..da3cc7f4fc52bfc3f82b3128a012bbed82835476 100644 (file)
@@ -75,8 +75,8 @@ class_init(
 {
     XferElementClass *klass = XFER_ELEMENT_CLASS(selfc);
     static xfer_element_mech_pair_t mech_pairs[] = {
-       { XFER_MECH_DIRECTTCP_CONNECT, XFER_MECH_NONE, 0, 0},
-       { XFER_MECH_NONE, XFER_MECH_NONE, 0, 0},
+       { XFER_MECH_DIRECTTCP_CONNECT, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) },
+       { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) },
     };
 
     klass->start = start_impl;
index aca2e8bdc2e1341714270a3c880f7788ff031c6e..6eee1d417d9c56db3d927722ede345f6bf673e97 100644 (file)
@@ -65,8 +65,8 @@ class_init(
 {
     XferElementClass *klass = XFER_ELEMENT_CLASS(selfc);
     static xfer_element_mech_pair_t mech_pairs[] = {
-       { XFER_MECH_WRITEFD, XFER_MECH_NONE, 0, 0},
-       { XFER_MECH_NONE, XFER_MECH_NONE, 0, 0},
+       { XFER_MECH_WRITEFD, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) },
+       { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) },
     };
 
     klass->perl_class = "Amanda::Xfer::Dest::Fd";
index 67d17bca16e0d651c50bd6eab913ca8898fe6dd0..c5260a5bb8b7f875f205ecb66bab2036016627de 100644 (file)
@@ -106,8 +106,8 @@ class_init(
 {
     XferElementClass *klass = XFER_ELEMENT_CLASS(selfc);
     static xfer_element_mech_pair_t mech_pairs[] = {
-       { XFER_MECH_PUSH_BUFFER, XFER_MECH_NONE, 0, 0},
-       { XFER_MECH_NONE, XFER_MECH_NONE, 0, 0},
+       { XFER_MECH_PUSH_BUFFER, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) },
+       { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) },
     };
 
     klass->push_buffer = push_buffer_impl;
index ce71f113b5a581f89c9f58a2db415ca5923b5888..ecc543d66d924ed1c407ff58af3a6562305158de 100644 (file)
@@ -25,6 +25,7 @@
 #include "directtcp.h"
 #include "util.h"
 #include "sockaddr-util.h"
+#include "debug.h"
 
 /*
  * Instance definition
@@ -111,30 +112,52 @@ do_directtcp_listen(
     DirectTCPAddr **addrsp)
 {
     int sock;
-    sockaddr_union addr;
+    sockaddr_union data_addr;
     DirectTCPAddr *addrs;
     socklen_t len;
+    struct addrinfo *res;
+    struct addrinfo *res_addr;
+    sockaddr_union *addr = NULL;
+
+    if (resolve_hostname("localhost", 0, &res, NULL) != 0) {
+       xfer_cancel_with_error(elt, "resolve_hostname(): %s", strerror(errno));
+       return FALSE;
+    }
+    for (res_addr = res; res_addr != NULL; res_addr = res_addr->ai_next) {
+       if (res_addr->ai_family == AF_INET) {
+            addr = (sockaddr_union *)res_addr->ai_addr;
+            break;
+        }
+    }
+    if (!addr) {
+        addr = (sockaddr_union *)res->ai_addr;
+    }
 
-    sock = *sockp = socket(AF_INET, SOCK_STREAM, 0);
+    sock = *sockp = socket(SU_GET_FAMILY(addr), SOCK_STREAM, 0);
     if (sock < 0) {
        xfer_cancel_with_error(elt, "socket(): %s", strerror(errno));
        return FALSE;
     }
 
+    len = SS_LEN(addr);
+    if (bind(sock, (struct sockaddr *)addr, len) != 0) {
+       xfer_cancel_with_error(elt, "bind(): %s", strerror(errno));
+       freeaddrinfo(res);
+       return FALSE;
+    }
+
     if (listen(sock, 1) < 0) {
        xfer_cancel_with_error(elt, "listen(): %s", strerror(errno));
        return FALSE;
     }
 
     /* TODO: which addresses should this display? all ifaces? localhost? */
-    len = sizeof(addr);
-    if (getsockname(sock, (struct sockaddr *)&addr, &len) < 0)
+    len = sizeof(data_addr);
+    if (getsockname(sock, (struct sockaddr *)&data_addr, &len) < 0)
        error("getsockname(): %s", strerror(errno));
-    g_assert(SU_GET_FAMILY(&addr) == AF_INET);
 
     addrs = g_new0(DirectTCPAddr, 2);
-    addrs[0].ipv4 = ntohl(inet_addr("127.0.0.1")); /* TODO: be smarter! */
-    addrs[0].port = SU_GET_PORT(&addr);
+    copy_sockaddr(&addrs[0], &data_addr);
     *addrsp = addrs;
 
     return TRUE;
@@ -195,12 +218,10 @@ do_directtcp_connect(
     }
 
     /* set up the sockaddr -- IPv4 only */
-    SU_INIT(&addr, AF_INET);
-    SU_SET_PORT(&addr, addrs->port);
-    ((struct sockaddr_in *)&addr)->sin_addr.s_addr = htonl(addrs->ipv4);
+    copy_sockaddr(&addr, addrs);
 
     g_debug("making data connection to %s", str_sockaddr(&addr));
-    sock = socket(AF_INET, SOCK_STREAM, 0);
+    sock = socket(SU_GET_FAMILY(&addr), SOCK_STREAM, 0);
     if (sock < 0) {
        xfer_cancel_with_error(elt,
            "socket(): %s", strerror(errno));
@@ -323,7 +344,7 @@ pull_and_write(XferElementGlue *self)
     }
 
     if (elt->cancelled && elt->expect_eof)
-       xfer_element_drain_by_pulling(elt->upstream);
+       xfer_element_drain_buffers(elt->upstream);
 
     /* close the fd we've been writing, as an EOF signal to downstream, and
      * set it to -1 to avoid accidental re-use */
@@ -370,7 +391,7 @@ read_and_write(XferElementGlue *self)
     }
 
     if (elt->cancelled && elt->expect_eof)
-       xfer_element_drain_by_reading(rfd);
+       xfer_element_drain_fd(rfd);
 
     /* close the read fd.  If it's not at EOF, then upstream will get EPIPE, which will hopefully
      * kill it and complete the cancellation */
@@ -405,6 +426,7 @@ read_and_push(
                            fd, strerror(saved_errno));
                    wait_until_xfer_cancelled(elt->xfer);
                }
+                amfree(buf);
                break;
            } else if (len == 0) { /* we only count a zero-length read as EOF */
                amfree(buf);
@@ -416,7 +438,7 @@ read_and_push(
     }
 
     if (elt->cancelled && elt->expect_eof)
-       xfer_element_drain_by_reading(fd);
+       xfer_element_drain_fd(fd);
 
     /* send an EOF indication downstream */
     xfer_element_push_buffer(elt->downstream, NULL, 0);
@@ -448,7 +470,7 @@ pull_and_push(XferElementGlue *self)
     }
 
     if (elt->cancelled && elt->expect_eof)
-       xfer_element_drain_by_pulling(elt->upstream);
+       xfer_element_drain_buffers(elt->upstream);
 
     if (!eof_sent)
        xfer_element_push_buffer(elt->downstream, NULL, 0);
@@ -937,7 +959,7 @@ pull_buffer_impl(
 
        case PULL_FROM_FD: {
            int fd = get_read_fd(self);
-           char *buf = g_malloc(GLUE_BUFFER_SIZE);
+           char *buf;
            ssize_t len;
 
            /* if the fd is already closed, it's possible upstream bailed out
@@ -945,7 +967,7 @@ pull_buffer_impl(
            if (elt->cancelled || fd == -1) {
                if (fd != -1) {
                    if (elt->expect_eof)
-                       xfer_element_drain_by_reading(fd);
+                       xfer_element_drain_fd(fd);
 
                    close_read_fd(self);
                }
@@ -954,6 +976,8 @@ pull_buffer_impl(
                return NULL;
            }
 
+           buf = g_malloc(GLUE_BUFFER_SIZE);
+
            /* read from upstream */
            len = full_read(fd, buf, GLUE_BUFFER_SIZE);
            if (len < GLUE_BUFFER_SIZE) {
@@ -970,7 +994,7 @@ pull_buffer_impl(
 
                    /* and finish off the upstream */
                    if (elt->expect_eof) {
-                       xfer_element_drain_by_reading(fd);
+                       xfer_element_drain_fd(fd);
                    }
                    close_read_fd(self);
                } else if (len == 0) {
@@ -1166,44 +1190,44 @@ finalize_impl(
 }
 
 static xfer_element_mech_pair_t _pairs[] = {
-    { XFER_MECH_READFD, XFER_MECH_WRITEFD, 2, 1 }, /* splice or copy */
-    { XFER_MECH_READFD, XFER_MECH_PUSH_BUFFER, 1, 1 }, /* read and call */
-    { XFER_MECH_READFD, XFER_MECH_PULL_BUFFER, 1, 0 }, /* read on demand */
-    { XFER_MECH_READFD, XFER_MECH_DIRECTTCP_LISTEN, 2, 1 }, /* splice or copy */
-    { XFER_MECH_READFD, XFER_MECH_DIRECTTCP_CONNECT, 2, 1 }, /* splice or copy */
-
-    { XFER_MECH_WRITEFD, XFER_MECH_READFD, 0, 0 }, /* pipe */
-    { XFER_MECH_WRITEFD, XFER_MECH_PUSH_BUFFER, 1, 1 }, /* pipe + read and call*/
-    { XFER_MECH_WRITEFD, XFER_MECH_PULL_BUFFER, 1, 0 }, /* pipe + read on demand */
-    { XFER_MECH_WRITEFD, XFER_MECH_DIRECTTCP_LISTEN, 2, 1 }, /* pipe + splice or copy*/
-    { XFER_MECH_WRITEFD, XFER_MECH_DIRECTTCP_CONNECT, 2, 1 }, /* splice or copy + pipe */
-
-    { XFER_MECH_PUSH_BUFFER, XFER_MECH_READFD, 1, 0 }, /* write on demand + pipe */
-    { XFER_MECH_PUSH_BUFFER, XFER_MECH_WRITEFD, 1, 0 }, /* write on demand */
-    { XFER_MECH_PUSH_BUFFER, XFER_MECH_PULL_BUFFER, 0, 0 }, /* async queue */
-    { XFER_MECH_PUSH_BUFFER, XFER_MECH_DIRECTTCP_LISTEN, 1, 0 }, /* write on demand */
-    { XFER_MECH_PUSH_BUFFER, XFER_MECH_DIRECTTCP_CONNECT, 1, 0 }, /* write on demand */
-
-    { XFER_MECH_PULL_BUFFER, XFER_MECH_READFD, 1, 1 }, /* call and write + pipe */
-    { XFER_MECH_PULL_BUFFER, XFER_MECH_WRITEFD, 1, 1 }, /* call and write */
-    { XFER_MECH_PULL_BUFFER, XFER_MECH_PUSH_BUFFER, 0, 1 }, /* call and call */
-    { XFER_MECH_PULL_BUFFER, XFER_MECH_DIRECTTCP_LISTEN, 1, 1 }, /* call and write */
-    { XFER_MECH_PULL_BUFFER, XFER_MECH_DIRECTTCP_CONNECT, 1, 1 }, /* call and write */
-
-    { XFER_MECH_DIRECTTCP_LISTEN, XFER_MECH_READFD, 2, 1 }, /* splice or copy + pipe */
-    { XFER_MECH_DIRECTTCP_LISTEN, XFER_MECH_WRITEFD, 2, 1 }, /* splice or copy */
-    { XFER_MECH_DIRECTTCP_LISTEN, XFER_MECH_PUSH_BUFFER, 1, 1 }, /* read and call */
-    { XFER_MECH_DIRECTTCP_LISTEN, XFER_MECH_PULL_BUFFER, 1, 0 }, /* read on demand */
-    { XFER_MECH_DIRECTTCP_LISTEN, XFER_MECH_DIRECTTCP_CONNECT, 2, 1 }, /* splice or copy */
-
-    { XFER_MECH_DIRECTTCP_CONNECT, XFER_MECH_READFD, 2, 1 }, /* splice or copy + pipe */
-    { XFER_MECH_DIRECTTCP_CONNECT, XFER_MECH_WRITEFD, 2, 1 }, /* splice or copy + pipe */
-    { XFER_MECH_DIRECTTCP_CONNECT, XFER_MECH_PUSH_BUFFER, 1, 1 }, /* read and call */
-    { XFER_MECH_DIRECTTCP_CONNECT, XFER_MECH_PULL_BUFFER, 1, 0 }, /* read on demand */
-    { XFER_MECH_DIRECTTCP_CONNECT, XFER_MECH_DIRECTTCP_LISTEN, 2, 1 }, /* splice or copy  */
+    { XFER_MECH_READFD, XFER_MECH_WRITEFD, XFER_NROPS(2), XFER_NTHREADS(1) }, /* splice or copy */
+    { XFER_MECH_READFD, XFER_MECH_PUSH_BUFFER, XFER_NROPS(1), XFER_NTHREADS(1) }, /* read and call */
+    { XFER_MECH_READFD, XFER_MECH_PULL_BUFFER, XFER_NROPS(1), XFER_NTHREADS(0) }, /* read on demand */
+    { XFER_MECH_READFD, XFER_MECH_DIRECTTCP_LISTEN, XFER_NROPS(2), XFER_NTHREADS(1) }, /* splice or copy */
+    { XFER_MECH_READFD, XFER_MECH_DIRECTTCP_CONNECT, XFER_NROPS(2), XFER_NTHREADS(1) }, /* splice or copy */
+
+    { XFER_MECH_WRITEFD, XFER_MECH_READFD, XFER_NROPS(0), XFER_NTHREADS(0) }, /* pipe */
+    { XFER_MECH_WRITEFD, XFER_MECH_PUSH_BUFFER, XFER_NROPS(1), XFER_NTHREADS(1) }, /* pipe + read and call*/
+    { XFER_MECH_WRITEFD, XFER_MECH_PULL_BUFFER, XFER_NROPS(1), XFER_NTHREADS(0) }, /* pipe + read on demand */
+    { XFER_MECH_WRITEFD, XFER_MECH_DIRECTTCP_LISTEN, XFER_NROPS(2), XFER_NTHREADS(1) }, /* pipe + splice or copy*/
+    { XFER_MECH_WRITEFD, XFER_MECH_DIRECTTCP_CONNECT, XFER_NROPS(2), XFER_NTHREADS(1) }, /* splice or copy + pipe */
+
+    { XFER_MECH_PUSH_BUFFER, XFER_MECH_READFD, XFER_NROPS(1), XFER_NTHREADS(0) }, /* write on demand + pipe */
+    { XFER_MECH_PUSH_BUFFER, XFER_MECH_WRITEFD, XFER_NROPS(1), XFER_NTHREADS(0) }, /* write on demand */
+    { XFER_MECH_PUSH_BUFFER, XFER_MECH_PULL_BUFFER, XFER_NROPS(0), XFER_NTHREADS(0) }, /* async queue */
+    { XFER_MECH_PUSH_BUFFER, XFER_MECH_DIRECTTCP_LISTEN, XFER_NROPS(1), XFER_NTHREADS(0) }, /* write on demand */
+    { XFER_MECH_PUSH_BUFFER, XFER_MECH_DIRECTTCP_CONNECT, XFER_NROPS(1), XFER_NTHREADS(0) }, /* write on demand */
+
+    { XFER_MECH_PULL_BUFFER, XFER_MECH_READFD, XFER_NROPS(1), XFER_NTHREADS(1) }, /* call and write + pipe */
+    { XFER_MECH_PULL_BUFFER, XFER_MECH_WRITEFD, XFER_NROPS(1), XFER_NTHREADS(1) }, /* call and write */
+    { XFER_MECH_PULL_BUFFER, XFER_MECH_PUSH_BUFFER, XFER_NROPS(0), XFER_NTHREADS(1) }, /* call and call */
+    { XFER_MECH_PULL_BUFFER, XFER_MECH_DIRECTTCP_LISTEN, XFER_NROPS(1), XFER_NTHREADS(1) }, /* call and write */
+    { XFER_MECH_PULL_BUFFER, XFER_MECH_DIRECTTCP_CONNECT, XFER_NROPS(1), XFER_NTHREADS(1) }, /* call and write */
+
+    { XFER_MECH_DIRECTTCP_LISTEN, XFER_MECH_READFD, XFER_NROPS(2), XFER_NTHREADS(1) }, /* splice or copy + pipe */
+    { XFER_MECH_DIRECTTCP_LISTEN, XFER_MECH_WRITEFD, XFER_NROPS(2), XFER_NTHREADS(1) }, /* splice or copy */
+    { XFER_MECH_DIRECTTCP_LISTEN, XFER_MECH_PUSH_BUFFER, XFER_NROPS(1), XFER_NTHREADS(1) }, /* read and call */
+    { XFER_MECH_DIRECTTCP_LISTEN, XFER_MECH_PULL_BUFFER, XFER_NROPS(1), XFER_NTHREADS(0) }, /* read on demand */
+    { XFER_MECH_DIRECTTCP_LISTEN, XFER_MECH_DIRECTTCP_CONNECT, XFER_NROPS(2), XFER_NTHREADS(1) }, /* splice or copy */
+
+    { XFER_MECH_DIRECTTCP_CONNECT, XFER_MECH_READFD, XFER_NROPS(2), XFER_NTHREADS(1) }, /* splice or copy + pipe */
+    { XFER_MECH_DIRECTTCP_CONNECT, XFER_MECH_WRITEFD, XFER_NROPS(2), XFER_NTHREADS(1) }, /* splice or copy + pipe */
+    { XFER_MECH_DIRECTTCP_CONNECT, XFER_MECH_PUSH_BUFFER, XFER_NROPS(1), XFER_NTHREADS(1) }, /* read and call */
+    { XFER_MECH_DIRECTTCP_CONNECT, XFER_MECH_PULL_BUFFER, XFER_NROPS(1), XFER_NTHREADS(0) }, /* read on demand */
+    { XFER_MECH_DIRECTTCP_CONNECT, XFER_MECH_DIRECTTCP_LISTEN, XFER_NROPS(2), XFER_NTHREADS(1) }, /* splice or copy  */
 
     /* terminator */
-    { XFER_MECH_NONE, XFER_MECH_NONE, 0, 0},
+    { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) },
 };
 xfer_element_mech_pair_t *xfer_element_glue_mech_pairs = _pairs;
 
index 155f1fa0419e07cb72f72d273d682caa201b466d..aa23b0bdf4079e13f0e2448d0d2cd168e6874370 100644 (file)
@@ -50,7 +50,7 @@ typedef struct XferFilterProcess {
 
     gchar **argv;
     gboolean need_root;
-    gboolean log_stderr;
+    int pipe_err[2];
 
     pid_t child_pid;
     GSource *child_watch;
@@ -63,8 +63,9 @@ typedef struct XferFilterProcess {
 
 typedef struct {
     XferElementClass __parent__;
-} XferFilterProcessClass;
+    int (*get_err_fd)(XferFilterProcess *elt);
 
+} XferFilterProcessClass;
 
 /*
  * Implementation
@@ -113,6 +114,13 @@ child_watch_callback(
     xfer_queue_message(XFER_ELEMENT(self)->xfer, xmsg_new(XFER_ELEMENT(self), XMSG_DONE, 0));
 }
 
+static int
+get_err_fd_impl(
+    XferFilterProcess *xfp)
+{
+    return xfp->pipe_err[0];
+}
+
 static gboolean
 start_impl(
     XferElement *elt)
@@ -154,8 +162,7 @@ start_impl(
             * on those fd's */
            dup2(rfd, STDIN_FILENO);
            dup2(wfd, STDOUT_FILENO);
-           if (!self->log_stderr)
-               debug_dup_stderr_to_debug();
+           dup2(self->pipe_err[1], STDERR_FILENO);
 
            /* and close everything else */
            safe_fd(-1, 0);
@@ -180,6 +187,7 @@ start_impl(
     /* close the pipe fd's */
     close(rfd);
     close(wfd);
+    close(self->pipe_err[1]);
 
     /* watch for child death */
     self->child_watch = new_child_watch_source(self->child_pid);
@@ -264,8 +272,8 @@ class_init(
     XferElementClass *klass = XFER_ELEMENT_CLASS(selfc);
     GObjectClass *goc = (GObjectClass*) klass;
     static xfer_element_mech_pair_t mech_pairs[] = {
-       { XFER_MECH_READFD, XFER_MECH_WRITEFD, 1, 0},
-       { XFER_MECH_NONE, XFER_MECH_NONE, 0, 0},
+       { XFER_MECH_READFD, XFER_MECH_WRITEFD, XFER_NROPS(1), XFER_NTHREADS(0) },
+       { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) },
     };
 
     klass->start = start_impl;
@@ -273,6 +281,7 @@ class_init(
 
     klass->perl_class = "Amanda::Xfer::Filter::Process";
     klass->mech_pairs = mech_pairs;
+    selfc->get_err_fd = get_err_fd_impl;
 
     goc->finalize = finalize_impl;
 
@@ -308,8 +317,7 @@ xfer_filter_process_get_type (void)
 XferElement *
 xfer_filter_process(
     gchar **argv,
-    gboolean need_root,
-    gboolean log_stderr)
+    gboolean need_root)
 {
     XferFilterProcess *xfp = (XferFilterProcess *)g_object_new(XFER_FILTER_PROCESS_TYPE, NULL);
     XferElement *elt = XFER_ELEMENT(xfp);
@@ -319,7 +327,22 @@ xfer_filter_process(
 
     xfp->argv = argv;
     xfp->need_root = need_root;
-    xfp->log_stderr = log_stderr;
-
+    if (pipe(xfp->pipe_err) < 0) {
+       g_critical(_("Can't create pipe: %s"), strerror(errno));
+    }
     return elt;
 }
+
+int get_err_fd(XferElement *elt);
+int get_err_fd(
+    XferElement *elt)
+{
+    XferFilterProcessClass *klass;
+    g_assert(IS_XFER_FILTER_PROCESS(elt));
+
+    klass = XFER_FILTER_PROCESS_GET_CLASS(elt);
+    if (klass->get_err_fd)
+       return klass->get_err_fd(XFER_FILTER_PROCESS(elt));
+    else
+        return 0;
+}
index 7bec75ea2713a22527a76ec7debb3e9860ebc2e3..7d836657c6171430eb03c01dd9f8881f12b3f031 100644 (file)
@@ -91,7 +91,7 @@ pull_buffer_impl(
     if (elt->cancelled) {
        /* drain our upstream only if we're expecting an EOF */
        if (elt->expect_eof) {
-           xfer_element_drain_by_pulling(XFER_ELEMENT(self)->upstream);
+           xfer_element_drain_buffers(XFER_ELEMENT(self)->upstream);
        }
 
        /* return an EOF */
@@ -140,9 +140,9 @@ class_init(
 {
     XferElementClass *klass = XFER_ELEMENT_CLASS(selfc);
     static xfer_element_mech_pair_t mech_pairs[] = {
-       { XFER_MECH_PULL_BUFFER, XFER_MECH_PULL_BUFFER, 1, 0},
-       { XFER_MECH_PUSH_BUFFER, XFER_MECH_PUSH_BUFFER, 1, 0},
-       { XFER_MECH_NONE, XFER_MECH_NONE, 0, 0},
+       { XFER_MECH_PULL_BUFFER, XFER_MECH_PULL_BUFFER, XFER_NROPS(1), XFER_NTHREADS(0) },
+       { XFER_MECH_PUSH_BUFFER, XFER_MECH_PUSH_BUFFER, XFER_NROPS(1), XFER_NTHREADS(0) },
+       { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) },
     };
 
     klass->push_buffer = push_buffer_impl;
index be7b5dee44440227a5120835c78016e5d7928f12..61c6070e012f611a7173082ce61bf60e647336ae 100644 (file)
@@ -21,6 +21,7 @@
 
 #include "amanda.h"
 #include "amxfer.h"
+#include "sockaddr-util.h"
 
 /*
  * Class declaration
@@ -68,7 +69,7 @@ setup_impl(
 {
     XferSourceDirectTCPConnect *self = (XferSourceDirectTCPConnect *)elt;
 
-    g_assert(self->addrs && self->addrs->ipv4);
+    g_assert(self->addrs && SU_GET_FAMILY(self->addrs) != 0);
     elt->output_listen_addrs = self->addrs;
 
     return TRUE;
@@ -102,8 +103,8 @@ class_init(
     XferElementClass *klass = XFER_ELEMENT_CLASS(selfc);
     GObjectClass *goc = G_OBJECT_CLASS(selfc);
     static xfer_element_mech_pair_t mech_pairs[] = {
-       { XFER_MECH_NONE, XFER_MECH_DIRECTTCP_CONNECT, 1, 0},
-       { XFER_MECH_NONE, XFER_MECH_NONE, 0, 0},
+       { XFER_MECH_NONE, XFER_MECH_DIRECTTCP_CONNECT, XFER_NROPS(1), XFER_NTHREADS(0) },
+       { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) },
     };
 
     klass->setup = setup_impl;
@@ -151,7 +152,7 @@ xfer_source_directtcp_connect(DirectTCPAddr *addrs)
 
     g_assert(addrs != NULL);
 
-    for (i = 0; addrs[i].port; i++) ;
+    for (i = 0; SU_GET_FAMILY(&addrs[i]) != 0; i++);
     self->addrs = g_memdup(addrs, (i+1) * sizeof(*addrs));
 
     return elt;
index 55bae540b243bc2b3a773194c5f779ab092cd74e..82bac75e588f5adb23bad6c52fcb46b2e59d004c 100644 (file)
@@ -20,6 +20,7 @@
  */
 
 #include "amanda.h"
+#include "sockaddr-util.h"
 #include "amxfer.h"
 
 /*
@@ -84,8 +85,8 @@ class_init(
 {
     XferElementClass *klass = XFER_ELEMENT_CLASS(selfc);
     static xfer_element_mech_pair_t mech_pairs[] = {
-       { XFER_MECH_NONE, XFER_MECH_DIRECTTCP_LISTEN, 1, 0},
-       { XFER_MECH_NONE, XFER_MECH_NONE, 0, 0},
+       { XFER_MECH_NONE, XFER_MECH_DIRECTTCP_LISTEN, XFER_NROPS(1), XFER_NTHREADS(0) },
+       { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) },
     };
 
     klass->start = start_impl;
index 09b82ccc32009c0f3359fa16c72d47a22b3db3ae..9d1814a19d1be84a5c588965ec4c9f3992fa38ab 100644 (file)
@@ -65,8 +65,8 @@ class_init(
 {
     XferElementClass *klass = XFER_ELEMENT_CLASS(selfc);
     static xfer_element_mech_pair_t mech_pairs[] = {
-       { XFER_MECH_NONE, XFER_MECH_READFD, 0, 0},
-       { XFER_MECH_NONE, XFER_MECH_NONE, 0, 0},
+       { XFER_MECH_NONE, XFER_MECH_READFD, XFER_NROPS(0), XFER_NTHREADS(0) },
+       { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) },
     };
 
     klass->perl_class = "Amanda::Xfer::Source::Fd";
index 4e3eb12f60f4d7067a93fdb4a796d52bd370375c..5a4aad836625c593341876f951845439898b757f 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Amanda, The Advanced Maryland Automatic Network Disk Archiver
- * Copyright (c) 2008,2009 Zmanda, Inc.  All Rights Reserved.
+ * Copyright (c) 2008, 2009, 2011 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
@@ -66,6 +66,41 @@ typedef struct {
  * Implementation
  */
 
+/*
+ * Utility function to fill a buffer buf of size len with the pattern defined
+ * for this instance. We start each copying from the offset where we left the
+ * previous one.
+ *
+ * Note that performance is important: amtapetype uses this very source and
+ * source-random.c to determine whether a tape device uses compression, and
+ * expects the two to run about the same speed.  This is why this is a byte
+ * loop and does not use mempcy() and friends: the random source is also byte
+ * per byte.
+ */
+
+static void fill_buffer_with_pattern(XferSourcePattern *self, char *buf,
+    size_t len)
+{
+    char *src = self->pattern, *dst = buf;
+    size_t plen = self->pattern_buffer_length, offset = self->current_offset;
+    size_t pos = 0;
+
+    src += offset;
+
+    while (pos < len) {
+        *dst++ = *src++;
+        pos++, offset++;
+
+        if (G_LIKELY(offset < plen))
+            continue;
+
+        offset = 0;
+        src = self->pattern;
+    }
+
+    self->current_offset = offset;
+}
+
 static gpointer
 pull_buffer_impl(
     XferElement *elt,
@@ -73,12 +108,9 @@ pull_buffer_impl(
 {
     XferSourcePattern *self = (XferSourcePattern *)elt;
     char *rval;
-    char *s, *d;
-    size_t l;
-    size_t offset;
 
     /* indicate EOF on an cancel */
-    if (elt->cancelled || (self->limited_length && self->length == 0)) {
+    if (elt->cancelled) {
        *size = 0;
        return NULL;
     }
@@ -97,17 +129,7 @@ pull_buffer_impl(
 
     rval = malloc(*size);
 
-    /* fill the buffer "manually", instead of using fancy memcpy techniques, so
-     * that this runs at about the same speed as the random source */
-    l = *size;
-    s = self->pattern;
-    offset = self->current_offset;
-    d = rval;
-    while (l--) {
-       *(d++) = *(s + offset++);
-       if (offset >= self->pattern_buffer_length) offset = 0;
-    }
-    self->current_offset = offset;
+    fill_buffer_with_pattern(self, rval, *size);
 
     return rval;
 }
@@ -125,8 +147,8 @@ class_init(
 {
     XferElementClass *klass = XFER_ELEMENT_CLASS(selfc);
     static xfer_element_mech_pair_t mech_pairs[] = {
-       { XFER_MECH_NONE, XFER_MECH_PULL_BUFFER, 1, 0},
-       { XFER_MECH_NONE, XFER_MECH_NONE, 0, 0},
+       { XFER_MECH_NONE, XFER_MECH_PULL_BUFFER, XFER_NROPS(1), XFER_NTHREADS(0) },
+       { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) },
     };
 
     klass->pull_buffer = pull_buffer_impl;
index 8056c3b3afe45191359bb1c0b56279ebea64cec5..b7c8f4b6dcb97ac865ab94d97bb516b828c0abb4 100644 (file)
@@ -112,8 +112,8 @@ class_init(
 {
     XferElementClass *klass = XFER_ELEMENT_CLASS(selfc);
     static xfer_element_mech_pair_t mech_pairs[] = {
-       { XFER_MECH_NONE, XFER_MECH_PULL_BUFFER, 1, 0},
-       { XFER_MECH_NONE, XFER_MECH_NONE, 0, 0},
+       { XFER_MECH_NONE, XFER_MECH_PULL_BUFFER, XFER_NROPS(1), XFER_NTHREADS(0) },
+       { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) },
     };
 
     selfc->get_seed = get_seed_impl;
index c244effb9e7953c7f7b7e3cb22f22bc8bb087d4e..dd94e3ca126faafa4ca3ffd055c5fdae49e08ec5 100644 (file)
@@ -50,6 +50,16 @@ xfer_element_setup_impl(
     return TRUE; /* success */
 }
 
+static gboolean
+xfer_element_set_size_impl(
+    XferElement *elt G_GNUC_UNUSED,
+    gint64       size G_GNUC_UNUSED)
+{
+    elt->size = size;
+
+    return TRUE; /* success */
+}
+
 static gboolean
 xfer_element_start_impl(
     XferElement *elt G_GNUC_UNUSED)
@@ -134,6 +144,7 @@ xfer_element_class_init(
 
     klass->repr = xfer_element_repr_impl;
     klass->setup = xfer_element_setup_impl;
+    klass->set_size = xfer_element_set_size_impl;
     klass->start = xfer_element_start_impl;
     klass->cancel = xfer_element_cancel_impl;
     klass->pull_buffer = xfer_element_pull_buffer_impl;
@@ -199,6 +210,14 @@ xfer_element_setup(
     return XFER_ELEMENT_GET_CLASS(elt)->setup(elt);
 }
 
+gboolean
+xfer_element_set_size(
+    XferElement *elt,
+    gint64       size)
+{
+    return XFER_ELEMENT_GET_CLASS(elt)->set_size(elt, size);
+}
+
 gboolean
 xfer_element_start(
     XferElement *elt)
@@ -252,7 +271,7 @@ xfer_element_get_mech_pairs(
  */
 
 void
-xfer_element_drain_by_pulling(
+xfer_element_drain_buffers(
     XferElement *upstream)
 {
     gpointer buf;
@@ -264,7 +283,7 @@ xfer_element_drain_by_pulling(
 }
 
 void
-xfer_element_drain_by_reading(
+xfer_element_drain_fd(
     int fd)
 {
     size_t len;
index 42f3233a2b21524f78b73c8ddcc54f486d6e32d6..5d45ac03f0c33ab1689a6ca6ffce4eea0cbfb694 100644 (file)
@@ -28,6 +28,7 @@
 #include <glib.h>
 #include <glib-object.h>
 #include "xfer.h"
+#include "amanda.h"
 #include "directtcp.h"
 
 typedef enum {
@@ -67,11 +68,19 @@ typedef enum {
     XFER_MECH_MAX,
 } xfer_mech;
 
-/* Description of a pair (input, output) of xfer mechanisms that an
+/*
+ * Description of a pair (input, output) of xfer mechanisms that an
  * element can support, along with the associated costs.  An array of these
  * pairs is stored in the class-level variable 'mech_pairs', describing
  * all of the mechanisms that an element supports.
+ *
+ * Use the XFER_NROPS() and XFER_NTHREADS() macros below in declarations in
+ * order to make declarations more understandable.
  */
+
+#define XFER_NROPS(x) (x)
+#define XFER_NTHREADS(x) (x)
+
 typedef struct {
     xfer_mech input_mech;
     xfer_mech output_mech;
@@ -139,6 +148,9 @@ typedef struct XferElement {
 
     /* cache for repr() */
     char *repr;
+
+    /* maximum size to transfer */
+    gint64 size;
 } XferElement;
 
 /*
@@ -182,6 +194,13 @@ typedef struct {
      */
     gboolean (*setup)(XferElement *elt);
 
+    /* set the size of data to transfer, to skip NUL padding bytes
+     * @param elt: the XferElement
+     * @param size: the size of data to transfer
+     * @return: TRUE
+     */
+    gboolean (*set_size)(XferElement *elt, gint64 size);
+
     /* Start transferring data.  The element downstream of this one will
      * already be started, while the upstream element will not, so data will
      * not begin flowing immediately.  It is safe to access attributes of
@@ -205,10 +224,9 @@ typedef struct {
      * If expect_eof is TRUE, then this element should expect an EOF from its
      * upstream element, and should drain any remaining data until that EOF
      * arrives and generate an EOF to the downstream element.  The utility
-     * functions xfer_element_drain_by_reading and
-     * xfer_element_drain_by_pulling may be useful for this purpose. This
-     * draining is important in order to avoid hung threads or unexpected
-     * SIGPIPEs.
+     * functions xfer_element_drain_fd and xfer_element_drain_buffers may be
+     * useful for this purpose. This draining is important in order to avoid
+     * hung threads or unexpected SIGPIPEs.
      *
      * If expect_eof is FALSE, then the upstream elements are unable to
      * generate an early EOF, so this element should *not* attempt to drain any
@@ -287,6 +305,7 @@ void xfer_element_unref(XferElement *elt);
 gboolean xfer_element_link_to(XferElement *elt, XferElement *successor);
 char *xfer_element_repr(XferElement *elt);
 gboolean xfer_element_setup(XferElement *elt);
+gboolean xfer_element_set_size(XferElement *elt, gint64 size);
 gboolean xfer_element_start(XferElement *elt);
 void xfer_element_push_buffer(XferElement *elt, gpointer buf, size_t size);
 gpointer xfer_element_pull_buffer(XferElement *elt, size_t *size);
@@ -303,14 +322,14 @@ xfer_element_mech_pair_t *xfer_element_get_mech_pairs(XferElement *elt);
  *
  * @param upstream: the element to drain
  */
-void xfer_element_drain_by_pulling(XferElement *upstream);
+void xfer_element_drain_buffers(XferElement *upstream);
 
 /* Drain UPSTREAM by reading until EOF.  This does not close
  * the file descriptor.
  *
  * @param fd: the file descriptor to drain
  */
-void xfer_element_drain_by_reading(int fd);
+void xfer_element_drain_fd(int fd);
 
 /* Atomically swap a value into elt->_input_fd and _output_fd, respectively.
  * Always use these methods to access the field.
@@ -407,13 +426,10 @@ XferElement * xfer_source_directtcp_connect(DirectTCPAddr *addrs);
  *
  * @param argv: NULL-terminated command-line arguments
  * @param need_root: become root before exec'ing the subprocess
- * @param log_stderr: if true, send stderr to the debug log; otherwise, send it
- * to the stderr of the current process
  * @return: new element
  */
 XferElement *xfer_filter_process(gchar **argv,
-    gboolean need_root,
-    gboolean log_stderr);
+    gboolean need_root);
 
 /* A transfer filter that just applies a bytewise XOR transformation to the data
  * that passes through it.
index f71894066c743a4ad607e3fb9510bfaf465c1169..f83448af4bebe98049d9ed51c7011a90fe36ce38 100644 (file)
@@ -124,8 +124,8 @@ source_readfd_class_init(
 {
     XferElementClass *xec = XFER_ELEMENT_CLASS(klass);
     static xfer_element_mech_pair_t mech_pairs[] = {
-       { XFER_MECH_NONE, XFER_MECH_READFD, 1, 1},
-       { XFER_MECH_NONE, XFER_MECH_NONE, 0, 0},
+       { XFER_MECH_NONE, XFER_MECH_READFD, XFER_NROPS(1), XFER_NTHREADS(1) },
+       { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) },
     };
 
     xec->setup = source_readfd_setup_impl;
@@ -223,8 +223,8 @@ source_writefd_class_init(
 {
     XferElementClass *xec = XFER_ELEMENT_CLASS(klass);
     static xfer_element_mech_pair_t mech_pairs[] = {
-       { XFER_MECH_NONE, XFER_MECH_WRITEFD, 1, 1},
-       { XFER_MECH_NONE, XFER_MECH_NONE, 0, 0},
+       { XFER_MECH_NONE, XFER_MECH_WRITEFD, XFER_NROPS(1), XFER_NTHREADS(1) },
+       { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) },
     };
 
     xec->start = source_writefd_start_impl;
@@ -325,8 +325,8 @@ source_push_class_init(
 {
     XferElementClass *xec = XFER_ELEMENT_CLASS(klass);
     static xfer_element_mech_pair_t mech_pairs[] = {
-       { XFER_MECH_NONE, XFER_MECH_PUSH_BUFFER, 1, 1},
-       { XFER_MECH_NONE, XFER_MECH_NONE, 0, 0},
+       { XFER_MECH_NONE, XFER_MECH_PUSH_BUFFER, XFER_NROPS(1), XFER_NTHREADS(1) },
+       { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) },
     };
 
     xec->start = source_push_start_impl;
@@ -420,8 +420,8 @@ source_pull_class_init(
 {
     XferElementClass *xec = XFER_ELEMENT_CLASS(klass);
     static xfer_element_mech_pair_t mech_pairs[] = {
-       { XFER_MECH_NONE, XFER_MECH_PULL_BUFFER, 1, 0},
-       { XFER_MECH_NONE, XFER_MECH_NONE, 0, 0},
+       { XFER_MECH_NONE, XFER_MECH_PULL_BUFFER, XFER_NROPS(1), XFER_NTHREADS(0) },
+       { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) },
     };
 
     xec->pull_buffer = source_pull_pull_buffer_impl;
@@ -482,28 +482,24 @@ source_listen_thread(
     XferSourceListen *self = XFER_SOURCE_LISTEN(data);
     XferElement *elt = XFER_ELEMENT(self);
     DirectTCPAddr *addrs;
-    sockaddr_union addr;
     int sock;
     char *buf;
     int i;
 
     /* set up the sockaddr -- IPv4 only */
-    SU_INIT(&addr, AF_INET);
     addrs = elt->downstream->input_listen_addrs;
     g_assert(addrs != NULL);
-    SU_SET_PORT(&addr, addrs->port);
-    ((struct sockaddr_in *)&addr)->sin_addr.s_addr = htonl(addrs->ipv4);
 
-    tu_dbg("making data connection to %s\n", str_sockaddr(&addr));
-    sock = socket(AF_INET, SOCK_STREAM, 0);
+    tu_dbg("making data connection to %s\n", str_sockaddr(addrs));
+    sock = socket(SU_GET_FAMILY(addrs), SOCK_STREAM, 0);
     if (sock < 0) {
        error("socket(): %s", strerror(errno));
     }
-    if (connect(sock, (struct sockaddr *)&addr, SS_LEN(&addr)) < 0) {
+    if (connect(sock, (struct sockaddr *)addrs, SS_LEN(addrs)) < 0) {
        error("connect(): %s", strerror(errno));
     }
 
-    tu_dbg("connected to %s\n", str_sockaddr(&addr));
+    tu_dbg("connected to %s\n", str_sockaddr(addrs));
 
     buf = g_malloc(TEST_BLOCK_SIZE);
     for (i = 0; i < TEST_BLOCK_COUNT; i++) {
@@ -547,8 +543,8 @@ source_listen_class_init(
 {
     XferElementClass *xec = XFER_ELEMENT_CLASS(klass);
     static xfer_element_mech_pair_t mech_pairs[] = {
-       { XFER_MECH_NONE, XFER_MECH_DIRECTTCP_LISTEN, 1, 0},
-       { XFER_MECH_NONE, XFER_MECH_NONE, 0, 0},
+       { XFER_MECH_NONE, XFER_MECH_DIRECTTCP_LISTEN, XFER_NROPS(1), XFER_NTHREADS(0) },
+       { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) },
     };
 
     xec->start = source_listen_start_impl;
@@ -674,8 +670,7 @@ source_connect_setup_impl(
     g_assert(SU_GET_FAMILY(&addr) == AF_INET);
 
     addrs = g_new0(DirectTCPAddr, 2);
-    addrs[0].ipv4 = ntohl(inet_addr("127.0.0.1"));
-    addrs[0].port = SU_GET_PORT(&addr);
+    copy_sockaddr(&addrs[0], &addr);
     elt->output_listen_addrs = addrs;
 
     return TRUE;
@@ -700,8 +695,8 @@ source_connect_class_init(
 {
     XferElementClass *xec = XFER_ELEMENT_CLASS(klass);
     static xfer_element_mech_pair_t mech_pairs[] = {
-       { XFER_MECH_NONE, XFER_MECH_DIRECTTCP_CONNECT, 1, 0},
-       { XFER_MECH_NONE, XFER_MECH_NONE, 0, 0},
+       { XFER_MECH_NONE, XFER_MECH_DIRECTTCP_CONNECT, XFER_NROPS(1), XFER_NTHREADS(0) },
+       { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) },
     };
 
     xec->setup = source_connect_setup_impl;
@@ -810,8 +805,8 @@ dest_readfd_class_init(
 {
     XferElementClass *xec = XFER_ELEMENT_CLASS(klass);
     static xfer_element_mech_pair_t mech_pairs[] = {
-       { XFER_MECH_READFD, XFER_MECH_NONE, 1, 1},
-       { XFER_MECH_NONE, XFER_MECH_NONE, 0, 0},
+       { XFER_MECH_READFD, XFER_MECH_NONE, XFER_NROPS(1), XFER_NTHREADS(1) },
+       { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) },
     };
 
     xec->start = dest_readfd_start_impl;
@@ -931,8 +926,8 @@ dest_writefd_class_init(
 {
     XferElementClass *xec = XFER_ELEMENT_CLASS(klass);
     static xfer_element_mech_pair_t mech_pairs[] = {
-       { XFER_MECH_WRITEFD, XFER_MECH_NONE, 1, 1},
-       { XFER_MECH_NONE, XFER_MECH_NONE, 0, 0},
+       { XFER_MECH_WRITEFD, XFER_MECH_NONE, XFER_NROPS(1), XFER_NTHREADS(1) },
+       { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) },
     };
 
     xec->setup = dest_writefd_setup_impl;
@@ -1029,8 +1024,8 @@ dest_push_class_init(
 {
     XferElementClass *xec = XFER_ELEMENT_CLASS(klass);
     static xfer_element_mech_pair_t mech_pairs[] = {
-       { XFER_MECH_PUSH_BUFFER, XFER_MECH_NONE, 1, 0},
-       { XFER_MECH_NONE, XFER_MECH_NONE, 0, 0},
+       { XFER_MECH_PUSH_BUFFER, XFER_MECH_NONE, XFER_NROPS(1), XFER_NTHREADS(0) },
+       { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) },
     };
 
     xec->push_buffer = dest_push_push_buffer_impl;
@@ -1129,8 +1124,8 @@ dest_pull_class_init(
 {
     XferElementClass *xec = XFER_ELEMENT_CLASS(klass);
     static xfer_element_mech_pair_t mech_pairs[] = {
-       { XFER_MECH_PULL_BUFFER, XFER_MECH_NONE, 1, 1},
-       { XFER_MECH_NONE, XFER_MECH_NONE, 0, 0},
+       { XFER_MECH_PULL_BUFFER, XFER_MECH_NONE, XFER_NROPS(1), XFER_NTHREADS(1) },
+       { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) },
     };
 
     xec->start = dest_pull_start_impl;
@@ -1248,8 +1243,7 @@ dest_listen_setup_impl(
     g_assert(SU_GET_FAMILY(&addr) == AF_INET);
 
     addrs = g_new0(DirectTCPAddr, 2);
-    addrs[0].ipv4 = ntohl(inet_addr("127.0.0.1"));
-    addrs[0].port = SU_GET_PORT(&addr);
+    copy_sockaddr(&addrs[0], &addr);
     elt->input_listen_addrs = addrs;
 
     return TRUE;
@@ -1274,8 +1268,8 @@ dest_listen_class_init(
 {
     XferElementClass *xec = XFER_ELEMENT_CLASS(klass);
     static xfer_element_mech_pair_t mech_pairs[] = {
-       { XFER_MECH_DIRECTTCP_LISTEN, XFER_MECH_NONE, 1, 1},
-       { XFER_MECH_NONE, XFER_MECH_NONE, 0, 0},
+       { XFER_MECH_DIRECTTCP_LISTEN, XFER_MECH_NONE, XFER_NROPS(1), XFER_NTHREADS(1) },
+       { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) },
     };
 
     xec->setup = dest_listen_setup_impl;
@@ -1347,11 +1341,10 @@ dest_connect_thread(
     SU_INIT(&addr, AF_INET);
     addrs = elt->upstream->output_listen_addrs;
     g_assert(addrs != NULL);
-    SU_SET_PORT(&addr, addrs->port);
-    ((struct sockaddr_in *)&addr)->sin_addr.s_addr = htonl(addrs->ipv4);
+    copy_sockaddr(&addr, addrs);
 
     tu_dbg("making data connection to %s\n", str_sockaddr(&addr));
-    sock = socket(AF_INET, SOCK_STREAM, 0);
+    sock = socket(SU_GET_FAMILY(&addr), SOCK_STREAM, 0);
     if (sock < 0) {
        error("socket(): %s", strerror(errno));
     }
@@ -1397,8 +1390,8 @@ dest_connect_class_init(
 {
     XferElementClass *xec = XFER_ELEMENT_CLASS(klass);
     static xfer_element_mech_pair_t mech_pairs[] = {
-       { XFER_MECH_DIRECTTCP_CONNECT, XFER_MECH_NONE, 1, 1},
-       { XFER_MECH_NONE, XFER_MECH_NONE, 0, 0},
+       { XFER_MECH_DIRECTTCP_CONNECT, XFER_MECH_NONE, XFER_NROPS(1), XFER_NTHREADS(1) },
+       { XFER_MECH_NONE, XFER_MECH_NONE, XFER_NROPS(0), XFER_NTHREADS(0) },
     };
 
     xec->start = dest_connect_start_impl;
@@ -1486,7 +1479,7 @@ test_xfer_simple(void)
        elements[i] = NULL;
     }
 
-    xfer_start(xfer);
+    xfer_start(xfer, 0, 0);
 
     g_main_loop_run(default_main_loop());
     g_assert(xfer->status == XFER_DONE);
@@ -1541,7 +1534,7 @@ test_xfer_files(gboolean add_filters)
        elements[i] = NULL;
     }
 
-    xfer_start(xfer);
+    xfer_start(xfer, 0, 0);
 
     g_main_loop_run(default_main_loop());
     g_assert(xfer->status == XFER_DONE);
@@ -1590,7 +1583,7 @@ test_glue_combo(
        elements[i] = NULL;
     }
 
-    xfer_start(xfer);
+    xfer_start(xfer, 0, 0);
 
     g_main_loop_run(default_main_loop());
     g_assert(xfer->status == XFER_DONE);
index 5f7a6fbe27a2e35716a01f4bbdf1f8ca35a03925..ac97198c34cc6d46d1a9afc9712e679354c3455c 100644 (file)
@@ -178,7 +178,9 @@ xfer_repr(
 
 void
 xfer_start(
-    Xfer *xfer)
+    Xfer *xfer,
+    gint64 offset G_GNUC_UNUSED,
+    gint64 size)
 {
     unsigned int len;
     unsigned int i;
@@ -187,6 +189,7 @@ xfer_start(
     g_assert(xfer != NULL);
     g_assert(xfer->status == XFER_INIT);
     g_assert(xfer->elements->len >= 2);
+    g_assert(offset == 0);
 
     g_debug("Starting %s", xfer_repr(xfer));
     /* set the status to XFER_START and add a reference to our count, so that
@@ -228,6 +231,12 @@ xfer_start(
                elt->downstream = g_ptr_array_index(xfer->elements, i+1);
        }
 
+       /* Set size for first element */
+       if (size) {
+           XferElement *xe = (XferElement *)g_ptr_array_index(xfer->elements, 0);
+           xfer_element_set_size(xe, size);
+       }
+
        /* now tell them all to start, in order from destination to source */
        for (i = xfer->elements->len; i >= 1; i--) {
            XferElement *xe = (XferElement *)g_ptr_array_index(xfer->elements, i-1);
index a1f378cb76155c772422df46a9604dcabd508bf9..3d6773a02f969d3684ce91f64282c177747d3389 100644 (file)
@@ -158,8 +158,10 @@ char *xfer_repr(Xfer *xfer);
  * correctly).
  *
  * @param xfer: the Xfer object
+ * @param offset: the offset to start the transfer from (must be 0)
+ * @param size: the Xfer object: the number of bytes to transfer.
  */
-void xfer_start(Xfer *xfer);
+void xfer_start(Xfer *xfer, gint64 offset, gint64 size);
 
 /* Abort a running transfer.  This essentially tells the source to stop
  * producing data and allows the remainder of the transfer to "drain".  Thus