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
Nikhil Bhupale <nikhilb@zmanda.com>
Contributions made under GPLv2
+
+Francis Galiegue <fgaliegue@gmail.com>
+ Contributions made under GPLv2
-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
$(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 \
AR = @AR@
ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
ASSERTIONS = @ASSERTIONS@
+AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
MAILER = @MAILER@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
+MOUNT = @MOUNT@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
STDDEF_H = @STDDEF_H@
STDINT_H = @STDINT_H@
STRIP = @STRIP@
+SUNTAR = @SUNTAR@
SVN = @SVN@
SWIG = @SWIG@
SWIG_LIB = @SWIG_LIB@
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@
+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.
+ 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.
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
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])
-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)
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
$(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 \
AR = @AR@
ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
ASSERTIONS = @ASSERTIONS@
+AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
MAILER = @MAILER@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
+MOUNT = @MOUNT@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
STDDEF_H = @STDDEF_H@
STDINT_H = @STDINT_H@
STRIP = @STRIP@
+SUNTAR = @SUNTAR@
SVN = @SVN@
SWIG = @SWIG@
SWIG_LIB = @SWIG_LIB@
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@
-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
SERVICE_SENDBACKUP,
SERVICE_SELFCHECK,
SERVICE_AMINDEXD,
- SERVICE_AMIDXTAPED
+ SERVICE_AMIDXTAPED,
+ SERVICE_AMDUMPD
} service_t;
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]))
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;
}
}
/*
- * 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*/
}
}
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);
-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 = \
$(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 \
AR = @AR@
ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
ASSERTIONS = @ASSERTIONS@
+AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
MAILER = @MAILER@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
+MOUNT = @MOUNT@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
STDDEF_H = @STDDEF_H@
STDINT_H = @STDINT_H@
STRIP = @STRIP@
+SUNTAR = @SUNTAR@
SVN = @SVN@
SWIG = @SWIG@
SWIG_LIB = @SWIG_LIB@
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@
-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
}
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);
$(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 \
AR = @AR@
ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
ASSERTIONS = @ASSERTIONS@
+AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
MAILER = @MAILER@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
+MOUNT = @MOUNT@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
STDDEF_H = @STDDEF_H@
STDINT_H = @STDINT_H@
STRIP = @STRIP@
+SUNTAR = @SUNTAR@
SVN = @SVN@
SWIG = @SWIG@
SWIG_LIB = @SWIG_LIB@
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@
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++;
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") {
}
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
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",
# 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"
#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
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 \
$(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 \
AR = @AR@
ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
ASSERTIONS = @ASSERTIONS@
+AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
MAILER = @MAILER@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
+MOUNT = @MOUNT@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
STDDEF_H = @STDDEF_H@
STDINT_H = @STDINT_H@
STRIP = @STRIP@
+SUNTAR = @SUNTAR@
SVN = @SVN@
SWIG = @SWIG@
SWIG_LIB = @SWIG_LIB@
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@
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 \
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,
}
}
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:
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));
#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;
$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;
$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;
$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;
$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;
$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;
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;
}
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";
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 {
#on exit:
# $self->{exclude}
# $self->{include}
+# $self->{include_filename}
sub validate_inexclude {
my $self = shift;
}
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);
}
}
$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;
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}) {
* IGNORE
* STRANGE
* INCLUDE-LIST (for restore only)
- * EXCLUDE-LIST (for restore only)
+ * EXCLUDE-FILE
+ * EXCLUDE-LIST
* DIRECTORY
*/
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;
{"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}
};
star_dle_tardumps = 0;
star_onefilesystem = 1;
star_sparse = 1;
+ star_acl = 1;
star_directory = NULL;
/* initialize */
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;
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");
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;
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);
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);
}
}
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:
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);
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++) {
g_ptr_array_add(argv_ptr, stralloc("-"));
}
g_ptr_array_add(argv_ptr, stralloc("-C"));
+
#if defined(__CYGWIN__)
{
char tmppath[PATH_MAX];
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)
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);
}
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";
my @opt_error;
my $opt_lang;
my $opt_directory;
+my $opt_suntar_path;
Getopt::Long::Configure(qw{bundling});
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]);
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";
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);
}
$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;
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 {
}
$(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 \
AR = @AR@
ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
ASSERTIONS = @ASSERTIONS@
+AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
MAILER = @MAILER@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
+MOUNT = @MOUNT@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
STDDEF_H = @STDDEF_H@
STDINT_H = @STDINT_H@
STRIP = @STRIP@
+SUNTAR = @SUNTAR@
SVN = @SVN@
SWIG = @SWIG@
SWIG_LIB = @SWIG_LIB@
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@
-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)
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
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
###
$(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 \
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 \
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
AR = @AR@
ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
ASSERTIONS = @ASSERTIONS@
+AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
MAILER = @MAILER@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
+MOUNT = @MOUNT@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
STDDEF_H = @STDDEF_H@
STDINT_H = @STDINT_H@
STRIP = @STRIP@
+SUNTAR = @SUNTAR@
SVN = @SVN@
SWIG = @SWIG@
SWIG_LIB = @SWIG_LIB@
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@
-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
###
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)
$(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)
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
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
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
--- /dev/null
+#! @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;
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);
}
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,
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);
-}
-
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,
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
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);
}
}
+checkoverall:
check_overall();
amfree(line);
}
}
+ 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);
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;
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);
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)
# 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_SOURCES += local-security.c
-libamanda_la_LDFLAGS = -release $(VERSION)
+libamanda_la_LDFLAGS = -release $(VERSION) $(AS_NEEDED_FLAGS)
noinst_HEADERS = \
amanda.h \
$(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
$(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 \
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 \
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 \
--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) \
AR = @AR@
ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
ASSERTIONS = @ASSERTIONS@
+AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
MAILER = @MAILER@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
+MOUNT = @MOUNT@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
STDDEF_H = @STDDEF_H@
STDINT_H = @STDINT_H@
STRIP = @STRIP@
+SUNTAR = @SUNTAR@
SVN = @SVN@
SWIG = @SWIG@
SWIG_LIB = @SWIG_LIB@
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@
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)
$(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 \
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)
@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@
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)
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)
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
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
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;
}
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.
*/
/* Test all amflock implementations available for basic
* functionality
*/
-static int
+static gboolean
test_old_impls(void)
{
amflock_impl_t **imp = amflock_impls;
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 */
imp++;
}
- return 1;
+ return TRUE;
}
/*
return NULL;
}
-static int
+static gboolean
test_intra_proc_locking(void)
{
GThread *thd;
return rv;
}
-static int
+static gboolean
test_inter_proc_locking(void)
{
int outpipe[2], inpipe[2];
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(
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,
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);
*/
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.
--- /dev/null
+/*
+ * 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;
+ }
+}
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);
script_t *script)
{
amfree(script->plugin);
+ amfree(script->client_name);
if (script->property)
g_hash_table_destroy(script->property);
}
dle->scriptlist = NULL;
dle->data_path = DATA_PATH_AMANDA;
dle->directtcp_list = NULL;
+ dle->application_client_name = NULL;
dle->next = NULL;
}
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) {
"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);
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)
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);
execute_on_t execute_on;
int execute_where;
proplist_t property;
+ char *client_name;
struct client_script_result_s *result;
} script_t;
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;
void (*fn)(security_handle_t *, pkt_t *),
void *datap)
{
+ struct stat sbuf;
assert(in >= 0 && out >= 0);
assert(fn != NULL);
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");
+ }
}
/*
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,
/* 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,
/* 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,
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.
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;
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
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 *);
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 *);
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
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
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);
/*
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;
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);
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
/* 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 },
{ "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 },
{ "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 },
{ "DUMPORDER", CONF_DUMPORDER },
{ "DUMPTYPE", CONF_DUMPTYPE },
{ "DUMPUSER", CONF_DUMPUSER },
+ { "DUMP_LIMIT", CONF_DUMP_LIMIT },
{ "EMPTY", CONF_EMPTY },
{ "ENCRYPT", CONF_ENCRYPT },
{ "ERROR", CONF_ERROR },
{ "INDEXDIR", CONF_INDEXDIR },
{ "INFOFILE", CONF_INFOFILE },
{ "INPARALLEL", CONF_INPARALLEL },
+ { "INTERACTIVITY", CONF_INTERACTIVITY },
{ "INTERFACE", CONF_INTERFACE },
{ "KENCRYPT", CONF_KENCRYPT },
{ "KRB5KEYTAB", CONF_KRB5KEYTAB },
{ "MAXPROMOTEDAY", CONF_MAXPROMOTEDAY },
{ "MEMORY", CONF_MEMORY },
{ "MEDIUM", CONF_MEDIUM },
+ { "META_AUTOLABEL", CONF_META_AUTOLABEL },
{ "NETUSAGE", CONF_NETUSAGE },
{ "NEVER", CONF_NEVER },
{ "NOFULL", CONF_NOFULL },
{ "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 },
{ "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 },
{ "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 },
{ 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 },
{ 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 },
{ 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 }
};
{ 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 }
};
{ 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 }
};
{ 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 }
};
{ 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
*/
*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) {
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;
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);
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
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
}
-application_t *
+static application_t *
read_application(
char *name,
FILE *from,
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
}
}
-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,
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
}
}
-device_config_t *
+static device_config_t *
read_device_config(
char *name,
FILE *from,
}
}
-changer_config_t *
+static changer_config_t *
read_changer_config(
char *name,
FILE *from,
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,
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"));
}
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,
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;
}
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) {
rl->same_host = TRUE;
break;
+ case CONF_SERVER:
+ rl->server = TRUE;
+ break;
+
case CONF_NL:
case CONF_END:
return;
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)
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;
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]);
/* 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], "");
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);
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] , "");
#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();
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;
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,
}
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
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) {
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;
}
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)
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)
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)
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
switch(valsrc->type) {
case CONFTYPE_INT:
case CONFTYPE_BOOLEAN:
+ case CONFTYPE_NO_YES_ALL:
case CONFTYPE_COMPRESS:
case CONFTYPE_ENCRYPT:
case CONFTYPE_HOLDING:
}
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;
switch(val->type) {
case CONFTYPE_INT:
case CONFTYPE_BOOLEAN:
+ case CONFTYPE_NO_YES_ALL:
case CONFTYPE_COMPRESS:
case CONFTYPE_ENCRYPT:
case CONFTYPE_HOLDING:
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:
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) {
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;
}
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
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:
}
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], " ");
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 = ", ";
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 = ", ";
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 = ", ";
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 = ", ";
} 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;
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. */
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
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;
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 *);
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?
*
#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)
#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
CNF_CONF,
CNF_INDEX_SERVER,
CNF_TAPE_SERVER,
+ CNF_AMDUMP_SERVER,
CNF_AUTH,
CNF_SSH_KEYS,
CNF_AMANDAD_PATH,
CNF_TAPEDEV,
CNF_DEVICE_PROPERTY,
CNF_PROPERTY,
+ CNF_INTERACTIVITY,
CNF_APPLICATION,
CNF_APPLICATION_TOOL,
CNF_EXECUTE_ON,
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;
#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))))
#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
*
DUMPTYPE_DATA_PATH,
DUMPTYPE_ALLOW_SPLIT,
DUMPTYPE_RECOVERY_LIMIT,
+ DUMPTYPE_DUMP_LIMIT,
DUMPTYPE_DUMPTYPE /* sentinel */
} dumptype_key;
#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
APPLICATION_COMMENT,
APPLICATION_PLUGIN,
APPLICATION_PROPERTY,
+ APPLICATION_CLIENT_NAME,
APPLICATION_APPLICATION
} application_key;
#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 {
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;
#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 */
#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 */
#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
*/
#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 */
/****
* Test that EV_TIME events fire, repeatedly.
*/
-static int
+static gboolean
test_ev_time(void)
{
global = 2;
/****
* 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 */
* 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;
}
/****
}
}
-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;
}
/****
event_release(hdl[1]);
}
-static int
+static gboolean
test_event_wait(void)
{
int cb_fired = 0;
* 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;
}
/****
event_wakeup(9876);
}
-static int
+static gboolean
test_event_wait_2(void)
{
int wakeups_remaining = 2;
* 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;
}
/****
#define TEST_EV_READFD_SIZE (1024*1024)
-static int
+static gboolean
test_ev_readfd(void)
{
int writer_pid;
case -1: /* error */
perror("fork");
- return 0;
+ return FALSE;
default: /* parent */
break;
if (global != 0) {
tu_dbg("%d bytes remain unread..\n", global);
- return 0;
+ return FALSE;
}
- return 1;
+ return TRUE;
}
/****
event_release(hdl[1]);
}
-static int
+static gboolean
test_read_timeout(void)
{
int writer_pid;
case -1: /* error */
perror("fork");
- return 0;
+ return FALSE;
default: /* parent */
break;
/* see if we got the sentinel indicating the timeout fired */
if (global != 1234)
- return 0;
+ return FALSE;
- return 1;
+ return TRUE;
}
/****
#define TEST_EV_WRITEFD_SIZE (1024*1024)
-static int
+static gboolean
test_ev_writefd(void)
{
int reader_pid;
case -1: /* error */
perror("fork");
- return 0;
+ return FALSE;
default: /* parent */
break;
/* and see what we got */
if (global != 0) {
tu_dbg("writes did not complete\n");
- return 0;
+ return FALSE;
}
- return 1;
+ return TRUE;
}
/****
g_main_loop_quit(test_child_watch_main_loop);
}
-static int
+static gboolean
test_child_watch_source(void)
{
int pid, pid2;
case -1: /* error */
perror("fork");
- return 0;
+ return FALSE;
default: /* parent */
break;
case -1: /* error */
perror("fork");
- return 0;
+ return FALSE;
default: /* parent */
break;
}
/* one function for each field; each fn calls the one above */
-static int
+static gboolean
test_roundtrip(void)
{
int rv;
rv = PREV_RT(&hdr);
tu_dbg("%d round-trips run\n", n_round_trips);
- return rv;
+ return (rv) ? TRUE : FALSE;
}
/* doc
#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[] = {
{"\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;
}
typedef struct {char *in; char *out; gboolean expect_err; } dec_vec;
-static int
+static gboolean
test_decode(void)
{
static const dec_vec test_strs[] = {
{"%00", "", TRUE}
};
static const int num = sizeof(test_strs)/sizeof(dec_vec);
- int i, ret;
+ int i;
+ gboolean ret;
char *tmp;
GError *err = NULL;
}
typedef char* round_vec;
-static int
+static gboolean
test_roundtrip(void)
{
static const round_vec test_strs[] = {
"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;
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;
return 1;
}
-static int
+static gboolean
test_sync(void)
{
int rv;
if (pipe(p) == -1) {
perror("pipe");
- return 0;
+ return FALSE;
}
proto = ipc_binary_proto_new(0xE10E);
/* 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
"LOCAL",
local_connect,
sec_accept,
- sec_get_authenticated_peer_name_localhost,
+ sec_get_authenticated_peer_name_gethostname,
sec_close,
stream_sendpkt,
stream_recvpkt,
/* 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 */
* Tests
*/
-static int
+static gboolean
test_validate_regexp(void)
{
gboolean ok = TRUE;
return ok;
}
-static int
+static gboolean
test_match(void)
{
gboolean ok = TRUE;
return ok;
}
-static int
+static gboolean
test_validate_glob(void)
{
gboolean ok = TRUE;
return ok;
}
-static int
+static gboolean
test_glob_to_regex(void)
{
gboolean ok = TRUE;
return ok;
}
-static int
+static gboolean
test_match_glob(void)
{
gboolean ok = TRUE;
return ok;
}
-static int
+static gboolean
test_match_tar(void)
{
gboolean ok = TRUE;
return ok;
}
-static int
+static gboolean
test_make_exact_host_expression(void)
{
gboolean ok = TRUE;
return ok;
}
-static int
+static gboolean
test_match_host(void)
{
gboolean ok = TRUE;
return ok;
}
-static int
+static gboolean
test_make_exact_disk_expression(void)
{
gboolean ok = TRUE;
return ok;
}
-static int
+static gboolean
test_match_disk(void)
{
gboolean ok = TRUE;
return ok;
}
-static int
+static gboolean
test_match_datestamp(void)
{
gboolean ok = TRUE;
return ok;
}
-static int
+static gboolean
test_match_level(void)
{
gboolean ok = TRUE;
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(®c, regex,
- REG_EXTENDED|REG_NOSUB|REG_NEWLINE)) != 0) {
- regerror(result, ®c, errmsg, SIZEOF(errmsg));
- return errmsg;
- }
+ valid = do_validate_regex(regex, ®c, &errmsg, TRUE);
regfree(®c);
-
- return NULL;
+ return (valid) ? NULL : errmsg;
}
char *
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(®c, regex,
- REG_EXTENDED|REG_NOSUB|REG_NEWLINE)) != 0) {
- regerror(result, ®c, errmsg, SIZEOF(errmsg));
- error(_("regex \"%s\": %s"), regex, errmsg);
- /*NOTREACHED*/
- }
+ regex_errbuf errmsg;
+ gboolean ok;
- if((result = regexec(®c, str, 0, 0, 0)) != 0
- && result != REG_NOMATCH) {
- regerror(result, ®c, errmsg, SIZEOF(errmsg));
- error(_("regex \"%s\": %s"), regex, errmsg);
- /*NOTREACHED*/
- }
-
- regfree(®c);
-
- return result == 0;
-}
+ ok = do_validate_regex(regex, ®c, &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(®c, regex,
- REG_EXTENDED|REG_NOSUB)) != 0) {
- regerror(result, ®c, errmsg, SIZEOF(errmsg));
- error(_("regex \"%s\": %s"), regex, errmsg);
- /*NOTREACHED*/
- }
+ result = try_match(®c, str, &errmsg);
- if((result = regexec(®c, str, 0, 0, 0)) != 0
- && result != REG_NOMATCH) {
- regerror(result, ®c, errmsg, SIZEOF(errmsg));
- error(_("regex \"%s\": %s"), regex, errmsg);
- /*NOTREACHED*/
- }
+ if (result == MATCH_ERROR)
+ error(_("regex \"%s\": %s"), regex, errmsg);
+ /*NOTREACHED*/
regfree(®c);
- 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(®c, regex,
- REG_EXTENDED|REG_NOSUB|REG_NEWLINE)) != 0) {
- regerror(result, ®c, errmsg, SIZEOF(errmsg));
- amfree(regex);
- return errmsg;
- }
+
+ if (!do_validate_regex(regex, ®c, &errmsg, TRUE))
+ ret = errmsg;
regfree(®c);
amfree(regex);
-
- return NULL;
+ return ret;
}
int
char *regex;
regex_t regc;
int result;
- char errmsg[STR_SIZE];
+ regex_errbuf errmsg;
+ gboolean ok;
regex = glob_to_regex(glob);
- if((result = regcomp(®c, regex,
- REG_EXTENDED|REG_NOSUB|REG_NEWLINE)) != 0) {
- regerror(result, ®c, errmsg, SIZEOF(errmsg));
- error(_("glob \"%s\" -> regex \"%s\": %s"), glob, regex, errmsg);
- /*NOTREACHED*/
- }
+ ok = do_validate_regex(regex, ®c, &errmsg, TRUE);
- if((result = regexec(®c, str, 0, 0, 0)) != 0
- && result != REG_NOMATCH) {
- regerror(result, ®c, 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(®c, str, &errmsg);
+
+ if (result == MATCH_ERROR)
+ error(_("glob \"%s\" -> regex \"%s\": %s"), glob, regex, errmsg);
+ /*NOTREACHED*/
regfree(®c);
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(
char *regex;
regex_t regc;
int result;
- char errmsg[STR_SIZE];
+ regex_errbuf errmsg;
+ gboolean ok;
regex = tar_to_regex(glob);
- if((result = regcomp(®c, regex,
- REG_EXTENDED|REG_NOSUB|REG_NEWLINE)) != 0) {
- regerror(result, ®c, errmsg, SIZEOF(errmsg));
- error(_("glob \"%s\" -> regex \"%s\": %s"), glob, regex, errmsg);
- /*NOTREACHED*/
- }
+ ok = do_validate_regex(regex, ®c, &errmsg, TRUE);
- if((result = regexec(®c, str, 0, 0, 0)) != 0
- && result != REG_NOMATCH) {
- regerror(result, ®c, 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(®c, str, &errmsg);
+
+ if (result == MATCH_ERROR)
+ error(_("glob \"%s\" -> regex \"%s\": %s"), glob, regex, errmsg);
+ /*NOTREACHED*/
regfree(®c);
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(
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;
}
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;
}
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
* 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
* Round-trip testing of quoting functions
*/
-static int
+static gboolean
test_round_trip(void)
{
char **strp;
return TRUE;
}
-static int
+static gboolean
test_split_quoted_strings(void)
{
char **iter1, **iter2, **iter3;
const char *expected[5];
};
-static int
+static gboolean
test_split_quoted_strings_edge(void)
{
gboolean success = TRUE;
/****
* Test unquoting of some pathological strings
*/
-static int
+static gboolean
test_unquote_string(void)
{
gboolean success = TRUE;
/****
* Test the strquotedstr function
*/
-static int
+static gboolean
test_strquotedstr_skipping(void)
{
char **iter1, **iter2;
return success;
}
-static int
+static gboolean
test_strquotedstr_edge_invalid(void)
{
gboolean success = TRUE;
return success;
}
-static int
+static gboolean
test_strquotedstr_edge_valid(void)
{
gboolean success = TRUE;
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 */
}
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";
}
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 */
{
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;
* @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.).
/*
* 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
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);
* 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;
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));
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));
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));
-#define BUILT_REV "3720"
-#define BUILT_BRANCH "3_2"
+#define BUILT_REV "4084"
+#define BUILT_BRANCH "3_3"
/*
- * 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)
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");
}
}
- if (result) {
- g_fprintf(stderr, " PASS %s\n", test->name);
- } else {
- g_fprintf(stderr, " FAIL %s\n", test->name);
- }
-
return result;
}
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"
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) {
} 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;
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;
}
/* 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;
}
$(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 \
AR = @AR@
ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
ASSERTIONS = @ASSERTIONS@
+AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
MAILER = @MAILER@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
+MOUNT = @MOUNT@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
STDDEF_H = @STDDEF_H@
STDINT_H = @STDINT_H@
STRIP = @STRIP@
+SUNTAR = @SUNTAR@
SVN = @SVN@
SWIG = @SWIG@
SWIG_LIB = @SWIG_LIB@
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@
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 \
--- /dev/null
+# 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)
+])
+
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
## 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
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. ])
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
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
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])
/* 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
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
PS
LPRFLAG
LPR
+UMOUNT
+MOUNT
MTX
MT_FILE_FLAG
MT
WANT_SAMBA_FALSE
WANT_SAMBA_TRUE
SAMBA_CLIENT
+SUNTAR
STAR
GNUTAR
DUMP_RETURNS_1
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
CONFIG_DIR
SETUID_GROUP
CLIENT_LOGIN
+AS_NEEDED_FLAGS
+WANT_AS_NEEDED_FALSE
+WANT_AS_NEEDED_TRUE
AMANDA_WARNING_CFLAGS
gltests_WITNESS
REPLACE_ISWCNTRL
with_cflags
with_includes
with_libraries
+enable_as_needed
with_user
with_group
with_dumperdir
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
with_dump_honor_nodump
with_gnutar
with_star
+with_suntar
with_smbclient
with_samba_user
with_rundump
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
PERL
GNUTAR
STAR
+SUNTAR
YACC
YFLAGS
MTX
+MOUNT
+UMOUNT
GLIB_CFLAGS
GLIB_LIBS
GLIB_GENMARSHAL
--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
--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]
--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]
--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
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
--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
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
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)
#
-# 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;
}
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
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
;;
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
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
;;
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
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
;;
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
;;
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
;;
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
;;
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
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
;;
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
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
;;
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
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
;;
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
;;
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
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
;;
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
-{ $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
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
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
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
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:)
$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
-{ $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
;;
*-*-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=$?
-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.
-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.
-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
-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
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
(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
(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
(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
(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. */
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;;
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
(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
(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
(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;
}
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
(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
(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;
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;
}
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"
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
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
;
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
;
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
;
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
;
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
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
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);
}
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
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
# 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
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
;
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
;
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
;
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
;
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
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
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);
}
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
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
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;
}
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
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;
}
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
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;
}
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
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;
}
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
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;
}
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
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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"
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;
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"
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;
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
(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;;
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
(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
(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
(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
(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
(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. */
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, µ) != 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"
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
(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;;
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
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"
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
(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
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
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"
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
(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"
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
(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
(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
(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;
}
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;
}
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;
}
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;
}
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;
}
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, µ) != 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;
}
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
#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;
}
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
(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
#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;
}
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
#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;
}
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
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. */
# 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
#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;
}
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
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
_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))"
_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
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;
}
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
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
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
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. */
_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))"
_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
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. */
_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))"
_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
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. */
_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))"
_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
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. */
_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))"
_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
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
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
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. */
_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))"
_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
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. */
_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))"
_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
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. */
_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))"
_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
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. */
# 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
#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;
}
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
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
_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))"
_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
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. */
_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))"
_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
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. */
_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))"
_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
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. */
_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))"
_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
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. */
_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))"
_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
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. */
_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))"
_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
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. */
_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))"
_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
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. */
_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))"
_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
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. */
_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))"
_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
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
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. */
_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))"
_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
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. */
_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))"
_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
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. */
_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))"
_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
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. */
# 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
#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;
}
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
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. */
_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))"
_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
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. */
_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))"
_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
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. */
_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))"
_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
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. */
_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))"
_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
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
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. */
_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))"
_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
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. */
_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))"
_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
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. */
_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))"
_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
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. */
_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))"
_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
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. */
_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))"
_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
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. */
_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))"
_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
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. */
_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))"
_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
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. */
_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))"
_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
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. */
_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))"
_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
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. */
_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))"
_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
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. */
_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))"
_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
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. */
_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))"
_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
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. */
_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))"
_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
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. */
_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))"
_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
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. */
_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))"
_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
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. */
# 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
#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;
}
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
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. */
_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))"
_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
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. */
# 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
#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;
}
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
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. */
_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))"
_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
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. */
_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))"
_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
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
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. */
_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))"
_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
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. */
_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))"
_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
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. */
_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))"
_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
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. */
_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))"
_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
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
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. */
_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))"
_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
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. */
_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))"
_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
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. */
# 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
#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;
}
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
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. */
_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))"
_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
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. */
_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))"
_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
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
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. */
_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))"
_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
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. */
_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))"
_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
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. */
_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))"
_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
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. */
_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))"
_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
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. */
# 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
#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;
}
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
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. */
_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))"
_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
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
_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))"
_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;
}
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
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. */
# 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
#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;
}
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
(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
(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
#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;
}
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
(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
(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
(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
(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
(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
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
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
AC_EXEEXT
AMANDA_INIT_FLAGS
AMANDA_ADD_CPPFLAGS([-D_GNU_SOURCE])
+AMANDA_AS_NEEDED
dnl -------------------------------------------------------------------------
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
#
AMANDA_PROG_DUMP_RESTORE
AMANDA_PROG_GNUTAR
AMANDA_PROG_STAR
+AMANDA_PROG_SUNTAR
AMANDA_PROG_SAMBA_CLIENT
AMANDA_CHECK_USE_RUNDUMP
AMANDA_PROG_MAILER
AMANDA_PROG_MT
AMANDA_PROG_MTX
+AMANDA_PROG_MOUNT
+AMANDA_PROG_UMOUNT
AMANDA_PROG_LPR
AMANDA_PROG_PCAT
AMANDA_PROG_PERL
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
# 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 =
## 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 \
$(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 \
AR = @AR@
ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
ASSERTIONS = @ASSERTIONS@
+AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
MAILER = @MAILER@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
+MOUNT = @MOUNT@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
STDDEF_H = @STDDEF_H@
STDINT_H = @STDINT_H@
STRIP = @STRIP@
+SUNTAR = @SUNTAR@
SVN = @SVN@
SWIG = @SWIG@
SWIG_LIB = @SWIG_LIB@
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@
-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 \
/* 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;
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,
}
/* 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);
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)
}
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);
/* 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)) {
}
/* 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,
/* 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)) {
}
/* 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,
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?");
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;
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;
*/
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;
char *bucket_location;
char *storage_class;
+ char *host;
+ char *service_path;
char *ca_info;
/* 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;
};
/*
#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-"
#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)
#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
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
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 */
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
*/
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;
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;
}
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;
}
{
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;
}
/* 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;
}
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,
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");
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);
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()
*/
&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,
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,
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
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)
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);
}
{
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;
{
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;
{
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)
{
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);
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")),
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;
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 */
/* 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?")),
/* 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;
}
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);
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;
}
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;
}
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;
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
}
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 */
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 */
}
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);
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)
return FALSE;
}
}
+ self->volume_bytes = 0;
return TRUE;
}
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) {
} 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) {
}
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);
}
/* attributes for new objects */
char *bucket_location;
char *storage_class;
-
+ char *host;
+ char *service_path;
+ gboolean use_subdomain;
char *ca_info;
CURL *curl;
*
* @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,
* @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,
const char *bucket,
const char *key,
const char *subresource,
- const char *md5_hash,
- gboolean use_subdomain);
+ const char *md5_hash);
}
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,
/* 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, "/");
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);
}
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;
}
/* 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);
}
}
- if (bucket && (use_subdomain || key))
+ if (bucket && (hdl->use_subdomain || key))
g_string_append(auth_string, "/");
if (key) {
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. */
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;
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 */
/* 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)))
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);
/* 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;
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);
gboolean is_truncated;
gchar *next_marker;
+ guint64 size;
gboolean want_text;
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")) {
} 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;
const char *bucket,
const char *prefix,
const char *delimiter,
- GSList **list)
+ GSList **list,
+ guint64 *total_size)
{
/*
* max len of XML variables:
thunk.filename_list = NULL;
thunk.text = NULL;
thunk.next_marker = NULL;
+ thunk.size = 0;
/* Loop until S3 has given us the entire picture */
do {
return FALSE;
} else {
*list = thunk.filename_list;
+ if(total_size) {
+ *total_size = thunk.size;
+ }
return TRUE;
}
}
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;
S3_ERROR(MissingSecurityHeader), \
S3_ERROR(NoLoggingStatusForKey), \
S3_ERROR(NoSuchBucket), \
+ S3_ERROR(NoSuchEntity), \
S3_ERROR(NoSuchKey), \
S3_ERROR(NotImplemented), \
S3_ERROR(NotSignedUp), \
* @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
* @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
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.
/*
- * 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
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);
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;
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,
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,
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)
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;
}
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;
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);
/* 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;
/* timer for the duration; NULL while paused or cancelled */
GTimer *part_timer;
+
+ gint64 size;
} XferSourceRecovery;
/*
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);
$(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 \
AR = @AR@
ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
ASSERTIONS = @ASSERTIONS@
+AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
MAILER = @MAILER@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
+MOUNT = @MOUNT@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
STDDEF_H = @STDDEF_H@
STDINT_H = @STDINT_H@
STRIP = @STRIP@
+SUNTAR = @SUNTAR@
SVN = @SVN@
SWIG = @SWIG@
SWIG_LIB = @SWIG_LIB@
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@
#
-# 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.
#
# 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
# indexing, recording, etc. Some examples:
# index yes
# record no
- # split_diskbuffer "/raid/amanda"
- # fallback_splitsize 64m
+ # auth "bsdtcp"
}
define dumptype always-full {
#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.
-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
:
# 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
$(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 \
AR = @AR@
ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
ASSERTIONS = @ASSERTIONS@
+AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
MAILER = @MAILER@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
+MOUNT = @MOUNT@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
STDDEF_H = @STDDEF_H@
STDINT_H = @STDINT_H@
STRIP = @STRIP@
+SUNTAR = @SUNTAR@
SVN = @SVN@
SWIG = @SWIG@
SWIG_LIB = @SWIG_LIB@
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@
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
# define FSUSAGE_H_
# include <stdint.h>
-# include <stdbool.h>
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. */
};
--- /dev/null
+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. */
+ };
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 ""
# 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;
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");
}
# 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
{
$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
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:");
# 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;
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,
die(join "\n", @errors);
}
+$chg->quit();
$chg = Amanda::Changer->new();
die($chg) if $chg->isa("Amanda::Changer::Error");
$get_info->();
Amanda::MainLoop::run();
}
+$chg->quit();
# test two simultaneous invocations of info()
}
test_except_slots(\&Amanda::MainLoop::quit);
Amanda::MainLoop::run();
+$chg->quit();
unlink($changer_filename);
unlink($result_file);
# 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;
$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) = @_;
Amanda::MainLoop::run();
}
+$chg->quit();
rmtree($taperoot);
# 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;
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 = ();
Amanda::MainLoop::run();
}
+$chg->quit();
rmtree($taperoot);
# 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;
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();
$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'});
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);
"$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'});
};
# 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;
}
my $chg = Amanda::Changer->new("chg-null:");
+is($chg->have_inventory(), '', "changer have inventory");
{
my ($get_info, $check_info, $do_load, $got_res);
$try_eject->();
Amanda::MainLoop::run();
}
+
+$chg->quit();
# 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;
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'},
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'},
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();
"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();
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");
# 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;
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();
$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'});
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");
$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 {
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();
}
##
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);
$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();
# 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;
'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();
[ 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)");
[ 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)
$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',
$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");
$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'
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\"");
+
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}) {
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;
# 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;
"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")
"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,
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:";
"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");
$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");
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);
},
);
+$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);
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;
my %params = @_;
Amanda::Debug::debug("Change changer to multi-changer");
- $params{'finished_cb'}->(undef, "multi-changer");
+ $params{'request_cb'}->(undef, "multi-changer");
};
# --------
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);
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);
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'}->();
(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");
# 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;
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");
}
@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);
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: {
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,
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,
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
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");
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,
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);
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
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");
# 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);
}
# 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-%",
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();
+
--- /dev/null
+# 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);
--- /dev/null
+# 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);
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
}
# 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 {
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);
}
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);
[ 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 ],
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);
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'}) {
}, $class;
}
+sub quit {
+ my $self = shift;
+}
+
sub make_new_tape_label {
return "FAKELABEL";
}
main::event("scribe_notif_tape_done",
$params{'volume_label'}, $params{'num_files'},
$params{'size'});
+ $params{'finished_cb'}->();
}
}
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
], "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' ],
], "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' ],
], "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' ],
], "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' ],
# 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',
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();
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();
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();
[ '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();
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();
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();
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();
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();
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();
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(
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(
part_size => 100,
part_cache_dir => "/tmp",
) },
- { },
+ { allow_split => 0 },
"default if dle_allow_split is false, no splitting");
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(
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(
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(
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)");
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(
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(
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(
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(
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");
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);
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),
]);
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),
]);
=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.
$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.
# 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");
}
$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);
}
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);
Amanda_Report \
Amanda_Tapelist \
Amanda_Taper_Scan \
+ Amanda_Taper_Scan_lexical \
+ Amanda_Taper_Scan_oldest \
Amanda_Taper_Scan_traditional \
Amanda_Taper_Scribe \
bigint \
amcheckdump \
amdevcheck \
amdump \
+ amdump_client \
amflush \
amoverview \
amreport \
$(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 \
AR = @AR@
ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
ASSERTIONS = @ASSERTIONS@
+AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
MAILER = @MAILER@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
+MOUNT = @MOUNT@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
STDDEF_H = @STDDEF_H@
STDINT_H = @STDINT_H@
STRIP = @STRIP@
+SUNTAR = @SUNTAR@
SVN = @SVN@
SWIG = @SWIG@
SWIG_LIB = @SWIG_LIB@
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@
Amanda_Report \
Amanda_Tapelist \
Amanda_Taper_Scan \
+ Amanda_Taper_Scan_lexical \
+ Amanda_Taper_Scan_oldest \
Amanda_Taper_Scan_traditional \
Amanda_Taper_Scribe \
bigint \
amcheckdump \
amdevcheck \
amdump \
+ amdump_client \
amflush \
amoverview \
amreport \
# 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;
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");
run_get('amdevcheck', 'TESTCONF', 'file:'.$Installcheck::Run::taperoot) ],
[ sort "SUCCESS" ],
"used vtape described as SUCCESS");
-
Installcheck::Run::cleanup();
--- /dev/null
+# 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();
# 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;
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");
$tl->reload();
is_deeply($tl->{'tles'}->[0], {
'reuse' => 1,
- 'barcode' => undef,
+ 'barcode' => undef,
+ 'meta' => undef,
'comment' => undef,
'position' => 1,
'label' => 'TESTCONF92',
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");
+
# 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;
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: {
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();
}
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'),
'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!");
};
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";
'>=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
'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 {
extra_args => [ '--wildcards' ],
expectations => {
'<1.16' => 'alpha',
- '>=1.16' => 'beta',
+ '1.16..<1.25' => 'beta',
+ '>=1.25' => 'zeta',
},
);
extra_args => [ '--wildcards', '--no-unquote' ],
expectations => {
'<1.16' => undef,
- '>=1.16' => 'gamma',
+ '1.16..<1.25' => 'gamma',
+ '>=1.25' => 'eta',
},
);
expectations => {
'!1.23' => 'gamma',
'1.23' => 'delta',
+ '>=1.25' => 'eta',
},
);
}
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"
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;
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;
# 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;
$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();
}
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;
##
$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");
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");
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");
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;
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");
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;
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");
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;
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");
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";
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");
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");
##
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");
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;
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();
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;
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();
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");
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");
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;
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();
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;
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");
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$/,
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();
$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();
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 \
amanda-devices.7 \
amanda-compatibility.7 \
amanda-changers.7 \
+ amanda-interactivity.7 \
amanda-taperscan.7 \
amaddclient.8 \
amadmin.8 \
amreport.8 \
amrmtape.8 \
amserverconfig.8 \
- amservice.8 \
amstatus.8 \
amtape.8 \
amtapetype.8 \
$(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 \
AR = @AR@
ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
ASSERTIONS = @ASSERTIONS@
+AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
MAILER = @MAILER@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
+MOUNT = @MOUNT@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
STDDEF_H = @STDDEF_H@
STDINT_H = @STDINT_H@
STRIP = @STRIP@
+SUNTAR = @SUNTAR@
SVN = @SVN@
SWIG = @SWIG@
SWIG_LIB = @SWIG_LIB@
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@
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 \
amanda-devices.7 \
amanda-compatibility.7 \
amanda-changers.7 \
+ amanda-interactivity.7 \
amanda-taperscan.7 \
amaddclient.8 \
amadmin.8 \
amreport.8 \
amrmtape.8 \
amserverconfig.8 \
- amservice.8 \
amstatus.8 \
amtape.8 \
amtapetype.8 \
.\" 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
.\" -----------------------------------------------------------------
.\" 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
.\" -----------------------------------------------------------------
.\" 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
.\" -----------------------------------------------------------------
.\" 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
.\" -----------------------------------------------------------------
.\" 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
.\" -----------------------------------------------------------------
.\" 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
.\" -----------------------------------------------------------------
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
.\" 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
.\" -----------------------------------------------------------------
.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
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"
.\" 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
.\" -----------------------------------------------------------------
\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
.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:
.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:
.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+
.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:
.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:
.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]*
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\&.
.\" 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
.\" -----------------------------------------------------------------
.\" 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
.\" -----------------------------------------------------------------
(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
.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
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\&.
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
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
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"
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
--- /dev/null
+'\" 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
.\" 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
.\" -----------------------------------------------------------------
.\" 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
.\" -----------------------------------------------------------------
(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),
.\" 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
.\" -----------------------------------------------------------------
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
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/
.\" 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
.\" -----------------------------------------------------------------
.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
.\" 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
.\" -----------------------------------------------------------------
.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
.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:
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:
\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
\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
\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
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:
compress server fast
}
define dumptype "bsd\-auth" {
- auth bsd
+ auth "bsd"
+}
+define dumptype "bsdtcp\-auth" {
+ auth "bsdtcp"
}
define dumptype "no\-record" {
record no
.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\&.
.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\&.
\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:
.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\&.
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\&.
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\&.
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\&.
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\&.
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\&.
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\&.
\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/
.\" 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
.\" -----------------------------------------------------------------
.\" 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
.\" -----------------------------------------------------------------
.\" 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
.\" -----------------------------------------------------------------
.\" 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
.\" -----------------------------------------------------------------
.\" 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
.\" -----------------------------------------------------------------
.\" 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
.\" -----------------------------------------------------------------
.\" 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
.\" -----------------------------------------------------------------
.\" 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
.\" -----------------------------------------------------------------
.\" 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
.\" -----------------------------------------------------------------
.\" 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
.\" -----------------------------------------------------------------
.\" 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
.\" -----------------------------------------------------------------
--- /dev/null
+'\" 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
.\" 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
.\" -----------------------------------------------------------------
.\" 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
.\" -----------------------------------------------------------------
.\" 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
.\" -----------------------------------------------------------------
.\" 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
.\" -----------------------------------------------------------------
.\" 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
.\" -----------------------------------------------------------------
.\" 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
.\" -----------------------------------------------------------------
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\&.
.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
(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
.\" 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
.\" -----------------------------------------------------------------
\fB\-\-config\fR \fIconfig\fR
.RS 4
Use configuration
-\fIconfig\fR
-instead of configuration daily\&.
+\fIconfig\fR\&.
.RE
.PP
\fB\-\-hostwidth\fR \fIwidth\fR
.\" 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
.\" -----------------------------------------------------------------
.\" 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
.\" -----------------------------------------------------------------
.\" 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
.\" -----------------------------------------------------------------
.\" 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
.\" -----------------------------------------------------------------
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
.\" 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
.\" -----------------------------------------------------------------
.\" 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
.\" -----------------------------------------------------------------
.\" 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
.\" -----------------------------------------------------------------
.\" 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
.\" -----------------------------------------------------------------
.\" 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
.\" -----------------------------------------------------------------
.\" 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
.\" -----------------------------------------------------------------
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
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
.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
.\" 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
.\" -----------------------------------------------------------------
.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\&.
.\" 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
.\" -----------------------------------------------------------------
.\" 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
.\" -----------------------------------------------------------------
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
.\" 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
.\" -----------------------------------------------------------------
.\" 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
.\" -----------------------------------------------------------------
.\" 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
.\" -----------------------------------------------------------------
.\" 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
.\" -----------------------------------------------------------------
.\" 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
.\" -----------------------------------------------------------------
.\" 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
.\" -----------------------------------------------------------------
.\" 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
.\" -----------------------------------------------------------------
.\" 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
.\" -----------------------------------------------------------------
.\" 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
.\" -----------------------------------------------------------------
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
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
</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>
<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>,
<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 >= 1 is required to prevent useless mount/umount.
+</listitem></varlistentry>
+
+</variablelist>
+</refsect3>
</refsect2>
<refsect2><title>chg-disk (old)</title>
<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>
<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>
</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>
<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>
<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>
</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>
<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>
<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>
<!-- ==== -->
<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>
<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 (> 1 megabyte) is reccomended with the S3 device.</para>
+ sizes (> 1 megabyte) is recommended with the S3 device.</para>
<para>
Amanda automatically creates a bucket when writing, if the bucket doesn't
<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
(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>
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>
</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 && 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
+</refsect3>
</refsect2>
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>
--- /dev/null
+<?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 <enter>. 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>
</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>
</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
</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>
<manref name="amanda-devices" vol="7"/>,
</listitem>
<listitem>
+<manref name="amanda-interactivity" vol="7"/>,
+</listitem>
+<listitem>
<manref name="amanda-match" vol="7"/>,
</listitem>
<listitem>
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 "DailySet1-%%%" empty</markup>
+<markup>"DailySet1-%%%"</markup>,
+<markup>"$c-%%%"</markup>,
+<markup>"$m-%%%"</markup>,
+<markup>"$m-$b"</markup>
</para>
<para>Note that many devices cannot distinguish an empty tape from an error
condition, so it may is often necessary to include
</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>"DailySet1-%%%"</markup>,
+<markup>"$o-%%%"</markup>,
+</para>
+ </listitem>
+ </varlistentry>
+
<varlistentry>
<term><amkeyword>dumpuser</amkeyword> <amtype>string</amtype></term>
<listitem>
</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>
</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>
</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
<term><amkeyword>auth</amkeyword> <amtype>string</amtype></term>
<listitem>
<para>Default:
-<amdefault>"bsd"</amdefault>.
+<amdefault>"bsdtcp"</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>
</listitem>
</varlistentry>
+
<!-- bumping parameters yanked from the global section above -->
<varlistentry>
<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
</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>
compress server fast
}
define dumptype "bsd-auth" {
- auth bsd
+ auth "bsd"
+}
+define dumptype "bsdtcp-auth" {
+ auth "bsdtcp"
}
define dumptype "no-record" {
record no
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
</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
<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>
--- /dev/null
+<?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>
+
<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>
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 — see <manref name="amanda-taperscan" vol="7" />).</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>
<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>
</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.
<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>
</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>
<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 < /dev/null</programlisting>
+<programlisting>amservice hostname bsdtcp noop < /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>
</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.
<!-- 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>
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>
<!-- ==== -->
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
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>
ndmos.c \
ndmos_common.c
-libndmlib_la_LDFLAGS = -release $(VERSION)
+libndmlib_la_LDFLAGS = -release $(VERSION) $(AS_NEEDED_FLAGS)
libndmlib_la_SOURCES = \
$(libndmjll) \
$(libndmjlp) \
$(libndmjla) \
$(libndmjlr)
-libndmjob_la_LDFLAGS = -release $(VERSION)
+libndmjob_la_LDFLAGS = -release $(VERSION) $(AS_NEEDED_FLAGS)
libndmjob_la_LIBADD = libndmlib.la
##
$(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 \
AR = @AR@
ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
ASSERTIONS = @ASSERTIONS@
+AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
MAILER = @MAILER@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
+MOUNT = @MOUNT@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
STDDEF_H = @STDDEF_H@
STDINT_H = @STDINT_H@
STRIP = @STRIP@
+SUNTAR = @SUNTAR@
SVN = @SVN@
SWIG = @SWIG@
SWIG_LIB = @SWIG_LIB@
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@
ndmos.c \
ndmos_common.c
-libndmlib_la_LDFLAGS = -release $(VERSION)
+libndmlib_la_LDFLAGS = -release $(VERSION) $(AS_NEEDED_FLAGS)
libndmlib_la_SOURCES = \
$(libndmjll) \
$(libndmjlp) \
$(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 \
nb = count;
- rc = read (ta->tape_fd, buf, nb);
+ rc = full_read (ta->tape_fd, buf, nb);
if (rc < 0) {
return NDMP9_IO_ERR;
}
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;
}
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 */
}
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];
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)
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
*/
#include "amanda.h"
+#include "sockaddr-util.h"
#include "ndmpconnobj.h"
/*
*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();
/* 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]);
}
$(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 \
AR = @AR@
ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
ASSERTIONS = @ASSERTIONS@
+AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
MAILER = @MAILER@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
+MOUNT = @MOUNT@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
STDDEF_H = @STDDEF_H@
STDINT_H = @STDINT_H@
STRIP = @STRIP@
+SUNTAR = @SUNTAR@
SVN = @SVN@
SWIG = @SWIG@
SWIG_LIB = @SWIG_LIB@
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@
$(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 \
AR = @AR@
ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
ASSERTIONS = @ASSERTIONS@
+AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
MAILER = @MAILER@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
+MOUNT = @MOUNT@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
STDDEF_H = @STDDEF_H@
STDINT_H = @STDINT_H@
STRIP = @STRIP@
+SUNTAR = @SUNTAR@
SVN = @SVN@
SWIG = @SWIG@
SWIG_LIB = @SWIG_LIB@
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@
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
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
.
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) \
$(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 \
$(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 \
# 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
# 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} \
%{AMLIBEXECDIR}/dumper
%{AMLIBEXECDIR}/planner
%{SBINDIR}/amcheck
+%{SBINDIR}/amservice
%defattr(0750,%{amanda_user},%{amanda_group},0750)
%{LOGDIR}
%{SYSCONFDIR}/amanda
}
- 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;
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);
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;
}
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;
# 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
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.
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
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:
=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>
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
=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
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
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) >>.
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
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) &&
# 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
# 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'");
}
}
+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 {
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
# 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"));
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;
}
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 {
# 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) = @_;
}
}
+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 );
'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
return bless (\%info, $class);
}
+# do nothing in quit
+sub quit {}
+
# types
sub fatal { $_[0]->{'type'} eq 'fatal'; }
sub failed { $_[0]->{'type'} eq 'failed'; }
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;
}
}
+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 {
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 = {};
--- /dev/null
+# 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);
+}
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;
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
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 = @_;
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;
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 {
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;
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 };
});
}
+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 = @_;
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'");
}
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 );
$self->{'device'} = $device;
$self->{'this_slot'} = $slot;
+ $self->{'chg'}->{'reservation'}->{$slot} += 1;
return $self;
}
# 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};
$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);
+}
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 ]);
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) = @_;
}
# 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,
$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,
$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,
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");
}
#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)
return 1;
case CONFTYPE_BOOLEAN: /* all same as INT.. */
+ case CONFTYPE_NO_YES_ALL:
case CONFTYPE_COMPRESS:
case CONFTYPE_ENCRYPT:
case CONFTYPE_STRATEGY:
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));
}
}
+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;
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};
&_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,
};
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}};
_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,
};
{"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},
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)));
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)));
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)));
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)));
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)));
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)));
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)));
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)));
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)));
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)));
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)));
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)));
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)));
*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;
*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;
*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;
*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;
*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;
*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;
*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;
*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;
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"}};
=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
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"}};
=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
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"}};
=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
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"}};
=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
=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);
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);
$_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);
$_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);
$_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);
$_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);
$_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);
#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);
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 = (
#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)\
APPLY(CNF_CHANGERFILE)\
APPLY(CNF_LABELSTR)\
APPLY(CNF_AUTOLABEL)\
+APPLY(CNF_META_AUTOLABEL)\
APPLY(CNF_TAPELIST)\
APPLY(CNF_DISKFILE)\
APPLY(CNF_INFOFILE)\
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);
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);
#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);
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);
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
*/
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);
*/
/* 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
* 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) {
return 1;
case CONFTYPE_BOOLEAN: /* all same as INT.. */
+ case CONFTYPE_NO_YES_ALL:
case CONFTYPE_COMPRESS:
case CONFTYPE_ENCRYPT:
case CONFTYPE_STRATEGY:
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));
}
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
$MAILER = "@MAILER@";
$MT = "@MT@";
$MTX = "@MTX@";
+$MOUNT = "@MOUNT@";
+$UMOUNT = "@UMOUNT@";
$LPR = "@LPR@";
$LPRFLAG = "@LPRFLAG@";
$PS = "@PS@";
$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@";
(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
# 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'}
};
}
);
# 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'};
}
# 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') {
$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;
}
#include "fileheader.h"
#include "glib-util.h"
#include "simpleprng.h"
+#include "amanda.h"
+#include "sockaddr-util.h"
}
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))
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++;
}
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");
}
- 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);
#include "fileheader.h"
#include "glib-util.h"
#include "simpleprng.h"
+#include "amanda.h"
+#include "sockaddr-util.h"
%}
%init %{
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))
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};
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)));
*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 = ();
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
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
/* -------- 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)
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
}
+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,
};
{"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}
};
/* -----------------------------------------------------------------------------
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);
}
}
+############# 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;
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
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
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;
+
+++ /dev/null
-# 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;
+++ /dev/null
-# 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;
--- /dev/null
+# 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;
--- /dev/null
+# 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;
--- /dev/null
+# 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;
--- /dev/null
+# 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;
--- /dev/null
+# 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;
}
+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 ;
{"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},
*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;
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);
}
}
int partnum;
int totalparts;
double sec;
+ off_t bytes;
off_t kb;
off_t orig_kb;
%mutable;
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);
}
}
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
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;
$$cb_ref = sub {
%steps = ();
$current_steps = undef;
+ $finalize->() if defined($finalize);
goto $orig_cb;
};
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
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;
$$cb_ref = sub {
%steps = ();
$current_steps = undef;
+ $finalize->() if defined($finalize);
goto $orig_cb;
};
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 {
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
# 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",
# later..
$reservation->release(finished_cb => $start_next_volume);
+ # later..
+ $scan->quit(); # also quit the changer
+
=head1 OVERVIEW
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
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
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 = @_;
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
}
# 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};
}
}
- 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'});
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;
$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 {
$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);
};
}
$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;
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};
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};
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};
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);
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 =~ /\]$/) {
--- /dev/null
+# 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;
$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,
no strict;
$GOOD = 0;
$ERROR = 1;
+$FAILURE = 2;
use strict;
use warnings;
} 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";
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();
}
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;
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,
};
}
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();
}
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;
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,
};
}
-#! @PERL@
# Copyright (c) 2009, 2010 Zmanda Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify it
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 );
sub new {
my $class = shift;
+ my %params = @_;
my $self = bless {
# filled in at start
proto => undef,
+ tapelist => $params{'tapelist'},
worker => {},
}, $class;
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,
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 {
};
step done => sub {
+ $self->{'taperscan'}->quit() if defined $self->{'taperscan'};
if (@errors) {
$params{'finished_cb'}->(join("; ", @errors));
} else {
-#! @PERL@
# Copyright (c) 2009, 2010 Zmanda Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify it
};
$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
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
(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
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.
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.
use warnings;
use Amanda::Config qw( :getconf );
use Amanda::Tapelist;
+use Amanda::Debug;
sub new {
my $class = shift;
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';
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 {
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;
--- /dev/null
+# 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;
--- /dev/null
+# 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;
sub _user_msg {
my $self = shift;
my %params = @_;
+
$self->{'user_msg_fn'}->(%params);
}
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;
does_not_match_labelstr => 1,
labelstr => $labelstr,
slot => $slot,
+ label => $label,
res => $res);
return 0;
}
$self->_user_msg(slot_result => 1,
not_in_tapelist => 1,
slot => $slot,
+ label => $label,
res => $res);
return 0;
}
$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);
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;
}
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);
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
# 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);
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,
the dump should be split:
$xdest = $scribe->get_xfer_dest(
+ allow_split => $allow_split,
max_memory => $max_memory,
# .. splitting parameters
);
=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
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 => ..,
# information for the current dumpfile
dump_header => undef,
retry_part_on_peom => undef,
+ allow_split => undef,
xfer => undef,
xdt => undef,
xdt_ready => undef,
# 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
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) {
$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)"));
}
# 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
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;
}
# 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);
$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'};
# 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
# 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 {
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
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");
# 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'}) {
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
}
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
$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;
-#! @PERL@
# Copyright (c) 2009, 2010 Zmanda Inc. All Rights Reserved.
#
# This program is free software; you can redistribute it and/or modify it
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 );
# 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'};
$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
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
}
+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 ;
}
+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 ;
{"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},
}
*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 {
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:
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();
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:
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();
}
int lock();
+ int lock_wr();
+ int lock_rd();
int unlock();
+ int locked();
%typemap(in) (const char *data, size_t len) {
$1 = SvPV($input, $2);
#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)
#include "glib-util.h"
#include "amxfer.h"
+#include "amanda.h"
+#include "sockaddr-util.h"
SWIGINTERNINLINE SV *
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);
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++;
}
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");
}
- 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);
{
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;
{
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);
}
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();
}
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++;
}
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");
}
- 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);
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};
&_swigt__p_char,
&_swigt__p_double,
&_swigt__p_float,
+ &_swigt__p_gint64,
&_swigt__p_gsize,
&_swigt__p_guint32,
&_swigt__p_guint64,
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}};
_swigc__p_char,
_swigc__p_double,
_swigc__p_float,
+ _swigc__p_gint64,
_swigc__p_gsize,
_swigc__p_guint32,
_swigc__p_guint64,
{"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},
*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;
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
=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
=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
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) = @_;
};
$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 {
Amanda::Xfer::xfer_filter_process(@_);
}
+*get_stderr_fd = *Amanda::Xfer::get_err_fd;
package Amanda::Xfer::Dest::Fd;
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
=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
=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
%{
#include "glib-util.h"
#include "amxfer.h"
+#include "amanda.h"
+#include "sockaddr-util.h"
%}
/* The SWIGging of the transfer architecture.
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 */
* 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) = @_;
};
$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);
}
%}
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 */
%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(
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)
/* ---- */
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
# 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 \
# 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
@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
$(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 \
"$(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)"
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 \
AR = @AR@
ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
ASSERTIONS = @ASSERTIONS@
+AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
MAILER = @MAILER@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
+MOUNT = @MOUNT@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
STDDEF_H = @STDDEF_H@
STDINT_H = @STDINT_H@
STRIP = @STRIP@
+SUNTAR = @SUNTAR@
SVN = @SVN@
SWIG = @SWIG@
SWIG_LIB = @SWIG_LIB@
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@
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 \
# 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
$(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 \
# 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
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)"
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)
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 \
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 \
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 \
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 \
$(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 \
AR = @AR@
ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
ASSERTIONS = @ASSERTIONS@
+AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
MAILER = @MAILER@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
+MOUNT = @MOUNT@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
STDDEF_H = @STDDEF_H@
STDINT_H = @STDINT_H@
STRIP = @STRIP@
+SUNTAR = @SUNTAR@
SVN = @SVN@
SWIG = @SWIG@
SWIG_LIB = @SWIG_LIB@
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@
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++;
}
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);
}
}
$(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 \
AR = @AR@
ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
ASSERTIONS = @ASSERTIONS@
+AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
MAILER = @MAILER@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
+MOUNT = @MOUNT@
MSGFMT = msgfmt
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = msgmerge
STDDEF_H = @STDDEF_H@
STDINT_H = @STDINT_H@
STRIP = @STRIP@
+SUNTAR = @SUNTAR@
SVN = @SVN@
SWIG = @SWIG@
SWIG_LIB = @SWIG_LIB@
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@
$(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 \
AR = @AR@
ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
ASSERTIONS = @ASSERTIONS@
+AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
MAILER = @MAILER@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
+MOUNT = @MOUNT@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
STDDEF_H = @STDDEF_H@
STDINT_H = @STDINT_H@
STRIP = @STRIP@
+SUNTAR = @SUNTAR@
SVN = @SVN@
SWIG = @SWIG@
SWIG_LIB = @SWIG_LIB@
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@
#include "event.h"
#include "client_util.h"
#include "security.h"
+#include "pipespawn.h"
typedef struct EXTRACT_LIST_ITEM {
char *path;
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;
/*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 */
-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
sbin_PROGRAMS = amadmin amcheck \
- amflush \
- amservice
+ amflush
amlibexec_PROGRAMS = amindexd amtrmidx \
amtrmlog driver dumper \
amlibexec_SCRIPTS_PERL = \
amlogroll \
+ amdumpd \
taper \
amcheck-device
INSTALLPERMS_exec = \
dest=$(sbindir) chown=root:setuid chmod=04750 \
- amcheck amservice \
+ amcheck \
dest=$(amlibexecdir) \
dumper planner
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
$(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)
$(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 \
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)
--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
AR = @AR@
ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
ASSERTIONS = @ASSERTIONS@
+AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
MAILER = @MAILER@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
+MOUNT = @MOUNT@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
STDDEF_H = @STDDEF_H@
STDINT_H = @STDINT_H@
STRIP = @STRIP@
+SUNTAR = @SUNTAR@
SVN = @SVN@
SWIG = @SWIG@
SWIG_LIB = @SWIG_LIB@
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@
-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 \
amlibexec_SCRIPTS = $(amlibexec_SCRIPTS_PERL) $(amlibexec_SCRIPTS_SHELL)
INSTALLPERMS_exec = \
dest=$(sbindir) chown=root:setuid chmod=04750 \
- amcheck amservice \
+ amcheck \
dest=$(amlibexecdir) \
dumper planner
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
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)
@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@
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";
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);
}
}
{
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);
(intmax_t)info.history[l].date);
}
g_printf("//\n");
+ amfree(qhost);
+ amfree(qdisk);
}
/* ----------------------------------------------- */
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);
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);
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) {
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);
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
(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()) {
}
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));
}
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);
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);
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;
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);
}
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."),
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 */
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;
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 {
chomp $line;
$buffer = "";
$self->abort();
- return $params{'finished_cb'}->(undef, $line);
+ return $params{'request_cb'}->(undef, $line);
}
}
};
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 {
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
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");
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);
# 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
# 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(
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) {
$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(); });
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;
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]);
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);
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");
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");
# bail out
do_amcleanup();
+my $crtl_c = 0;
+$SIG{INT} = \&interrupt;
+
+sub interrupt {
+ $crtl_c = 1;
+}
+
# start up the log file
start_logfiles();
# 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");
--- /dev/null
+#! @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);
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;
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 {
chomp $line;
$buffer = "";
$self->abort();
- return $params{'finished_cb'}->(undef, $line);
+ return $params{'request_cb'}->(undef, $line);
}
}
};
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;
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) {
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(
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);
# 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
push @filters,
Amanda::Xfer::Filter::Process->new(
[ $Amanda::Constants::COMPRESS_PATH,
- $compress_opt ], 0, 0);
+ $compress_opt ], 0);
# adjust the header
$hdr->{'compressed'} = 1;
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'});
return failure($err, $finished_cb) if $err;
- $finished_cb->();
+#do all filter are done reading stderr
+ $fetch_done = 1;
+ if (!%all_filter) {
+ $finished_cb->();
+ }
};
}
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;
my $buffer = "";
my $steps = define_steps
- cb_ref => \$params{'finished_cb'};
+ cb_ref => \$params{'request_cb'};
step send_message => sub {
if ($params{'err'}) {
# 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'}->();
};
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'});
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);
}
};
};
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 );
$self->{'my_features'} = Amanda::Feature::Set->mine();
$self->{'their_features'} = Amanda::Feature::Set->old();
+ $self->{'all_filter'} = {};
$self->setup_streams();
}
$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
$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;
}
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)) {
}
# 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(@_); });
}
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 ];
}
}
+ # 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
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();
}
}
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;
}
}
+ /* 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;
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);
}
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();
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);
}
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);
}
};
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";
}
}
+ $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);
$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;
# 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();
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;
}
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 {
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
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);
}
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;
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);
# 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
@filters = (
Amanda::Xfer::Filter::Process->new(
[ $Amanda::Constants::COMPRESS_PATH,
- $compress_opt ], 0, 0),
+ $compress_opt ], 0),
);
# adjust the header
$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;
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'}->();
}
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);
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;
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 {
$resv->release(finished_cb => sub {
my ($err) = @_;
+
+ $chg->quit();
die $err if $err;
$scrub_db->();
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;
}
}
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");
}
}
}
+++ /dev/null
-/*
- * 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");
-}
$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;
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
$chg->reset(finished_cb => sub {
my ($err) = @_;
+ $chg->quit();
return failure($err, $finished_cb) if $err;
print STDERR "changer is reset\n";
$chg->eject(@drive_args,
finished_cb => sub {
my ($err) = @_;
+ $chg->quit();
return failure($err, $finished_cb) if $err;
print STDERR "drive ejected\n";
$chg->clean(@drive_args,
finished_cb => sub {
my ($err) = @_;
+ $chg->quit();
return failure($err, $finished_cb) if $err;
print STDERR "drive cleaned\n";
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'});
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 {
}
};
- 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'});
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->();
}
} 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) {
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);
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,
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') {
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 {
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 {
}
};
- $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"));
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 {
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'};
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,
return failure($err, $finished_cb) if $err;
print STDERR "update complete\n";
+ $chg->quit();
$finished_cb->();
});
});
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;
}
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;
dbprintf(_("could not open index directory %s\n"), qindexdir);
amfree(indexdir);
amfree(qindexdir);
+ g_slist_free(matching_dp);
continue;
}
name_length = 100;
amfree(datestamp);
amfree(names[i]);
}
+ g_slist_free(matching_dp);
amfree(names);
amfree(indexdir);
amfree(qindexdir);
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;
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 {
chomp $line;
$buffer = "";
$self->abort();
- return $params{'finished_cb'}->(undef, $line);
+ return $params{'request_cb'}->(undef, $line);
}
}
};
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');
$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'},
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'});
# 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;
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'}) {
$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 {
# 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;
#include "util.h"
#include "holding.h"
#include "timestamp.h"
+#include "sockaddr-util.h"
#ifndef SEEK_SET
#define SEEK_SET 0
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;
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) {
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);
return config_errors(NULL);
}
+am_host_t *
+get_hostlist(void)
+{
+ return hostlist;
+}
+
am_host_t *
lookup_host(
const char *hostname)
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
{
char *plugin;
char *b64plugin;
+ char *client_name;
xml_app_t xml_app;
proplist_t proplist;
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);
{
char *plugin;
char *b64plugin;
+ char *client_name;
char *xml_scr;
char *xml_scr1;
char *str = "";
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 = ",";
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);
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;
}
}
}
int todo;
char *application;
identlist_t pp_scriptlist;
+ host_limit_t *dump_limit;
void *up; /* generic user pointer */
} disk_t;
* 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);
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,
find_result_t *holding_files;
disklist_t holding_disklist = { NULL, NULL };
int no_taper = FALSE;
+ int from_client = FALSE;
/*
* Configure program for internationalization:
}
}
+ 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);
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);
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;
} 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);
{
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;
}
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,
}
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,
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);
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.
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;
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;
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;
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> */
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 */
* 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."));
}
} while(areads_dataready(taper_fd));
+ start_some_dumps(&runq);
startaflush();
}
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) {
}
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;
}
}
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();
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++) {
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;
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.
//
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)) {
!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
) {
(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;
}
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;
" ", disk2serial(dp),
"\n", NULL);
} else {
- cmdline = vstralloc(cmdstr[cmd], "\n");
+ cmdline = vstralloc(cmdstr[cmd], "\n", NULL);
}
break;
default:
/* 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);
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;
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);
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;
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;
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);
return 0;
}
*label = s - 1;
- skip_non_whitespace(s, ch);
+ skip_quoted_string(s, ch);
s[-1] = '\0';
+ *label = unquote_string(*label);
return 1;
}
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*/
logfile, curstr);
} else if(strcmp(ck_datestamp, datestamp) == 0
&& strcmp(ck_label, label) == 0) {
+ amfree(ck_label);
afclose(logf);
return TRUE;
}
+ amfree(ck_label);
}
}
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);
if (strcmp(datestamp, ck_datestamp) != 0) {
g_printf(_("Log file %s stamped %s, expecting %s!\n"),
logfile, ck_datestamp, datestamp);
+ amfree(ck_label);
break;
}
}
found_something = TRUE;
}
amfree(current_label);
- current_label = g_strdup(ck_label);
+ current_label = ck_label;
if (datestamp == NULL) {
datestamp = g_strdup(ck_datestamp);
}
}
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') {
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);
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;
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;
} else {
sec = 0;
kb = 0;
+ bytes = 0;
orig_kb = 0;
*rest_undo = ' ';
}
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;
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 {
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");
}
}
}
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) {
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;
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;
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;
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;
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;
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)
int planner_setuid;
int exit_status = EXIT_SUCCESS;
gboolean no_taper = FALSE;
+ gboolean from_client = FALSE;
/*
* Configure program for internationalization:
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
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);
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) {
}
/* 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;
}
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.
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);
}
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) {
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;
}
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);
}
}
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"),
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 */
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;
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;
void
-run_server_scripts(
+run_server_dle_scripts(
execute_on_t execute_on,
char *config,
disk_t *dp,
}
}
+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)
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);
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");
s[-1] = '\0';
skip_whitespace(s, ch);
}
+
if (strncmp_const(s - 1, "BARCODE:") == 0) {
s1 = s - 1 + 8;
skip_non_whitespace(s, ch);
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 '#' */
int reuse;
char *label;
char *barcode;
+ char *meta;
char *comment;
} tape_t;
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;
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();
-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
xfer.c \
xmsg.c
-libamxfer_la_LDFLAGS = -release $(VERSION)
+libamxfer_la_LDFLAGS = -release $(VERSION) $(AS_NEEDED_FLAGS)
libamxfer_la_LIBADD = \
../common-src/libamanda.la
$(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 \
AR = @AR@
ASM_SYMBOL_PREFIX = @ASM_SYMBOL_PREFIX@
ASSERTIONS = @ASSERTIONS@
+AS_NEEDED_FLAGS = @AS_NEEDED_FLAGS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
MAILER = @MAILER@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
+MOUNT = @MOUNT@
MSGFMT = @MSGFMT@
MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
STDDEF_H = @STDDEF_H@
STDINT_H = @STDINT_H@
STRIP = @STRIP@
+SUNTAR = @SUNTAR@
SVN = @SVN@
SWIG = @SWIG@
SWIG_LIB = @SWIG_LIB@
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@
-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)
xfer.c \
xmsg.c
-libamxfer_la_LDFLAGS = -release $(VERSION)
+libamxfer_la_LDFLAGS = -release $(VERSION) $(AS_NEEDED_FLAGS)
libamxfer_la_LIBADD = \
../common-src/libamanda.la
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;
{
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;
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;
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;
{
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;
{
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";
{
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;
#include "directtcp.h"
#include "util.h"
#include "sockaddr-util.h"
+#include "debug.h"
/*
* Instance definition
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;
}
/* 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));
}
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 */
}
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 */
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);
}
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);
}
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);
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
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);
}
return NULL;
}
+ buf = g_malloc(GLUE_BUFFER_SIZE);
+
/* read from upstream */
len = full_read(fd, buf, GLUE_BUFFER_SIZE);
if (len < GLUE_BUFFER_SIZE) {
/* 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) {
}
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;
gchar **argv;
gboolean need_root;
- gboolean log_stderr;
+ int pipe_err[2];
pid_t child_pid;
GSource *child_watch;
typedef struct {
XferElementClass __parent__;
-} XferFilterProcessClass;
+ int (*get_err_fd)(XferFilterProcess *elt);
+} XferFilterProcessClass;
/*
* Implementation
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)
* 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);
/* 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);
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;
klass->perl_class = "Amanda::Xfer::Filter::Process";
klass->mech_pairs = mech_pairs;
+ selfc->get_err_fd = get_err_fd_impl;
goc->finalize = finalize_impl;
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);
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;
+}
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 */
{
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;
#include "amanda.h"
#include "amxfer.h"
+#include "sockaddr-util.h"
/*
* Class declaration
{
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;
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;
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;
*/
#include "amanda.h"
+#include "sockaddr-util.h"
#include "amxfer.h"
/*
{
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;
{
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";
/*
* 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
* 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,
{
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;
}
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;
}
{
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;
{
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;
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)
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;
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)
*/
void
-xfer_element_drain_by_pulling(
+xfer_element_drain_buffers(
XferElement *upstream)
{
gpointer buf;
}
void
-xfer_element_drain_by_reading(
+xfer_element_drain_fd(
int fd)
{
size_t len;
#include <glib.h>
#include <glib-object.h>
#include "xfer.h"
+#include "amanda.h"
#include "directtcp.h"
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;
/* cache for repr() */
char *repr;
+
+ /* maximum size to transfer */
+ gint64 size;
} XferElement;
/*
*/
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
* 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
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);
*
* @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.
*
* @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.
{
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;
{
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;
{
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;
{
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;
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++) {
{
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;
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;
{
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;
{
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;
{
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;
{
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;
{
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;
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;
{
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;
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));
}
{
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;
elements[i] = NULL;
}
- xfer_start(xfer);
+ xfer_start(xfer, 0, 0);
g_main_loop_run(default_main_loop());
g_assert(xfer->status == XFER_DONE);
elements[i] = NULL;
}
- xfer_start(xfer);
+ xfer_start(xfer, 0, 0);
g_main_loop_run(default_main_loop());
g_assert(xfer->status == XFER_DONE);
elements[i] = NULL;
}
- xfer_start(xfer);
+ xfer_start(xfer, 0, 0);
g_main_loop_run(default_main_loop());
g_assert(xfer->status == XFER_DONE);
void
xfer_start(
- Xfer *xfer)
+ Xfer *xfer,
+ gint64 offset G_GNUC_UNUSED,
+ gint64 size)
{
unsigned int len;
unsigned int i;
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
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);
* 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