Imported Upstream version 2.5.2p1 upstream/2.5.2p1
authorBdale Garbee <bdale@gag.com>
Tue, 20 May 2008 04:47:53 +0000 (22:47 -0600)
committerBdale Garbee <bdale@gag.com>
Tue, 20 May 2008 04:47:53 +0000 (22:47 -0600)
387 files changed:
COPYRIGHT-APACHE [deleted file]
COPYRIGHT-REGEX [deleted file]
ChangeLog
Makefile.am
Makefile.in
NEWS
ReleaseNotes
acinclude.m4
amandad-src/Makefile.am
amandad-src/Makefile.in
amandad-src/amandad.c
amandad-src/amandad_util.c
amplot/Makefile.in
amplot/amplot.awk
amplot/amplot.sh.in
autogen
changer-src/Makefile.am
changer-src/Makefile.in
changer-src/chg-chio.pl.in
changer-src/chg-disk.sh.in
changer-src/chg-lib.sh.in [new file with mode: 0644]
changer-src/chg-manual.sh.in
changer-src/chg-multi.sh.in
changer-src/chg-scsi.c
changer-src/chg-zd-mtx.sh.in
changer-src/scsi-changer-driver.c
changer-src/scsi-linux.c
changer-src/scsi-solaris.c
client-src/Makefile.am
client-src/Makefile.in
client-src/amandates.h
client-src/calcsize.c
client-src/client_util.c
client-src/client_util.h
client-src/clientconf.c [deleted file]
client-src/clientconf.h [deleted file]
client-src/getfsent.c
client-src/killpgrp.c
client-src/rundump.c
client-src/runtar.c
client-src/selfcheck.c
client-src/sendbackup-dump.c
client-src/sendbackup-gnutar.c
client-src/sendbackup.c
client-src/sendbackup.h
client-src/sendsize.c
common-src/Makefile.am
common-src/Makefile.in
common-src/alloc.c
common-src/alloca.c [deleted file]
common-src/amanda.h
common-src/amfeatures.c
common-src/amfeatures.h
common-src/amflock.c
common-src/amregex.h [deleted file]
common-src/bsd-security.c
common-src/bsdtcp-security.c
common-src/bsdudp-security.c
common-src/clock.c
common-src/conffile.c [new file with mode: 0644]
common-src/conffile.h [new file with mode: 0644]
common-src/debug.c
common-src/dgram.c
common-src/dgram.h
common-src/event.c
common-src/file.c
common-src/fileheader.c
common-src/fileheader.h
common-src/getcwd.c [deleted file]
common-src/krb4-security.c
common-src/krb5-security.c
common-src/match.c
common-src/memmove.c [deleted file]
common-src/mktime.c [deleted file]
common-src/packet.c
common-src/packet.h
common-src/pipespawn.c
common-src/protocol.c
common-src/regcomp.c [deleted file]
common-src/regerror.c [deleted file]
common-src/regexec.c [deleted file]
common-src/regfree.c [deleted file]
common-src/rsh-security.c
common-src/security-util.c
common-src/security-util.h
common-src/security.c
common-src/security.h
common-src/snprintf.c [deleted file]
common-src/ssh-security.c
common-src/statfs.c
common-src/strcasecmp.c [deleted file]
common-src/stream.c
common-src/strerror.c [deleted file]
common-src/strftime.c [deleted file]
common-src/strncasecmp.c [deleted file]
common-src/strstr.c [deleted file]
common-src/tapelist.c
common-src/util.c
common-src/util.h
common-src/version.c
common-src/versuff.c
common-src/waitpid.c [deleted file]
common-src/writev.c [deleted file]
config/Makefile.am
config/Makefile.in
config/acinclude.m4i
config/config.h.in
config/config.rpath [new file with mode: 0644]
config/gnulib.m4i [new file with mode: 0644]
config/gnulib/absolute-header.m4 [new file with mode: 0644]
config/gnulib/alloca.m4 [new file with mode: 0644]
config/gnulib/arpa_inet_h.m4 [new file with mode: 0644]
config/gnulib/eoverflow.m4 [new file with mode: 0644]
config/gnulib/extensions.m4 [new file with mode: 0644]
config/gnulib/getaddrinfo.m4 [new file with mode: 0644]
config/gnulib/gnulib-cache.m4 [new file with mode: 0644]
config/gnulib/gnulib-common.m4 [new file with mode: 0644]
config/gnulib/gnulib-comp.m4 [new file with mode: 0644]
config/gnulib/gnulib-tool.m4 [new file with mode: 0644]
config/gnulib/inet_ntop.m4 [new file with mode: 0644]
config/gnulib/intmax_t.m4 [new file with mode: 0644]
config/gnulib/inttypes_h.m4 [new file with mode: 0644]
config/gnulib/lib-ld.m4 [new file with mode: 0644]
config/gnulib/lib-link.m4 [new file with mode: 0644]
config/gnulib/lib-prefix.m4 [new file with mode: 0644]
config/gnulib/lock.m4 [new file with mode: 0644]
config/gnulib/longdouble.m4 [new file with mode: 0644]
config/gnulib/longlong.m4 [new file with mode: 0644]
config/gnulib/netinet_in_h.m4 [new file with mode: 0644]
config/gnulib/onceonly_2_57.m4 [new file with mode: 0644]
config/gnulib/size_max.m4 [new file with mode: 0644]
config/gnulib/snprintf.m4 [new file with mode: 0644]
config/gnulib/socklen.m4 [new file with mode: 0644]
config/gnulib/sockpfaf.m4 [new file with mode: 0644]
config/gnulib/stdbool.m4 [new file with mode: 0644]
config/gnulib/stdint_h.m4 [new file with mode: 0644]
config/gnulib/strdup.m4 [new file with mode: 0644]
config/gnulib/string_h.m4 [new file with mode: 0644]
config/gnulib/sys_socket_h.m4 [new file with mode: 0644]
config/gnulib/vasnprintf.m4 [new file with mode: 0644]
config/gnulib/visibility.m4 [new file with mode: 0644]
config/gnulib/wchar_t.m4 [new file with mode: 0644]
config/gnulib/wint_t.m4 [new file with mode: 0644]
config/gnulib/xsize.m4 [new file with mode: 0644]
configure
configure.in
docs/Makefile.am
docs/Makefile.in
docs/amadmin.8.txt
docs/amanda-client.conf.5.txt
docs/amanda.8.txt
docs/amanda.conf.5.txt
docs/amcheck.8.txt
docs/amdump.8.txt
docs/amfetchdump.8.txt
docs/amflush.8.txt
docs/amgetconf.8.txt
docs/amlabel.8.txt
docs/amrecover.8.txt
docs/amreport.8.txt
docs/amrestore.8.txt
docs/amtape.8.txt
docs/chgscsi.txt
docs/dumperapi.txt
docs/eventapi.txt
docs/exclude.txt
docs/faq.txt
docs/howto-afs.txt
docs/howto-auth.txt
docs/howto-cygwin.txt
docs/howto-filedriver.txt
docs/howto-gpg.txt [deleted file]
docs/howto-wrapper.txt
docs/indexing.txt
docs/install.txt
docs/internals.txt
docs/ix01.txt
docs/kerberos.txt
docs/labelprinting.txt
docs/links.txt
docs/manpages.txt
docs/multitape.txt
docs/portusage.txt
docs/rait.txt
docs/restore.txt
docs/samba.txt
docs/security-api.txt
docs/security.txt
docs/strategy-api.txt
docs/systemnotes.txt
docs/tapechangers.txt
docs/tapetypes.txt
docs/topten.txt
docs/upgrade.txt
docs/using.txt
docs/vtape-api.txt
docs/whatwasnew.txt
docs/wishlist.txt
docs/y2k.txt
docs/zftape.txt
dumper-src/Makefile.am
dumper-src/Makefile.in
dumper-src/amgtar.pl.in [new file with mode: 0644]
dumper-src/generic-dumper.pl.in
dumper-src/gnutar.pl.in [deleted file]
example/Makefile.in
example/amanda-client.conf.in
example/amanda.conf.in
example/chg-mcutil.conf
example/chg-mcutil.conf.in
gnulib/Makefile.am [new file with mode: 0644]
gnulib/Makefile.in [new file with mode: 0644]
gnulib/alloca_.h [new file with mode: 0644]
gnulib/asnprintf.c [new file with mode: 0644]
gnulib/gai_strerror.c [new file with mode: 0644]
gnulib/getaddrinfo.c [new file with mode: 0644]
gnulib/getaddrinfo.h [new file with mode: 0644]
gnulib/gettext.h [new file with mode: 0644]
gnulib/inet_ntop.c [new file with mode: 0644]
gnulib/inet_ntop.h [new file with mode: 0644]
gnulib/lock.c [new file with mode: 0644]
gnulib/lock.h [new file with mode: 0644]
gnulib/printf-args.c [new file with mode: 0644]
gnulib/printf-args.h [new file with mode: 0644]
gnulib/printf-parse.c [new file with mode: 0644]
gnulib/printf-parse.h [new file with mode: 0644]
gnulib/regenerate/getaddrinfo-cygwin.patch [new file with mode: 0644]
gnulib/regenerate/no-error.patch [new file with mode: 0644]
gnulib/regenerate/regenerate [new file with mode: 0644]
gnulib/size_max.h [new file with mode: 0644]
gnulib/snprintf.c [new file with mode: 0644]
gnulib/snprintf.h [new file with mode: 0644]
gnulib/socket_.h [new file with mode: 0644]
gnulib/stdbool_.h [new file with mode: 0644]
gnulib/strdup.c [new file with mode: 0644]
gnulib/string_.h [new file with mode: 0644]
gnulib/vasnprintf.c [new file with mode: 0644]
gnulib/vasnprintf.h [new file with mode: 0644]
gnulib/xsize.h [new file with mode: 0644]
man/Makefile.am
man/Makefile.in
man/amadmin.8
man/amaespipe.8
man/amanda-client.conf.5
man/amanda.8
man/amanda.conf.5
man/amcheck.8
man/amcheckdb.8
man/amcleanup.8
man/amcrypt-ossl-asym.8
man/amcrypt-ossl.8
man/amcrypt.8
man/amdd.8
man/amdump.8
man/amfetchdump.8
man/amflush.8
man/amgetconf.8
man/amlabel.8
man/ammt.8
man/amoverview.8
man/amplot.8
man/amrecover.8
man/amreport.8
man/amrestore.8
man/amrmtape.8
man/amstatus.8
man/amtape.8
man/amtapetype.8
man/amtoc.8
man/amverify.8
man/amverifyrun.8
man/xml-source/amadmin.8.xml
man/xml-source/amanda-client.conf.5.xml
man/xml-source/amanda.8.xml
man/xml-source/amanda.conf.5.xml
man/xml-source/amcheck.8.xml
man/xml-source/amdump.8.xml
man/xml-source/amfetchdump.8.xml
man/xml-source/amflush.8.xml
man/xml-source/amgetconf.8.xml
man/xml-source/amlabel.8.xml
man/xml-source/amrecover.8.xml
man/xml-source/amreport.8.xml
man/xml-source/amrestore.8.xml
man/xml-source/amtape.8.xml
oldrecover-src/Makefile.am
oldrecover-src/Makefile.in
oldrecover-src/amrecover.c
oldrecover-src/amrecover.h
oldrecover-src/display_commands.c
oldrecover-src/extract_list.c
oldrecover-src/set_commands.c
oldrecover-src/uparse.c
oldrecover-src/uparse.h
oldrecover-src/uparse.y
recover-src/Makefile.am
recover-src/Makefile.in
recover-src/amrecover.c
recover-src/amrecover.h
recover-src/display_commands.c
recover-src/extract_list.c
recover-src/set_commands.c
recover-src/uparse.c
recover-src/uparse.h
recover-src/uparse.y
regex-src/COPYRIGHT [deleted file]
regex-src/Makefile [deleted file]
regex-src/README [deleted file]
regex-src/WHATSNEW [deleted file]
regex-src/cclass.h [deleted file]
regex-src/cname.h [deleted file]
regex-src/debug.c [deleted file]
regex-src/engine.c [deleted file]
regex-src/fake/limits.h [deleted file]
regex-src/fake/memmove.c [deleted file]
regex-src/fake/stdlib.h [deleted file]
regex-src/main.c [deleted file]
regex-src/mkh [deleted file]
regex-src/regcomp.c [deleted file]
regex-src/regerror.c [deleted file]
regex-src/regex.3 [deleted file]
regex-src/regex.7 [deleted file]
regex-src/regex2.h [deleted file]
regex-src/regexec.c [deleted file]
regex-src/regfree.c [deleted file]
regex-src/split.c [deleted file]
regex-src/tests [deleted file]
regex-src/utils.h [deleted file]
restore-src/Makefile.am
restore-src/Makefile.in
restore-src/amfetchdump.c
restore-src/amidxtaped.c
restore-src/amrestore.c
restore-src/restore.c
restore-src/restore.h
server-src/Makefile.am
server-src/Makefile.in
server-src/amadmin.c
server-src/amcheck.c
server-src/amcleanupdisk.c
server-src/amcrypt-ossl-asym.sh.in
server-src/amcrypt-ossl.sh.in
server-src/amflush.c
server-src/amindex.c
server-src/amindex.h
server-src/amindexd.c
server-src/amlabel.c
server-src/amlogroll.c
server-src/amoverview.pl.in
server-src/amstatus.pl.in
server-src/amtape.c
server-src/amtrmidx.c
server-src/amtrmlog.c
server-src/amverify.sh.in
server-src/changer.c
server-src/chunker.c
server-src/cmdline.c [new file with mode: 0644]
server-src/cmdline.h [new file with mode: 0644]
server-src/conffile.c [deleted file]
server-src/conffile.h [deleted file]
server-src/disk_history.c
server-src/disk_history.h
server-src/diskfile.c
server-src/diskfile.h
server-src/driver.c
server-src/driverio.c
server-src/driverio.h
server-src/dumper.c
server-src/find.c
server-src/getconf.c
server-src/holding.c
server-src/holding.h
server-src/infofile.c
server-src/logfile.c
server-src/planner.c
server-src/reporter.c
server-src/server_util.c
server-src/server_util.h
server-src/tapefile.c
server-src/taper.c
server-src/taperscan.c
tape-src/Makefile.am
tape-src/Makefile.in
tape-src/output-file.c
tape-src/output-tape.c
tape-src/tapeio.c
tape-src/tapetype.c

diff --git a/COPYRIGHT-APACHE b/COPYRIGHT-APACHE
deleted file mode 100644 (file)
index 998fb56..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-If your system does not have the snprintf function, then a version from
-the Apache distribution is used and has the following notice:
-
-/* ====================================================================
- * Copyright (c) 1995-1997 The Apache Group.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. All advertising materials mentioning features or use of this
- *    software must display the following acknowledgment:
- *    "This product includes software developed by the Apache Group
- *    for use in the Apache HTTP server project (http://www.apache.org/)."
- *
- * 4. The names "Apache Server" and "Apache Group" must not be used to
- *    endorse or promote products derived from this software without
- *    prior written permission.
- *
- * 5. Redistributions of any form whatsoever must retain the following
- *    acknowledgment:
- *    "This product includes software developed by the Apache Group
- *    for use in the Apache HTTP server project (http://www.apache.org/)."
- *
- * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY
- * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE APACHE GROUP OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
- * OF THE POSSIBILITY OF SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Group and was originally based
- * on public domain software written at the National Center for
- * Supercomputing Applications, University of Illinois, Urbana-Champaign.
- * For more information on the Apache Group and the Apache HTTP server
- * project, please see <http://www.apache.org/>.
- *
- * This code is based on, and used with the permission of, the
- * SIO stdio-replacement strx_* functions by Panos Tsirigotis
- * <panos@alumni.cs.colorado.edu> for xinetd.
- */
diff --git a/COPYRIGHT-REGEX b/COPYRIGHT-REGEX
deleted file mode 100644 (file)
index 33743d3..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-The regular expressions library used by Amanda was written by Henry
-Spencer.  The full library distribution is in the regex-src directory,
-as well as its copyright notice and license.
-
-A newer version of this library may be available in the URL
-ftp://ftp.zoo.toronto.edu/pub/regex.shar
-
-The one distributed with amanda since 2.4.0b4 is a slightly modified
-alpha3.6, released on September 30, 1997.  The differences between the
-released library and the one distributed with Amanda can be found in
-patches/regex-3.6alpha.patch
index e298b3c2bc1cacfac8b7ce886cf4a5602d2991f2..fbba979bcf8e7110cd49ef1200d6476b11d988f7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
+2007-06-06  Jean-Louis Martineau <martineau@zmanda.com>
+       * Amanda 2.5.2p1 released.
+
+2007-06-06  Jean-Louis Martineau <martineau@zmanda.com>
+       * restore-src/restore.c: accept all header with size >= DISK_BLOCK_BYTES
+
+2007-06-06  Jean-Louis Martineau <martineau@zmanda.com>
+       * NEWS: Change in 2.5.2p1.
+       * configure.in: AM_INIT_AUTOMAKE(amanda, 2.5.2p1).
+
+2007-06-06  Jean-Louis Martineau <martineau@zmanda.com>
+       * configure.in: Fix check backup is not from gnutar.
+
+2007-06-04  Jean-Louis Martineau <martineau@zmanda.com>
+       Original patch by franz Fischer
+       * tape-src/tapetype.c: close and open after a rewind.
+
+2007-06-04  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/krb5-security.c, common-src/bsdtcp-security.c,
+         common-src/security-util.c: Check return code of getnameinfo.
+
+2007-06-04  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amstatus.pl.in: Perl argument are '-Tw'.
+
+2007-06-04  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/holding.c: Forgotten ==0 in strcmp().
+
+2007-05-31  Jean-Louis Martineau <martineau@zmanda.com>
+       * configure.in: Check backup is not from gnutar.
+
+2007-05-31  Jean-Louis Martineau <martineau@zmanda.com>
+       * recover-src/set_commands.c (cd_dir): Validate regex.
+
+2007-05-30  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/krb5-security.c: Use keytab_name.
+       * server-src/holding.c: Remove unused date_matches variable.
+
+2007-05-30  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amstatus.pl.in: Set and use chunk_time.
+
+2007-05-30  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/util.c: Don't use -w flags for od execution.
+
+2007-05-29  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/planner.c: Don't report overwrite if no label.
+
+2007-05-29  Jean-Louis Martineau <martineau@zmanda.com>
+       * changer-src/chg-manual.sh.in: Don't reset the slot to 0 on eject.
+
+2007-05-25  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amstatus.pl.in: Put all flags in one arguments.
+
+2007-05-23  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/util.c: Fix missing NULL in vstralloc call.
+
+2007-05-23  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amstatus.pl.in: Use compressed size.
+
+2007-05-23  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/driver.c: Check dumper->down.
+       * server-src/dumper.c (sendbackup_response): Only call
+         security_close_connection if pkt != NULL.
+
+2007-05-23  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/find.c: Send ouput to stderr.
+
+2007-05-17  Jean-Louis Martineau <martineau@zmanda.com>
+       * amplot/amplot.sh.in: Remove function keyword.
+       * changer-src/chg-lib.sh.in: Remove function keyword.
+       * changer-src/chg-multi.sh.in: Remove function keyword.
+       * changer-src/chg-zd-mtx.sh.in: Remove function keyword.
+
+2007-05-16  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/dumper.c (read_datafd): Reset timeout after the write.
+
+2007-05-15  Jean-Louis Martineau <martineau@zmanda.com>
+       * client-src/sendsize.c: Set qlist before using it.
+
+2007-05-15  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amadmin.c, server-src/cmdline.c,
+         server-src/find.c: Call holding_get_files will NULL date_list.
+       * server-src/holding.c (holding_get_directories_per_disk): New
+         date_list param, scan only the date_list directories.
+       * server-src/holding.c (holding_get_directories): New
+         date_list param.
+       * server-src/holding.c (holding_get_files): New
+         date_list param.
+       * server-src/holding.c (holding_get_files_for_flush): Don't loop over
+         date.
+       * server-src/holding.h (holding_get_directories,
+         holding_get_files): New prototype.
+
+2007-05-14  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/bsd-security.c: Open an IPv4 and an IPv6 socket.
+       * common-src/bsdudp-security.c: Open an IPv4 and an IPv6 socket.
+
+2007-05-11  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amcrypt-ossl-asym.sh.in: Use CLIENT_LOGIN.
+       * server-src/amcrypt-ossl.sh.in: Use CLIENT_LOGIN.
+
+2007-05-10  Jean-Louis Martineau <martineau@zmanda.com>
+       * util.c (cmp_sockaddr): Fix compilation.
+
+2007-05-10  Jean-Louis Martineau <martineau@zmanda.com>
+       * util.c (cmp_sockaddr): un-map V4mapped address before comparison.
+       * common-src/security-util.c: add debugging.
+
+2007-05-08  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/diskfile.c: Fix double free.
+
+2007-05-07  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/alloc.c (debug_vstrallocf): Remove file and line.
+       * common-src/amanda.h (vstrallocf): Change define.
+
+2007-05-07  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/amanda.h: define sockaddr_storage and ss_family.
+       * common-src/amanda.h: define INET_ADDRSTRLEN.
+       * config/acinclude.m4i (AC_SOCKADDR_STORAGE): New macro.
+       * configure.in: AC_SOCKADDR_STORAGE.
+
+2007-05-07  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/amanda.h: Define AI_V4MAPPED and AI_ALL.
+
+2007-05-07  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/bsd-security.c, common-src/bsdtcp-security.c,
+         common-src/bsdudp-security.c, common-src/krb5-security.c,
+         common-src/stream.c, server-src/amcheck.c,
+         server-src/dumper.c: Retry getaddrinfo with ai_flags = AI_CANONNAME
+
+2007-05-07  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/stream.c: pass correct sockaddr size to bind()
+
+2007-05-07  Pieter Bowman <bowman@math.utah.edu>
+       * common-src/file.c: reverse the order of chown/chmod to correctly
+                            create temporary files.
+
+2007-05-03  Jean-Louis Martineau <martineau@zmanda.com>
+       * docs/*.txt: Update from xml-docs.
+
+2007-05-03  Jean-Louis Martineau <martineau@zmanda.com>
+       * man/xml-source/amrecover.8.xml: Fix space.
+
+2007-05-03  Jean-Louis Martineau <martineau@zmanda.com>
+       * Amanda 2.5.2 released.
+       * configure.in: AM_INIT_AUTOMAKE(amanda, 2.5.2).
+
+2007-05-02  Jean-Louis Martineau <martineau@zmanda.com>
+       * docs/*.txt, man/xml-source/*.xml: Change OVERWRITE bu OVERRIDE.
+       * man/xml-source/amadmin.8.xml: Add notees on no-reuse command.
+
+2007-05-02  Jean-Louis Martineau <martineau@zmanda.com>
+       * amandad-src/amandad.c: Improve 'invalid service' message.
+
+2007-05-01  Jean-Louis Martineau <martineau@zmanda.com>
+       * recover-src/extract_list.c: Report the error message.
+       * recover-src/extract_list.c: Don't call close_connection.
+       * common-src/security-util.c: (tcpm_close_connection): Check for rh->rc
+
+2007-04-27  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/security-util.c (tcp1_stream_client): Set rh->rc->driver.
+
+2007-04-27  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/bsd-security.c, common-src/bsdudp-security.c,
+         common-src/krb4-security.c: Fix ntohs for port number.
+       * common-src/dgram.c: Add socket number in comment.
+
+2007-04-27  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/holding.c server-src/holding.h server-src/find.c:
+         use holding module in find.c:search_holding_disk()
+
+2007-04-27  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amcheck.c: Fix infobad setting.
+
+2007-04-26  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amcheck.c: Set *bad on error.
+
+2007-04-26  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amflush.c: Quote L_DISK and FLUSH line.
+       * server-src/driver.c: Parse quoted FLUSH line.
+       * server-src/planner.c:  Quote L_DISK and FLUSH line.
+
+2007-04-25  Dustin J. Mitchell <dustin@zmanda.com>
+       * configure.in common-src/ssh-security.c: allow build-time configuration of SSH options
+
+2007-04-23  Paddy Sreenivasan <paddy@zmanda.com>
+       * changer-src/scsi-solaris.c common-src/protocol.c: changes to build on Solaris
+
+2007-04-20  Dustin J. Mitchell <dustin@zmanda.com>
+       * configure.in: remove unused AMANDA_C_VOLATILE
+       * config/acinclude.m4: remove unused AMANDA_C_VOLATILE
+
+2007-04-20  Dustin J. Mitchell <dustin@zmanda.com>
+       * autogen: silence unnecessary warnings about GNU make, return exit status
+
+2007-04-20  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/stream.c: retry socket creation if OS does not support IPv6
+         at runtime
+
+2007-04-20  Jean-Louis Martineau <martineau@zmanda.com>
+       * amplot/amplot.sh.in (test_awk,find_gnuplot): Imported from zmanda.
+       * amplot/amplot.awk: Fix some parsing.
+       * server-src/driver.c (free_kps): Return 0 instead of big value.
+
+2007-04-18  Jean-Louis Martineau <martineau@zmanda.com>
+       * oldrecover-src/Makefile.am, changer-src/Makefile.am,
+         client-src/Makefile.am, amandad-src/Makefile.am,
+         recover-src/Makefile.am, server-src/Makefile.am,
+         restore-src/Makefile.am: Link libgnu after libamanda.
+
+2007-04-18  Jean-Louis Martineau <martineau@zmanda.com>
+       * client-src/sendbackup.c: Improve tar argument in amanda header for
+                                  extraction.
+
+2007-04-18  Dustin J. Mitchell <dustin@zmanda.com>
+       * man/Makefile.am configure.in config/acinclude.m4i: add xsltproc- and docbook-
+         related autoconf macros, use them to ensure the environment is appropriate for
+         building manpages; manpage build is off by default.
+
+2007-04-17  Jean-Louis Martineau <martineau@zmanda.com>
+       * changer-src/chg-disk.sh.in: Send error message to stdout.
+
+2007-04-17  Dustin J. Mitchell <dustin@zmanda.com>
+       * changer-src/chg-zd-mtx.sh.in: fix more typos (thanks to
+         "Stefan G. Weichinger" <sgw@amanda.org>)
+
+2007-04-17  Jean-Louis Martineau <martineau@zmanda.com>
+       * restore-src/restore.c: Fix restoration of split and encrypted backup.
+
+2007-04-13  Dustin J. Mitchell <dustin@zmanda.com>
+       * changer-src/chg-zd-mtx.sh.in: fix typo in error message
+
+2007-04-13  Jean-Louis Martineau <martineau@zmanda.com>
+       * Amanda 2.5.2b1 released.
+       * configure.in: AM_INIT_AUTOMAKE(amanda, 2.5.2b1).
+
+2007-04-13  Jean-Louis Martineau <martineau@zmanda.com>
+       * client-src/sendbackup.c (first_num): Removed function.
+       * client-src/sendbackup.c (the_num): return the nth number in a string.
+       * client-src/sendbackup.h (AM_SIZE_RE): Need a field.
+       * client-src/sendbackup-dump.c: Use new AM_SIZE_RE.
+       * client-src/sendbackup-gnutar.c: Use new AM_SIZE_RE.
+
+2007-04-13  Jean-Louis Martineau <martineau@zmanda.com>
+       * NEWS: Change in amanda-2.5.2
+       * ReleaseNotes: Releases Notes for 2.5.2
+       * server-src/chunker.c (write_tapeheader): Set errno to ENOSPC.
+
+2007-04-12  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/dumper.c: use fullwrite() instead of write()
+
+2007-04-12  Jean-Louis Martineau <martineau@zmanda.com>
+       * amandad-src/amandad.c: Remove duplicate setsockopt(,,SO_REUSEADDR).
+       * common-src/bsd-security.c: Use int for setsockopt.
+       * common-src/stream.c (try_socksize): Use int for setsockopt.
+
+2007-04-12  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amcheck.c: Remove duplicate test.
+       * server-src/dumper.c: Use newvstralloc.
+
+2007-04-12  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/reporter.c: Take value from chunker if it succeed and
+                                taper fail.
+
+2007-04-10  Jean-Louis Martineau <martineau@zmanda.com>
+       * configure.in: Use krb5 shared library.
+
+2007-04-10  Dustin J. Mitchell <dustin@zmanda.com>
+       * changer-src/chg-zd-mtx.sh.in: remove configurability of mt, mtx paths
+
+2007-04-10  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/krb5-security.c: Initialize rc->gss_context.
+
+2007-04-09  Dustin J. Mitchell <dustin@zmanda.com>
+       * changer-src/chg-zd-mtx.sh.in: fix bugs in configuration for mt, mtx paths
+
+2007-04-06  Dustin J. Mitchell <dustin@zmanda.com>
+       * oldrecover-src/extract_list.c oldrecover-src/display_commands.c
+         client-src/sendbackup.c client-src/getfsent.c client-src/sendsize.c
+         client-src/selfcheck.c recover-src/amrecover.c recover-src/extract_list.c
+         recover-src/display_commands.c server-src/amlogroll.c
+         server-src/amindexd.c server-src/tapefile.c server-src/amcheck.c
+         server-src/dumper.c server-src/planner.c server-src/reporter.c
+         server-src/amadmin.c server-src/find.c server-src/infofile.c
+         restore-src/amidxtaped.c common-src/security-util.c common-src/amanda.h:
+         improve parsing with strcmp_const and strcmp_const_skip
+
+2007-04-06  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/taper.c: Limit splitsize to 1G in PORT-WRITE.
+
+2007-04-06  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/krb5-security.c: Report client hostname.
+
+2007-04-06  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/tapelist.c (append_to_tape): Don't call dump_tapelist.
+
+2007-04-05  Dustin J. Mitchell <dustin@zmanda.com>
+       * contrib/macosx/org.amanda.amandad.bsd*.plist: updated to use username
+         'amandabackup'
+
+2007-04-05  Dustin J. Mitchell <dustin@zmanda.com>
+       * amplot/amplot.sh.in configure.in config/acinclude.m4i:
+         move checks for gnuplot, awk to runtime for easier packaging;
+         add fake gettext functions to ease the transition to
+         full gettext support
+
+2007-04-05  Dustin J. Mitchell <dustin@zmanda.com> 
+       * server-src/amindex.c: fix bug where debug fd was closed by safe_fd,
+         remove remote_hostname, rewrite to use getaddrinfo/getnameinfo
+       * server-src/dumper.c server-src/amcheck.c recover-src/set_commands.c:
+         use getaddrinfo/getnameinfo
+       * common-src/security-util.[ch]: add try_resolving_hostname()
+       * common-src/ssh-security.c common-src/rsh-security.c:
+         use try_resolving_hostname, rewrite to avoid gethostbyname
+       * common-src/krb5-security.c: use getaddrinfo instead of gethostbyname
+
+2007-04-05  Dustin J. Mitchell <dustin@zmanda.com>
+       * changer-src/chg-lib.sh.in changer-src/chg-mtx.sh.in
+         changer-src/chg-manual.sh.in changer-src/chg-zd-mtx.sh.in
+         changer-src/chg-multi.sh.in changer-src/Makefile.am
+         configure.in: make the path to MTX and other executables configurable
+         in changer scripts; introduce new changer shell library to reduce
+         code duplication; add fake gettext functions to ease the transition to
+         full gettext support
+
+2007-04-04  Dustin J. Mitchell <dustin@zmanda.com>
+       * server-src/dumper.c server-src/chunker.c: remove assumed ENOSPC
+         error in static write_tapeheader functions
+
+2007-04-03  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/security-util.c: Remove buggy &.
+
+2007-04-03  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/conffile.c: Add READBLOCKSIZE tapetype config option.
+       * common-src/conffile.c(getconf_readblocksize): Function to retrieve
+         the tapetype readblocksize or the configured maxtapeblocksize.
+       * common-src/conffile.h: Add READBLOCKSIZE tapetype config option.
+       * man/xml-source/amanda.conf.5.xml: Document it.
+       * tape-src/output-tape.c: Use getconf_readblocksize.
+       * tape-src/tapeio.c: Use getconf_readblocksize.
+
+2007-04-03  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/bsd-security.c, common-src/bsdtcp-security.c,
+         common-src/bsdudp-security.c,
+         common-src/security-util.c: Fix auth_debug and dbprintf usage.
+
+2007-04-03  Jean-Louis Martineau <martineau@zmanda.com>
+       Merge from zmanda ext.
+       * man/xml-source/amadmin.8.xml man/xml-source/amanda.8.xml
+         server-src/amflush.c server-src/cmdline.c server-src/cmdline.h
+         server-src/holding.c server-src/holding.h server-src/driver.c
+         server-src/planner.c server-src/amadmin.c server-src/taper.c
+         server-src/amcleanupdisk.c server-src/find.c
+         server-src/Makefile.am: revise holding-disk management, add new
+         'amadmin' subcommand to list and delete dumps from the holding
+         disk.
+       * server-src/amadmin.c: Add 'amadmin XX holding list -l'
+
+2007-04-02  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/bsdtcp-security.c common-src/bsd-security.c 
+         common-src/security-util.c common-src/bsdudp-security.c:
+         bugfixes, always check for NULL ai_canonname
+       * common-src/util.c common-src/util.h common-src/krb4-security.c 
+         common-src/security-util.c: bugfix for hosts with multiple addresses,
+         improved cmp_sockaddr, remove redundant checks
+       * server-src/taper.c: add log message when new tapes are auto-labeled
+       * common-src/security-util.c: patch to avoid spurious compiler warnings
+         noticed on FC3
+
+2007-03-30  Dustin J. Mitchell <dustin@zmanda.com>
+       * common-src/file.c: remove unused amanda_setup()
+
+2007-03-30  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/amanda.h: Define a _() macro.
+
+2007-03-28  Dustin J. Mitchell <dustin@zmanda.com>
+       * common/amanda.h: fix typo in SS_SET_INADDR_ANY for non-IPv6 
+         machines
+       * gnulib/regenerate/regenerate: update to include visibility
+         and lock modules (See 2007-03-14)
+       * recover-src/extract_list.c common-src/krb4-security.c
+         common-src/event.c common-src/security-util.c: use
+         SELECT_ARG_TYPE instead of fd_set
+
+2007-03-27  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/krb5-security.c: Fix for krb5 and IPv6.
+       * common-src/security-util.c: Fix for krb5 and IPv6.
+
+2007-03-27  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/krb5-security.c: Compile with heimdal kerberos.
+
+2007-03-27  Jean-Louis Martineau <martineau@zmanda.com>
+       Fix solaris 9 problem:
+       * common-src/krb5-security.c: Use putenv instead of setenv.
+       * common-src/security-util.c: Set flags according to family.
+
+2007-03-27  Jean-Louis Martineau <martineau@zmanda.com>
+       Merge from zmanda EXT.
+
+2007-03-27  Jean-Louis Martineau <martineau@zmanda.com>
+       * Makefile.am (EXTRA_DIST): Remove contrib/gnulib-update-current.
+
+2007-03-27  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/reporter.c: Ouput quoted diskname in "DUMP SUMMARY"
+         section.
+
+2007-03-23  Jean-Louis Martineau <martineau@zmanda.com>
+       * changer-src/chg-zd-mtx.sh.in: Exit with a message if the
+                                       configuration file doesn't exist.
+
+2007-03-23  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/conffile.c: Fix error message.
+
+2007-03-23  Jean-Louis Martineau <martineau@zmanda.com>
+       * amandad-src/amandad.c: Fix segfault.
+
+2007-03-23  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/security-util.c: Use SS_LEN.
+       * common-src/util.c: Use SS_LEN.
+
+2007-03-21  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/security.h (security_driver): Add data_encrypt and
+                                                  data_decrypt function.
+       * common-src/bsd-security.c, common-src/bsdtcp-security.c,
+         common-src/bsdudp-security.c, common-src/krb4-security.c,
+         common-src/rsh-security.c,
+         common-src/ssh-security.c: Set data_encrypt and data_decrypt to NULL.
+
+       * common-src/conffile.c: Parse KRB5KEYTAB and KRB5PRINCIPAL on client.
+       * common-src/krb5-security.c: Complete rewrite.
+       * common-src/security-util.h: Change many prototype.
+       * common-src/security-util.c: Change argument to function.
+       * recover-src/amrecover.c: Use generic_client_get_security_conf.
+       * recover-src/extract_list.c: Use generic_client_get_security_conf.
+
+2007-03-21  Jean-Louis Martineau <martineau@zmanda.com>
+       Merge from zmanda EXT.
+       - Add SS_INIT, SS_SET_INADDR_ANY, SS_GET_PORT and SS_SET_PORT
+         macros for IPv6 portability
+       - add SS_LEN() macro for calculating length of a
+         struct sockaddr, use it in a few locations where incorrect
+         lengths were being passed.
+       - New script for rebuilding gnulib from scratch; current
+         gnulib is from "cvs update -D '2007-01-31 13:12:51 -0600'"
+
+2007-03-12  Jean-Louis Martineau <martineau@zmanda.com>
+       * recover-src/set_commands.c (set_tape): Don't amfree(tape).
+       * oldrecover-src/set_commands.c (set_tape): Don't amfree(tape).
+
+2007-02-22  Jean-Louis Martineau <martineau@zmanda.com>
+       * changer-src/scsi-linux.c, common-src/security-util.c,
+         common-src/stream.c, oldrecover-src/amrecover.c,
+         restore-src/restore.c, server-src/amcheck.c,
+         server-src/taper.c: Use SIZE_T_FMT and SSIZE_T_FMT instead of %z.
+
+2007-02-22  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/bsd-security.c: Always retry getaddrinfo if INET6 failed.
+       * common-src/bsdudp-security.c: Ditto.
+
+2007-02-22  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/debug.c: Remove old file in current directory.
+
+2007-02-22  Jean-Louis Martineau <martineau@zmanda.com>
+       * changer-src/chg-chio.pl.in: Typo.
+
+2007-02-21  Jean-Louis Martineau <martineau@zmanda.com>
+       * recover-src/extract_list.c: Remove match for path_on_disk_slash.
+
+2007-02-20  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/stream.c, common-src/util.c: Pass exact socklen_t to
+                                                 bind and connect call.
+
+2007-02-20  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/taper.c: Set splitsize to 0 if no data in file.
+       * server-src/amflush.c: Don't send FLUSH request if no data in file.
+       * server-src/planner.c: Don't send FLUSH request if no data in file.
+       * server-src/driver.c: Don't send request to taper if no data in file.
+
+2007-02-19  Jean-Louis Martineau <martineau@zmanda.com>
+       * amandad-src/amandad.c: Fix compilation with --without-ipv6.
+
+2007-02-19  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amverify.sh.in: Remove bogus fi.
+
+2007-02-16  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amverify.sh.in: Add timeout on wait for device ready.
+       * changer-src/chg-chio.pl.in: Wait (with timeout) for drive ready.
+
+2007-02-15  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/taper.c: Don't call free_server_config.
+
+2007-02-15  Jean-Louis Martineau <martineau@zmanda.com>
+       * patching file oldrecover-src/amrecover.h (local_cd): Prototype.
+       * oldrecover-src/set_commands.c: Works with quoted arguments.
+       * oldrecover-src/uparse.y (LCD): Call local_cd.
+       * recover-src/amrecover.h (local_cd): Prototype.
+       * recover-src/set_commands.c: Works with quoted arguments.
+       * recover-src/uparse.y (LCD): Call local_cd.
+
+2007-02-14  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/security-util.c: Add "on the client" message.
+
+2007-02-13  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amstatus.pl.in: fix for chunk and displayunit.
+
+2007-02-13  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/dumper.c: Fix if krb4 is compiled but another auth is
+                              used.
+
+2007-02-13  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/alloc.c (safe_env): Remove LANG and LC_* only if we are
+                                        priviledged process.
+
+2007-02-13  Jean-Louis Martineau <martineau@zmanda.com>
+       * dumper-src/amgtar.pl.in: Replace -t options by -T.
+       * dumper-src/Makefile.am: Remove perl -t options.
+
+2007-02-12  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/Makefile.am (STANDARD_COMMON_STUFF_NOT_FILE): Add sl.
+       * common-src/statfs.c: Fix scale function.
+
+2007-02-12  Jean-Louis Martineau <martineau@zmanda.com>
+       * client-src/sendsize.c: Fix PARAM_HONOR_NODUMP.
+
+2007-02-09  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/reporter.c: Fix postscript crash.
+
+2007-02-09  Jean-Louis Martineau <martineau@zmanda.com>
+       * changer-src/chg-manual.sh.in: Add tty, email, tty_email request mode.
+
 2007-02-07  Jean-Louis Martineau <martineau@zmanda.com>
        * server-src/amindexd.c: Use dbfd.
 
 2007-02-06  Jean-Louis Martineau <martineau@zmanda.com>
-       * Amanda 2.5.1p3 released.
-       * configure.in: AM_INIT_AUTOMAKE(amanda, 2.5.1p3).
-       * NEWS: Update for 2.5.1p3
+       * common-src/alloc.c (vstrallocf): New function.
+       * common-src/amanda.h (vstrallocf): Prototype.
+       * client-src/sendsize.c: Send error if fe_rep_sendsize_quoted_error.
+       * common-src/amfeatures.c (am_init_feature_set): Set
+                                                fe_rep_sendsize_quoted_error.
+       * common-src/amfeatures.h (fe_rep_sendsize_quoted_error): new features.
+       * server-src/planner.c: Receive error message from sendsize.
 
 2007-02-06  Jean-Louis Martineau <martineau@zmanda.com>
-       * man/xml-source/amcheck.8.xml,
-         server-src/amlabel.c: Merge from zmanda.
+       * amandad-src/amandad.c, changer-src/scsi-linux.c,
+         common-src/conffile.c, configure.in,
+         man/Makefile.am, man/xml-source/amcheck.8.xml,
+         server-src/amlabel.c, server-src/taper.c: Merge from zmanda.
 
 2007-02-06  Jean-Louis Martineau <martineau@zmanda.com>
        * common-src/clock.c (timesub): The result must always be positive.
        * server-src/amcheck.c: Add parentheses.
 
 2007-02-02  Jean-Louis Martineau <martineau@zmanda.com>
-       * docs/*.txt: Update from xml-docs.
+       * contrib/gnulib-update-current: New file.
+       * Makefile.am (EXTRA_DIST): Add contrib/gnulib-update-current.
 
 2007-02-02  Jean-Louis Martineau <martineau@zmanda.com>
        * man/Makefile.am: Use http://docbook.sourceforge.net
        * server-src/amflush.c: Output a starttime line.
        * server-src/amstatus.pl.in: parse the starttime line.
 
+2007-01-26  Jean-Louis Martineau <martineau@zmanda.com>
+       * configure.in: Fix --with-ipv6 option.
+
 2007-01-26  Jean-Louis Martineau <martineau@zmanda.com>
        * server-src/amdump.sh.in: Exit with a status.
 
 2007-01-26  Jean-Louis Martineau <martineau@zmanda.com>
        * server-src/amstatus.pl.in: Detect failed dump to tape.
 
+2007-01-25  Jean-Louis Martineau <martineau@zmanda.com>
+       * configure.in: Add --with-ipv6 option.
+
 2007-01-25  Jean-Louis Martineau <martineau@zmanda.com>
        * server-src/changer.c (changer_command): Send stderr to dbfd().
 
        * changer-src/chg-zd-mtx.sh.in: Set CHANGER environment variable.
 
 2007-01-24  Jean-Louis Martineau <martineau@zmanda.com>
-       * client-src/clientconf.c: Don;t check for duplicate -o options.
-       * common-src/util.c: Check for duplicate -o options.
+       * common-src/conffile.c: Cleanup conf_print function.
+
+2007-01-24  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/conffile.c: Check for duplicate -o options.
        * recover-src/amrecover.c: Change precedence of option.
 
 2007-01-24  Jean-Louis Martineau <martineau@zmanda.com>
        * server-src/amcheck.c: Check tape_access.
        * server-src/taper.c: Improve message.
 
+2007-01-16  Jean-Louis Martineau <martineau@zmanda.com>
+       * configure.in: Define GCC_COMPILER.
+       * gnulib/Makefile.am: Add -Wno-error to AM_CFLAGS if GCC_COMPILER.
+
 2007-01-16  Jean-Louis Martineau <martineau@zmanda.com>
        * server-src/getconf.c: Fix segfault in parameter parsing.
 
+2007-01-15  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/bsd-security.c, common-src/bsdtcp-security.c,
+         common-src/bsdudp-security.c,
+         common-src/stream.c: Don't call check_addrinfo_give_name.
+       * common-src/security-util.c (check_addrinfo_give_name): Always log
+                                                                error message.
+
 2007-01-11  Jean-Louis Martineau <martineau@zmanda.com>
-       * server-src/conffile.c Set default length/filemark correctly.
+       * common-src/conffile.c Set default length/filemark correctly.
        * man/xml-source/amanda.conf.5.xml: Document they are in kbytes.
 
+2007-01-10  Jean-Louis Martineau <martineau@zmanda.com>
+       * config/gnulib/gnulib-common.m4: New file.
+       * config/gnulib.m4i: Load config/gnulib/gnulib-common.m4.
+
 2007-01-10  Jean-Louis Martineau <martineau@zmanda.com>
        * amandad-src/amandad.c (do_sendpkt): Send packet if handle != NULL.
 
 2007-01-10  Jean-Louis Martineau <martineau@zmanda.com>
-       * common-src/util.c, common-src/util.h, server-src/conffile.c,
+       * common-src/conffile.c, common-src/conffile.h,
          server-src/diskfile.c: Keep different list for exclude file and list.
 
 2007-01-10  Jean-Louis Martineau <martineau@zmanda.com>
 2007-01-04  Jean-Louis Martineau <martineau@zmanda.com>
        * restore-src/restore.c: Use prompt_in.
 
+2007-01-04  Jean-Louis Martineau <martineau@zmanda.com>
+       * amandad-src/amandad.c, common-src/bsd-security.c,
+         common-src/bsdtcp-security.c, common-src/bsdudp-security.c,
+         common-src/dgram.c, common-src/security-util.c,
+         common-src/stream.c,
+         common-src/util.c: Replace HAVE_IPV6 by WORKING_IPV6.
+       * configure.in: Define HAVE_IPV6 if IPv6 is working.
+
 2007-01-04  Jean-Louis Martineau <martineau@zmanda.com>
        * changer-src/chg-chio.pl.in, changer-src/chg-iomega.pl.in,
-         changer-src/chg-rth.pl.in, dumper-src/gnutar.pl.in,
+         changer-src/chg-rth.pl.in, dumper-src/amgtar.pl.in,
          server-src/amoverview.pl.in, server-src/amstatus.pl.in,
          server-src/amtoc.pl.in: Clean ENV and set PATH.
 
          common-src/security-util.c: Use pkt_init_empty.
 
 2006-12-18  Jean-Louis Martineau <martineau@zmanda.com>
-       * server-src/conffile.c: Print nothing if the list is emtpy.
+       * common-src/conffile.c: Print nothing if the list is emtpy.
 
 2006-12-14  Jean-Louis Martineau <martineau@zmanda.com>
        * restore-src/restore.c: Fix filename for output file.
 
-2006-12-12  Jean-Louis Martineau <martineau@zmanda.com>
-       * common-src/util.c: Fix printf format error.
-
 2006-12-12  Jean-Louis Martineau <martineau@zmanda.com>
        * common-src/amanda.h: Define __attribute__ for gcc >= 3.
        * common-src/packet.c (pkt_init): Accept NULL for fmt.
          common-src/security-util.c: Pass NULL to pkt_init.
        * amandad-src/amandad.c, changer-src/chg-scsi.c,
          changer-src/scsi-linux.c, client-src/sendbackup.c,
-         common-src/amanda.h, common-src/event.c,
-         common-src/packet.c, common-src/security-util.c,
-         common-src/stream.c, oldrecover-src/amrecover.c,
+         common-src/amanda.h, common-src/conffile.c,
+         common-src/event.c, common-src/packet.c,
+         common-src/security-util.c, common-src/stream.c,
+         common-src/util.c, oldrecover-src/amrecover.c,
          restore-src/restore.c, server-src/amcheck.c,
          server-src/driver.c, server-src/driverio.c,
          server-src/taper.c: Fix printf format error.
        * server-src/amindexd.c: Clean the indexd file between the uncompress
                                 and sort process.
 
+2006-12-08  Jean-Louis Martineau <martineau@zmanda.com>
+       * configure.in: Add ICE_CHECK_DECL(snprintf,stdio.h)
+       * configure.in: Add ICE_CHECK_DECL(vsnprintf,stdio.h)
+       * client-src/sendbackup.c: Fix ignoring return value of write.
+
 2006-12-08  Jean-Louis Martineau <martineau@zmanda.com>
        * man/xml-source/amadmin.8.xml, man/xml-source/amanda.8.xml,
          man/xml-source/amanda.conf.5.xml, man/xml-source/amcheck.8.xml,
        * changer-src/chg-rait.sh.in: Fix typo for -reset.
 
 2006-12-07  Jean-Louis Martineau <martineau@zmanda.com>
-       * common-src/util.c (lookup_keyword): Use strcasecmp.
-       * common-src/util.c (get_conftoken): Don;t convert to uppercase.
+       * server-src/amindexd.c: Fix host case problem.
+       * server-src/diskfile.c (add_disk, parse_diskline): Update hostname
+                                                           field.
+       * server-src/diskfile.h (disk_s): New hostname field.
+       * server-src/disk_history.c (add_dump): New hostname parameter.
+       * server-src/disk_history.h (DUMP_ITEM): New hostname field.
+       * server-src/disk_history.h (add_dump): Protoype change.
+
+2006-12-07  Jean-Louis Martineau <martineau@zmanda.com>
+       * amandad-src/amandad.c: Add missing HAVE_IPV6.
+       * common-src/security-util.c: Add missing HAVE_IPV6.
+       * common-src/bsd-security.c, common-src/bsdtcp-security.c,
+         common-src/bsdudp-security.c, common-src/dgram.c,
+         common-src/dgram.h, common-src/stream.c,
+         common-src/util.c: Fix for broken getaddrinfo:not returning V4MAPPED
+
+2006-12-07  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/conffile.c (lookup_keyword): Use strcasecmp.
+       * common-src/conffile.c (get_conftoken): Don;t convert to uppercase.
        * server-src/getconf.c: Don;t print extra '\n' for --list.
 
+2006-12-04  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/util.c (str_sockaddr): Use host byte order for port.
+
 2006-12-04  Jean-Louis Martineau <martineau@zmanda.com>
        * server-src/amtape.h: Remove file.
 
+2006-12-04  Jean-Louis Martineau <martineau@zmanda.com>
+       Application API phase 1.
+       * client-src/client_util.c, client-src/client_util.h,
+         client-src/selfcheck.c, client-src/sendbackup.c,
+         client-src/sendsize.c, common-src/amfeatures.c,
+         common-src/amfeatures.h, common-src/fileheader.c,
+         common-src/fileheader.h, recover-src/extract_list.c,
+         server-src/amcheck.c, server-src/amstatus.pl.in,
+         server-src/dumper.c, server-src/Makefile.am,
+         server-src/planner.c: Fix for Application API.
+       * configure.in: Fix for moved files.
+       * dumper-src/generic-dumper.pl.in: Fix for Application API.
+       * dumper-src/Makefile.am: Fix for renamed files.
+       * dumper-src/gnutar.pl.in: Renamed to dumper-src/amgtar.pl.in.
+       * dumper-src/amgtar.pl.in: Fix for Application API.
+       * dumper-src/star.pl.in: Renamed to dumper-src/amstar.pl.in.
+       * dumper-src/amstar.pl.in: Fix for Application API.
+
 2006-11-29  Jean-Louis Martineau <martineau@zmanda.com>
        * client-src/sendbackup.c: Kill dump process on error.
 
 2006-11-29  Jean-Louis Martineau <martineau@zmanda.com>
        * restore-src/restore.c (search_tapes): Fix prompt_out setting.
 
-2006-11-24  Jean-Louis Martineau <martineau@zmanda.com>
+2006-11-28  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/amanda.h: Don't include gnulib header if CONFIGURE_TEST
+                              is defined.
+       * common-src/amflock.c (main): Remove unused fd variable.
+
+2006-11-28  Jean-Louis Martineau <martineau@zmanda.com>
+       * config/Makefile.am (EXTRA_DIST): Add gnulib.m4i.
+
+2006-11-27  Jean-Louis Martineau <martineau@zmanda.com>
        * common-src/util.c (copy_file): Fix compilation error.
 
+2006-11-27  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/stream.c: Fix compilation error.
+
+2006-11-27  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/amanda.h (NI_MAXHOST): Define if not defined.
+       * common-src/bsd-security.c, common-src/bsdtcp-security.c,
+         common-src/bsdudp-security.c, common-src/dgram.c,
+         common-src/security-util.c, common-src/stream.c,
+         common-src/util.c: HAVE_IPV6 conditional code
+
+2006-11-26  Jean-Louis Martineau <martineau@zmanda.com>
+       * config/gnulib/*: m4 files for gnulib.
+       * config/gnulib.m4i: File to load all m4 files for gnulib.
+       * gnulib/*: gnulib source.
+       * */Makefile.am (INCLUDES): Add $(top_srcdir)/gnulib.
+       * */Makefile.am (LDADD): Add ../gnulib/libgnu.$(LIB_EXTENSION).
+       * Makefile.am (ACINCLUDE_M4_DEPS): Add $(srcdir)/config/gnulib.m4i.
+       * Makefile.am (SUBDIRS): Add gnulib.
+       * configure.in: AC_PREREQ(2.59), gl_EARLY, gl_INIT.
+       * configure.in (AC_CONFIG_FILES): Add gnulib/Makefile.
+       * autogen: Add config/gnulib.m4i to acinclude.m4.
+
 2006-11-24  Jean-Louis Martineau <martineau@zmanda.com>
        * client-src/sendbackup-dump.c, client-src/sendbackup-gnutar.c,
          client-src/sendsize.c,
        * common-src/security-util.c (tcpm_recv_token): amanda protocol
          packet can be larger than NETWORK_BLOCK_BYTES
 
+2006-11-21  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/stream.c: Fix compiler error.
+
+2006-11-21  Jean-Louis Martineau <martineau@zmanda.com>
+       * amandad-src/amandad.c, common-src/amanda.h,
+         common-src/bsd-security.c, common-src/bsdtcp-security.c,
+         common-src/bsdudp-security.c, common-src/dgram.c,
+         common-src/dgram.h, common-src/krb4-security.c,
+         common-src/krb5-security.c, common-src/security-util.c,
+         common-src/security-util.h, common-src/stream.c,
+         common-src/util.c, common-src/util.h,
+         restore-src/amidxtaped.c, server-src/amindexd.c: IPV6.
+
+2006-11-20  Jean-Louis Martineau <martineau@zmanda.com>
+       * client-src/sendsize.c, oldrecover-src/display_commands.c,
+         oldrecover-src/extract_list.c, recover-src/display_commands.c,
+         recover-src/extract_list.c,
+         server-src/driver.c: Fix compiler error.
+
 2006-11-20  Jean-Louis Martineau <martineau@zmanda.com>
        * client-src/sendsize.c: Open the amandates file after the
                                 <config>/amanda-client.conf file is loaded.
 
+2006-11-20  Jean-Louis Martineau <martineau@zmanda.com>
+       * client-src/sendsize.c: Fix compiler error on boris.
+       * server-src/driver.c: Fix compiler error on rocky.
+
 2006-11-20  Jean-Louis Martineau <martineau@zmanda.com>
        * common-src/security-util.c, server-src/amcheck.c,
        * server-src/driver.c, server-src/dumper.c,
                                is set to 0.
 
 2006-11-09  Jean-Louis Martineau <martineau@zmanda.com>
-       * Amanda 2.5.1p2 released.
-       * configure.in: AM_INIT_AUTOMAKE(amanda, 2.5.1p2).
-       * NEWS: Update for 2.5.1p2
-
-2006-11-09  Jean-Louis Martineau <martineau@zmanda.com>
-       * server-src/conffile.c (getconf_byname):
-                               Parse "DEFINE:identifer:parameter" format.
-       * server-src/conffile.c (getconf_list): New function to list a DEFINE.
-       * server-src/conffile.c (lookup_holdingdisk): New function.
-       * server-src/conffile.h (getconf_list,
-                                lookup_holdingdisk): New prototype.
-       * server-src/getconf.c: accept --list argument and
-                               "DEFINE:identifer:parameter" format.
-       * man/xml-source/amgetconf.8.xml: Document.
+       * man/xml-source/amgetconf.8.xml: Document --list.
 
 2006-11-09  Jean-Louis Martineau <martineau@zmanda.com>
        * changer-src/chg-scsi.c: Don't remove '_' from "generic_changer".
-       
+
 2006-11-08  Jean-Louis Martineau <martineau@zmanda.com>
-       * common-src/amanda.h, common-src/security-util.c,
-         common-src/util.h, configure.in,
-         oldrecover-src/amrecover.c, oldrecover-src/extract_list.c,
-         recover-src/amrecover.c, recover-src/extract_list.c,
-         restore-src/amrestore.c, server-src/conffile.c,
+       * common-src/amanda.h, common-src/conffile.c,
+         common-src/conffile.h, common-src/security-util.c,
+         configure.in, oldrecover-src/amrecover.c,
+         oldrecover-src/extract_list.c, recover-src/amrecover.c,
+         recover-src/extract_list.c, restore-src/amrestore.c,
          server-src/dumper.c: Fix compiler error on Tru64.
 
+2006-11-08  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/conffile.c (getconf_byname):
+                               Parse "DEFINE:identifer:parameter" format.
+       * common-src/conffile.c (getconf_list): New function to list a DEFINE.
+       * common-src/conffile.c (lookup_holdingdisk): New function.
+       * common-src/conffile.h (getconf_list,
+                                lookup_holdingdisk): New prototype.
+       * server-src/getconf.c: accept --list argument and
+                               "DEFINE:identifer:parameter" format.
+       * man/xml-source/amgetconf.8.xml: Document.
+
 2006-11-08  Jean-Louis Martineau <martineau@zmanda.com>
        * server-src/driver.c: set off_t variable to 0 before sscanf.
        * server-src/planner.c: set off_t variable to 0 before sscanf.
        * server-src/diskfile.c: Fix coverity bug 147.
 
 2006-11-07  Jean-Louis Martineau <martineau@zmanda.com>
-       * server-src/conffile.c (validate_chunksize): Check chunksize is >=
+       * common-src/conffile.c (validate_chunksize): Check chunksize is >=
                                                      2*DISK_BLOCK_KB
 
 2006-11-06  Jean-Louis Martineau <martineau@zmanda.com>
        * server-src/diskfile.c: Don't use 0 for NULL.
 
 2006-11-01  Jean-Louis Martineau <martineau@zmanda.com>
-       * client-src/clientconf.c: Define AMANDATES_FILE
+       Revert Ian patch of 2006-10-29.
+       * common-src/conffile.c: Defile AMANDATES_FILE
        * client-src/amandates.h: Don't define AMANDATES_FILE
 
 2006-11-01  Jean-Louis Martineau <martineau@zmanda.com>
        * server-src/amadmin.c (disklist_one): Print correct starttime.
        * server-src/diskfile.c: Set start_t to starttime.
        * server-src/diskfile.h (disk_t): Add starttime.
-       * common-src/conffile.c (conf_print): Add a parameter if we want
-                                             CONFTYPE_STRING enclosed in ".
-       * server-src/planner.c: Use getconf_int to get etimeout value.
-       * common-src/conffile.c (CNF_CTIMEOUT, CNF_DTIMEOUT, CNF_ETIMEOUT):
-         They are of type CONFTYPE_INT
-         (CONFTYPE_TIME are for value parsed as "hhmm"")
-       * common-src/conffile.c (getconf_byname): Use conf_print().
-       * common-src/conffile.h: Add comment.
-       * server-src/amcheck.c, server-src/dumper.c, server-src/planner.c:
-         Use getconf_int to get timeout value.
 
 2006-11-01  Jean-Louis Martineau <martineau@zmanda.com>
        * changer-src/scsi-changer-driver.c: Add Tandberg SLR100,
        * common-src/amanda.h: Define dbrename if !DEBUG_CODE.
        * restore-src/amidxtaped.c: Declare i if !DEBUG_CODE.
 
-2006-10-25  Jean-Louis Martineau <martineau@zmanda.com>
-       * server-src/amtape.c: Use parse_conf instead of parse_server_conf.
+2006-10-30  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/amadmin.c (disklist_one): Print ignore field.
+       * server-src/amoverview.pl.in: Ignore 'ignore yes' and 'strategy skip'.
        * server-src/diskfile.c: Correct hostname allocation.
+                                Keep 'ignore yes' and 'strategy skip' DLE in
+                                memory, set there todo to 0.
+       * server-src/diskfile.h: (struct disk_s): New ignore field.
+
+2006-10-29  Ian Turner <ian@zmanda.com>
+       This was reported as debian bug 394796. Thanks to Damyan Ivanov 
+       <dam@modsoftsys.com> for reporting and to Bdale Garbee 
+       <bdale@gag.com> for a preliminary patch.
+       * common-src/conffile.c: Use AMANDATES_FILE as default for 
+         location of amandates.
+       * common-src/amandates.h: Move from client-src/
+       * client-src/amandates.h: Move to common-src/
+       * common-src/Makefile.am: Update to reflect new location of 
+         amandates.h.
+       * client-src/Makefile.am: ditto.
 
 2006-10-25  Jean-Louis Martineau <martineau@zmanda.com>
        Patch by Jay Fenlason
 2006-10-24  Jean-Louis Martineau <martineau@zmanda.com>
        * server-src/taper.c: Fix allocation problem on tapedev.
 
+2006-10-20  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/conffile.c (conf_print): Add a parameter if we want
+                                             CONFTYPE_STRING enclosed in ".
+       * server-src/planner.c: Use getconf_int to get etimeout value.
+
 2006-10-20  Jean-Louis Martineau <martineau@zmanda.com>
        * server-src/taper.c (free_split_buffer): Correct free.
 
+2006-10-20  Jean-Louis Martineau <martineau@zmanda.com>
+       * client-src/sendbackup.c: Parse quote amdevice.
+       * server-src/amcheck.c: Send quoted amdevice.
+       * server-src/planner.c: Send quoted amdevice.
+
+2006-10-20  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/conffile.c (CNF_CTIMEOUT, CNF_DTIMEOUT, CNF_ETIMEOUT):
+         They are of type CONFTYPE_INT
+         (CONFTYPE_TIME are for value parsed as "hhmm"")
+       * common-src/conffile.c (getconf_byname): Use conf_print().
+       * common-src/conffile.h: Add comment.
+       * server-src/amcheck.c, server-src/dumper.c, server-src/planner.c:
+         Use getconf_int to get timeout value.
+
 2006-10-19  Jean-Louis Martineau <martineau@zmanda.com>
        * man/xml-source/amanda.conf.5.xml: Fix formating.
 
+2006-10-19  Jean-Louis Martineau <martineau@zmanda.com>
+       * client-src/calcsize.c, client-src/sendsize.c: Remove bogus fseek.
+
 2006-10-19  Jean-Louis Martineau <martineau@zmanda.com>
        * client-src/calcsize.c: Quote amname.
 
+2006-10-19  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/driver.c: Print an L_STATS with the hostname
+       * server-src/reporter.c: Print hostname, org, config and date at the
+                                beginning of the report
+
 2006-10-16  Jean-Louis Martineau <martineau@zmanda.com>
        * common-src/dgram.c (dgram_cat),
          common-src/packet.c (pkt_init, pkt_cat): Works correctly with
                                                   vsnprintf returning -1.
 
+2006-10-11  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/Makefile.am (libamanda_la_LIBADD) Remove @LTLIBOBJS@.
+
+2006-10-11  Jean-Louis Martineau <martineau@zmanda.com>
+       * server-src/taper.c: stralloc(tapedev).
+       * configure.in (EXAMPLE_TAPEDEV): Set to /dev/null if no tape-device.
+       * example/amanda-client.conf.in, example/amanda.conf.in
+         example/chg-mcutil.conf.in: Use EXAMPLE_TAPEDEV.
+
+2006-10-11  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/alloca.c, common-src/getcwd.c, common-src/mktime.c,
+         common-src/memmove.c, common-src/snprintf.c,
+         common-src/strcasecmp.c, common-src/strerror.c,
+         common-src/strftime.c, common-src/strncasecmp.c,
+         common-src/strstr.c, common-src/waitpid.c,
+         COPYRIGHT-APACHE: Removed files.
+       * configure.in: Remove many AC_REPLACE_FUNCS.
+       * Makefile.am (pkgdata_DATA): Remove COPYRIGHT-APACHE.
+
+2006-10-11  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/Makefile.am: Remove all reference to our regex
+       * common-src/match.c: #include <regex.h>, the system regex
+       * common-src/memmove.c: No more memmove in regex-src
+       * Makefile.am (pkgdata_DATA): Remove COPYRIGHT-REGEX
+       * Makefile.am (EXTRA_DIST): Remove regex-src/*
+       * regex-src: Remove directory.
+       * common-src/regcomp.c, common-src/regerror.c,
+         common-src/regexec.c, common-src/regfree.c,
+         common-src/amregex.h: Remove files.
+
 2006-10-11  Jean-Louis Martineau <martineau@zmanda.com>
        * server-src/planner.c: Improve message for dump larger than available
                                tape space if runtapes > 1 and splitsize == 0.
 2006-10-03  Jean-Louis Martineau <martineau@zmanda.com>
        * server-src/amcleanupdisk.c: Accept -o arguments.
        * server-src/amcleanup.sh.in: Add missing 'shift' for non-linux system.
-                                     Accept -o arguments.
+                                     Accept -o arguments.
 
 2006-10-03  Jean-Louis Martineau <martineau@zmanda.com>
        * server-src/amoverview.pl.in: Fix parsing of time field from amadmin.
          server-src/taperscan.c: Check for CNF_TAPEDEV == NULL.
 
 2006-10-03  Jean-Louis Martineau <martineau@zmanda.com>
-       * server-src/conffile.c: Don't set CNF_TAPEDEV to DEFAULT_TAPE_DEVICE.
+       * common-src/conffile.c: Don't set CNF_TAPEDEV to DEFAULT_TAPE_DEVICE.
        * configure.in: Don't set DEFAULT_TAPE_DEVICE.
 
 2006-09-29  Jean-Louis Martineau <martineau@zmanda.com>
        * common-src/bsd-security.c: Fix %hd printf argument format.
        * common-src/security-util.c: Fix %hd printf argument format.
 
-2006-09-27  Jean-Louis Martineau <martineau@zmanda.com>
-       * Amanda 2.5.1p1 released.
-       * configure.in: AM_INIT_AUTOMAKE(amanda, 2.5.1p1).
-       * NEWS: Update for 2.5.1p1
+2006-09-28  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/conffile.c (client_keytab): Add DEBUG_*.
+       * oldrecover-src/amrecover.c: Call read_clientconf.
 
 2006-09-27  Jean-Louis Martineau <martineau@zmanda.com>
        * restore-src/restore.c: Improve debugging.
 
 2006-09-27  Jean-Louis Martineau <martineau@zmanda.com>
        * restore-src/amfetchdump.c: Pass new prompt_in parameter to
-                                    search_tapes.
+                                    search_tapes.
        * restore-src/restore.c (search_tapes, load_manual_tape): New prompt_in
-                                                                 parameter.
+                                                                 parameter.
        * restore-src/restore.h (search_tapes): New prompt_in parameter.
        * restore-src/amidxtaped.c: Set new 'FILE *' instead of reusing stdin
-                                   and stdout.
+                                   and stdout.
        * server-src/amindexd.c: Set new 'FILE *' instead of reusing stdin
-                                and stdout.
+                                and stdout.
 
 2006-09-27  Jean-Louis Martineau <martineau@zmanda.com>
        Patch by Orion Poplawski <orion@cora.nwra.com>
        * server-src/amstatus.pl.in: Fix parsing of 'taper: wrote label' line.
        * server-src/amtoc.pl.in: Fix parsing of 'START taper' line.
 
+2006-09-22  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/conffile.h: New CONFTYPE_INTRANGE conftype_t.
+       * common-src/conffile.c: New CNF_RESERVED_UDP_PORT,
+                                CNF_RESERVED_TCP_PORT,
+                                CNF_UNRESERVED_TCP_PORT config options.
+       * common-src/dgram.c: Use the new CNF_RESERVED_UDP_PORT option.
+       * common-src/stream.c: Use the new CNF_*RESERVED_PORT options.
+       * man/xml-source/amanda-client.conf.5.xml: Document it.
+       * man/xml-source/amanda.conf.5.xml: Document it.
+
 2006-09-22  Jean-Louis Martineau <martineau@zmanda.com>
        Patch by William Jojo
        * client-src/sendsize.c: Fix #endif for AIX.
 2006-09-21  Jean-Louis Martineau <martineau@zmanda.com>
        * server-src/amcheck.c: Don't assert if holding use is set to 0.
 
-2006-09-21  Jean-Louis Martineau <martineau@zmanda.com>
-       * common-src/util.c: Declare keytable.
-       * common-src/util.h: Declare keytable as extern.
-
-2006-09-19  Jean-Louis Martineau <martineau@zmanda.com>
-       * contrib/sst: Removed
-       * Makefile.am (EXTRA_DIST): Remove sst files.
-
 2006-09-19  Jean-Louis Martineau <martineau@zmanda.com>
        * server-src/find.c (search_logfile): Count 'PARTIAL taper line'.
 
 2006-09-19  Jean-Louis Martineau <martineau@zmanda.com>
        * common-src/dgram.c (dgram_bind): Remove unused variables.
 
+2006-09-19  Jean-Louis Martineau <martineau@zmanda.com>
+       * common-src/conffile.c, common-src/conffile.h: Add debug_amandad,
+         debug_amidxtaped, debug_amindexd, debug_amrecover, debug_auth,
+         debug_event, debug_holding, debug_protocol, debug_planner,
+         debug_driver, debug_dumper, debug_chunker, debug_taper,
+         debug_selfcheck, debug_sendsize, debug_sendbackup
+         configurations options.
+       * common-sc/debug.c: Use it's own clock function.
+       * amandad-src/amandad.c, amandad-src/amandad_util.c,
+         client-src/calcsize.c, client-src/client_util.c,
+         client-src/killpgrp.c, client-src/rundump.c,
+         client-src/runtar.c, client-src/selfcheck.c,
+         client-src/sendbackup.c, client-src/sendsize.c,
+         common-src/bsd-security.c, common-src/bsdtcp-security.c,
+         common-src/bsdudp-security.c, common-src/debug.c,
+         common-src/dgram.c, common-src/event.c,
+         common-src/krb5-security.c, common-src/pipespawn.c,
+         common-src/protocol.c, common-src/rsh-security.c,
+         common-src/security.c, common-src/security-util.c,
+         common-src/security-util.h, common-src/ssh-security.c,
+         common-src/stream.c, common-src/util.c,
+         recover-src/amrecover.c, restore-src/amidxtaped.c,
+         server-src/amindexd.c, server-src/chunker.c,
+         server-src/driver.c, server-src/dumper.c,
+         server-src/planner.c,
+         server-src/taper.c: Use the debug_* configuration options.
+                             Use debug_prefix_time to print the time on
+                             all debugging message.
+
+2006-09-19  Jean-Louis Martineau <martineau@zmanda.com>
+       * amandad-src/amandad.c: Use CNF_REP_TRIES.
+       * common-src/conffile.c: New CONNECT_TRIES, REQ_TRIES, REP_TRIES
+                                configuration options.
+       * common-src/conffile.h: New CONNECT_TRIES, REQ_TRIES, REP_TRIES
+                                configuration options.
+       * common-src/protocol.c: Use CNF_CONNECT_TRIES and CNF_REQ_TRIES.
+       * common-src/protocol.c: Rename reqtries to resettries.
+                                Rename acktries to reqtries.
+       * man/xml-source/amanda-client.conf.5.xml: Document new options.
+       * man/xml-source/amanda.conf.5.xml: Document new options.
+
+2006-09-19  Jean-Louis Martineau <martineau@zmanda.com>
+       * amandad-src/amandad.c: Read client configuratrion file.
+       * client-src/client_util.c, client-src/selfcheck.c,
+         client-src/sendbackup.c, client-src/sendbackup-dump.c,
+         client-src/sendbackup-gnutar.c, client-src/sendsize.c,
+         recover-src/amrecover.c, recover-src/extract_list.c,
+         restore-src/amfetchdump.c, server-src/amadmin.c,
+         server-src/amcheck.c, server-src/amflush.c,
+         server-src/amflush.c, server-src/amlabel.c,
+         server-src/amlogroll.c, server-src/amtrmidx.c,
+         server-src/amtrmlog.c, server-src/chunker.c,
+         server-src/diskfile.c, server-src/driver.c,
+         server-src/dumper.c, server-src/getconf.c,
+         server-src/planner.c, server-src/reporter.c,
+         server-src/taper.c: Use generic macro/functions instead of
+                             client/server functions.
+       * client-src/client_util.h: Remove unuse macro.
+       * client-src/Makefile.am: Remove clientconf.? files.
+       * common-src/amanda.h: Define MAX_DUMPERS.
+       * common-src/conffile.c: New file, merge of client-src/clientconf.c
+                                               and server-src/conffile.c
+       * common-src/conffile.h: New file, merge of client-src/clientconf.c
+                                               and server-src/conffile.c
+       * common-src/Makefile.am (libamanda_la_SOURCES): Add conffile.c
+       * common-src/Makefile.am (noinst_HEADERS): Add conffile.h
+       * common-src/util.c: Move many thing to common-src/conffile.c.
+       * common-src/util.h: Move many thing to common-src/conffile.h.
+       * server-src/driverio.h: Remove MAX_DUMPERS define.
+       * server-src/Makefile.am: Remove conffile.[hc].
+
 2006-09-19  Jean-Louis Martineau <martineau@zmanda.com>
        * common-src/dgram.c (dgram_bind): Don't set SO_REUSEADDR on socket.
 
 
 2006-09-18  Jean-Louis Martineau <martineau@zmanda.com>
        * common-src/util.c(dump_sockaddr): Convert from network to machine
-                                           bytes order before printing.
+                                           bytes order before printing.
        * common-src/dgram.c (dgram_recv): Print the fromaddr.
 
 2006-09-15  Jean-Louis Martineau <martineau@zmanda.com>
index b51faf45c52eeba6210a8ec3b25e41d083d5f95e..532bccec18301ebcf6d94f9ac5c615626a02dae0 100644 (file)
@@ -4,7 +4,8 @@ AUTOMAKE_OPTIONS = 1.4 foreign
 ACINCLUDE_M4 = $(srcdir)/acinclude.m4
 ACINCLUDE_M4I = $(srcdir)/config/acinclude.m4i
 LIBTOOL_M4I = $(srcdir)/config/libtool.m4i
-ACINCLUDE_M4_DEPS = $(ACINCLUDE_M4I) $(LIBTOOL_M4I)
+GNULIB_M4I  = $(srcdir)/config/gnulib.m4i
+ACINCLUDE_M4_DEPS = $(GNULIB_M4I) $(ACINCLUDE_M4I) $(LIBTOOL_M4I)
 
 if WANT_CLIENT
 CLIENT_SUBDIRS = client-src dumper-src
@@ -26,6 +27,7 @@ PLOT_SUBDIRS = amplot
 endif
 # order is significant, don't change it arbitrarily
 SUBDIRS = \
+       gnulib \
        config \
        common-src \
        amandad-src \
@@ -39,9 +41,7 @@ SUBDIRS = \
 
 pkgdata_DATA = \
        ReleaseNotes                    \
-       COPYRIGHT                       \
-       COPYRIGHT-APACHE                \
-       COPYRIGHT-REGEX
+       COPYRIGHT
 
 EXTRA_DIST = $(SNAPSHOT_STAMP) \
        $(pkgdata_DATA)                 \
@@ -64,30 +64,7 @@ EXTRA_DIST = $(SNAPSHOT_STAMP) \
        contrib/gsc/ucfggsc.c           \
        patches/regex-3.6alpha.patch    \
        patches/samba-largefs.patch     \
-       patches/tar-1.12.patch          \
-       regex-src/COPYRIGHT             \
-       regex-src/Makefile              \
-       regex-src/README                \
-       regex-src/WHATSNEW              \
-       regex-src/cclass.h              \
-       regex-src/cname.h               \
-       regex-src/debug.c               \
-       regex-src/engine.c              \
-       regex-src/main.c                \
-       regex-src/mkh                   \
-       regex-src/regcomp.c             \
-       regex-src/regerror.c            \
-       regex-src/regex.3               \
-       regex-src/regex.7               \
-       regex-src/regex2.h              \
-       regex-src/regexec.c             \
-       regex-src/regfree.c             \
-       regex-src/split.c               \
-       regex-src/tests                 \
-       regex-src/utils.h               \
-       regex-src/fake/limits.h         \
-       regex-src/fake/memmove.c        \
-       regex-src/fake/stdlib.h
+       patches/tar-1.12.patch
 
 $(ACINCLUDE_M4): $(ACINCLUDE_M4_DEPS)
        @-rm -f $@
@@ -109,7 +86,6 @@ lint:
        (cd common-src; make lint)
        (cd oldrecover-src; make lint)
        (cd recover-src; make lint)
-       (cd regex-src; make lint)
        (cd restore-src; make lint)
        (cd server-src; make lint)
        (cd tape-src; make lint)
index 598bac208b4c89075d23c826cfc35a62321e304f..1679e3c85ebad42c0fbe63692dd1361a305afe06 100644 (file)
@@ -43,6 +43,41 @@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
        ChangeLog INSTALL NEWS
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+       $(top_srcdir)/config/gnulib/absolute-header.m4 \
+       $(top_srcdir)/config/gnulib/alloca.m4 \
+       $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/eoverflow.m4 \
+       $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/getaddrinfo.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-cache.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-common.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-comp.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-tool.m4 \
+       $(top_srcdir)/config/gnulib/inet_ntop.m4 \
+       $(top_srcdir)/config/gnulib/intmax_t.m4 \
+       $(top_srcdir)/config/gnulib/inttypes_h.m4 \
+       $(top_srcdir)/config/gnulib/lib-ld.m4 \
+       $(top_srcdir)/config/gnulib/lib-link.m4 \
+       $(top_srcdir)/config/gnulib/lib-prefix.m4 \
+       $(top_srcdir)/config/gnulib/lock.m4 \
+       $(top_srcdir)/config/gnulib/longdouble.m4 \
+       $(top_srcdir)/config/gnulib/longlong.m4 \
+       $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
+       $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \
+       $(top_srcdir)/config/gnulib/size_max.m4 \
+       $(top_srcdir)/config/gnulib/snprintf.m4 \
+       $(top_srcdir)/config/gnulib/socklen.m4 \
+       $(top_srcdir)/config/gnulib/sockpfaf.m4 \
+       $(top_srcdir)/config/gnulib/stdbool.m4 \
+       $(top_srcdir)/config/gnulib/stdint_h.m4 \
+       $(top_srcdir)/config/gnulib/strdup.m4 \
+       $(top_srcdir)/config/gnulib/string_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
+       $(top_srcdir)/config/gnulib/vasnprintf.m4 \
+       $(top_srcdir)/config/gnulib/visibility.m4 \
+       $(top_srcdir)/config/gnulib/wchar_t.m4 \
+       $(top_srcdir)/config/gnulib/wint_t.m4 \
+       $(top_srcdir)/config/gnulib/xsize.m4 \
        $(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
@@ -70,9 +105,9 @@ pkgdataDATA_INSTALL = $(INSTALL_DATA)
 DATA = $(pkgdata_DATA)
 ETAGS = etags
 CTAGS = ctags
-DIST_SUBDIRS = config common-src amandad-src tape-src client-src \
-       dumper-src server-src changer-src restore-src recover-src \
-       oldrecover-src amplot man docs example
+DIST_SUBDIRS = gnulib config common-src amandad-src tape-src \
+       client-src dumper-src server-src changer-src restore-src \
+       recover-src oldrecover-src amplot man docs example
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 distdir = $(PACKAGE)-$(VERSION)
 top_distdir = $(distdir)
@@ -84,8 +119,10 @@ DIST_ARCHIVES = $(distdir).tar.gz
 GZIP_ENV = --best
 distuninstallcheck_listfiles = find . -type f -print
 distcleancheck_listfiles = find . -type f -print
+ABSOLUTE_STRING_H = @ABSOLUTE_STRING_H@
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
+ALLOCA_H = @ALLOCA_H@
 AMANDA_DBGDIR = @AMANDA_DBGDIR@
 AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@
 AMANDA_TMPDIR = @AMANDA_TMPDIR@
@@ -100,18 +137,17 @@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@
 AMTAR = @AMTAR@
 AM_CFLAGS = @AM_CFLAGS@
 AR = @AR@
+ARPA_INET_H = @ARPA_INET_H@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
-AWK_VAR_ASSIGNMENT_OPT = @AWK_VAR_ASSIGNMENT_OPT@
 BINARY_OWNER = @BINARY_OWNER@
-BUILD_MAN_PAGES_FALSE = @BUILD_MAN_PAGES_FALSE@
-BUILD_MAN_PAGES_TRUE = @BUILD_MAN_PAGES_TRUE@
 CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
+CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
 CHIO = @CHIO@
 CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
@@ -144,18 +180,40 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
+ENABLE_MANPAGE_BUILD_FALSE = @ENABLE_MANPAGE_BUILD_FALSE@
+ENABLE_MANPAGE_BUILD_TRUE = @ENABLE_MANPAGE_BUILD_TRUE@
+EOVERFLOW = @EOVERFLOW@
+EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@
 EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
+GCC_COMPILER_FALSE = @GCC_COMPILER_FALSE@
+GCC_COMPILER_TRUE = @GCC_COMPILER_TRUE@
 GETCONF = @GETCONF@
+GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@
+GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
 GNUTAR_LISTED_INCREMENTAL_DIRX = @GNUTAR_LISTED_INCREMENTAL_DIRX@
 GREP = @GREP@
 GZIP = @GZIP@
-HAVE_XSLTPROC_FALSE = @HAVE_XSLTPROC_FALSE@
-HAVE_XSLTPROC_TRUE = @HAVE_XSLTPROC_TRUE@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRNDUP = @HAVE_STRNDUP@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE__BOOL = @HAVE__BOOL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -164,22 +222,31 @@ LDFLAGS = @LDFLAGS@
 LEX = @LEX@
 LEXLIB = @LEXLIB@
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
+LIBPTH = @LIBPTH@
+LIBPTH_PREFIX = @LIBPTH_PREFIX@
 LIBS = @LIBS@
+LIBTHREAD = @LIBTHREAD@
 LIBTOOL = @LIBTOOL@
 LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LL_FMT = @LL_FMT@
 LL_RFMT = @LL_RFMT@
 LN_S = @LN_S@
 LTALLOCA = @LTALLOCA@
+LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
 LTLIBOBJS = @LTLIBOBJS@
+LTLIBPTH = @LTLIBPTH@
+LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
 MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@
 MCUTIL = @MCUTIL@
+MKDIR_P = @MKDIR_P@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
+NETINET_IN_H = @NETINET_IN_H@
 OBJEXT = @OBJEXT@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -193,6 +260,9 @@ PERL = @PERL@
 PRINT = @PRINT@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
+REPLACE_STRCASECMP = @REPLACE_STRCASECMP@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRSTR = @REPLACE_STRSTR@
 RESTORE = @RESTORE@
 SAMBA_CLIENT = @SAMBA_CLIENT@
 SERVICE_SUFFIX = @SERVICE_SUFFIX@
@@ -201,7 +271,10 @@ SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 SNAPSHOT_STAMP = @SNAPSHOT_STAMP@
 SORT = @SORT@
+SSH = @SSH@
+STDBOOL_H = @STDBOOL_H@
 STRIP = @STRIP@
+SYS_SOCKET_H = @SYS_SOCKET_H@
 USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@
 VDUMP = @VDUMP@
 VERSION = @VERSION@
@@ -240,6 +313,7 @@ WANT_TAPE_TRUE = @WANT_TAPE_TRUE@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
 XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
 YACC = @YACC@
 ac_c = @ac_c@
 ac_ct_AR = @ac_ct_AR@
@@ -266,6 +340,8 @@ build_os = @build_os@
 build_vendor = @build_vendor@
 datadir = @datadir@
 exec_prefix = @exec_prefix@
+gl_LIBOBJS = @gl_LIBOBJS@
+gl_LTLIBOBJS = @gl_LTLIBOBJS@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -294,7 +370,8 @@ AUTOMAKE_OPTIONS = 1.4 foreign
 ACINCLUDE_M4 = $(srcdir)/acinclude.m4
 ACINCLUDE_M4I = $(srcdir)/config/acinclude.m4i
 LIBTOOL_M4I = $(srcdir)/config/libtool.m4i
-ACINCLUDE_M4_DEPS = $(ACINCLUDE_M4I) $(LIBTOOL_M4I)
+GNULIB_M4I = $(srcdir)/config/gnulib.m4i
+ACINCLUDE_M4_DEPS = $(GNULIB_M4I) $(ACINCLUDE_M4I) $(LIBTOOL_M4I)
 @WANT_CLIENT_TRUE@CLIENT_SUBDIRS = client-src dumper-src
 @WANT_TAPE_TRUE@TAPE_SUBDIRS = tape-src
 @WANT_SERVER_TRUE@SERVER_SUBDIRS = server-src changer-src
@@ -303,6 +380,7 @@ ACINCLUDE_M4_DEPS = $(ACINCLUDE_M4I) $(LIBTOOL_M4I)
 @WANT_AMPLOT_TRUE@PLOT_SUBDIRS = amplot
 # order is significant, don't change it arbitrarily
 SUBDIRS = \
+       gnulib \
        config \
        common-src \
        amandad-src \
@@ -316,9 +394,7 @@ SUBDIRS = \
 
 pkgdata_DATA = \
        ReleaseNotes                    \
-       COPYRIGHT                       \
-       COPYRIGHT-APACHE                \
-       COPYRIGHT-REGEX
+       COPYRIGHT
 
 EXTRA_DIST = $(SNAPSHOT_STAMP) \
        $(pkgdata_DATA)                 \
@@ -341,30 +417,7 @@ EXTRA_DIST = $(SNAPSHOT_STAMP) \
        contrib/gsc/ucfggsc.c           \
        patches/regex-3.6alpha.patch    \
        patches/samba-largefs.patch     \
-       patches/tar-1.12.patch          \
-       regex-src/COPYRIGHT             \
-       regex-src/Makefile              \
-       regex-src/README                \
-       regex-src/WHATSNEW              \
-       regex-src/cclass.h              \
-       regex-src/cname.h               \
-       regex-src/debug.c               \
-       regex-src/engine.c              \
-       regex-src/main.c                \
-       regex-src/mkh                   \
-       regex-src/regcomp.c             \
-       regex-src/regerror.c            \
-       regex-src/regex.3               \
-       regex-src/regex.7               \
-       regex-src/regex2.h              \
-       regex-src/regexec.c             \
-       regex-src/regfree.c             \
-       regex-src/split.c               \
-       regex-src/tests                 \
-       regex-src/utils.h               \
-       regex-src/fake/limits.h         \
-       regex-src/fake/memmove.c        \
-       regex-src/fake/stdlib.h
+       patches/tar-1.12.patch
 
 CONFIG_STATUS = config.status
 all: all-recursive
@@ -566,7 +619,7 @@ distclean-tags:
 distdir: $(DISTFILES)
        $(am__remove_distdir)
        mkdir $(distdir)
-       $(mkdir_p) $(distdir)/amplot $(distdir)/changer-src $(distdir)/client-src $(distdir)/common-src $(distdir)/contrib $(distdir)/contrib/gsc $(distdir)/dumper-src $(distdir)/example $(distdir)/patches $(distdir)/regex-src $(distdir)/regex-src/fake $(distdir)/server-src
+       $(mkdir_p) $(distdir)/amplot $(distdir)/changer-src $(distdir)/client-src $(distdir)/common-src $(distdir)/config/gnulib $(distdir)/contrib $(distdir)/contrib/gsc $(distdir)/dumper-src $(distdir)/example $(distdir)/patches $(distdir)/server-src
        @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
        list='$(DISTFILES)'; for file in $$list; do \
@@ -826,7 +879,6 @@ lint:
        (cd common-src; make lint)
        (cd oldrecover-src; make lint)
        (cd recover-src; make lint)
-       (cd regex-src; make lint)
        (cd restore-src; make lint)
        (cd server-src; make lint)
        (cd tape-src; make lint)
diff --git a/NEWS b/NEWS
index f88b5e89767570ecdad0738ae290e21ef7283418..2fb19021f21cf9c0ef85571abe61a0e275e6a39b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,9 +1,40 @@
+Changes in release 2.5.2p1
+
+   * Many bugs fixed
+         o Many IPv6 bugs
+               + missing sockaddr_storage
+               + missing AI_V4MAPPED and AI_ALL
+               + compare of IPv4 and IPv6 v4mapped address.
+               + (bsd/bsdudp): server use two sockets,
+                  one for IPv4 and one for IPv6
+         o amflush/autoflush
+         o chown/chmod
+         o amstatus
+         o compilation on some platform
+         o others small bug
+
+Changes in release 2.5.2
+
+   * Many bugs fixed and code cleanup
+   * krb5 auth is working
+   * Works with IPv6 address
+   * Amanda configuration file changes
+         o amanda.conf changes
+               + debugging is enabled in the config file
+                 see all debug_* config option
+               + tapetype 'readblocksize', if maxtapeblocksize is set too
+                 larger for your hardware
+   * Amanda command changes
+         o amadmin: new 'holding list' and 'holding delete' subcommand.
+
 Changes in release 2.5.1p3
+
    * Many bugs fixed
    * amrecover improve handling of not ascii filename in index.
    * Works with tar-1.16 and exit status of 1.
    * Can define a LASTSLOT in a chg-disk config file.
 
+
 Changes in release 2.5.1p2
 
    * Many bugs fixed
index 664194b2dcc50be1fd5d2d937107d85ded3d9604..47d9399bd864a8a7c7b2dc482b0cf0ef5143b58a 100644 (file)
@@ -1,3 +1,18 @@
+               Release Notes for amanda-2.5.2
+
+IPv6
+
+  IPv6 support is enabled by default if your OS support it, if your OS is
+  not working correctly with IPV6, you can disable it at configure time
+  with '--without-ipv6'.
+
+readblocksize
+
+  This option is useful only if you configured amanda with a big
+  '--with-maxtapeblocksize' and your hardware can't works with big block
+  size.
+  
+
                Release Notes for amanda-2.5.1
 
 
index b55bdb06f702cd7b50058c90657ea8a878b4f554..0451d2afaff000b7bc8c4267b099b42bfc80c71f 100644 (file)
-dnl Check if the compiler can handle unsigned long constants, ie 2ul.
-AC_DEFUN([AMANDA_C_UNSIGNED_LONG_CONSTANTS],
-    [
-       AC_CACHE_CHECK(
-           [for working unsigned long constants],
-           amanda_cv_c_unsigned_long_constants,
-           [
-               AC_TRY_COMPILE(
-                   [
-                   ],
-                   [
-                       long l = 1ul;
-                   ],
-                   amanda_cv_c_unsigned_long_constants=yes,
-                   amanda_cv_c_unsigned_long_constants=no
-               )
-           ]
-       )
-       if test "$amanda_cv_c_unsigned_long_constants" = yes; then
-           AC_DEFINE(HAVE_UNSIGNED_LONG_CONSTANTS,1,[Define if the compiler support unsigned long constants. ])
-       fi
-    ]
-)
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+## Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
+## Free Software Foundation, Inc.
+## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+##
+## This file is free software; the Free Software Foundation gives
+## unlimited permission to copy and/or distribute it, with or without
+## modifications, as long as this notice is preserved.
 
-dnl Check for the argument type for shmat() and shmdt()
-AC_DEFUN([AMANDA_FUNC_SHM_ARG_TYPE],
-    [
-       AC_CACHE_CHECK(
-           [for shmdt() argument type],
-           amanda_cv_shmdt_arg_type,
-           [
-               if test "$ac_cv_func_shmget" = yes; then
-                   cat <<EOF >conftest.$ac_ext
-#include "confdefs.h"
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_IPC_H
-# include <sys/ipc.h>
-#endif
-#ifdef HAVE_SYS_SHM_H
-# include <sys/shm.h>
-#endif
+# serial 47 AC_PROG_LIBTOOL
 
-#ifdef __cplusplus
-extern "C" void *shmat(int, void *, int);
-#else
-void *shmat();
-#endif
 
-int main()
-{
-    int i;
-    return 0;
-}
-EOF
-                   ${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext >/dev/null 2>/dev/null
-                   if test $? = 0; then
-                       amanda_cv_shmdt_arg_type=void
-                   else
-                       amanda_cv_shmdt_arg_type=char
-                   fi
-                   rm -f conftest*
-               else
-                   amanda_cv_shmdt_arg_type=nothing
-               fi
-           ]
-       )
-       AC_DEFINE_UNQUOTED(SHM_ARG_TYPE,$amanda_cv_shmdt_arg_type,[Define to type of shmget() function argument. ])
-    ]
-)
+# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
+# -----------------------------------------------------------
+# If this macro is not defined by Autoconf, define it here.
+m4_ifdef([AC_PROVIDE_IFELSE],
+         [],
+         [m4_define([AC_PROVIDE_IFELSE],
+                [m4_ifdef([AC_PROVIDE_$1],
+                          [$2], [$3])])])
 
-dnl Figure out the select() argument type.
-AC_DEFUN([AMANDA_FUNC_SELECT_ARG_TYPE],
-    [
-       AC_CACHE_CHECK(
-           [for select() argument type],
-           amanda_cv_select_arg_type,
-           [
-               rm -f conftest.c
-               cat <<EOF >conftest.$ac_ext
-#include "confdefs.h"
-#ifdef HAVE_SYS_TIME_H
-# include <sys/time.h>
-#endif
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_SELECT_H
-#  include <sys/select.h>
-#endif
-#ifdef HAVE_SYS_SOCKET_H
-#  include <sys/socket.h>
-#endif
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
 
-int main()
-{
-#ifdef FD_SET_POINTER
-       (void)select(0, (fd_set *) 0, (fd_set *) 0, (fd_set *) 0, 0);
-#else
-       (void)select(0, (int *) 0, (int *) 0, (int *) 0, 0);
-#endif
-       return 0;
-}
-EOF
+# AC_PROG_LIBTOOL
+# ---------------
+AC_DEFUN([AC_PROG_LIBTOOL],
+[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
+dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
+dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
+  AC_PROVIDE_IFELSE([AC_PROG_CXX],
+    [AC_LIBTOOL_CXX],
+    [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
+  ])])
+dnl And a similar setup for Fortran 77 support
+  AC_PROVIDE_IFELSE([AC_PROG_F77],
+    [AC_LIBTOOL_F77],
+    [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
+])])
 
-               dnl Figure out the select argument type by first trying to
-               dnl compile with the fd_set argument.  If the compile fails,
-               dnl then we know to use the int.  If it suceeds, then try to
-               dnl use the int.  If the int fails, then use fd_set.  If
-               dnl both suceeed, then do a line count on the number of
-               dnl lines that the compiler spit out, assuming that the
-               dnl compile outputing more lines had more errors.
-               amanda_cv_select_arg_type=no
-               select_compile="${CC-cc} -c $CFLAGS $CPPFLAGS"
-               $select_compile -DFD_SET_POINTER conftest.$ac_ext 1>conftest.fd_set 2>&1
-               if test $? -ne 0; then
-                   amanda_cv_select_arg_type=int
-               fi
-               if test "$amanda_cv_select_arg_type" = no; then
-                   $select_compile conftest.$ac_ext 1>conftest.int 2>&1
-                   if test $? -ne 0; then
-                       amanda_cv_select_arg_type=fd_set
-                   fi
-               fi
-               if test "$amanda_cv_select_arg_type" = no; then
-                   wc_fdset=`wc -l <conftest.fd_set`
-                   wc_int=`wc -l <conftest.int`
-                   if test "$wc_fdset" -le "$wc_int"; then
-                       amanda_cv_select_arg_type=fd_set
-                   else
-                       amanda_cv_select_arg_type=int
-                   fi
-               fi
-               rm -f conftest*
-           ]
-       )
-       AC_DEFINE_UNQUOTED(SELECT_ARG_TYPE,$amanda_cv_select_arg_type,[Define to type of select arguments. ])
-    ]
-)
+dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
+dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
+dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
+  AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+    [AC_LIBTOOL_GCJ],
+    [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+      [AC_LIBTOOL_GCJ],
+      [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
+       [AC_LIBTOOL_GCJ],
+      [ifdef([AC_PROG_GCJ],
+            [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
+       ifdef([A][M_PROG_GCJ],
+            [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
+       ifdef([LT_AC_PROG_GCJ],
+            [define([LT_AC_PROG_GCJ],
+               defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
+])])# AC_PROG_LIBTOOL
 
-dnl Check if setsockopt can use the SO_SNDTIMEO option.
-dnl This defines HAVE_SO_SNDTIMEO if setsockopt works
-dnl with SO_SNDTIMEO.
-AC_DEFUN([AMANDA_FUNC_SETSOCKOPT_SO_SNDTIMEO],
-    [
-       AC_CACHE_CHECK(
-           [for setsockopt SO_SNDTIMEO option],
-           amanda_cv_setsockopt_SO_SNDTIMEO,
-           [
-               AC_TRY_RUN(
-                   [
-#include <sys/types.h>
-#include <sys/socket.h>
-#ifdef TIME_WITH_SYS_TIME
-#  include <sys/time.h>
-#  include <time.h>
-#else
-#  ifdef HAVE_SYS_TIME_H
-#    include <sys/time.h>
-#  else
-#    include <time.h>
-#  endif
-#endif
 
-main() {
-#ifdef SO_SNDTIMEO
-    int sock = socket(AF_INET, SOCK_STREAM, 0);
-    struct timeval timeout;
-    timeout.tv_sec = 1;
-    timeout.tv_usec = 0;
-    return (setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO,
-             (void *)&timeout, sizeof(timeout)));
-#else
-    return -1;
-#endif
-}
-                   ],
-                   amanda_cv_setsockopt_SO_SNDTIMEO=yes,
-                   amanda_cv_setsockopt_SO_SNDTIMEO=no,
-                   amanda_cv_setsockopt_SO_SNDTIMEO=no
-               )
-           ]
-       )
-       if test "$amanda_cv_setsockopt_SO_SNDTIMEO" = yes; then
-           AC_DEFINE(HAVE_SO_SNDTIMEO,1,[Define if SO_SNDTIMEO is available. ])
-       fi
-    ]
-)
-
-dnl Find out how {awk,gawk,nawk,mawk} likes to assign variables, if it
-dnl can do so at all.
-AC_DEFUN([AMANDA_PROG_AWK_VAR],
-    [
-       AC_REQUIRE([AC_PROG_AWK])
-       AC_CACHE_CHECK(
-           [for $AWK command line variable assignment],
-           amanda_cv_awk_var_assignment,
-           [
-               echo 'BEGIN{print i; exit}' > conftest.awk
-               result=`$AWK -f conftest.awk i=xx | wc -c`
-               if test "$result" -le 1; then
-                   result=`$AWK -f conftest.awk -v i=xx | wc -c`
-                   if test "$result" -le 1; then
-                       amanda_cv_awk_var_assignment=no
-                   else
-                       amanda_cv_awk_var_assignment="yes with -v"
-                   fi
-               else
-                   amanda_cv_awk_var_assignment="yes"
-               fi
-               rm -fr conftest.awk
-           ]
-       )
-       AWK_VAR_ASSIGNMENT_OPT=
-       case "$amanda_cv_awk_var_assignment" in
-           no)
-               HAVE_AWK_WITH_VAR=no
-               ;;
-           yes)
-               HAVE_AWK_WITH_VAR=yes
-               ;;
-           "yes with -v")
-               HAVE_AWK_WITH_VAR=yes
-               AWK_VAR_ASSIGNMENT_OPT=-v
-               ;;
-       esac
-       AC_SUBST(AWK_VAR_ASSIGNMENT_OPT)
-    ]
-)      
-
-dnl Check for the one or two argument version of gettimeofday.
-AC_DEFUN([AMANDA_FUNC_GETTIMEOFDAY_ARGS],
-    [
-       AC_REQUIRE([AC_HEADER_TIME])
-       AC_CACHE_CHECK(
-           [for gettimeofday number of arguments],
-           amanda_cv_gettimeofday_args,
-           [
-               AC_TRY_COMPILE(
-                   [
-#ifdef TIME_WITH_SYS_TIME
-#  include <sys/time.h>
-#  include <time.h>
-#else
-#  ifdef HAVE_SYS_TIME_H
-#    include <sys/time.h>
-#  else
-#    include <time.h>
-#  endif
-#endif
-                   ],
-                   [
-                       struct timeval val;
-                       struct timezone zone;
-                       gettimeofday(&val, &zone);
-                   ],
-                   amanda_cv_gettimeofday_args=2,
-                   amanda_cv_gettimeofday_args=1
-               )
-           ]
-       )
-       if test "$amanda_cv_gettimeofday_args" = 2; then
-           AC_DEFINE(HAVE_TWO_ARG_GETTIMEOFDAY,1,[Define if gettimeofday takes two arguments. ])
-       fi
-    ]
-)
+# _AC_PROG_LIBTOOL
+# ----------------
+AC_DEFUN([_AC_PROG_LIBTOOL],
+[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
 
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
 
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
 
-dnl Check if the compiler understands volatile.
-AC_DEFUN([AMANDA_C_VOLATILE],
-    [
-       AC_CACHE_CHECK(
-           [for working volatile],
-           amanda_cv_c_volatile,
-           [
-               AC_TRY_COMPILE(,
-                   [
-                       volatile int aaa = 0;
-                   ],
-                   amanda_cv_c_volatile=yes,
-                   amanda_cv_c_volatile=no
-               )
-           ]
-       )
-       if test $amanda_cv_c_volatile = no; then
-           AC_DEFINE(volatile, [],[Define to empty if the compiler does not support volatile. ])
-       fi
-    ]
-)
+# Prevent multiple expansion
+define([AC_PROG_LIBTOOL], [])
+])# _AC_PROG_LIBTOOL
 
 
-dnl Check for if pid_t is a long, int, or short.
-AC_DEFUN([AMANDA_TYPE_PID_T],
-    [
-       AC_REQUIRE([AC_TYPE_PID_T])
-       AC_CACHE_CHECK([for pid_t type], amanda_cv_pid_type,
-           [
-               amanda_cv_pid_type=unknown
-               if test "$ac_cv_type_pid_t" = no; then
-                   amanda_cv_pid_type=int
-               fi
-               for TEST_amanda_cv_pid_type in long short int; do
-                   if test $amanda_cv_pid_type = unknown; then
-                       AC_EGREP_CPP(typedef.*${TEST_amanda_cv_pid_type}.*pid_t,
-                           [
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-                           ],
-                       amanda_cv_pid_type=$TEST_amanda_cv_pid_type)
-                   fi
-                   if test $amanda_cv_pid_type = unknown; then
-                       AC_EGREP_CPP(ZZZZ.*${TEST_amanda_cv_pid_type},
-                           [
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#include <stddef.h>
-#endif
-                               ZZZZ pid_t
-                       ],
-                       amanda_cv_pid_type=$TEST_amanda_cv_pid_type)
-                   fi
-               done
-               if test $amanda_cv_pid_type = unknown; then
-                   amanda_cv_pid_type=int
-               fi
-           ]
-       )
-       case $amanda_cv_pid_type in
-           int)        AC_DEFINE_UNQUOTED(PRINTF_PID_T,"%d",[Define to printf formatting string to print a PID. ]) ;;
-           long)       AC_DEFINE_UNQUOTED(PRINTF_PID_T,"%ld") ;;
-           short)      AC_DEFINE_UNQUOTED(PRINTF_PID_T,"%d") ;;
-       esac
-    ]
-)
+# AC_LIBTOOL_SETUP
+# ----------------
+AC_DEFUN([AC_LIBTOOL_SETUP],
+[AC_PREREQ(2.50)dnl
+AC_REQUIRE([AC_ENABLE_SHARED])dnl
+AC_REQUIRE([AC_ENABLE_STATIC])dnl
+AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_LD])dnl
+AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
+AC_REQUIRE([AC_PROG_NM])dnl
 
+AC_REQUIRE([AC_PROG_LN_S])dnl
+AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
+AC_REQUIRE([AC_OBJEXT])dnl
+AC_REQUIRE([AC_EXEEXT])dnl
 dnl
-dnl
-dnl ICE_CHECK_DECL (FUNCTION, HEADER-FILE...)
-dnl If FUNCTION is available, define `HAVE_FUNCTION'.  If it is declared
-dnl in one of the headers named in the whitespace-separated list 
-dnl HEADER_FILE, define `HAVE_FUNCTION_DECL` (in all capitals).
-dnl
-AC_DEFUN([ICE_CHECK_DECL],
-[
-ice_have_$1=no
-AC_CHECK_FUNCS($1, ice_have_$1=yes)
-if test "${ice_have_$1}" = yes; then
-AC_MSG_CHECKING(for $1 declaration in $2)
-AC_CACHE_VAL(ice_cv_have_$1_decl,
-[
-ice_cv_have_$1_decl=no
-changequote(,)dnl
-ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
-ice_re_word='(^|[^a-zA-Z0-9_])'
-changequote([,])dnl
-for header in $2; do
-# Check for ordinary declaration
-AC_EGREP_HEADER([${ice_re_word}$1[     ]*\(], $header, 
-       ice_cv_have_$1_decl=yes)
-if test "$ice_cv_have_$1_decl" = yes; then
-       break
-fi
-# Check for "fixed" declaration like "getpid _PARAMS((int))"
-AC_EGREP_HEADER([${ice_re_word}$1[     ]*$ice_re_params\(\(], $header, 
-       ice_cv_have_$1_decl=yes)
-if test "$ice_cv_have_$1_decl" = yes; then
-       break
-fi
-done
-])
-AC_MSG_RESULT($ice_cv_have_$1_decl)
-if test "$ice_cv_have_$1_decl" = yes; then
-AC_DEFINE_UNQUOTED([HAVE_]translit($1,[a-z],[A-Z])[_DECL],1,[Define if $1 is declared. ])
-fi
-fi
-])dnl
-dnl Test for the presence of <sys/wait.h>, 'union wait', arg-type of 'wait()'.
-dnl by T.E.Dickey" , Jim Spath <jspath@mail.bcpl.lib.md.us>
-dnl
-dnl     FIXME: These tests should have been in autoconf 1.11!
-dnl
-dnl     Note that we cannot simply grep for 'union wait' in the wait.h file,
-dnl     because some Posix systems turn this on only when a BSD variable is
-dnl     defined. Since I'm trying to do without special defines, I'll live
-dnl     with the default behavior of the include-file.
-dnl
-dnl     I do _2_ compile checks, because we may have union-wait, but the
-dnl     prototype for 'wait()' may want an int.
-dnl
-dnl     Don't use HAVE_UNION_WAIT, because the autoconf documentation implies
-dnl     that if we've got union-wait, we'll automatically use it.
-dnl
-dnl Garrett Wollman adds:
-dnl    The tests described above don't quite do the right thing,
-dnl    since some systems have hacks which allow `union wait' to
-dnl    still work even though `int' is preferred (and generates
-dnl    fewer warnings).  Since all of these systems use prototypes,
-dnl    we can use the prototype of wait(2) to disambiguate them.
-dnl
-dnl Alexandre Oliva adds:
-dnl     A single compile check is enough.  If we don't have union wait,
-dnl     it's obvious that the test will fail, and that we must use int.
-dnl     If we do, the prototype (on STDC systems) and WIFEXITED will tell
-dnl     whether we're supposed to be using union wait instead of int.
-dnl
-AC_DEFUN([CF_WAIT],
-[
-AC_REQUIRE([AC_TYPE_PID_T])
-AC_HAVE_HEADERS(sys/wait.h wait.h)
-AC_CACHE_CHECK([whether wait uses union wait], [cf_cv_arg_union_wait],
-        [AC_TRY_COMPILE([
-#include <sys/types.h>
 
-#if HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#else
-# if HAVE_WAIT_H
-#  include <wait.h>
-# endif
-#endif
+AC_LIBTOOL_SYS_MAX_CMD_LEN
+AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+AC_LIBTOOL_OBJDIR
 
-#ifdef __STDC__
-pid_t wait(union wait *);
-#endif
-], [
-  union wait x; int i;
-  wait(&x); i = WIFEXITED(x)
-], [cf_cv_arg_union_wait=yes], [cf_cv_arg_union_wait=no])])
-if test $cf_cv_arg_union_wait = yes; then
-       AC_DEFINE(WAIT_USES_UNION,1,[Defined if wait() puts the status in a union wait instead of int. ])
-fi
-])dnl
-AC_DEFUN([CF_WAIT_INT],
-[
-AC_REQUIRE([AC_TYPE_PID_T])
-AC_HAVE_HEADERS(sys/wait.h wait.h)
-AC_CACHE_CHECK([whether wait uses int], [cf_cv_arg_int],
-        [AC_TRY_COMPILE([
-#include <sys/types.h>
+AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+_LT_AC_PROG_ECHO_BACKSLASH
 
-#if HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#else
-# if HAVE_WAIT_H
-#  include <wait.h>
-# endif
-#endif
+case $host_os in
+aix3*)
+  # AIX sometimes has problems with the GCC collect2 program.  For some
+  # reason, if we set the COLLECT_NAMES environment variable, the problems
+  # vanish in a puff of smoke.
+  if test "X${COLLECT_NAMES+set}" != Xset; then
+    COLLECT_NAMES=
+    export COLLECT_NAMES
+  fi
+  ;;
+esac
 
-#ifdef __STDC__
-pid_t wait(int *);
-#endif
-], [
-  int x; int i;
-  wait(&x); i = WIFEXITED(x)
-], [cf_cv_arg_int=yes], [cf_cv_arg_int=no])])
-if test $cf_cv_arg_int = yes; then
-        AC_DEFINE(WAIT_USES_INT,1,[Defined if wait() puts the status in a int instead of a union wait. ])
-fi
-])dnl
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='sed -e 1s/^X//'
+[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
 
-dnl @synopsis AX_CREATE_STDINT_H [( HEADER-TO-GENERATE [, HEDERS-TO-CHECK])]
-dnl
-dnl the "ISO C9X: 7.18 Integer types <stdint.h>" section requires the
-dnl existence of an include file <stdint.h> that defines a set of 
-dnl typedefs, especially uint8_t,int32_t,uintptr_t.
-dnl Many older installations will not provide this file, but some will
-dnl have the very same definitions in <inttypes.h>. In other enviroments
-dnl we can use the inet-types in <sys/types.h> which would define the
-dnl typedefs int8_t and u_int8_t respectivly.
-dnl
-dnl This macros will create a local "_stdint.h" or the headerfile given as 
-dnl an argument. In many cases that file will just "#include <stdint.h>" 
-dnl or "#include <inttypes.h>", while in other environments it will provide 
-dnl the set of basic 'stdint's definitions/typedefs: 
-dnl   int8_t,uint8_t,int16_t,uint16_t,int32_t,uint32_t,intptr_t,uintptr_t
-dnl   int_least32_t.. int_fast32_t.. intmax_t
-dnl which may or may not rely on the definitions of other files,
-dnl or using the AC_CHECK_SIZEOF macro to determine the actual
-dnl sizeof each type.
-dnl
-dnl if your header files require the stdint-types you will want to create an
-dnl installable file mylib-int.h that all your other installable header
-dnl may include. So if you have a library package named "mylib", just use
-dnl      AX_CREATE_STDINT_H(mylib-int.h) 
-dnl in configure.ac and go to install that very header file in Makefile.am
-dnl along with the other headers (mylib.h) - and the mylib-specific headers
-dnl can simply use "#include <mylib-int.h>" to obtain the stdint-types.
-dnl
-dnl Remember, if the system already had a valid <stdint.h>, the generated
-dnl file will include it directly. No need for fuzzy HAVE_STDINT_H things...
-dnl
-dnl @, (status: used on new platforms) (see http://ac-archive.sf.net/gstdint/)
-dnl @version Id: ax_create_stdint_h.m4,v 1.5 2005/01/06 18:27:27 guidod Exp
-dnl @author  Guido Draheim <guidod@gmx.de> 
-
-AC_DEFUN([AX_CHECK_DATA_MODEL],[
-   AC_CHECK_SIZEOF(char)
-   AC_CHECK_SIZEOF(short)
-   AC_CHECK_SIZEOF(int)
-   AC_CHECK_SIZEOF(long)
-   AC_CHECK_SIZEOF(void*)
-   ac_cv_char_data_model=""
-   ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_char"
-   ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_short"
-   ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_int"
-   ac_cv_long_data_model=""
-   ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_int"
-   ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_long"
-   ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_voidp"
-   AC_MSG_CHECKING([data model])
-   case "$ac_cv_char_data_model/$ac_cv_long_data_model" in
-    122/242)     ac_cv_data_model="IP16"  ; n="standard 16bit machine" ;;
-    122/244)     ac_cv_data_model="LP32"  ; n="standard 32bit machine" ;;
-    122/*)       ac_cv_data_model="i16"   ; n="unusual int16 model" ;;
-    124/444)     ac_cv_data_model="ILP32" ; n="standard 32bit unixish" ;;
-    124/488)     ac_cv_data_model="LP64"  ; n="standard 64bit unixish" ;;
-    124/448)     ac_cv_data_model="LLP64" ; n="unusual 64bit unixish" ;;
-    124/*)       ac_cv_data_model="i32"   ; n="unusual int32 model" ;;
-    128/888)     ac_cv_data_model="ILP64" ; n="unusual 64bit numeric" ;;
-    128/*)       ac_cv_data_model="i64"   ; n="unusual int64 model" ;;         
-    222/*2)      ac_cv_data_model="DSP16" ; n="strict 16bit dsptype" ;;
-    333/*3)      ac_cv_data_model="DSP24" ; n="strict 24bit dsptype" ;;
-    444/*4)      ac_cv_data_model="DSP32" ; n="strict 32bit dsptype" ;;
-    666/*6)      ac_cv_data_model="DSP48" ; n="strict 48bit dsptype" ;;
-    888/*8)      ac_cv_data_model="DSP64" ; n="strict 64bit dsptype" ;;
-    222/*|333/*|444/*|666/*|888/*) :
-                 ac_cv_data_model="iDSP"  ; n="unusual dsptype" ;;
-     *)          ac_cv_data_model="none"  ; n="very unusual model" ;;
-   esac
-   AC_MSG_RESULT([$ac_cv_data_model ($ac_cv_long_data_model, $n)])
-])
+# Same as above, but do not quote variable references.
+[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
 
-dnl AX_CHECK_HEADER_STDINT_X([HEADERLIST][,ACTION-IF])
-AC_DEFUN([AX_CHECK_HEADER_STDINT_X],[
-AC_CACHE_CHECK([for stdint uintptr_t], [ac_cv_header_stdint_x],[
- ac_cv_header_stdint_x="" # the 1997 typedefs (inttypes.h)
-  AC_MSG_RESULT([(..)])
-  for i in m4_ifval([$1],[$1],[stdint.h inttypes.h sys/inttypes.h]) ; do
-   unset ac_cv_type_uintptr_t 
-   unset ac_cv_type_uint64_t
-   AC_CHECK_TYPE(uintptr_t,[ac_cv_header_stdint_x=$i],continue,[#include <$i>])
-   AC_CHECK_TYPE(uint64_t,[and64="/uint64_t"],[and64=""],[#include<$i>])
-   m4_ifvaln([$1],[$1]) break
-  done
-  AC_MSG_CHECKING([for stdint uintptr_t])
- ])
-])
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
 
-AC_DEFUN([AX_CHECK_HEADER_STDINT_O],[
-AC_CACHE_CHECK([for stdint uint32_t], [ac_cv_header_stdint_o],[
- ac_cv_header_stdint_o="" # the 1995 typedefs (sys/inttypes.h)
-  AC_MSG_RESULT([(..)])
-  for i in m4_ifval([$1],[$1],[inttypes.h sys/inttypes.h stdint.h]) ; do
-   unset ac_cv_type_uint32_t
-   unset ac_cv_type_uint64_t
-   AC_CHECK_TYPE(uint32_t,[ac_cv_header_stdint_o=$i],continue,[#include <$i>])
-   AC_CHECK_TYPE(uint64_t,[and64="/uint64_t"],[and64=""],[#include<$i>])
-   m4_ifvaln([$1],[$1]) break
-   break;
-  done
-  AC_MSG_CHECKING([for stdint uint32_t])
- ])
-])
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
 
-AC_DEFUN([AX_CHECK_HEADER_STDINT_U],[
-AC_CACHE_CHECK([for stdint u_int32_t], [ac_cv_header_stdint_u],[
- ac_cv_header_stdint_u="" # the BSD typedefs (sys/types.h)
-  AC_MSG_RESULT([(..)])
-  for i in m4_ifval([$1],[$1],[sys/types.h inttypes.h sys/inttypes.h]) ; do
-   unset ac_cv_type_u_int32_t
-   unset ac_cv_type_u_int64_t
-   AC_CHECK_TYPE(u_int32_t,[ac_cv_header_stdint_u=$i],continue,[#include <$i>])
-   AC_CHECK_TYPE(u_int64_t,[and64="/u_int64_t"],[and64=""],[#include<$i>])
-   m4_ifvaln([$1],[$1]) break
-   break;
-  done
-  AC_MSG_CHECKING([for stdint u_int32_t])
- ])
-])
+# Constants:
+rm="rm -f"
 
-AC_DEFUN([AX_CREATE_STDINT_H],
-[# ------ AX CREATE STDINT H -------------------------------------
-AC_MSG_CHECKING([for stdint types])
-ac_stdint_h=`echo ifelse($1, , _stdint.h, $1)`
-# try to shortcircuit - if the default include path of the compiler
-# can find a "stdint.h" header then we assume that all compilers can.
-AC_CACHE_VAL([ac_cv_header_stdint_t],[
-old_CXXFLAGS="$CXXFLAGS" ; CXXFLAGS=""
-old_CPPFLAGS="$CPPFLAGS" ; CPPFLAGS=""
-old_CFLAGS="$CFLAGS"     ; CFLAGS=""
-AC_TRY_COMPILE([#include <stdint.h>],[int_least32_t v = 0;],
-[ac_cv_stdint_result="(assuming C99 compatible system)"
- ac_cv_header_stdint_t="stdint.h"; ],
-[ac_cv_header_stdint_t=""])
-CXXFLAGS="$old_CXXFLAGS"
-CPPFLAGS="$old_CPPFLAGS"
-CFLAGS="$old_CFLAGS" ])
+# Global variables:
+default_ofile=libtool
+can_build_shared=yes
 
-v="... $ac_cv_header_stdint_h"
-if test "$ac_stdint_h" = "stdint.h" ; then
- AC_MSG_RESULT([(are you sure you want them in ./stdint.h?)])
-elif test "$ac_stdint_h" = "inttypes.h" ; then
- AC_MSG_RESULT([(are you sure you want them in ./inttypes.h?)])
-elif test "_$ac_cv_header_stdint_t" = "_" ; then
- AC_MSG_RESULT([(putting them into $ac_stdint_h)$v])
-else
- ac_cv_header_stdint="$ac_cv_header_stdint_t"
- AC_MSG_RESULT([$ac_cv_header_stdint (shortcircuit)])
-fi
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+ltmain="$ac_aux_dir/ltmain.sh"
+ofile="$default_ofile"
+with_gnu_ld="$lt_cv_prog_gnu_ld"
 
-if test "_$ac_cv_header_stdint_t" = "_" ; then # can not shortcircuit..
+AC_CHECK_TOOL(AR, ar, false)
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+AC_CHECK_TOOL(STRIP, strip, :)
 
-dnl .....intro message done, now do a few system checks.....
-dnl btw, all old CHECK_TYPE macros do automatically "DEFINE" a type, 
-dnl therefore we use the autoconf implementation detail CHECK_TYPE_NEW 
-dnl instead that is triggered with 3 or more arguments (see types.m4)
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
 
-inttype_headers=`echo $2 | sed -e 's/,/ /g'`
+# Set sane defaults for various variables
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+test -z "$AS" && AS=as
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+test -z "$LD" && LD=ld
+test -z "$LN_S" && LN_S="ln -s"
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+test -z "$NM" && NM=nm
+test -z "$SED" && SED=sed
+test -z "$OBJDUMP" && OBJDUMP=objdump
+test -z "$RANLIB" && RANLIB=:
+test -z "$STRIP" && STRIP=:
+test -z "$ac_objext" && ac_objext=o
 
-ac_cv_stdint_result="(no helpful system typedefs seen)"
-AX_CHECK_HEADER_STDINT_X(dnl
-   stdint.h inttypes.h sys/inttypes.h $inttype_headers,
-   ac_cv_stdint_result="(seen uintptr_t$and64 in $i)")
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
 
-if test "_$ac_cv_header_stdint_x" = "_" ; then
-AX_CHECK_HEADER_STDINT_O(dnl,
-   inttypes.h sys/inttypes.h stdint.h $inttype_headers,
-   ac_cv_stdint_result="(seen uint32_t$and64 in $i)")
+if test -n "$RANLIB"; then
+  case $host_os in
+  openbsd*)
+    old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
+    ;;
+  *)
+    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
 fi
 
-if test "_$ac_cv_header_stdint_x" = "_" ; then
-if test "_$ac_cv_header_stdint_o" = "_" ; then
-AX_CHECK_HEADER_STDINT_U(dnl,
-   sys/types.h inttypes.h sys/inttypes.h $inttype_headers,
-   ac_cv_stdint_result="(seen u_int32_t$and64 in $i)")
-fi fi
+_LT_CC_BASENAME([$compiler])
 
-dnl if there was no good C99 header file, do some typedef checks...
-if test "_$ac_cv_header_stdint_x" = "_" ; then
-   AC_MSG_CHECKING([for stdint datatype model])
-   AC_MSG_RESULT([(..)])
-   AX_CHECK_DATA_MODEL
-fi
+# Only perform the check for file, if the check method requires it
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    AC_PATH_MAGIC
+  fi
+  ;;
+esac
 
-if test "_$ac_cv_header_stdint_x" != "_" ; then
-   ac_cv_header_stdint="$ac_cv_header_stdint_x"
-elif  test "_$ac_cv_header_stdint_o" != "_" ; then
-   ac_cv_header_stdint="$ac_cv_header_stdint_o"
-elif  test "_$ac_cv_header_stdint_u" != "_" ; then
-   ac_cv_header_stdint="$ac_cv_header_stdint_u"
-else
-   ac_cv_header_stdint="stddef.h"
-fi
+AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
+enable_win32_dll=yes, enable_win32_dll=no)
 
-AC_MSG_CHECKING([for extra inttypes in chosen header])
-AC_MSG_RESULT([($ac_cv_header_stdint)])
-dnl see if int_least and int_fast types are present in _this_ header.
-unset ac_cv_type_int_least32_t
-unset ac_cv_type_int_fast32_t
-AC_CHECK_TYPE(int_least32_t,,,[#include <$ac_cv_header_stdint>])
-AC_CHECK_TYPE(int_fast32_t,,,[#include<$ac_cv_header_stdint>])
-AC_CHECK_TYPE(intmax_t,,,[#include <$ac_cv_header_stdint>])
+AC_ARG_ENABLE([libtool-lock],
+    [AC_HELP_STRING([--disable-libtool-lock],
+       [avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
 
-fi # shortcircut to system "stdint.h"
-# ------------------ PREPARE VARIABLES ------------------------------
-if test "$GCC" = "yes" ; then
-ac_cv_stdint_message="using gnu compiler "`$CC --version | head -1` 
-else
-ac_cv_stdint_message="using $CC"
-fi
+AC_ARG_WITH([pic],
+    [AC_HELP_STRING([--with-pic],
+       [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+    [pic_mode="$withval"],
+    [pic_mode=default])
+test -z "$pic_mode" && pic_mode=default
 
-AC_MSG_RESULT([make use of $ac_cv_header_stdint in $ac_stdint_h dnl
-$ac_cv_stdint_result])
+# Use C for the default configuration in the libtool script
+tagname=
+AC_LIBTOOL_LANG_C_CONFIG
+_LT_AC_TAGCONFIG
+])# AC_LIBTOOL_SETUP
 
-dnl -----------------------------------------------------------------
-# ----------------- DONE inttypes.h checks START header -------------
-AC_CONFIG_COMMANDS([$ac_stdint_h],[
-AC_MSG_NOTICE(creating $ac_stdint_h : $_ac_stdint_h)
-ac_stdint=$tmp/_stdint.h
 
-echo "#ifndef" $_ac_stdint_h >$ac_stdint
-echo "#define" $_ac_stdint_h "1" >>$ac_stdint
-echo "#ifndef" _GENERATED_STDINT_H >>$ac_stdint
-echo "#define" _GENERATED_STDINT_H '"'$PACKAGE $VERSION'"' >>$ac_stdint
-echo "/* generated $ac_cv_stdint_message */" >>$ac_stdint
-if test "_$ac_cv_header_stdint_t" != "_" ; then 
-echo "#define _STDINT_HAVE_STDINT_H" "1" >>$ac_stdint
-echo "#include <stdint.h>" >>$ac_stdint
-echo "#endif" >>$ac_stdint
-echo "#endif" >>$ac_stdint
-else
+# _LT_AC_SYS_COMPILER
+# -------------------
+AC_DEFUN([_LT_AC_SYS_COMPILER],
+[AC_REQUIRE([AC_PROG_CC])dnl
 
-cat >>$ac_stdint <<STDINT_EOF
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
 
-/* ................... shortcircuit part ........................... */
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])# _LT_AC_SYS_COMPILER
 
-#if defined HAVE_STDINT_H || defined _STDINT_HAVE_STDINT_H
-#include <stdint.h>
-#else
-#include <stddef.h>
 
-/* .................... configured part ............................ */
+# _LT_CC_BASENAME(CC)
+# -------------------
+# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
+AC_DEFUN([_LT_CC_BASENAME],
+[for cc_temp in $1""; do
+  case $cc_temp in
+    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+])
 
-STDINT_EOF
 
-echo "/* whether we have a C99 compatible stdint header file */" >>$ac_stdint
-if test "_$ac_cv_header_stdint_x" != "_" ; then
-  ac_header="$ac_cv_header_stdint_x"
-  echo "#define _STDINT_HEADER_INTPTR" '"'"$ac_header"'"' >>$ac_stdint
-else
-  echo "/* #undef _STDINT_HEADER_INTPTR */" >>$ac_stdint
-fi
+# _LT_COMPILER_BOILERPLATE
+# ------------------------
+# Check for compiler boilerplate output or warnings with
+# the simple compiler test code.
+AC_DEFUN([_LT_COMPILER_BOILERPLATE],
+[ac_outfile=conftest.$ac_objext
+printf "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$rm conftest*
+])# _LT_COMPILER_BOILERPLATE
 
-echo "/* whether we have a C96 compatible inttypes header file */" >>$ac_stdint
-if  test "_$ac_cv_header_stdint_o" != "_" ; then
-  ac_header="$ac_cv_header_stdint_o"
-  echo "#define _STDINT_HEADER_UINT32" '"'"$ac_header"'"' >>$ac_stdint
-else
-  echo "/* #undef _STDINT_HEADER_UINT32 */" >>$ac_stdint
-fi
 
-echo "/* whether we have a BSD compatible inet types header */" >>$ac_stdint
-if  test "_$ac_cv_header_stdint_u" != "_" ; then
-  ac_header="$ac_cv_header_stdint_u"
-  echo "#define _STDINT_HEADER_U_INT32" '"'"$ac_header"'"' >>$ac_stdint
-else
-  echo "/* #undef _STDINT_HEADER_U_INT32 */" >>$ac_stdint
-fi
+# _LT_LINKER_BOILERPLATE
+# ----------------------
+# Check for linker boilerplate output or warnings with
+# the simple link test code.
+AC_DEFUN([_LT_LINKER_BOILERPLATE],
+[ac_outfile=conftest.$ac_objext
+printf "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$rm conftest*
+])# _LT_LINKER_BOILERPLATE
 
-echo "" >>$ac_stdint
 
-if test "_$ac_header" != "_" ; then if test "$ac_header" != "stddef.h" ; then
-  echo "#include <$ac_header>" >>$ac_stdint
-  echo "" >>$ac_stdint
-fi fi
+# _LT_AC_SYS_LIBPATH_AIX
+# ----------------------
+# Links a minimal program and checks the executable
+# for the system default hardcoded library path. In most cases,
+# this is /usr/lib:/lib, but when the MPI compilers are used
+# the location of the communication and MPI libs are included too.
+# If we don't find anything, use the default library path according
+# to the aix ld manual.
+AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
+[AC_LINK_IFELSE(AC_LANG_PROGRAM,[
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`; fi],[])
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+])# _LT_AC_SYS_LIBPATH_AIX
 
-echo "/* which 64bit typedef has been found */" >>$ac_stdint
-if test "$ac_cv_type_uint64_t" = "yes" ; then
-echo "#define   _STDINT_HAVE_UINT64_T" "1"  >>$ac_stdint
-else
-echo "/* #undef _STDINT_HAVE_UINT64_T */" >>$ac_stdint
-fi
-if test "$ac_cv_type_u_int64_t" = "yes" ; then
-echo "#define   _STDINT_HAVE_U_INT64_T" "1"  >>$ac_stdint
-else
-echo "/* #undef _STDINT_HAVE_U_INT64_T */" >>$ac_stdint
-fi
-echo "" >>$ac_stdint
 
-echo "/* which type model has been detected */" >>$ac_stdint
-if test "_$ac_cv_char_data_model" != "_" ; then
-echo "#define   _STDINT_CHAR_MODEL" "$ac_cv_char_data_model" >>$ac_stdint
-echo "#define   _STDINT_LONG_MODEL" "$ac_cv_long_data_model" >>$ac_stdint
-else
-echo "/* #undef _STDINT_CHAR_MODEL // skipped */" >>$ac_stdint
-echo "/* #undef _STDINT_LONG_MODEL // skipped */" >>$ac_stdint
-fi
-echo "" >>$ac_stdint
+# _LT_AC_SHELL_INIT(ARG)
+# ----------------------
+AC_DEFUN([_LT_AC_SHELL_INIT],
+[ifdef([AC_DIVERSION_NOTICE],
+            [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
+        [AC_DIVERT_PUSH(NOTICE)])
+$1
+AC_DIVERT_POP
+])# _LT_AC_SHELL_INIT
 
-echo "/* whether int_least types were detected */" >>$ac_stdint
-if test "$ac_cv_type_int_least32_t" = "yes"; then
-echo "#define   _STDINT_HAVE_INT_LEAST32_T" "1"  >>$ac_stdint
-else
-echo "/* #undef _STDINT_HAVE_INT_LEAST32_T */" >>$ac_stdint
-fi
-echo "/* whether int_fast types were detected */" >>$ac_stdint
-if test "$ac_cv_type_int_fast32_t" = "yes"; then
-echo "#define   _STDINT_HAVE_INT_FAST32_T" "1" >>$ac_stdint
+
+# _LT_AC_PROG_ECHO_BACKSLASH
+# --------------------------
+# Add some code to the start of the generated configure script which
+# will find an echo command which doesn't interpret backslashes.
+AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
+[_LT_AC_SHELL_INIT([
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$ECHO in
+X*--fallback-echo)
+  # Remove one level of quotation (which was required for Make).
+  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
+  ;;
+esac
+
+echo=${ECHO-echo}
+if test "X[$]1" = X--no-reexec; then
+  # Discard the --no-reexec flag, and continue.
+  shift
+elif test "X[$]1" = X--fallback-echo; then
+  # Avoid inline document here, it may be left over
+  :
+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
+  # Yippee, $echo works!
+  :
 else
-echo "/* #undef _STDINT_HAVE_INT_FAST32_T */" >>$ac_stdint
+  # Restart under the correct shell.
+  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
 fi
-echo "/* whether intmax_t type was detected */" >>$ac_stdint
-if test "$ac_cv_type_intmax_t" = "yes"; then
-echo "#define   _STDINT_HAVE_INTMAX_T" "1" >>$ac_stdint
-else
-echo "/* #undef _STDINT_HAVE_INTMAX_T */" >>$ac_stdint
+
+if test "X[$]1" = X--fallback-echo; then
+  # used as fallback echo
+  shift
+  cat <<EOF
+[$]*
+EOF
+  exit 0
 fi
-echo "" >>$ac_stdint
 
-  cat >>$ac_stdint <<STDINT_EOF
-/* .................... detections part ............................ */
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
-/* whether we need to define bitspecific types from compiler base types */
-#ifndef _STDINT_HEADER_INTPTR
-#ifndef _STDINT_HEADER_UINT32
-#ifndef _STDINT_HEADER_U_INT32
-#define _STDINT_NEED_INT_MODEL_T
-#else
-#define _STDINT_HAVE_U_INT_TYPES
-#endif
-#endif
-#endif
+if test -z "$ECHO"; then
+if test "X${echo_test_string+set}" != Xset; then
+# find a string as large as possible, as long as the shell can cope with it
+  for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
+    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
+    if (echo_test_string=`eval $cmd`) 2>/dev/null &&
+       echo_test_string=`eval $cmd` &&
+       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
+    then
+      break
+    fi
+  done
+fi
 
-#ifdef _STDINT_HAVE_U_INT_TYPES
-#undef _STDINT_NEED_INT_MODEL_T
-#endif
-
-#ifdef  _STDINT_CHAR_MODEL
-#if     _STDINT_CHAR_MODEL+0 == 122 || _STDINT_CHAR_MODEL+0 == 124
-#ifndef _STDINT_BYTE_MODEL
-#define _STDINT_BYTE_MODEL 12
-#endif
-#endif
-#endif
-
-#ifndef _STDINT_HAVE_INT_LEAST32_T
-#define _STDINT_NEED_INT_LEAST_T
-#endif
-
-#ifndef _STDINT_HAVE_INT_FAST32_T
-#define _STDINT_NEED_INT_FAST_T
-#endif
-
-#ifndef _STDINT_HEADER_INTPTR
-#define _STDINT_NEED_INTPTR_T
-#ifndef _STDINT_HAVE_INTMAX_T
-#define _STDINT_NEED_INTMAX_T
-#endif
-#endif
+if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+   test "X$echo_testing_string" = "X$echo_test_string"; then
+  :
+else
+  # The Solaris, AIX, and Digital Unix default echo programs unquote
+  # backslashes.  This makes it impossible to quote backslashes using
+  #   echo "$something" | sed 's/\\/\\\\/g'
+  #
+  # So, first we look for a working echo in the user's PATH.
 
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for dir in $PATH /usr/ucb; do
+    IFS="$lt_save_ifs"
+    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
+       test "X$echo_testing_string" = "X$echo_test_string"; then
+      echo="$dir/echo"
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
 
-/* .................... definition part ............................ */
+  if test "X$echo" = Xecho; then
+    # We didn't find a better echo, so look for alternatives.
+    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
+       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
+       test "X$echo_testing_string" = "X$echo_test_string"; then
+      # This shell has a builtin print -r that does the trick.
+      echo='print -r'
+    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
+        test "X$CONFIG_SHELL" != X/bin/ksh; then
+      # If we have ksh, try running configure again with it.
+      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+      export ORIGINAL_CONFIG_SHELL
+      CONFIG_SHELL=/bin/ksh
+      export CONFIG_SHELL
+      exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
+    else
+      # Try using printf.
+      echo='printf %s\n'
+      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+        echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+        test "X$echo_testing_string" = "X$echo_test_string"; then
+       # Cool, printf works
+       :
+      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+          test "X$echo_testing_string" = 'X\t' &&
+          echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+          test "X$echo_testing_string" = "X$echo_test_string"; then
+       CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
+       export CONFIG_SHELL
+       SHELL="$CONFIG_SHELL"
+       export SHELL
+       echo="$CONFIG_SHELL [$]0 --fallback-echo"
+      elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+          test "X$echo_testing_string" = 'X\t' &&
+          echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+          test "X$echo_testing_string" = "X$echo_test_string"; then
+       echo="$CONFIG_SHELL [$]0 --fallback-echo"
+      else
+       # maybe with a smaller string...
+       prev=:
 
-/* some system headers have good uint64_t */
-#ifndef _HAVE_UINT64_T
-#if     defined _STDINT_HAVE_UINT64_T  || defined HAVE_UINT64_T
-#define _HAVE_UINT64_T
-#elif   defined _STDINT_HAVE_U_INT64_T || defined HAVE_U_INT64_T
-#define _HAVE_UINT64_T
-typedef u_int64_t uint64_t;
-#endif
-#endif
+       for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
+         if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
+         then
+           break
+         fi
+         prev="$cmd"
+       done
 
-#ifndef _HAVE_UINT64_T
-/* .. here are some common heuristics using compiler runtime specifics */
-#if defined __STDC_VERSION__ && defined __STDC_VERSION__ >= 199901L
-#define _HAVE_UINT64_T
-#define _HAVE_LONGLONG_UINT64_T
-typedef long long int64_t;
-typedef unsigned long long uint64_t;
+       if test "$prev" != 'sed 50q "[$]0"'; then
+         echo_test_string=`eval $prev`
+         export echo_test_string
+         exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
+       else
+         # Oops.  We lost completely, so just stick with echo.
+         echo=echo
+       fi
+      fi
+    fi
+  fi
+fi
+fi
 
-#elif !defined __STRICT_ANSI__
-#if defined _MSC_VER || defined __WATCOMC__ || defined __BORLANDC__
-#define _HAVE_UINT64_T
-typedef __int64 int64_t;
-typedef unsigned __int64 uint64_t;
+# Copy echo and quote the copy suitably for passing to libtool from
+# the Makefile, instead of quoting the original, which is used later.
+ECHO=$echo
+if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
+   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
+fi
 
-#elif defined __GNUC__ || defined __MWERKS__ || defined __ELF__
-/* note: all ELF-systems seem to have loff-support which needs 64-bit */
-#if !defined _NO_LONGLONG
-#define _HAVE_UINT64_T
-#define _HAVE_LONGLONG_UINT64_T
-typedef long long int64_t;
-typedef unsigned long long uint64_t;
-#endif
+AC_SUBST(ECHO)
+])])# _LT_AC_PROG_ECHO_BACKSLASH
 
-#elif defined __alpha || (defined __mips && defined _ABIN32)
-#if !defined _NO_LONGLONG
-#define _HAVE_UINT64_T
-typedef long int64_t;
-typedef unsigned long uint64_t;
-#endif
-  /* compiler/cpu type to define int64_t */
-#endif
-#endif
-#endif
 
-#if defined _STDINT_HAVE_U_INT_TYPES
-/* int8_t int16_t int32_t defined by inet code, redeclare the u_intXX types */
-typedef u_int8_t uint8_t;
-typedef u_int16_t uint16_t;
-typedef u_int32_t uint32_t;
+# _LT_AC_LOCK
+# -----------
+AC_DEFUN([_LT_AC_LOCK],
+[AC_ARG_ENABLE([libtool-lock],
+    [AC_HELP_STRING([--disable-libtool-lock],
+       [avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
 
-/* glibc compatibility */
-#ifndef __int8_t_defined
-#define __int8_t_defined
-#endif
-#endif
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.$ac_objext` in
+    *ELF-32*)
+      HPUX_IA64_MODE="32"
+      ;;
+    *ELF-64*)
+      HPUX_IA64_MODE="64"
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+*-*-irix6*)
+  # Find out which ABI we are using.
+  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+   if test "$lt_cv_prog_gnu_ld" = yes; then
+    case `/usr/bin/file conftest.$ac_objext` in
+    *32-bit*)
+      LD="${LD-ld} -melf32bsmip"
+      ;;
+    *N32*)
+      LD="${LD-ld} -melf32bmipn32"
+      ;;
+    *64-bit*)
+      LD="${LD-ld} -melf64bmip"
+      ;;
+    esac
+   else
+    case `/usr/bin/file conftest.$ac_objext` in
+    *32-bit*)
+      LD="${LD-ld} -32"
+      ;;
+    *N32*)
+      LD="${LD-ld} -n32"
+      ;;
+    *64-bit*)
+      LD="${LD-ld} -64"
+      ;;
+    esac
+   fi
+  fi
+  rm -rf conftest*
+  ;;
 
-#ifdef _STDINT_NEED_INT_MODEL_T
-/* we must guess all the basic types. Apart from byte-adressable system, */
-/* there a few 32-bit-only dsp-systems that we guard with BYTE_MODEL 8-} */
-/* (btw, those nibble-addressable systems are way off, or so we assume) */
+x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.o` in
+    *32-bit*)
+      case $host in
+        x86_64-*linux*)
+          LD="${LD-ld} -m elf_i386"
+          ;;
+        ppc64-*linux*|powerpc64-*linux*)
+          LD="${LD-ld} -m elf32ppclinux"
+          ;;
+        s390x-*linux*)
+          LD="${LD-ld} -m elf_s390"
+          ;;
+        sparc64-*linux*)
+          LD="${LD-ld} -m elf32_sparc"
+          ;;
+      esac
+      ;;
+    *64-bit*)
+      case $host in
+        x86_64-*linux*)
+          LD="${LD-ld} -m elf_x86_64"
+          ;;
+        ppc*-*linux*|powerpc*-*linux*)
+          LD="${LD-ld} -m elf64ppc"
+          ;;
+        s390*-*linux*)
+          LD="${LD-ld} -m elf64_s390"
+          ;;
+        sparc*-*linux*)
+          LD="${LD-ld} -m elf64_sparc"
+          ;;
+      esac
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
 
-dnl   /* have a look at "64bit and data size neutrality" at */
-dnl   /* http://unix.org/version2/whatsnew/login_64bit.html */
-dnl   /* (the shorthand "ILP" types always have a "P" part) */
+*-*-sco3.2v5*)
+  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -belf"
+  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+    [AC_LANG_PUSH(C)
+     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+     AC_LANG_POP])
+  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+    CFLAGS="$SAVE_CFLAGS"
+  fi
+  ;;
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
+[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
+  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+  AC_CHECK_TOOL(AS, as, false)
+  AC_CHECK_TOOL(OBJDUMP, objdump, false)
+  ;;
+  ])
+esac
 
-#if defined _STDINT_BYTE_MODEL
-#if _STDINT_LONG_MODEL+0 == 242
-/* 2:4:2 =  IP16 = a normal 16-bit system                */
-typedef unsigned char   uint8_t;
-typedef unsigned short  uint16_t;
-typedef unsigned long   uint32_t;
-#ifndef __int8_t_defined
-#define __int8_t_defined
-typedef          char    int8_t;
-typedef          short   int16_t;
-typedef          long    int32_t;
-#endif
-#elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL == 444
-/* 2:4:4 =  LP32 = a 32-bit system derived from a 16-bit */
-/* 4:4:4 = ILP32 = a normal 32-bit system                */
-typedef unsigned char   uint8_t;
-typedef unsigned short  uint16_t;
-typedef unsigned int    uint32_t;
-#ifndef __int8_t_defined
-#define __int8_t_defined
-typedef          char    int8_t;
-typedef          short   int16_t;
-typedef          int     int32_t;
-#endif
-#elif _STDINT_LONG_MODEL+0 == 484 || _STDINT_LONG_MODEL+0 == 488
-/* 4:8:4 =  IP32 = a 32-bit system prepared for 64-bit    */
-/* 4:8:8 =  LP64 = a normal 64-bit system                 */
-typedef unsigned char   uint8_t;
-typedef unsigned short  uint16_t;
-typedef unsigned int    uint32_t;
-#ifndef __int8_t_defined
-#define __int8_t_defined
-typedef          char    int8_t;
-typedef          short   int16_t;
-typedef          int     int32_t;
-#endif
-/* this system has a "long" of 64bit */
-#ifndef _HAVE_UINT64_T
-#define _HAVE_UINT64_T
-typedef unsigned long   uint64_t;
-typedef          long    int64_t;
-#endif
-#elif _STDINT_LONG_MODEL+0 == 448
-/*      LLP64   a 64-bit system derived from a 32-bit system */
-typedef unsigned char   uint8_t;
-typedef unsigned short  uint16_t;
-typedef unsigned int    uint32_t;
-#ifndef __int8_t_defined
-#define __int8_t_defined
-typedef          char    int8_t;
-typedef          short   int16_t;
-typedef          int     int32_t;
-#endif
-/* assuming the system has a "long long" */
-#ifndef _HAVE_UINT64_T
-#define _HAVE_UINT64_T
-#define _HAVE_LONGLONG_UINT64_T
-typedef unsigned long long uint64_t;
-typedef          long long  int64_t;
-#endif
-#else
-#define _STDINT_NO_INT32_T
-#endif
-#else
-#define _STDINT_NO_INT8_T
-#define _STDINT_NO_INT32_T
-#endif
-#endif
+need_locks="$enable_libtool_lock"
 
-/*
- * quote from SunOS-5.8 sys/inttypes.h:
- * Use at your own risk.  As of February 1996, the committee is squarely
- * behind the fixed sized types; the "least" and "fast" types are still being
- * discussed.  The probability that the "fast" types may be removed before
- * the standard is finalized is high enough that they are not currently
- * implemented.
- */
+])# _LT_AC_LOCK
 
-#if defined _STDINT_NEED_INT_LEAST_T
-typedef  int8_t    int_least8_t;
-typedef  int16_t   int_least16_t;
-typedef  int32_t   int_least32_t;
-#ifdef _HAVE_UINT64_T
-typedef  int64_t   int_least64_t;
-#endif
 
-typedef uint8_t   uint_least8_t;
-typedef uint16_t  uint_least16_t;
-typedef uint32_t  uint_least32_t;
-#ifdef _HAVE_UINT64_T
-typedef uint64_t  uint_least64_t;
-#endif
-  /* least types */
-#endif
+# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+#              [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
+[AC_REQUIRE([LT_AC_PROG_SED])
+AC_CACHE_CHECK([$1], [$2],
+  [$2=no
+  ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$3"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&AS_MESSAGE_LOG_FD
+   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp
+     $SED '/^$/d' conftest.err >conftest.er2
+     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
+       $2=yes
+     fi
+   fi
+   $rm conftest*
+])
 
-#if defined _STDINT_NEED_INT_FAST_T
-typedef  int8_t    int_fast8_t; 
-typedef  int       int_fast16_t;
-typedef  int32_t   int_fast32_t;
-#ifdef _HAVE_UINT64_T
-typedef  int64_t   int_fast64_t;
-#endif
+if test x"[$]$2" = xyes; then
+    ifelse([$5], , :, [$5])
+else
+    ifelse([$6], , :, [$6])
+fi
+])# AC_LIBTOOL_COMPILER_OPTION
 
-typedef uint8_t   uint_fast8_t; 
-typedef unsigned  uint_fast16_t;
-typedef uint32_t  uint_fast32_t;
-#ifdef _HAVE_UINT64_T
-typedef uint64_t  uint_fast64_t;
-#endif
-  /* fast types */
-#endif
 
-#ifdef _STDINT_NEED_INTMAX_T
-#ifdef _HAVE_UINT64_T
-typedef  int64_t       intmax_t;
-typedef uint64_t      uintmax_t;
-#else
-typedef          long  intmax_t;
-typedef unsigned long uintmax_t;
-#endif
-#endif
+# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+#                          [ACTION-SUCCESS], [ACTION-FAILURE])
+# ------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
+[AC_CACHE_CHECK([$1], [$2],
+  [$2=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $3"
+   printf "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&AS_MESSAGE_LOG_FD
+       $echo "X$_lt_linker_boilerplate" | $Xsed > conftest.exp
+       $SED '/^$/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         $2=yes
+       fi
+     else
+       $2=yes
+     fi
+   fi
+   $rm conftest*
+   LDFLAGS="$save_LDFLAGS"
+])
 
-#ifdef _STDINT_NEED_INTPTR_T
-#ifndef __intptr_t_defined
-#define __intptr_t_defined
-/* we encourage using "long" to store pointer values, never use "int" ! */
-#if   _STDINT_LONG_MODEL+0 == 242 || _STDINT_LONG_MODEL+0 == 484
-typedef  unsinged int   uintptr_t;
-typedef           int    intptr_t;
-#elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL+0 == 444
-typedef  unsigned long  uintptr_t;
-typedef           long   intptr_t;
-#elif _STDINT_LONG_MODEL+0 == 448 && defined _HAVE_UINT64_T
-typedef        uint64_t uintptr_t;
-typedef         int64_t  intptr_t;
-#else /* matches typical system types ILP32 and LP64 - but not IP16 or LLP64 */
-typedef  unsigned long  uintptr_t;
-typedef           long   intptr_t;
-#endif
-#endif
-#endif
+if test x"[$]$2" = xyes; then
+    ifelse([$4], , :, [$4])
+else
+    ifelse([$5], , :, [$5])
+fi
+])# AC_LIBTOOL_LINKER_OPTION
 
-/* The ISO C99 standard specifies that in C++ implementations these
-   should only be defined if explicitly requested.  */
-#if !defined __cplusplus || defined __STDC_CONSTANT_MACROS
-#ifndef UINT32_C
 
-/* Signed.  */
-# define INT8_C(c)      c
-# define INT16_C(c)     c
-# define INT32_C(c)     c
-# ifdef _HAVE_LONGLONG_UINT64_T
-#  define INT64_C(c)    c ## L
-# else
-#  define INT64_C(c)    c ## LL
-# endif
+# AC_LIBTOOL_SYS_MAX_CMD_LEN
+# --------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
+[# find the maximum length of command line arguments
+AC_MSG_CHECKING([the maximum length of command line arguments])
+AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
+  i=0
+  teststring="ABCD"
 
-/* Unsigned.  */
-# define UINT8_C(c)     c ## U
-# define UINT16_C(c)    c ## U
-# define UINT32_C(c)    c ## U
-# ifdef _HAVE_LONGLONG_UINT64_T
-#  define UINT64_C(c)   c ## UL
-# else
-#  define UINT64_C(c)   c ## ULL
-# endif
-
-/* Maximal type.  */
-# ifdef _HAVE_LONGLONG_UINT64_T
-#  define INTMAX_C(c)   c ## L
-#  define UINTMAX_C(c)  c ## UL
-# else
-#  define INTMAX_C(c)   c ## LL
-#  define UINTMAX_C(c)  c ## ULL
-# endif
-
-  /* literalnumbers */
-#endif
-#endif
-
-/* These limits are merily those of a two complement byte-oriented system */
-
-/* Minimum of signed integral types.  */
-# define INT8_MIN               (-128)
-# define INT16_MIN              (-32767-1)
-# define INT32_MIN              (-2147483647-1)
-# define INT64_MIN              (-__INT64_C(9223372036854775807)-1)
-/* Maximum of signed integral types.  */
-# define INT8_MAX               (127)
-# define INT16_MAX              (32767)
-# define INT32_MAX              (2147483647)
-# define INT64_MAX              (__INT64_C(9223372036854775807))
+  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
+    ;;
 
-/* Maximum of unsigned integral types.  */
-# define UINT8_MAX              (255)
-# define UINT16_MAX             (65535)
-# define UINT32_MAX             (4294967295U)
-# define UINT64_MAX             (__UINT64_C(18446744073709551615))
+  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;
+    ;;
 
-/* Minimum of signed integral types having a minimum size.  */
-# define INT_LEAST8_MIN         INT8_MIN
-# define INT_LEAST16_MIN        INT16_MIN
-# define INT_LEAST32_MIN        INT32_MIN
-# define INT_LEAST64_MIN        INT64_MIN
-/* Maximum of signed integral types having a minimum size.  */
-# define INT_LEAST8_MAX         INT8_MAX
-# define INT_LEAST16_MAX        INT16_MAX
-# define INT_LEAST32_MAX        INT32_MAX
-# define INT_LEAST64_MAX        INT64_MAX
+  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;
+    ;;
 
-/* Maximum of unsigned integral types having a minimum size.  */
-# define UINT_LEAST8_MAX        UINT8_MAX
-# define UINT_LEAST16_MAX       UINT16_MAX
-# define UINT_LEAST32_MAX       UINT32_MAX
-# define UINT_LEAST64_MAX       UINT64_MAX
+  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;
+    ;;
 
-  /* shortcircuit*/
-#endif
-  /* once */
-#endif
-#endif
-STDINT_EOF
-fi
-    if cmp -s $ac_stdint_h $ac_stdint 2>/dev/null; then
-      AC_MSG_NOTICE([$ac_stdint_h is unchanged])
+  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
-      ac_dir=`AS_DIRNAME(["$ac_stdint_h"])`
-      AS_MKDIR_P(["$ac_dir"])
-      rm -f $ac_stdint_h
-      mv $ac_stdint $ac_stdint_h
+      lt_cv_sys_max_cmd_len=65536      # usable default for all BSDs
     fi
-],[# variables for create stdint.h replacement
-PACKAGE="$PACKAGE"
-VERSION="$VERSION"
-ac_stdint_h="$ac_stdint_h"
-_ac_stdint_h=AS_TR_CPP(_$PACKAGE-$ac_stdint_h)
-ac_cv_stdint_message="$ac_cv_stdint_message"
-ac_cv_header_stdint_t="$ac_cv_header_stdint_t"
-ac_cv_header_stdint_x="$ac_cv_header_stdint_x"
-ac_cv_header_stdint_o="$ac_cv_header_stdint_o"
-ac_cv_header_stdint_u="$ac_cv_header_stdint_u"
-ac_cv_type_uint64_t="$ac_cv_type_uint64_t"
-ac_cv_type_u_int64_t="$ac_cv_type_u_int64_t"
-ac_cv_char_data_model="$ac_cv_char_data_model"
-ac_cv_long_data_model="$ac_cv_long_data_model"
-ac_cv_type_int_least32_t="$ac_cv_type_int_least32_t"
-ac_cv_type_int_fast32_t="$ac_cv_type_int_fast32_t"
-ac_cv_type_intmax_t="$ac_cv_type_intmax_t"
-])
+    # And add a safety zone
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    ;;
+  osf*)
+    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+    # nice to cause kernel panics so lets avoid the loop below.
+    # First set a reasonable default.
+    lt_cv_sys_max_cmd_len=16384
+    #
+    if test -x /sbin/sysconfig; then
+      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+        *1*) lt_cv_sys_max_cmd_len=-1 ;;
+      esac
+    fi
+    ;;
+  *)
+    # If test is not a shell built-in, we'll probably end up computing a
+    # maximum length that is only half of the actual maximum length, but
+    # we can't tell.
+    SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+    while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
+              = "XX$teststring") >/dev/null 2>&1 &&
+           new_result=`expr "X$teststring" : ".*" 2>&1` &&
+           lt_cv_sys_max_cmd_len=$new_result &&
+           test $i != 17 # 1/2 MB should be enough
+    do
+      i=`expr $i + 1`
+      teststring=$teststring$teststring
+    done
+    teststring=
+    # Add a significant safety factor because C++ compilers can tack on massive
+    # amounts of additional arguments before passing them to the linker.
+    # It appears as though 1/2 is a usable value.
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+    ;;
+  esac
 ])
-# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
-## Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005
-## Free Software Foundation, Inc.
-## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
-##
-## This file is free software; the Free Software Foundation gives
-## unlimited permission to copy and/or distribute it, with or without
-## modifications, as long as this notice is preserved.
-
-# serial 47 AC_PROG_LIBTOOL
+if test -n $lt_cv_sys_max_cmd_len ; then
+  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
+else
+  AC_MSG_RESULT(none)
+fi
+])# AC_LIBTOOL_SYS_MAX_CMD_LEN
 
 
-# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
-# -----------------------------------------------------------
-# If this macro is not defined by Autoconf, define it here.
-m4_ifdef([AC_PROVIDE_IFELSE],
-         [],
-         [m4_define([AC_PROVIDE_IFELSE],
-                [m4_ifdef([AC_PROVIDE_$1],
-                          [$2], [$3])])])
+# _LT_AC_CHECK_DLFCN
+# --------------------
+AC_DEFUN([_LT_AC_CHECK_DLFCN],
+[AC_CHECK_HEADERS(dlfcn.h)dnl
+])# _LT_AC_CHECK_DLFCN
 
 
-# AC_PROG_LIBTOOL
-# ---------------
-AC_DEFUN([AC_PROG_LIBTOOL],
-[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
-dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
-dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
-  AC_PROVIDE_IFELSE([AC_PROG_CXX],
-    [AC_LIBTOOL_CXX],
-    [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
-  ])])
-dnl And a similar setup for Fortran 77 support
-  AC_PROVIDE_IFELSE([AC_PROG_F77],
-    [AC_LIBTOOL_F77],
-    [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
-])])
+# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ------------------------------------------------------------------
+AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
+[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
+if test "$cross_compiling" = yes; then :
+  [$4]
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<EOF
+[#line __oline__ "configure"
+#include "confdefs.h"
 
-dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
-dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
-dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
-  AC_PROVIDE_IFELSE([AC_PROG_GCJ],
-    [AC_LIBTOOL_GCJ],
-    [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
-      [AC_LIBTOOL_GCJ],
-      [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
-       [AC_LIBTOOL_GCJ],
-      [ifdef([AC_PROG_GCJ],
-            [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
-       ifdef([A][M_PROG_GCJ],
-            [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
-       ifdef([LT_AC_PROG_GCJ],
-            [define([LT_AC_PROG_GCJ],
-               defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
-])])# AC_PROG_LIBTOOL
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
 
+#include <stdio.h>
 
-# _AC_PROG_LIBTOOL
-# ----------------
-AC_DEFUN([_AC_PROG_LIBTOOL],
-[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
-AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
-AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl
-AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL          RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL                DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL                0
+#  endif
+#endif
 
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
+/* 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
 
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
-AC_SUBST(LIBTOOL)dnl
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
 
-# Prevent multiple expansion
-define([AC_PROG_LIBTOOL], [])
-])# _AC_PROG_LIBTOOL
+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); */
+    }
 
-# AC_LIBTOOL_SETUP
-# ----------------
-AC_DEFUN([AC_LIBTOOL_SETUP],
-[AC_PREREQ(2.50)dnl
-AC_REQUIRE([AC_ENABLE_SHARED])dnl
-AC_REQUIRE([AC_ENABLE_STATIC])dnl
-AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_PROG_LD])dnl
-AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
-AC_REQUIRE([AC_PROG_NM])dnl
+    exit (status);
+}]
+EOF
+  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) $1 ;;
+      x$lt_dlneed_uscore) $2 ;;
+      x$lt_unknown|x*) $3 ;;
+    esac
+  else :
+    # compilation failed
+    $3
+  fi
+fi
+rm -fr conftest*
+])# _LT_AC_TRY_DLOPEN_SELF
 
-AC_REQUIRE([AC_PROG_LN_S])dnl
-AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
-# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
-AC_REQUIRE([AC_OBJEXT])dnl
-AC_REQUIRE([AC_EXEEXT])dnl
-dnl
 
-AC_LIBTOOL_SYS_MAX_CMD_LEN
-AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
-AC_LIBTOOL_OBJDIR
+# AC_LIBTOOL_DLOPEN_SELF
+# -------------------
+AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
+[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
+if test "x$enable_dlopen" != xyes; then
+  enable_dlopen=unknown
+  enable_dlopen_self=unknown
+  enable_dlopen_self_static=unknown
+else
+  lt_cv_dlopen=no
+  lt_cv_dlopen_libs=
 
-AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
-_LT_AC_PROG_ECHO_BACKSLASH
+  case $host_os in
+  beos*)
+    lt_cv_dlopen="load_add_on"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ;;
 
-case $host_os in
-aix3*)
-  # AIX sometimes has problems with the GCC collect2 program.  For some
-  # reason, if we set the COLLECT_NAMES environment variable, the problems
-  # vanish in a puff of smoke.
-  if test "X${COLLECT_NAMES+set}" != Xset; then
-    COLLECT_NAMES=
-    export COLLECT_NAMES
-  fi
-  ;;
-esac
+  mingw* | pw32*)
+    lt_cv_dlopen="LoadLibrary"
+    lt_cv_dlopen_libs=
+   ;;
 
-# Sed substitution that helps us do robust quoting.  It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed='sed -e 1s/^X//'
-[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
+  cygwin*)
+    lt_cv_dlopen="dlopen"
+    lt_cv_dlopen_libs=
+   ;;
 
-# Same as above, but do not quote variable references.
-[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
+  darwin*)
+  # if libdl is installed we need to link against it
+    AC_CHECK_LIB([dl], [dlopen],
+               [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ])
+   ;;
 
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+  *)
+    AC_CHECK_FUNC([shl_load],
+         [lt_cv_dlopen="shl_load"],
+      [AC_CHECK_LIB([dld], [shl_load],
+           [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
+       [AC_CHECK_FUNC([dlopen],
+             [lt_cv_dlopen="dlopen"],
+         [AC_CHECK_LIB([dl], [dlopen],
+               [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+           [AC_CHECK_LIB([svld], [dlopen],
+                 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
+             [AC_CHECK_LIB([dld], [dld_link],
+                   [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
+             ])
+           ])
+         ])
+       ])
+      ])
+    ;;
+  esac
 
-# Sed substitution to avoid accidental globbing in evaled expressions
-no_glob_subst='s/\*/\\\*/g'
+  if test "x$lt_cv_dlopen" != xno; then
+    enable_dlopen=yes
+  else
+    enable_dlopen=no
+  fi
 
-# Constants:
-rm="rm -f"
+  case $lt_cv_dlopen in
+  dlopen)
+    save_CPPFLAGS="$CPPFLAGS"
+    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
 
-# Global variables:
-default_ofile=libtool
-can_build_shared=yes
+    save_LDFLAGS="$LDFLAGS"
+    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
 
-# All known linkers require a `.a' archive for static linking (except MSVC,
-# which needs '.lib').
-libext=a
-ltmain="$ac_aux_dir/ltmain.sh"
-ofile="$default_ofile"
-with_gnu_ld="$lt_cv_prog_gnu_ld"
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
 
-AC_CHECK_TOOL(AR, ar, false)
-AC_CHECK_TOOL(RANLIB, ranlib, :)
-AC_CHECK_TOOL(STRIP, strip, :)
+    AC_CACHE_CHECK([whether a program can dlopen itself],
+         lt_cv_dlopen_self, [dnl
+         _LT_AC_TRY_DLOPEN_SELF(
+           lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
+           lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
+    ])
 
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      LDFLAGS="$LDFLAGS $link_static_flag"
+      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+         lt_cv_dlopen_self_static, [dnl
+         _LT_AC_TRY_DLOPEN_SELF(
+           lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
+           lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
+      ])
+    fi
 
-# Set sane defaults for various variables
-test -z "$AR" && AR=ar
-test -z "$AR_FLAGS" && AR_FLAGS=cru
-test -z "$AS" && AS=as
-test -z "$CC" && CC=cc
-test -z "$LTCC" && LTCC=$CC
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-test -z "$LD" && LD=ld
-test -z "$LN_S" && LN_S="ln -s"
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-test -z "$NM" && NM=nm
-test -z "$SED" && SED=sed
-test -z "$OBJDUMP" && OBJDUMP=objdump
-test -z "$RANLIB" && RANLIB=:
-test -z "$STRIP" && STRIP=:
-test -z "$ac_objext" && ac_objext=o
+    CPPFLAGS="$save_CPPFLAGS"
+    LDFLAGS="$save_LDFLAGS"
+    LIBS="$save_LIBS"
+    ;;
+  esac
 
-# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
-old_postinstall_cmds='chmod 644 $oldlib'
-old_postuninstall_cmds=
+  case $lt_cv_dlopen_self in
+  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+  *) enable_dlopen_self=unknown ;;
+  esac
 
-if test -n "$RANLIB"; then
-  case $host_os in
-  openbsd*)
-    old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
-    ;;
-  *)
-    old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
-    ;;
+  case $lt_cv_dlopen_self_static in
+  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+  *) enable_dlopen_self_static=unknown ;;
   esac
-  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
 fi
+])# AC_LIBTOOL_DLOPEN_SELF
 
-_LT_CC_BASENAME([$compiler])
-
-# Only perform the check for file, if the check method requires it
-case $deplibs_check_method in
-file_magic*)
-  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
-    AC_PATH_MAGIC
-  fi
-  ;;
-esac
-
-AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
-AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
-enable_win32_dll=yes, enable_win32_dll=no)
-
-AC_ARG_ENABLE([libtool-lock],
-    [AC_HELP_STRING([--disable-libtool-lock],
-       [avoid locking (might break parallel builds)])])
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
-
-AC_ARG_WITH([pic],
-    [AC_HELP_STRING([--with-pic],
-       [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
-    [pic_mode="$withval"],
-    [pic_mode=default])
-test -z "$pic_mode" && pic_mode=default
-
-# Use C for the default configuration in the libtool script
-tagname=
-AC_LIBTOOL_LANG_C_CONFIG
-_LT_AC_TAGCONFIG
-])# AC_LIBTOOL_SETUP
-
-
-# _LT_AC_SYS_COMPILER
-# -------------------
-AC_DEFUN([_LT_AC_SYS_COMPILER],
-[AC_REQUIRE([AC_PROG_CC])dnl
-
-# If no C compiler was specified, use CC.
-LTCC=${LTCC-"$CC"}
-
-# Allow CC to be a program name with arguments.
-compiler=$CC
-])# _LT_AC_SYS_COMPILER
 
+# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
+# ---------------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler
+AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
+[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+   $rm -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
 
-# _LT_CC_BASENAME(CC)
-# -------------------
-# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
-AC_DEFUN([_LT_CC_BASENAME],
-[for cc_temp in $1""; do
-  case $cc_temp in
-    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
-    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
-    \-*) ;;
-    *) break;;
-  esac
-done
-cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"`
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&AS_MESSAGE_LOG_FD
+   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp
+     $SED '/^$/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+     fi
+   fi
+   chmod u+w . 2>&AS_MESSAGE_LOG_FD
+   $rm conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
+   $rm out/* && rmdir out
+   cd ..
+   rmdir conftest
+   $rm conftest*
 ])
+])# AC_LIBTOOL_PROG_CC_C_O
 
 
-# _LT_COMPILER_BOILERPLATE
-# ------------------------
-# Check for compiler boilerplate output or warnings with
-# the simple compiler test code.
-AC_DEFUN([_LT_COMPILER_BOILERPLATE],
-[ac_outfile=conftest.$ac_objext
-printf "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
-_lt_compiler_boilerplate=`cat conftest.err`
-$rm conftest*
-])# _LT_COMPILER_BOILERPLATE
-
-
-# _LT_LINKER_BOILERPLATE
-# ----------------------
-# Check for linker boilerplate output or warnings with
-# the simple link test code.
-AC_DEFUN([_LT_LINKER_BOILERPLATE],
-[ac_outfile=conftest.$ac_objext
-printf "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d' >conftest.err
-_lt_linker_boilerplate=`cat conftest.err`
-$rm conftest*
-])# _LT_LINKER_BOILERPLATE
-
-
-# _LT_AC_SYS_LIBPATH_AIX
-# ----------------------
-# Links a minimal program and checks the executable
-# for the system default hardcoded library path. In most cases,
-# this is /usr/lib:/lib, but when the MPI compilers are used
-# the location of the communication and MPI libs are included too.
-# If we don't find anything, use the default library path according
-# to the aix ld manual.
-AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
-[AC_LINK_IFELSE(AC_LANG_PROGRAM,[
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
-}'`; fi],[])
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
-])# _LT_AC_SYS_LIBPATH_AIX
+# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
+# -----------------------------------------
+# Check to see if we can do hard links to lock some files if needed
+AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
+[AC_REQUIRE([_LT_AC_LOCK])dnl
 
+hard_links="nottested"
+if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  AC_MSG_CHECKING([if we can lock with hard links])
+  hard_links=yes
+  $rm conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  AC_MSG_RESULT([$hard_links])
+  if test "$hard_links" = no; then
+    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
 
-# _LT_AC_SHELL_INIT(ARG)
-# ----------------------
-AC_DEFUN([_LT_AC_SHELL_INIT],
-[ifdef([AC_DIVERSION_NOTICE],
-            [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
-        [AC_DIVERT_PUSH(NOTICE)])
-$1
-AC_DIVERT_POP
-])# _LT_AC_SHELL_INIT
 
+# AC_LIBTOOL_OBJDIR
+# -----------------
+AC_DEFUN([AC_LIBTOOL_OBJDIR],
+[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
+[rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+  lt_cv_objdir=.libs
+else
+  # MS-DOS does not allow filenames that begin with a dot.
+  lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null])
+objdir=$lt_cv_objdir
+])# AC_LIBTOOL_OBJDIR
 
-# _LT_AC_PROG_ECHO_BACKSLASH
-# --------------------------
-# Add some code to the start of the generated configure script which
-# will find an echo command which doesn't interpret backslashes.
-AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
-[_LT_AC_SHELL_INIT([
-# Check that we are running under the correct shell.
-SHELL=${CONFIG_SHELL-/bin/sh}
 
-case X$ECHO in
-X*--fallback-echo)
-  # Remove one level of quotation (which was required for Make).
-  ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
-  ;;
-esac
+# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
+# ----------------------------------------------
+# Check hardcoding attributes.
+AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
+[AC_MSG_CHECKING([how to hardcode library paths into programs])
+_LT_AC_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
+   test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \
+   test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
 
-echo=${ECHO-echo}
-if test "X[$]1" = X--no-reexec; then
-  # Discard the --no-reexec flag, and continue.
-  shift
-elif test "X[$]1" = X--fallback-echo; then
-  # Avoid inline document here, it may be left over
-  :
-elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
-  # Yippee, $echo works!
-  :
+  # We can hardcode non-existant directories.
+  if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
+     test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
+    # Linking always hardcodes the temporary library directory.
+    _LT_AC_TAGVAR(hardcode_action, $1)=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    _LT_AC_TAGVAR(hardcode_action, $1)=immediate
+  fi
 else
-  # Restart under the correct shell.
-  exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
 fi
+AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
 
-if test "X[$]1" = X--fallback-echo; then
-  # used as fallback echo
-  shift
-  cat <<EOF
-[$]*
-EOF
-  exit 0
+if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
 fi
+])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
 
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
-if test -z "$ECHO"; then
-if test "X${echo_test_string+set}" != Xset; then
-# find a string as large as possible, as long as the shell can cope with it
-  for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
-    # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
-    if (echo_test_string=`eval $cmd`) 2>/dev/null &&
-       echo_test_string=`eval $cmd` &&
-       (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
-    then
-      break
-    fi
-  done
+# AC_LIBTOOL_SYS_LIB_STRIP
+# ------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
+[striplib=
+old_striplib=
+AC_MSG_CHECKING([whether stripping libraries is possible])
+if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
+  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  AC_MSG_RESULT([yes])
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+  case $host_os in
+   darwin*)
+       if test -n "$STRIP" ; then
+         striplib="$STRIP -x"
+         AC_MSG_RESULT([yes])
+       else
+  AC_MSG_RESULT([no])
+fi
+       ;;
+   *)
+  AC_MSG_RESULT([no])
+    ;;
+  esac
 fi
+])# AC_LIBTOOL_SYS_LIB_STRIP
 
-if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
-   echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
-   test "X$echo_testing_string" = "X$echo_test_string"; then
-  :
+
+# AC_LIBTOOL_SYS_DYNAMIC_LINKER
+# -----------------------------
+# PORTME Fill in your ld.so characteristics
+AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
+[AC_MSG_CHECKING([dynamic linker characteristics])
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+if test "$GCC" = yes; then
+  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+    # if the path contains ";" then we assume it to be the separator
+    # otherwise default to the standard path separator (i.e. ":") - it is
+    # assumed that no part of a normal pathname contains ";" but that should
+    # okay in the real world where ";" in dirpaths is itself problematic.
+    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+  else
+    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+  fi
 else
-  # The Solaris, AIX, and Digital Unix default echo programs unquote
-  # backslashes.  This makes it impossible to quote backslashes using
-  #   echo "$something" | sed 's/\\/\\\\/g'
-  #
-  # So, first we look for a working echo in the user's PATH.
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+need_lib_prefix=unknown
+hardcode_into_libs=no
 
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for dir in $PATH /usr/ucb; do
-    IFS="$lt_save_ifs"
-    if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
-       test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
-       echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
-       test "X$echo_testing_string" = "X$echo_test_string"; then
-      echo="$dir/echo"
-      break
-    fi
-  done
-  IFS="$lt_save_ifs"
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
 
-  if test "X$echo" = Xecho; then
-    # We didn't find a better echo, so look for alternatives.
-    if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
-       echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
-       test "X$echo_testing_string" = "X$echo_test_string"; then
-      # This shell has a builtin print -r that does the trick.
-      echo='print -r'
-    elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
-        test "X$CONFIG_SHELL" != X/bin/ksh; then
-      # If we have ksh, try running configure again with it.
-      ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
-      export ORIGINAL_CONFIG_SHELL
-      CONFIG_SHELL=/bin/ksh
-      export CONFIG_SHELL
-      exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
-    else
-      # Try using printf.
-      echo='printf %s\n'
-      if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
-        echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
-        test "X$echo_testing_string" = "X$echo_test_string"; then
-       # Cool, printf works
-       :
-      elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
-          test "X$echo_testing_string" = 'X\t' &&
-          echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
-          test "X$echo_testing_string" = "X$echo_test_string"; then
-       CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
-       export CONFIG_SHELL
-       SHELL="$CONFIG_SHELL"
-       export SHELL
-       echo="$CONFIG_SHELL [$]0 --fallback-echo"
-      elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
-          test "X$echo_testing_string" = 'X\t' &&
-          echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
-          test "X$echo_testing_string" = "X$echo_test_string"; then
-       echo="$CONFIG_SHELL [$]0 --fallback-echo"
-      else
-       # maybe with a smaller string...
-       prev=:
+case $host_os in
+aix3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  shlibpath_var=LIBPATH
 
-       for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
-         if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
-         then
-           break
-         fi
-         prev="$cmd"
-       done
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
 
-       if test "$prev" != 'sed 50q "[$]0"'; then
-         echo_test_string=`eval $prev`
-         export echo_test_string
-         exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
-       else
-         # Oops.  We lost completely, so just stick with echo.
-         echo=echo
-       fi
+aix4* | aix5*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[[01]] | aix4.[[01]].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+          echo ' yes '
+          echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
+       :
+      else
+       can_build_shared=no
       fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
     fi
+    shlibpath_var=LIBPATH
   fi
-fi
-fi
+  ;;
 
-# Copy echo and quote the copy suitably for passing to libtool from
-# the Makefile, instead of quoting the original, which is used later.
-ECHO=$echo
-if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
-   ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
-fi
+amigaos*)
+  library_names_spec='$libname.ixlibrary $libname.a'
+  # Create ${libname}_ixlibrary.a entries in /sys/libs.
+  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+  ;;
 
-AC_SUBST(ECHO)
-])])# _LT_AC_PROG_ECHO_BACKSLASH
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
 
+bsdi[[45]]*)
+  version_type=linux
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
 
-# _LT_AC_LOCK
-# -----------
-AC_DEFUN([_LT_AC_LOCK],
-[AC_ARG_ENABLE([libtool-lock],
-    [AC_HELP_STRING([--disable-libtool-lock],
-       [avoid locking (might break parallel builds)])])
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+cygwin* | mingw* | pw32*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
 
-# Some flags need to be propagated to the compiler or linker for good
-# libtool support.
-case $host in
-ia64-*-hpux*)
-  # Find out which ABI we are using.
-  echo 'int i;' > conftest.$ac_ext
-  if AC_TRY_EVAL(ac_compile); then
-    case `/usr/bin/file conftest.$ac_objext` in
-    *ELF-32*)
-      HPUX_IA64_MODE="32"
-      ;;
-    *ELF-64*)
-      HPUX_IA64_MODE="64"
-      ;;
-    esac
-  fi
-  rm -rf conftest*
-  ;;
-*-*-irix6*)
-  # Find out which ABI we are using.
-  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
-  if AC_TRY_EVAL(ac_compile); then
-   if test "$lt_cv_prog_gnu_ld" = yes; then
-    case `/usr/bin/file conftest.$ac_objext` in
-    *32-bit*)
-      LD="${LD-ld} -melf32bsmip"
-      ;;
-    *N32*)
-      LD="${LD-ld} -melf32bmipn32"
-      ;;
-    *64-bit*)
-      LD="${LD-ld} -melf64bmip"
-      ;;
-    esac
-   else
-    case `/usr/bin/file conftest.$ac_objext` in
-    *32-bit*)
-      LD="${LD-ld} -32"
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32*)
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $rm \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
       ;;
-    *N32*)
-      LD="${LD-ld} -n32"
+    mingw*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+      if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
+        # It is most probably a Windows format PATH printed by
+        # mingw gcc, but we are running on Cygwin. Gcc prints its search
+        # path with ; separators, and with drive letters. We can handle the
+        # drive letters (cygwin fileutils understands them), so leave them,
+        # especially as we might pass files found there to a mingw objdump,
+        # which wouldn't understand a cygwinified path. Ahh.
+        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+      fi
       ;;
-    *64-bit*)
-      LD="${LD-ld} -64"
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
       ;;
     esac
-   fi
-  fi
-  rm -rf conftest*
+    ;;
+
+  *)
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    ;;
+  esac
+  dynamic_linker='Win32 ld.exe'
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
   ;;
 
-x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
-  # Find out which ABI we are using.
-  echo 'int i;' > conftest.$ac_ext
-  if AC_TRY_EVAL(ac_compile); then
-    case `/usr/bin/file conftest.o` in
-    *32-bit*)
-      case $host in
-        x86_64-*linux*)
-          LD="${LD-ld} -m elf_i386"
-          ;;
-        ppc64-*linux*|powerpc64-*linux*)
-          LD="${LD-ld} -m elf32ppclinux"
-          ;;
-        s390x-*linux*)
-          LD="${LD-ld} -m elf_s390"
-          ;;
-        sparc64-*linux*)
-          LD="${LD-ld} -m elf32_sparc"
-          ;;
-      esac
-      ;;
-    *64-bit*)
-      case $host in
-        x86_64-*linux*)
-          LD="${LD-ld} -m elf_x86_64"
-          ;;
-        ppc*-*linux*|powerpc*-*linux*)
-          LD="${LD-ld} -m elf64ppc"
-          ;;
-        s390*-*linux*)
-          LD="${LD-ld} -m elf64_s390"
-          ;;
-        sparc*-*linux*)
-          LD="${LD-ld} -m elf64_sparc"
-          ;;
-      esac
-      ;;
-    esac
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+  if test "$GCC" = yes; then
+    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+  else
+    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
   fi
-  rm -rf conftest*
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
   ;;
 
-*-*-sco3.2v5*)
-  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
-  SAVE_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -belf"
-  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
-    [AC_LANG_PUSH(C)
-     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
-     AC_LANG_POP])
-  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
-    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
-    CFLAGS="$SAVE_CFLAGS"
-  fi
+dgux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
   ;;
-AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
-[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
-  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
-  AC_CHECK_TOOL(AS, as, false)
-  AC_CHECK_TOOL(OBJDUMP, objdump, false)
+
+freebsd1*)
+  dynamic_linker=no
   ;;
-  ])
-esac
 
-need_locks="$enable_libtool_lock"
+kfreebsd*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
 
-])# _LT_AC_LOCK
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[[123]]*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  *) # from 3.2 on
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
 
+gnu*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  ;;
 
-# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
-#              [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
-# ----------------------------------------------------------------
-# Check whether the given compiler option works
-AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
-[AC_REQUIRE([LT_AC_PROG_SED])
-AC_CACHE_CHECK([$1], [$2],
-  [$2=no
-  ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
-   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
-   lt_compiler_flag="$3"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   # The option is referenced via a variable to avoid confusing sed.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
-   (eval "$lt_compile" 2>conftest.err)
-   ac_status=$?
-   cat conftest.err >&AS_MESSAGE_LOG_FD
-   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
-   if (exit $ac_status) && test -s "$ac_outfile"; then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings other than the usual output.
-     $echo "X$_lt_compiler_boilerplate" | $Xsed >conftest.exp
-     $SED '/^$/d' conftest.err >conftest.er2
-     if test ! -s conftest.err || diff conftest.exp conftest.er2 >/dev/null; then
-       $2=yes
-     fi
-   fi
-   $rm conftest*
-])
-
-if test x"[$]$2" = xyes; then
-    ifelse([$5], , :, [$5])
-else
-    ifelse([$6], , :, [$6])
-fi
-])# AC_LIBTOOL_COMPILER_OPTION
-
-
-# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
-#                          [ACTION-SUCCESS], [ACTION-FAILURE])
-# ------------------------------------------------------------
-# Check whether the given compiler option works
-AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
-[AC_CACHE_CHECK([$1], [$2],
-  [$2=no
-   save_LDFLAGS="$LDFLAGS"
-   LDFLAGS="$LDFLAGS $3"
-   printf "$lt_simple_link_test_code" > conftest.$ac_ext
-   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
-     # The linker can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     if test -s conftest.err; then
-       # Append any errors to the config.log.
-       cat conftest.err 1>&AS_MESSAGE_LOG_FD
-       $echo "X$_lt_linker_boilerplate" | $Xsed > conftest.exp
-       $SED '/^$/d' conftest.err >conftest.er2
-       if diff conftest.exp conftest.er2 >/dev/null; then
-         $2=yes
-       fi
-     else
-       $2=yes
-     fi
-   fi
-   $rm conftest*
-   LDFLAGS="$save_LDFLAGS"
-])
-
-if test x"[$]$2" = xyes; then
-    ifelse([$4], , :, [$4])
-else
-    ifelse([$5], , :, [$5])
-fi
-])# AC_LIBTOOL_LINKER_OPTION
-
-
-# AC_LIBTOOL_SYS_MAX_CMD_LEN
-# --------------------------
-AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
-[# find the maximum length of command line arguments
-AC_MSG_CHECKING([the maximum length of command line arguments])
-AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
-  i=0
-  teststring="ABCD"
-
-  case $build_os in
-  msdosdjgpp*)
-    # On DJGPP, this test can blow up pretty badly due to problems in libc
-    # (any single argument exceeding 2000 bytes causes a buffer overrun
-    # during glob expansion).  Even if it were fixed, the result of this
-    # check would be larger than it should be.
-    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
-    ;;
-
-  gnu*)
-    # Under GNU Hurd, this test is not required because there is
-    # no limit to the length of command line arguments.
-    # Libtool will interpret -1 as no limit whatsoever
-    lt_cv_sys_max_cmd_len=-1;
-    ;;
-
-  cygwin* | mingw*)
-    # On Win9x/ME, this test blows up -- it succeeds, but takes
-    # about 5 minutes as the teststring grows exponentially.
-    # Worse, since 9x/ME are not pre-emptively multitasking,
-    # you end up with a "frozen" computer, even though with patience
-    # the test eventually succeeds (with a max line length of 256k).
-    # Instead, let's just punt: use the minimum linelength reported by
-    # all of the supported platforms: 8192 (on NT/2K/XP).
-    lt_cv_sys_max_cmd_len=8192;
-    ;;
-
-  amigaos*)
-    # On AmigaOS with pdksh, this test takes hours, literally.
-    # So we just punt and use a minimum line length of 8192.
-    lt_cv_sys_max_cmd_len=8192;
-    ;;
-
-  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
-    # This has been around since 386BSD, at least.  Likely further.
-    if test -x /sbin/sysctl; then
-      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
-    elif test -x /usr/sbin/sysctl; then
-      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case $host_cpu in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
     else
-      lt_cv_sys_max_cmd_len=65536      # usable default for all BSDs
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
     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`
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
     ;;
-  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
+   hppa*64*)
+     shrext_cmds='.sl'
+     hardcode_into_libs=yes
+     dynamic_linker="$host_os dld.sl"
+     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+     soname_spec='${libname}${release}${shared_ext}$major'
+     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+     ;;
+   *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555.
+  postinstall_cmds='chmod 555 $lib'
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+       if test "$lt_cv_prog_gnu_ld" = yes; then
+               version_type=linux
+       else
+               version_type=irix
+       fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
     ;;
   *)
-    # If test is not a shell built-in, we'll probably end up computing a
-    # maximum length that is only half of the actual maximum length, but
-    # we can't tell.
-    SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
-    while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \
-              = "XX$teststring") >/dev/null 2>&1 &&
-           new_result=`expr "X$teststring" : ".*" 2>&1` &&
-           lt_cv_sys_max_cmd_len=$new_result &&
-           test $i != 17 # 1/2 MB should be enough
-    do
-      i=`expr $i + 1`
-      teststring=$teststring$teststring
-    done
-    teststring=
-    # Add a significant safety factor because C++ compilers can tack on massive
-    # amounts of additional arguments before passing them to the linker.
-    # It appears as though 1/2 is a usable value.
-    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
     ;;
   esac
-])
-if test -n $lt_cv_sys_max_cmd_len ; then
-  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
-else
-  AC_MSG_RESULT(none)
-fi
-])# AC_LIBTOOL_SYS_MAX_CMD_LEN
-
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  hardcode_into_libs=yes
+  ;;
 
-# _LT_AC_CHECK_DLFCN
-# --------------------
-AC_DEFUN([_LT_AC_CHECK_DLFCN],
-[AC_CHECK_HEADERS(dlfcn.h)dnl
-])# _LT_AC_CHECK_DLFCN
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
 
+# This must be Linux ELF.
+linux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
 
-# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
-#                           ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
-# ------------------------------------------------------------------
-AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
-[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
-if test "$cross_compiling" = yes; then :
-  [$4]
-else
-  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
-  lt_status=$lt_dlunknown
-  cat > conftest.$ac_ext <<EOF
-[#line __oline__ "configure"
-#include "confdefs.h"
+  # Append ld.so.conf contents to the search path
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,   ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+  fi
 
-#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;
+  # 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'
+  ;;
 
-  if (self)
-    {
-      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
-      else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
-      /* dlclose (self); */
-    }
+knetbsd*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='GNU ld.so'
+  ;;
 
-    exit (status);
-}]
-EOF
-  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
-    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
-    lt_status=$?
-    case x$lt_status in
-      x$lt_dlno_uscore) $1 ;;
-      x$lt_dlneed_uscore) $2 ;;
-      x$lt_unknown|x*) $3 ;;
-    esac
-  else :
-    # compilation failed
-    $3
+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
-fi
-rm -fr conftest*
-])# _LT_AC_TRY_DLOPEN_SELF
+  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
+  ;;
 
-# AC_LIBTOOL_DLOPEN_SELF
-# -------------------
-AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
-[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
-if test "x$enable_dlopen" != xyes; then
-  enable_dlopen=unknown
-  enable_dlopen_self=unknown
-  enable_dlopen_self_static=unknown
-else
-  lt_cv_dlopen=no
-  lt_cv_dlopen_libs=
+nto-qnx*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
 
+openbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
   case $host_os in
-  beos*)
-    lt_cv_dlopen="load_add_on"
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=yes
-    ;;
-
-  mingw* | pw32*)
-    lt_cv_dlopen="LoadLibrary"
-    lt_cv_dlopen_libs=
-   ;;
-
-  cygwin*)
-    lt_cv_dlopen="dlopen"
-    lt_cv_dlopen_libs=
-   ;;
-
-  darwin*)
-  # if libdl is installed we need to link against it
-    AC_CHECK_LIB([dl], [dlopen],
-               [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
-    lt_cv_dlopen="dyld"
-    lt_cv_dlopen_libs=
-    lt_cv_dlopen_self=yes
-    ])
-   ;;
-
-  *)
-    AC_CHECK_FUNC([shl_load],
-         [lt_cv_dlopen="shl_load"],
-      [AC_CHECK_LIB([dld], [shl_load],
-           [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
-       [AC_CHECK_FUNC([dlopen],
-             [lt_cv_dlopen="dlopen"],
-         [AC_CHECK_LIB([dl], [dlopen],
-               [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
-           [AC_CHECK_LIB([svld], [dlopen],
-                 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
-             [AC_CHECK_LIB([dld], [dld_link],
-                   [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
-             ])
-           ])
-         ])
-       ])
-      ])
-    ;;
+    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+    *)                         need_version=no  ;;
   esac
-
-  if test "x$lt_cv_dlopen" != xno; then
-    enable_dlopen=yes
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[[89]] | openbsd2.[[89]].*)
+       shlibpath_overrides_runpath=no
+       ;;
+      *)
+       shlibpath_overrides_runpath=yes
+       ;;
+      esac
   else
-    enable_dlopen=no
+    shlibpath_overrides_runpath=yes
   fi
+  ;;
 
-  case $lt_cv_dlopen in
-  dlopen)
-    save_CPPFLAGS="$CPPFLAGS"
-    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+os2*)
+  libname_spec='$name'
+  shrext_cmds=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
 
-    save_LDFLAGS="$LDFLAGS"
-    eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+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"
+  ;;
 
-    save_LIBS="$LIBS"
-    LIBS="$lt_cv_dlopen_libs $LIBS"
+sco3.2v5*)
+  version_type=osf
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
 
-    AC_CACHE_CHECK([whether a program can dlopen itself],
-         lt_cv_dlopen_self, [dnl
-         _LT_AC_TRY_DLOPEN_SELF(
-           lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
-           lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
-    ])
+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'
+  ;;
 
-    if test "x$lt_cv_dlopen_self" = xyes; then
-      LDFLAGS="$LDFLAGS $link_static_flag"
-      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
-         lt_cv_dlopen_self_static, [dnl
-         _LT_AC_TRY_DLOPEN_SELF(
-           lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
-           lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
-      ])
-    fi
-
-    CPPFLAGS="$save_CPPFLAGS"
-    LDFLAGS="$save_LDFLAGS"
-    LIBS="$save_LIBS"
-    ;;
-  esac
+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
+  ;;
 
-  case $lt_cv_dlopen_self in
-  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
-  *) enable_dlopen_self=unknown ;;
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      export_dynamic_flag_spec='${wl}-Blargedynsym'
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
   esac
+  ;;
 
-  case $lt_cv_dlopen_self_static in
-  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
-  *) enable_dlopen_self_static=unknown ;;
-  esac
-fi
-])# AC_LIBTOOL_DLOPEN_SELF
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
 
+uts4*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
 
-# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
-# ---------------------------------
-# Check to see if options -c and -o are simultaneously supported by compiler
-AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
-[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
-AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
-  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
-  [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
-   $rm -r conftest 2>/dev/null
-   mkdir conftest
-   cd conftest
-   mkdir out
-   printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+*)
+  dynamic_linker=no
+  ;;
+esac
+AC_MSG_RESULT([$dynamic_linker])
+test "$dynamic_linker" = no && can_build_shared=no
+])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
 
-   lt_compiler_flag="-o out/conftest2.$ac_objext"
-   # Insert the option either (1) after the last *FLAGS variable, or
-   # (2) before a word containing "conftest.", or (3) at the end.
-   # Note that $ac_compile itself does not contain backslashes and begins
-   # with a dollar sign (not a hyphen), so the echo should work correctly.
-   lt_compile=`echo "$ac_compile" | $SED \
-   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
-   -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
-   (eval "$lt_compile" 2>out/conftest.err)
-   ac_status=$?
-   cat out/conftest.err >&AS_MESSAGE_LOG_FD
-   echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
-   if (exit $ac_status) && test -s out/conftest2.$ac_objext
-   then
-     # The compiler can only warn and ignore the option if not recognized
-     # So say no if there are warnings
-     $echo "X$_lt_compiler_boilerplate" | $Xsed > out/conftest.exp
-     $SED '/^$/d' out/conftest.err >out/conftest.er2
-     if test ! -s out/conftest.err || diff out/conftest.exp out/conftest.er2 >/dev/null; then
-       _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
-     fi
-   fi
-   chmod u+w . 2>&AS_MESSAGE_LOG_FD
-   $rm conftest*
-   # SGI C++ compiler will create directory out/ii_files/ for
-   # template instantiation
-   test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files
-   $rm out/* && rmdir out
-   cd ..
-   rmdir conftest
-   $rm conftest*
-])
-])# AC_LIBTOOL_PROG_CC_C_O
 
+# _LT_AC_TAGCONFIG
+# ----------------
+AC_DEFUN([_LT_AC_TAGCONFIG],
+[AC_ARG_WITH([tags],
+    [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
+        [include additional configurations @<:@automatic@:>@])],
+    [tagnames="$withval"])
 
-# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
-# -----------------------------------------
-# Check to see if we can do hard links to lock some files if needed
-AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
-[AC_REQUIRE([_LT_AC_LOCK])dnl
+if test -f "$ltmain" && test -n "$tagnames"; then
+  if test ! -f "${ofile}"; then
+    AC_MSG_WARN([output file `$ofile' does not exist])
+  fi
 
-hard_links="nottested"
-if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
-  # do not overwrite the value of need_locks provided by the user
-  AC_MSG_CHECKING([if we can lock with hard links])
-  hard_links=yes
-  $rm conftest*
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  touch conftest.a
-  ln conftest.a conftest.b 2>&5 || hard_links=no
-  ln conftest.a conftest.b 2>/dev/null && hard_links=no
-  AC_MSG_RESULT([$hard_links])
-  if test "$hard_links" = no; then
-    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
-    need_locks=warn
+  if test -z "$LTCC"; then
+    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
+    if test -z "$LTCC"; then
+      AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
+    else
+      AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
+    fi
   fi
-else
-  need_locks=no
-fi
-])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
 
+  # Extract list of available tagged configurations in $ofile.
+  # Note that this assumes the entire list is on one line.
+  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
 
-# AC_LIBTOOL_OBJDIR
-# -----------------
-AC_DEFUN([AC_LIBTOOL_OBJDIR],
-[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
-[rm -f .libs 2>/dev/null
-mkdir .libs 2>/dev/null
-if test -d .libs; then
-  lt_cv_objdir=.libs
-else
-  # MS-DOS does not allow filenames that begin with a dot.
-  lt_cv_objdir=_libs
-fi
-rmdir .libs 2>/dev/null])
-objdir=$lt_cv_objdir
-])# AC_LIBTOOL_OBJDIR
+  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+  for tagname in $tagnames; do
+    IFS="$lt_save_ifs"
+    # Check whether tagname contains only valid characters
+    case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
+    "") ;;
+    *)  AC_MSG_ERROR([invalid tag name: $tagname])
+       ;;
+    esac
 
+    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
+    then
+      AC_MSG_ERROR([tag name \"$tagname\" already exists])
+    fi
 
-# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
-# ----------------------------------------------
-# Check hardcoding attributes.
-AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
-[AC_MSG_CHECKING([how to hardcode library paths into programs])
-_LT_AC_TAGVAR(hardcode_action, $1)=
-if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
-   test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \
-   test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
+    # Update the list of available tags.
+    if test -n "$tagname"; then
+      echo appending configuration tag \"$tagname\" to $ofile
 
-  # We can hardcode non-existant directories.
-  if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
-     # If the only mechanism to avoid hardcoding is shlibpath_var, we
-     # have to relink, otherwise we might link with an installed library
-     # when we should be linking with a yet-to-be-installed one
-     ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
-     test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
-    # Linking always hardcodes the temporary library directory.
-    _LT_AC_TAGVAR(hardcode_action, $1)=relink
-  else
-    # We can link without hardcoding, and we can hardcode nonexisting dirs.
-    _LT_AC_TAGVAR(hardcode_action, $1)=immediate
-  fi
-else
-  # We cannot hardcode anything, or else we can only hardcode existing
-  # directories.
-  _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
-fi
-AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
+      case $tagname in
+      CXX)
+       if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+           ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+           (test "X$CXX" != "Xg++"))) ; then
+         AC_LIBTOOL_LANG_CXX_CONFIG
+       else
+         tagname=""
+       fi
+       ;;
 
-if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
-  # Fast installation is not supported
-  enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
-     test "$enable_shared" = no; then
-  # Fast installation is not necessary
-  enable_fast_install=needless
-fi
-])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
+      F77)
+       if test -n "$F77" && test "X$F77" != "Xno"; then
+         AC_LIBTOOL_LANG_F77_CONFIG
+       else
+         tagname=""
+       fi
+       ;;
 
+      GCJ)
+       if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
+         AC_LIBTOOL_LANG_GCJ_CONFIG
+       else
+         tagname=""
+       fi
+       ;;
 
-# AC_LIBTOOL_SYS_LIB_STRIP
-# ------------------------
-AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
-[striplib=
-old_striplib=
-AC_MSG_CHECKING([whether stripping libraries is possible])
-if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
-  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
-  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
-  AC_MSG_RESULT([yes])
-else
-# FIXME - insert some real tests, host_os isn't really good enough
-  case $host_os in
-   darwin*)
-       if test -n "$STRIP" ; then
-         striplib="$STRIP -x"
-         AC_MSG_RESULT([yes])
-       else
-  AC_MSG_RESULT([no])
-fi
-       ;;
-   *)
-  AC_MSG_RESULT([no])
-    ;;
-  esac
-fi
-])# AC_LIBTOOL_SYS_LIB_STRIP
+      RC)
+       AC_LIBTOOL_LANG_RC_CONFIG
+       ;;
 
+      *)
+       AC_MSG_ERROR([Unsupported tag name: $tagname])
+       ;;
+      esac
 
-# AC_LIBTOOL_SYS_DYNAMIC_LINKER
-# -----------------------------
-# PORTME Fill in your ld.so characteristics
-AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
-[AC_MSG_CHECKING([dynamic linker characteristics])
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-shrext_cmds=".so"
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-if test "$GCC" = yes; then
-  sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-  if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
-    # if the path contains ";" then we assume it to be the separator
-    # otherwise default to the standard path separator (i.e. ":") - it is
-    # assumed that no part of a normal pathname contains ";" but that should
-    # okay in the real world where ";" in dirpaths is itself problematic.
-    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      # Append the new tag name to the list of available tags.
+      if test -n "$tagname" ; then
+      available_tags="$available_tags $tagname"
+    fi
+    fi
+  done
+  IFS="$lt_save_ifs"
+
+  # Now substitute the updated list of available tags.
+  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
+    mv "${ofile}T" "$ofile"
+    chmod +x "$ofile"
   else
-    sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
+    rm -f "${ofile}T"
+    AC_MSG_ERROR([unable to update list of available tagged configurations.])
   fi
-else
-  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
 fi
-need_lib_prefix=unknown
-hardcode_into_libs=no
+])# _LT_AC_TAGCONFIG
 
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-need_version=unknown
 
-case $host_os in
-aix3*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
-  shlibpath_var=LIBPATH
+# AC_LIBTOOL_DLOPEN
+# -----------------
+# enable checks for dlopen support
+AC_DEFUN([AC_LIBTOOL_DLOPEN],
+ [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
+])# AC_LIBTOOL_DLOPEN
 
-  # AIX 3 has no versioning support, so we append a major version to the name.
-  soname_spec='${libname}${release}${shared_ext}$major'
-  ;;
 
-aix4* | aix5*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  hardcode_into_libs=yes
-  if test "$host_cpu" = ia64; then
-    # AIX 5 supports IA64
-    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
-    shlibpath_var=LD_LIBRARY_PATH
-  else
-    # With GCC up to 2.95.x, collect2 would create an import file
-    # for dependence libraries.  The import file would start with
-    # the line `#! .'.  This would cause the generated library to
-    # depend on `.', always an invalid library.  This was fixed in
-    # development snapshots of GCC prior to 3.0.
-    case $host_os in
-      aix4 | aix4.[[01]] | aix4.[[01]].*)
-      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
-          echo ' yes '
-          echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then
-       :
-      else
-       can_build_shared=no
-      fi
-      ;;
-    esac
-    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
-    # soname into executable. Probably we can add versioning support to
-    # collect2, so additional links can be useful in future.
-    if test "$aix_use_runtimelinking" = yes; then
-      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
-      # instead of lib<name>.a to let people know that these are not
-      # typical AIX shared libraries.
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    else
-      # We preserve .a as extension for shared libraries through AIX4.2
-      # and later when we are not doing run time linking.
-      library_names_spec='${libname}${release}.a $libname.a'
-      soname_spec='${libname}${release}${shared_ext}$major'
-    fi
-    shlibpath_var=LIBPATH
-  fi
-  ;;
+# AC_LIBTOOL_WIN32_DLL
+# --------------------
+# declare package support for building win32 DLLs
+AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
+])# AC_LIBTOOL_WIN32_DLL
 
-amigaos*)
-  library_names_spec='$libname.ixlibrary $libname.a'
-  # Create ${libname}_ixlibrary.a entries in /sys/libs.
-  finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
-  ;;
 
-beos*)
-  library_names_spec='${libname}${shared_ext}'
-  dynamic_linker="$host_os ld.so"
-  shlibpath_var=LIBRARY_PATH
-  ;;
+# AC_ENABLE_SHARED([DEFAULT])
+# ---------------------------
+# implement the --enable-shared flag
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+AC_DEFUN([AC_ENABLE_SHARED],
+[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([shared],
+    [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+       [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_shared=yes ;;
+    no) enable_shared=no ;;
+    *)
+      enable_shared=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+       IFS="$lt_save_ifs"
+       if test "X$pkg" = "X$p"; then
+         enable_shared=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
+])# AC_ENABLE_SHARED
 
-bsdi[[45]]*)
-  version_type=linux
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
-  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
-  # the default ld.so.conf also contains /usr/contrib/lib and
-  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
-  # libtool to hard-code these into programs
-  ;;
 
-cygwin* | mingw* | pw32*)
-  version_type=windows
-  shrext_cmds=".dll"
-  need_version=no
-  need_lib_prefix=no
+# AC_DISABLE_SHARED
+# -----------------
+#- set the default shared flag to --disable-shared
+AC_DEFUN([AC_DISABLE_SHARED],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_SHARED(no)
+])# AC_DISABLE_SHARED
 
-  case $GCC,$host_os in
-  yes,cygwin* | yes,mingw* | yes,pw32*)
-    library_names_spec='$libname.dll.a'
-    # DLL is installed to $(libdir)/../bin by postinstall_cmds
-    postinstall_cmds='base_file=`basename \${file}`~
-      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
-      dldir=$destdir/`dirname \$dlpath`~
-      test -d \$dldir || mkdir -p \$dldir~
-      $install_prog $dir/$dlname \$dldir/$dlname~
-      chmod a+x \$dldir/$dlname'
-    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
-      dlpath=$dir/\$dldll~
-       $rm \$dlpath'
-    shlibpath_overrides_runpath=yes
 
-    case $host_os in
-    cygwin*)
-      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
-      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib"
+# AC_ENABLE_STATIC([DEFAULT])
+# ---------------------------
+# implement the --enable-static flag
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+AC_DEFUN([AC_ENABLE_STATIC],
+[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([static],
+    [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+       [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_static=yes ;;
+    no) enable_static=no ;;
+    *)
+     enable_static=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+       IFS="$lt_save_ifs"
+       if test "X$pkg" = "X$p"; then
+         enable_static=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
       ;;
-    mingw*)
-      # MinGW DLLs use traditional 'lib' prefix
-      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
-      sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
-      if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
-        # It is most probably a Windows format PATH printed by
-        # mingw gcc, but we are running on Cygwin. Gcc prints its search
-        # path with ; separators, and with drive letters. We can handle the
-        # drive letters (cygwin fileutils understands them), so leave them,
-        # especially as we might pass files found there to a mingw objdump,
-        # which wouldn't understand a cygwinified path. Ahh.
-        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
-      else
-        sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED  -e "s/$PATH_SEPARATOR/ /g"`
-      fi
-      ;;
-    pw32*)
-      # pw32 DLLs use 'pw' prefix rather than 'lib'
-      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+    esac],
+    [enable_static=]AC_ENABLE_STATIC_DEFAULT)
+])# AC_ENABLE_STATIC
+
+
+# AC_DISABLE_STATIC
+# -----------------
+# set the default static flag to --disable-static
+AC_DEFUN([AC_DISABLE_STATIC],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_STATIC(no)
+])# AC_DISABLE_STATIC
+
+
+# AC_ENABLE_FAST_INSTALL([DEFAULT])
+# ---------------------------------
+# implement the --enable-fast-install flag
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+AC_DEFUN([AC_ENABLE_FAST_INSTALL],
+[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE([fast-install],
+    [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+    [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_fast_install=yes ;;
+    no) enable_fast_install=no ;;
+    *)
+      enable_fast_install=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+       IFS="$lt_save_ifs"
+       if test "X$pkg" = "X$p"; then
+         enable_fast_install=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
       ;;
-    esac
-    ;;
+    esac],
+    [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
+])# AC_ENABLE_FAST_INSTALL
 
-  *)
-    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
-    ;;
-  esac
-  dynamic_linker='Win32 ld.exe'
-  # FIXME: first we should search . and the directory the executable is in
-  shlibpath_var=PATH
-  ;;
 
-darwin* | rhapsody*)
-  dynamic_linker="$host_os dyld"
-  version_type=darwin
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
-  soname_spec='${libname}${release}${major}$shared_ext'
-  shlibpath_overrides_runpath=yes
-  shlibpath_var=DYLD_LIBRARY_PATH
-  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
-  # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
-  if test "$GCC" = yes; then
-    sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
-  else
-    sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
-  fi
-  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
-  ;;
+# AC_DISABLE_FAST_INSTALL
+# -----------------------
+# set the default to --disable-fast-install
+AC_DEFUN([AC_DISABLE_FAST_INSTALL],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_FAST_INSTALL(no)
+])# AC_DISABLE_FAST_INSTALL
 
-dgux*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  ;;
 
-freebsd1*)
-  dynamic_linker=no
+# AC_LIBTOOL_PICMODE([MODE])
+# --------------------------
+# implement the --with-pic flag
+# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
+AC_DEFUN([AC_LIBTOOL_PICMODE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+pic_mode=ifelse($#,1,$1,default)
+])# AC_LIBTOOL_PICMODE
+
+
+# AC_PROG_EGREP
+# -------------
+# This is predefined starting with Autoconf 2.54, so this conditional
+# definition can be removed once we require Autoconf 2.54 or later.
+m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
+[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
+   [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+    then ac_cv_prog_egrep='grep -E'
+    else ac_cv_prog_egrep='egrep'
+    fi])
+ EGREP=$ac_cv_prog_egrep
+ AC_SUBST([EGREP])
+])])
+
+
+# AC_PATH_TOOL_PREFIX
+# -------------------
+# find a file program which can recognise shared library
+AC_DEFUN([AC_PATH_TOOL_PREFIX],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
+[case $MAGIC_CMD in
+[[\\/*] |  ?:[\\/]*])
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
   ;;
+*)
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+dnl $ac_dummy forces splitting on constant user-supplied paths.
+dnl POSIX.2 word splitting is done only on the output of word expansions,
+dnl not every word.  This closes a longstanding sh security hole.
+  ac_dummy="ifelse([$2], , $PATH, [$2])"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$1; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
+      if test -n "$file_magic_test_file"; then
+       case $deplibs_check_method in
+       "file_magic "*)
+         file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+         MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+         if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+           $EGREP "$file_magic_regex" > /dev/null; then
+           :
+         else
+           cat <<EOF 1>&2
 
-kfreebsd*-gnu)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='GNU ld.so'
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+EOF
+         fi ;;
+       esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
   ;;
+esac])
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  AC_MSG_RESULT($MAGIC_CMD)
+else
+  AC_MSG_RESULT(no)
+fi
+])# AC_PATH_TOOL_PREFIX
 
-freebsd* | dragonfly*)
-  # DragonFly does not have aout.  When/if they implement a new
-  # versioning mechanism, adjust this.
-  if test -x /usr/bin/objformat; then
-    objformat=`/usr/bin/objformat`
+
+# AC_PATH_MAGIC
+# -------------
+# find a file program which can recognise a shared library
+AC_DEFUN([AC_PATH_MAGIC],
+[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+  if test -n "$ac_tool_prefix"; then
+    AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
   else
-    case $host_os in
-    freebsd[[123]]*) objformat=aout ;;
-    *) objformat=elf ;;
-    esac
+    MAGIC_CMD=:
   fi
-  version_type=freebsd-$objformat
-  case $version_type in
-    freebsd-elf*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
-      need_version=no
-      need_lib_prefix=no
-      ;;
-    freebsd-*)
-      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
-      need_version=yes
-      ;;
-  esac
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_os in
-  freebsd2*)
-    shlibpath_overrides_runpath=yes
-    ;;
-  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
-    shlibpath_overrides_runpath=yes
-    hardcode_into_libs=yes
-    ;;
-  *) # from 3.2 on
-    shlibpath_overrides_runpath=no
-    hardcode_into_libs=yes
-    ;;
-  esac
-  ;;
+fi
+])# AC_PATH_MAGIC
 
-gnu*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  hardcode_into_libs=yes
-  ;;
 
-hpux9* | hpux10* | hpux11*)
-  # Give a soname corresponding to the major version so that dld.sl refuses to
-  # link against other versions.
-  version_type=sunos
-  need_lib_prefix=no
-  need_version=no
-  case $host_cpu in
-  ia64*)
-    shrext_cmds='.so'
-    hardcode_into_libs=yes
-    dynamic_linker="$host_os dld.so"
-    shlibpath_var=LD_LIBRARY_PATH
-    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    if test "X$HPUX_IA64_MODE" = X32; then
-      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
-    else
-      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
-    fi
-    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-    ;;
-   hppa*64*)
-     shrext_cmds='.sl'
-     hardcode_into_libs=yes
-     dynamic_linker="$host_os dld.sl"
-     shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
-     shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
-     library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-     soname_spec='${libname}${release}${shared_ext}$major'
-     sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
-     sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
-     ;;
-   *)
-    shrext_cmds='.sl'
-    dynamic_linker="$host_os dld.sl"
-    shlibpath_var=SHLIB_PATH
-    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
-    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-    soname_spec='${libname}${release}${shared_ext}$major'
-    ;;
-  esac
-  # HP-UX runs *really* slowly unless shared libraries are mode 555.
-  postinstall_cmds='chmod 555 $lib'
-  ;;
-
-irix5* | irix6* | nonstopux*)
-  case $host_os in
-    nonstopux*) version_type=nonstopux ;;
-    *)
-       if test "$lt_cv_prog_gnu_ld" = yes; then
-               version_type=linux
-       else
-               version_type=irix
-       fi ;;
+# AC_PROG_LD
+# ----------
+# find the pathname to the GNU or non-GNU linker
+AC_DEFUN([AC_PROG_LD],
+[AC_ARG_WITH([gnu-ld],
+    [AC_HELP_STRING([--with-gnu-ld],
+       [assume the C compiler uses GNU ld @<:@default=no@:>@])],
+    [test "$withval" = no || with_gnu_ld=yes],
+    [with_gnu_ld=no])
+AC_REQUIRE([LT_AC_PROG_SED])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  AC_MSG_CHECKING([for ld used by $CC])
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
   esac
-  need_lib_prefix=no
-  need_version=no
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
-  case $host_os in
-  irix5* | nonstopux*)
-    libsuff= shlibsuff=
+  case $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
     ;;
   *)
-    case $LD in # libtool.m4 will add one of these switches to LD
-    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
-      libsuff= shlibsuff= libmagic=32-bit;;
-    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
-      libsuff=32 shlibsuff=N32 libmagic=N32;;
-    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
-      libsuff=64 shlibsuff=64 libmagic=64-bit;;
-    *) libsuff= shlibsuff= libmagic=never-match;;
-    esac
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
     ;;
   esac
-  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
-  shlibpath_overrides_runpath=no
-  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
-  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
-  hardcode_into_libs=yes
-  ;;
+elif test "$with_gnu_ld" = yes; then
+  AC_MSG_CHECKING([for GNU ld])
+else
+  AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(lt_cv_path_LD,
+[if test -z "$LD"; then
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some variants of GNU ld only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+       test "$with_gnu_ld" != no && break
+       ;;
+      *)
+       test "$with_gnu_ld" != yes && break
+       ;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  AC_MSG_RESULT($LD)
+else
+  AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+AC_PROG_LD_GNU
+])# AC_PROG_LD
 
-# No shared lib support for Linux oldld, aout, or coff.
-linux*oldld* | linux*aout* | linux*coff*)
-  dynamic_linker=no
+
+# AC_PROG_LD_GNU
+# --------------
+AC_DEFUN([AC_PROG_LD_GNU],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
   ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])# AC_PROG_LD_GNU
 
-# This must be Linux ELF.
-linux*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  # This implies no fast_install, which is unacceptable.
-  # Some rework will be needed to allow for fast_install
-  # before this can be enabled.
-  hardcode_into_libs=yes
 
-  # Append ld.so.conf contents to the search path
-  if test -f /etc/ld.so.conf; then
-    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:,   ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
-    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
-  fi
+# AC_PROG_LD_RELOAD_FLAG
+# ----------------------
+# find reload flag for linker
+#   -- PORTME Some linkers may need a different reload flag.
+AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
+[AC_CACHE_CHECK([for $LD option to reload object files],
+  lt_cv_ld_reload_flag,
+  [lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+  darwin*)
+    if test "$GCC" = yes; then
+      reload_cmds='$CC -nostdlib ${wl}-r -o $output$reload_objs'
+    else
+      reload_cmds='$LD$reload_flag -o $output$reload_objs'
+    fi
+    ;;
+esac
+])# AC_PROG_LD_RELOAD_FLAG
 
-  # 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'
+
+# AC_DEPLIBS_CHECK_METHOD
+# -----------------------
+# how to check for library dependencies
+#  -- PORTME fill in with the dynamic library characteristics
+AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
+[AC_CACHE_CHECK([how to recognise dependent libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix4* | aix5*)
+  lt_cv_deplibs_check_method=pass_all
   ;;
 
-knetbsd*-gnu)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=no
-  hardcode_into_libs=yes
-  dynamic_linker='GNU ld.so'
+beos*)
+  lt_cv_deplibs_check_method=pass_all
   ;;
 
-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
+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
   ;;
 
-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
+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'
   ;;
 
-nto-qnx*)
-  version_type=linux
-  need_lib_prefix=no
-  need_version=no
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  shlibpath_overrides_runpath=yes
+mingw* | pw32*)
+  # Base MSYS/MinGW do not provide the 'file' command needed by
+  # func_win32_libid shell function, so use a weaker test based on 'objdump'.
+  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
   ;;
 
-openbsd*)
-  version_type=sunos
-  need_lib_prefix=no
-  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
-  case $host_os in
-    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
-    *)                         need_version=no  ;;
-  esac
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
-  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
-  shlibpath_var=LD_LIBRARY_PATH
-  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-    case $host_os in
-      openbsd2.[[89]] | openbsd2.[[89]].*)
-       shlibpath_overrides_runpath=no
-       ;;
-      *)
-       shlibpath_overrides_runpath=yes
-       ;;
-      esac
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+freebsd* | kfreebsd*-gnu | dragonfly*)
+  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+    case $host_cpu in
+    i*86 )
+      # Not sure whether the presence of OpenBSD here was a mistake.
+      # Let's accept both of them until this is cleared up.
+      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
+      lt_cv_file_magic_cmd=/usr/bin/file
+      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+      ;;
+    esac
   else
-    shlibpath_overrides_runpath=yes
+    lt_cv_deplibs_check_method=pass_all
   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
+gnu*)
+  lt_cv_deplibs_check_method=pass_all
   ;;
 
-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"
+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
   ;;
 
-sco3.2v5*)
-  version_type=osf
-  soname_spec='${libname}${release}${shared_ext}$major'
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  shlibpath_var=LD_LIBRARY_PATH
+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
   ;;
 
-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'
+# This must be Linux ELF.
+linux*)
+  lt_cv_deplibs_check_method=pass_all
   ;;
 
-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
+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
-  need_version=yes
   ;;
 
-sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-  version_type=linux
-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
-  soname_spec='${libname}${release}${shared_ext}$major'
-  shlibpath_var=LD_LIBRARY_PATH
-  case $host_vendor in
-    sni)
-      shlibpath_overrides_runpath=no
-      need_lib_prefix=no
-      export_dynamic_flag_spec='${wl}-Blargedynsym'
-      runpath_var=LD_RUN_PATH
-      ;;
-    siemens)
-      need_lib_prefix=no
-      ;;
-    motorola)
-      need_lib_prefix=no
-      need_version=no
-      shlibpath_overrides_runpath=no
-      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
-      ;;
-  esac
+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
   ;;
 
-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
+nto-qnx*)
+  lt_cv_deplibs_check_method=unknown
+  ;;
+
+openbsd*)
+  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
   fi
   ;;
 
-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
+osf3* | osf4* | osf5*)
+  lt_cv_deplibs_check_method=pass_all
   ;;
 
-*)
-  dynamic_linker=no
+sco3.2v5*)
+  lt_cv_deplibs_check_method=pass_all
   ;;
-esac
-AC_MSG_RESULT([$dynamic_linker])
-test "$dynamic_linker" = no && can_build_shared=no
-])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
 
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
 
-# _LT_AC_TAGCONFIG
-# ----------------
-AC_DEFUN([_LT_AC_TAGCONFIG],
-[AC_ARG_WITH([tags],
-    [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
-        [include additional configurations @<:@automatic@:>@])],
-    [tagnames="$withval"])
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+  case $host_vendor in
+  motorola)
+    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
+    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+    ;;
+  ncr)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  sequent)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
+    ;;
+  sni)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
+    lt_cv_file_magic_test_file=/lib/libc.so
+    ;;
+  siemens)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  esac
+  ;;
 
-if test -f "$ltmain" && test -n "$tagnames"; then
-  if test ! -f "${ofile}"; then
-    AC_MSG_WARN([output file `$ofile' does not exist])
-  fi
+sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+esac
+])
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+])# AC_DEPLIBS_CHECK_METHOD
 
-  if test -z "$LTCC"; then
-    eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
-    if test -z "$LTCC"; then
-      AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
-    else
-      AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
+
+# AC_PROG_NM
+# ----------
+# find the pathname to a BSD-compatible name lister
+AC_DEFUN([AC_PROG_NM],
+[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
+[if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    tmp_nm="$ac_dir/${ac_tool_prefix}nm"
+    if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+      # Check to see if the nm accepts a BSD-compat flag.
+      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+      #   nm: unknown option "B" ignored
+      # Tru64's nm complains that /dev/null is an invalid object file
+      case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+      */dev/null* | *'Invalid file or object type'*)
+       lt_cv_path_NM="$tmp_nm -B"
+       break
+        ;;
+      *)
+       case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+       */dev/null*)
+         lt_cv_path_NM="$tmp_nm -p"
+         break
+         ;;
+       *)
+         lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+         continue # so that we can try to find one that supports BSD flags
+         ;;
+       esac
+      esac
     fi
-  fi
+  done
+  IFS="$lt_save_ifs"
+  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+fi])
+NM="$lt_cv_path_NM"
+])# AC_PROG_NM
 
-  # Extract list of available tagged configurations in $ofile.
-  # Note that this assumes the entire list is on one line.
-  available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
 
-  lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-  for tagname in $tagnames; do
-    IFS="$lt_save_ifs"
-    # Check whether tagname contains only valid characters
-    case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
-    "") ;;
-    *)  AC_MSG_ERROR([invalid tag name: $tagname])
-       ;;
-    esac
+# AC_CHECK_LIBM
+# -------------
+# check for math library
+AC_DEFUN([AC_CHECK_LIBM],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case $host in
+*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
+  # These system don't have libm, or don't need it
+  ;;
+*-ncr-sysv4.3*)
+  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
+  ;;
+*)
+  AC_CHECK_LIB(m, cos, LIBM="-lm")
+  ;;
+esac
+])# AC_CHECK_LIBM
 
-    if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
-    then
-      AC_MSG_ERROR([tag name \"$tagname\" already exists])
-    fi
 
-    # Update the list of available tags.
-    if test -n "$tagname"; then
-      echo appending configuration tag \"$tagname\" to $ofile
+# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
+# -----------------------------------
+# sets LIBLTDL to the link flags for the libltdl convenience library and
+# LTDLINCL to the include flags for the libltdl header and adds
+# --enable-ltdl-convenience to the configure arguments.  Note that
+# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
+# it is assumed to be `libltdl'.  LIBLTDL will be prefixed with
+# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/'
+# (note the single quotes!).  If your package is not flat and you're not
+# using automake, define top_builddir and top_srcdir appropriately in
+# the Makefiles.
+AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+  case $enable_ltdl_convenience in
+  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
+  "") enable_ltdl_convenience=yes
+      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
+  esac
+  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
+  LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+  # For backwards non-gettext consistent compatibility...
+  INCLTDL="$LTDLINCL"
+])# AC_LIBLTDL_CONVENIENCE
 
-      case $tagname in
-      CXX)
-       if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
-           ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
-           (test "X$CXX" != "Xg++"))) ; then
-         AC_LIBTOOL_LANG_CXX_CONFIG
-       else
-         tagname=""
-       fi
-       ;;
 
-      F77)
-       if test -n "$F77" && test "X$F77" != "Xno"; then
-         AC_LIBTOOL_LANG_F77_CONFIG
-       else
-         tagname=""
-       fi
-       ;;
+# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
+# -----------------------------------
+# sets LIBLTDL to the link flags for the libltdl installable library and
+# LTDLINCL to the include flags for the libltdl header and adds
+# --enable-ltdl-install to the configure arguments.  Note that
+# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
+# and an installed libltdl is not found, it is assumed to be `libltdl'.
+# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with
+# '${top_srcdir}/' (note the single quotes!).  If your package is not
+# flat and you're not using automake, define top_builddir and top_srcdir
+# appropriately in the Makefiles.
+# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
+AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+  AC_CHECK_LIB(ltdl, lt_dlinit,
+  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
+  [if test x"$enable_ltdl_install" = xno; then
+     AC_MSG_WARN([libltdl not installed, but installation disabled])
+   else
+     enable_ltdl_install=yes
+   fi
+  ])
+  if test x"$enable_ltdl_install" = x"yes"; then
+    ac_configure_args="$ac_configure_args --enable-ltdl-install"
+    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
+    LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+  else
+    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
+    LIBLTDL="-lltdl"
+    LTDLINCL=
+  fi
+  # For backwards non-gettext consistent compatibility...
+  INCLTDL="$LTDLINCL"
+])# AC_LIBLTDL_INSTALLABLE
 
-      GCJ)
-       if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
-         AC_LIBTOOL_LANG_GCJ_CONFIG
-       else
-         tagname=""
-       fi
-       ;;
 
-      RC)
-       AC_LIBTOOL_LANG_RC_CONFIG
-       ;;
+# AC_LIBTOOL_CXX
+# --------------
+# enable support for C++ libraries
+AC_DEFUN([AC_LIBTOOL_CXX],
+[AC_REQUIRE([_LT_AC_LANG_CXX])
+])# AC_LIBTOOL_CXX
 
-      *)
-       AC_MSG_ERROR([Unsupported tag name: $tagname])
-       ;;
-      esac
 
-      # Append the new tag name to the list of available tags.
-      if test -n "$tagname" ; then
-      available_tags="$available_tags $tagname"
-    fi
-    fi
-  done
-  IFS="$lt_save_ifs"
+# _LT_AC_LANG_CXX
+# ---------------
+AC_DEFUN([_LT_AC_LANG_CXX],
+[AC_REQUIRE([AC_PROG_CXX])
+AC_REQUIRE([_LT_AC_PROG_CXXCPP])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
+])# _LT_AC_LANG_CXX
 
-  # Now substitute the updated list of available tags.
-  if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
-    mv "${ofile}T" "$ofile"
-    chmod +x "$ofile"
-  else
-    rm -f "${ofile}T"
-    AC_MSG_ERROR([unable to update list of available tagged configurations.])
-  fi
+# _LT_AC_PROG_CXXCPP
+# ---------------
+AC_DEFUN([_LT_AC_PROG_CXXCPP],
+[
+AC_REQUIRE([AC_PROG_CXX])
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+    (test "X$CXX" != "Xg++"))) ; then
+  AC_PROG_CXXCPP
 fi
-])# _LT_AC_TAGCONFIG
+])# _LT_AC_PROG_CXXCPP
 
+# AC_LIBTOOL_F77
+# --------------
+# enable support for Fortran 77 libraries
+AC_DEFUN([AC_LIBTOOL_F77],
+[AC_REQUIRE([_LT_AC_LANG_F77])
+])# AC_LIBTOOL_F77
 
-# AC_LIBTOOL_DLOPEN
-# -----------------
-# enable checks for dlopen support
-AC_DEFUN([AC_LIBTOOL_DLOPEN],
- [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
-])# AC_LIBTOOL_DLOPEN
 
+# _LT_AC_LANG_F77
+# ---------------
+AC_DEFUN([_LT_AC_LANG_F77],
+[AC_REQUIRE([AC_PROG_F77])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
+])# _LT_AC_LANG_F77
 
-# AC_LIBTOOL_WIN32_DLL
-# --------------------
-# declare package support for building win32 DLLs
-AC_DEFUN([AC_LIBTOOL_WIN32_DLL],
-[AC_BEFORE([$0], [AC_LIBTOOL_SETUP])
-])# AC_LIBTOOL_WIN32_DLL
 
+# AC_LIBTOOL_GCJ
+# --------------
+# enable support for GCJ libraries
+AC_DEFUN([AC_LIBTOOL_GCJ],
+[AC_REQUIRE([_LT_AC_LANG_GCJ])
+])# AC_LIBTOOL_GCJ
 
-# AC_ENABLE_SHARED([DEFAULT])
-# ---------------------------
-# implement the --enable-shared flag
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
-AC_DEFUN([AC_ENABLE_SHARED],
-[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE([shared],
-    [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
-       [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
-    [p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_shared=yes ;;
-    no) enable_shared=no ;;
-    *)
-      enable_shared=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-       IFS="$lt_save_ifs"
-       if test "X$pkg" = "X$p"; then
-         enable_shared=yes
-       fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac],
-    [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
-])# AC_ENABLE_SHARED
-
-
-# AC_DISABLE_SHARED
-# -----------------
-#- set the default shared flag to --disable-shared
-AC_DEFUN([AC_DISABLE_SHARED],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_SHARED(no)
-])# AC_DISABLE_SHARED
-
-
-# AC_ENABLE_STATIC([DEFAULT])
-# ---------------------------
-# implement the --enable-static flag
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
-AC_DEFUN([AC_ENABLE_STATIC],
-[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE([static],
-    [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
-       [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
-    [p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_static=yes ;;
-    no) enable_static=no ;;
-    *)
-     enable_static=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-       IFS="$lt_save_ifs"
-       if test "X$pkg" = "X$p"; then
-         enable_static=yes
-       fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac],
-    [enable_static=]AC_ENABLE_STATIC_DEFAULT)
-])# AC_ENABLE_STATIC
-
-
-# AC_DISABLE_STATIC
-# -----------------
-# set the default static flag to --disable-static
-AC_DEFUN([AC_DISABLE_STATIC],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_STATIC(no)
-])# AC_DISABLE_STATIC
 
+# _LT_AC_LANG_GCJ
+# ---------------
+AC_DEFUN([_LT_AC_LANG_GCJ],
+[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
+  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
+    [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
+      [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
+        [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
+          [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
+])# _LT_AC_LANG_GCJ
 
-# AC_ENABLE_FAST_INSTALL([DEFAULT])
-# ---------------------------------
-# implement the --enable-fast-install flag
-# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
-AC_DEFUN([AC_ENABLE_FAST_INSTALL],
-[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
-AC_ARG_ENABLE([fast-install],
-    [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
-    [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
-    [p=${PACKAGE-default}
-    case $enableval in
-    yes) enable_fast_install=yes ;;
-    no) enable_fast_install=no ;;
-    *)
-      enable_fast_install=no
-      # Look at the argument we got.  We use all the common list separators.
-      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
-      for pkg in $enableval; do
-       IFS="$lt_save_ifs"
-       if test "X$pkg" = "X$p"; then
-         enable_fast_install=yes
-       fi
-      done
-      IFS="$lt_save_ifs"
-      ;;
-    esac],
-    [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
-])# AC_ENABLE_FAST_INSTALL
 
+# AC_LIBTOOL_RC
+# --------------
+# enable support for Windows resource files
+AC_DEFUN([AC_LIBTOOL_RC],
+[AC_REQUIRE([LT_AC_PROG_RC])
+_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
+])# AC_LIBTOOL_RC
 
-# AC_DISABLE_FAST_INSTALL
-# -----------------------
-# set the default to --disable-fast-install
-AC_DEFUN([AC_DISABLE_FAST_INSTALL],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-AC_ENABLE_FAST_INSTALL(no)
-])# AC_DISABLE_FAST_INSTALL
 
+# AC_LIBTOOL_LANG_C_CONFIG
+# ------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined.  Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
+AC_DEFUN([_LT_AC_LANG_C_CONFIG],
+[lt_save_CC="$CC"
+AC_LANG_PUSH(C)
 
-# AC_LIBTOOL_PICMODE([MODE])
-# --------------------------
-# implement the --with-pic flag
-# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
-AC_DEFUN([AC_LIBTOOL_PICMODE],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-pic_mode=ifelse($#,1,$1,default)
-])# AC_LIBTOOL_PICMODE
+# Source file extension for C test sources.
+ac_ext=c
 
+# Object file extension for compiled C test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
 
-# AC_PROG_EGREP
-# -------------
-# This is predefined starting with Autoconf 2.54, so this conditional
-# definition can be removed once we require Autoconf 2.54 or later.
-m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
-[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
-   [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
-    then ac_cv_prog_egrep='grep -E'
-    else ac_cv_prog_egrep='egrep'
-    fi])
- EGREP=$ac_cv_prog_egrep
- AC_SUBST([EGREP])
-])])
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
 
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}\n'
 
-# AC_PATH_TOOL_PREFIX
-# -------------------
-# find a file program which can recognise shared library
-AC_DEFUN([AC_PATH_TOOL_PREFIX],
-[AC_REQUIRE([AC_PROG_EGREP])dnl
-AC_MSG_CHECKING([for $1])
-AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
-[case $MAGIC_CMD in
-[[\\/*] |  ?:[\\/]*])
-  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
-  ;;
-*)
-  lt_save_MAGIC_CMD="$MAGIC_CMD"
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-dnl $ac_dummy forces splitting on constant user-supplied paths.
-dnl POSIX.2 word splitting is done only on the output of word expansions,
-dnl not every word.  This closes a longstanding sh security hole.
-  ac_dummy="ifelse([$2], , $PATH, [$2])"
-  for ac_dir in $ac_dummy; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    if test -f $ac_dir/$1; then
-      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
-      if test -n "$file_magic_test_file"; then
-       case $deplibs_check_method in
-       "file_magic "*)
-         file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
-         MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-         if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
-           $EGREP "$file_magic_regex" > /dev/null; then
-           :
-         else
-           cat <<EOF 1>&2
+_LT_AC_SYS_COMPILER
 
-*** Warning: the command libtool uses to detect shared libraries,
-*** $file_magic_cmd, produces output that libtool cannot recognize.
-*** The result is that libtool may fail to recognize shared libraries
-*** as such.  This will affect the creation of libtool libraries that
-*** depend on shared libraries, but programs linked with such libtool
-*** libraries will work regardless of this problem.  Nevertheless, you
-*** may want to report the problem to your system manager and/or to
-*** bug-libtool@gnu.org
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
 
-EOF
-         fi ;;
-       esac
-      fi
-      break
-    fi
-  done
-  IFS="$lt_save_ifs"
-  MAGIC_CMD="$lt_save_MAGIC_CMD"
-  ;;
-esac])
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
-  AC_MSG_RESULT($MAGIC_CMD)
-else
-  AC_MSG_RESULT(no)
+#
+# Check for any special shared library compilation flags.
+#
+_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)=
+if test "$GCC" = no; then
+  case $host_os in
+  sco3.2v5*)
+    _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf'
+    ;;
+  esac
 fi
-])# AC_PATH_TOOL_PREFIX
-
-
-# AC_PATH_MAGIC
-# -------------
-# find a file program which can recognise a shared library
-AC_DEFUN([AC_PATH_MAGIC],
-[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
-if test -z "$lt_cv_path_MAGIC_CMD"; then
-  if test -n "$ac_tool_prefix"; then
-    AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then
+  AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries])
+  if echo "$old_CC $old_CFLAGS " | grep "[[    ]]$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[        ]]" >/dev/null; then :
   else
-    MAGIC_CMD=:
+    AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure])
+    _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no
   fi
 fi
-])# AC_PATH_MAGIC
 
 
-# AC_PROG_LD
-# ----------
-# find the pathname to the GNU or non-GNU linker
-AC_DEFUN([AC_PROG_LD],
-[AC_ARG_WITH([gnu-ld],
-    [AC_HELP_STRING([--with-gnu-ld],
-       [assume the C compiler uses GNU ld @<:@default=no@:>@])],
-    [test "$withval" = no || with_gnu_ld=yes],
-    [with_gnu_ld=no])
-AC_REQUIRE([LT_AC_PROG_SED])dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-ac_prog=ld
-if test "$GCC" = yes; then
-  # Check if gcc -print-prog-name=ld gives a path.
-  AC_MSG_CHECKING([for ld used by $CC])
-  case $host in
-  *-*-mingw*)
-    # gcc leaves a trailing carriage return which upsets mingw
-    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
-  *)
-    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
-  esac
-  case $ac_prog in
-    # Accept absolute paths.
-    [[\\/]]* | ?:[[\\/]]*)
-      re_direlt='/[[^/]][[^/]]*/\.\./'
-      # Canonicalize the pathname of ld
-      ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'`
-      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
-       ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
-      done
-      test -z "$LD" && LD="$ac_prog"
-      ;;
-  "")
-    # If it fails, then pretend we aren't using GCC.
-    ac_prog=ld
-    ;;
-  *)
-    # If it is relative, then search for the first ld in PATH.
-    with_gnu_ld=unknown
-    ;;
-  esac
-elif test "$with_gnu_ld" = yes; then
-  AC_MSG_CHECKING([for GNU ld])
-else
-  AC_MSG_CHECKING([for non-GNU ld])
-fi
-AC_CACHE_VAL(lt_cv_path_LD,
-[if test -z "$LD"; then
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for ac_dir in $PATH; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      lt_cv_path_LD="$ac_dir/$ac_prog"
-      # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some variants of GNU ld only accept -v.
-      # Break only if it was the GNU/non-GNU ld that we prefer.
-      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
-      *GNU* | *'with BFD'*)
-       test "$with_gnu_ld" != no && break
-       ;;
-      *)
-       test "$with_gnu_ld" != yes && break
-       ;;
-      esac
-    fi
-  done
-  IFS="$lt_save_ifs"
-else
-  lt_cv_path_LD="$LD" # Let the user override the test with a path.
-fi])
-LD="$lt_cv_path_LD"
-if test -n "$LD"; then
-  AC_MSG_RESULT($LD)
-else
-  AC_MSG_RESULT(no)
-fi
-test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
-AC_PROG_LD_GNU
-])# AC_PROG_LD
+#
+# Check to make sure the static flag actually works.
+#
+AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works],
+  _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
+  $_LT_AC_TAGVAR(lt_prog_compiler_static, $1),
+  [],
+  [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
 
 
-# AC_PROG_LD_GNU
-# --------------
-AC_DEFUN([AC_PROG_LD_GNU],
-[AC_REQUIRE([AC_PROG_EGREP])dnl
-AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
-[# I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
-  lt_cv_prog_gnu_ld=yes
-  ;;
-*)
-  lt_cv_prog_gnu_ld=no
-  ;;
-esac])
-with_gnu_ld=$lt_cv_prog_gnu_ld
-])# AC_PROG_LD_GNU
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_DLOPEN_SELF($1)
 
+# Report which librarie types wil actually be built
+AC_MSG_CHECKING([if libtool supports shared libraries])
+AC_MSG_RESULT([$can_build_shared])
 
-# AC_PROG_LD_RELOAD_FLAG
-# ----------------------
-# find reload flag for linker
-#   -- PORTME Some linkers may need a different reload flag.
-AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
-[AC_CACHE_CHECK([for $LD option to reload object files],
-  lt_cv_ld_reload_flag,
-  [lt_cv_ld_reload_flag='-r'])
-reload_flag=$lt_cv_ld_reload_flag
-case $reload_flag in
-"" | " "*) ;;
-*) reload_flag=" $reload_flag" ;;
-esac
-reload_cmds='$LD$reload_flag -o $output$reload_objs'
+AC_MSG_CHECKING([whether to build shared libraries])
+test "$can_build_shared" = "no" && enable_shared=no
+
+# On AIX, shared libraries and static libraries use the same namespace, and
+# are all built from PIC.
 case $host_os in
-  darwin*)
-    if test "$GCC" = yes; then
-      reload_cmds='$CC -nostdlib ${wl}-r -o $output$reload_objs'
-    else
-      reload_cmds='$LD$reload_flag -o $output$reload_objs'
-    fi
+aix3*)
+  test "$enable_shared" = yes && enable_static=no
+  if test -n "$RANLIB"; then
+    archive_cmds="$archive_cmds~\$RANLIB \$lib"
+    postinstall_cmds='$RANLIB $lib'
+  fi
+  ;;
+
+aix4* | aix5*)
+  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+    test "$enable_shared" = yes && enable_static=no
+  fi
     ;;
 esac
-])# AC_PROG_LD_RELOAD_FLAG
+AC_MSG_RESULT([$enable_shared])
 
+AC_MSG_CHECKING([whether to build static libraries])
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+AC_MSG_RESULT([$enable_static])
 
-# AC_DEPLIBS_CHECK_METHOD
-# -----------------------
-# how to check for library dependencies
-#  -- PORTME fill in with the dynamic library characteristics
-AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
-[AC_CACHE_CHECK([how to recognise dependent libraries],
-lt_cv_deplibs_check_method,
-[lt_cv_file_magic_cmd='$MAGIC_CMD'
-lt_cv_file_magic_test_file=
-lt_cv_deplibs_check_method='unknown'
-# Need to set the preceding variable on all platforms that support
-# interlibrary dependencies.
-# 'none' -- dependencies not supported.
-# `unknown' -- same as none, but documents that we really don't know.
-# 'pass_all' -- all dependencies passed with no checks.
-# 'test_compile' -- check by making test program.
-# 'file_magic [[regex]]' -- check by looking for files in library path
-# which responds to the $file_magic_cmd with a given extended regex.
-# If you have `file' or equivalent on your system and you're not sure
-# whether `pass_all' will *always* work, you probably want this one.
+AC_LIBTOOL_CONFIG($1)
 
-case $host_os in
-aix4* | aix5*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
+AC_LANG_POP
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_C_CONFIG
 
-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
-  ;;
+# AC_LIBTOOL_LANG_CXX_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined.  Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
+AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
+[AC_LANG_PUSH(C++)
+AC_REQUIRE([AC_PROG_CXX])
+AC_REQUIRE([_LT_AC_PROG_CXXCPP])
 
-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'
-  ;;
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_AC_TAGVAR(allow_undefined_flag, $1)=
+_LT_AC_TAGVAR(always_export_symbols, $1)=no
+_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_direct, $1)=no
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+_LT_AC_TAGVAR(hardcode_automatic, $1)=no
+_LT_AC_TAGVAR(module_cmds, $1)=
+_LT_AC_TAGVAR(module_expsym_cmds, $1)=
+_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_AC_TAGVAR(no_undefined_flag, $1)=
+_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
 
-mingw* | pw32*)
-  # Base MSYS/MinGW do not provide the 'file' command needed by
-  # func_win32_libid shell function, so use a weaker test based on 'objdump'.
-  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
-  lt_cv_file_magic_cmd='$OBJDUMP -f'
-  ;;
+# Dependencies to place before and after the object being linked:
+_LT_AC_TAGVAR(predep_objects, $1)=
+_LT_AC_TAGVAR(postdep_objects, $1)=
+_LT_AC_TAGVAR(predeps, $1)=
+_LT_AC_TAGVAR(postdeps, $1)=
+_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
 
-darwin* | rhapsody*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
+# Source file extension for C++ test sources.
+ac_ext=cpp
 
-freebsd* | kfreebsd*-gnu | dragonfly*)
-  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
-    case $host_cpu in
-    i*86 )
-      # Not sure whether the presence of OpenBSD here was a mistake.
-      # Let's accept both of them until this is cleared up.
-      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
-      lt_cv_file_magic_cmd=/usr/bin/file
-      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
-      ;;
-    esac
-  else
-    lt_cv_deplibs_check_method=pass_all
-  fi
-  ;;
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
 
-gnu*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
 
-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
-  ;;
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
 
-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
-  ;;
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
 
-# This must be Linux ELF.
-linux*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
 
-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
-  ;;
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_LD=$LD
+lt_save_GCC=$GCC
+GCC=$GXX
+lt_save_with_gnu_ld=$with_gnu_ld
+lt_save_path_LD=$lt_cv_path_LD
+if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+  lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+else
+  unset lt_cv_prog_gnu_ld
+fi
+if test -n "${lt_cv_path_LDCXX+set}"; then
+  lt_cv_path_LD=$lt_cv_path_LDCXX
+else
+  unset lt_cv_path_LD
+fi
+test -z "${LDCXX+set}" || LD=$LDCXX
+CC=${CXX-"c++"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
 
-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
-  ;;
+# We don't want -fno-exception wen compiling C++ code, so set the
+# no_builtin_flag separately
+if test "$GXX" = yes; then
+  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+else
+  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+fi
 
-nto-qnx*)
-  lt_cv_deplibs_check_method=unknown
-  ;;
+if test "$GXX" = yes; then
+  # Set up default GNU C++ configuration
 
-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
-  ;;
+  AC_PROG_LD
 
-osf3* | osf4* | osf5*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
+  # Check if GNU C++ uses GNU ld as the underlying linker, since the
+  # archiving commands below assume that GNU ld is being used.
+  if test "$with_gnu_ld" = yes; then
+    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
 
-sco3.2v5*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
 
-solaris*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+    #     investigate it a little bit more. (MM)
+    wlarc='${wl}'
 
-sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-  case $host_vendor in
-  motorola)
-    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
-    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
-    ;;
-  ncr)
-    lt_cv_deplibs_check_method=pass_all
-    ;;
-  sequent)
-    lt_cv_file_magic_cmd='/bin/file'
-    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
-    ;;
-  sni)
-    lt_cv_file_magic_cmd='/bin/file'
-    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
-    lt_cv_file_magic_test_file=/lib/libc.so
-    ;;
-  siemens)
-    lt_cv_deplibs_check_method=pass_all
-    ;;
-  esac
-  ;;
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
+       grep 'no-whole-archive' > /dev/null; then
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+    fi
+  else
+    with_gnu_ld=no
+    wlarc=
 
-sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*)
-  lt_cv_deplibs_check_method=pass_all
-  ;;
-esac
-])
-file_magic_cmd=$lt_cv_file_magic_cmd
-deplibs_check_method=$lt_cv_deplibs_check_method
-test -z "$deplibs_check_method" && deplibs_check_method=unknown
-])# AC_DEPLIBS_CHECK_METHOD
+    # A generic and very simple default shared library creation
+    # command for GNU C++ for the case where it uses the native
+    # linker, instead of GNU ld.  If possible, this setting should
+    # overridden to take advantage of the native linker features on
+    # the platform it is being used on.
+    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+  fi
 
+  # Commands to make compiler produce verbose output that lists
+  # what "hidden" libraries, object files and flags are used when
+  # linking a shared library.
+  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
 
-# AC_PROG_NM
-# ----------
-# find the pathname to a BSD-compatible name lister
-AC_DEFUN([AC_PROG_NM],
-[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM,
-[if test -n "$NM"; then
-  # Let the user override the test.
-  lt_cv_path_NM="$NM"
 else
-  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
-    IFS="$lt_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    tmp_nm="$ac_dir/${ac_tool_prefix}nm"
-    if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
-      # Check to see if the nm accepts a BSD-compat flag.
-      # Adding the `sed 1q' prevents false positives on HP-UX, which says:
-      #   nm: unknown option "B" ignored
-      # Tru64's nm complains that /dev/null is an invalid object file
-      case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
-      */dev/null* | *'Invalid file or object type'*)
-       lt_cv_path_NM="$tmp_nm -B"
-       break
-        ;;
-      *)
-       case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
-       */dev/null*)
-         lt_cv_path_NM="$tmp_nm -p"
-         break
-         ;;
-       *)
-         lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
-         continue # so that we can try to find one that supports BSD flags
-         ;;
-       esac
+  GXX=no
+  with_gnu_ld=no
+  wlarc=
+fi
+
+# PORTME: fill in a description of your system's C++ link characteristics
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+_LT_AC_TAGVAR(ld_shlibs, $1)=yes
+case $host_os in
+  aix3*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  aix4* | aix5*)
+    if test "$host_cpu" = ia64; then
+      # On IA64, the linker does run time linking by default, so we don't
+      # have to do anything special.
+      aix_use_runtimelinking=no
+      exp_sym_flag='-Bexport'
+      no_entry_flag=""
+    else
+      aix_use_runtimelinking=no
+
+      # Test if we are trying to use run time linking or normal
+      # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+      # need to do runtime linking.
+      case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
+       for ld_flag in $LDFLAGS; do
+         case $ld_flag in
+         *-brtl*)
+           aix_use_runtimelinking=yes
+           break
+           ;;
+         esac
+       done
       esac
+
+      exp_sym_flag='-bexport'
+      no_entry_flag='-bnoentry'
     fi
-  done
-  IFS="$lt_save_ifs"
-  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
-fi])
-NM="$lt_cv_path_NM"
-])# AC_PROG_NM
 
+    # When large executables or shared objects are built, AIX ld can
+    # have problems creating the table of contents.  If linking a library
+    # or program results in "error TOC overflow" add -mminimal-toc to
+    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
 
-# AC_CHECK_LIBM
-# -------------
-# check for math library
-AC_DEFUN([AC_CHECK_LIBM],
-[AC_REQUIRE([AC_CANONICAL_HOST])dnl
-LIBM=
-case $host in
-*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
-  # These system don't have libm, or don't need it
-  ;;
-*-ncr-sysv4.3*)
-  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
-  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
-  ;;
-*)
-  AC_CHECK_LIB(m, cos, LIBM="-lm")
-  ;;
-esac
-])# AC_CHECK_LIBM
+    _LT_AC_TAGVAR(archive_cmds, $1)=''
+    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
 
+    if test "$GXX" = yes; then
+      case $host_os in aix4.[[012]]|aix4.[[012]].*)
+      # We only want to do this on AIX 4.2 and lower, the check
+      # below for broken collect2 doesn't work under 4.3+
+       collect2name=`${CC} -print-prog-name=collect2`
+       if test -f "$collect2name" && \
+          strings "$collect2name" | grep resolve_lib_name >/dev/null
+       then
+         # We have reworked collect2
+         _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+       else
+         # We have old collect2
+         _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
+         # It fails to find uninstalled libraries when the uninstalled
+         # path is not listed in the libpath.  Setting hardcode_minus_L
+         # to unsupported forces relinking
+         _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+       fi
+      esac
+      shared_flag='-shared'
+      if test "$aix_use_runtimelinking" = yes; then
+       shared_flag="$shared_flag "'${wl}-G'
+      fi
+    else
+      # not using gcc
+      if test "$host_cpu" = ia64; then
+       # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+       # chokes on -Wl,-G. The following line is correct:
+       shared_flag='-G'
+      else
+       if test "$aix_use_runtimelinking" = yes; then
+         shared_flag='${wl}-G'
+       else
+         shared_flag='${wl}-bM:SRE'
+       fi
+      fi
+    fi
 
-# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
-# -----------------------------------
-# sets LIBLTDL to the link flags for the libltdl convenience library and
-# LTDLINCL to the include flags for the libltdl header and adds
-# --enable-ltdl-convenience to the configure arguments.  Note that
-# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
-# it is assumed to be `libltdl'.  LIBLTDL will be prefixed with
-# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/'
-# (note the single quotes!).  If your package is not flat and you're not
-# using automake, define top_builddir and top_srcdir appropriately in
-# the Makefiles.
-AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-  case $enable_ltdl_convenience in
-  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
-  "") enable_ltdl_convenience=yes
-      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
-  esac
-  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
-  LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
-  # For backwards non-gettext consistent compatibility...
-  INCLTDL="$LTDLINCL"
-])# AC_LIBLTDL_CONVENIENCE
+    # It seems that -bexpall does not export symbols beginning with
+    # underscore (_), so it is better to generate a list of symbols to export.
+    _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+    if test "$aix_use_runtimelinking" = yes; then
+      # Warning - without using the other runtime loading flags (-brtl),
+      # -berok will link without error, but may produce a broken library.
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
+      # Determine the default libpath from the value encoded in an empty executable.
+      _LT_AC_SYS_LIBPATH_AIX
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
 
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+     else
+      if test "$host_cpu" = ia64; then
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+       _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+      else
+       # Determine the default libpath from the value encoded in an empty executable.
+       _LT_AC_SYS_LIBPATH_AIX
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+       # Warning - without using the other run time loading flags,
+       # -berok will link without error, but may produce a broken library.
+       _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+       # -bexpall does not export symbols beginning with underscore (_)
+       _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+       # Exported symbols can be pulled into shared objects from archives
+       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
+       _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+       # This is similar to how AIX traditionally builds its shared libraries.
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+      fi
+    fi
+    ;;
+  chorus*)
+    case $cc_basename in
+      *)
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+    esac
+    ;;
 
-# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
-# -----------------------------------
-# sets LIBLTDL to the link flags for the libltdl installable library and
-# LTDLINCL to the include flags for the libltdl header and adds
-# --enable-ltdl-install to the configure arguments.  Note that
-# AC_CONFIG_SUBDIRS is not called here.  If DIRECTORY is not provided,
-# and an installed libltdl is not found, it is assumed to be `libltdl'.
-# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with
-# '${top_srcdir}/' (note the single quotes!).  If your package is not
-# flat and you're not using automake, define top_builddir and top_srcdir
-# appropriately in the Makefiles.
-# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
-AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
-[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-  AC_CHECK_LIB(ltdl, lt_dlinit,
-  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
-  [if test x"$enable_ltdl_install" = xno; then
-     AC_MSG_WARN([libltdl not installed, but installation disabled])
-   else
-     enable_ltdl_install=yes
-   fi
-  ])
-  if test x"$enable_ltdl_install" = x"yes"; then
-    ac_configure_args="$ac_configure_args --enable-ltdl-install"
-    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
-    LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
-  else
-    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
-    LIBLTDL="-lltdl"
-    LTDLINCL=
-  fi
-  # For backwards non-gettext consistent compatibility...
-  INCLTDL="$LTDLINCL"
-])# AC_LIBLTDL_INSTALLABLE
 
+  cygwin* | mingw* | pw32*)
+    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+    # as there is no search path for DLLs.
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+    _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+    _LT_AC_TAGVAR(always_export_symbols, $1)=no
+    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
 
-# AC_LIBTOOL_CXX
-# --------------
-# enable support for C++ libraries
-AC_DEFUN([AC_LIBTOOL_CXX],
-[AC_REQUIRE([_LT_AC_LANG_CXX])
-])# AC_LIBTOOL_CXX
+    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+      # If the export-symbols file already is a .def file (1st line
+      # is EXPORTS), use it as is; otherwise, prepend...
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+       cp $export_symbols $output_objdir/$soname.def;
+      else
+       echo EXPORTS > $output_objdir/$soname.def;
+       cat $export_symbols >> $output_objdir/$soname.def;
+      fi~
+      $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+    else
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    fi
+  ;;
+      darwin* | rhapsody*)
+        case $host_os in
+        rhapsody* | darwin1.[[012]])
+         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[[012]])
+               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+        esac
+      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_AC_TAGVAR(hardcode_direct, $1)=no
+      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
 
+    if test "$GXX" = yes ; then
+      lt_int_apple_cc_single_mod=no
+      output_verbose_link_cmd='echo'
+      if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
+       lt_int_apple_cc_single_mod=yes
+      fi
+      if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      else
+          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+        fi
+        _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+        # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+          if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+            _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          else
+            _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          fi
+            _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      else
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+          _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         _LT_AC_TAGVAR(ld_shlibs, $1)=no
+          ;;
+      esac
+      fi
+        ;;
 
-# _LT_AC_LANG_CXX
-# ---------------
-AC_DEFUN([_LT_AC_LANG_CXX],
-[AC_REQUIRE([AC_PROG_CXX])
-AC_REQUIRE([_LT_AC_PROG_CXXCPP])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX])
-])# _LT_AC_LANG_CXX
-
-# _LT_AC_PROG_CXXCPP
-# ---------------
-AC_DEFUN([_LT_AC_PROG_CXXCPP],
-[
-AC_REQUIRE([AC_PROG_CXX])
-if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
-    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
-    (test "X$CXX" != "Xg++"))) ; then
-  AC_PROG_CXXCPP
-fi
-])# _LT_AC_PROG_CXXCPP
+  dgux*)
+    case $cc_basename in
+      ec++*)
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+      ghcx*)
+       # Green Hills C++ Compiler
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+      *)
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+    esac
+    ;;
+  freebsd[[12]]*)
+    # C++ shared libraries reported to be fairly broken before switch to ELF
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  freebsd-elf*)
+    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+    ;;
+  freebsd* | kfreebsd*-gnu | dragonfly*)
+    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+    # conventions
+    _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+    ;;
+  gnu*)
+    ;;
+  hpux9*)
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+    _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+                               # but as the default
+                               # location of the library.
 
-# AC_LIBTOOL_F77
-# --------------
-# enable support for Fortran 77 libraries
-AC_DEFUN([AC_LIBTOOL_F77],
-[AC_REQUIRE([_LT_AC_LANG_F77])
-])# AC_LIBTOOL_F77
+    case $cc_basename in
+    CC*)
+      # FIXME: insert proper C++ library support
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+    aCC*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      # Commands to make compiler produce verbose output that lists
+      # what "hidden" libraries, object files and flags are used when
+      # linking a shared library.
+      #
+      # There doesn't appear to be a way to prevent this compiler from
+      # explicitly linking system object files so we need to strip them
+      # from the output so that they don't get included in the library
+      # dependencies.
+      output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+      ;;
+    *)
+      if test "$GXX" = yes; then
+        _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+        # FIXME: insert proper C++ library support
+        _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+    esac
+    ;;
+  hpux10*|hpux11*)
+    if test $with_gnu_ld = no; then
+      case $host_cpu in
+      hppa*64*)
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+        ;;
+      ia64*)
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+        ;;
+      *)
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+        ;;
+      esac
+    fi
+    case $host_cpu in
+    hppa*64*)
+      _LT_AC_TAGVAR(hardcode_direct, $1)=no
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+    ia64*)
+      _LT_AC_TAGVAR(hardcode_direct, $1)=no
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+                                             # but as the default
+                                             # location of the library.
+      ;;
+    *)
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+                                             # but as the default
+                                             # location of the library.
+      ;;
+    esac
 
+    case $cc_basename in
+      CC*)
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+      aCC*)
+       case $host_cpu in
+       hppa*64*|ia64*)
+         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+         ;;
+       *)
+         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+         ;;
+       esac
+       # Commands to make compiler produce verbose output that lists
+       # what "hidden" libraries, object files and flags are used when
+       # linking a shared library.
+       #
+       # There doesn't appear to be a way to prevent this compiler from
+       # explicitly linking system object files so we need to strip them
+       # from the output so that they don't get included in the library
+       # dependencies.
+       output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+       ;;
+      *)
+       if test "$GXX" = yes; then
+         if test $with_gnu_ld = no; then
+           case $host_cpu in
+           ia64*|hppa*64*)
+             _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+             ;;
+           *)
+             _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+             ;;
+           esac
+         fi
+       else
+         # FIXME: insert proper C++ library support
+         _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       fi
+       ;;
+    esac
+    ;;
+  irix5* | irix6*)
+    case $cc_basename in
+      CC*)
+       # SGI C++
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
 
-# _LT_AC_LANG_F77
-# ---------------
-AC_DEFUN([_LT_AC_LANG_F77],
-[AC_REQUIRE([AC_PROG_F77])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77])
-])# _LT_AC_LANG_F77
+       # Archives containing C++ object files must be created using
+       # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
+       # necessary to make sure instantiated templates are included
+       # in the archive.
+       _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
+       ;;
+      *)
+       if test "$GXX" = yes; then
+         if test "$with_gnu_ld" = no; then
+           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+         else
+           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
+         fi
+       fi
+       _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+       ;;
+    esac
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+    ;;
+  linux*)
+    case $cc_basename in
+      KCC*)
+       # Kuck and Associates, Inc. (KAI) C++ Compiler
 
+       # KCC will only create a shared library if the output file
+       # ends with ".so" (or ".sl" for HP-UX), so rename the library
+       # to its proper name (with version) after linking.
+       _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+       # Commands to make compiler produce verbose output that lists
+       # what "hidden" libraries, object files and flags are used when
+       # linking a shared library.
+       #
+       # There doesn't appear to be a way to prevent this compiler from
+       # explicitly linking system object files so we need to strip them
+       # from the output so that they don't get included in the library
+       # dependencies.
+       output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
 
-# AC_LIBTOOL_GCJ
-# --------------
-# enable support for GCJ libraries
-AC_DEFUN([AC_LIBTOOL_GCJ],
-[AC_REQUIRE([_LT_AC_LANG_GCJ])
-])# AC_LIBTOOL_GCJ
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
+       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
 
+       # Archives containing C++ object files must be created using
+       # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+       _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+       ;;
+      icpc*)
+       # Intel C++
+       with_gnu_ld=yes
+       # version 8.0 and above of icpc choke on multiply defined symbols
+       # if we add $predep_objects and $postdep_objects, however 7.1 and
+       # earlier do not add the objects themselves.
+       case `$CC -V 2>&1` in
+       *"Version 7."*)
+         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+         ;;
+       *)  # Version 8.0 or newer
+         tmp_idyn=
+         case $host_cpu in
+           ia64*) tmp_idyn=' -i_dynamic';;
+         esac
+         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+         ;;
+       esac
+       _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+       ;;
+      pgCC*)
+        # Portland Group C++ compiler
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
 
-# _LT_AC_LANG_GCJ
-# ---------------
-AC_DEFUN([_LT_AC_LANG_GCJ],
-[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
-  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
-    [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
-      [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
-        [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
-          [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ])
-])# _LT_AC_LANG_GCJ
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+        ;;
+      cxx*)
+       # Compaq C++
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
 
+       runpath_var=LD_RUN_PATH
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 
-# AC_LIBTOOL_RC
-# --------------
-# enable support for Windows resource files
-AC_DEFUN([AC_LIBTOOL_RC],
-[AC_REQUIRE([LT_AC_PROG_RC])
-_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC])
-])# AC_LIBTOOL_RC
+       # Commands to make compiler produce verbose output that lists
+       # what "hidden" libraries, object files and flags are used when
+       # linking a shared library.
+       #
+       # There doesn't appear to be a way to prevent this compiler from
+       # explicitly linking system object files so we need to strip them
+       # from the output so that they don't get included in the library
+       # dependencies.
+       output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+       ;;
+    esac
+    ;;
+  lynxos*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  m88k*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  mvs*)
+    case $cc_basename in
+      cxx*)
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+      *)
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+    esac
+    ;;
+  netbsd*)
+    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+      wlarc=
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+    fi
+    # Workaround some broken pre-1.5 toolchains
+    output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+    ;;
+  openbsd2*)
+    # C++ shared libraries are fairly broken
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  openbsd*)
+    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+    if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    fi
+    output_verbose_link_cmd='echo'
+    ;;
+  osf3*)
+    case $cc_basename in
+      KCC*)
+       # Kuck and Associates, Inc. (KAI) C++ Compiler
 
+       # KCC will only create a shared library if the output file
+       # ends with ".so" (or ".sl" for HP-UX), so rename the library
+       # to its proper name (with version) after linking.
+       _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
 
-# AC_LIBTOOL_LANG_C_CONFIG
-# ------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined.  Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
-AC_DEFUN([_LT_AC_LANG_C_CONFIG],
-[lt_save_CC="$CC"
-AC_LANG_PUSH(C)
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 
-# Source file extension for C test sources.
-ac_ext=c
+       # Archives containing C++ object files must be created using
+       # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+       _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
 
-# Object file extension for compiled C test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
+       ;;
+      RCC*)
+       # Rational C++ 2.4.1
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+      cxx*)
+       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
 
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;\n"
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(){return(0);}\n'
+       # Commands to make compiler produce verbose output that lists
+       # what "hidden" libraries, object files and flags are used when
+       # linking a shared library.
+       #
+       # There doesn't appear to be a way to prevent this compiler from
+       # explicitly linking system object files so we need to strip them
+       # from the output so that they don't get included in the library
+       # dependencies.
+       output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+       ;;
+      *)
+       if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 
-_LT_AC_SYS_COMPILER
+         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
+         # Commands to make compiler produce verbose output that lists
+         # what "hidden" libraries, object files and flags are used when
+         # linking a shared library.
+         output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
 
-#
-# Check for any special shared library compilation flags.
-#
-_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)=
-if test "$GCC" = no; then
-  case $host_os in
-  sco3.2v5*)
-    _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf'
+       else
+         # FIXME: insert proper C++ library support
+         _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       fi
+       ;;
+    esac
     ;;
-  esac
-fi
-if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then
-  AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries])
-  if echo "$old_CC $old_CFLAGS " | grep "[[    ]]$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[        ]]" >/dev/null; then :
-  else
-    AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure])
-    _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no
-  fi
-fi
+  osf4* | osf5*)
+    case $cc_basename in
+      KCC*)
+       # Kuck and Associates, Inc. (KAI) C++ Compiler
 
+       # KCC will only create a shared library if the output file
+       # ends with ".so" (or ".sl" for HP-UX), so rename the library
+       # to its proper name (with version) after linking.
+       _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
 
-#
-# Check to make sure the static flag actually works.
-#
-AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works],
-  _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
-  $_LT_AC_TAGVAR(lt_prog_compiler_static, $1),
-  [],
-  [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 
+       # Archives containing C++ object files must be created using
+       # the KAI C++ compiler.
+       _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
+       ;;
+      RCC*)
+       # Rational C++ 2.4.1
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+      cxx*)
+       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+         echo "-hidden">> $lib.exp~
+         $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp  `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~
+         $rm $lib.exp'
 
-## CAVEAT EMPTOR:
-## There is no encapsulation within the following macros, do not change
-## the running order or otherwise move them around unless you know exactly
-## what you are doing...
-AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
-AC_LIBTOOL_PROG_COMPILER_PIC($1)
-AC_LIBTOOL_PROG_CC_C_O($1)
-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
-AC_LIBTOOL_PROG_LD_SHLIBS($1)
-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-AC_LIBTOOL_SYS_LIB_STRIP
-AC_LIBTOOL_DLOPEN_SELF($1)
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 
-# Report which librarie types wil actually be built
-AC_MSG_CHECKING([if libtool supports shared libraries])
-AC_MSG_RESULT([$can_build_shared])
+       # Commands to make compiler produce verbose output that lists
+       # what "hidden" libraries, object files and flags are used when
+       # linking a shared library.
+       #
+       # There doesn't appear to be a way to prevent this compiler from
+       # explicitly linking system object files so we need to strip them
+       # from the output so that they don't get included in the library
+       # dependencies.
+       output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+       ;;
+      *)
+       if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
 
-AC_MSG_CHECKING([whether to build shared libraries])
-test "$can_build_shared" = "no" && enable_shared=no
+         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 
-# 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
-  ;;
+         # Commands to make compiler produce verbose output that lists
+         # what "hidden" libraries, object files and flags are used when
+         # linking a shared library.
+         output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
 
-aix4* | aix5*)
-  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-    test "$enable_shared" = yes && enable_static=no
-  fi
+       else
+         # FIXME: insert proper C++ library support
+         _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       fi
+       ;;
+    esac
     ;;
-esac
-AC_MSG_RESULT([$enable_shared])
-
-AC_MSG_CHECKING([whether to build static libraries])
-# Make sure either enable_shared or enable_static is yes.
-test "$enable_shared" = yes || enable_static=yes
-AC_MSG_RESULT([$enable_static])
-
-AC_LIBTOOL_CONFIG($1)
-
-AC_LANG_POP
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_C_CONFIG
+  psos*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  sco*)
+    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+    case $cc_basename in
+      CC*)
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+      *)
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+    esac
+    ;;
+  sunos4*)
+    case $cc_basename in
+      CC*)
+       # Sun C++ 4.x
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+      lcc*)
+       # Lucid
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+      *)
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+    esac
+    ;;
+  solaris*)
+    case $cc_basename in
+      CC*)
+       # Sun C++ 4.2, 5.x and Centerline C++
+        _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes
+       _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+       $CC -G${allow_undefined_flag}  ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
 
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+       case $host_os in
+         solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+         *)
+           # The C++ compiler is used as linker so we must use $wl
+           # flag to pass the commands to the underlying system
+           # linker. We must also pass each convience library through
+           # to the system linker between allextract/defaultextract.
+           # The C++ compiler will combine linker options so we
+           # cannot just pass the convience library names through
+           # without $wl.
+           # Supported since Solaris 2.6 (maybe 2.5.1?)
+           _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
+           ;;
+       esac
+       _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
 
-# AC_LIBTOOL_LANG_CXX_CONFIG
-# --------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined.  Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
-AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
-[AC_LANG_PUSH(C++)
-AC_REQUIRE([AC_PROG_CXX])
-AC_REQUIRE([_LT_AC_PROG_CXXCPP])
+       output_verbose_link_cmd='echo'
 
-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_AC_TAGVAR(allow_undefined_flag, $1)=
-_LT_AC_TAGVAR(always_export_symbols, $1)=no
-_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
-_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_AC_TAGVAR(hardcode_direct, $1)=no
-_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
-_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
-_LT_AC_TAGVAR(hardcode_automatic, $1)=no
-_LT_AC_TAGVAR(module_cmds, $1)=
-_LT_AC_TAGVAR(module_expsym_cmds, $1)=
-_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_AC_TAGVAR(no_undefined_flag, $1)=
-_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+       # Archives containing C++ object files must be created using
+       # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+       # necessary to make sure instantiated templates are included
+       # in the archive.
+       _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+       ;;
+      gcx*)
+       # Green Hills C++ Compiler
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
 
-# Dependencies to place before and after the object being linked:
-_LT_AC_TAGVAR(predep_objects, $1)=
-_LT_AC_TAGVAR(postdep_objects, $1)=
-_LT_AC_TAGVAR(predeps, $1)=
-_LT_AC_TAGVAR(postdeps, $1)=
-_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
+       # The C++ compiler must be used to create the archive.
+       _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+       ;;
+      *)
+       # GNU C++ compiler with Solaris linker
+       if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+         _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+         if $CC --version | grep -v '^2\.7' > /dev/null; then
+           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+           _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+               $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
 
-# Source file extension for C++ test sources.
-ac_ext=cpp
+           # Commands to make compiler produce verbose output that lists
+           # what "hidden" libraries, object files and flags are used when
+           # linking a shared library.
+           output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+         else
+           # g++ 2.7 appears to require `-G' NOT `-shared' on this
+           # platform.
+           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+           _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+               $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
 
-# Object file extension for compiled C++ test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
+           # Commands to make compiler produce verbose output that lists
+           # what "hidden" libraries, object files and flags are used when
+           # linking a shared library.
+           output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+         fi
 
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="int some_variable = 0;\n"
+         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+       fi
+       ;;
+    esac
+    ;;
+  sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*)
+    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+    ;;
+  tandem*)
+    case $cc_basename in
+      NCC*)
+       # NonStop-UX NCC 3.20
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+      *)
+       # FIXME: insert proper C++ library support
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       ;;
+    esac
+    ;;
+  vxworks*)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+  *)
+    # FIXME: insert proper C++ library support
+    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+    ;;
+esac
+AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
 
-# Code to be used in simple link tests
-lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
+_LT_AC_TAGVAR(GCC, $1)="$GXX"
+_LT_AC_TAGVAR(LD, $1)="$LD"
 
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_AC_SYS_COMPILER
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+AC_LIBTOOL_POSTDEP_PREDEP($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_DLOPEN_SELF($1)
 
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
+AC_LIBTOOL_CONFIG($1)
 
-# Allow CC to be a program name with arguments.
-lt_save_CC=$CC
-lt_save_LD=$LD
-lt_save_GCC=$GCC
-GCC=$GXX
-lt_save_with_gnu_ld=$with_gnu_ld
-lt_save_path_LD=$lt_cv_path_LD
-if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
-  lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
-else
-  unset lt_cv_prog_gnu_ld
-fi
-if test -n "${lt_cv_path_LDCXX+set}"; then
-  lt_cv_path_LD=$lt_cv_path_LDCXX
-else
-  unset lt_cv_path_LD
-fi
-test -z "${LDCXX+set}" || LD=$LDCXX
-CC=${CXX-"c++"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
+AC_LANG_POP
+CC=$lt_save_CC
+LDCXX=$LD
+LD=$lt_save_LD
+GCC=$lt_save_GCC
+with_gnu_ldcxx=$with_gnu_ld
+with_gnu_ld=$lt_save_with_gnu_ld
+lt_cv_path_LDCXX=$lt_cv_path_LD
+lt_cv_path_LD=$lt_save_path_LD
+lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+])# AC_LIBTOOL_LANG_CXX_CONFIG
 
-# We don't want -fno-exception wen compiling C++ code, so set the
-# no_builtin_flag separately
-if test "$GXX" = yes; then
-  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
-else
-  _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
-fi
+# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
+# ------------------------
+# Figure out "hidden" library dependencies from verbose
+# compiler output when linking a shared library.
+# Parse the compiler output and extract the necessary
+# objects, libraries and library flags.
+AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[
+dnl we can't use the lt_simple_compile_test_code here,
+dnl because it contains code intended for an executable,
+dnl not a library.  It's possible we should let each
+dnl tag define a new lt_????_link_test_code variable,
+dnl but it's only used here...
+ifelse([$1],[],[cat > conftest.$ac_ext <<EOF
+int a;
+void foo (void) { a = 0; }
+EOF
+],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
+class Foo
+{
+public:
+  Foo (void) { a = 0; }
+private:
+  int a;
+};
+EOF
+],[$1],[F77],[cat > conftest.$ac_ext <<EOF
+      subroutine foo
+      implicit none
+      integer*4 a
+      a=0
+      return
+      end
+EOF
+],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
+public class foo {
+  private int a;
+  public void bar (void) {
+    a = 0;
+  }
+};
+EOF
+])
+dnl Parse the compiler output and extract the necessary
+dnl objects, libraries and library flags.
+if AC_TRY_EVAL(ac_compile); then
+  # Parse the compiler output and extract the necessary
+  # objects, libraries and library flags.
 
-if test "$GXX" = yes; then
-  # Set up default GNU C++ configuration
+  # Sentinel used to keep track of whether or not we are before
+  # the conftest object file.
+  pre_test_object_deps_done=no
 
-  AC_PROG_LD
+  # The `*' in the case matches for architectures that use `case' in
+  # $output_verbose_cmd can trigger glob expansion during the loop
+  # eval without this substitution.
+  output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
 
-  # Check if GNU C++ uses GNU ld as the underlying linker, since the
-  # archiving commands below assume that GNU ld is being used.
-  if test "$with_gnu_ld" = yes; then
-    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-    _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+  for p in `eval $output_verbose_link_cmd`; do
+    case $p in
 
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
-    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+    -L* | -R* | -l*)
+       # Some compilers place space between "-{L,R}" and the path.
+       # Remove the space.
+       if test $p = "-L" \
+         || test $p = "-R"; then
+        prev=$p
+        continue
+       else
+        prev=
+       fi
 
-    # If archive_cmds runs LD, not CC, wlarc should be empty
-    # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
-    #     investigate it a little bit more. (MM)
-    wlarc='${wl}'
+       if test "$pre_test_object_deps_done" = no; then
+        case $p in
+        -L* | -R*)
+          # Internal compiler library paths should come after those
+          # provided the user.  The postdeps already come after the
+          # user supplied libs so there is no need to process them.
+          if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
+            _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+          else
+            _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
+          fi
+          ;;
+        # The "-l" case would never come before the object being
+        # linked, so don't bother handling this case.
+        esac
+       else
+        if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
+          _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
+        else
+          _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
+        fi
+       fi
+       ;;
 
-    # ancient GNU ld didn't support --whole-archive et. al.
-    if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
-       grep 'no-whole-archive' > /dev/null; then
-      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-    else
-      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
-    fi
-  else
-    with_gnu_ld=no
-    wlarc=
+    *.$objext)
+       # This assumes that the test object file only shows up
+       # once in the compiler output.
+       if test "$p" = "conftest.$objext"; then
+        pre_test_object_deps_done=yes
+        continue
+       fi
 
-    # A generic and very simple default shared library creation
-    # command for GNU C++ for the case where it uses the native
-    # linker, instead of GNU ld.  If possible, this setting should
-    # overridden to take advantage of the native linker features on
-    # the platform it is being used on.
-    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
-  fi
+       if test "$pre_test_object_deps_done" = no; then
+        if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
+          _LT_AC_TAGVAR(predep_objects, $1)="$p"
+        else
+          _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
+        fi
+       else
+        if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
+          _LT_AC_TAGVAR(postdep_objects, $1)="$p"
+        else
+          _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
+        fi
+       fi
+       ;;
 
-  # Commands to make compiler produce verbose output that lists
-  # what "hidden" libraries, object files and flags are used when
-  # linking a shared library.
-  output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+    *) ;; # Ignore the rest.
+
+    esac
+  done
 
+  # Clean up.
+  rm -f a.out a.exe
 else
-  GXX=no
-  with_gnu_ld=no
-  wlarc=
+  echo "libtool.m4: error: problem compiling $1 test program"
 fi
 
-# PORTME: fill in a description of your system's C++ link characteristics
-AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
-_LT_AC_TAGVAR(ld_shlibs, $1)=yes
-case $host_os in
-  aix3*)
-    # FIXME: insert proper C++ library support
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
+$rm -f confest.$objext
+
+# PORTME: override above test on systems where it is broken
+ifelse([$1],[CXX],
+[case $host_os in
+solaris*)
+  case $cc_basename in
+  CC*)
+    # Adding this requires a known-good setup of shared libraries for
+    # Sun compiler versions before 5.6, else PIC objects from an old
+    # archive will be linked into the output, leading to subtle bugs.
+    _LT_AC_TAGVAR(postdeps,$1)='-lCstd -lCrun'
     ;;
-  aix4* | aix5*)
-    if test "$host_cpu" = ia64; then
-      # On IA64, the linker does run time linking by default, so we don't
-      # have to do anything special.
-      aix_use_runtimelinking=no
-      exp_sym_flag='-Bexport'
-      no_entry_flag=""
-    else
-      aix_use_runtimelinking=no
+  esac
+esac
+])
 
-      # Test if we are trying to use run time linking or normal
-      # AIX style linking. If -brtl is somewhere in LDFLAGS, we
-      # need to do runtime linking.
-      case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
-       for ld_flag in $LDFLAGS; do
-         case $ld_flag in
-         *-brtl*)
-           aix_use_runtimelinking=yes
-           break
-           ;;
-         esac
-       done
-      esac
+case " $_LT_AC_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+])# AC_LIBTOOL_POSTDEP_PREDEP
 
-      exp_sym_flag='-bexport'
-      no_entry_flag='-bnoentry'
-    fi
+# AC_LIBTOOL_LANG_F77_CONFIG
+# ------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined.  Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
+AC_DEFUN([_LT_AC_LANG_F77_CONFIG],
+[AC_REQUIRE([AC_PROG_F77])
+AC_LANG_PUSH(Fortran 77)
 
-    # When large executables or shared objects are built, AIX ld can
-    # have problems creating the table of contents.  If linking a library
-    # or program results in "error TOC overflow" add -mminimal-toc to
-    # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
-    # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_AC_TAGVAR(allow_undefined_flag, $1)=
+_LT_AC_TAGVAR(always_export_symbols, $1)=no
+_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_direct, $1)=no
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+_LT_AC_TAGVAR(hardcode_automatic, $1)=no
+_LT_AC_TAGVAR(module_cmds, $1)=
+_LT_AC_TAGVAR(module_expsym_cmds, $1)=
+_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_AC_TAGVAR(no_undefined_flag, $1)=
+_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
 
-    _LT_AC_TAGVAR(archive_cmds, $1)=''
-    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
-    _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+# Source file extension for f77 test sources.
+ac_ext=f
 
-    if test "$GXX" = yes; then
-      case $host_os in aix4.[[012]]|aix4.[[012]].*)
-      # We only want to do this on AIX 4.2 and lower, the check
-      # below for broken collect2 doesn't work under 4.3+
-       collect2name=`${CC} -print-prog-name=collect2`
-       if test -f "$collect2name" && \
-          strings "$collect2name" | grep resolve_lib_name >/dev/null
-       then
-         # We have reworked collect2
-         _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-       else
-         # We have old collect2
-         _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
-         # It fails to find uninstalled libraries when the uninstalled
-         # path is not listed in the libpath.  Setting hardcode_minus_L
-         # to unsupported forces relinking
-         _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
-       fi
-      esac
-      shared_flag='-shared'
-      if test "$aix_use_runtimelinking" = yes; then
-       shared_flag="$shared_flag "'${wl}-G'
-      fi
-    else
-      # not using gcc
-      if test "$host_cpu" = ia64; then
-       # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
-       # chokes on -Wl,-G. The following line is correct:
-       shared_flag='-G'
-      else
-       if test "$aix_use_runtimelinking" = yes; then
-         shared_flag='${wl}-G'
-       else
-         shared_flag='${wl}-bM:SRE'
-       fi
-      fi
-    fi
+# Object file extension for compiled f77 test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
 
-    # It seems that -bexpall does not export symbols beginning with
-    # underscore (_), so it is better to generate a list of symbols to export.
-    _LT_AC_TAGVAR(always_export_symbols, $1)=yes
-    if test "$aix_use_runtimelinking" = yes; then
-      # Warning - without using the other runtime loading flags (-brtl),
-      # -berok will link without error, but may produce a broken library.
-      _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
-      # Determine the default libpath from the value encoded in an empty executable.
-      _LT_AC_SYS_LIBPATH_AIX
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
 
-      _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-     else
-      if test "$host_cpu" = ia64; then
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
-       _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
-       _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
-      else
-       # Determine the default libpath from the value encoded in an empty executable.
-       _LT_AC_SYS_LIBPATH_AIX
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-       # Warning - without using the other run time loading flags,
-       # -berok will link without error, but may produce a broken library.
-       _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
-       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
-       # -bexpall does not export symbols beginning with underscore (_)
-       _LT_AC_TAGVAR(always_export_symbols, $1)=yes
-       # Exported symbols can be pulled into shared objects from archives
-       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
-       _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
-       # This is similar to how AIX traditionally builds its shared libraries.
-       _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
-      fi
-    fi
-    ;;
-  chorus*)
-    case $cc_basename in
-      *)
-       # FIXME: insert proper C++ library support
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       ;;
-    esac
-    ;;
+# Code to be used in simple link tests
+lt_simple_link_test_code="      program t\n      end\n"
 
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
 
-  cygwin* | mingw* | pw32*)
-    # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
-    # as there is no search path for DLLs.
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-    _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
-    _LT_AC_TAGVAR(always_export_symbols, $1)=no
-    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
 
-    if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
-      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
-      # If the export-symbols file already is a .def file (1st line
-      # is EXPORTS), use it as is; otherwise, prepend...
-      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-       cp $export_symbols $output_objdir/$soname.def;
-      else
-       echo EXPORTS > $output_objdir/$soname.def;
-       cat $export_symbols >> $output_objdir/$soname.def;
-      fi~
-      $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
-    else
-      _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    fi
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${F77-"f77"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+
+AC_MSG_CHECKING([if libtool supports shared libraries])
+AC_MSG_RESULT([$can_build_shared])
+
+AC_MSG_CHECKING([whether to build shared libraries])
+test "$can_build_shared" = "no" && enable_shared=no
+
+# On AIX, shared libraries and static libraries use the same namespace, and
+# are all built from PIC.
+case $host_os in
+aix3*)
+  test "$enable_shared" = yes && enable_static=no
+  if test -n "$RANLIB"; then
+    archive_cmds="$archive_cmds~\$RANLIB \$lib"
+    postinstall_cmds='$RANLIB $lib'
+  fi
   ;;
-      darwin* | rhapsody*)
-        case $host_os in
-        rhapsody* | darwin1.[[012]])
-         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
-         ;;
-       *) # Darwin 1.3 on
-         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
-           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-         else
-           case ${MACOSX_DEPLOYMENT_TARGET} in
-             10.[[012]])
-               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-               ;;
-             10.*)
-               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
-               ;;
-           esac
-         fi
-         ;;
-        esac
-      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-      _LT_AC_TAGVAR(hardcode_direct, $1)=no
-      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
-      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+aix4* | aix5*)
+  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+    test "$enable_shared" = yes && enable_static=no
+  fi
+  ;;
+esac
+AC_MSG_RESULT([$enable_shared])
 
-    if test "$GXX" = yes ; then
-      lt_int_apple_cc_single_mod=no
-      output_verbose_link_cmd='echo'
-      if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then
-       lt_int_apple_cc_single_mod=yes
-      fi
-      if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
-      else
-          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
-        fi
-        _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-        # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-          if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
-            _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          else
-            _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          fi
-            _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-      else
-      case $cc_basename in
-        xlc*)
-         output_verbose_link_cmd='echo'
-          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
-          _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-          _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          ;;
-       *)
-         _LT_AC_TAGVAR(ld_shlibs, $1)=no
-          ;;
-      esac
-      fi
-        ;;
+AC_MSG_CHECKING([whether to build static libraries])
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+AC_MSG_RESULT([$enable_static])
 
-  dgux*)
-    case $cc_basename in
-      ec++*)
-       # FIXME: insert proper C++ library support
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       ;;
-      ghcx*)
-       # Green Hills C++ Compiler
-       # FIXME: insert proper C++ library support
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       ;;
-      *)
-       # FIXME: insert proper C++ library support
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       ;;
-    esac
-    ;;
-  freebsd[[12]]*)
-    # C++ shared libraries reported to be fairly broken before switch to ELF
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    ;;
-  freebsd-elf*)
-    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-    ;;
-  freebsd* | kfreebsd*-gnu | dragonfly*)
-    # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
-    # conventions
-    _LT_AC_TAGVAR(ld_shlibs, $1)=yes
-    ;;
-  gnu*)
-    ;;
-  hpux9*)
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-    _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
-                               # but as the default
-                               # location of the library.
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
 
-    case $cc_basename in
-    CC*)
-      # FIXME: insert proper C++ library support
-      _LT_AC_TAGVAR(ld_shlibs, $1)=no
-      ;;
-    aCC*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      # Commands to make compiler produce verbose output that lists
-      # what "hidden" libraries, object files and flags are used when
-      # linking a shared library.
-      #
-      # There doesn't appear to be a way to prevent this compiler from
-      # explicitly linking system object files so we need to strip them
-      # from the output so that they don't get included in the library
-      # dependencies.
-      output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-      ;;
-    *)
-      if test "$GXX" = yes; then
-        _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      else
-        # FIXME: insert proper C++ library support
-        _LT_AC_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-    esac
-    ;;
-  hpux10*|hpux11*)
-    if test $with_gnu_ld = no; then
-      case $host_cpu in
-      hppa*64*)
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
-       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-        ;;
-      ia64*)
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-        ;;
-      *)
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-        ;;
-      esac
-    fi
-    case $host_cpu in
-    hppa*64*)
-      _LT_AC_TAGVAR(hardcode_direct, $1)=no
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
-    ia64*)
-      _LT_AC_TAGVAR(hardcode_direct, $1)=no
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
-                                             # but as the default
-                                             # location of the library.
-      ;;
-    *)
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
-                                             # but as the default
-                                             # location of the library.
-      ;;
-    esac
+_LT_AC_TAGVAR(GCC, $1)="$G77"
+_LT_AC_TAGVAR(LD, $1)="$LD"
 
-    case $cc_basename in
-      CC*)
-       # FIXME: insert proper C++ library support
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       ;;
-      aCC*)
-       case $host_cpu in
-       hppa*64*|ia64*)
-         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
-         ;;
-       *)
-         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-         ;;
-       esac
-       # Commands to make compiler produce verbose output that lists
-       # what "hidden" libraries, object files and flags are used when
-       # linking a shared library.
-       #
-       # There doesn't appear to be a way to prevent this compiler from
-       # explicitly linking system object files so we need to strip them
-       # from the output so that they don't get included in the library
-       # dependencies.
-       output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-       ;;
-      *)
-       if test "$GXX" = yes; then
-         if test $with_gnu_ld = no; then
-           case $host_cpu in
-           ia64*|hppa*64*)
-             _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
-             ;;
-           *)
-             _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-             ;;
-           esac
-         fi
-       else
-         # FIXME: insert proper C++ library support
-         _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       fi
-       ;;
-    esac
-    ;;
-  irix5* | irix6*)
-    case $cc_basename in
-      CC*)
-       # SGI C++
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
 
-       # Archives containing C++ object files must be created using
-       # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
-       # necessary to make sure instantiated templates are included
-       # in the archive.
-       _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
-       ;;
-      *)
-       if test "$GXX" = yes; then
-         if test "$with_gnu_ld" = no; then
-           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-         else
-           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
-         fi
-       fi
-       _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-       ;;
-    esac
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-    _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-    ;;
-  linux*)
-    case $cc_basename in
-      KCC*)
-       # Kuck and Associates, Inc. (KAI) C++ Compiler
 
-       # KCC will only create a shared library if the output file
-       # ends with ".so" (or ".sl" for HP-UX), so rename the library
-       # to its proper name (with version) after linking.
-       _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
-       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
-       # Commands to make compiler produce verbose output that lists
-       # what "hidden" libraries, object files and flags are used when
-       # linking a shared library.
-       #
-       # There doesn't appear to be a way to prevent this compiler from
-       # explicitly linking system object files so we need to strip them
-       # from the output so that they don't get included in the library
-       # dependencies.
-       output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+AC_LIBTOOL_CONFIG($1)
 
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
-       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+AC_LANG_POP
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_F77_CONFIG
 
-       # Archives containing C++ object files must be created using
-       # "CC -Bstatic", where "CC" is the KAI C++ compiler.
-       _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
-       ;;
-      icpc*)
-       # Intel C++
-       with_gnu_ld=yes
-       # version 8.0 and above of icpc choke on multiply defined symbols
-       # if we add $predep_objects and $postdep_objects, however 7.1 and
-       # earlier do not add the objects themselves.
-       case `$CC -V 2>&1` in
-       *"Version 7."*)
-         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-         ;;
-       *)  # Version 8.0 or newer
-         tmp_idyn=
-         case $host_cpu in
-           ia64*) tmp_idyn=' -i_dynamic';;
-         esac
-         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-         ;;
-       esac
-       _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
-       ;;
-      pgCC*)
-        # Portland Group C++ compiler
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
-       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
 
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
-       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-        ;;
-      cxx*)
-       # Compaq C++
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
-       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+# AC_LIBTOOL_LANG_GCJ_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined.  Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
+AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
+[AC_LANG_SAVE
 
-       runpath_var=LD_RUN_PATH
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
-       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+# Source file extension for Java test sources.
+ac_ext=java
 
-       # Commands to make compiler produce verbose output that lists
-       # what "hidden" libraries, object files and flags are used when
-       # linking a shared library.
-       #
-       # There doesn't appear to be a way to prevent this compiler from
-       # explicitly linking system object files so we need to strip them
-       # from the output so that they don't get included in the library
-       # dependencies.
-       output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-       ;;
-    esac
-    ;;
-  lynxos*)
-    # FIXME: insert proper C++ library support
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    ;;
-  m88k*)
-    # FIXME: insert proper C++ library support
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    ;;
-  mvs*)
-    case $cc_basename in
-      cxx*)
-       # FIXME: insert proper C++ library support
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       ;;
-      *)
-       # FIXME: insert proper C++ library support
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       ;;
-    esac
-    ;;
-  netbsd*)
-    if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
-      wlarc=
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-    fi
-    # Workaround some broken pre-1.5 toolchains
-    output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
-    ;;
-  openbsd2*)
-    # C++ shared libraries are fairly broken
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    ;;
-  openbsd*)
-    _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-    _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-    _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-    if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
-      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-    fi
-    output_verbose_link_cmd='echo'
-    ;;
-  osf3*)
-    case $cc_basename in
-      KCC*)
-       # Kuck and Associates, Inc. (KAI) C++ Compiler
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
 
-       # KCC will only create a shared library if the output file
-       # ends with ".so" (or ".sl" for HP-UX), so rename the library
-       # to its proper name (with version) after linking.
-       _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}\n"
 
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }\n'
 
-       # Archives containing C++ object files must be created using
-       # "CC -Bstatic", where "CC" is the KAI C++ compiler.
-       _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
 
-       ;;
-      RCC*)
-       # Rational C++ 2.4.1
-       # FIXME: insert proper C++ library support
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       ;;
-      cxx*)
-       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
 
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${GCJ-"gcj"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
 
-       # Commands to make compiler produce verbose output that lists
-       # what "hidden" libraries, object files and flags are used when
-       # linking a shared library.
-       #
-       # There doesn't appear to be a way to prevent this compiler from
-       # explicitly linking system object files so we need to strip them
-       # from the output so that they don't get included in the library
-       # dependencies.
-       output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-       ;;
-      *)
-       if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
 
-         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
 
-         # Commands to make compiler produce verbose output that lists
-         # what "hidden" libraries, object files and flags are used when
-         # linking a shared library.
-         output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_DLOPEN_SELF($1)
 
-       else
-         # FIXME: insert proper C++ library support
-         _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       fi
-       ;;
-    esac
-    ;;
-  osf4* | osf5*)
-    case $cc_basename in
-      KCC*)
-       # Kuck and Associates, Inc. (KAI) C++ Compiler
+AC_LIBTOOL_CONFIG($1)
 
-       # KCC will only create a shared library if the output file
-       # ends with ".so" (or ".sl" for HP-UX), so rename the library
-       # to its proper name (with version) after linking.
-       _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_GCJ_CONFIG
 
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
 
-       # Archives containing C++ object files must be created using
-       # the KAI C++ compiler.
-       _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
-       ;;
-      RCC*)
-       # Rational C++ 2.4.1
-       # FIXME: insert proper C++ library support
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       ;;
-      cxx*)
-       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
-         echo "-hidden">> $lib.exp~
-         $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp  `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~
-         $rm $lib.exp'
+# AC_LIBTOOL_LANG_RC_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the Windows resource compiler are
+# suitably defined.  Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
+AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
+[AC_LANG_SAVE
 
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
-       _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+# Source file extension for RC test sources.
+ac_ext=rc
 
-       # Commands to make compiler produce verbose output that lists
-       # what "hidden" libraries, object files and flags are used when
-       # linking a shared library.
-       #
-       # There doesn't appear to be a way to prevent this compiler from
-       # explicitly linking system object files so we need to strip them
-       # from the output so that they don't get included in the library
-       # dependencies.
-       output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
-       ;;
-      *)
-       if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
 
-         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
 
-         # Commands to make compiler produce verbose output that lists
-         # what "hidden" libraries, object files and flags are used when
-         # linking a shared library.
-         output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"'
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
 
-       else
-         # FIXME: insert proper C++ library support
-         _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       fi
-       ;;
-    esac
-    ;;
-  psos*)
-    # FIXME: insert proper C++ library support
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    ;;
-  sco*)
-    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-    case $cc_basename in
-      CC*)
-       # FIXME: insert proper C++ library support
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       ;;
-      *)
-       # FIXME: insert proper C++ library support
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       ;;
-    esac
-    ;;
-  sunos4*)
-    case $cc_basename in
-      CC*)
-       # Sun C++ 4.x
-       # FIXME: insert proper C++ library support
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       ;;
-      lcc*)
-       # Lucid
-       # FIXME: insert proper C++ library support
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       ;;
-      *)
-       # FIXME: insert proper C++ library support
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       ;;
-    esac
-    ;;
-  solaris*)
-    case $cc_basename in
-      CC*)
-       # Sun C++ 4.2, 5.x and Centerline C++
-        _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes
-       _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
-       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-       $CC -G${allow_undefined_flag}  ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
 
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-       case $host_os in
-         solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
-         *)
-           # The C++ compiler is used as linker so we must use $wl
-           # flag to pass the commands to the underlying system
-           # linker. We must also pass each convience library through
-           # to the system linker between allextract/defaultextract.
-           # The C++ compiler will combine linker options so we
-           # cannot just pass the convience library names through
-           # without $wl.
-           # Supported since Solaris 2.6 (maybe 2.5.1?)
-           _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract'
-           ;;
-       esac
-       _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
 
-       output_verbose_link_cmd='echo'
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${RC-"windres"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
 
-       # Archives containing C++ object files must be created using
-       # "CC -xar", where "CC" is the Sun C++ compiler.  This is
-       # necessary to make sure instantiated templates are included
-       # in the archive.
-       _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
-       ;;
-      gcx*)
-       # Green Hills C++ Compiler
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+AC_LIBTOOL_CONFIG($1)
 
-       # The C++ compiler must be used to create the archive.
-       _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
-       ;;
-      *)
-       # GNU C++ compiler with Solaris linker
-       if test "$GXX" = yes && test "$with_gnu_ld" = no; then
-         _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
-         if $CC --version | grep -v '^2\.7' > /dev/null; then
-           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-           _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-               $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_RC_CONFIG
 
-           # Commands to make compiler produce verbose output that lists
-           # what "hidden" libraries, object files and flags are used when
-           # linking a shared library.
-           output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
-         else
-           # g++ 2.7 appears to require `-G' NOT `-shared' on this
-           # platform.
-           _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
-           _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-               $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp'
 
-           # Commands to make compiler produce verbose output that lists
-           # what "hidden" libraries, object files and flags are used when
-           # linking a shared library.
-           output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
-         fi
+# AC_LIBTOOL_CONFIG([TAGNAME])
+# ----------------------------
+# If TAGNAME is not passed, then create an initial libtool script
+# with a default configuration from the untagged config vars.  Otherwise
+# add code to config.status for appending the configuration named by
+# TAGNAME from the matching tagged config vars.
+AC_DEFUN([AC_LIBTOOL_CONFIG],
+[# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+  # See if we are running on zsh, and set the options which allow our commands through
+  # without removal of \ escapes.
+  if test -n "${ZSH_VERSION+set}" ; then
+    setopt NO_GLOB_SUBST
+  fi
+  # Now quote all the things that may contain metacharacters while being
+  # careful not to overquote the AC_SUBSTed values.  We take copies of the
+  # variables and quote the copies for generation of the libtool script.
+  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
+    SED SHELL STRIP \
+    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+    deplibs_check_method reload_flag reload_cmds need_locks \
+    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+    lt_cv_sys_global_symbol_to_c_name_address \
+    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+    old_postinstall_cmds old_postuninstall_cmds \
+    _LT_AC_TAGVAR(compiler, $1) \
+    _LT_AC_TAGVAR(CC, $1) \
+    _LT_AC_TAGVAR(LD, $1) \
+    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
+    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
+    _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
+    _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
+    _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
+    _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
+    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
+    _LT_AC_TAGVAR(old_archive_cmds, $1) \
+    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
+    _LT_AC_TAGVAR(predep_objects, $1) \
+    _LT_AC_TAGVAR(postdep_objects, $1) \
+    _LT_AC_TAGVAR(predeps, $1) \
+    _LT_AC_TAGVAR(postdeps, $1) \
+    _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
+    _LT_AC_TAGVAR(archive_cmds, $1) \
+    _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
+    _LT_AC_TAGVAR(postinstall_cmds, $1) \
+    _LT_AC_TAGVAR(postuninstall_cmds, $1) \
+    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
+    _LT_AC_TAGVAR(allow_undefined_flag, $1) \
+    _LT_AC_TAGVAR(no_undefined_flag, $1) \
+    _LT_AC_TAGVAR(export_symbols_cmds, $1) \
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
+    _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
+    _LT_AC_TAGVAR(hardcode_automatic, $1) \
+    _LT_AC_TAGVAR(module_cmds, $1) \
+    _LT_AC_TAGVAR(module_expsym_cmds, $1) \
+    _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
+    _LT_AC_TAGVAR(exclude_expsyms, $1) \
+    _LT_AC_TAGVAR(include_expsyms, $1); do
 
-         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
-       fi
-       ;;
-    esac
-    ;;
-  sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*)
-    _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-    ;;
-  tandem*)
-    case $cc_basename in
-      NCC*)
-       # NonStop-UX NCC 3.20
-       # FIXME: insert proper C++ library support
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       ;;
-      *)
-       # FIXME: insert proper C++ library support
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       ;;
+    case $var in
+    _LT_AC_TAGVAR(old_archive_cmds, $1) | \
+    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
+    _LT_AC_TAGVAR(archive_cmds, $1) | \
+    _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
+    _LT_AC_TAGVAR(module_cmds, $1) | \
+    _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
+    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
+    _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
+    extract_expsyms_cmds | reload_cmds | finish_cmds | \
+    postinstall_cmds | postuninstall_cmds | \
+    old_postinstall_cmds | old_postuninstall_cmds | \
+    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+      # Double-quote double-evaled strings.
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+      ;;
+    *)
+      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+      ;;
     esac
+  done
+
+  case $lt_echo in
+  *'\[$]0 --fallback-echo"')
+    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
     ;;
-  vxworks*)
-    # FIXME: insert proper C++ library support
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    ;;
-  *)
-    # FIXME: insert proper C++ library support
-    _LT_AC_TAGVAR(ld_shlibs, $1)=no
-    ;;
-esac
-AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
-test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+  esac
 
-_LT_AC_TAGVAR(GCC, $1)="$GXX"
-_LT_AC_TAGVAR(LD, $1)="$LD"
+ifelse([$1], [],
+  [cfgfile="${ofile}T"
+  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
+  $rm -f "$cfgfile"
+  AC_MSG_NOTICE([creating $ofile])],
+  [cfgfile="$ofile"])
 
-## CAVEAT EMPTOR:
-## There is no encapsulation within the following macros, do not change
-## the running order or otherwise move them around unless you know exactly
-## what you are doing...
-AC_LIBTOOL_POSTDEP_PREDEP($1)
-AC_LIBTOOL_PROG_COMPILER_PIC($1)
-AC_LIBTOOL_PROG_CC_C_O($1)
-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
-AC_LIBTOOL_PROG_LD_SHLIBS($1)
-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-AC_LIBTOOL_SYS_LIB_STRIP
-AC_LIBTOOL_DLOPEN_SELF($1)
+  cat <<__EOF__ >> "$cfgfile"
+ifelse([$1], [],
+[#! $SHELL
 
-AC_LIBTOOL_CONFIG($1)
+# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+#
+# This file is part of GNU Libtool:
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
 
-AC_LANG_POP
-CC=$lt_save_CC
-LDCXX=$LD
-LD=$lt_save_LD
-GCC=$lt_save_GCC
-with_gnu_ldcxx=$with_gnu_ld
-with_gnu_ld=$lt_save_with_gnu_ld
-lt_cv_path_LDCXX=$lt_cv_path_LD
-lt_cv_path_LD=$lt_save_path_LD
-lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
-lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
-])# AC_LIBTOOL_LANG_CXX_CONFIG
+# A sed program that does not truncate output.
+SED=$lt_SED
 
-# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
-# ------------------------
-# Figure out "hidden" library dependencies from verbose
-# compiler output when linking a shared library.
-# Parse the compiler output and extract the necessary
-# objects, libraries and library flags.
-AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[
-dnl we can't use the lt_simple_compile_test_code here,
-dnl because it contains code intended for an executable,
-dnl not a library.  It's possible we should let each
-dnl tag define a new lt_????_link_test_code variable,
-dnl but it's only used here...
-ifelse([$1],[],[cat > conftest.$ac_ext <<EOF
-int a;
-void foo (void) { a = 0; }
-EOF
-],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
-class Foo
-{
-public:
-  Foo (void) { a = 0; }
-private:
-  int a;
-};
-EOF
-],[$1],[F77],[cat > conftest.$ac_ext <<EOF
-      subroutine foo
-      implicit none
-      integer*4 a
-      a=0
-      return
-      end
-EOF
-],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
-public class foo {
-  private int a;
-  public void bar (void) {
-    a = 0;
-  }
-};
-EOF
-])
-dnl Parse the compiler output and extract the necessary
-dnl objects, libraries and library flags.
-if AC_TRY_EVAL(ac_compile); then
-  # Parse the compiler output and extract the necessary
-  # objects, libraries and library flags.
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="$SED -e 1s/^X//"
 
-  # Sentinel used to keep track of whether or not we are before
-  # the conftest object file.
-  pre_test_object_deps_done=no
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
-  # The `*' in the case matches for architectures that use `case' in
-  # $output_verbose_cmd can trigger glob expansion during the loop
-  # eval without this substitution.
-  output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"`
+# The names of the tagged configurations supported by this script.
+available_tags=
 
-  for p in `eval $output_verbose_link_cmd`; do
-    case $p in
+# ### BEGIN LIBTOOL CONFIG],
+[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
 
-    -L* | -R* | -l*)
-       # Some compilers place space between "-{L,R}" and the path.
-       # Remove the space.
-       if test $p = "-L" \
-         || test $p = "-R"; then
-        prev=$p
-        continue
-       else
-        prev=
-       fi
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
 
-       if test "$pre_test_object_deps_done" = no; then
-        case $p in
-        -L* | -R*)
-          # Internal compiler library paths should come after those
-          # provided the user.  The postdeps already come after the
-          # user supplied libs so there is no need to process them.
-          if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
-            _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
-          else
-            _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
-          fi
-          ;;
-        # The "-l" case would never come before the object being
-        # linked, so don't bother handling this case.
-        esac
-       else
-        if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
-          _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
-        else
-          _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
-        fi
-       fi
-       ;;
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
 
-    *.$objext)
-       # This assumes that the test object file only shows up
-       # once in the compiler output.
-       if test "$p" = "conftest.$objext"; then
-        pre_test_object_deps_done=yes
-        continue
-       fi
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
 
-       if test "$pre_test_object_deps_done" = no; then
-        if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
-          _LT_AC_TAGVAR(predep_objects, $1)="$p"
-        else
-          _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
-        fi
-       else
-        if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
-          _LT_AC_TAGVAR(postdep_objects, $1)="$p"
-        else
-          _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
-        fi
-       fi
-       ;;
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
 
-    *) ;; # Ignore the rest.
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
 
-    esac
-  done
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
 
-  # Clean up.
-  rm -f a.out a.exe
-else
-  echo "libtool.m4: error: problem compiling $1 test program"
-fi
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
 
-$rm -f confest.$objext
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
 
-# PORTME: override above test on systems where it is broken
-ifelse([$1],[CXX],
-[case $host_os in
-solaris*)
-  case $cc_basename in
-  CC*)
-    # Adding this requires a known-good setup of shared libraries for
-    # Sun compiler versions before 5.6, else PIC objects from an old
-    # archive will be linked into the output, leading to subtle bugs.
-    _LT_AC_TAGVAR(postdeps,$1)='-lCstd -lCrun'
-    ;;
-  esac
-esac
-])
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
 
-case " $_LT_AC_TAGVAR(postdeps, $1) " in
-*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
-esac
-])# AC_LIBTOOL_POSTDEP_PREDEP
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
 
-# AC_LIBTOOL_LANG_F77_CONFIG
-# ------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined.  Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
-AC_DEFUN([_LT_AC_LANG_F77_CONFIG],
-[AC_REQUIRE([AC_PROG_F77])
-AC_LANG_PUSH(Fortran 77)
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
 
-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-_LT_AC_TAGVAR(allow_undefined_flag, $1)=
-_LT_AC_TAGVAR(always_export_symbols, $1)=no
-_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
-_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
-_LT_AC_TAGVAR(hardcode_direct, $1)=no
-_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
-_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
-_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
-_LT_AC_TAGVAR(hardcode_automatic, $1)=no
-_LT_AC_TAGVAR(module_cmds, $1)=
-_LT_AC_TAGVAR(module_expsym_cmds, $1)=
-_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
-_LT_AC_TAGVAR(no_undefined_flag, $1)=
-_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
-_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+# A C compiler.
+LTCC=$lt_LTCC
 
-# Source file extension for f77 test sources.
-ac_ext=f
+# A language-specific compiler.
+CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
 
-# Object file extension for compiled f77 test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
+# Is the compiler the GNU C compiler?
+with_gcc=$_LT_AC_TAGVAR(GCC, $1)
 
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="      subroutine t\n      return\n      end\n"
+# An ERE matcher.
+EGREP=$lt_EGREP
 
-# Code to be used in simple link tests
-lt_simple_link_test_code="      program t\n      end\n"
+# The linker used to build libraries.
+LD=$lt_[]_LT_AC_TAGVAR(LD, $1)
 
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_AC_SYS_COMPILER
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
 
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
+# A BSD-compatible nm program.
+NM=$lt_NM
 
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${F77-"f77"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
+# A symbol stripping program
+STRIP=$lt_STRIP
 
-AC_MSG_CHECKING([if libtool supports shared libraries])
-AC_MSG_RESULT([$can_build_shared])
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
 
-AC_MSG_CHECKING([whether to build shared libraries])
-test "$can_build_shared" = "no" && enable_shared=no
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
 
-# On AIX, shared libraries and static libraries use the same namespace, and
-# are all built from PIC.
-case $host_os in
-aix3*)
-  test "$enable_shared" = yes && enable_static=no
-  if test -n "$RANLIB"; then
-    archive_cmds="$archive_cmds~\$RANLIB \$lib"
-    postinstall_cmds='$RANLIB $lib'
-  fi
-  ;;
-aix4* | aix5*)
-  if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
-    test "$enable_shared" = yes && enable_static=no
-  fi
-  ;;
-esac
-AC_MSG_RESULT([$enable_shared])
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
 
-AC_MSG_CHECKING([whether to build static libraries])
-# Make sure either enable_shared or enable_static is yes.
-test "$enable_shared" = yes || enable_static=yes
-AC_MSG_RESULT([$enable_static])
+# Used on cygwin: assembler.
+AS="$AS"
 
-test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
 
-_LT_AC_TAGVAR(GCC, $1)="$G77"
-_LT_AC_TAGVAR(LD, $1)="$LD"
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
 
-AC_LIBTOOL_PROG_COMPILER_PIC($1)
-AC_LIBTOOL_PROG_CC_C_O($1)
-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
-AC_LIBTOOL_PROG_LD_SHLIBS($1)
-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-AC_LIBTOOL_SYS_LIB_STRIP
+# How to pass a linker flag through the compiler.
+wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
 
+# Object file suffix (normally "o").
+objext="$ac_objext"
 
-AC_LIBTOOL_CONFIG($1)
+# Old archive suffix (normally "a").
+libext="$libext"
 
-AC_LANG_POP
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_F77_CONFIG
+# Shared library suffix (normally ".so").
+shrext_cmds='$shrext_cmds'
 
+# Executable file suffix (normally "").
+exeext="$exeext"
 
-# AC_LIBTOOL_LANG_GCJ_CONFIG
-# --------------------------
-# Ensure that the configuration vars for the C compiler are
-# suitably defined.  Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
-AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
-[AC_LANG_SAVE
+# Additional compiler flags for building library objects.
+pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
+pic_mode=$pic_mode
 
-# Source file extension for Java test sources.
-ac_ext=java
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
 
-# Object file extension for compiled Java test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
 
-# Code to be used in simple compile tests
-lt_simple_compile_test_code="class foo {}\n"
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
 
-# Code to be used in simple link tests
-lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }\n'
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
 
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_AC_SYS_COMPILER
+# Do we need a version for libraries?
+need_version=$need_version
 
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
 
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${GCJ-"gcj"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
 
-# GCJ did not exist at the time GCC didn't implicitly link libc in.
-_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
 
-_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
 
-## CAVEAT EMPTOR:
-## There is no encapsulation within the following macros, do not change
-## the running order or otherwise move them around unless you know exactly
-## what you are doing...
-AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
-AC_LIBTOOL_PROG_COMPILER_PIC($1)
-AC_LIBTOOL_PROG_CC_C_O($1)
-AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
-AC_LIBTOOL_PROG_LD_SHLIBS($1)
-AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
-AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
-AC_LIBTOOL_SYS_LIB_STRIP
-AC_LIBTOOL_DLOPEN_SELF($1)
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
 
-AC_LIBTOOL_CONFIG($1)
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
 
-AC_LANG_RESTORE
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_GCJ_CONFIG
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
 
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
 
-# AC_LIBTOOL_LANG_RC_CONFIG
-# --------------------------
-# Ensure that the configuration vars for the Windows resource compiler are
-# suitably defined.  Those variables are subsequently used by
-# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
-AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
-AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
-[AC_LANG_SAVE
+# Library versioning type.
+version_type=$version_type
 
-# Source file extension for RC test sources.
-ac_ext=rc
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
 
-# Object file extension for compiled RC test sources.
-objext=o
-_LT_AC_TAGVAR(objext, $1)=$objext
+# List of archive names.  First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
 
-# Code to be used in simple compile tests
-lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
 
-# Code to be used in simple link tests
-lt_simple_link_test_code="$lt_simple_compile_test_code"
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
 
-# ltmain only uses $CC for tagged configurations so make sure $CC is set.
-_LT_AC_SYS_COMPILER
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
 
-# save warnings/boilerplate of simple test code
-_LT_COMPILER_BOILERPLATE
-_LT_LINKER_BOILERPLATE
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
 
-# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
-CC=${RC-"windres"}
-compiler=$CC
-_LT_AC_TAGVAR(compiler, $1)=$CC
-_LT_CC_BASENAME([$compiler])
-_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
+archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
 
-AC_LIBTOOL_CONFIG($1)
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
+module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
 
-AC_LANG_RESTORE
-CC="$lt_save_CC"
-])# AC_LIBTOOL_LANG_RC_CONFIG
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
 
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
 
-# AC_LIBTOOL_CONFIG([TAGNAME])
-# ----------------------------
-# If TAGNAME is not passed, then create an initial libtool script
-# with a default configuration from the untagged config vars.  Otherwise
-# add code to config.status for appending the configuration named by
-# TAGNAME from the matching tagged config vars.
-AC_DEFUN([AC_LIBTOOL_CONFIG],
-[# The else clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
-  # See if we are running on zsh, and set the options which allow our commands through
-  # without removal of \ escapes.
-  if test -n "${ZSH_VERSION+set}" ; then
-    setopt NO_GLOB_SUBST
-  fi
-  # Now quote all the things that may contain metacharacters while being
-  # careful not to overquote the AC_SUBSTed values.  We take copies of the
-  # variables and quote the copies for generation of the libtool script.
-  for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM \
-    SED SHELL STRIP \
-    libname_spec library_names_spec soname_spec extract_expsyms_cmds \
-    old_striplib striplib file_magic_cmd finish_cmds finish_eval \
-    deplibs_check_method reload_flag reload_cmds need_locks \
-    lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
-    lt_cv_sys_global_symbol_to_c_name_address \
-    sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
-    old_postinstall_cmds old_postuninstall_cmds \
-    _LT_AC_TAGVAR(compiler, $1) \
-    _LT_AC_TAGVAR(CC, $1) \
-    _LT_AC_TAGVAR(LD, $1) \
-    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
-    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
-    _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
-    _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
-    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
-    _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
-    _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
-    _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
-    _LT_AC_TAGVAR(old_archive_cmds, $1) \
-    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
-    _LT_AC_TAGVAR(predep_objects, $1) \
-    _LT_AC_TAGVAR(postdep_objects, $1) \
-    _LT_AC_TAGVAR(predeps, $1) \
-    _LT_AC_TAGVAR(postdeps, $1) \
-    _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
-    _LT_AC_TAGVAR(archive_cmds, $1) \
-    _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
-    _LT_AC_TAGVAR(postinstall_cmds, $1) \
-    _LT_AC_TAGVAR(postuninstall_cmds, $1) \
-    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
-    _LT_AC_TAGVAR(allow_undefined_flag, $1) \
-    _LT_AC_TAGVAR(no_undefined_flag, $1) \
-    _LT_AC_TAGVAR(export_symbols_cmds, $1) \
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
-    _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
-    _LT_AC_TAGVAR(hardcode_automatic, $1) \
-    _LT_AC_TAGVAR(module_cmds, $1) \
-    _LT_AC_TAGVAR(module_expsym_cmds, $1) \
-    _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
-    _LT_AC_TAGVAR(exclude_expsyms, $1) \
-    _LT_AC_TAGVAR(include_expsyms, $1); do
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
 
-    case $var in
-    _LT_AC_TAGVAR(old_archive_cmds, $1) | \
-    _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
-    _LT_AC_TAGVAR(archive_cmds, $1) | \
-    _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
-    _LT_AC_TAGVAR(module_cmds, $1) | \
-    _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
-    _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
-    _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
-    extract_expsyms_cmds | reload_cmds | finish_cmds | \
-    postinstall_cmds | postuninstall_cmds | \
-    old_postinstall_cmds | old_postuninstall_cmds | \
-    sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
-      # Double-quote double-evaled strings.
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
-      ;;
-    *)
-      eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
-      ;;
-    esac
-  done
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
 
-  case $lt_echo in
-  *'\[$]0 --fallback-echo"')
-    lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
-    ;;
-  esac
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
 
-ifelse([$1], [],
-  [cfgfile="${ofile}T"
-  trap "$rm \"$cfgfile\"; exit 1" 1 2 15
-  $rm -f "$cfgfile"
-  AC_MSG_NOTICE([creating $ofile])],
-  [cfgfile="$ofile"])
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
 
-  cat <<__EOF__ >> "$cfgfile"
-ifelse([$1], [],
-[#! $SHELL
-
-# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
-# Free Software Foundation, Inc.
-#
-# This file is part of GNU Libtool:
-# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# A sed program that does not truncate output.
-SED=$lt_SED
-
-# Sed that helps us avoid accidentally triggering echo(1) options like -n.
-Xsed="$SED -e 1s/^X//"
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
-# The names of the tagged configurations supported by this script.
-available_tags=
-
-# ### BEGIN LIBTOOL CONFIG],
-[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
-
-# Whether or not to disallow shared libs when runtime libs are static
-allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# The host system.
-host_alias=$host_alias
-host=$host
-host_os=$host_os
-
-# The build system.
-build_alias=$build_alias
-build=$build
-build_os=$build_os
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# A C compiler.
-LTCC=$lt_LTCC
-
-# A language-specific compiler.
-CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
-
-# Is the compiler the GNU C compiler?
-with_gcc=$_LT_AC_TAGVAR(GCC, $1)
-
-# An ERE matcher.
-EGREP=$lt_EGREP
-
-# The linker used to build libraries.
-LD=$lt_[]_LT_AC_TAGVAR(LD, $1)
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$lt_STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Shared library suffix (normally ".so").
-shrext_cmds='$shrext_cmds'
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
-pic_mode=$pic_mode
-
-# What is the maximum length of a command?
-max_cmd_len=$lt_cv_sys_max_cmd_len
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
-
-# Must we lock files when doing compilation?
-need_locks=$lt_need_locks
-
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
-
-# Library versioning type.
-version_type=$version_type
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names.  First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
-archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands used to build a loadable module (assumed same as above if empty)
-module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
-module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
-
-# Dependencies to place before the objects being linked to create a
-# shared library.
-predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
-
-# Dependencies to place after the objects being linked to create a
-# shared library.
-postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
-
-# The library search path used internally by the compiler when linking
-# a shared library.
-compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
 
 # Command to use when deplibs_check_method == file_magic.
 file_magic_cmd=$lt_file_magic_cmd
@@ -6097,1235 +4950,2526 @@ AC_MSG_CHECKING([for $compiler option to produce PIC])
        ;;
     esac
   fi
-],
-[
-  if test "$GCC" = yes; then
-    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+],
+[
+  if test "$GCC" = yes; then
+    _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+    _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      # FIXME: we need at least 68020 code to build shared libraries, but
+      # adding the `-m68020' flag to GCC prevents building anything better,
+      # like `-m68040'.
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+      ;;
+
+    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | pw32* | os2*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      enable_shared=no
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+      fi
+      ;;
+
+    hpux*)
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+       # +Z the default
+       ;;
+      *)
+       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+       ;;
+      esac
+      ;;
+
+    *)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      else
+       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+      darwin*)
+        # PIC is the default on this platform
+        # Common symbols not allowed in MH_DYLIB files
+       case $cc_basename in
+         xlc*)
+         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
+         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+         ;;
+       esac
+       ;;
+
+    mingw* | pw32* | os2*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+       # +Z the default
+       ;;
+      *)
+       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+       ;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # PIC (with -KPIC) is the default.
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    newsos6)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    linux*)
+      case $cc_basename in
+      icc* | ecc*)
+       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+        ;;
+      pgcc* | pgf77* | pgf90* | pgf95*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+       # which looks to be a dead project)
+       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+        ;;
+      ccc*)
+        _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+        # All Alpha code is PIC.
+        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+        ;;
+      esac
+      ;;
+
+    osf3* | osf4* | osf5*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # All OSF/1 code is PIC.
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    sco3.2v5*)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn'
+      ;;
+
+    solaris*)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95*)
+       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+      *)
+       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    unicos*)
+      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      ;;
+
+    uts4*)
+      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    *)
+      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      ;;
+    esac
+  fi
+])
+AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
+  AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
+    _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
+    [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
+    [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
+     "" | " "*) ;;
+     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+     esac],
+    [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+fi
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+    ;;
+  *)
+    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
+    ;;
+esac
+])
+
+
+# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
+# ------------------------------------
+# See if the linker supports building shared libraries.
+AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
+[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+ifelse([$1],[CXX],[
+  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  case $host_os in
+  aix4* | aix5*)
+    # If we're using GNU nm, then we don't want the "-C" option.
+    # -C means demangle to AIX nm, but means don't demangle with GNU nm
+    if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+    else
+      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+    fi
+    ;;
+  pw32*)
+    _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+  ;;
+  cygwin* | mingw*)
+    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  *)
+    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  esac
+],[
+  runpath_var=
+  _LT_AC_TAGVAR(allow_undefined_flag, $1)=
+  _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+  _LT_AC_TAGVAR(archive_cmds, $1)=
+  _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+  _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
+  _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+  _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
+  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+  _LT_AC_TAGVAR(hardcode_direct, $1)=no
+  _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+  _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+  _LT_AC_TAGVAR(hardcode_automatic, $1)=no
+  _LT_AC_TAGVAR(module_cmds, $1)=
+  _LT_AC_TAGVAR(module_expsym_cmds, $1)=
+  _LT_AC_TAGVAR(always_export_symbols, $1)=no
+  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  _LT_AC_TAGVAR(include_expsyms, $1)=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ` (' and `)$', so one must not match beginning or
+  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+  # as well as any symbol that contains `d'.
+  _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
+  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+  # platforms (ab)use it in PIC code, but their linkers get confused if
+  # the symbol is explicitly referenced.  Since portable code cannot
+  # rely on this symbol name, it's probably fine to never include it in
+  # preloaded symbol tables.
+  extract_expsyms_cmds=
+  # Just being paranoid about ensuring that cc_basename is set.
+  _LT_CC_BASENAME([$compiler])
+  case $host_os in
+  cygwin* | mingw* | pw32*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test "$GCC" != yes; then
+      with_gnu_ld=no
+    fi
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+  if test "$with_gnu_ld" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
+
+    # Set some defaults for GNU ld with shared library support. These
+    # are reset later if shared libraries are not supported. Putting them
+    # here allows them to be overridden if necessary.
+    runpath_var=LD_RUN_PATH
+    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+      else
+       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>/dev/null` in
+      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
+      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+      *\ 2.11.*) ;; # other 2.11 versions
+      *) supports_anon_versioning=yes ;;
+    esac
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix3* | aix4* | aix5*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       cat <<EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.9.1, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+EOF
+      fi
+      ;;
+
+    amigaos*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+
+      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+      # that the semantics of dynamic libraries on AmigaOS, at least up
+      # to version 4, is to share data among multiple programs linked
+      # with the same dynamic library.  Since this doesn't match the
+      # behavior of shared libraries on other platforms, we can't use
+      # them.
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+       # support --undefined.  This deserves some investigation.  FIXME
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+      # as there is no search path for DLLs.
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_AC_TAGVAR(always_export_symbols, $1)=no
+      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
+
+      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+       # If the export-symbols file already is a .def file (1st line
+       # is EXPORTS), use it as is; otherwise, prepend...
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+         cp $export_symbols $output_objdir/$soname.def;
+       else
+         echo EXPORTS > $output_objdir/$soname.def;
+         cat $export_symbols >> $output_objdir/$soname.def;
+       fi~
+       $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000  ${wl}--out-implib,$lib'
+      else
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    linux*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       tmp_addflag=
+       case $cc_basename,$host_cpu in
+       pgcc*)                          # Portland Group C compiler
+         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+         tmp_addflag=' $pic_flag'
+         ;;
+       pgf77* | pgf90* | pgf95*)       # Portland Group f77 and f90 compilers
+         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
+         tmp_addflag=' $pic_flag -Mnomain' ;;
+       ecc*,ia64* | icc*,ia64*)                # Intel C compiler on ia64
+         tmp_addflag=' -i_dynamic' ;;
+       efc*,ia64* | ifort*,ia64*)      # Intel Fortran compiler on ia64
+         tmp_addflag=' -i_dynamic -nofor_main' ;;
+       ifc* | ifort*)                  # Intel Fortran compiler
+         tmp_addflag=' -nofor_main' ;;
+       esac
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+       if test $supports_anon_versioning = yes; then
+         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
+  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+  $echo "local: *; };" >> $output_objdir/$libname.ver~
+         $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+       fi
+      else
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+       wlarc=
+      else
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris* | sysv5*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+       cat <<EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+EOF
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    sunos4*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+    esac
+
+    if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then
+      runpath_var=
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      if test "$GCC" = yes && test -z "$link_static_flag"; then
+       # Neither direct hardcoding nor static linking is supported with a
+       # broken collect2.
+       _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
+      fi
+      ;;
+
+    aix4* | aix5*)
+      if test "$host_cpu" = ia64; then
+       # On IA64, the linker does run time linking by default, so we don't
+       # have to do anything special.
+       aix_use_runtimelinking=no
+       exp_sym_flag='-Bexport'
+       no_entry_flag=""
+      else
+       # If we're using GNU nm, then we don't want the "-C" option.
+       # -C means demangle to AIX nm, but means don't demangle with GNU nm
+       if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
+         _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+       else
+         _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+       fi
+       aix_use_runtimelinking=no
+
+       # Test if we are trying to use run time linking or normal
+       # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+       # need to do runtime linking.
+       case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
+         for ld_flag in $LDFLAGS; do
+         if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+           aix_use_runtimelinking=yes
+           break
+         fi
+         done
+       esac
+
+       exp_sym_flag='-bexport'
+       no_entry_flag='-bnoentry'
+      fi
+
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+      _LT_AC_TAGVAR(archive_cmds, $1)=''
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+      if test "$GCC" = yes; then
+       case $host_os in aix4.[[012]]|aix4.[[012]].*)
+       # We only want to do this on AIX 4.2 and lower, the check
+       # below for broken collect2 doesn't work under 4.3+
+         collect2name=`${CC} -print-prog-name=collect2`
+         if test -f "$collect2name" && \
+          strings "$collect2name" | grep resolve_lib_name >/dev/null
+         then
+         # We have reworked collect2
+         _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+         else
+         # We have old collect2
+         _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
+         # It fails to find uninstalled libraries when the uninstalled
+         # path is not listed in the libpath.  Setting hardcode_minus_L
+         # to unsupported forces relinking
+         _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+         fi
+       esac
+       shared_flag='-shared'
+       if test "$aix_use_runtimelinking" = yes; then
+         shared_flag="$shared_flag "'${wl}-G'
+       fi
+      else
+       # not using gcc
+       if test "$host_cpu" = ia64; then
+       # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+       # chokes on -Wl,-G. The following line is correct:
+         shared_flag='-G'
+       else
+       if test "$aix_use_runtimelinking" = yes; then
+           shared_flag='${wl}-G'
+         else
+           shared_flag='${wl}-bM:SRE'
+       fi
+       fi
+      fi
+
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+      if test "$aix_use_runtimelinking" = yes; then
+       # Warning - without using the other runtime loading flags (-brtl),
+       # -berok will link without error, but may produce a broken library.
+       _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
+       # Determine the default libpath from the value encoded in an empty executable.
+       _LT_AC_SYS_LIBPATH_AIX
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+       else
+       if test "$host_cpu" = ia64; then
+         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+         _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+         _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
+       else
+        # Determine the default libpath from the value encoded in an empty executable.
+        _LT_AC_SYS_LIBPATH_AIX
+        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+         # Warning - without using the other run time loading flags,
+         # -berok will link without error, but may produce a broken library.
+         _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+         # -bexpall does not export symbols beginning with underscore (_)
+         _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+         # Exported symbols can be pulled into shared objects from archives
+         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
+         _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+         # This is similar to how AIX traditionally builds its shared libraries.
+         _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+       fi
+      fi
+      ;;
+
+    amigaos*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      # see comment about different semantics on the GNU ld section
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+
+    bsdi[[45]]*)
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+      # Tell ltmain to make .lib files, not .a files.
+      libext=lib
+      # Tell ltmain to make .dll files, not .so files.
+      shrext_cmds=".dll"
+      # FIXME: Setting linknames here is a bad hack.
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
+      # FIXME: Should let the user specify the lib program.
+      _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
+      _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
+      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      ;;
+
+    darwin* | rhapsody*)
+      case $host_os in
+        rhapsody* | darwin1.[[012]])
+         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
+         ;;
+       *) # Darwin 1.3 on
+         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+         else
+           case ${MACOSX_DEPLOYMENT_TARGET} in
+             10.[[012]])
+               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
+               ;;
+             10.*)
+               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
+               ;;
+           esac
+         fi
+         ;;
+      esac
+      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_AC_TAGVAR(hardcode_direct, $1)=no
+      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+    if test "$GCC" = yes ; then
+       output_verbose_link_cmd='echo'
+        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+      _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+      _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    else
+      case $cc_basename in
+        xlc*)
+         output_verbose_link_cmd='echo'
+         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+         _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
+         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+          ;;
+       *)
+         _LT_AC_TAGVAR(ld_shlibs, $1)=no
+          ;;
+      esac
+    fi
+      ;;
+
+    dgux*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    freebsd1*)
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+
+    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+    # support.  Future versions do this automatically, but an explicit c++rt0.o
+    # does not break anything, and helps significantly (at the cost of a little
+    # extra space).
+    freebsd2.2*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | kfreebsd*-gnu | dragonfly*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+       _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+       _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      ;;
+
+    hpux10* | hpux11*)
+      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+       case $host_cpu in
+       hppa*64*|ia64*)
+         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       esac
+      else
+       case $host_cpu in
+       hppa*64*|ia64*)
+         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+         ;;
+       *)
+         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+         ;;
+       esac
+      fi
+      if test "$with_gnu_ld" = no; then
+       case $host_cpu in
+       hppa*64*)
+         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+         _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+         _LT_AC_TAGVAR(hardcode_direct, $1)=no
+         _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+         ;;
+       ia64*)
+         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+         _LT_AC_TAGVAR(hardcode_direct, $1)=no
+         _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+
+         # hardcode_minus_L: Not really in the search PATH,
+         # but as the default location of the library.
+         _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+         ;;
+       *)
+         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+         _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+         _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+
+         # hardcode_minus_L: Not really in the search PATH,
+         # but as the default location of the library.
+         _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+         ;;
+       esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    newsos6)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    openbsd*)
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      else
+       case $host_os in
+        openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+          _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+          _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+          ;;
+        *)
+          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+          _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+          ;;
+       esac
+      fi
+      ;;
+
+    os2*)
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      ;;
+
+    osf4* | osf5*)     # as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      else
+       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
+       $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
+
+       # Both c and cxx compiler support -rpath directly
+       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+      ;;
+
+    sco3.2v5*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+      runpath_var=LD_RUN_PATH
+      hardcode_runpath_var=yes
+      ;;
+
+    solaris*)
+      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
+      if test "$GCC" = yes; then
+       wlarc='${wl}'
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+         $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+      else
+       wlarc=''
+       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+       $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      case $host_os in
+      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+      *)
+       # The compiler driver will combine linker options so we
+       # cannot just pass the convience library names through
+       # without $wl, iff we do not link with $LD.
+       # Luckily, gcc supports the same syntax we need for Sun Studio.
+       # Supported since Solaris 2.6 (maybe 2.5.1?)
+       case $wlarc in
+       '')
+         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
+       *)
+         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
+       esac ;;
+      esac
+      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
+    sunos4*)
+      if test "x$host_vendor" = xsequent; then
+       # Use $CC to link under sequent, because it throws in some extra .o
+       # files that make .init and .fini sections work.
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+       sni)
+         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+       ;;
+       siemens)
+         ## LD is ld it makes a PLAMLIB
+         ## CC just makes a GrossModule.
+         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+         _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+         _LT_AC_TAGVAR(hardcode_direct, $1)=no
+        ;;
+       motorola)
+         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+       ;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv4.3*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+       runpath_var=LD_RUN_PATH
+       hardcode_runpath_var=yes
+       _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+      fi
+      ;;
+
+    sysv4.2uw2*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+      _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      hardcode_runpath_var=yes
+      runpath_var=LD_RUN_PATH
+      ;;
+
+   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[[78]]* | unixware7*)
+      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text'
+      if test "$GCC" = yes; then
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      runpath_var='LD_RUN_PATH'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv5*)
+      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
+      # $CC -shared without GNU ld will not create a library from C++
+      # object files and a static libstdc++, better avoid it by now
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+               $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      runpath_var='LD_RUN_PATH'
+      ;;
+
+    uts4*)
+      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *)
+      _LT_AC_TAGVAR(ld_shlibs, $1)=no
+      ;;
+    esac
+  fi
+])
+AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
+x|xyes)
+  # Assume -lc should be added
+  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $_LT_AC_TAGVAR(archive_cmds, $1) in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      AC_MSG_CHECKING([whether -lc should be explicitly linked in])
+      $rm conftest*
+      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+      if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
+        soname=conftest
+        lib=conftest
+        libobjs=conftest.$ac_objext
+        deplibs=
+        wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
+        compiler_flags=-v
+        linker_flags=-v
+        verstring=
+        output_objdir=.
+        libname=conftest
+        lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
+        _LT_AC_TAGVAR(allow_undefined_flag, $1)=
+        if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
+        then
+         _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+        else
+         _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+        fi
+        _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+      else
+        cat conftest.err 1>&5
+      fi
+      $rm conftest*
+      AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
+      ;;
+    esac
+  fi
+  ;;
+esac
+])# AC_LIBTOOL_PROG_LD_SHLIBS
 
-    case $host_os in
-      aix*)
-      # All AIX code is PIC.
-      if test "$host_cpu" = ia64; then
-       # AIX 5 now supports IA64 processor
-       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+
+# _LT_AC_FILE_LTDLL_C
+# -------------------
+# Be careful that the start marker always follows a newline.
+AC_DEFUN([_LT_AC_FILE_LTDLL_C], [
+# /* ltdll.c starts here */
+# #define WIN32_LEAN_AND_MEAN
+# #include <windows.h>
+# #undef WIN32_LEAN_AND_MEAN
+# #include <stdio.h>
+#
+# #ifndef __CYGWIN__
+# #  ifdef __CYGWIN32__
+# #    define __CYGWIN__ __CYGWIN32__
+# #  endif
+# #endif
+#
+# #ifdef __cplusplus
+# extern "C" {
+# #endif
+# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
+# #ifdef __cplusplus
+# }
+# #endif
+#
+# #ifdef __CYGWIN__
+# #include <cygwin/cygwin_dll.h>
+# DECLARE_CYGWIN_DLL( DllMain );
+# #endif
+# HINSTANCE __hDllInstance_base;
+#
+# BOOL APIENTRY
+# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
+# {
+#   __hDllInstance_base = hInst;
+#   return TRUE;
+# }
+# /* ltdll.c ends here */
+])# _LT_AC_FILE_LTDLL_C
+
+
+# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
+# ---------------------------------
+AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
+
+
+# old names
+AC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
+AC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
+AC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
+AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+AC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
+AC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
+
+# This is just to silence aclocal about the macro not being used
+ifelse([AC_DISABLE_FAST_INSTALL])
+
+AC_DEFUN([LT_AC_PROG_GCJ],
+[AC_CHECK_TOOL(GCJ, gcj, no)
+  test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+  AC_SUBST(GCJFLAGS)
+])
+
+AC_DEFUN([LT_AC_PROG_RC],
+[AC_CHECK_TOOL(RC, windres, no)
+])
+
+############################################################
+# NOTE: This macro has been submitted for inclusion into   #
+#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
+#  a released version of Autoconf we should remove this    #
+#  macro and use it instead.                               #
+############################################################
+# LT_AC_PROG_SED
+# --------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible.  Prefer GNU sed if found.
+AC_DEFUN([LT_AC_PROG_SED],
+[AC_MSG_CHECKING([for a sed that does not truncate output])
+AC_CACHE_VAL(lt_cv_path_SED,
+[# Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for lt_ac_prog in sed gsed; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
       fi
-      ;;
+    done
+  done
+done
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+  test ! -f $lt_ac_sed && continue
+  cat /dev/null > conftest.in
+  lt_ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+  # Check for GNU sed and select it if it is found.
+  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+    lt_cv_path_SED=$lt_ac_sed
+    break
+  fi
+  while true; do
+    cat conftest.in conftest.in >conftest.tmp
+    mv conftest.tmp conftest.in
+    cp conftest.in conftest.nl
+    echo >>conftest.nl
+    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+    cmp -s conftest.out conftest.nl || break
+    # 10000 chars as input seems more than enough
+    test $lt_ac_count -gt 10 && break
+    lt_ac_count=`expr $lt_ac_count + 1`
+    if test $lt_ac_count -gt $lt_ac_max; then
+      lt_ac_max=$lt_ac_count
+      lt_cv_path_SED=$lt_ac_sed
+    fi
+  done
+done
+])
+SED=$lt_cv_path_SED
+AC_MSG_RESULT([$SED])
+])
+m4_include([config/gnulib/absolute-header.m4])
+m4_include([config/gnulib/alloca.m4])
+m4_include([config/gnulib/arpa_inet_h.m4])
+m4_include([config/gnulib/eoverflow.m4])
+m4_include([config/gnulib/extensions.m4])
+m4_include([config/gnulib/getaddrinfo.m4])
+m4_include([config/gnulib/gnulib-cache.m4])
+m4_include([config/gnulib/gnulib-common.m4])
+m4_include([config/gnulib/gnulib-comp.m4])
+m4_include([config/gnulib/gnulib-tool.m4])
+m4_include([config/gnulib/inet_ntop.m4])
+m4_include([config/gnulib/intmax_t.m4])
+m4_include([config/gnulib/inttypes_h.m4])
+m4_include([config/gnulib/lib-ld.m4])
+m4_include([config/gnulib/lib-link.m4])
+m4_include([config/gnulib/lib-prefix.m4])
+m4_include([config/gnulib/lock.m4])
+m4_include([config/gnulib/longdouble.m4])
+m4_include([config/gnulib/longlong.m4])
+m4_include([config/gnulib/netinet_in_h.m4])
+m4_include([config/gnulib/onceonly_2_57.m4])
+m4_include([config/gnulib/size_max.m4])
+m4_include([config/gnulib/snprintf.m4])
+m4_include([config/gnulib/socklen.m4])
+m4_include([config/gnulib/sockpfaf.m4])
+m4_include([config/gnulib/stdbool.m4])
+m4_include([config/gnulib/stdint_h.m4])
+m4_include([config/gnulib/strdup.m4])
+m4_include([config/gnulib/string_h.m4])
+m4_include([config/gnulib/sys_socket_h.m4])
+m4_include([config/gnulib/vasnprintf.m4])
+m4_include([config/gnulib/visibility.m4])
+m4_include([config/gnulib/wchar_t.m4])
+m4_include([config/gnulib/wint_t.m4])
+m4_include([config/gnulib/xsize.m4])
+dnl Check if the compiler can handle unsigned long constants, ie 2ul.
+AC_DEFUN([AMANDA_C_UNSIGNED_LONG_CONSTANTS],
+    [
+       AC_CACHE_CHECK(
+           [for working unsigned long constants],
+           amanda_cv_c_unsigned_long_constants,
+           [
+               AC_TRY_COMPILE(
+                   [
+                   ],
+                   [
+                       long l = 1ul;
+                   ],
+                   amanda_cv_c_unsigned_long_constants=yes,
+                   amanda_cv_c_unsigned_long_constants=no
+               )
+           ]
+       )
+       if test "$amanda_cv_c_unsigned_long_constants" = yes; then
+           AC_DEFINE(HAVE_UNSIGNED_LONG_CONSTANTS,1,[Define if the compiler support unsigned long constants. ])
+       fi
+    ]
+)
 
-    amigaos*)
-      # FIXME: we need at least 68020 code to build shared libraries, but
-      # adding the `-m68020' flag to GCC prevents building anything better,
-      # like `-m68040'.
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
-      ;;
+dnl Check for the argument type for shmat() and shmdt()
+AC_DEFUN([AMANDA_FUNC_SHM_ARG_TYPE],
+    [
+       AC_CACHE_CHECK(
+           [for shmdt() argument type],
+           amanda_cv_shmdt_arg_type,
+           [
+               if test "$ac_cv_func_shmget" = yes; then
+                   cat <<EOF >conftest.$ac_ext
+#include "confdefs.h"
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_IPC_H
+# include <sys/ipc.h>
+#endif
+#ifdef HAVE_SYS_SHM_H
+# include <sys/shm.h>
+#endif
 
-    beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
-      # PIC is the default for these OSes.
-      ;;
+#ifdef __cplusplus
+extern "C" void *shmat(int, void *, int);
+#else
+void *shmat();
+#endif
 
-    mingw* | pw32* | os2*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
-      ;;
+int main()
+{
+    int i;
+    return 0;
+}
+EOF
+                   ${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext >/dev/null 2>/dev/null
+                   if test $? = 0; then
+                       amanda_cv_shmdt_arg_type=void
+                   else
+                       amanda_cv_shmdt_arg_type=char
+                   fi
+                   rm -f conftest*
+               else
+                   amanda_cv_shmdt_arg_type=nothing
+               fi
+           ]
+       )
+       AC_DEFINE_UNQUOTED(SHM_ARG_TYPE,$amanda_cv_shmdt_arg_type,[Define to type of shmget() function argument. ])
+    ]
+)
 
-    darwin* | rhapsody*)
-      # PIC is the default on this platform
-      # Common symbols not allowed in MH_DYLIB files
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
-      ;;
+dnl Figure out the select() argument type.
+AC_DEFUN([AMANDA_FUNC_SELECT_ARG_TYPE],
+    [
+       AC_CACHE_CHECK(
+           [for select() argument type],
+           amanda_cv_select_arg_type,
+           [
+               rm -f conftest.c
+               cat <<EOF >conftest.$ac_ext
+#include "confdefs.h"
+#ifdef HAVE_SYS_TIME_H
+# include <sys/time.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SELECT_H
+#  include <sys/select.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#  include <sys/socket.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
 
-    msdosdjgpp*)
-      # Just because we use GCC doesn't mean we suddenly get shared libraries
-      # on systems that don't support them.
-      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
-      enable_shared=no
-      ;;
+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
 
-    sysv4*MP*)
-      if test -d /usr/nec; then
-       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
-      fi
-      ;;
+               dnl Figure out the select argument type by first trying to
+               dnl compile with the fd_set argument.  If the compile fails,
+               dnl then we know to use the int.  If it suceeds, then try to
+               dnl use the int.  If the int fails, then use fd_set.  If
+               dnl both suceeed, then do a line count on the number of
+               dnl lines that the compiler spit out, assuming that the
+               dnl compile outputing more lines had more errors.
+               amanda_cv_select_arg_type=no
+               select_compile="${CC-cc} -c $CFLAGS $CPPFLAGS"
+               $select_compile -DFD_SET_POINTER conftest.$ac_ext 1>conftest.fd_set 2>&1
+               if test $? -ne 0; then
+                   amanda_cv_select_arg_type=int
+               fi
+               if test "$amanda_cv_select_arg_type" = no; then
+                   $select_compile conftest.$ac_ext 1>conftest.int 2>&1
+                   if test $? -ne 0; then
+                       amanda_cv_select_arg_type=fd_set
+                   fi
+               fi
+               if test "$amanda_cv_select_arg_type" = no; then
+                   wc_fdset=`wc -l <conftest.fd_set`
+                   wc_int=`wc -l <conftest.int`
+                   if test "$wc_fdset" -le "$wc_int"; then
+                       amanda_cv_select_arg_type=fd_set
+                   else
+                       amanda_cv_select_arg_type=int
+                   fi
+               fi
+               rm -f conftest*
+           ]
+       )
+       AC_DEFINE_UNQUOTED(SELECT_ARG_TYPE,$amanda_cv_select_arg_type,[Define to type of select arguments. ])
+    ]
+)
 
-    hpux*)
-      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
-      # not for PA HP-UX.
-      case $host_cpu in
-      hppa*64*|ia64*)
-       # +Z the default
-       ;;
-      *)
-       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-       ;;
-      esac
-      ;;
+dnl Check if setsockopt can use the SO_SNDTIMEO option.
+dnl This defines HAVE_SO_SNDTIMEO if setsockopt works
+dnl with SO_SNDTIMEO.
+AC_DEFUN([AMANDA_FUNC_SETSOCKOPT_SO_SNDTIMEO],
+    [
+       AC_CACHE_CHECK(
+           [for setsockopt SO_SNDTIMEO option],
+           amanda_cv_setsockopt_SO_SNDTIMEO,
+           [
+               AC_TRY_RUN(
+                   [
+#include <sys/types.h>
+#include <sys/socket.h>
+#ifdef TIME_WITH_SYS_TIME
+#  include <sys/time.h>
+#  include <time.h>
+#else
+#  ifdef HAVE_SYS_TIME_H
+#    include <sys/time.h>
+#  else
+#    include <time.h>
+#  endif
+#endif
 
-    *)
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
-      ;;
-    esac
-  else
-    # PORTME Check for flag to pass linker flags through the system compiler.
-    case $host_os in
-    aix*)
-      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      if test "$host_cpu" = ia64; then
-       # AIX 5 now supports IA64 processor
-       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      else
-       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
-      fi
-      ;;
-      darwin*)
-        # PIC is the default on this platform
-        # Common symbols not allowed in MH_DYLIB files
-       case $cc_basename in
-         xlc*)
-         _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
-         _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-         ;;
-       esac
-       ;;
+main() {
+#ifdef SO_SNDTIMEO
+    int sock = socket(AF_INET, SOCK_STREAM, 0);
+    struct timeval timeout;
+    timeout.tv_sec = 1;
+    timeout.tv_usec = 0;
+    return (setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO,
+             (void *)&timeout, sizeof(timeout)));
+#else
+    return -1;
+#endif
+}
+                   ],
+                   amanda_cv_setsockopt_SO_SNDTIMEO=yes,
+                   amanda_cv_setsockopt_SO_SNDTIMEO=no,
+                   amanda_cv_setsockopt_SO_SNDTIMEO=no
+               )
+           ]
+       )
+       if test "$amanda_cv_setsockopt_SO_SNDTIMEO" = yes; then
+           AC_DEFINE(HAVE_SO_SNDTIMEO,1,[Define if SO_SNDTIMEO is available. ])
+       fi
+    ]
+)
 
-    mingw* | pw32* | os2*)
-      # This hack is so that the source file can tell whether it is being
-      # built for inclusion in a dll (and should export symbols for example).
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
-      ;;
+dnl Check for the one or two argument version of gettimeofday.
+AC_DEFUN([AMANDA_FUNC_GETTIMEOFDAY_ARGS],
+    [
+       AC_REQUIRE([AC_HEADER_TIME])
+       AC_CACHE_CHECK(
+           [for gettimeofday number of arguments],
+           amanda_cv_gettimeofday_args,
+           [
+               AC_TRY_COMPILE(
+                   [
+#ifdef TIME_WITH_SYS_TIME
+#  include <sys/time.h>
+#  include <time.h>
+#else
+#  ifdef HAVE_SYS_TIME_H
+#    include <sys/time.h>
+#  else
+#    include <time.h>
+#  endif
+#endif
+                   ],
+                   [
+                       struct timeval val;
+                       struct timezone zone;
+                       gettimeofday(&val, &zone);
+                   ],
+                   amanda_cv_gettimeofday_args=2,
+                   amanda_cv_gettimeofday_args=1
+               )
+           ]
+       )
+       if test "$amanda_cv_gettimeofday_args" = 2; then
+           AC_DEFINE(HAVE_TWO_ARG_GETTIMEOFDAY,1,[Define if gettimeofday takes two arguments. ])
+       fi
+    ]
+)
 
-    hpux9* | hpux10* | hpux11*)
-      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
-      # not for PA HP-UX.
-      case $host_cpu in
-      hppa*64*|ia64*)
-       # +Z the default
-       ;;
-      *)
-       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
-       ;;
-      esac
-      # Is there a better lt_prog_compiler_static that works with the bundled CC?
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
-      ;;
 
-    irix5* | irix6* | nonstopux*)
-      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      # PIC (with -KPIC) is the default.
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-      ;;
 
-    newsos6)
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
+dnl Check for if pid_t is a long, int, or short.
+AC_DEFUN([AMANDA_TYPE_PID_T],
+    [
+       AC_REQUIRE([AC_TYPE_PID_T])
+       AC_CACHE_CHECK([for pid_t type], amanda_cv_pid_type,
+           [
+               amanda_cv_pid_type=unknown
+               if test "$ac_cv_type_pid_t" = no; then
+                   amanda_cv_pid_type=int
+               fi
+               for TEST_amanda_cv_pid_type in long short int; do
+                   if test $amanda_cv_pid_type = unknown; then
+                       AC_EGREP_CPP(typedef.*${TEST_amanda_cv_pid_type}.*pid_t,
+                           [
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+                           ],
+                       amanda_cv_pid_type=$TEST_amanda_cv_pid_type)
+                   fi
+                   if test $amanda_cv_pid_type = unknown; then
+                       AC_EGREP_CPP(ZZZZ.*${TEST_amanda_cv_pid_type},
+                           [
+#include <sys/types.h>
+#if STDC_HEADERS
+#include <stdlib.h>
+#include <stddef.h>
+#endif
+                               ZZZZ pid_t
+                       ],
+                       amanda_cv_pid_type=$TEST_amanda_cv_pid_type)
+                   fi
+               done
+               if test $amanda_cv_pid_type = unknown; then
+                   amanda_cv_pid_type=int
+               fi
+           ]
+       )
+       case $amanda_cv_pid_type in
+           int)        AC_DEFINE_UNQUOTED(PRINTF_PID_T,"%d",[Define to printf formatting string to print a PID. ]) ;;
+           long)       AC_DEFINE_UNQUOTED(PRINTF_PID_T,"%ld") ;;
+           short)      AC_DEFINE_UNQUOTED(PRINTF_PID_T,"%d") ;;
+       esac
+    ]
+)
 
-    linux*)
-      case $cc_basename in
-      icc* | ecc*)
-       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
-        ;;
-      pgcc* | pgf77* | pgf90* | pgf95*)
-        # Portland Group compilers (*not* the Pentium gcc compiler,
-       # which looks to be a dead project)
-       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
-       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-        ;;
-      ccc*)
-        _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-        # All Alpha code is PIC.
-        _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-        ;;
-      esac
-      ;;
+dnl
+dnl
+dnl ICE_CHECK_DECL (FUNCTION, HEADER-FILE...)
+dnl If FUNCTION is available, define `HAVE_FUNCTION'.  If it is declared
+dnl in one of the headers named in the whitespace-separated list 
+dnl HEADER_FILE, define `HAVE_FUNCTION_DECL` (in all capitals).
+dnl
+AC_DEFUN([ICE_CHECK_DECL],
+[
+ice_have_$1=no
+AC_CHECK_FUNCS($1, ice_have_$1=yes)
+if test "${ice_have_$1}" = yes; then
+AC_MSG_CHECKING(for $1 declaration in $2)
+AC_CACHE_VAL(ice_cv_have_$1_decl,
+[
+ice_cv_have_$1_decl=no
+changequote(,)dnl
+ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
+ice_re_word='(^|[^a-zA-Z0-9_])'
+changequote([,])dnl
+for header in $2; do
+# Check for ordinary declaration
+AC_EGREP_HEADER([${ice_re_word}$1[     ]*\(], $header, 
+       ice_cv_have_$1_decl=yes)
+if test "$ice_cv_have_$1_decl" = yes; then
+       break
+fi
+# Check for "fixed" declaration like "getpid _PARAMS((int))"
+AC_EGREP_HEADER([${ice_re_word}$1[     ]*$ice_re_params\(\(], $header, 
+       ice_cv_have_$1_decl=yes)
+if test "$ice_cv_have_$1_decl" = yes; then
+       break
+fi
+done
+])
+AC_MSG_RESULT($ice_cv_have_$1_decl)
+if test "$ice_cv_have_$1_decl" = yes; then
+AC_DEFINE_UNQUOTED([HAVE_]translit($1,[a-z],[A-Z])[_DECL],1,[Define if $1 is declared. ])
+fi
+fi
+])dnl
+dnl Test for the presence of <sys/wait.h>, 'union wait', arg-type of 'wait()'.
+dnl by T.E.Dickey" , Jim Spath <jspath@mail.bcpl.lib.md.us>
+dnl
+dnl     FIXME: These tests should have been in autoconf 1.11!
+dnl
+dnl     Note that we cannot simply grep for 'union wait' in the wait.h file,
+dnl     because some Posix systems turn this on only when a BSD variable is
+dnl     defined. Since I'm trying to do without special defines, I'll live
+dnl     with the default behavior of the include-file.
+dnl
+dnl     I do _2_ compile checks, because we may have union-wait, but the
+dnl     prototype for 'wait()' may want an int.
+dnl
+dnl     Don't use HAVE_UNION_WAIT, because the autoconf documentation implies
+dnl     that if we've got union-wait, we'll automatically use it.
+dnl
+dnl Garrett Wollman adds:
+dnl    The tests described above don't quite do the right thing,
+dnl    since some systems have hacks which allow `union wait' to
+dnl    still work even though `int' is preferred (and generates
+dnl    fewer warnings).  Since all of these systems use prototypes,
+dnl    we can use the prototype of wait(2) to disambiguate them.
+dnl
+dnl Alexandre Oliva adds:
+dnl     A single compile check is enough.  If we don't have union wait,
+dnl     it's obvious that the test will fail, and that we must use int.
+dnl     If we do, the prototype (on STDC systems) and WIFEXITED will tell
+dnl     whether we're supposed to be using union wait instead of int.
+dnl
+AC_DEFUN([CF_WAIT],
+[
+AC_REQUIRE([AC_TYPE_PID_T])
+AC_HAVE_HEADERS(sys/wait.h wait.h)
+AC_CACHE_CHECK([whether wait uses union wait], [cf_cv_arg_union_wait],
+        [AC_TRY_COMPILE([
+#include <sys/types.h>
 
-    osf3* | osf4* | osf5*)
-      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      # All OSF/1 code is PIC.
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
-      ;;
+#if HAVE_SYS_WAIT_H
+# include <sys/wait.h>
+#else
+# if HAVE_WAIT_H
+#  include <wait.h>
+# endif
+#endif
 
-    sco3.2v5*)
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic'
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn'
-      ;;
+#ifdef __STDC__
+pid_t wait(union wait *);
+#endif
+], [
+  union wait x; int i;
+  wait(&x); i = WIFEXITED(x)
+], [cf_cv_arg_union_wait=yes], [cf_cv_arg_union_wait=no])])
+if test $cf_cv_arg_union_wait = yes; then
+       AC_DEFINE(WAIT_USES_UNION,1,[Defined if wait() puts the status in a union wait instead of int. ])
+fi
+])dnl
+AC_DEFUN([CF_WAIT_INT],
+[
+AC_REQUIRE([AC_TYPE_PID_T])
+AC_HAVE_HEADERS(sys/wait.h wait.h)
+AC_CACHE_CHECK([whether wait uses int], [cf_cv_arg_int],
+        [AC_TRY_COMPILE([
+#include <sys/types.h>
 
-    solaris*)
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      case $cc_basename in
-      f77* | f90* | f95*)
-       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
-      *)
-       _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
-      esac
-      ;;
+#if HAVE_SYS_WAIT_H
+# include <sys/wait.h>
+#else
+# if HAVE_WAIT_H
+#  include <wait.h>
+# endif
+#endif
 
-    sunos4*)
-      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
+#ifdef __STDC__
+pid_t wait(int *);
+#endif
+], [
+  int x; int i;
+  wait(&x); i = WIFEXITED(x)
+], [cf_cv_arg_int=yes], [cf_cv_arg_int=no])])
+if test $cf_cv_arg_int = yes; then
+        AC_DEFINE(WAIT_USES_INT,1,[Defined if wait() puts the status in a int instead of a union wait. ])
+fi
+])dnl
 
-    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
-      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
+dnl @synopsis AX_CREATE_STDINT_H [( HEADER-TO-GENERATE [, HEDERS-TO-CHECK])]
+dnl
+dnl the "ISO C9X: 7.18 Integer types <stdint.h>" section requires the
+dnl existence of an include file <stdint.h> that defines a set of 
+dnl typedefs, especially uint8_t,int32_t,uintptr_t.
+dnl Many older installations will not provide this file, but some will
+dnl have the very same definitions in <inttypes.h>. In other enviroments
+dnl we can use the inet-types in <sys/types.h> which would define the
+dnl typedefs int8_t and u_int8_t respectivly.
+dnl
+dnl This macros will create a local "_stdint.h" or the headerfile given as 
+dnl an argument. In many cases that file will just "#include <stdint.h>" 
+dnl or "#include <inttypes.h>", while in other environments it will provide 
+dnl the set of basic 'stdint's definitions/typedefs: 
+dnl   int8_t,uint8_t,int16_t,uint16_t,int32_t,uint32_t,intptr_t,uintptr_t
+dnl   int_least32_t.. int_fast32_t.. intmax_t
+dnl which may or may not rely on the definitions of other files,
+dnl or using the AC_CHECK_SIZEOF macro to determine the actual
+dnl sizeof each type.
+dnl
+dnl if your header files require the stdint-types you will want to create an
+dnl installable file mylib-int.h that all your other installable header
+dnl may include. So if you have a library package named "mylib", just use
+dnl      AX_CREATE_STDINT_H(mylib-int.h) 
+dnl in configure.ac and go to install that very header file in Makefile.am
+dnl along with the other headers (mylib.h) - and the mylib-specific headers
+dnl can simply use "#include <mylib-int.h>" to obtain the stdint-types.
+dnl
+dnl Remember, if the system already had a valid <stdint.h>, the generated
+dnl file will include it directly. No need for fuzzy HAVE_STDINT_H things...
+dnl
+dnl @, (status: used on new platforms) (see http://ac-archive.sf.net/gstdint/)
+dnl @version Id: ax_create_stdint_h.m4,v 1.5 2005/01/06 18:27:27 guidod Exp
+dnl @author  Guido Draheim <guidod@gmx.de> 
 
-    sysv4*MP*)
-      if test -d /usr/nec ;then
-       _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
-       _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      fi
-      ;;
+AC_DEFUN([AX_CHECK_DATA_MODEL],[
+   AC_CHECK_SIZEOF(char)
+   AC_CHECK_SIZEOF(short)
+   AC_CHECK_SIZEOF(int)
+   AC_CHECK_SIZEOF(long)
+   AC_CHECK_SIZEOF(void*)
+   ac_cv_char_data_model=""
+   ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_char"
+   ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_short"
+   ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_int"
+   ac_cv_long_data_model=""
+   ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_int"
+   ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_long"
+   ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_voidp"
+   AC_MSG_CHECKING([data model])
+   case "$ac_cv_char_data_model/$ac_cv_long_data_model" in
+    122/242)     ac_cv_data_model="IP16"  ; n="standard 16bit machine" ;;
+    122/244)     ac_cv_data_model="LP32"  ; n="standard 32bit machine" ;;
+    122/*)       ac_cv_data_model="i16"   ; n="unusual int16 model" ;;
+    124/444)     ac_cv_data_model="ILP32" ; n="standard 32bit unixish" ;;
+    124/488)     ac_cv_data_model="LP64"  ; n="standard 64bit unixish" ;;
+    124/448)     ac_cv_data_model="LLP64" ; n="unusual 64bit unixish" ;;
+    124/*)       ac_cv_data_model="i32"   ; n="unusual int32 model" ;;
+    128/888)     ac_cv_data_model="ILP64" ; n="unusual 64bit numeric" ;;
+    128/*)       ac_cv_data_model="i64"   ; n="unusual int64 model" ;;         
+    222/*2)      ac_cv_data_model="DSP16" ; n="strict 16bit dsptype" ;;
+    333/*3)      ac_cv_data_model="DSP24" ; n="strict 24bit dsptype" ;;
+    444/*4)      ac_cv_data_model="DSP32" ; n="strict 32bit dsptype" ;;
+    666/*6)      ac_cv_data_model="DSP48" ; n="strict 48bit dsptype" ;;
+    888/*8)      ac_cv_data_model="DSP64" ; n="strict 64bit dsptype" ;;
+    222/*|333/*|444/*|666/*|888/*) :
+                 ac_cv_data_model="iDSP"  ; n="unusual dsptype" ;;
+     *)          ac_cv_data_model="none"  ; n="very unusual model" ;;
+   esac
+   AC_MSG_RESULT([$ac_cv_data_model ($ac_cv_long_data_model, $n)])
+])
 
-    unicos*)
-      _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
-      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
-      ;;
+dnl AX_CHECK_HEADER_STDINT_X([HEADERLIST][,ACTION-IF])
+AC_DEFUN([AX_CHECK_HEADER_STDINT_X],[
+AC_CACHE_CHECK([for stdint uintptr_t], [ac_cv_header_stdint_x],[
+ ac_cv_header_stdint_x="" # the 1997 typedefs (inttypes.h)
+  AC_MSG_RESULT([(..)])
+  for i in m4_ifval([$1],[$1],[stdint.h inttypes.h sys/inttypes.h]) ; do
+   unset ac_cv_type_uintptr_t 
+   unset ac_cv_type_uint64_t
+   AC_CHECK_TYPE(uintptr_t,[ac_cv_header_stdint_x=$i],continue,[#include <$i>])
+   AC_CHECK_TYPE(uint64_t,[and64="/uint64_t"],[and64=""],[#include<$i>])
+   m4_ifvaln([$1],[$1]) break
+  done
+  AC_MSG_CHECKING([for stdint uintptr_t])
+ ])
+])
 
-    uts4*)
-      _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
-      _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
-      ;;
+AC_DEFUN([AX_CHECK_HEADER_STDINT_O],[
+AC_CACHE_CHECK([for stdint uint32_t], [ac_cv_header_stdint_o],[
+ ac_cv_header_stdint_o="" # the 1995 typedefs (sys/inttypes.h)
+  AC_MSG_RESULT([(..)])
+  for i in m4_ifval([$1],[$1],[inttypes.h sys/inttypes.h stdint.h]) ; do
+   unset ac_cv_type_uint32_t
+   unset ac_cv_type_uint64_t
+   AC_CHECK_TYPE(uint32_t,[ac_cv_header_stdint_o=$i],continue,[#include <$i>])
+   AC_CHECK_TYPE(uint64_t,[and64="/uint64_t"],[and64=""],[#include<$i>])
+   m4_ifvaln([$1],[$1]) break
+   break;
+  done
+  AC_MSG_CHECKING([for stdint uint32_t])
+ ])
+])
 
-    *)
-      _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
-      ;;
-    esac
-  fi
+AC_DEFUN([AX_CHECK_HEADER_STDINT_U],[
+AC_CACHE_CHECK([for stdint u_int32_t], [ac_cv_header_stdint_u],[
+ ac_cv_header_stdint_u="" # the BSD typedefs (sys/types.h)
+  AC_MSG_RESULT([(..)])
+  for i in m4_ifval([$1],[$1],[sys/types.h inttypes.h sys/inttypes.h]) ; do
+   unset ac_cv_type_u_int32_t
+   unset ac_cv_type_u_int64_t
+   AC_CHECK_TYPE(u_int32_t,[ac_cv_header_stdint_u=$i],continue,[#include <$i>])
+   AC_CHECK_TYPE(u_int64_t,[and64="/u_int64_t"],[and64=""],[#include<$i>])
+   m4_ifvaln([$1],[$1]) break
+   break;
+  done
+  AC_MSG_CHECKING([for stdint u_int32_t])
+ ])
 ])
-AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
 
-#
-# Check to make sure the PIC flag actually works.
-#
-if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
-  AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
-    _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
-    [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
-    [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
-     "" | " "*) ;;
-     *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
-     esac],
-    [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
-     _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+AC_DEFUN([AX_CREATE_STDINT_H],
+[# ------ AX CREATE STDINT H -------------------------------------
+AC_MSG_CHECKING([for stdint types])
+ac_stdint_h=`echo ifelse($1, , _stdint.h, $1)`
+# try to shortcircuit - if the default include path of the compiler
+# can find a "stdint.h" header then we assume that all compilers can.
+AC_CACHE_VAL([ac_cv_header_stdint_t],[
+old_CXXFLAGS="$CXXFLAGS" ; CXXFLAGS=""
+old_CPPFLAGS="$CPPFLAGS" ; CPPFLAGS=""
+old_CFLAGS="$CFLAGS"     ; CFLAGS=""
+AC_TRY_COMPILE([#include <stdint.h>],[int_least32_t v = 0;],
+[ac_cv_stdint_result="(assuming C99 compatible system)"
+ ac_cv_header_stdint_t="stdint.h"; ],
+[ac_cv_header_stdint_t=""])
+CXXFLAGS="$old_CXXFLAGS"
+CPPFLAGS="$old_CPPFLAGS"
+CFLAGS="$old_CFLAGS" ])
+
+v="... $ac_cv_header_stdint_h"
+if test "$ac_stdint_h" = "stdint.h" ; then
+ AC_MSG_RESULT([(are you sure you want them in ./stdint.h?)])
+elif test "$ac_stdint_h" = "inttypes.h" ; then
+ AC_MSG_RESULT([(are you sure you want them in ./inttypes.h?)])
+elif test "_$ac_cv_header_stdint_t" = "_" ; then
+ AC_MSG_RESULT([(putting them into $ac_stdint_h)$v])
+else
+ ac_cv_header_stdint="$ac_cv_header_stdint_t"
+ AC_MSG_RESULT([$ac_cv_header_stdint (shortcircuit)])
 fi
-case $host_os in
-  # For platforms which do not support PIC, -DPIC is meaningless:
-  *djgpp*)
-    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
-    ;;
-  *)
-    _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
-    ;;
-esac
-])
 
+if test "_$ac_cv_header_stdint_t" = "_" ; then # can not shortcircuit..
 
-# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
-# ------------------------------------
-# See if the linker supports building shared libraries.
-AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
-[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
-ifelse([$1],[CXX],[
-  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  case $host_os in
-  aix4* | aix5*)
-    # If we're using GNU nm, then we don't want the "-C" option.
-    # -C means demangle to AIX nm, but means don't demangle with GNU nm
-    if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
-      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
-    else
-      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
-    fi
-    ;;
-  pw32*)
-    _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
-  ;;
-  cygwin* | mingw*)
-    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
-  ;;
-  *)
-    _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  ;;
-  esac
-],[
-  runpath_var=
-  _LT_AC_TAGVAR(allow_undefined_flag, $1)=
-  _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
-  _LT_AC_TAGVAR(archive_cmds, $1)=
-  _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
-  _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
-  _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
-  _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
-  _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
-  _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
-  _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
-  _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
-  _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
-  _LT_AC_TAGVAR(hardcode_direct, $1)=no
-  _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
-  _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-  _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
-  _LT_AC_TAGVAR(hardcode_automatic, $1)=no
-  _LT_AC_TAGVAR(module_cmds, $1)=
-  _LT_AC_TAGVAR(module_expsym_cmds, $1)=
-  _LT_AC_TAGVAR(always_export_symbols, $1)=no
-  _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
-  # include_expsyms should be a list of space-separated symbols to be *always*
-  # included in the symbol list
-  _LT_AC_TAGVAR(include_expsyms, $1)=
-  # exclude_expsyms can be an extended regexp of symbols to exclude
-  # it will be wrapped by ` (' and `)$', so one must not match beginning or
-  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
-  # as well as any symbol that contains `d'.
-  _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
-  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
-  # platforms (ab)use it in PIC code, but their linkers get confused if
-  # the symbol is explicitly referenced.  Since portable code cannot
-  # rely on this symbol name, it's probably fine to never include it in
-  # preloaded symbol tables.
-  extract_expsyms_cmds=
-  # Just being paranoid about ensuring that cc_basename is set.
-  _LT_CC_BASENAME([$compiler])
-  case $host_os in
-  cygwin* | mingw* | pw32*)
-    # FIXME: the MSVC++ port hasn't been tested in a loooong time
-    # When not using gcc, we currently assume that we are using
-    # Microsoft Visual C++.
-    if test "$GCC" != yes; then
-      with_gnu_ld=no
-    fi
-    ;;
-  openbsd*)
-    with_gnu_ld=no
-    ;;
-  esac
+dnl .....intro message done, now do a few system checks.....
+dnl btw, all old CHECK_TYPE macros do automatically "DEFINE" a type, 
+dnl therefore we use the autoconf implementation detail CHECK_TYPE_NEW 
+dnl instead that is triggered with 3 or more arguments (see types.m4)
 
-  _LT_AC_TAGVAR(ld_shlibs, $1)=yes
-  if test "$with_gnu_ld" = yes; then
-    # If archive_cmds runs LD, not CC, wlarc should be empty
-    wlarc='${wl}'
+inttype_headers=`echo $2 | sed -e 's/,/ /g'`
 
-    # Set some defaults for GNU ld with shared library support. These
-    # are reset later if shared libraries are not supported. Putting them
-    # here allows them to be overridden if necessary.
-    runpath_var=LD_RUN_PATH
-    _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
-    _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
-    # ancient GNU ld didn't support --whole-archive et. al.
-    if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
-       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
-      else
-       _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
-    fi
-    supports_anon_versioning=no
-    case `$LD -v 2>/dev/null` in
-      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
-      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
-      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
-      *\ 2.11.*) ;; # other 2.11 versions
-      *) supports_anon_versioning=yes ;;
-    esac
+ac_cv_stdint_result="(no helpful system typedefs seen)"
+AX_CHECK_HEADER_STDINT_X(dnl
+   stdint.h inttypes.h sys/inttypes.h $inttype_headers,
+   ac_cv_stdint_result="(seen uintptr_t$and64 in $i)")
 
-    # See if GNU ld supports shared libraries.
-    case $host_os in
-    aix3* | aix4* | aix5*)
-      # On AIX/PPC, the GNU linker is very broken
-      if test "$host_cpu" != ia64; then
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       cat <<EOF 1>&2
+if test "_$ac_cv_header_stdint_x" = "_" ; then
+AX_CHECK_HEADER_STDINT_O(dnl,
+   inttypes.h sys/inttypes.h stdint.h $inttype_headers,
+   ac_cv_stdint_result="(seen uint32_t$and64 in $i)")
+fi
 
-*** Warning: the GNU linker, at least up to release 2.9.1, is reported
-*** to be unable to reliably create shared libraries on AIX.
-*** Therefore, libtool is disabling shared libraries support.  If you
-*** really care for shared libraries, you may want to modify your PATH
-*** so that a non-GNU linker is found, and then restart.
+if test "_$ac_cv_header_stdint_x" = "_" ; then
+if test "_$ac_cv_header_stdint_o" = "_" ; then
+AX_CHECK_HEADER_STDINT_U(dnl,
+   sys/types.h inttypes.h sys/inttypes.h $inttype_headers,
+   ac_cv_stdint_result="(seen u_int32_t$and64 in $i)")
+fi fi
 
-EOF
-      fi
-      ;;
+dnl if there was no good C99 header file, do some typedef checks...
+if test "_$ac_cv_header_stdint_x" = "_" ; then
+   AC_MSG_CHECKING([for stdint datatype model])
+   AC_MSG_RESULT([(..)])
+   AX_CHECK_DATA_MODEL
+fi
 
-    amigaos*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+if test "_$ac_cv_header_stdint_x" != "_" ; then
+   ac_cv_header_stdint="$ac_cv_header_stdint_x"
+elif  test "_$ac_cv_header_stdint_o" != "_" ; then
+   ac_cv_header_stdint="$ac_cv_header_stdint_o"
+elif  test "_$ac_cv_header_stdint_u" != "_" ; then
+   ac_cv_header_stdint="$ac_cv_header_stdint_u"
+else
+   ac_cv_header_stdint="stddef.h"
+fi
 
-      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
-      # that the semantics of dynamic libraries on AmigaOS, at least up
-      # to version 4, is to share data among multiple programs linked
-      # with the same dynamic library.  Since this doesn't match the
-      # behavior of shared libraries on other platforms, we can't use
-      # them.
-      _LT_AC_TAGVAR(ld_shlibs, $1)=no
-      ;;
+AC_MSG_CHECKING([for extra inttypes in chosen header])
+AC_MSG_RESULT([($ac_cv_header_stdint)])
+dnl see if int_least and int_fast types are present in _this_ header.
+unset ac_cv_type_int_least32_t
+unset ac_cv_type_int_fast32_t
+AC_CHECK_TYPE(int_least32_t,,,[#include <$ac_cv_header_stdint>])
+AC_CHECK_TYPE(int_fast32_t,,,[#include<$ac_cv_header_stdint>])
+AC_CHECK_TYPE(intmax_t,,,[#include <$ac_cv_header_stdint>])
 
-    beos*)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-       _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
-       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
-       # support --undefined.  This deserves some investigation.  FIXME
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-      else
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
+fi # shortcircut to system "stdint.h"
+# ------------------ PREPARE VARIABLES ------------------------------
+if test "$GCC" = "yes" ; then
+ac_cv_stdint_message="using gnu compiler "`$CC --version | head -1` 
+else
+ac_cv_stdint_message="using $CC"
+fi
 
-    cygwin* | mingw* | pw32*)
-      # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
-      # as there is no search path for DLLs.
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
-      _LT_AC_TAGVAR(always_export_symbols, $1)=no
-      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-      _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
+AC_MSG_RESULT([make use of $ac_cv_header_stdint in $ac_stdint_h dnl
+$ac_cv_stdint_result])
 
-      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
-        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
-       # If the export-symbols file already is a .def file (1st line
-       # is EXPORTS), use it as is; otherwise, prepend...
-       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
-         cp $export_symbols $output_objdir/$soname.def;
-       else
-         echo EXPORTS > $output_objdir/$soname.def;
-         cat $export_symbols >> $output_objdir/$soname.def;
-       fi~
-       $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000  ${wl}--out-implib,$lib'
-      else
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
+dnl -----------------------------------------------------------------
+# ----------------- DONE inttypes.h checks START header -------------
+AC_CONFIG_COMMANDS([$ac_stdint_h],[
+AC_MSG_NOTICE(creating $ac_stdint_h : $_ac_stdint_h)
+ac_stdint=$tmp/_stdint.h
 
-    linux*)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-       tmp_addflag=
-       case $cc_basename,$host_cpu in
-       pgcc*)                          # Portland Group C compiler
-         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-         tmp_addflag=' $pic_flag'
-         ;;
-       pgf77* | pgf90* | pgf95*)       # Portland Group f77 and f90 compilers
-         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive'
-         tmp_addflag=' $pic_flag -Mnomain' ;;
-       ecc*,ia64* | icc*,ia64*)                # Intel C compiler on ia64
-         tmp_addflag=' -i_dynamic' ;;
-       efc*,ia64* | ifort*,ia64*)      # Intel Fortran compiler on ia64
-         tmp_addflag=' -i_dynamic -nofor_main' ;;
-       ifc* | ifort*)                  # Intel Fortran compiler
-         tmp_addflag=' -nofor_main' ;;
-       esac
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+echo "#ifndef" $_ac_stdint_h >$ac_stdint
+echo "#define" $_ac_stdint_h "1" >>$ac_stdint
+echo "#ifndef" _GENERATED_STDINT_H >>$ac_stdint
+echo "#define" _GENERATED_STDINT_H '"'$PACKAGE $VERSION'"' >>$ac_stdint
+echo "/* generated $ac_cv_stdint_message */" >>$ac_stdint
+if test "_$ac_cv_header_stdint_t" != "_" ; then 
+echo "#define _STDINT_HAVE_STDINT_H" "1" >>$ac_stdint
+echo "#include <stdint.h>" >>$ac_stdint
+echo "#endif" >>$ac_stdint
+echo "#endif" >>$ac_stdint
+else
 
-       if test $supports_anon_versioning = yes; then
-         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~
-  cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
-  $echo "local: *; };" >> $output_objdir/$libname.ver~
-         $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
-       fi
-      else
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
+cat >>$ac_stdint <<STDINT_EOF
 
-    netbsd*)
-      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
-       wlarc=
-      else
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      fi
-      ;;
+/* ................... shortcircuit part ........................... */
 
-    solaris* | sysv5*)
-      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-       cat <<EOF 1>&2
+#if defined HAVE_STDINT_H || defined _STDINT_HAVE_STDINT_H
+#include <stdint.h>
+#else
+#include <stddef.h>
 
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems.  Therefore, libtool
-*** is disabling shared libraries support.  We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer.  Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
+/* .................... configured part ............................ */
 
-EOF
-      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      else
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
+STDINT_EOF
 
-    sunos4*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      wlarc=
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
+echo "/* whether we have a C99 compatible stdint header file */" >>$ac_stdint
+if test "_$ac_cv_header_stdint_x" != "_" ; then
+  ac_header="$ac_cv_header_stdint_x"
+  echo "#define _STDINT_HEADER_INTPTR" '"'"$ac_header"'"' >>$ac_stdint
+else
+  echo "/* #undef _STDINT_HEADER_INTPTR */" >>$ac_stdint
+fi
 
-    *)
-      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
-       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
-      else
-       _LT_AC_TAGVAR(ld_shlibs, $1)=no
-      fi
-      ;;
-    esac
+echo "/* whether we have a C96 compatible inttypes header file */" >>$ac_stdint
+if  test "_$ac_cv_header_stdint_o" != "_" ; then
+  ac_header="$ac_cv_header_stdint_o"
+  echo "#define _STDINT_HEADER_UINT32" '"'"$ac_header"'"' >>$ac_stdint
+else
+  echo "/* #undef _STDINT_HEADER_UINT32 */" >>$ac_stdint
+fi
 
-    if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then
-      runpath_var=
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
-      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
-      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
-    fi
-  else
-    # PORTME fill in a description of your system's linker (not GNU ld)
-    case $host_os in
-    aix3*)
-      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
-      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
-      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
-      # Note: this linker hardcodes the directories in LIBPATH if there
-      # are no directories specified by -L.
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-      if test "$GCC" = yes && test -z "$link_static_flag"; then
-       # Neither direct hardcoding nor static linking is supported with a
-       # broken collect2.
-       _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
-      fi
-      ;;
+echo "/* whether we have a BSD compatible inet types header */" >>$ac_stdint
+if  test "_$ac_cv_header_stdint_u" != "_" ; then
+  ac_header="$ac_cv_header_stdint_u"
+  echo "#define _STDINT_HEADER_U_INT32" '"'"$ac_header"'"' >>$ac_stdint
+else
+  echo "/* #undef _STDINT_HEADER_U_INT32 */" >>$ac_stdint
+fi
 
-    aix4* | aix5*)
-      if test "$host_cpu" = ia64; then
-       # On IA64, the linker does run time linking by default, so we don't
-       # have to do anything special.
-       aix_use_runtimelinking=no
-       exp_sym_flag='-Bexport'
-       no_entry_flag=""
-      else
-       # If we're using GNU nm, then we don't want the "-C" option.
-       # -C means demangle to AIX nm, but means don't demangle with GNU nm
-       if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
-         _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
-       else
-         _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
-       fi
-       aix_use_runtimelinking=no
+echo "" >>$ac_stdint
 
-       # Test if we are trying to use run time linking or normal
-       # AIX style linking. If -brtl is somewhere in LDFLAGS, we
-       # need to do runtime linking.
-       case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
-         for ld_flag in $LDFLAGS; do
-         if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
-           aix_use_runtimelinking=yes
-           break
-         fi
-         done
-       esac
+if test "_$ac_header" != "_" ; then if test "$ac_header" != "stddef.h" ; then
+  echo "#include <$ac_header>" >>$ac_stdint
+  echo "" >>$ac_stdint
+fi fi
 
-       exp_sym_flag='-bexport'
-       no_entry_flag='-bnoentry'
-      fi
+echo "/* which 64bit typedef has been found */" >>$ac_stdint
+if test "$ac_cv_type_uint64_t" = "yes" ; then
+echo "#define   _STDINT_HAVE_UINT64_T" "1"  >>$ac_stdint
+else
+echo "/* #undef _STDINT_HAVE_UINT64_T */" >>$ac_stdint
+fi
+if test "$ac_cv_type_u_int64_t" = "yes" ; then
+echo "#define   _STDINT_HAVE_U_INT64_T" "1"  >>$ac_stdint
+else
+echo "/* #undef _STDINT_HAVE_U_INT64_T */" >>$ac_stdint
+fi
+echo "" >>$ac_stdint
 
-      # When large executables or shared objects are built, AIX ld can
-      # have problems creating the table of contents.  If linking a library
-      # or program results in "error TOC overflow" add -mminimal-toc to
-      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
-      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+echo "/* which type model has been detected */" >>$ac_stdint
+if test "_$ac_cv_char_data_model" != "_" ; then
+echo "#define   _STDINT_CHAR_MODEL" "$ac_cv_char_data_model" >>$ac_stdint
+echo "#define   _STDINT_LONG_MODEL" "$ac_cv_long_data_model" >>$ac_stdint
+else
+echo "/* #undef _STDINT_CHAR_MODEL // skipped */" >>$ac_stdint
+echo "/* #undef _STDINT_LONG_MODEL // skipped */" >>$ac_stdint
+fi
+echo "" >>$ac_stdint
 
-      _LT_AC_TAGVAR(archive_cmds, $1)=''
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
-      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+echo "/* whether int_least types were detected */" >>$ac_stdint
+if test "$ac_cv_type_int_least32_t" = "yes"; then
+echo "#define   _STDINT_HAVE_INT_LEAST32_T" "1"  >>$ac_stdint
+else
+echo "/* #undef _STDINT_HAVE_INT_LEAST32_T */" >>$ac_stdint
+fi
+echo "/* whether int_fast types were detected */" >>$ac_stdint
+if test "$ac_cv_type_int_fast32_t" = "yes"; then
+echo "#define   _STDINT_HAVE_INT_FAST32_T" "1" >>$ac_stdint
+else
+echo "/* #undef _STDINT_HAVE_INT_FAST32_T */" >>$ac_stdint
+fi
+echo "/* whether intmax_t type was detected */" >>$ac_stdint
+if test "$ac_cv_type_intmax_t" = "yes"; then
+echo "#define   _STDINT_HAVE_INTMAX_T" "1" >>$ac_stdint
+else
+echo "/* #undef _STDINT_HAVE_INTMAX_T */" >>$ac_stdint
+fi
+echo "" >>$ac_stdint
 
-      if test "$GCC" = yes; then
-       case $host_os in aix4.[[012]]|aix4.[[012]].*)
-       # We only want to do this on AIX 4.2 and lower, the check
-       # below for broken collect2 doesn't work under 4.3+
-         collect2name=`${CC} -print-prog-name=collect2`
-         if test -f "$collect2name" && \
-          strings "$collect2name" | grep resolve_lib_name >/dev/null
-         then
-         # We have reworked collect2
-         _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-         else
-         # We have old collect2
-         _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
-         # It fails to find uninstalled libraries when the uninstalled
-         # path is not listed in the libpath.  Setting hardcode_minus_L
-         # to unsupported forces relinking
-         _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
-         fi
-       esac
-       shared_flag='-shared'
-       if test "$aix_use_runtimelinking" = yes; then
-         shared_flag="$shared_flag "'${wl}-G'
-       fi
-      else
-       # not using gcc
-       if test "$host_cpu" = ia64; then
-       # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
-       # chokes on -Wl,-G. The following line is correct:
-         shared_flag='-G'
-       else
-       if test "$aix_use_runtimelinking" = yes; then
-           shared_flag='${wl}-G'
-         else
-           shared_flag='${wl}-bM:SRE'
-       fi
-       fi
-      fi
+  cat >>$ac_stdint <<STDINT_EOF
+/* .................... detections part ............................ */
 
-      # It seems that -bexpall does not export symbols beginning with
-      # underscore (_), so it is better to generate a list of symbols to export.
-      _LT_AC_TAGVAR(always_export_symbols, $1)=yes
-      if test "$aix_use_runtimelinking" = yes; then
-       # Warning - without using the other runtime loading flags (-brtl),
-       # -berok will link without error, but may produce a broken library.
-       _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
-       # Determine the default libpath from the value encoded in an empty executable.
-       _LT_AC_SYS_LIBPATH_AIX
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-       _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
-       else
-       if test "$host_cpu" = ia64; then
-         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
-         _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
-         _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
-       else
-        # Determine the default libpath from the value encoded in an empty executable.
-        _LT_AC_SYS_LIBPATH_AIX
-        _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
-         # Warning - without using the other run time loading flags,
-         # -berok will link without error, but may produce a broken library.
-         _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
-         _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
-         # -bexpall does not export symbols beginning with underscore (_)
-         _LT_AC_TAGVAR(always_export_symbols, $1)=yes
-         # Exported symbols can be pulled into shared objects from archives
-         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
-         _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
-         # This is similar to how AIX traditionally builds its shared libraries.
-         _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
-       fi
-      fi
-      ;;
+/* whether we need to define bitspecific types from compiler base types */
+#ifndef _STDINT_HEADER_INTPTR
+#ifndef _STDINT_HEADER_UINT32
+#ifndef _STDINT_HEADER_U_INT32
+#define _STDINT_NEED_INT_MODEL_T
+#else
+#define _STDINT_HAVE_U_INT_TYPES
+#endif
+#endif
+#endif
 
-    amigaos*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-      # see comment about different semantics on the GNU ld section
-      _LT_AC_TAGVAR(ld_shlibs, $1)=no
-      ;;
+#ifdef _STDINT_HAVE_U_INT_TYPES
+#undef _STDINT_NEED_INT_MODEL_T
+#endif
 
-    bsdi[[45]]*)
-      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
-      ;;
+#ifdef  _STDINT_CHAR_MODEL
+#if     _STDINT_CHAR_MODEL+0 == 122 || _STDINT_CHAR_MODEL+0 == 124
+#ifndef _STDINT_BYTE_MODEL
+#define _STDINT_BYTE_MODEL 12
+#endif
+#endif
+#endif
 
-    cygwin* | mingw* | pw32*)
-      # When not using gcc, we currently assume that we are using
-      # Microsoft Visual C++.
-      # hardcode_libdir_flag_spec is actually meaningless, as there is
-      # no search path for DLLs.
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
-      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
-      # Tell ltmain to make .lib files, not .a files.
-      libext=lib
-      # Tell ltmain to make .dll files, not .so files.
-      shrext_cmds=".dll"
-      # FIXME: Setting linknames here is a bad hack.
-      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
-      # The linker will automatically build a .lib file if we build a DLL.
-      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
-      # FIXME: Should let the user specify the lib program.
-      _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
-      _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
-      _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-      ;;
+#ifndef _STDINT_HAVE_INT_LEAST32_T
+#define _STDINT_NEED_INT_LEAST_T
+#endif
 
-    darwin* | rhapsody*)
-      case $host_os in
-        rhapsody* | darwin1.[[012]])
-         _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress'
-         ;;
-       *) # Darwin 1.3 on
-         if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
-           _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-         else
-           case ${MACOSX_DEPLOYMENT_TARGET} in
-             10.[[012]])
-               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress'
-               ;;
-             10.*)
-               _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup'
-               ;;
-           esac
-         fi
-         ;;
-      esac
-      _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
-      _LT_AC_TAGVAR(hardcode_direct, $1)=no
-      _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
-      _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
-      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-    if test "$GCC" = yes ; then
-       output_verbose_link_cmd='echo'
-        _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
-      _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-      # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-      _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-    else
-      case $cc_basename in
-        xlc*)
-         output_verbose_link_cmd='echo'
-         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
-         _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
-          # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds
-         _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[    ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag  -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
-          ;;
-       *)
-         _LT_AC_TAGVAR(ld_shlibs, $1)=no
-          ;;
-      esac
-    fi
-      ;;
+#ifndef _STDINT_HAVE_INT_FAST32_T
+#define _STDINT_NEED_INT_FAST_T
+#endif
 
-    dgux*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
+#ifndef _STDINT_HEADER_INTPTR
+#define _STDINT_NEED_INTPTR_T
+#ifndef _STDINT_HAVE_INTMAX_T
+#define _STDINT_NEED_INTMAX_T
+#endif
+#endif
 
-    freebsd1*)
-      _LT_AC_TAGVAR(ld_shlibs, $1)=no
-      ;;
 
-    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
-    # support.  Future versions do this automatically, but an explicit c++rt0.o
-    # does not break anything, and helps significantly (at the cost of a little
-    # extra space).
-    freebsd2.2*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
+/* .................... definition part ............................ */
 
-    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
-    freebsd2*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
+/* some system headers have good uint64_t */
+#ifndef _HAVE_UINT64_T
+#if     defined _STDINT_HAVE_UINT64_T  || defined HAVE_UINT64_T
+#define _HAVE_UINT64_T
+#elif   defined _STDINT_HAVE_U_INT64_T || defined HAVE_U_INT64_T
+#define _HAVE_UINT64_T
+typedef u_int64_t uint64_t;
+#endif
+#endif
 
-    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
-    freebsd* | kfreebsd*-gnu | dragonfly*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
+#ifndef _HAVE_UINT64_T
+/* .. here are some common heuristics using compiler runtime specifics */
+#if defined __STDC_VERSION__ && defined __STDC_VERSION__ >= 199901L
+#define _HAVE_UINT64_T
+#define _HAVE_LONGLONG_UINT64_T
+typedef long long int64_t;
+typedef unsigned long long uint64_t;
 
-    hpux9*)
-      if test "$GCC" = yes; then
-       _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      else
-       _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
-      fi
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+#elif !defined __STRICT_ANSI__
+#if defined _MSC_VER || defined __WATCOMC__ || defined __BORLANDC__
+#define _HAVE_UINT64_T
+typedef __int64 int64_t;
+typedef unsigned __int64 uint64_t;
 
-      # hardcode_minus_L: Not really in the search PATH,
-      # but as the default location of the library.
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-      ;;
+#elif defined __GNUC__ || defined __MWERKS__ || defined __ELF__
+/* note: all ELF-systems seem to have loff-support which needs 64-bit */
+#if !defined _NO_LONGLONG
+#define _HAVE_UINT64_T
+#define _HAVE_LONGLONG_UINT64_T
+typedef long long int64_t;
+typedef unsigned long long uint64_t;
+#endif
 
-    hpux10* | hpux11*)
-      if test "$GCC" = yes -a "$with_gnu_ld" = no; then
-       case $host_cpu in
-       hppa*64*|ia64*)
-         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-         ;;
-       *)
-         _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
-         ;;
-       esac
-      else
-       case $host_cpu in
-       hppa*64*|ia64*)
-         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
-         ;;
-       *)
-         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
-         ;;
-       esac
-      fi
-      if test "$with_gnu_ld" = no; then
-       case $host_cpu in
-       hppa*64*)
-         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-         _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
-         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-         _LT_AC_TAGVAR(hardcode_direct, $1)=no
-         _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-         ;;
-       ia64*)
-         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-         _LT_AC_TAGVAR(hardcode_direct, $1)=no
-         _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+#elif defined __alpha || (defined __mips && defined _ABIN32)
+#if !defined _NO_LONGLONG
+#define _HAVE_UINT64_T
+typedef long int64_t;
+typedef unsigned long uint64_t;
+#endif
+  /* compiler/cpu type to define int64_t */
+#endif
+#endif
+#endif
 
-         # hardcode_minus_L: Not really in the search PATH,
-         # but as the default location of the library.
-         _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-         ;;
-       *)
-         _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
-         _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-         _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-         _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+#if defined _STDINT_HAVE_U_INT_TYPES
+/* int8_t int16_t int32_t defined by inet code, redeclare the u_intXX types */
+typedef u_int8_t uint8_t;
+typedef u_int16_t uint16_t;
+typedef u_int32_t uint32_t;
 
-         # hardcode_minus_L: Not really in the search PATH,
-         # but as the default location of the library.
-         _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-         ;;
-       esac
-      fi
-      ;;
+/* glibc compatibility */
+#ifndef __int8_t_defined
+#define __int8_t_defined
+#endif
+#endif
 
-    irix5* | irix6* | nonstopux*)
-      if test "$GCC" = yes; then
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-      else
-       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
-      fi
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-      ;;
+#ifdef _STDINT_NEED_INT_MODEL_T
+/* we must guess all the basic types. Apart from byte-adressable system, */
+/* there a few 32-bit-only dsp-systems that we guard with BYTE_MODEL 8-} */
+/* (btw, those nibble-addressable systems are way off, or so we assume) */
 
-    netbsd*)
-      if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
-       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
-      else
-       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
-      fi
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
+dnl   /* have a look at "64bit and data size neutrality" at */
+dnl   /* http://unix.org/version2/whatsnew/login_64bit.html */
+dnl   /* (the shorthand "ILP" types always have a "P" part) */
 
-    newsos6)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
+#if defined _STDINT_BYTE_MODEL
+#if _STDINT_LONG_MODEL+0 == 242
+/* 2:4:2 =  IP16 = a normal 16-bit system                */
+typedef unsigned char   uint8_t;
+typedef unsigned short  uint16_t;
+typedef unsigned long   uint32_t;
+#ifndef __int8_t_defined
+#define __int8_t_defined
+typedef          char    int8_t;
+typedef          short   int16_t;
+typedef          long    int32_t;
+#endif
+#elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL == 444
+/* 2:4:4 =  LP32 = a 32-bit system derived from a 16-bit */
+/* 4:4:4 = ILP32 = a normal 32-bit system                */
+typedef unsigned char   uint8_t;
+typedef unsigned short  uint16_t;
+typedef unsigned int    uint32_t;
+#ifndef __int8_t_defined
+#define __int8_t_defined
+typedef          char    int8_t;
+typedef          short   int16_t;
+typedef          int     int32_t;
+#endif
+#elif _STDINT_LONG_MODEL+0 == 484 || _STDINT_LONG_MODEL+0 == 488
+/* 4:8:4 =  IP32 = a 32-bit system prepared for 64-bit    */
+/* 4:8:8 =  LP64 = a normal 64-bit system                 */
+typedef unsigned char   uint8_t;
+typedef unsigned short  uint16_t;
+typedef unsigned int    uint32_t;
+#ifndef __int8_t_defined
+#define __int8_t_defined
+typedef          char    int8_t;
+typedef          short   int16_t;
+typedef          int     int32_t;
+#endif
+/* this system has a "long" of 64bit */
+#ifndef _HAVE_UINT64_T
+#define _HAVE_UINT64_T
+typedef unsigned long   uint64_t;
+typedef          long    int64_t;
+#endif
+#elif _STDINT_LONG_MODEL+0 == 448
+/*      LLP64   a 64-bit system derived from a 32-bit system */
+typedef unsigned char   uint8_t;
+typedef unsigned short  uint16_t;
+typedef unsigned int    uint32_t;
+#ifndef __int8_t_defined
+#define __int8_t_defined
+typedef          char    int8_t;
+typedef          short   int16_t;
+typedef          int     int32_t;
+#endif
+/* assuming the system has a "long long" */
+#ifndef _HAVE_UINT64_T
+#define _HAVE_UINT64_T
+#define _HAVE_LONGLONG_UINT64_T
+typedef unsigned long long uint64_t;
+typedef          long long  int64_t;
+#endif
+#else
+#define _STDINT_NO_INT32_T
+#endif
+#else
+#define _STDINT_NO_INT8_T
+#define _STDINT_NO_INT32_T
+#endif
+#endif
 
-    openbsd*)
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-       _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
-      else
-       case $host_os in
-        openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
-          _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
-          _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-          ;;
-        *)
-          _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
-          _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
-          ;;
-       esac
-      fi
-      ;;
+/*
+ * quote from SunOS-5.8 sys/inttypes.h:
+ * Use at your own risk.  As of February 1996, the committee is squarely
+ * behind the fixed sized types; the "least" and "fast" types are still being
+ * discussed.  The probability that the "fast" types may be removed before
+ * the standard is finalized is high enough that they are not currently
+ * implemented.
+ */
 
-    os2*)
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
-      _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
-      _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
-      ;;
+#if defined _STDINT_NEED_INT_LEAST_T
+typedef  int8_t    int_least8_t;
+typedef  int16_t   int_least16_t;
+typedef  int32_t   int_least32_t;
+#ifdef _HAVE_UINT64_T
+typedef  int64_t   int_least64_t;
+#endif
 
-    osf3*)
-      if test "$GCC" = yes; then
-       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-      else
-       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-      fi
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-      ;;
+typedef uint8_t   uint_least8_t;
+typedef uint16_t  uint_least16_t;
+typedef uint32_t  uint_least32_t;
+#ifdef _HAVE_UINT64_T
+typedef uint64_t  uint_least64_t;
+#endif
+  /* least types */
+#endif
 
-    osf4* | osf5*)     # as osf3* with the addition of -msym flag
-      if test "$GCC" = yes; then
-       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
-      else
-       _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
-       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
-       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~
-       $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp'
+#if defined _STDINT_NEED_INT_FAST_T
+typedef  int8_t    int_fast8_t; 
+typedef  int       int_fast16_t;
+typedef  int32_t   int_fast32_t;
+#ifdef _HAVE_UINT64_T
+typedef  int64_t   int_fast64_t;
+#endif
 
-       # Both c and cxx compiler support -rpath directly
-       _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
-      fi
-      _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
-      ;;
+typedef uint8_t   uint_fast8_t; 
+typedef unsigned  uint_fast16_t;
+typedef uint32_t  uint_fast32_t;
+#ifdef _HAVE_UINT64_T
+typedef uint64_t  uint_fast64_t;
+#endif
+  /* fast types */
+#endif
 
-    sco3.2v5*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
-      runpath_var=LD_RUN_PATH
-      hardcode_runpath_var=yes
-      ;;
+#ifdef _STDINT_NEED_INTMAX_T
+#ifdef _HAVE_UINT64_T
+typedef  int64_t       intmax_t;
+typedef uint64_t      uintmax_t;
+#else
+typedef          long  intmax_t;
+typedef unsigned long uintmax_t;
+#endif
+#endif
 
-    solaris*)
-      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
-      if test "$GCC" = yes; then
-       wlarc='${wl}'
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-         $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
-      else
-       wlarc=''
-       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-       _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-       $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
-      fi
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      case $host_os in
-      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
-      *)
-       # The compiler driver will combine linker options so we
-       # cannot just pass the convience library names through
-       # without $wl, iff we do not link with $LD.
-       # Luckily, gcc supports the same syntax we need for Sun Studio.
-       # Supported since Solaris 2.6 (maybe 2.5.1?)
-       case $wlarc in
-       '')
-         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
-       *)
-         _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;;
-       esac ;;
-      esac
-      _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
-      ;;
+#ifdef _STDINT_NEED_INTPTR_T
+#ifndef __intptr_t_defined
+#define __intptr_t_defined
+/* we encourage using "long" to store pointer values, never use "int" ! */
+#if   _STDINT_LONG_MODEL+0 == 242 || _STDINT_LONG_MODEL+0 == 484
+typedef  unsinged int   uintptr_t;
+typedef           int    intptr_t;
+#elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL+0 == 444
+typedef  unsigned long  uintptr_t;
+typedef           long   intptr_t;
+#elif _STDINT_LONG_MODEL+0 == 448 && defined _HAVE_UINT64_T
+typedef        uint64_t uintptr_t;
+typedef         int64_t  intptr_t;
+#else /* matches typical system types ILP32 and LP64 - but not IP16 or LLP64 */
+typedef  unsigned long  uintptr_t;
+typedef           long   intptr_t;
+#endif
+#endif
+#endif
 
-    sunos4*)
-      if test "x$host_vendor" = xsequent; then
-       # Use $CC to link under sequent, because it throws in some extra .o
-       # files that make .init and .fini sections work.
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
-      fi
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
+/* The ISO C99 standard specifies that in C++ implementations these
+   should only be defined if explicitly requested.  */
+#if !defined __cplusplus || defined __STDC_CONSTANT_MACROS
+#ifndef UINT32_C
 
-    sysv4)
-      case $host_vendor in
-       sni)
-         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-         _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
-       ;;
-       siemens)
-         ## LD is ld it makes a PLAMLIB
-         ## CC just makes a GrossModule.
-         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
-         _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
-         _LT_AC_TAGVAR(hardcode_direct, $1)=no
-        ;;
-       motorola)
-         _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-         _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
-       ;;
-      esac
-      runpath_var='LD_RUN_PATH'
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
+/* Signed.  */
+# define INT8_C(c)      c
+# define INT16_C(c)     c
+# define INT32_C(c)     c
+# ifdef _HAVE_LONGLONG_UINT64_T
+#  define INT64_C(c)    c ## L
+# else
+#  define INT64_C(c)    c ## LL
+# endif
 
-    sysv4.3*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
-      ;;
+/* Unsigned.  */
+# define UINT8_C(c)     c ## U
+# define UINT16_C(c)    c ## U
+# define UINT32_C(c)    c ## U
+# ifdef _HAVE_LONGLONG_UINT64_T
+#  define UINT64_C(c)   c ## UL
+# else
+#  define UINT64_C(c)   c ## ULL
+# endif
 
-    sysv4*MP*)
-      if test -d /usr/nec; then
-       _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-       _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-       runpath_var=LD_RUN_PATH
-       hardcode_runpath_var=yes
-       _LT_AC_TAGVAR(ld_shlibs, $1)=yes
-      fi
-      ;;
+/* Maximal type.  */
+# ifdef _HAVE_LONGLONG_UINT64_T
+#  define INTMAX_C(c)   c ## L
+#  define UINTMAX_C(c)  c ## UL
+# else
+#  define INTMAX_C(c)   c ## LL
+#  define UINTMAX_C(c)  c ## ULL
+# endif
 
-    sysv4.2uw2*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
-      _LT_AC_TAGVAR(hardcode_direct, $1)=yes
-      _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      hardcode_runpath_var=yes
-      runpath_var=LD_RUN_PATH
-      ;;
+  /* literalnumbers */
+#endif
+#endif
 
-   sysv5OpenUNIX8* | sysv5UnixWare7* |  sysv5uw[[78]]* | unixware7*)
-      _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text'
-      if test "$GCC" = yes; then
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-      else
-       _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
-      fi
-      runpath_var='LD_RUN_PATH'
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
+/* These limits are merily those of a two complement byte-oriented system */
 
-    sysv5*)
-      _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
-      # $CC -shared without GNU ld will not create a library from C++
-      # object files and a static libstdc++, better avoid it by now
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
-               $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp'
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      runpath_var='LD_RUN_PATH'
-      ;;
+/* Minimum of signed integral types.  */
+# define INT8_MIN               (-128)
+# define INT16_MIN              (-32767-1)
+# define INT32_MIN              (-2147483647-1)
+# define INT64_MIN              (-__INT64_C(9223372036854775807)-1)
+/* Maximum of signed integral types.  */
+# define INT8_MAX               (127)
+# define INT16_MAX              (32767)
+# define INT32_MAX              (2147483647)
+# define INT64_MAX              (__INT64_C(9223372036854775807))
 
-    uts4*)
-      _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
-      _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
-      _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
-      ;;
+/* Maximum of unsigned integral types.  */
+# define UINT8_MAX              (255)
+# define UINT16_MAX             (65535)
+# define UINT32_MAX             (4294967295U)
+# define UINT64_MAX             (__UINT64_C(18446744073709551615))
+
+/* Minimum of signed integral types having a minimum size.  */
+# define INT_LEAST8_MIN         INT8_MIN
+# define INT_LEAST16_MIN        INT16_MIN
+# define INT_LEAST32_MIN        INT32_MIN
+# define INT_LEAST64_MIN        INT64_MIN
+/* Maximum of signed integral types having a minimum size.  */
+# define INT_LEAST8_MAX         INT8_MAX
+# define INT_LEAST16_MAX        INT16_MAX
+# define INT_LEAST32_MAX        INT32_MAX
+# define INT_LEAST64_MAX        INT64_MAX
 
-    *)
-      _LT_AC_TAGVAR(ld_shlibs, $1)=no
-      ;;
-    esac
-  fi
-])
-AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
-test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+/* Maximum of unsigned integral types having a minimum size.  */
+# define UINT_LEAST8_MAX        UINT8_MAX
+# define UINT_LEAST16_MAX       UINT16_MAX
+# define UINT_LEAST32_MAX       UINT32_MAX
+# define UINT_LEAST64_MAX       UINT64_MAX
 
-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"
+  /* shortcircuit*/
+#endif
+  /* once */
+#endif
+#endif
+STDINT_EOF
 fi
+    if cmp -s $ac_stdint_h $ac_stdint 2>/dev/null; then
+      AC_MSG_NOTICE([$ac_stdint_h is unchanged])
+    else
+      ac_dir=`AS_DIRNAME(["$ac_stdint_h"])`
+      AS_MKDIR_P(["$ac_dir"])
+      rm -f $ac_stdint_h
+      mv $ac_stdint $ac_stdint_h
+    fi
+],[# variables for create stdint.h replacement
+PACKAGE="$PACKAGE"
+VERSION="$VERSION"
+ac_stdint_h="$ac_stdint_h"
+_ac_stdint_h=AS_TR_CPP(_$PACKAGE-$ac_stdint_h)
+ac_cv_stdint_message="$ac_cv_stdint_message"
+ac_cv_header_stdint_t="$ac_cv_header_stdint_t"
+ac_cv_header_stdint_x="$ac_cv_header_stdint_x"
+ac_cv_header_stdint_o="$ac_cv_header_stdint_o"
+ac_cv_header_stdint_u="$ac_cv_header_stdint_u"
+ac_cv_type_uint64_t="$ac_cv_type_uint64_t"
+ac_cv_type_u_int64_t="$ac_cv_type_u_int64_t"
+ac_cv_char_data_model="$ac_cv_char_data_model"
+ac_cv_long_data_model="$ac_cv_long_data_model"
+ac_cv_type_int_least32_t="$ac_cv_type_int_least32_t"
+ac_cv_type_int_fast32_t="$ac_cv_type_int_fast32_t"
+ac_cv_type_intmax_t="$ac_cv_type_intmax_t"
+])
+])
 
+# AC_PROG_XSLTPROC
+# -----------------------------------------------------------------
+# Find an xsltproc executable.
 #
-# Do we need to explicitly link libc?
-#
-case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
-x|xyes)
-  # Assume -lc should be added
-  _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
-
-  if test "$enable_shared" = yes && test "$GCC" = yes; then
-    case $_LT_AC_TAGVAR(archive_cmds, $1) in
-    *'~'*)
-      # FIXME: we may have to deal with multi-command sequences.
-      ;;
-    '$CC '*)
-      # Test whether the compiler implicitly links with -lc since on some
-      # systems, -lgcc has to come before -lc. If gcc already passes -lc
-      # to ld, don't add -lc before -lgcc.
-      AC_MSG_CHECKING([whether -lc should be explicitly linked in])
-      $rm conftest*
-      printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+# Input:
+#  $1 is the default $XSLTPROC_FLAGS, which will be overridden if the
+#  user specifies --with-xsltproc-flags.
+# Output:
+#  $XSLTPROC contains the path to xsltproc, or is empty if none was
+#  found or the user specified --without-xsltproc. $XSLTPROC_FLAGS 
+#  contains the flags to use with xsltproc.
+
+AC_DEFUN([AC_PROG_XSLTPROC],
+[
+XSLTPROC_FLAGS="$1"
+AC_SUBST(XSLTPROC_FLAGS)
+
+# The (lack of) whitespace and overquoting here are all necessary for
+# proper formatting.
+AC_ARG_WITH(xsltproc,
+AS_HELP_STRING([--with-xsltproc[[[[[=PATH]]]]]],
+               [Use the xsltproc binary in in PATH.]),
+    [ ac_with_xsltproc=$withval; ],
+    [ ac_with_xsltproc=maybe; ])
+
+AC_ARG_WITH(xsltproc-flags,
+AS_HELP_STRING([  --with-xsltproc-flags=FLAGS],
+               [Flags to pass to xsltproc (default $1)]),
+    [ if test "x$withval" == "xno"; then
+       XSLTPROC_FLAGS=''
+    else
+       if test "x$withval" != "xyes"; then
+           XSLTPROC_FLAGS="$withval"
+       fi
+    fi
+       ])
 
-      if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
-        soname=conftest
-        lib=conftest
-        libobjs=conftest.$ac_objext
-        deplibs=
-        wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
-        compiler_flags=-v
-        linker_flags=-v
-        verstring=
-        output_objdir=.
-        libname=conftest
-        lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
-        _LT_AC_TAGVAR(allow_undefined_flag, $1)=
-        if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
-        then
-         _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+# search for xsltproc if it wasn't specified
+if test "$ac_with_xsltproc" = "yes" -o "$ac_with_xsltproc" = "maybe"; then
+    AC_PATH_PROGS(XSLTPROC,xsltproc,,$LOCSYSPATH)
+else
+    if test "$ac_with_xsltproc" != "no"; then
+        if test -x "$ac_with_xsltproc"; then
+            XSLTPROC="$ac_with_xsltproc";
         else
-         _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+            AC_MSG_WARN([Specified xsltproc of $ac_with_xsltproc isn't])
+            AC_MSG_WARN([executable; searching for an alternative.])
+            AC_PATH_PROGS(XSLTPROC,xsltproc,,$LOCSYSPATH)
         fi
-        _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
-      else
-        cat conftest.err 1>&5
-      fi
-      $rm conftest*
-      AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
-      ;;
-    esac
-  fi
-  ;;
-esac
-])# AC_LIBTOOL_PROG_LD_SHLIBS
-
+    fi
+fi
+])
 
-# _LT_AC_FILE_LTDLL_C
-# -------------------
-# Be careful that the start marker always follows a newline.
-AC_DEFUN([_LT_AC_FILE_LTDLL_C], [
-# /* ltdll.c starts here */
-# #define WIN32_LEAN_AND_MEAN
-# #include <windows.h>
-# #undef WIN32_LEAN_AND_MEAN
-# #include <stdio.h>
-#
-# #ifndef __CYGWIN__
-# #  ifdef __CYGWIN32__
-# #    define __CYGWIN__ __CYGWIN32__
-# #  endif
-# #endif
-#
-# #ifdef __cplusplus
-# extern "C" {
-# #endif
-# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
-# #ifdef __cplusplus
-# }
-# #endif
-#
-# #ifdef __CYGWIN__
-# #include <cygwin/cygwin_dll.h>
-# DECLARE_CYGWIN_DLL( DllMain );
-# #endif
-# HINSTANCE __hDllInstance_base;
+# AC_CHECK_DOCBOOK_XSLT
+# -----------------------------------------------------------------
+# Check for access to docbook stylesheets of a particular revision.
+# This macro can be used for multiple versions within the same script.
 #
-# BOOL APIENTRY
-# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
-# {
-#   __hDllInstance_base = hInst;
-#   return TRUE;
-# }
-# /* ltdll.c ends here */
-])# _LT_AC_FILE_LTDLL_C
+# Input:
+#  $1 is the version of docbook to search for; default 'current'
+# Output:
+#  $HAVE_DOCBOOK_XSLT_VERS will be set to 'yes' or 'no' depending
+#  on the results of the test, where VERS is $1, with '_' substituted
+#  for '.'  $HAVE_DOCBOOK_XSLT will also be set to the same value.
+AC_DEFUN([AC_CHECK_DOCBOOK_XSLT],
+[
+    AC_REQUIRE([AC_PROG_XSLTPROC])
 
+    dnl define a temporary variable for the version, so this macro can be
+    dnl used with multiple versions
+    define([_VERS], $1)
+    ifelse(_VERS, [], [define([_VERS], [current])])
+    define([ac_cv_docbook_xslt_VERS], patsubst([ac_cv_docbook_xslt_]_VERS, [\.], [_]))
+    define([HAVE_DOCBOOK_XSLT_VERS], patsubst([HAVE_DOCBOOK_XSLT_]_VERS, [\.], [_]))
 
-# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
-# ---------------------------------
-AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
+    AC_CACHE_CHECK([for Docbook XSLT version ]_VERS, [ac_cv_docbook_xslt_VERS],
+    [
+       ac_cv_docbook_xslt_VERS=no
+       if test -n "$XSLTPROC"; then
+           echo "Trying '$XSLTPROC $XSLTPROC_FLAGS http://docbook.sourceforge.net/release/xsl/_VERS/xhtml/docbook.xsl'" >&AS_MESSAGE_LOG_FD
+           $XSLTPROC $XSLTPROC_FLAGS http://docbook.sourceforge.net/release/xsl/_VERS/xhtml/docbook.xsl >&AS_MESSAGE_LOG_FD 2>&1
 
+           if test "$?" = 0; then
+               ac_cv_docbook_xslt_VERS=yes
+           fi
+       fi
+    ])
 
-# old names
-AC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
-AC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
-AC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
-AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
-AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
-AC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
-AC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
+    HAVE_DOCBOOK_XSLT_VERS="$ac_cv_docbook_xslt_VERS"
+    HAVE_DOCBOOK_XSLT=HAVE_DOCBOOK_XSLT_VERS
+    undefine([_VERS])
+])
 
-# This is just to silence aclocal about the macro not being used
-ifelse([AC_DISABLE_FAST_INSTALL])
+# AC_CHECK_DOCBOOK_DTD
+# -----------------------------------------------------------------
+# Check for access to docbook DTD of a particular revision.
+# This macro can be used for multiple versions within the same script.
+#
+# Input:
+#  $1 is the version of docbook to search for; default 'current'
+# Output:
+#  $HAVE_DOCBOOK_DTD_VERS will be set to 'yes' or 'no' depending
+#  on the results of the test, where VERS is $1, with '_' substituted
+#  for '.'  $HAVE_DOCBOOK_DTD will also be set to the same value.
+AC_DEFUN([AC_CHECK_DOCBOOK_DTD],
+[
+    AC_REQUIRE([AC_PROG_XSLTPROC])
 
-AC_DEFUN([LT_AC_PROG_GCJ],
-[AC_CHECK_TOOL(GCJ, gcj, no)
-  test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
-  AC_SUBST(GCJFLAGS)
-])
+    dnl define a temporary variable for the version, so this macro can be
+    dnl used with multiple versions
+    define([_VERS], $1)
+    ifelse(_VERS, [], [define([_VERS], [current])])
+    define([ac_cv_docbook_dtd_VERS], patsubst([ac_cv_docbook_dtd_]_VERS, [\.], [_]))
+    define([HAVE_DOCBOOK_DTD_VERS], patsubst([HAVE_DOCBOOK_DTD_]_VERS, [\.], [_]))
 
-AC_DEFUN([LT_AC_PROG_RC],
-[AC_CHECK_TOOL(RC, windres, no)
-])
+    AC_CACHE_CHECK([for Docbook DTD version ]_VERS, [ac_cv_docbook_dtd_VERS],
+    [
+       ac_cv_docbook_dtd_VERS=no
+       if test -n "$XSLTPROC"; then
+           MY_XSLTPROC_FLAGS=`echo "" $XSLTPROC_FLAGS|sed -e s/--novalid//g`
+           cat <<EOF >conftest.xml
+<?xml version="1.0" encoding='ISO-8859-1'?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V[]_VERS//EN" "http://www.oasis-open.org/docbook/xml/_VERS/docbookx.dtd">
+<book id="empty">
+</book>
+EOF
+           echo "Trying '$XSLTPROC $MY_XSLTPROC_FLAGS conftest.xml'" >&AS_MESSAGE_LOG_FD
+           $XSLTPROC $MY_XSLTPROC_FLAGS conftest.xml >conftest.out 2>&1
+           if test "$?" = 0; then
+               # failing to load the DTD is just a warning, so check for it in the output.
+               if grep 'warning: failed to load external entity' conftest_out >/dev/null 2>&1; then
+                   : # no good..
+               else
+                   ac_cv_docbook_dtd_VERS=yes
+               fi
+           fi
+           cat conftest.out >&AS_MESSAGE_LOG_FD
 
-############################################################
-# NOTE: This macro has been submitted for inclusion into   #
-#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
-#  a released version of Autoconf we should remove this    #
-#  macro and use it instead.                               #
-############################################################
-# LT_AC_PROG_SED
-# --------------
-# Check for a fully-functional sed program, that truncates
-# as few characters as possible.  Prefer GNU sed if found.
-AC_DEFUN([LT_AC_PROG_SED],
-[AC_MSG_CHECKING([for a sed that does not truncate output])
-AC_CACHE_VAL(lt_cv_path_SED,
-[# Loop through the user's path and test for sed and gsed.
-# Then use that list of sed's as ones to test for truncation.
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for lt_ac_prog in sed gsed; do
-    for ac_exec_ext in '' $ac_executable_extensions; do
-      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
-        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
-      fi
-    done
-  done
-done
-lt_ac_max=0
-lt_ac_count=0
-# Add /usr/xpg4/bin/sed as it is typically found on Solaris
-# along with /bin/sed that truncates output.
-for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
-  test ! -f $lt_ac_sed && continue
-  cat /dev/null > conftest.in
-  lt_ac_count=0
-  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
-  # Check for GNU sed and select it if it is found.
-  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
-    lt_cv_path_SED=$lt_ac_sed
-    break
-  fi
-  while true; do
-    cat conftest.in conftest.in >conftest.tmp
-    mv conftest.tmp conftest.in
-    cp conftest.in conftest.nl
-    echo >>conftest.nl
-    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
-    cmp -s conftest.out conftest.nl || break
-    # 10000 chars as input seems more than enough
-    test $lt_ac_count -gt 10 && break
-    lt_ac_count=`expr $lt_ac_count + 1`
-    if test $lt_ac_count -gt $lt_ac_max; then
-      lt_ac_max=$lt_ac_count
-      lt_cv_path_SED=$lt_ac_sed
-    fi
-  done
-done
-])
-SED=$lt_cv_path_SED
-AC_MSG_RESULT([$SED])
+           rm -f conftest.xml conftest.out
+       fi
+    ])
+
+    HAVE_DOCBOOK_DTD_VERS="$ac_cv_docbook_dtd_VERS"
+    HAVE_DOCBOOK_DTD=HAVE_DOCBOOK_DTD_VERS
+    undefine([_VERS])
 ])
+dnl
+dnl Checks to see if there's a sockaddr_storage structure
+dnl
+dnl usage:
+dnl
+dnl    AC_SOCKADDR_STORAGE
+dnl
+dnl results:
+dnl
+dnl    HAVE_SOCKADDR_STORAGE (defined)
+dnl
+AC_DEFUN([AC_SOCKADDR_STORAGE],
+    [AC_MSG_CHECKING(if sockaddr_storage struct exists)
+    AC_CACHE_VAL(ac_cv_has_sockaddr_storage,
+       AC_TRY_COMPILE([
+#      include <sys/types.h>
+#      include <sys/socket.h>],
+       [u_int i = sizeof (struct sockaddr_storage)],
+       ac_cv_has_sockaddr_storage=yes,
+       ac_cv_has_sockaddr_storage=no))
+    AC_MSG_RESULT($ac_cv_has_sockaddr_storage)
+    if test $ac_cv_has_sockaddr_storage = yes ; then
+           AC_DEFINE(HAVE_SOCKADDR_STORAGE,1,[if struct sockaddr_storage exists])
+    fi])
+
+
index 3411292a1cf52ab962fc0664ca152856594e38a3..a673cb597195007de8b12d5fc64af3a1be1bdd91 100644 (file)
@@ -1,7 +1,8 @@
 # Makefile for Amanda client programs.
 
 INCLUDES =     -I$(top_builddir)/common-src \
-               -I$(top_srcdir)/common-src
+               -I$(top_srcdir)/common-src \
+               -I$(top_srcdir)/gnulib
 
 LINT=@AMLINT@
 LINTFLAGS=@AMLINTFLAGS@
@@ -29,7 +30,8 @@ noinst_HEADERS  = amandad.h
 
 LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
        libamandad.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION)
+       ../common-src/libamanda.$(LIB_EXTENSION) \
+       ../gnulib/libgnu.$(LIB_EXTENSION)
 
 install-exec-hook:
        @list="$(libexec_PROGRAMS) $(libexec_SCRIPTS)"; \
index ed050692c246c82e0f8f6fe92a246fbad08db83b..9ea0a5c0563d3ce9175b1bdc9852950e6ac0fcf1 100644 (file)
@@ -47,6 +47,41 @@ DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
        $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+       $(top_srcdir)/config/gnulib/absolute-header.m4 \
+       $(top_srcdir)/config/gnulib/alloca.m4 \
+       $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/eoverflow.m4 \
+       $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/getaddrinfo.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-cache.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-common.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-comp.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-tool.m4 \
+       $(top_srcdir)/config/gnulib/inet_ntop.m4 \
+       $(top_srcdir)/config/gnulib/intmax_t.m4 \
+       $(top_srcdir)/config/gnulib/inttypes_h.m4 \
+       $(top_srcdir)/config/gnulib/lib-ld.m4 \
+       $(top_srcdir)/config/gnulib/lib-link.m4 \
+       $(top_srcdir)/config/gnulib/lib-prefix.m4 \
+       $(top_srcdir)/config/gnulib/lock.m4 \
+       $(top_srcdir)/config/gnulib/longdouble.m4 \
+       $(top_srcdir)/config/gnulib/longlong.m4 \
+       $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
+       $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \
+       $(top_srcdir)/config/gnulib/size_max.m4 \
+       $(top_srcdir)/config/gnulib/snprintf.m4 \
+       $(top_srcdir)/config/gnulib/socklen.m4 \
+       $(top_srcdir)/config/gnulib/sockpfaf.m4 \
+       $(top_srcdir)/config/gnulib/stdbool.m4 \
+       $(top_srcdir)/config/gnulib/stdint_h.m4 \
+       $(top_srcdir)/config/gnulib/strdup.m4 \
+       $(top_srcdir)/config/gnulib/string_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
+       $(top_srcdir)/config/gnulib/vasnprintf.m4 \
+       $(top_srcdir)/config/gnulib/visibility.m4 \
+       $(top_srcdir)/config/gnulib/wchar_t.m4 \
+       $(top_srcdir)/config/gnulib/wint_t.m4 \
+       $(top_srcdir)/config/gnulib/xsize.m4 \
        $(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
@@ -72,7 +107,8 @@ amandad_OBJECTS = amandad.$(OBJEXT)
 amandad_LDADD = $(LDADD)
 amandad_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
        libamandad.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION)
+       ../common-src/libamanda.$(LIB_EXTENSION) \
+       ../gnulib/libgnu.$(LIB_EXTENSION)
 DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/config
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
 am__depfiles_maybe = depfiles
@@ -90,8 +126,10 @@ HEADERS = $(noinst_HEADERS)
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ABSOLUTE_STRING_H = @ABSOLUTE_STRING_H@
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
+ALLOCA_H = @ALLOCA_H@
 AMANDA_DBGDIR = @AMANDA_DBGDIR@
 AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@
 AMANDA_TMPDIR = @AMANDA_TMPDIR@
@@ -106,18 +144,17 @@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@
 AMTAR = @AMTAR@
 AM_CFLAGS = @AM_CFLAGS@
 AR = @AR@
+ARPA_INET_H = @ARPA_INET_H@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
-AWK_VAR_ASSIGNMENT_OPT = @AWK_VAR_ASSIGNMENT_OPT@
 BINARY_OWNER = @BINARY_OWNER@
-BUILD_MAN_PAGES_FALSE = @BUILD_MAN_PAGES_FALSE@
-BUILD_MAN_PAGES_TRUE = @BUILD_MAN_PAGES_TRUE@
 CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
+CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
 CHIO = @CHIO@
 CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
@@ -150,18 +187,40 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
+ENABLE_MANPAGE_BUILD_FALSE = @ENABLE_MANPAGE_BUILD_FALSE@
+ENABLE_MANPAGE_BUILD_TRUE = @ENABLE_MANPAGE_BUILD_TRUE@
+EOVERFLOW = @EOVERFLOW@
+EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@
 EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
+GCC_COMPILER_FALSE = @GCC_COMPILER_FALSE@
+GCC_COMPILER_TRUE = @GCC_COMPILER_TRUE@
 GETCONF = @GETCONF@
+GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@
+GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
 GNUTAR_LISTED_INCREMENTAL_DIRX = @GNUTAR_LISTED_INCREMENTAL_DIRX@
 GREP = @GREP@
 GZIP = @GZIP@
-HAVE_XSLTPROC_FALSE = @HAVE_XSLTPROC_FALSE@
-HAVE_XSLTPROC_TRUE = @HAVE_XSLTPROC_TRUE@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRNDUP = @HAVE_STRNDUP@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE__BOOL = @HAVE__BOOL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -170,22 +229,31 @@ LDFLAGS = @LDFLAGS@
 LEX = @LEX@
 LEXLIB = @LEXLIB@
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
+LIBPTH = @LIBPTH@
+LIBPTH_PREFIX = @LIBPTH_PREFIX@
 LIBS = @LIBS@
+LIBTHREAD = @LIBTHREAD@
 LIBTOOL = @LIBTOOL@
 LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LL_FMT = @LL_FMT@
 LL_RFMT = @LL_RFMT@
 LN_S = @LN_S@
 LTALLOCA = @LTALLOCA@
+LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
 LTLIBOBJS = @LTLIBOBJS@
+LTLIBPTH = @LTLIBPTH@
+LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
 MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@
 MCUTIL = @MCUTIL@
+MKDIR_P = @MKDIR_P@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
+NETINET_IN_H = @NETINET_IN_H@
 OBJEXT = @OBJEXT@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -199,6 +267,9 @@ PERL = @PERL@
 PRINT = @PRINT@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
+REPLACE_STRCASECMP = @REPLACE_STRCASECMP@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRSTR = @REPLACE_STRSTR@
 RESTORE = @RESTORE@
 SAMBA_CLIENT = @SAMBA_CLIENT@
 SERVICE_SUFFIX = @SERVICE_SUFFIX@
@@ -207,7 +278,10 @@ SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 SNAPSHOT_STAMP = @SNAPSHOT_STAMP@
 SORT = @SORT@
+SSH = @SSH@
+STDBOOL_H = @STDBOOL_H@
 STRIP = @STRIP@
+SYS_SOCKET_H = @SYS_SOCKET_H@
 USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@
 VDUMP = @VDUMP@
 VERSION = @VERSION@
@@ -246,6 +320,7 @@ WANT_TAPE_TRUE = @WANT_TAPE_TRUE@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
 XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
 YACC = @YACC@
 ac_c = @ac_c@
 ac_ct_AR = @ac_ct_AR@
@@ -272,6 +347,8 @@ build_os = @build_os@
 build_vendor = @build_vendor@
 datadir = @datadir@
 exec_prefix = @exec_prefix@
+gl_LIBOBJS = @gl_LIBOBJS@
+gl_LTLIBOBJS = @gl_LTLIBOBJS@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -297,7 +374,8 @@ target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
 INCLUDES = -I$(top_builddir)/common-src \
-               -I$(top_srcdir)/common-src
+               -I$(top_srcdir)/common-src \
+               -I$(top_srcdir)/gnulib
 
 LINT = @AMLINT@
 LINTFLAGS = @AMLINTFLAGS@
@@ -316,7 +394,8 @@ noinst_HEADERS = amandad.h
 ###
 LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
        libamandad.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION)
+       ../common-src/libamanda.$(LIB_EXTENSION) \
+       ../gnulib/libgnu.$(LIB_EXTENSION)
 
 all: all-am
 
index 2bc6df54b98b49dc73ec4c21f240de3c67c30e66..f04d4e3f1508095441b1d0a7ef35ce86beec410c 100644 (file)
  */
 
 /*
- * $Id: amandad.c,v 1.18.2.5 2007/01/10 16:26:57 martinea Exp $
+ * $Id: amandad.c,v 1.18 2006/08/21 20:17:09 martinea Exp $
  *
  * handle client-host side of Amanda network communications, including
  * security checks, execution of the proper service, and acking the
  * master side
  */
 
-/*#define      AMANDAD_DEBUG*/
-
 #include "amanda.h"
 #include "amandad.h"
 #include "clock.h"
 #include "security.h"
 #include "stream.h"
 #include "util.h"
+#include "conffile.h"
 
 #define        REP_TIMEOUT     (6*60*60)       /* secs for service to reply */
 #define        ACK_TIMEOUT     10              /* XXX should be configurable */
-#define        MAX_REP_RETRIES 5
+
+#define amandad_debug(i,x) do {                \
+       if ((i) <= debug_amandad) {     \
+               dbprintf(x);            \
+       }                               \
+} while (0)
 
 /*
  * These are the actions for entering the state machine
@@ -170,10 +174,8 @@ static ssize_t do_sendpkt(security_handle_t *handle, pkt_t *pkt);
 
 static void child_signal(int signal);
 
-#ifdef AMANDAD_DEBUG
 static const char *state2str(state_t);
 static const char *action2str(action_t);
-#endif
 
 /*
  * Harvests defunct processes...
@@ -206,10 +208,11 @@ main(
     int no_exit = 0;
     struct sigaction act, oact;
     char *pgm = "amandad";             /* in case argv[0] is not set */
-#if defined(AMANDAD_DEBUG) && defined(USE_REUSEADDR)
+#if defined(USE_REUSEADDR)
     const int on = 1;
     int r;
 #endif
+    char *conffile;
 
     safe_fd(-1, 0);
     safe_cd();
@@ -245,6 +248,13 @@ main(
        /*NOTREACHED*/
     }
 
+    conffile = vstralloc(CONFIG_DIR, "/", "amanda-client.conf", NULL);
+    if (read_clientconf(conffile) > 0) {
+       error("error reading conffile: %s", conffile);
+       /*NOTREACHED*/
+    }
+    amfree(conffile);
+
 #ifdef USE_DBMALLOC
     dbmalloc_info.start.size = malloc_inuse(&dbmalloc_info.start.hist);
 #endif
@@ -270,10 +280,8 @@ main(
      *
      * We accept       -auth=[authentication type]
      *                 -no-exit
-#ifdef AMANDAD_DEBUG
      *                 -tcp=[port]
      *                 -udp=[port]
-#endif
      * We also add a list of services that amandad can launch
      */
     secdrv = NULL;
@@ -312,16 +320,23 @@ main(
            continue;
        }
 
-#ifdef AMANDAD_DEBUG
        /*
         * Allow us to directly bind to a udp port for debugging.
         * This may only apply to some security types.
         */
        else if (strncmp(argv[i], "-udp=", strlen("-udp=")) == 0) {
+#ifdef WORKING_IPV6
+           struct sockaddr_in6 sin;
+#else
            struct sockaddr_in sin;
+#endif
 
            argv[i] += strlen("-udp=");
+#ifdef WORKING_IPV6
+           in = out = socket(AF_INET6, SOCK_DGRAM, 0);
+#else
            in = out = socket(AF_INET, SOCK_DGRAM, 0);
+#endif
            if (in < 0) {
                error("can't create dgram socket: %s\n", strerror(errno));
                /*NOTREACHED*/
@@ -331,14 +346,20 @@ main(
                (void *)&on, (socklen_t)sizeof(on));
            if (r < 0) {
                dbprintf(("%s: amandad: setsockopt(SO_REUSEADDR) failed: %s\n",
-                         debug_prefix(NULL),
+                         debug_prefix_time(NULL),
                          strerror(errno)));
            }
 #endif
 
+#ifdef WORKING_IPV6
+           sin.sin6_family = (sa_family_t)AF_INET6;
+           sin.sin6_addr = in6addr_any;
+           sin.sin6_port = (in_port_t)htons((in_port_t)atoi(argv[i]));
+#else
            sin.sin_family = (sa_family_t)AF_INET;
            sin.sin_addr.s_addr = INADDR_ANY;
            sin.sin_port = (in_port_t)htons((in_port_t)atoi(argv[i]));
+#endif
            if (bind(in, (struct sockaddr *)&sin, (socklen_t)sizeof(sin)) < 0) {
                error("can't bind to port %d: %s\n", atoi(argv[i]),
                    strerror(errno));
@@ -349,31 +370,42 @@ main(
         * Ditto for tcp ports.
         */
        else if (strncmp(argv[i], "-tcp=", strlen("-tcp=")) == 0) {
+#ifdef WORKING_IPV6
+           struct sockaddr_in6 sin;
+#else
            struct sockaddr_in sin;
+#endif
            int sock;
            socklen_t n;
 
            argv[i] += strlen("-tcp=");
+#ifdef WORKING_IPV6
+           sock = socket(AF_INET6, SOCK_STREAM, 0);
+#else
            sock = socket(AF_INET, SOCK_STREAM, 0);
+#endif
            if (sock < 0) {
                error("can't create tcp socket: %s\n", strerror(errno));
                /*NOTREACHED*/
            }
-           n = 1;
 #ifdef USE_REUSEADDR
            r = setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
                (void *)&on, (socklen_t)sizeof(on));
            if (r < 0) {
                dbprintf(("%s: amandad: setsockopt(SO_REUSEADDR) failed: %s\n",
-                         debug_prefix(NULL),
+                         debug_prefix_time(NULL),
                          strerror(errno)));
            }
 #endif
-           setsockopt(sock, SOL_SOCKET, SO_REUSEADDR,
-               (void *)&n, (socklen_t)sizeof(n));
+#ifdef WORKING_IPV6
+           sin.sin6_family = (sa_family_t)AF_INET6;
+           sin.sin6_addr = in6addr_any;
+           sin.sin6_port = (in_port_t)htons((in_port_t)atoi(argv[i]));
+#else
            sin.sin_family = (sa_family_t)AF_INET;
            sin.sin_addr.s_addr = INADDR_ANY;
            sin.sin_port = (in_port_t)htons((in_port_t)atoi(argv[i]));
+#endif
            if (bind(sock, (struct sockaddr *)&sin, (socklen_t)sizeof(sin)) < 0) {
                error("can't bind to port %d: %s\n", atoi(argv[i]),
                    strerror(errno));
@@ -383,7 +415,6 @@ main(
            n = (socklen_t)sizeof(sin);
            in = out = accept(sock, (struct sockaddr *)&sin, &n);
        }
-#endif
        /*
         * It must be a service name
         */
@@ -440,12 +471,12 @@ main(
 
     dbprintf(("%s: version %s\n", get_pname(), version()));
     for (i = 0; version_info[i] != NULL; i++) {
-       dbprintf(("%s: %s", debug_prefix(NULL), version_info[i]));
+       dbprintf(("%s: %s", debug_prefix_time(NULL), version_info[i]));
     }
 
     if (! (argc >= 1 && argv != NULL && argv[0] != NULL)) {
        dbprintf(("%s: WARNING: argv[0] not defined: check inetd.conf\n",
-                 debug_prefix(NULL)));
+                 debug_prefix_time(NULL)));
     }
 
     /*
@@ -594,7 +625,7 @@ protocol_accept(
     if (i == (int)NSERVICES) {
        dbprintf(("%s: %s: invalid service\n",
            debug_prefix_time(NULL), service));
-       pkt_init(&pkt_out, P_NAK, "ERROR %s: invalid service\n", service);
+       pkt_init(&pkt_out, P_NAK, "ERROR %s: invalid service, add '%s' as argument to amandad\n", service, service);
        goto send_pkt_out;
     }
 
@@ -682,34 +713,26 @@ state_machine(
     state_t curstate;
     pkt_t nak;
 
-#ifdef AMANDAD_DEBUG
-    dbprintf(("%s: state_machine: %p entering\n",
-       debug_prefix_time(NULL), as));
-#endif
+    amandad_debug(1, ("%s: state_machine: %p entering\n",
+                     debug_prefix_time(NULL), as));
     for (;;) {
        curstate = as->state;
-#ifdef AMANDAD_DEBUG
-       dbprintf(("%s: state_machine: %p curstate=%s action=%s\n",
-           debug_prefix_time(NULL), as,
-           state2str(curstate), action2str(action)));
-#endif
+       amandad_debug(1, ("%s: state_machine: %p curstate=%s action=%s\n",
+                         debug_prefix_time(NULL), as,
+                         state2str(curstate), action2str(action)));
        retaction = (*curstate)(as, action, pkt);
-#ifdef AMANDAD_DEBUG
-       dbprintf(("%s: state_machine: %p curstate=%s returned %s (nextstate=%s)\n",
-           debug_prefix_time(NULL),
-           as, state2str(curstate), action2str(retaction),
-           state2str(as->state)));
-#endif
+       amandad_debug(1, ("%s: state_machine: %p curstate=%s returned %s (nextstate=%s)\n",
+                         debug_prefix_time(NULL),
+                         as, state2str(curstate), action2str(retaction),
+                         state2str(as->state)));
 
        switch (retaction) {
        /*
         * State has queued up and is now blocking on input.
         */
        case A_PENDING:
-#ifdef AMANDAD_DEBUG
-           dbprintf(("%s: state_machine: %p leaving (A_PENDING)\n",
-               debug_prefix_time(NULL), as));
-#endif
+           amandad_debug(1, ("%s: state_machine: %p leaving (A_PENDING)\n",
+                             debug_prefix_time(NULL), as));
            return;
 
        /*
@@ -731,10 +754,8 @@ state_machine(
            do_sendpkt(as->security_handle, &nak);
            amfree(nak.body);
            security_recvpkt(as->security_handle, protocol_recv, as, -1);
-#ifdef AMANDAD_DEBUG
-           dbprintf(("%s: state_machine: %p leaving (A_SENDNAK)\n",
-               debug_prefix_time(NULL), as));
-#endif
+           amandad_debug(1, ("%s: state_machine: %p leaving (A_SENDNAK)\n",
+                             debug_prefix_time(NULL), as));
            return;
 
        /*
@@ -742,10 +763,8 @@ state_machine(
         */
        case A_FINISH:
            service_delete(as);
-#ifdef AMANDAD_DEBUG
-           dbprintf(("%s: state_machine: %p leaving (A_FINISH)\n",
-               debug_prefix_time(NULL), as));
-#endif
+           amandad_debug(1, ("%s: state_machine: %p leaving (A_FINISH)\n",
+                             debug_prefix_time(NULL), as));
            return;
 
        default:
@@ -980,7 +999,7 @@ error:
      * state.
      */
     as->state = s_sendrep;
-    as->repretry = MAX_REP_RETRIES;
+    as->repretry = getconf_int(CNF_REP_TRIES);
     amfree(repbuf);
     return (A_CONTINUE);
 }
@@ -1031,10 +1050,8 @@ s_ackwait(
            debug_prefix_time(NULL)));
        return (A_FINISH);
     }
-#ifdef AMANDAD_DEBUG
-    dbprintf(("%s: received ACK, now opening streams\n",
-       debug_prefix_time(NULL)));
-#endif
+    amandad_debug(1, ("%s: received ACK, now opening streams\n",
+                     debug_prefix_time(NULL)));
 
     assert(action == A_RECVPKT);
 
@@ -1055,11 +1072,12 @@ s_ackwait(
        if (dh->netfd == NULL)
            continue;
        if (security_stream_accept(dh->netfd) < 0) {
-           dbprintf(("%s: stream %ld accept failed: %s\n",
+           dbprintf(("%s: stream %td accept failed: %s\n",
                debug_prefix_time(NULL),
                dh - &as->data[0], security_geterror(as->security_handle)));
            security_stream_close(dh->netfd);
            dh->netfd = NULL;
+           continue;
        }
        /* setup an event for reads from it */
        dh->ev_read = event_register((event_id_t)dh->fd_read, EV_READFD,
@@ -1091,10 +1109,8 @@ s_ackwait(
      * If no pipes are open, then we're done.  Otherwise, just start running.
      * The event handlers on all of the pipes will take it from here.
      */
-#ifdef AMANDAD_DEBUG
-    dbprintf(("%s: at end of s_ackwait, npipes is %d\n",
-       debug_prefix_time(NULL), npipes));
-#endif
+    amandad_debug(1, ("%s: at end of s_ackwait, npipes is %d\n",
+                     debug_prefix_time(NULL), npipes));
     if (npipes == 0)
        return (A_FINISH);
     else {
@@ -1493,10 +1509,9 @@ service_delete(
     int i;
     struct datafd_handle *dh;
 
-#ifdef AMANDAD_DEBUG
-       dbprintf(("%s: closing service: %s\n",
-           debug_prefix_time(NULL), (as->cmd)?as->cmd:"??UNKONWN??"));
-#endif
+    amandad_debug(1, ("%s: closing service: %s\n",
+                     debug_prefix_time(NULL),
+                     (as->cmd)?as->cmd:"??UNKONWN??"));
 
     assert(as != NULL);
 
@@ -1597,7 +1612,6 @@ do_sendpkt(
        return 1;
 }
 
-#ifdef AMANDAD_DEBUG
 /*
  * Convert a state into a string
  */
@@ -1654,4 +1668,3 @@ action2str(
            return (actions[i].str);
     return ("UNKNOWN ACTION");
 }
-#endif /* AMANDAD_DEBUG */
index aef28525b2de1d21e6d48fb7b35249c711a12a78..9ce31fdebddaeb3dc5ac68228b3befff300a1d63 100644 (file)
@@ -66,14 +66,14 @@ parse_g_options(
        if(strncmp(tok,"features=", 9) == 0) {
            if(g_options->features != NULL) {
                dbprintf(("%s: multiple features option\n", 
-                         debug_prefix(NULL)));
+                         debug_prefix_time(NULL)));
                if(verbose) {
                    printf("ERROR [multiple features option]\n");
                }
            }
            if((g_options->features = am_string_to_feature(tok+9)) == NULL) {
                dbprintf(("%s: bad features value \"%s\n",
-                         debug_prefix(NULL), tok+10));
+                         debug_prefix_time(NULL), tok+10));
                if(verbose) {
                    printf("ERROR [bad features value \"%s\"]\n", tok+10);
                }
@@ -82,7 +82,7 @@ parse_g_options(
        else if(strncmp(tok,"hostname=", 9) == 0) {
            if(g_options->hostname != NULL) {
                dbprintf(("%s: multiple hostname option\n", 
-                         debug_prefix(NULL)));
+                         debug_prefix_time(NULL)));
                if(verbose) {
                    printf("ERROR [multiple hostname option]\n");
                }
@@ -92,7 +92,7 @@ parse_g_options(
        else if(strncmp(tok,"auth=", 5) == 0) {
            if(g_options->auth != NULL) {
                dbprintf(("%s: multiple auth option\n", 
-                         debug_prefix(NULL)));
+                         debug_prefix_time(NULL)));
                if(verbose) {
                    printf("ERROR [multiple auth option]\n");
                }
@@ -102,7 +102,7 @@ parse_g_options(
        else if(strncmp(tok,"maxdumps=", 9) == 0) {
            if(g_options->maxdumps != 0) {
                dbprintf(("%s: multiple maxdumps option\n", 
-                         debug_prefix(NULL)));
+                         debug_prefix_time(NULL)));
                if(verbose) {
                    printf("ERROR [multiple maxdumps option]\n");
                }
@@ -116,7 +116,7 @@ parse_g_options(
                }
                else {
                    dbprintf(("%s: bad maxdumps value \"%s\"\n",
-                             debug_prefix(NULL), tok+9));
+                             debug_prefix_time(NULL), tok+9));
                    if(verbose) {
                        printf("ERROR [bad maxdumps value \"%s\"]\n",
                               tok+9);
@@ -125,7 +125,7 @@ parse_g_options(
            }
            else {
                dbprintf(("%s: bad maxdumps value \"%s\"\n",
-                         debug_prefix(NULL), tok+9));
+                         debug_prefix_time(NULL), tok+9));
                if(verbose) {
                    printf("ERROR [bad maxdumps value \"%s\"]\n",
                           tok+9);
@@ -135,7 +135,7 @@ parse_g_options(
        else if(strncmp(tok,"config=", 7) == 0) {
            if(g_options->config != NULL) {
                dbprintf(("%s: multiple config option\n",
-                         debug_prefix(NULL)));
+                         debug_prefix_time(NULL)));
                if(verbose) {
                    printf("ERROR [multiple config option]\n");
                }
@@ -144,7 +144,7 @@ parse_g_options(
            if (strchr(g_options->config, '/')) {
                amfree(g_options->config);
                dbprintf(("%s: invalid character in config option\n",
-                         debug_prefix(NULL)));
+                         debug_prefix_time(NULL)));
                if(verbose) {
                    printf("ERROR [invalid character in config option]\n");
                }
@@ -152,7 +152,7 @@ parse_g_options(
        }
        else {
            dbprintf(("%s: unknown option \"%s\"\n",
-                                  debug_prefix(NULL), tok));
+                                  debug_prefix_time(NULL), tok));
            if(verbose) {
                printf("ERROR [unknown option \"%s\"]\n", tok);
            }
index ca2b1384b021cdfd99ade90951360e938e5754bb..a0c2eda6918db2e468f1b1b1f18ffb396a51ef41 100644 (file)
@@ -45,6 +45,41 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
        $(srcdir)/amcat.awk.in $(srcdir)/amplot.sh.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+       $(top_srcdir)/config/gnulib/absolute-header.m4 \
+       $(top_srcdir)/config/gnulib/alloca.m4 \
+       $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/eoverflow.m4 \
+       $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/getaddrinfo.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-cache.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-common.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-comp.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-tool.m4 \
+       $(top_srcdir)/config/gnulib/inet_ntop.m4 \
+       $(top_srcdir)/config/gnulib/intmax_t.m4 \
+       $(top_srcdir)/config/gnulib/inttypes_h.m4 \
+       $(top_srcdir)/config/gnulib/lib-ld.m4 \
+       $(top_srcdir)/config/gnulib/lib-link.m4 \
+       $(top_srcdir)/config/gnulib/lib-prefix.m4 \
+       $(top_srcdir)/config/gnulib/lock.m4 \
+       $(top_srcdir)/config/gnulib/longdouble.m4 \
+       $(top_srcdir)/config/gnulib/longlong.m4 \
+       $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
+       $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \
+       $(top_srcdir)/config/gnulib/size_max.m4 \
+       $(top_srcdir)/config/gnulib/snprintf.m4 \
+       $(top_srcdir)/config/gnulib/socklen.m4 \
+       $(top_srcdir)/config/gnulib/sockpfaf.m4 \
+       $(top_srcdir)/config/gnulib/stdbool.m4 \
+       $(top_srcdir)/config/gnulib/stdint_h.m4 \
+       $(top_srcdir)/config/gnulib/strdup.m4 \
+       $(top_srcdir)/config/gnulib/string_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
+       $(top_srcdir)/config/gnulib/vasnprintf.m4 \
+       $(top_srcdir)/config/gnulib/visibility.m4 \
+       $(top_srcdir)/config/gnulib/wchar_t.m4 \
+       $(top_srcdir)/config/gnulib/wint_t.m4 \
+       $(top_srcdir)/config/gnulib/xsize.m4 \
        $(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
@@ -65,8 +100,10 @@ am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
 amplotDATA_INSTALL = $(INSTALL_DATA)
 DATA = $(amplot_DATA)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ABSOLUTE_STRING_H = @ABSOLUTE_STRING_H@
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
+ALLOCA_H = @ALLOCA_H@
 AMANDA_DBGDIR = @AMANDA_DBGDIR@
 AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@
 AMANDA_TMPDIR = @AMANDA_TMPDIR@
@@ -81,18 +118,17 @@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@
 AMTAR = @AMTAR@
 AM_CFLAGS = @AM_CFLAGS@
 AR = @AR@
+ARPA_INET_H = @ARPA_INET_H@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
-AWK_VAR_ASSIGNMENT_OPT = @AWK_VAR_ASSIGNMENT_OPT@
 BINARY_OWNER = @BINARY_OWNER@
-BUILD_MAN_PAGES_FALSE = @BUILD_MAN_PAGES_FALSE@
-BUILD_MAN_PAGES_TRUE = @BUILD_MAN_PAGES_TRUE@
 CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
+CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
 CHIO = @CHIO@
 CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
@@ -125,18 +161,40 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
+ENABLE_MANPAGE_BUILD_FALSE = @ENABLE_MANPAGE_BUILD_FALSE@
+ENABLE_MANPAGE_BUILD_TRUE = @ENABLE_MANPAGE_BUILD_TRUE@
+EOVERFLOW = @EOVERFLOW@
+EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@
 EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
+GCC_COMPILER_FALSE = @GCC_COMPILER_FALSE@
+GCC_COMPILER_TRUE = @GCC_COMPILER_TRUE@
 GETCONF = @GETCONF@
+GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@
+GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
 GNUTAR_LISTED_INCREMENTAL_DIRX = @GNUTAR_LISTED_INCREMENTAL_DIRX@
 GREP = @GREP@
 GZIP = @GZIP@
-HAVE_XSLTPROC_FALSE = @HAVE_XSLTPROC_FALSE@
-HAVE_XSLTPROC_TRUE = @HAVE_XSLTPROC_TRUE@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRNDUP = @HAVE_STRNDUP@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE__BOOL = @HAVE__BOOL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -145,22 +203,31 @@ LDFLAGS = @LDFLAGS@
 LEX = @LEX@
 LEXLIB = @LEXLIB@
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
+LIBPTH = @LIBPTH@
+LIBPTH_PREFIX = @LIBPTH_PREFIX@
 LIBS = @LIBS@
+LIBTHREAD = @LIBTHREAD@
 LIBTOOL = @LIBTOOL@
 LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LL_FMT = @LL_FMT@
 LL_RFMT = @LL_RFMT@
 LN_S = @LN_S@
 LTALLOCA = @LTALLOCA@
+LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
 LTLIBOBJS = @LTLIBOBJS@
+LTLIBPTH = @LTLIBPTH@
+LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
 MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@
 MCUTIL = @MCUTIL@
+MKDIR_P = @MKDIR_P@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
+NETINET_IN_H = @NETINET_IN_H@
 OBJEXT = @OBJEXT@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -174,6 +241,9 @@ PERL = @PERL@
 PRINT = @PRINT@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
+REPLACE_STRCASECMP = @REPLACE_STRCASECMP@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRSTR = @REPLACE_STRSTR@
 RESTORE = @RESTORE@
 SAMBA_CLIENT = @SAMBA_CLIENT@
 SERVICE_SUFFIX = @SERVICE_SUFFIX@
@@ -182,7 +252,10 @@ SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 SNAPSHOT_STAMP = @SNAPSHOT_STAMP@
 SORT = @SORT@
+SSH = @SSH@
+STDBOOL_H = @STDBOOL_H@
 STRIP = @STRIP@
+SYS_SOCKET_H = @SYS_SOCKET_H@
 USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@
 VDUMP = @VDUMP@
 VERSION = @VERSION@
@@ -221,6 +294,7 @@ WANT_TAPE_TRUE = @WANT_TAPE_TRUE@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
 XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
 YACC = @YACC@
 ac_c = @ac_c@
 ac_ct_AR = @ac_ct_AR@
@@ -247,6 +321,8 @@ build_os = @build_os@
 build_vendor = @build_vendor@
 datadir = @datadir@
 exec_prefix = @exec_prefix@
+gl_LIBOBJS = @gl_LIBOBJS@
+gl_LTLIBOBJS = @gl_LTLIBOBJS@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
index 962c080b29d237b211ac71add22d25971e089568..fa34c4bdc4d4a0a2b0d54be5c9001ec3171beee5 100644 (file)
@@ -92,7 +92,7 @@ BEGIN{
                else if( $2=="flush" && $3=="size" ) {
                        flush_size = $4;
                }
-               else if( $2=="start")       do_start();
+               else if( $2=="start" && $3=="time")       do_start();
                else if( $2=="send-cmd") { 
                        if( $7=="FILE-DUMP"){
                          file_dump++;
@@ -107,6 +107,9 @@ BEGIN{
                else if( $2=="finished-cmd") cmd_fin++;
                else if( $2=="started")      forked++;
                else if( $2=="QUITTING")     do_quit();
+               else if( $2=="find_diskspace:") ; #eat this line
+               else if( $2=="assign_holdingdisk:") ; #eat this line
+               else if( $2=="adjust_diskspace:") ; #eat this line
                else if( $2=="tape" && $3=="size") ; #eat this line
                else if( $2=="dump" && $3=="failed") ; #eat this line
                else if( $2=="taper" && $3=="failed") ; #eat this line
@@ -129,7 +132,7 @@ BEGIN{
                    print fil, "INFO#", $0;
        }
        else if( $1 == "taper:") {
-               if($3 != "label" && $3 != "end" && $2 != "DONE" && $2 != "pid" && $2 != "slot" && $2 != "reader-side:" && $2 != "page" && $2 != "buffer" && $3 != "at")
+               if($3 != "label" && $3 != "end" && $2 != "DONE" && $2 != "pid" && $2 != "slot" && $2 != "reader-side:" && $2 != "page" && $2 != "buffer" && $3 != "at" && $3 != "switching" && $2 != "slot:")
                    print fil, "INFO#", $0;
        }
        else if( $1 == "FLUSH") {
@@ -151,11 +154,16 @@ function do_state(){              # state line is printed out after driver
 # $11 = "writing"/"idle"# $12 = "idle-dumpers:"
 # $13 = #idle          # $14 = "qlen"          # $15 = "tapeq:"
 # $16 = #waiting       # $17 = "runq:"         # $18 = #not started 
-# $19 = "stoppedq:"    # $20 = #stopped
+# $19 = "roomq"                # $20 = #roomq          # $21 = "wakeup:"
+# $22 = #wakeup                # $23 = "driver-idle:"  # $23 = status
 
        cnt++;                                  # number of event
        time = $4/time_scale;
-       unused = (bandw - $7)*bandw_scale+bandw_raise;
+       #Check overflow in driver ouput (big value instead of negative)
+       if($7>0 && $7 < 0x7fffffff)
+               unused = (bandw - $7)*bandw_scale+bandw_raise;
+       else
+               unused = bandw_raise;
        if( unused != unused_old) 
                printf plot_fmt, time, unused_old, time,unused >>"bandw_free";
        unused_old = unused;
@@ -360,6 +368,7 @@ function do_result(){               # process lines driver: result
        else {                                  # something bad from dumper 
                if ($7=="FAILED") { failed++;}
                else if ($7=="TRY-AGAIN"){ try++;}
+               else if ($7=="PORT") ;  # ignore from chunker
                else if ($7=="RQ-MORE-DISK") ;  # FIXME: ignore for now
                else if ($7=="NO-ROOM")  
                  print fil, pr_time($4),"#"  ++no_room, $0;
index 05a6ce8166829f7178d014fbaea949205cbd3270..f771e7456f55d2a3e224ff90b0fa79a8dd660574 100644 (file)
@@ -47,20 +47,82 @@ PATH=$sbindir:$libexecdir:/usr/bin:/bin:/usr/sbin:/sbin:/usr/ucb:$PATH
 export PATH
 
 AWK=@AWK@
-AVARFLAG=@AWK_VAR_ASSIGNMENT_OPT@
 GNUPLOT=@GNUPLOT@
 COMPRESS=@AMPLOT_COMPRESS@
 
+#+
+# Function to:
+#    Simplify gettext usage by allowing printf format
+#    strings for translators, use _() identifier for
+#    xgettext extraction similar to "C" usage and
+#    collapsing "printf `gettext fmt` ...", which is
+#    used everywhere, into one function.
+#-
+_() {
+       fmt="$1"
+       shift
+       printf "$fmt" $*
+}
+
+# Function to check that awk can do command-line variable
+# substitution.  If no, then exit; if yes, set $AVARFLAG
+# to the commandline switch used to introduce a variable. This
+# check used to be performed at build time in configure; it's
+# now performed at runtime.
+test_awk() {
+       local tmpfile result
+       tmpfile=`mktemp /tmp/amplot.XXXXXX`
+       echo 'BEGIN{print i; exit}' > ${tmpfile}
+       result=`$AWK -f ${tmpfile} i=xx | wc -c`
+       if test "$result" -le 1; then
+               result=`$AWK -f ${tmpfile} -v i=xx | wc -c`
+               if test "$result" -le 1; then
+                       echo "$AWK does not support command-line variable assignment; amplot cannot run" >&2
+                       rm -fr $tmpfile
+                       exit 1
+               else
+                       AVARFLAG=-v
+               fi
+       else
+               AVARFLAG=''
+       fi
+
+       rm -fr $tmpfile
+}
+
+# Function to search for gnuplot and ensure it's working.  This
+# first tries the location detected/configured when amanda was built,
+# then tries 'gnuplot', assuming it's in the user's path.  If no
+# working gnuplot executable is found, it exits with an error.  The
+# variable $GNUPLOT is set to the resulting executable.
+find_gnuplot() {
+       if test "x$GNUPLOT" = "x"; then
+               # look for it in the user's PATH
+               GNUPLOT=gnuplot
+       fi
+
+       if ${GNUPLOT} --version 2>/dev/null | grep '^gnuplot' >/dev/null; then
+               : # looks OK
+       else
+               echo "${GNUPLOT} was not found; amplot cannot run"
+               exit 1
+       fi
+}
+
+# check our environment, using functions from above
+test_awk
+find_gnuplot
+
 if [ $# -eq 0 ] ; then
-       echo "Usage: $0 [-c] [-e] [-g] [-l] [-p] [-t hours] <amdump_files.[gz,z,Z]>"
-       echo "amplot generates plot for screen with fixed dimensions"
-       echo "  -c      Compress the input amdump files after plotting"
-       echo "  -e      Extends x (time) axes if needed"
-       echo "  -g      Run gnuplot directly no postscript file generated DEFAULT"
-       echo "  -l      Landscape mode suitable for printing"
-       echo "  -p      Postscript output (color)"
-       echo "  -b      The postscipt will be b/w"
-       echo "  -t T    Set the right edge of the plot to be T hours"
+       _ 'Usage: %s [-c] [-e] [-g] [-l] [-p] [-t hours] <amdump_files.[gz,z,Z]>\n' $0
+       _ '%s generates plot for screen with fixed dimensions\n' $0
+       _ '     -c      Compress the input amdump files after plotting\n'
+       _ '     -e      Extends x (time) axes if needed\n'
+       _ '     -g      Run gnuplot directly no postscript file generated DEFAULT\n'
+       _ '     -l      Landscape mode suitable for printing\n'
+       _ '     -p      Postscript output (color)\n'
+       _ '     -b      The postscipt will be b/w\n'
+       _ '     -t T    Set the right edge of the plot to be T hours\n'
        exit 1 
 fi
 
@@ -85,7 +147,7 @@ while :; do
    -b) bw=1; shift;;
    -t)  shift
        if test "$#" -eq 0; then
-           echo "amplot: no argument for -t option" 1>&2
+           _ '%s: no argument for -t option\n' $0 1>&2
            exit 5
        fi
        maxtime="$1"; shift;;
@@ -93,7 +155,7 @@ while :; do
    esac
 done
 if [ $# -eq 0 ] ; then 
-       echo "amplot: no input files" 1>&2
+       _ '%s: no input files\n' $0 1>&2
        exit 5
 fi
 para=$para"$AVARFLAG maxtime=$maxtime"
@@ -102,14 +164,14 @@ if [ $gnuplot  -eq 1 ] ; then
        my_plot=$my_plot"p"             # use the plot prog that pauses
        plot=" -geometry 800x700+40+0" 
        para=$para"$AVARFLAG gnuplot=1 "
-       echo "Displaying graph on the screen, <CR> for next graph"
+       _ "Displaying graph on the screen, <CR> for next graph"
 
        if [ "$paper" -eq 1 ] ; then
-               echo "amplot: -l requires -p flag at the same time" 1>&2
+               _ '%s: -l requires -p flag at the same time\n' $0 1>&2
                exit 6 
        fi
        if [ "$bw" -eq 1 ] ; then
-               echo "amplot: -b requires -p flag at the same time" 1>&2
+               _ '%s: -b requires -p flag at the same time\n' $0 1>&2
                exit 6 
        fi
 fi
@@ -129,7 +191,7 @@ do
        if [ -f "$f" ] ; then           # found file 
                 disp=`$AWK -f $libexecdir/amcat.awk $AVARFLAG f="$f"`
                if [ -z "$disp" ] ; then 
-                       echo "Do not know how to [gz|z]cat this file"
+                       _ 'Do not know how to [gz|z]cat this file\n'
                else
                        /bin/rm -f $tmp_files 
                        $disp "$f" | $AWK -f $libexecdir/amplot.awk $para
@@ -139,7 +201,7 @@ do
                        fi
                fi
        else                            # check if file has been compressed
-               echo "No such file $i or $i.*[zZ]"
+               _ 'No such file %s or %s\n' "$i" "$i.*[zZ]"
        fi
 done
 
@@ -147,7 +209,7 @@ done
 
 if [ "$list" != "" ] ; then            # now compress the files we worked on
 # comment out next line if you do not want compression at the end
-       echo "Compressing $list"
+       _ 'Compressing %s\n' "$list"
        $COMPRESS $list
 fi
 exit 0
diff --git a/autogen b/autogen
index 2da35923b644bb8df27e54dd38c7fb15c3c6d628..e15c807cb6ce84813a00429034d6c4d15981d557 100755 (executable)
--- a/autogen
+++ b/autogen
@@ -8,12 +8,12 @@ cd `dirname $0`
 touch config/config.h.in
 
 if test x`ls -1t acinclude.m4 2>/dev/null \
-           config/acinclude.m4i config/libtool.m4i |
+           config/gnulib.m4i config/acinclude.m4i config/libtool.m4i |
          sed 1q` != x"acinclude.m4"; then
     rm -f acinclude.m4
-    cat config/acinclude.m4i config/libtool.m4i > acinclude.m4
+    # keep libtool.m4i first here, as it has a "serial number" comment that it wants
+    # first in the file
+    cat config/libtool.m4i config/gnulib.m4i config/acinclude.m4i > acinclude.m4
 fi
 
-autoreconf --warning=syntax --force ${1+"$@"}
-
-exit 0
+autoreconf --warning=syntax --warning=no-portability --force ${1+"$@"} || exit 1
index 2471aa25c22da162a6166d5cdeae53c5e353f191..76328451193a830dfd94a398352539c22c891198 100644 (file)
@@ -3,7 +3,8 @@
 INCLUDES =     -I$(top_builddir)/common-src \
                -I$(top_srcdir)/common-src   \
                -I$(top_srcdir)/server-src   \
-               -I$(top_srcdir)/tape-src
+               -I$(top_srcdir)/tape-src     \
+               -I$(top_srcdir)/gnulib
 
 LINT=@AMLINT@
 LINTFLAGS=@AMLINTFLAGS@
@@ -25,7 +26,7 @@ libexec_SCRIPTS =     chg-manual      chg-multi       chg-mtx         \
                        chg-rth         chg-chs         chg-chio        \
                        chg-zd-mtx      chg-juke        chg-rait        \
                        chg-null        chg-mcutil      chg-disk        \
-                       chg-iomega
+                       chg-iomega  chg-lib.sh
 
 CLEANFILES = $(libexec_SCRIPTS)
 
@@ -40,6 +41,7 @@ LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
        ../server-src/libamserver.$(LIB_EXTENSION) \
        ../tape-src/libamtape.$(LIB_EXTENSION) \
        ../common-src/libamanda.$(LIB_EXTENSION)   \
+       ../gnulib/libgnu.$(LIB_EXTENSION) \
        $(READLINE_LIBS)
 
 SUFFIXES =             .pl .sh
index b547a30469a3d1ae9cb33bf555fce361ba46c585..a1617971abd79e54e5b5d9daadd7b021758869c7 100644 (file)
@@ -46,13 +46,48 @@ subdir = changer-src
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
        $(srcdir)/chg-chio.pl.in $(srcdir)/chg-chs.sh.in \
        $(srcdir)/chg-disk.sh.in $(srcdir)/chg-iomega.pl.in \
-       $(srcdir)/chg-juke.sh.in $(srcdir)/chg-manual.sh.in \
-       $(srcdir)/chg-mcutil.sh.in $(srcdir)/chg-mtx.sh.in \
-       $(srcdir)/chg-multi.sh.in $(srcdir)/chg-null.sh.in \
-       $(srcdir)/chg-rait.sh.in $(srcdir)/chg-rth.pl.in \
-       $(srcdir)/chg-zd-mtx.sh.in
+       $(srcdir)/chg-juke.sh.in $(srcdir)/chg-lib.sh.in \
+       $(srcdir)/chg-manual.sh.in $(srcdir)/chg-mcutil.sh.in \
+       $(srcdir)/chg-mtx.sh.in $(srcdir)/chg-multi.sh.in \
+       $(srcdir)/chg-null.sh.in $(srcdir)/chg-rait.sh.in \
+       $(srcdir)/chg-rth.pl.in $(srcdir)/chg-zd-mtx.sh.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+       $(top_srcdir)/config/gnulib/absolute-header.m4 \
+       $(top_srcdir)/config/gnulib/alloca.m4 \
+       $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/eoverflow.m4 \
+       $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/getaddrinfo.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-cache.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-common.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-comp.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-tool.m4 \
+       $(top_srcdir)/config/gnulib/inet_ntop.m4 \
+       $(top_srcdir)/config/gnulib/intmax_t.m4 \
+       $(top_srcdir)/config/gnulib/inttypes_h.m4 \
+       $(top_srcdir)/config/gnulib/lib-ld.m4 \
+       $(top_srcdir)/config/gnulib/lib-link.m4 \
+       $(top_srcdir)/config/gnulib/lib-prefix.m4 \
+       $(top_srcdir)/config/gnulib/lock.m4 \
+       $(top_srcdir)/config/gnulib/longdouble.m4 \
+       $(top_srcdir)/config/gnulib/longlong.m4 \
+       $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
+       $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \
+       $(top_srcdir)/config/gnulib/size_max.m4 \
+       $(top_srcdir)/config/gnulib/snprintf.m4 \
+       $(top_srcdir)/config/gnulib/socklen.m4 \
+       $(top_srcdir)/config/gnulib/sockpfaf.m4 \
+       $(top_srcdir)/config/gnulib/stdbool.m4 \
+       $(top_srcdir)/config/gnulib/stdint_h.m4 \
+       $(top_srcdir)/config/gnulib/strdup.m4 \
+       $(top_srcdir)/config/gnulib/string_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
+       $(top_srcdir)/config/gnulib/vasnprintf.m4 \
+       $(top_srcdir)/config/gnulib/visibility.m4 \
+       $(top_srcdir)/config/gnulib/wchar_t.m4 \
+       $(top_srcdir)/config/gnulib/wint_t.m4 \
+       $(top_srcdir)/config/gnulib/xsize.m4 \
        $(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
@@ -60,7 +95,7 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config/config.h
 CONFIG_CLEAN_FILES = chg-manual.sh chg-multi.sh chg-mtx.sh chg-chs.sh \
        chg-rth.pl chg-chio.pl chg-zd-mtx.sh chg-juke.sh chg-rait.sh \
-       chg-null.sh chg-mcutil.sh chg-disk.sh chg-iomega.pl
+       chg-null.sh chg-mcutil.sh chg-disk.sh chg-iomega.pl chg-lib.sh
 @WANT_CHIO_SCSI_TRUE@am__EXEEXT_1 = chg-scsi-chio$(EXEEXT)
 @WANT_CHG_SCSI_TRUE@am__EXEEXT_2 = chg-scsi$(EXEEXT)
 am__installdirs = "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(libexecdir)"
@@ -78,7 +113,8 @@ am__DEPENDENCIES_1 =
 chg_scsi_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
        ../server-src/libamserver.$(LIB_EXTENSION) \
        ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
+       ../common-src/libamanda.$(LIB_EXTENSION) \
+       ../gnulib/libgnu.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
 am__objects_2 = chg-scsi-chio.$(OBJEXT) scsi-hpux.$(OBJEXT) \
        scsi-chio.$(OBJEXT)
 am_chg_scsi_chio_OBJECTS = $(am__objects_2)
@@ -87,7 +123,8 @@ chg_scsi_chio_LDADD = $(LDADD)
 chg_scsi_chio_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
        ../server-src/libamserver.$(LIB_EXTENSION) \
        ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
+       ../common-src/libamanda.$(LIB_EXTENSION) \
+       ../gnulib/libgnu.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
 libexecSCRIPT_INSTALL = $(INSTALL_SCRIPT)
 SCRIPTS = $(libexec_SCRIPTS)
 DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/config
@@ -106,8 +143,10 @@ DIST_SOURCES = $(chg_scsi_SOURCES) $(chg_scsi_chio_SOURCES)
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ABSOLUTE_STRING_H = @ABSOLUTE_STRING_H@
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
+ALLOCA_H = @ALLOCA_H@
 AMANDA_DBGDIR = @AMANDA_DBGDIR@
 AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@
 AMANDA_TMPDIR = @AMANDA_TMPDIR@
@@ -122,18 +161,17 @@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@
 AMTAR = @AMTAR@
 AM_CFLAGS = @AM_CFLAGS@
 AR = @AR@
+ARPA_INET_H = @ARPA_INET_H@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
-AWK_VAR_ASSIGNMENT_OPT = @AWK_VAR_ASSIGNMENT_OPT@
 BINARY_OWNER = @BINARY_OWNER@
-BUILD_MAN_PAGES_FALSE = @BUILD_MAN_PAGES_FALSE@
-BUILD_MAN_PAGES_TRUE = @BUILD_MAN_PAGES_TRUE@
 CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
+CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
 CHIO = @CHIO@
 CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
@@ -166,18 +204,40 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
+ENABLE_MANPAGE_BUILD_FALSE = @ENABLE_MANPAGE_BUILD_FALSE@
+ENABLE_MANPAGE_BUILD_TRUE = @ENABLE_MANPAGE_BUILD_TRUE@
+EOVERFLOW = @EOVERFLOW@
+EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@
 EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
+GCC_COMPILER_FALSE = @GCC_COMPILER_FALSE@
+GCC_COMPILER_TRUE = @GCC_COMPILER_TRUE@
 GETCONF = @GETCONF@
+GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@
+GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
 GNUTAR_LISTED_INCREMENTAL_DIRX = @GNUTAR_LISTED_INCREMENTAL_DIRX@
 GREP = @GREP@
 GZIP = @GZIP@
-HAVE_XSLTPROC_FALSE = @HAVE_XSLTPROC_FALSE@
-HAVE_XSLTPROC_TRUE = @HAVE_XSLTPROC_TRUE@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRNDUP = @HAVE_STRNDUP@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE__BOOL = @HAVE__BOOL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -186,22 +246,31 @@ LDFLAGS = @LDFLAGS@
 LEX = @LEX@
 LEXLIB = @LEXLIB@
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
+LIBPTH = @LIBPTH@
+LIBPTH_PREFIX = @LIBPTH_PREFIX@
 LIBS = @LIBS@
+LIBTHREAD = @LIBTHREAD@
 LIBTOOL = @LIBTOOL@
 LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LL_FMT = @LL_FMT@
 LL_RFMT = @LL_RFMT@
 LN_S = @LN_S@
 LTALLOCA = @LTALLOCA@
+LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
 LTLIBOBJS = @LTLIBOBJS@
+LTLIBPTH = @LTLIBPTH@
+LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
 MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@
 MCUTIL = @MCUTIL@
+MKDIR_P = @MKDIR_P@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
+NETINET_IN_H = @NETINET_IN_H@
 OBJEXT = @OBJEXT@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -215,6 +284,9 @@ PERL = @PERL@
 PRINT = @PRINT@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
+REPLACE_STRCASECMP = @REPLACE_STRCASECMP@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRSTR = @REPLACE_STRSTR@
 RESTORE = @RESTORE@
 SAMBA_CLIENT = @SAMBA_CLIENT@
 SERVICE_SUFFIX = @SERVICE_SUFFIX@
@@ -223,7 +295,10 @@ SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 SNAPSHOT_STAMP = @SNAPSHOT_STAMP@
 SORT = @SORT@
+SSH = @SSH@
+STDBOOL_H = @STDBOOL_H@
 STRIP = @STRIP@
+SYS_SOCKET_H = @SYS_SOCKET_H@
 USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@
 VDUMP = @VDUMP@
 VERSION = @VERSION@
@@ -262,6 +337,7 @@ WANT_TAPE_TRUE = @WANT_TAPE_TRUE@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
 XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
 YACC = @YACC@
 ac_c = @ac_c@
 ac_ct_AR = @ac_ct_AR@
@@ -288,6 +364,8 @@ build_os = @build_os@
 build_vendor = @build_vendor@
 datadir = @datadir@
 exec_prefix = @exec_prefix@
+gl_LIBOBJS = @gl_LIBOBJS@
+gl_LTLIBOBJS = @gl_LTLIBOBJS@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -315,7 +393,8 @@ target_vendor = @target_vendor@
 INCLUDES = -I$(top_builddir)/common-src \
                -I$(top_srcdir)/common-src   \
                -I$(top_srcdir)/server-src   \
-               -I$(top_srcdir)/tape-src
+               -I$(top_srcdir)/tape-src     \
+               -I$(top_srcdir)/gnulib
 
 LINT = @AMLINT@
 LINTFLAGS = @AMLINTFLAGS@
@@ -326,7 +405,7 @@ libexec_SCRIPTS = chg-manual        chg-multi       chg-mtx         \
                        chg-rth         chg-chs         chg-chio        \
                        chg-zd-mtx      chg-juke        chg-rait        \
                        chg-null        chg-mcutil      chg-disk        \
-                       chg-iomega
+                       chg-iomega  chg-lib.sh
 
 CLEANFILES = $(libexec_SCRIPTS)
 
@@ -340,6 +419,7 @@ LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
        ../server-src/libamserver.$(LIB_EXTENSION) \
        ../tape-src/libamtape.$(LIB_EXTENSION) \
        ../common-src/libamanda.$(LIB_EXTENSION)   \
+       ../gnulib/libgnu.$(LIB_EXTENSION) \
        $(READLINE_LIBS)
 
 SUFFIXES = .pl .sh
@@ -410,6 +490,8 @@ chg-disk.sh: $(top_builddir)/config.status $(srcdir)/chg-disk.sh.in
        cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
 chg-iomega.pl: $(top_builddir)/config.status $(srcdir)/chg-iomega.pl.in
        cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+chg-lib.sh: $(top_builddir)/config.status $(srcdir)/chg-lib.sh.in
+       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
 install-libexecPROGRAMS: $(libexec_PROGRAMS)
        @$(NORMAL_INSTALL)
        test -z "$(libexecdir)" || $(mkdir_p) "$(DESTDIR)$(libexecdir)"
index 79c7a393b05e237f464854cdc92b97b58077ad5a..56bb35875f2b7a4d15fe0ad822235780abbbe331 100644 (file)
@@ -286,6 +286,16 @@ sub Load {
                print "$progname: cannot '@CHIO@ -f $changerDevice move' tape $tape into drive 0\n";
                exit(2);
        }
+
+       # wait for tape to load
+       $count = 1800;
+       while ( $count > 0 &&
+               system("$MT $MTF $tapeDevice status > /dev/null 2>&1" ) ) {
+               print LOG &do_time(), ": waiting for tape to load\n";
+               sleep 30;
+               $count -= 30;
+       }
+
        print LOG &do_time(), ": leave: Load\n";
 }
 
@@ -307,8 +317,8 @@ sub Unload {
        # firmware rev but for now it's safest to just explicitly eject
        # the tape before moving the cartridge.
        #
-       if ( system ("@MT@ @MT_FILE_FLAG@ $tapeDevice offline") ) {
-               print "$progname: Warning, failed to eject the tape with '@MT@ @MT_FILE_FLAG@ $tapeDevice offline'\n";
+       if ( system ("$MT $MTF $tapeDevice offline") ) {
+               print "$progname: Warning, failed to eject the tape with '$MT $MTF $tapeDevice offline'\n";
                # NB: not fatal; let chio try it's thing
        }
 
@@ -375,7 +385,7 @@ if (-x "$sbindir/ammt$SUF") {
        print "<none> mt program not found\n";
        exit(1);
 }
-print LOG &do_time(), "MT -> $MT $MTF\n";
+print LOG &do_time(), "MT -> $MT $MTF\n";
 
 system ("$MT $MTF $tapeDevice rewind")
        unless $currentTape == 0;
index c4f59f700ddf86df8b17f3bdb21c956f203aac42..5ac3783e110a3da2e0c70f609bbcac47097f2639 100644 (file)
@@ -83,7 +83,7 @@ MYNAME=$0
 
 TAPE=`amgetconf$SUF tapedev`
 if test X"$TAPE" == X""; then
-    echo "<none> tapedev not specified in amanda.conf." 1>&2
+    echo "<none> tapedev not specified in amanda.conf."
     exit 2
 fi
 SLOTDIR=`echo $TAPE | sed 's/^file://'`
@@ -99,11 +99,11 @@ isinteger() {
 
 # Need rwx access to the virtual tape itself.
 if ! test -d $SLOTDIR; then
-    echo "Virtual-tape directory $SLOTDIR does not exist." 1>&2
+    echo "<none> Virtual-tape directory $SLOTDIR does not exist."
     exit 2
 fi
 if ! test -w $SLOTDIR; then
-    echo "Virtual-tape directory $SLOTDIR is not writable." 1>&2
+    echo "<none> Virtual-tape directory $SLOTDIR is not writable."
     exit 2
 fi
 
@@ -120,21 +120,21 @@ fi
 
 CFDir=`dirname ${CHANGERFILE}`
 [ -d ${CFDir} -a -r ${CFDir} -a -w ${CFDir} -a -x ${CFDir} ] ||
-       { echo "$MYNAME: need 'rwx' access to '$CFDir'" 1>&2 ; exit 2 ; }
+       { echo "<none> $MYNAME: need 'rwx' access to '$CFDir'"; exit 2 ; }
 
 # check or create changer metadata files
 ACCESSFILE=$CHANGERFILE-access
 [ -f $ACCESSFILE -a -r $ACCESSFILE -a -w $ACCESSFILE ] ||
        echo 0 > $ACCESSFILE ||
-       { echo "$MYNAME: could not access or create '$ACCESSFILE'" 1>&2 ; exit 2 ; }
+       { echo "<none> $MYNAME: could not access or create '$ACCESSFILE'" ; exit 2 ; }
 CLEANFILE=$CHANGERFILE-clean
 [ -f $CLEANFILE -a -r $CLEANFILE -a -w $CLEANFILE ] ||
        echo 0 > $CLEANFILE ||
-       { echo "$MYNAME: could not access or create '$CLEANFILE'" 1>&2 ; exit 2 ; }
+       { echo "<none> $MYNAME: could not access or create '$CLEANFILE'" ; exit 2 ; }
 SLOTFILE=$CHANGERFILE-slot
 [ -f $SLOTFILE -a -r $SLOTFILE -a -w $SLOTFILE ] ||
        echo 0 > $SLOTFILE ||
-       { echo "$MYNAME: could not access or create '$SLOTFILE'" 1>&2 ; exit 2 ; }
+       { echo "<none> $MYNAME: could not access or create '$SLOTFILE'" ; exit 2 ; }
 
 # read and check metadata
 ACCESSCOUNT=`cat $ACCESSFILE`
@@ -310,7 +310,7 @@ while [ $# -ge 1 ];do
             eject
             ;;
     *)
-       echo "Unknown option $1"
+       echo "<none> Unknown option $1"
        exit 2
        ;;
   esac
diff --git a/changer-src/chg-lib.sh.in b/changer-src/chg-lib.sh.in
new file mode 100644 (file)
index 0000000..2df29bf
--- /dev/null
@@ -0,0 +1,69 @@
+################################################################################
+# You may want to customize these values
+################################################################################
+
+# These are the defaults discovered by configure when Amanda was installed.
+# They can be overridden here, or by by 'mt_binary' and 'mtx_binary', 
+# respectively, in the changerfile (currently only for chg-zd-mtx.sh and
+# chg-manual.sh).
+
+MT=@MT@
+MTX=@MTX@
+
+# This is the flag used to specify a device filename to 'mt', usually '-f'
+MTF=@MT_FILE_FLAG@
+
+################################################################################
+# No user-level customization should be required beyond this point.
+################################################################################
+
+####
+# Set up paths, including PATH for finding amanda executables
+
+PATH="$PATH:@sbindir@:@libexecdir@"
+prefix="@prefix@"
+exec_prefix="@exec_prefix@"
+sbindir="@sbindir@"
+libexecdir="@libexecdir@"
+
+####
+# Gettext
+
+#+
+# Function to:
+#    Simplify gettext usage by allowing printf format
+#    strings for translators, use _() identifier for
+#    xgettext extraction similar to "C" usage and
+#    collapsing "printf `gettext fmt` ...", which is
+#    used everywhere, into one function.
+#-
+_() {
+       fmt=`gettext -d amanda "$1"`
+       shift
+       printf "$fmt" $*
+}
+
+####
+# Eponymous functions to access various amanda apps
+
+if test "@USE_VERSION_SUFFIXES@" = "yes"; then
+    amgetconf() {
+        "${sbindir}/amgetconf-@VERSION@" "${@}"
+    }
+    ammt() {
+        "${sbindir}/ammt-@VERSION@" "${@}"
+    }
+    amdd() {
+        "${sbindir}/amdd-@VERSION@" "${@}"
+    }
+else
+    amgetconf() {
+        "${sbindir}/amgetconf" "${@}"
+    }
+    amdd() {
+        "${sbindir}/amdd" "${@}"
+    }
+    amdd() {
+        "${sbindir}/amdd" "${@}"
+    }
+fi
index 205decfae4c2f2742e3ca7464fe5c5a05f65bd3e..1c45651688456ad18e40e9b1574dc9d4b095317c 100644 (file)
@@ -15,6 +15,19 @@ libexecdir=@libexecdir@
 PATH=$sbindir:$libexecdir:/usr/bin:/bin:/usr/sbin:/sbin:/usr/ucb
 export PATH
 
+#
+#      Changer config file (changerfile)
+#
+#      resend_mail=900         # 15 minutes
+#      timeout_mail=604800     # 7 days
+#      request="tty"           # Use the tty to ask the user to change tape.
+#                              # Can't be use by cron
+#      request="email"         # Send an email to ask the user to change tape.
+#      request="tty_email"     # Use the tty if it exist or send an email.
+#                      #Default is "tty_email"
+#
+#
+
 if [ -d "@AMANDA_DBGDIR@" ]; then
        logfile=@AMANDA_DBGDIR@/changer.debug
 else
@@ -74,9 +87,19 @@ ORG=`amgetconf$SUF ORG`
 
 firstslot=1
 lastslot=99
+resend_mail=900                # 15 minutes
+timeout_mail=604800    # 7 days
 
 changerfile=`amgetconf$SUF changerfile`
 
+conf_match=`expr "$changerfile" : .\*\.conf\$`
+if [ $conf_match -ge 6 ]; then
+        configfile=$changerfile
+        changerfile=`echo $changerfile | sed 's/.conf$//g'`
+else
+        configfile=$changerfile.conf
+fi
+
 cleanfile=$changerfile-clean
 accessfile=$changerfile-access
 slotfile=$changerfile-slot
@@ -87,48 +110,75 @@ cleancount=`cat $cleanfile`
 accesscount=`cat $accessfile`
 slot=`cat $slotfile`
 
-request() {
-       echo "insert tape into slot $1 and press return" >/dev/tty
-       read ANSWER </dev/tty
+request_tty() {
+       if > /dev/tty; then
+               echo -n "Insert tape into slot $1 and press return" > /dev/tty
+               read ANSWER < /dev/tty
+       else
+               echo "no /dev/tty to ask to change tape"
+               exit 1
+       fi
 }
 
+
 ###
 # If $changerfile exists, source it into this script.  One reason is to
 # override the request() function above which gets called to request
 # that a tape be mounted.  Here is an alternate versions of request()
 # that does things more asynchronous:
 #
-#  request() {
-#      # Send E-mail about the mount request and wait for the drive
-#      # to go ready by checking the status once a minute.  Repeat
-#       # the E-mail once an hour in case it gets lost.
-#      timeout=0
-#      while true;do
-#          if [ $timeout -le 0 ]; then
-#              echo "insert Amanda tape into slot $1 ($tape)" \
-#                | $MAILER -s "$ORG AMANDA TAPE MOUNT REQUEST FOR SLOT $1" \
-#                        $REPORTTO
-#              timeout=`expr 60 \* 60`
-#          fi
-#          echo "     -> rewind $tape" >> $logfile
-#          $MT $MTF $tape rewind >> $logfile 2>&1
-#          echo "     -> status $tape" >> $logfile
-#          used=`$MT $MTF $tape status 2>&1 | tee -a $logfile | $EGREP "$ONLINEREGEX"`
-#          echo "     -> loaded <$used>" >> $logfile
-#          if [ ! -z "$used" ];then
-#              break
-#          fi
-#          sleep 60
-#          timeout=`expr $timeout - 60`
-#      done
-#  }
-#
-# Instead of sending mail, you might write the message to /dev/console
-# or use "logger" to send it via syslog, etc.
-###
+request_email() {
+       # Send E-mail about the mount request and wait for the drive
+       # to go ready by checking the status once a minute.  Repeat
+       # the E-mail once an hour in case it gets lost.
+       timeout=0
+       gtimeout=$timeout_mail
+       while true;do
+               if [ $gtimeout -le 0 ]; then
+                       echo "timeout waiting for tape online"
+                       exit 1;
+               fi
+               if [ $timeout -le 0 ]; then
+                       msg="insert Amanda tape into slot $1 ($tape)"
+                       subject="$ORG AMANDA TAPE MOUNT REQUEST FOR SLOT $1"
+                       echo "$msg" | $MAILER -s "$subject" $REPORTTO
+                       timeout=$resend_mail
+               fi
+               echo "     -> rewind $tape" >> $logfile
+               $MT $MTF $tape rewind >> $logfile 2>&1
+               echo "     -> status $tape" >> $logfile
+               used=`$MT $MTF $tape status 2>&1 | tee -a $logfile | $EGREP "$ONLINEREGEX"`
+               echo "     -> loaded <$used>" >> $logfile
+               if [ ! -z "$used" ];then
+               break
+               fi
+               sleep 60
+               timeout=`expr $timeout - 60`
+               gtimeout=`expr $gtimeout - 60`
+       done
+}
+request_tty_email() {
+       if > /dev/tty; then
+               echo -n "Insert tape into slot $1 and press return" > /dev/tty
+               read ANSWER < /dev/tty
+       else
+               request_email "$1"
+       fi
+}
+
+request() {
+       if [ X"$request" = X"tty" ]; then
+               request_tty "$1"
+       else if [ X"$request" = X"email" ]; then
+               request_email "$1"
+       else
+               request_tty_email "$1"
+       fi
+       fi
+}
 
-if [ -f $changerfile ]; then
-       . $changerfile
+if [ -f $configfile ]; then
+       . $configfile
 fi
 
 #
@@ -142,7 +192,6 @@ eject() {
        if [ ! -z "$used" ];then
                echo "     -> offline $tape" >> $logfile
                $MT $MTF $tape offline >> $logfile 2>&1
-               echo 0 > $slotfile
                answer="$slot $tape"
                code=0
        else
index 9ac098ee4afa45b4af6265a3a5a3242c20633df0..0eea3e9984125b7bc8497d2af7d655178039f44e 100644 (file)
@@ -46,7 +46,14 @@ else
        logfile=/dev/null
 fi
 
-echo Args "->" "$@" >> $logfile
+# support simultaneous development with and without gettext
+_() {
+        fmt="$1"
+        shift
+        printf "$fmt" $*
+}
+
+echo `_ "arguments ->"` "$@" >> $logfile
 
 USE_VERSION_SUFFIXES="@USE_VERSION_SUFFIXES@"
 if test "$USE_VERSION_SUFFIXES" = "yes"; then
@@ -64,13 +71,12 @@ elif [ -x "@MT@" ]; then
        MT=@MT@
        MTF=@MT_FILE_FLAG@
 else
-       answer="<none> $myname: mt program not found"
-       code=1
-       echo "Exit -> $answer" >> $logfile
-       echo "$answer"
-       exit $code
+       answer=`_ '<none> %s: mt program not found' "$myname"`
+       echo `_ 'Exit ->'` $answer >> $logfile
+       echo $answer
+       exit 1
 fi
-echo MT "->" $MT $MTF >> $logfile
+echo "MT ->" $MT $MTF >> $logfile
 
 EXPR=expr
 # EXPR=/usr/local/bin/expr # in case you need a more powerful expr...
@@ -78,85 +84,78 @@ EXPR=expr
 # read in some config parameters
 
 if [ ! -f "$ourconf" ]; then
-       answer="<none> $pname: $ourconf does not exist"
-       code=2
-       echo "Exit -> $answer" >> $logfile
-       echo "$answer"
-       exit $code
+       answer=`_ '<none> %s: %s does not exist' "$pname" "$ourconf"`
+       echo `_ 'Exit ->'` $answer >> $logfile
+       echo $answer
+       exit 2
 fi
 
 firstslot=`awk '$1 == "firstslot" {print $2}' $ourconf 2>/dev/null`
 if [ -z "$firstslot" ]; then
-       answer="<none> $pname: firstslot not specified in $ourconf"
-       code=2
-       echo "Exit -> $answer" >> $logfile
-       echo "$answer"
-       exit $code
+       answer=`_ '<none> %s: firstslot not specified in %s' "$pname" "$ourconf"`
+       echo `_ 'Exit ->'` $answer >> $logfile
+       echo $answer
+       exit 2
 fi
 
 lastslot=`awk '$1 == "lastslot" {print $2}' $ourconf 2>/dev/null`
 if [ -z "$lastslot" ]; then
-       answer="<none> $pname: lastslot not specified in $ourconf"
-       code=2
-       echo "Exit -> $answer" >> $logfile
-       echo "$answer"
-       exit $code
+       answer=`_ '<none> %s: lastslot not specified in %s' "$pname" "$ourconf"`
+       echo `_ 'Exit ->'` $answer >> $logfile
+       echo $answer
+       exit 2
 fi
 
 nslots=`$EXPR $lastslot - $firstslot + 1`
 
 gravity=`awk '$1 == "gravity" {print $2}' $ourconf 2>/dev/null`
 if [ -z "$gravity" ]; then
-       answer="<none> $pname: gravity not specified in $ourconf"
-       code=2
-       echo "Exit -> $answer" >> $logfile
-       echo "$answer"
-       exit $code
+       answer=`_ '<none> %s: gravity not specified in %s' "$pname" "$ourconf"`
+       echo `_ 'Exit ->'` $answer >> $logfile
+       echo $answer
+       exit 2
 fi
 
 needeject=`awk '$1 == "needeject" {print $2}' $ourconf 2>/dev/null`
 if [ -z "$needeject" ]; then
-       answer="<none> $pname: needeject not specified in $ourconf"
-       code=2
-       echo "Exit -> $answer" >> $logfile
-       echo "$answer"
-       exit $code
+       answer=`_ '<none> %s: needeject not specified in %s' "$pname" "$ourconf"`
+       echo `_ 'Exit ->'` $answer >> $logfile
+       echo $answer
+       exit 2
 fi
 
 multieject=`awk '$1 == "multieject" {print $2}' $ourconf 2>/dev/null`
 if [ -z "$multieject" ]; then
-       echo "Note: setting multieject to a default of zero" >> $logfile
+       echo `_ 'Note: setting multieject to a default of zero'` >> $logfile
        multieject=0
 fi
 
 ejectdelay=`awk '$1 == "ejectdelay" {print $2}' $ourconf 2>/dev/null`
 if [ -z "$ejectdelay" ]; then
-       echo "Note: setting ejectdelay to a default of zero" >> $logfile
+       echo `_ 'Note: setting ejectdelay to a default of zero'` >> $logfile
        ejectdelay=0
 fi
 
 posteject=`awk '$1 == "posteject" {print $2}' $ourconf 2>/dev/null`
 if [ -z "$posteject" ]; then
-       echo "Note: setting posteject to a default of \"true\"" >> $logfile
+       echo `_ 'Note: setting posteject to a default of "true"'` >> $logfile
        posteject=true
 fi
 
 ourstate=`awk '$1 == "statefile" {print $2}' $ourconf 2>/dev/null`
 if [ -z "$ourstate" ]; then
-       answer="<none> $pname: statefile not specified in $ourconf"
-       code=2
-       echo "Exit -> $answer" >> $logfile
-       echo "$answer"
-       exit $code
+       answer=`_ '<none> %s: statefile not specified in %s' "$pname" "$ourconf"`
+       echo `_ 'Exit ->'` $answer >> $logfile
+       echo $answer
+       exit 2
 fi
 
 # needeject and multieject are incompatible
 if [ $needeject -eq 1 ] && [ $multieject -eq 1 ] ; then
-       answer="<none> $pname: needeject and multieject cannot be both enabled in $ourconf"
-       code=2
-       echo "Exit -> $answer" >> $logfile
-       echo "$answer"
-       exit $code
+       answer=`_ '<none> %s: needeject and multieject cannot be both enabled in %s' "$pname" "$ourconf"`
+       echo `_ 'Exit ->'` $answer >> $logfile
+       echo $answer
+       exit 2
 fi
 
 # read in state: only curslot and curloaded at the present time
@@ -190,10 +189,9 @@ case "$command" in
 
        backwards=`$EXPR 1 - $gravity`
        answer="$curslot $nslots $backwards"
-       code=0
-       echo "Exit -> $answer" >> $logfile
-       echo "$answer"
-       exit $code
+       echo `_ 'Exit ->'` $answer >> $logfile
+       echo $answer
+       exit 0
        ;;
 
 -reset) # reset changer. Actually, we only reset changer state. We
@@ -224,18 +222,16 @@ case "$command" in
            ([ $gravity -eq 0 ] || [ $curslot -ne $lastslot ]) ; then 
                # Can't do this: if we eject, the stacker is going to
                # load the next tape, and our state will be botched
-               answer="$curslot $pname: Cannot use -eject with multieject/nogravity/notlastslot"
-               code=1
-               echo "Exit -> $answer" >> $logfile
-               echo "$answer"
-               exit $code
+               answer=`_ '%s %s: Cannot use -eject with multieject/nogravity/notlastslot' "$curslot" "$pname"`
+               echo `_ 'Exit ->'` $answer >> $logfile
+               echo $answer
+               exit 1
        fi    
        if [ $curloaded -eq 0 ]; then
-               answer="$curslot $pname: slot already empty"
-               code=1
-               echo "Exit -> $answer" >> $logfile
-               echo "$answer"
-               exit $code
+               answer=`_ '%s %s: slot already empty' "$curslot" "$pname"`
+               echo `_ 'Exit ->'` $answer >> $logfile
+               echo $answer
+               exit 1
        fi
        ;;
 
@@ -250,11 +246,10 @@ case "$command" in
                newslot=$slotparm
                if [ $newslot -gt $lastslot ] || \
                     [ $newslot -lt $firstslot ] ; then
-                       answer="$newslot $pname: no slot $newslot: legal range is $firstslot ... $lastslot"
-                       code=1
-                       echo "Exit -> $answer" >> $logfile
-                       echo "$answer"
-                       exit $code
+                       answer=`_ '%s %s: no slot %s: legal range is %s ... %s' "$newslot" "$pname" "$newslot" "$firstslot" "$lastslot"`
+                       echo `_ 'Exit ->'` $answer >> $logfile
+                       echo $answer
+                       exit 1
                fi
                ;;
        current)
@@ -282,11 +277,10 @@ case "$command" in
                fi
                ;;
        *)
-               answer="<none> $pname: bad slot name \"$slotparm\""
-               code=1
-               echo "Exit -> $answer" >> $logfile
-               echo "$answer"
-               exit $code
+               answer=`_ '<none> %s: bad slot name "%s"' "$pname" "$slotparm"`
+               echo `_ 'Exit ->'` $answer >> $logfile
+               echo $answer
+               exit 1
                ;;
        esac
        ;;
@@ -297,11 +291,10 @@ esac
 
 
 if [ $usage -eq 1 ]; then
-       answer="<none> usage: $pname {-reset | -slot [<slot-number>|current|next|prev|advance] | -info | -eject}"
-       code=2
-       echo "Exit -> $answer" >> $logfile
-       echo "$answer"
-       exit $code
+       answer=`_ '<none> usage: %s {-reset | -slot [<slot-number>|current|next|prev|advance] | -info | -eject}' "$pname"`
+       echo `_ 'Exit ->'` $answer >> $logfile
+       echo $answer
+       exit 2
 fi
 
 
@@ -309,11 +302,10 @@ fi
 
 if [ $checkgravity -eq 1 ] && [ $gravity -ne 0 ] ; then
        if [ $newslot -lt $curslot ] || [ "$slotparm" = "prev" ] ; then
-               answer="$newslot $pname: cannot go backwards in gravity stacker"
-               code=1
-               echo "Exit -> $answer" >> $logfile
-               echo "$answer"
-               exit $code
+               answer=`_ '%s %s: cannot go backwards in gravity stacker' "$newslot" "$pname"`
+               echo `_ 'Exit ->'` $answer >> $logfile
+               echo $answer
+               exit 1
        fi
 fi
 
@@ -328,31 +320,28 @@ then
        while [ $curslot -ne $newslot ]; do
            device=`awk '$1 == "slot" && $2 == '$curslot' {print $3}' $ourconf 2>/dev/null`
            if [ "$device" = "" ]; then
-               answer="$curslot $pname: slot $curslot device not specified in $ourconf"
-               code=2
-               echo "Exit -> $answer" >> $logfile
-               echo "$answer"
-               exit $code
+               answer=`_ '%s %s: slot %s device not specified in %s' "$curslot" "$pname" "$curslot" "$ourconf"`
+               echo `_ 'Exit ->'` $answer >> $logfile
+               echo $answer
+               exit 2
            fi
-           echo "     -> offline $device" >> $logfile
+           echo `_ '     -> offline'` "$device"` >> $logfile
            $MT $MTF $device offline >> $logfile 2>&1
            if [ $? -ne 0 ]; then
-               answer="$newslot $pname: $device: unable to change to slot $curslot"
-               code=2
-               echo "Exit -> $answer" >> $logfile
-               echo "$answer"
-               exit $code
+               answer=`_ '%s %s: %s: unable to change to slot %s' "$newslot" "$pname" "$device" "$curslot"`
+               echo `_ 'Exit ->'` $answer >> $logfile
+               echo $answer
+               exit 2
            fi
            [ $ejectdelay -gt 0 ] && sleep $ejectdelay
-           echo "     -> running $posteject $device" >> $logfile
+           echo `_ '     -> running'` $posteject $device >> $logfile
            $posteject $device >> $logfile 2>&1
            status=$?
            if [ $status -ne 0 ]; then
-               answer="$newslot $pname: $posteject $device failed: $status"
-               code=2
-               echo "Exit -> $answer" >> $logfile
-               echo "$answer"
-               exit $code
+               answer=`_ '%s %s: %s %s failed: %s' "$newslot" "$pname" "$posteject" "$device" "$status"`
+               echo `_ 'Exit ->'` $answer >> $logfile
+               echo $answer
+               exit 2
            fi
            curslot=`$EXPR $curslot + 1`
            if [ $curslot -gt $lastslot ] ; then
@@ -375,13 +364,12 @@ then
        # try to unload the current device
        device=`awk '$1 == "slot" && $2 == '$curslot' {print $3}' $ourconf 2>/dev/null`
        if [ "$device" = "" ]; then
-               answer="$curslot $pname: slot $curslot device not specified in $ourconf"
-               code=2
-               echo "Exit -> $answer" >> $logfile
-               echo "$answer"
-               exit $code
+               answer=`_ '%s %s: slot %s device not specified in %s' "$curslot" "$pname" "$curslot" "$ourconf"`
+               echo `_ 'Exit ->'` $answer >> $logfile
+               echo $answer
+               exit 2
        fi
-       echo "     -> offline $device" >> $logfile
+       echo `_ '     -> offline'` $device >> $logfile
        $MT $MTF $device offline >> $logfile 2>&1
        if [ $? -ne 0 ]; then
                #
@@ -393,15 +381,14 @@ then
                slotempty=1
        else
                [ $ejectonly -eq 0 ] && [ $ejectdelay -gt 0 ] && sleep $ejectdelay
-               echo "     -> running $posteject $device" >> $logfile
+               echo `_ '     -> running '` $posteject $device >> $logfile
                $posteject $device >> $logfile 2>&1
                status=$?
                if [ $status -ne 0 ]; then
-                       answer="$newslot $pname: $posteject $device failed: $status"
-                       code=2
-                       echo "Exit -> $answer" >> $logfile
-                       echo "$answer"
-                       exit $code
+                       answer=`_ '%s %s: %s %s failed: %s' "$newslot" "$pname" "$posteject" "$device" "$status"`
+                       echo `_ 'Exit ->'` $answer >> $logfile
+                       echo $answer
+                       exit 2
                fi
        fi
 fi
@@ -417,13 +404,12 @@ if [ $loadslot -eq 1 ]; then      # load the tape from the slot
        # try to rewind the device
        device=`awk '$1 == "slot" && $2 == '$curslot' {print $3}' $ourconf 2>/dev/null`
        if [ "$device" = "" ]; then
-               answer="$curslot $pname: slot $curslot device not specified in $ourconf"
-               code=2
-               echo "Exit -> $answer" >> $logfile
-               echo "$answer"
-               exit $code
+               answer=`_ "%s %s: slot %s device not specified in %s' "$curslot" "$pname" "$curslot" "$ourconf"`
+               echo `_ 'Exit ->'` $answer >> $logfile
+               echo $answer
+               exit 2
        fi
-       echo "     -> rewind $device" >> $logfile
+       echo `_ '     -> rewind'` $device >> $logfile
        $MT $MTF $device rewind >> $logfile 2>&1
        if [ $? -ne 0 ]; then
                #
@@ -439,18 +425,17 @@ fi
 
 # update state
 
-echo "# multi-changer state cache: DO NOT EDIT!" >  $ourstate
+echo `_ '# multi-changer state cache: DO NOT EDIT!'` >  $ourstate
 echo curslot $newslot                           >> $ourstate
 echo curloaded $curloaded                       >> $ourstate
 
 # return slot info
 
 if [ $slotempty -eq 1 ]; then
-       answer="$newslot $pname: slot is empty"
-       code=1
-       echo "Exit -> $answer" >> $logfile
-       echo "$answer"
-       exit $code
+       answer=`_ '%s %s: slot is empty' "$newslot" "$pname"`
+       echo `_ 'Exit ->'` $answer >> $logfile
+       echo $answer
+       exit 1
 fi
 
 if [ "$command" = -slot -a "$slotparm" = advance ]; then
@@ -458,7 +443,6 @@ if [ "$command" = -slot -a "$slotparm" = advance ]; then
 fi
 
 answer="$newslot $device"
-code=0
-echo "Exit -> $answer" >> $logfile
-echo "$answer"
-exit $code
+echo `_ 'Exit ->'` $answer >> $logfile
+echo $answer
+exit 0
index 1e679a17a720a01ba4c3a2c1eaf45bfd1ef3c37c..f4b904efd38be9d56385b9c2e6ea32dd2115fd1d 100644 (file)
@@ -1,4 +1,4 @@
-static char rcsid[] = "$Id: chg-scsi.c,v 1.52.2.2 2006/12/12 14:56:37 martinea Exp $";
+static char rcsid[] = "$Id: chg-scsi.c,v 1.52 2006/07/25 18:18:46 martinea Exp $";
 /*
  * 
  *
index 281112cd5449f16dc734ce8768b214c31f0c9b35..a36e9010e8415f008c030323d2a01e31d3c53bdc 100644 (file)
 #
 # initial_poll_delay=NN            #### initial delay after load before polling for
 #                          #### readiness
+#
 ####
 
 ####
 #      env DEBUG=yes .../chg-zd-mtx ...
 ################################################################################
 
-################################################################################
-# You may need to customize these things
-################################################################################
-
-MT=@MT@
-MTF=@MT_FILE_FLAG@
-MTX=@MTX@
-
-################################################################################
-# No user-level customization should be required beyond this point.
-################################################################################
+# source utility functions and values from configure
+exec_prefix=@exec_prefix@
+libexecdir=@libexecdir@
+. ${libexecdir}/chg-lib.sh
 
 test -n "$DEBUG" && set -x
 TMPDIR="@AMANDA_TMPDIR@"
@@ -376,7 +370,7 @@ Exit() {
        exit_slot=$1
        shift
        exit_answer="$@"
-       Log $call_type "($code)" "->" "$exit_slot" "$@"
+       Log $call_type "($code) -> $exit_slot $@"
        echo "$exit_slot" "$@"
        if [ $call_type = Return ]; then
                return $code
@@ -390,11 +384,11 @@ Exit() {
 ###
 
 Run() {
-       Log Running: "$@"
+       Log `_ 'Running: %s' "$@"`
        rm -f $stdout $stderr
        "$@" > $stdout 2> $stderr
        exitcode=$?
-       Log Exit code: $exitcode
+       Log `_ 'Exit code: %s' "$exitcode"`
        if [ -s $stdout ]
        then
                LogAppend Stdout:
@@ -487,7 +481,9 @@ get_loaded_info() {
        loadedslot=$1
        loadedbarcode=$2
        if [ -z "$loadedslot" ]; then
-               Exit 2 "<none>" "could not determine current slot, are you sure your drive slot is $driveslot"
+               Exit 2 \
+                   `_ '<none>'` \
+                   "could not determine current slot, are you sure your drive slot is $driveslot"
                return $?                       # in case we are internal
        fi
 
@@ -542,12 +538,12 @@ get_loaded_info() {
                :
        else
                Exit 2 \
-                    "<none>" \
+                    `_ '<none>'` \
                     "currently loaded slot ($loadedslot) not numeric"
                return $?                       # in case we are internal
        fi
-       Log       "STATUS   -> currently loaded slot = $loadedslot"
-       LogAppend "         -> currently loaded barcode = \"$loadedbarcode\""
+       Log       `_ 'STATUS   -> currently loaded slot = %s' "$loadedslot"`
+       LogAppend `_ '         -> currently loaded barcode = "%s"' "$loadedbarcode"`
 }
 
 ###
@@ -593,7 +589,7 @@ get_slot_list() {
                last=$lastslot
                for slot in $slot_list; do
                        if [ $firstslot -lt 0 ]; then
-                               Log "SLOTLIST -> firstslot set to $slot"
+                               Log `_ 'SLOTLIST -> firstslot set to %s' "$slot"`
                                firstslot=$slot
                        fi
                        if [ $lastslot -lt 0 ]; then
@@ -601,18 +597,18 @@ get_slot_list() {
                        fi
                done
                if [ $lastslot -lt 0 -a $last -ge 0 ]; then
-                       Log "SLOTLIST -> lastslot set to $last"
+                       Log `_ 'SLOTLIST -> lastslot set to %s' "$last"`
                        lastslot=$last
                fi
                if [ $firstslot -lt 0 ]; then
                        Exit 2 \
-                            "<none>" \
-                            "cannot determine first slot"
+                            `_ '<none>'` \
+                            `_ 'cannot determine first slot'`
                        return $?               # in case we are internal
                elif [ $lastslot -lt 0 ]; then
                        Exit 2 \
-                            "<none>" \
-                            "cannot determine last slot"
+                            `_ '<none>'` \
+                            `_ 'cannot determine last slot'`
                        return $?               # in case we are internal
                fi
        fi
@@ -624,7 +620,7 @@ get_slot_list() {
        done
        if [ -z "$amanda_slot_list" ]; then
                Exit 2 \
-                    "<none>" \
+                    `_ '<none>'` \
                     "no slots available"
                return $?                       # in case we are internal
        fi
@@ -657,28 +653,28 @@ fi
 changerfile=`amgetconf$SUF changerfile 2>/dev/null`
 if [ -z "$changerfile" ]; then
        Exit 2 \
-            "<none>" \
+            `_ '<none>'` \
             "changerfile must be specified in amanda.conf"
 fi
 
 tape=`amgetconf$SUF tapedev 2>/dev/null`
 if [ -z "$tape" ]; then
        Exit 2 \
-            "<none>" \
+            `_ '<none>'` \
             "tapedev may not be empty"
 elif [ $tape = "/dev/null" -o `expr "$tape" : 'null:'` -eq 5 ]; then
        Exit 2 \
-            "<none>" \
+            `_ '<none>'` \
             "tapedev ($tape) may not be the null device"
 fi
 TAPE=`amgetconf$SUF changerdev 2>/dev/null`
 if [ -z "$TAPE" ]; then
        Exit 2 \
-            "<none>" \
+            `_ '<none>'` \
             "changerdev may not be empty"
 elif [ $TAPE = "/dev/null" ]; then
        Exit 2 \
-            "<none>" \
+            `_ '<none>'` \
             "changerdev ($TAPE) may not be the null device"
 fi
 export TAPE                                    # for mtx command
@@ -696,6 +692,17 @@ else
        configfile=$changerfile.conf
 fi
 
+if [ ! -e $configfile ]; then
+       Exit 2 \
+            `_ '<none>'` \
+            "configuration file \"$configfile\" doesn't exist"
+fi
+if [ ! -f $configfile ]; then
+       Exit 2 \
+            `_ '<none>'` \
+            "configuration file \"$configfile\" is not a file"
+fi
+
 cleanfile=$changerfile-clean
 accessfile=$changerfile-access
 slotfile=$changerfile-slot
@@ -760,12 +767,12 @@ if [ $DBGFILE = /dev/null ]; then
        else
                DBGFILE=/dev/null
        fi
-       Log === Start "`date`" ===
+       Log `_ '=== Start %s ===' "\`date\`"`
 fi
 if [ -z "$driveslot" ]; then
        Exit 2 \
-            "<none>" \
-            "cannot determine drive slot from $tape"
+            `_ '<none>'` \
+            `_ 'cannot determine drive slot from %s' "$tape"`
 fi
 
 stdout=$TMPDIR/$myname.1.$$
@@ -773,11 +780,11 @@ stderr=$TMPDIR/$myname.2.$$
 mtx_status=$TMPDIR/$myname.status.$$
 trap "rm -f $stdout $stderr $mtx_status" 0     # exit cleanup
 
-Log "Using config file $configfile"
+Log `_ 'Using config file %s' "$configfile"`
 
 # Log the argument list.
 
-Log "Arg info:"
+Log `_ "Arg info:"`
 LogAppend "\$# = $#"
 i=0
 LogAppend "\$$i = \"$argv0\""
@@ -810,7 +817,7 @@ max_drive_wait=${max_drive_wait:-'120'}                     # default: two minutes
 
 get_slot_list
 
-Log "Config info:"
+Log `_ "Config info:"`
 for var in $varlist; do
        if [ $var = "OFFLINE_BEFORE_UNLOAD" ]; then
                continue                        # old name
@@ -820,15 +827,15 @@ for var in $varlist; do
        eval val=\"'$'$var\"
        if [ -z "$val" ]; then
                Exit 2 \
-                    "<none>" \
-                    "$var missing in $configfile"
+                    `_ '<none>'` \
+                    `_ '%s missing in %s' "$var" "$configfile"`
        fi
        if IsNumeric "$val" ; then
                :
        else
                Exit 2 \
-                    "<none>" \
-                    "$var ($val) not numeric in $configfile"
+                    `_ '<none>'` \
+                    `_ '%s (%s) not numeric in %s' "$var" "$val" "$configfile"`
        fi
        LogAppend $var = \"$val\"
 done
@@ -837,14 +844,13 @@ done
 
 if [ $firstslot -gt $lastslot ]; then
        Exit 2 \
-            "<none>" \
-            "firstslot ($firstslot) greater than" \
-            "lastslot ($lastslot) in $configfile"
+            `_ '<none>'` \
+            `_ 'firstslot (%s) greater than lastslot (%s) in %s' "$firstslot" "$lastslot" "$configfile"`
 fi
 if [ $autoclean -ne 0 -a $cleanslot -lt 0 ]; then
        Exit 2 \
-            "<none>" \
-            "autoclean set but cleanslot not valid ($cleanslot)"
+            `_ '<none>'` \
+            `_ 'autoclean set but cleanslot not valid (%s)' "$cleanslot"`
 fi
 
 # Set up the current slot
@@ -852,19 +858,14 @@ fi
 currentslot=`cat $slotfile`
 if IsNumeric "$currentslot" ; then
        if [ $currentslot -lt $firstslot ]; then
-               Log "SETUP    -> current slot $currentslot" \
-                                "less than $firstslot ..." \
-                                "resetting to $firstslot"
+               Log `_ 'SETUP    -> current slot %s less than %s ... resetting to %s' "$currentslot" "$firstslot" "$firstslot"`
                currentslot=$firstslot
        elif [ $currentslot -gt $lastslot ]; then
-               Log "SETUP    -> current slot $currentslot" \
-                                "greater than $lastslot ..." \
-                                "resetting to $lastslot"
+               Log `_ 'SETUP    -> current slot %s greater than %s ... resetting to %s' "$currentslot" "$lastslot" "$lastslot"`
                currentslot=$lastslot
        fi
 else
-       Log "SETUP    -> contents of $slotfile ($currentslot) invalid," \
-                        "setting current slot to first slot ($firstslot)"
+       Log `_ 'SETUP    -> contents of %s (%s) invalid, setting current slot to first slot (%s)' "$slotfile" "$currentslot" "$firstslot"`
        currentslot=$firstslot
 fi
 
@@ -889,8 +890,7 @@ if [ $found_current -eq 0 ]; then
        else
                new_currentslot=$next_slot_after_current
        fi
-       Log "WARNING  -> current slot $currentslot not available," \
-                        "setting current slot to next slot ($new_currentslot)"
+       Log `_ 'WARNING  -> current slot %s not available, setting current slot to next slot (%s)' "$currentslot" "$new_currentslot"`
        currentslot=$new_currentslot
 fi
 
@@ -902,18 +902,17 @@ fi
 
 eject() {
        test -n "$DEBUG" && set -x
-       Log "EJECT    -> ejecting tape from $tape"
+       Log `_ 'EJECT    -> ejecting tape from %s' "$tape"`
        get_loaded_info 
        if [ $loadedslot -gt 0 ]; then
-               Log "EJECT    -> moving tape from drive $driveslot" \
-                                "to storage slot $loadedslot"
+               Log `_ 'EJECT    -> moving tape from drive %s to storage slot %s' "$driveslot" "$loadedslot"`
                if [ $offline_before_unload -ne 0 ]; then
                        Run $MT $MTF $tape offline > /dev/null 2>&1
                fi
                sleep $unloadpause
                result=`Run $MTX unload $loadedslot $driveslot 2>&1`
                status=$?
-               Log "         -> status $status, result \"$result\""
+               Log `_ '         -> status %s, result "%s"' "$status" "$result"`
                mtx_status_valid=0
                if [ $status -ne 0 ]; then
                        answer="$result"
@@ -923,7 +922,7 @@ eject() {
                        code=0
                fi
        else
-               answer="Drive was not loaded"
+               answer=`_ 'Drive was not loaded'`
                code=1
        fi
        Exit $code "$loadedslot" "$answer"
@@ -936,13 +935,12 @@ eject() {
 
 reset() {
        test -n "$DEBUG" && set -x
-       Log "RESET    -> loading tape from slot $firstslot" \
-                        "to drive $driveslot ($tape)"
+       Log `_ 'RESET    -> loading tape from slot %s to drive %s (%s)' "$firstslot" "$driveslot" "$tape"`
        # Call loadslot without doing it as an internal and let it finish
        # things up.
        loadslot $firstslot
        # NOTREACHED
-       Exit 2 "<none>" "reset: should not get here"
+       Exit 2 `_ '<none>'` `_ 'reset: should not get here'`
        return $?                               # in case we are internal
 }
 
@@ -955,11 +953,11 @@ reset() {
 loadslot() {
        test -n "$DEBUG" && set -x
        if [ $# -lt 1 ]; then
-               Exit 2 "<none>" "Missing -slot argument"
+               Exit 2 `_ '<none>'` `_ 'Missing -slot argument'`
                return $?                       # in case we are internal
        fi
        whichslot=$1
-       Log "LOADSLOT -> load drive $driveslot ($tape) from slot $whichslot"
+       Log `_ 'LOADSLOT -> load drive %s (%s) from slot %s' "$driveslot" "$tape" "$whichslot"`
 
        numeric=`echo $whichslot | sed 's/[^0-9]//g'`
        case $whichslot in
@@ -979,7 +977,7 @@ loadslot() {
                find_slot=$cleanslot
                ;;
        *)
-               Exit 2 "<none>" "Illegal slot: \"$whichslot\""
+               Exit 2 `_ '<none>'` `_ 'Illegal slot: "%s"' "$whichslot"`
                return $?                       # in case we are internal
                ;;
        esac
@@ -1003,9 +1001,8 @@ loadslot() {
        done
        if [ $# -le 0 ]; then
                Exit 2 \
-                    "<none>" \
-                    "Cannot find slot $find_slot" \
-                    "in slot list ($slot_list)"
+                    `_ '<none>'` \
+                    `_ 'Cannot find slot %s in slot list (%s)' "$find_slot " "$slot_list"`
                return $?                       # in case we are internal
        fi
 
@@ -1090,11 +1087,10 @@ loadslot() {
        fi
 
        # Load the tape, finally!
-       Log "LOADSLOT -> loading tape from slot $loadslot" \
-                        "to drive $driveslot ($tape)"
+       Log `_ "LOADSLOT -> loading tape from slot %s to drive %s (%s)" "$loadslot" "$driveslot" "$tape"`
        result=`Run $MTX load $loadslot $driveslot 2>&1`
        status=$?
-       Log "         -> status $status, result \"$result\""
+       Log `_ '         -> status %s, result "%s"' "$status" "$result"`
        mtx_status_valid=0
        if [ $status -ne 0 ]; then
                Exit 2 "$loadslot" "$result"
@@ -1128,9 +1124,7 @@ loadslot() {
                waittime=`expr $waittime + $poll_drive_ready`
        done
        if [ $ready -eq 0 ]; then
-               Exit 2 "$loadslot" "Drive not ready after" \
-                                  "$max_drive_wait seconds," \
-                                  "rewind said \"$result\""
+               Exit 2 "$loadslot" `_ 'Drive not ready after %s seconds, rewind said "%s"' "$max_drive_wait" "$result"`
                return $?                       # in case we are internal
        fi
 
@@ -1151,13 +1145,13 @@ info() {
        test -n "$DEBUG" && set -x
        get_loaded_info
        get_slot_list
-       Log       "INFO     -> first slot: $firstslot"
-       LogAppend "         -> current slot: $currentslot"
-       LogAppend "         -> loaded slot: $loadedslot"
-       LogAppend "         -> last slot: $lastslot"
-       LogAppend "         -> slot list: $slot_list"
-       LogAppend "         -> can go backwards: 1"
-       LogAppend "         -> havereader: $havereader"
+       Log       `_ 'INFO     -> first slot: %s' "$firstslot"`
+       LogAppend `_ '         -> current slot: %s' "$currentslot"`
+       LogAppend `_ '         -> loaded slot: %s' "$loadedslot"`
+       LogAppend `_ '         -> last slot: %s' "$lastslot"`
+       LogAppend `_ '         -> slot list: %s' "$slot_list"`
+       LogAppend `_ '         -> can go backwards: 1'`
+       LogAppend `_ '         -> havereader: %s' "$havereader"`
 
         ###
        # Check if a barcode reader is configured or not.  If so, it
@@ -1193,24 +1187,20 @@ read_labelfile() {
        while read lbl bc junk; do
                line=`expr $line + 1`
                if [ -z "$lbl" -o -z "$bc" -o -n "$junk" ]; then
-                       Log       "ERROR    -> Line $line malformed: $lbl $bc $junk"
-                       LogAppend "         -> Remove $labelfile" \
-                                              "and run" \
-                                              "\"$sbindir/amtape $config update\""
+                       Log       `_ 'ERROR    -> Line %s malformed: %s %s %s' "$line" "$lbl" "$bc" "$junk"`
+                       LogAppend `_ '         -> Remove %s and run "%s %s update"' "$labelfile" "$sbindir/amtape" "$config"`
                        Exit 2 \
-                            "<none>" \
-                            "Line $line malformed in $labelfile: $lbl $bc $junk"
+                            `_ '<none>'` \
+                            `_ 'Line %s malformed in %s: %s %s %s' "$line" "$labelfile" "$lbl" "$bc" "$junk"`
                        return $?               # in case we are internal
                fi
                if [ $lbl = "$lbl_search" -o $bc = "$bc_search" ]; then
                        if [ $labelfile_entry_found -ne 0 ]; then
-                               Log       "ERROR    -> Duplicate entries: $labelfile line $line"
-                               LogAppend "         -> Remove $labelfile" \
-                                                      "and run" \
-                                                      "\"$sbindir/amtape $config update\""
+                               Log       `_ 'ERROR    -> Duplicate entries: %s line %s' "$labelfile" "$line"`
+                               LogAppend `_ '         -> Remove $labelfile and run "$sbindir/amtape $config update"' "$labelfile" "$sbindir/amtape" "$config"`
                                Exit 2 \
-                                    "<none>" \
-                                    "Duplicate entries: $labelfile line $line"
+                                    `_ '<none>'` \
+                                    `_ 'Duplicate entries: %s line %s' "$labelfile" "$line"`
                                return $?       # in case we are internal
                        fi
                        labelfile_entry_found=1
@@ -1228,23 +1218,20 @@ read_labelfile() {
 addlabel() {
        test -n "$DEBUG" && set -x
        if [ $# -lt 1 ]; then
-               Exit 2 "<none>" "Missing -label argument"
+               Exit 2 `_ '<none>'` `_ 'Missing -label argument'`
                return $?                       # in case we are internal
        fi
         tapelabel=$1
        if [ $havereader -eq 0 ]; then
-               Exit 2 "<none>" "Not configured with barcode reader"
+               Exit 2 `_ '<none>'` `_ 'Not configured with barcode reader'`
                return $?                       # in case we are internal
        fi
         get_loaded_info
        if [ $loadedslot -lt 0 ]; then
-               Exit 1 "<none>" "No tape currently loaded"
+               Exit 1 `_ '<none>'` `_ 'No tape currently loaded'`
                return $?                       # in case we are internal
        fi
-       Log       "LABEL    -> Adding label \"$tapelabel\"" \
-                              "with barcode \"$loadedbarcode\"" \
-                              "for slot $loadedslot" \
-                              "into $labelfile"
+       Log       `_ 'LABEL    -> Adding label "%s" with barcode "%s" for slot %s into %s' "$tapelabel" "$loadedbarcode" "$loadedslot" "$labelfile"`
        read_labelfile "$tapelabel" "$loadedbarcode" < $labelfile
        if [ $labelfile_entry_found -ne 0 ]; then
                lf_val=
@@ -1262,25 +1249,17 @@ addlabel() {
                        new_val=$tapelabel
                fi
                if [ -n "$lf_val" ]; then
-                       LogAppend "ERROR    -> !!! Label database corrupted !!!"
-                       LogAppend "         -> \"$old_val\" conflicts with" \
-                                              "new $val_type \"$new_val\"" \
-                                              "for $lf_type \"$lf_val\""
-                       LogAppend "         -> Remove $labelfile" \
-                                              "and run" \
-                                              "\"$sbindir/amtape $config update\""
+                       LogAppend `_ 'ERROR    -> !!! Label database corrupted !!!'`
+                       LogAppend `_ '         -> "%s" conflicts with new %s "%s" for %s "%s"' "$old_val" "$val_type" "$new_val" "$lf_type" "$lf_val"`
                        Exit 2 \
-                            "<none>" \
-                            "$tapelabel: \"$old_val\" conflicts with" \
-                            "new $val_type \"$new_val\"" \
-                            "for $lf_type \"$lf_val\""
+                            `_ '<none>'` \
+                            `_ '%s: "%s" conflicts with new %s "%s" for %s "%s"' "$tapelabel" "$old_val" "$val_type" "$new_val" "$lf_type" "$lf_val"`
                        return $?               # in case we are internal
                fi
-               LogAppend "         -> already synced"
+               LogAppend `_ "         -> already synced"`
        else
                echo "$tapelabel $loadedbarcode" >> $labelfile
-               LogAppend "         -> appended $labelfile entry:" \
-                                      "$tapelabel $loadedbarcode"
+               LogAppend `_ '         -> appended %s entry: %s %s' "$labelfile" "$tapelabel" "$loadedbarcode"`
        fi
        Exit 0 "$loadedslot" "$tape"
        return $?                               # in case we are internal
@@ -1294,28 +1273,25 @@ addlabel() {
 searchtape() {
        test -n "$DEBUG" && set -x
        if [ $# -lt 1 ]; then
-               Exit 2 "<none>" "Missing -search argument"
+               Exit 2 `_ '<none>'` `_ 'Missing -search argument'`
                return $?                       # in case we are internal
        fi
         tapelabel=$1
        if [ $havereader -eq 0 ]; then
-               Exit 2 "<none>" "Not configured with barcode reader"
+               Exit 2 `_ '<none>'` `_ 'Not configured with barcode reader'`
                return $?                       # in case we are internal
        fi
-       Log "SEARCH   -> Hunting for label \"$tapelabel\""
+       Log `_ 'SEARCH   -> Hunting for label "%s"' "$tapelabel"`
        read_labelfile "$tapelabel" "" < $labelfile
        if [ $labelfile_entry_found -eq 0 ]; then
-               LogAppend "         -> !!! label \"$tapelabel\" not found" \
-                                      "in $labelfile !!!"
-               LogAppend "         -> Remove $labelfile" \
-                                      "and run" \
-                                      "\"$sbindir/amtape $config update\""
+               LogAppend `_ '         -> !!! label "%s" not found in %s !!!' "$tapelabel" "$labelfile"`
+               LogAppend `_ '         -> Remove $labelfile and run "%s %s update"' "$labelfile" "$sbindir/amtape" "$config"`
                Exit 2 \
-                    "<none>" \
-                    "$tapelabel: label \"$tapelabel\" not found in $labelfile"
+                    `_ '<none>'` \
+                    `_ '%s: label "%s" not found in %s' "$tapelabel" "$tapelabel" "$labelfile"`
                return $?                       # in case we are internal
        fi
-       LogAppend "         -> barcode is \"$labelfile_barcode\""
+       LogAppend `_ '         -> barcode is "%s"' "$labelfile_barcode"`
        get_mtx_status
        foundslot=`sed -n '
 /VolumeTag *= *'$labelfile_barcode' *$/                        {
@@ -1323,24 +1299,20 @@ searchtape() {
        q
 }
 ' < $mtx_status`
-       LogAppend "         -> foundslot is $foundslot"
+       LogAppend `_ '         -> foundslot is %s' "$foundslot"`
        if [ -z "$foundslot" ]; then
-               LogAppend "ERROR    -> !!! Could not find slot" \
-                                      "for barcode \"$labelfile_barcode\"!!!"
-               LogAppend "         -> Remove $labelfile" \
-                                      "and run" \
-                                      "\"$sbindir/amtape $config update\""
+               LogAppend `_ 'ERROR    -> !!! Could not find slot for barcode "%s"!!!' "$labelfile_barcode"`
+               LogAppend `_ '         -> Remove %s and run "%s %s update"' "$labelfile" "$sbindir/amtape" "$config"`
                Exit 2 \
-                    "<none>" \
-                    "barcode \"$labelfile_barcode\"" \
-                    "not found in mtx status output"
+                    `_ '<none>'` \
+                    `_ 'barcode "%s" not found in mtx status output' "$labelfile_barcode"`
                return $?                       # in case we are internal
        fi
        # Call loadslot without doing it as an internal and let it finish
        # things up.
        loadslot $foundslot
        # NOTREACHED
-       Exit 2 "<none>" "searchtape: should not get here"
+       Exit 2 `_ '<none>'` `_ 'searchtape: should not get here'`
        return $?                               # in case we are internal
 }
 
@@ -1349,7 +1321,7 @@ searchtape() {
 ###
 
 if [ $# -lt 1 ]; then
-       Exit 2 "<none>" "Usage: $myname -command args"
+       Exit 2 `_ '<none>'` `_ 'Usage: %s -command args' "$myname"`
 fi
 cmd=$1
 shift
@@ -1376,8 +1348,8 @@ case "$cmd" in
        loadslot clean
        ;;
 *)
-       Exit 2 "<none>" "unknown option: $cmd"
+       Exit 2 `_ '<none>'` `_ 'unknown option: %s' "$cmd"`
        ;;
 esac
 
-Exit 2 "<none>" "$myname: should not get here"
+Exit 2 `_ '<none>'` `_ '%s: should not get here' "$myname"`
index 5ce1f1e3c6572bd0cd4beef8111a4d53f2a594b5..776e184a9ddb369aa03717ee7f62399790e85954 100644 (file)
@@ -1,4 +1,4 @@
-static char rcsid[] = "$Id: scsi-changer-driver.c,v 1.52.2.1 2006/11/01 13:55:55 martinea Exp $";
+static char rcsid[] = "$Id: scsi-changer-driver.c,v 1.52 2006/07/21 00:25:50 martinea Exp $";
 /*
  * Interface to control a tape robot/library connected to the SCSI bus
  *
index d8cf55d7b3e4b389efffa05d11b21509a01eec1f..d0dcaeb8b31f18f4c6092ae1312ebd3ae0a1b0ef 100644 (file)
@@ -24,7 +24,7 @@
  * file named AUTHORS, in the root directory of this distribution.
  */
 /*
- * $Id: scsi-linux.c,v 1.30.2.1 2006/12/12 14:56:38 martinea Exp $
+ * $Id: scsi-linux.c,v 1.30 2006/07/06 11:57:28 martinea Exp $
  *
  * Interface to execute SCSI commands on Linux
  *
@@ -83,7 +83,7 @@ extern OpenFiles_T *pDev;
 void SCSI_OS_Version(void)
 {
 #ifndef lint
-   static char rcsid[] = "$Id: scsi-linux.c,v 1.30.2.1 2006/12/12 14:56:38 martinea Exp $";
+   static char rcsid[] = "$Id: scsi-linux.c,v 1.30 2006/07/06 11:57:28 martinea Exp $";
    DebugPrint(DEBUG_ERROR, SECTION_INFO, "scsi-os-layer: %s\n",rcsid);
 #endif
 }
@@ -377,7 +377,7 @@ int SCSI_ExecuteCommand(int DeviceFD,
        (psg_header->result != 0)) 
     { 
       dbprintf(("SCSI_ExecuteCommand error read \n"));
-      dbprintf(("Status %zd (%lu) %2X\n", status, SCSI_OFF + DataBufferLength,psg_header->result ));
+      dbprintf(("Status " SSIZE_T_FMT " (" SSIZE_T_FMT ") %2X\n", status, SCSI_OFF + DataBufferLength,psg_header->result ));
       SCSI_CloseDevice(DeviceFD);
       amfree(buffer);
       return(SCSI_ERROR);
index eb9bd77cfd65f91bc288e247c9c9b43ed6f09725..891420abeebe92a70fce8e7103bb7d9833bdceeb 100644 (file)
@@ -57,7 +57,7 @@
 #include <scsi-defs.h>
 #include <sys/mtio.h>
 
-void SCSI_OS_Version()
+void SCSI_OS_Version(void)
 {
 #ifndef lint
    static char rcsid[] = "$Id: scsi-solaris.c,v 1.26 2006/05/25 01:47:10 johnfranks Exp $";
index b479e122e6037bf442d70ad8d04a8738b09e059b..2aa6d4749580773762655e9df2be1c0e9acafe59 100644 (file)
@@ -1,8 +1,9 @@
 # Makefile for Amanda client programs.
 
 INCLUDES =     -I$(top_builddir)/common-src \
-               -I$(top_srcdir)/common-src \
-               -I$(top_srcdir)/amandad-src
+               -I$(top_srcdir)/common-src   \
+               -I$(top_srcdir)/amandad-src  \
+               -I$(top_srcdir)/gnulib
 
 LINT=@AMLINT@
 LINTFLAGS=@AMLINTFLAGS@
@@ -26,7 +27,7 @@ endif
 
 libamclient_la_SOURCES=        amandates.c             getfsent.c      \
                        unctime.c               client_util.c   \
-                       clientconf.c            $(samba_sources)
+                       $(samba_sources)
 
 libamclient_la_LDFLAGS = -release $(VERSION)
 
@@ -40,7 +41,8 @@ libamclient_la_LDFLAGS = -release $(VERSION)
 LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
        libamclient.$(LIB_EXTENSION) \
        ../amandad-src/libamandad.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION)
+       ../common-src/libamanda.$(LIB_EXTENSION) \
+       ../gnulib/libgnu.$(LIB_EXTENSION)
 
 SUFFIXES =             .sh .pl
 
@@ -70,8 +72,8 @@ sendbackup_SOURCES =  sendbackup.c            sendbackup.h      \
                        sendbackup-dump.c       sendbackup-gnutar.c
 
 noinst_HEADERS =       amandates.h     getfsent.h      \
-                       findpass.h      client_util.h   \
-                       clientconf.h
+                       findpass.h      client_util.h
+                       
 
 install-exec-hook:
        @list="$(sbin_SCRIPTS)"; \
index 173d5c80b16a46130cccf244a5bc4815b855eca3..b797c1b0fed9b7d0796619af41356adeb56747ff 100644 (file)
@@ -51,6 +51,41 @@ DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
        $(srcdir)/Makefile.in $(srcdir)/patch-system.sh.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+       $(top_srcdir)/config/gnulib/absolute-header.m4 \
+       $(top_srcdir)/config/gnulib/alloca.m4 \
+       $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/eoverflow.m4 \
+       $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/getaddrinfo.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-cache.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-common.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-comp.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-tool.m4 \
+       $(top_srcdir)/config/gnulib/inet_ntop.m4 \
+       $(top_srcdir)/config/gnulib/intmax_t.m4 \
+       $(top_srcdir)/config/gnulib/inttypes_h.m4 \
+       $(top_srcdir)/config/gnulib/lib-ld.m4 \
+       $(top_srcdir)/config/gnulib/lib-link.m4 \
+       $(top_srcdir)/config/gnulib/lib-prefix.m4 \
+       $(top_srcdir)/config/gnulib/lock.m4 \
+       $(top_srcdir)/config/gnulib/longdouble.m4 \
+       $(top_srcdir)/config/gnulib/longlong.m4 \
+       $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
+       $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \
+       $(top_srcdir)/config/gnulib/size_max.m4 \
+       $(top_srcdir)/config/gnulib/snprintf.m4 \
+       $(top_srcdir)/config/gnulib/socklen.m4 \
+       $(top_srcdir)/config/gnulib/sockpfaf.m4 \
+       $(top_srcdir)/config/gnulib/stdbool.m4 \
+       $(top_srcdir)/config/gnulib/stdint_h.m4 \
+       $(top_srcdir)/config/gnulib/strdup.m4 \
+       $(top_srcdir)/config/gnulib/string_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
+       $(top_srcdir)/config/gnulib/vasnprintf.m4 \
+       $(top_srcdir)/config/gnulib/visibility.m4 \
+       $(top_srcdir)/config/gnulib/wchar_t.m4 \
+       $(top_srcdir)/config/gnulib/wint_t.m4 \
+       $(top_srcdir)/config/gnulib/xsize.m4 \
        $(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
@@ -69,10 +104,10 @@ libLTLIBRARIES_INSTALL = $(INSTALL)
 LTLIBRARIES = $(lib_LTLIBRARIES)
 libamclient_la_LIBADD =
 am__libamclient_la_SOURCES_DIST = amandates.c getfsent.c unctime.c \
-       client_util.c clientconf.c findpass.c
+       client_util.c findpass.c
 @WANT_SAMBA_TRUE@am__objects_1 = findpass.lo
 am_libamclient_la_OBJECTS = amandates.lo getfsent.lo unctime.lo \
-       client_util.lo clientconf.lo $(am__objects_1)
+       client_util.lo $(am__objects_1)
 libamclient_la_OBJECTS = $(am_libamclient_la_OBJECTS)
 am__EXEEXT_1 = getfsent$(EXEEXT)
 libexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
@@ -83,49 +118,56 @@ calcsize_LDADD = $(LDADD)
 calcsize_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
        libamclient.$(LIB_EXTENSION) \
        ../amandad-src/libamandad.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION)
+       ../common-src/libamanda.$(LIB_EXTENSION) \
+       ../gnulib/libgnu.$(LIB_EXTENSION)
 am_getfsent_OBJECTS = getfsent.test.$(OBJEXT)
 getfsent_OBJECTS = $(am_getfsent_OBJECTS)
 getfsent_LDADD = $(LDADD)
 getfsent_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
        libamclient.$(LIB_EXTENSION) \
        ../amandad-src/libamandad.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION)
+       ../common-src/libamanda.$(LIB_EXTENSION) \
+       ../gnulib/libgnu.$(LIB_EXTENSION)
 killpgrp_SOURCES = killpgrp.c
 killpgrp_OBJECTS = killpgrp.$(OBJEXT)
 killpgrp_LDADD = $(LDADD)
 killpgrp_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
        libamclient.$(LIB_EXTENSION) \
        ../amandad-src/libamandad.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION)
+       ../common-src/libamanda.$(LIB_EXTENSION) \
+       ../gnulib/libgnu.$(LIB_EXTENSION)
 noop_SOURCES = noop.c
 noop_OBJECTS = noop.$(OBJEXT)
 noop_LDADD = $(LDADD)
 noop_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
        libamclient.$(LIB_EXTENSION) \
        ../amandad-src/libamandad.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION)
+       ../common-src/libamanda.$(LIB_EXTENSION) \
+       ../gnulib/libgnu.$(LIB_EXTENSION)
 rundump_SOURCES = rundump.c
 rundump_OBJECTS = rundump.$(OBJEXT)
 rundump_LDADD = $(LDADD)
 rundump_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
        libamclient.$(LIB_EXTENSION) \
        ../amandad-src/libamandad.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION)
+       ../common-src/libamanda.$(LIB_EXTENSION) \
+       ../gnulib/libgnu.$(LIB_EXTENSION)
 runtar_SOURCES = runtar.c
 runtar_OBJECTS = runtar.$(OBJEXT)
 runtar_LDADD = $(LDADD)
 runtar_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
        libamclient.$(LIB_EXTENSION) \
        ../amandad-src/libamandad.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION)
+       ../common-src/libamanda.$(LIB_EXTENSION) \
+       ../gnulib/libgnu.$(LIB_EXTENSION)
 selfcheck_SOURCES = selfcheck.c
 selfcheck_OBJECTS = selfcheck.$(OBJEXT)
 selfcheck_LDADD = $(LDADD)
 selfcheck_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
        libamclient.$(LIB_EXTENSION) \
        ../amandad-src/libamandad.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION)
+       ../common-src/libamanda.$(LIB_EXTENSION) \
+       ../gnulib/libgnu.$(LIB_EXTENSION)
 am_sendbackup_OBJECTS = sendbackup.$(OBJEXT) sendbackup-dump.$(OBJEXT) \
        sendbackup-gnutar.$(OBJEXT)
 sendbackup_OBJECTS = $(am_sendbackup_OBJECTS)
@@ -133,21 +175,24 @@ sendbackup_LDADD = $(LDADD)
 sendbackup_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
        libamclient.$(LIB_EXTENSION) \
        ../amandad-src/libamandad.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION)
+       ../common-src/libamanda.$(LIB_EXTENSION) \
+       ../gnulib/libgnu.$(LIB_EXTENSION)
 sendsize_SOURCES = sendsize.c
 sendsize_OBJECTS = sendsize.$(OBJEXT)
 sendsize_LDADD = $(LDADD)
 sendsize_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
        libamclient.$(LIB_EXTENSION) \
        ../amandad-src/libamandad.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION)
+       ../common-src/libamanda.$(LIB_EXTENSION) \
+       ../gnulib/libgnu.$(LIB_EXTENSION)
 versionsuffix_SOURCES = versionsuffix.c
 versionsuffix_OBJECTS = versionsuffix.$(OBJEXT)
 versionsuffix_LDADD = $(LDADD)
 versionsuffix_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
        libamclient.$(LIB_EXTENSION) \
        ../amandad-src/libamandad.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION)
+       ../common-src/libamanda.$(LIB_EXTENSION) \
+       ../gnulib/libgnu.$(LIB_EXTENSION)
 libexecSCRIPT_INSTALL = $(INSTALL_SCRIPT)
 sbinSCRIPT_INSTALL = $(INSTALL_SCRIPT)
 SCRIPTS = $(libexec_SCRIPTS) $(sbin_SCRIPTS)
@@ -172,8 +217,10 @@ HEADERS = $(noinst_HEADERS)
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ABSOLUTE_STRING_H = @ABSOLUTE_STRING_H@
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
+ALLOCA_H = @ALLOCA_H@
 AMANDA_DBGDIR = @AMANDA_DBGDIR@
 AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@
 AMANDA_TMPDIR = @AMANDA_TMPDIR@
@@ -188,18 +235,17 @@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@
 AMTAR = @AMTAR@
 AM_CFLAGS = @AM_CFLAGS@
 AR = @AR@
+ARPA_INET_H = @ARPA_INET_H@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
-AWK_VAR_ASSIGNMENT_OPT = @AWK_VAR_ASSIGNMENT_OPT@
 BINARY_OWNER = @BINARY_OWNER@
-BUILD_MAN_PAGES_FALSE = @BUILD_MAN_PAGES_FALSE@
-BUILD_MAN_PAGES_TRUE = @BUILD_MAN_PAGES_TRUE@
 CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
+CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
 CHIO = @CHIO@
 CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
@@ -232,18 +278,40 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
+ENABLE_MANPAGE_BUILD_FALSE = @ENABLE_MANPAGE_BUILD_FALSE@
+ENABLE_MANPAGE_BUILD_TRUE = @ENABLE_MANPAGE_BUILD_TRUE@
+EOVERFLOW = @EOVERFLOW@
+EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@
 EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
+GCC_COMPILER_FALSE = @GCC_COMPILER_FALSE@
+GCC_COMPILER_TRUE = @GCC_COMPILER_TRUE@
 GETCONF = @GETCONF@
+GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@
+GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
 GNUTAR_LISTED_INCREMENTAL_DIRX = @GNUTAR_LISTED_INCREMENTAL_DIRX@
 GREP = @GREP@
 GZIP = @GZIP@
-HAVE_XSLTPROC_FALSE = @HAVE_XSLTPROC_FALSE@
-HAVE_XSLTPROC_TRUE = @HAVE_XSLTPROC_TRUE@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRNDUP = @HAVE_STRNDUP@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE__BOOL = @HAVE__BOOL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -252,22 +320,31 @@ LDFLAGS = @LDFLAGS@
 LEX = @LEX@
 LEXLIB = @LEXLIB@
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
+LIBPTH = @LIBPTH@
+LIBPTH_PREFIX = @LIBPTH_PREFIX@
 LIBS = @LIBS@
+LIBTHREAD = @LIBTHREAD@
 LIBTOOL = @LIBTOOL@
 LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LL_FMT = @LL_FMT@
 LL_RFMT = @LL_RFMT@
 LN_S = @LN_S@
 LTALLOCA = @LTALLOCA@
+LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
 LTLIBOBJS = @LTLIBOBJS@
+LTLIBPTH = @LTLIBPTH@
+LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
 MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@
 MCUTIL = @MCUTIL@
+MKDIR_P = @MKDIR_P@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
+NETINET_IN_H = @NETINET_IN_H@
 OBJEXT = @OBJEXT@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -281,6 +358,9 @@ PERL = @PERL@
 PRINT = @PRINT@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
+REPLACE_STRCASECMP = @REPLACE_STRCASECMP@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRSTR = @REPLACE_STRSTR@
 RESTORE = @RESTORE@
 SAMBA_CLIENT = @SAMBA_CLIENT@
 SERVICE_SUFFIX = @SERVICE_SUFFIX@
@@ -289,7 +369,10 @@ SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 SNAPSHOT_STAMP = @SNAPSHOT_STAMP@
 SORT = @SORT@
+SSH = @SSH@
+STDBOOL_H = @STDBOOL_H@
 STRIP = @STRIP@
+SYS_SOCKET_H = @SYS_SOCKET_H@
 USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@
 VDUMP = @VDUMP@
 VERSION = @VERSION@
@@ -328,6 +411,7 @@ WANT_TAPE_TRUE = @WANT_TAPE_TRUE@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
 XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
 YACC = @YACC@
 ac_c = @ac_c@
 ac_ct_AR = @ac_ct_AR@
@@ -354,6 +438,8 @@ build_os = @build_os@
 build_vendor = @build_vendor@
 datadir = @datadir@
 exec_prefix = @exec_prefix@
+gl_LIBOBJS = @gl_LIBOBJS@
+gl_LTLIBOBJS = @gl_LTLIBOBJS@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -379,8 +465,9 @@ target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
 INCLUDES = -I$(top_builddir)/common-src \
-               -I$(top_srcdir)/common-src \
-               -I$(top_srcdir)/amandad-src
+               -I$(top_srcdir)/common-src   \
+               -I$(top_srcdir)/amandad-src  \
+               -I$(top_srcdir)/gnulib
 
 LINT = @AMLINT@
 LINTFLAGS = @AMLINTFLAGS@
@@ -392,7 +479,7 @@ libexec_SCRIPTS = patch-system
 @WANT_RUNTIME_PSEUDO_RELOC_TRUE@AM_LDFLAGS = -Wl,-enable-runtime-pseudo-reloc
 libamclient_la_SOURCES = amandates.c           getfsent.c      \
                        unctime.c               client_util.c   \
-                       clientconf.c            $(samba_sources)
+                       $(samba_sources)
 
 libamclient_la_LDFLAGS = -release $(VERSION)
 
@@ -405,7 +492,8 @@ libamclient_la_LDFLAGS = -release $(VERSION)
 LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
        libamclient.$(LIB_EXTENSION) \
        ../amandad-src/libamandad.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION)
+       ../common-src/libamanda.$(LIB_EXTENSION) \
+       ../gnulib/libgnu.$(LIB_EXTENSION)
 
 SUFFIXES = .sh .pl
 
@@ -419,8 +507,7 @@ sendbackup_SOURCES = sendbackup.c           sendbackup.h      \
                        sendbackup-dump.c       sendbackup-gnutar.c
 
 noinst_HEADERS = amandates.h   getfsent.h      \
-                       findpass.h      client_util.h   \
-                       clientconf.h
+                       findpass.h      client_util.h
 
 getfsent_SOURCES = getfsent.test.c
 all: all-am
@@ -593,7 +680,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amandates.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/calcsize.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/client_util.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clientconf.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/findpass.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getfsent.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getfsent.test.Po@am__quote@
index 51cd23eaaf6aa745285de5ddc8667fb99b634a4f..6335a9b42d8de638ca13d672f63f88af08b2232f 100644 (file)
@@ -24,7 +24,7 @@
  * file named AUTHORS, in the root directory of this distribution.
  */
 /*
- * $Id: amandates.h,v 1.5.2.1 2006/11/01 15:31:06 martinea Exp $
+ * $Id: amandates.h,v 1.5 2006/07/25 18:35:21 martinea Exp $
  *
  * interface for amandates file
  */
index c6518b94aaa64c720b30535c3a420a82584c5fb0..7d8ad04f0fa276b1ebf9ffd16c57a714f99453b5 100644 (file)
@@ -24,7 +24,7 @@
  * file named AUTHORS, in the root directory of this distribution.
  */
 /* 
- * $Id: calcsize.c,v 1.44.2.1 2006/10/19 18:47:25 martinea Exp $
+ * $Id: calcsize.c,v 1.44 2006/07/25 18:27:56 martinea Exp $
  *
  * traverse directory tree to get backup size estimates
  *
@@ -157,7 +157,7 @@ main(
 #else
     int i;
     char *dirname=NULL;
-    char *amname=NULL, *qamname = NULL;
+    char *amname=NULL, *qamname=NULL;
     char *filename=NULL, *qfilename = NULL;
     unsigned long malloc_hist_1, malloc_size_1;
     unsigned long malloc_hist_2, malloc_size_2;
@@ -168,7 +168,7 @@ main(
     set_pname("calcsize");
 
     dbopen(DBG_SUBDIR_CLIENT);
-    dbprintf(("%s: version %s\n", debug_prefix(NULL), version()));
+    dbprintf(("%s: version %s\n", debug_prefix_time(NULL), version()));
 
     malloc_size_1 = malloc_inuse(&malloc_hist_1);
 
@@ -330,11 +330,6 @@ main(
 
        amflock(1, "size");
 
-       if (fseek(stderr, 0L, SEEK_END) < 0) {
-           dbprintf(("calcsize: warning - seek failed: %s\n",
-                     strerror(errno)));
-       }
-
        dbprintf(("calcsize: %s %d SIZE " OFF_T_FMT "\n",
               qamname, dumplevel[i],
               (OFF_T_FMT_TYPE)final_size(i, dirname)));
index 71ce4b4c6443c8152d97fb176b4b10bdfb4b6db4..bba8b184b5b5103cae0958dd9f6656b7eeef565b 100644 (file)
  */
 
 #include "amanda.h"
+#include "conffile.h"
 #include "client_util.h"
 #include "getfsent.h"
 #include "util.h"
+#include "pipespawn.h"
 
 #define MAXMAXDUMPS 16
 
@@ -153,7 +155,7 @@ build_name(
        afilename = newvstralloc(afilename, dbgdir, filename, NULL);
        quoted = quote_string(afilename);
        dbprintf(("%s: Cannot create %s (%s)\n",
-                       debug_prefix(NULL), quoted, strerror(errno)));
+                       debug_prefix_time(NULL), quoted, strerror(errno)));
        if(verbose) {
            printf("ERROR [cannot create %s (%s)]\n",
                        quoted, strerror(errno));
@@ -218,7 +220,7 @@ add_include(
     if (strncmp(ainc, "./", 2) != 0) {
         quoted = quote_string(ainc);
         dbprintf(("%s: include must start with './' (%s)\n",
-                 debug_prefix(NULL), quoted));
+                 debug_prefix_time(NULL), quoted));
        if(verbose) {
            printf("ERROR [include must start with './' (%s)]\n", quoted);
        }
@@ -246,7 +248,7 @@ add_include(
            if((d = opendir(device)) == NULL) {
                quoted = quote_string(device);
                dbprintf(("%s: Can't open disk %s\n",
-                     debug_prefix(NULL), quoted));
+                     debug_prefix_time(NULL), quoted));
                if(verbose) {
                    printf("ERROR [Can't open disk %s]\n", quoted);
                }
@@ -328,7 +330,7 @@ build_exclude(
                    else {
                        quoted = quote_string(exclname);
                        dbprintf(("%s: Can't open exclude file %s (%s)\n",
-                                 debug_prefix(NULL),
+                                 debug_prefix_time(NULL),
                                  quoted, strerror(errno)));
                        if(verbose && (options->exclude_optional == 0 ||
                                       errno != ENOENT)) {
@@ -345,7 +347,7 @@ build_exclude(
        else {
            quoted = quote_string(filename);
            dbprintf(("%s: Can't create exclude file %s (%s)\n",
-                     debug_prefix(NULL),
+                     debug_prefix_time(NULL),
                      quoted, strerror(errno)));
            if(verbose) {
                printf("ERROR [Can't create exclude file %s (%s)]\n",
@@ -411,7 +413,7 @@ build_include(
                    else {
                        quoted = quote_string(inclname);
                        dbprintf(("%s: Can't open include file %s (%s)\n",
-                                 debug_prefix(NULL), quoted, strerror(errno)));
+                                 debug_prefix_time(NULL), quoted, strerror(errno)));
                        if(verbose && (options->include_optional == 0 ||
                                       errno != ENOENT)) {
                            printf("ERROR [Can't open include file %s (%s)]\n",
@@ -427,7 +429,7 @@ build_include(
        else {
            quoted = quote_string(filename);
            dbprintf(("%s: Can't create include file %s (%s)\n",
-                     debug_prefix(NULL), quoted, strerror(errno)));
+                     debug_prefix_time(NULL), quoted, strerror(errno)));
            if(verbose) {
                printf("ERROR [Can't create include file %s (%s)]\n",
                        quoted, strerror(errno));
@@ -438,7 +440,7 @@ build_include(
        
     if(nb_exp == 0) {
        quoted = quote_string(disk);
-       dbprintf(("%s: No include for %s\n", debug_prefix(NULL), quoted));
+       dbprintf(("%s: No include for %s\n", debug_prefix_time(NULL), quoted));
        if(verbose && options->include_optional == 0) {
            printf("ERROR [No include for %s]\n", quoted);
        }
@@ -454,7 +456,7 @@ init_options(
     option_t *options)
 {
     options->str = NULL;
-    options->compress = NO_COMPR;
+    options->compress = COMP_NONE;
     options->srvcompprog = NULL;
     options->clntcompprog = NULL;
     options->encrypt = ENCRYPT_NONE;
@@ -504,7 +506,7 @@ parse_options(
            if(options->auth != NULL) {
                quoted = quote_string(tok + 5);
                dbprintf(("%s: multiple auth option %s\n",
-                         debug_prefix(NULL), quoted));
+                         debug_prefix_time(NULL), quoted));
                if(verbose) {
                    printf("ERROR [multiple auth option %s]\n", quoted);
                }
@@ -516,7 +518,7 @@ parse_options(
           && BSTRNCMP(tok, "bsd-auth") == 0) {
            if(options->auth != NULL) {
                dbprintf(("%s: multiple auth option\n",
-                         debug_prefix(NULL)));
+                         debug_prefix_time(NULL)));
                if(verbose) {
                    printf("ERROR [multiple auth option]\n");
                }
@@ -527,7 +529,7 @@ parse_options(
           && BSTRNCMP(tok, "krb4-auth") == 0) {
            if(options->auth != NULL) {
                dbprintf(("%s: multiple auth option\n",
-                         debug_prefix(NULL)));
+                         debug_prefix_time(NULL)));
                if(verbose) {
                    printf("ERROR [multiple auth option]\n");
                }
@@ -535,72 +537,72 @@ parse_options(
            options->auth = stralloc("krb4");
        }
        else if(BSTRNCMP(tok, "compress-fast") == 0) {
-           if(options->compress != NO_COMPR) {
+           if(options->compress != COMP_NONE) {
                dbprintf(("%s: multiple compress option\n",
-                         debug_prefix(NULL)));
+                         debug_prefix_time(NULL)));
                if(verbose) {
                    printf("ERROR [multiple compress option]\n");
                }
            }
-           options->compress = COMPR_FAST;
+           options->compress = COMP_FAST;
        }
        else if(BSTRNCMP(tok, "compress-best") == 0) {
-           if(options->compress != NO_COMPR) {
+           if(options->compress != COMP_NONE) {
                dbprintf(("%s: multiple compress option\n",
-                         debug_prefix(NULL)));
+                         debug_prefix_time(NULL)));
                if(verbose) {
                    printf("ERROR [multiple compress option]\n");
                }
            }
-           options->compress = COMPR_BEST;
+           options->compress = COMP_BEST;
        }
        else if(BSTRNCMP(tok, "srvcomp-fast") == 0) {
-           if(options->compress != NO_COMPR) {
+           if(options->compress != COMP_NONE) {
                dbprintf(("%s: multiple compress option\n",
-                         debug_prefix(NULL)));
+                         debug_prefix_time(NULL)));
                if(verbose) {
                    printf("ERROR [multiple compress option]\n");
                }
            }
-           options->compress = COMPR_SERVER_FAST;
+           options->compress = COMP_SERVER_FAST;
        }
        else if(BSTRNCMP(tok, "srvcomp-best") == 0) {
-           if(options->compress != NO_COMPR) {
+           if(options->compress != COMP_NONE) {
                dbprintf(("%s: multiple compress option\n",
-                         debug_prefix(NULL)));
+                         debug_prefix_time(NULL)));
                if(verbose) {
                    printf("ERROR [multiple compress option]\n");
                }
            }
-           options->compress = COMPR_SERVER_BEST;
+           options->compress = COMP_SERVER_BEST;
        }
        else if(BSTRNCMP(tok, "srvcomp-cust=") == 0) {
-           if(options->compress != NO_COMPR) {
+           if(options->compress != COMP_NONE) {
                dbprintf(("%s: multiple compress option\n", 
-                         debug_prefix(NULL)));
+                         debug_prefix_time(NULL)));
                if(verbose) {
                    printf("ERROR [multiple compress option]\n");
                }
            }
            options->srvcompprog = stralloc(tok + SIZEOF("srvcomp-cust=") -1);
-           options->compress = COMPR_SERVER_CUST;
+           options->compress = COMP_SERVER_CUST;
        }
        else if(BSTRNCMP(tok, "comp-cust=") == 0) {
-           if(options->compress != NO_COMPR) {
+           if(options->compress != COMP_NONE) {
                dbprintf(("%s: multiple compress option\n", 
-                         debug_prefix(NULL)));
+                         debug_prefix_time(NULL)));
                if(verbose) {
                    printf("ERROR [multiple compress option]\n");
                }
            }
            options->clntcompprog = stralloc(tok + SIZEOF("comp-cust=") -1);
-           options->compress = COMPR_CUST;
+           options->compress = COMP_CUST;
            /* parse encryption options */
        } 
        else if(BSTRNCMP(tok, "encrypt-serv-cust=") == 0) {
            if(options->encrypt != ENCRYPT_NONE) {
                dbprintf(("%s: multiple encrypt option\n", 
-                         debug_prefix(NULL)));
+                         debug_prefix_time(NULL)));
                if(verbose) {
                    printf("ERROR [multiple encrypt option]\n");
                }
@@ -611,7 +613,7 @@ parse_options(
        else if(BSTRNCMP(tok, "encrypt-cust=") == 0) {
            if(options->encrypt != ENCRYPT_NONE) {
                dbprintf(("%s: multiple encrypt option\n", 
-                         debug_prefix(NULL)));
+                         debug_prefix_time(NULL)));
                if(verbose) {
                    printf("ERROR [multiple encrypt option]\n");
                }
@@ -628,7 +630,7 @@ parse_options(
        else if(BSTRNCMP(tok, "no-record") == 0) {
            if(options->no_record != 0) {
                dbprintf(("%s: multiple no-record option\n",
-                         debug_prefix(NULL)));
+                         debug_prefix_time(NULL)));
                if(verbose) {
                    printf("ERROR [multiple no-record option]\n");
                }
@@ -638,7 +640,7 @@ parse_options(
        else if(BSTRNCMP(tok, "index") == 0) {
            if(options->createindex != 0) {
                dbprintf(("%s: multiple index option\n",
-                         debug_prefix(NULL)));
+                         debug_prefix_time(NULL)));
                if(verbose) {
                    printf("ERROR [multiple index option]\n");
                }
@@ -648,7 +650,7 @@ parse_options(
        else if(BSTRNCMP(tok, "exclude-optional") == 0) {
            if(options->exclude_optional != 0) {
                dbprintf(("%s: multiple exclude-optional option\n",
-                         debug_prefix(NULL)));
+                         debug_prefix_time(NULL)));
                if(verbose) {
                    printf("ERROR [multiple exclude-optional option]\n");
                }
@@ -658,7 +660,7 @@ parse_options(
        else if(strcmp(tok, "include-optional") == 0) {
            if(options->include_optional != 0) {
                dbprintf(("%s: multiple include-optional option\n",
-                         debug_prefix(NULL)));
+                         debug_prefix_time(NULL)));
                if(verbose) {
                    printf("ERROR [multiple include-optional option]\n");
                }
@@ -688,7 +690,7 @@ parse_options(
        else if(strcmp(tok,"|") != 0) {
            quoted = quote_string(tok);
            dbprintf(("%s: unknown option %s\n",
-                       debug_prefix(NULL), quoted));
+                       debug_prefix_time(NULL), quoted));
            if(verbose) {
                printf("ERROR [unknown option: %s]\n", quoted);
            }
@@ -699,3 +701,162 @@ parse_options(
     amfree(p);
     return options;
 }
+
+void
+output_tool_property(
+    FILE     *tool,
+    option_t *options)
+{
+    sle_t *sle;
+    char *q;
+
+    if (!is_empty_sl(options->exclude_file)) {
+       for(sle = options->exclude_file->first ; sle != NULL; sle=sle->next) {
+           q = quote_string(sle->name);
+           fprintf(tool, "EXCLUDE-FILE %s\n", q);
+           amfree(q);
+       }
+    }
+
+    if (!is_empty_sl(options->exclude_list)) {
+       for(sle = options->exclude_list->first ; sle != NULL; sle=sle->next) {
+           q = quote_string(sle->name);
+           fprintf(tool, "EXCLUDE-LIST %s\n", q);
+           amfree(q);
+       }
+    }
+
+    if (!is_empty_sl(options->include_file)) {
+       for(sle = options->include_file->first ; sle != NULL; sle=sle->next) {
+           q = quote_string(sle->name);
+           fprintf(tool, "INCLUDE-FILE %s\n", q);
+           amfree(q);
+       }
+    }
+
+    if (!is_empty_sl(options->include_list)) {
+       for(sle = options->include_list->first ; sle != NULL; sle=sle->next) {
+           q = quote_string(sle->name);
+           fprintf(tool, "INCLUDE-LIST %s\n", q);
+           amfree(q);
+       }
+    }
+
+    if (!is_empty_sl(options->exclude_file) ||
+       !is_empty_sl(options->exclude_list)) {
+       if (options->exclude_optional)
+           fprintf(tool, "EXCLUDE-OPTIONAL YES\n");
+       else
+           fprintf(tool, "EXCLUDE-OPTIONAL NO\n");
+    }
+
+    if (!is_empty_sl(options->include_file) ||
+       !is_empty_sl(options->include_list)) {
+       if (options->include_optional)
+           fprintf(tool, "INCLUDE-OPTIONAL YES\n");
+       else
+           fprintf(tool, "INCLUDE-OPTIONAL NO\n");
+    }
+}
+
+backup_support_option_t *
+backup_support_option(
+    char       *program,
+    g_option_t *g_options,
+    char       *disk,
+    char       *amdevice)
+{
+    pid_t   supportpid;
+    int     supportin, supportout, supporterr;
+    char   *cmd;
+    char  **argvchild;
+    int     i;
+    FILE   *streamout;
+    char   *line;
+    backup_support_option_t *bsu;
+
+    cmd = vstralloc(DUMPER_DIR, "/", program, NULL);
+    argvchild = malloc(5 * SIZEOF(char *));
+    i = 0;
+    argvchild[i++] = program;
+    argvchild[i++] = "support";
+    if (g_options->config) {
+       argvchild[i++] = "--config";
+       argvchild[i++] = g_options->config;
+    }
+    if (g_options->hostname) {
+       argvchild[i++] = "--host";
+       argvchild[i++] = g_options->hostname;
+    }
+    if (disk) {
+       argvchild[i++] = "--disk";
+       argvchild[i++] = disk;
+    }
+    if (amdevice) {
+       argvchild[i++] = "--device";
+       argvchild[i++] = amdevice;
+    }
+    argvchild[i++] = NULL;
+
+    supporterr = fileno(stderr);
+    supportpid = pipespawnv(cmd, STDIN_PIPE|STDOUT_PIPE, &supportin,
+                           &supportout, &supporterr, argvchild);
+
+    aclose(supportin);
+
+    bsu = malloc(SIZEOF(*bsu));
+    memset(bsu, '\0', SIZEOF(*bsu));
+    streamout = fdopen(supportout, "r");
+    while((line = agets(streamout)) != NULL) {
+       dbprintf(("support line: %s\n", line));
+       if (strncmp(line,"CONFIG ", 7) == 0) {
+           if (strcmp(line+7, "YES") == 0)
+               bsu->config = 1;
+       } else if (strncmp(line,"HOST ", 5) == 0) {
+           if (strcmp(line+5, "YES") == 0)
+           bsu->host = 1;
+       } else if (strncmp(line,"DISK ", 5) == 0) {
+           if (strcmp(line+5, "YES") == 0)
+               bsu->host = 1;
+       } else if (strncmp(line,"INDEX-LINE ", 11) == 0) {
+           if (strcmp(line+11, "YES") == 0)
+               bsu->index_line = 1;
+       } else if (strncmp(line,"INDEX-XML ", 10) == 0) {
+           if (strcmp(line+10, "YES") == 0)
+               bsu->index_xml = 1;
+       } else if (strncmp(line,"MESSAGE-LINE ", 13) == 0) {
+           if (strcmp(line+13, "YES") == 0)
+               bsu->message_line = 1;
+       } else if (strncmp(line,"MESSAGE-XML ", 12) == 0) {
+           if (strcmp(line+12, "YES") == 0)
+               bsu->message_xml = 1;
+       } else if (strncmp(line,"RECORD ", 7) == 0) {
+           if (strcmp(line+7, "YES") == 0)
+               bsu->record = 1;
+       } else if (strncmp(line,"INCLUDE-FILE ", 13) == 0) {
+           if (strcmp(line+13, "YES") == 0)
+               bsu->include_file = 1;
+       } else if (strncmp(line,"INCLUDE-LIST ", 13) == 0) {
+           if (strcmp(line+13, "YES") == 0)
+               bsu->include_list = 1;
+       } else if (strncmp(line,"EXCLUDE-FILE ", 13) == 0) {
+           if (strcmp(line+13, "YES") == 0)
+               bsu->exclude_file = 1;
+       } else if (strncmp(line,"EXCLUDE-LIST ", 13) == 0) {
+           if (strcmp(line+13, "YES") == 0)
+               bsu->exclude_list = 1;
+       } else if (strncmp(line,"COLLECTION ", 11) == 0) {
+           if (strcmp(line+11, "YES") == 0)
+               bsu->collection = 1;
+       } else if (strncmp(line,"MAX-LEVEL ", 10) == 0) {
+           bsu->max_level  = atoi(line+10);
+       } else {
+           dbprintf(("Invalid support line: %s\n", line));
+       }
+       amfree(line);
+    }
+    aclose(supportout);
+
+    return NULL;
+}
+
index 0745a3109574d6ae36fc72c44776b0995dc4e7d4..e3f4d7a55e40bf7026e6d3c6e07be973aa7a5e8c 100644 (file)
 #define CLIENT_UTIL_H
 
 #include "amanda.h"
+#include "conffile.h"
 #include "amfeatures.h"
 #include "sl.h"
 #include "util.h"              /* for bstrncmp() */
+#include "amandad.h"           /* for g_option_t */
 
 typedef struct option_s {
     char *str;
@@ -57,17 +59,24 @@ typedef struct option_s {
     int include_optional;
 } option_t;
 
-#define NO_COMPR   0
-#define COMPR_FAST 1
-#define COMPR_BEST 2
-#define COMPR_SERVER_FAST 3
-#define COMPR_SERVER_BEST 4
-#define COMPR_SERVER_CUST 5    /* server-side custom compression */
-#define COMPR_CUST 6            /* client-side custom compression */
-
-#define ENCRYPT_NONE         0 /* no encryption  */
-#define ENCRYPT_CUST         1 /* client-side custom encryption */
-#define ENCRYPT_SERV_CUST    2 /* server-side custom encryption */
+typedef struct backup_support_option_s {
+    int config;
+    int host;
+    int disk;
+    int max_level;
+    int index_line;
+    int index_xml;
+    int message_line;
+    int message_xml;
+    int record;
+    int include_file;
+    int include_list;
+    int include_optional;
+    int exclude_file;
+    int exclude_list;
+    int exclude_optional;
+    int collection;
+} backup_support_option_t;
 
 char *build_exclude(char *disk, char *device, option_t *options, int verbose);
 char *build_include(char *disk, char *device, option_t *options, int verbose);
@@ -77,7 +86,11 @@ option_t *parse_options(char *str,
                           char *device,
                           am_feature_t *features,
                           int verbose);
-
+void output_tool_property(FILE *tool, option_t *options);
 char *fixup_relative(char *name, char *device);
+backup_support_option_t *backup_support_option(char *program,
+                                              g_option_t *g_options,
+                                              char *disk,
+                                              char *amdevice);
 
 #endif
diff --git a/client-src/clientconf.c b/client-src/clientconf.c
deleted file mode 100644 (file)
index bdb63c4..0000000
+++ /dev/null
@@ -1,649 +0,0 @@
-/*
- * Amanda, The Advanced Maryland Automatic Network Disk Archiver
- * Copyright (c) 1991-2000 University of Maryland at College Park
- * All Rights Reserved.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of U.M. not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission.  U.M. makes no representations about the
- * suitability of this software for any purpose.  It is provided "as is"
- * without express or implied warranty.
- *
- * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Author: James da Silva, Systems Design and Analysis Group
- *                        Computer Science Department
- *                        University of Maryland at College Park
- */
-/*
- * $Id: clientconf.c,v 1.17.2.2 2007/01/24 18:33:29 martinea Exp $
- *
- * read configuration file
- */
-/*
- *
- * XXX - I'm not happy *at all* with this implementation, but I don't
- * think YACC would be any easier.  A more table based implementation
- * would be better.  Also clean up memory leaks.
- */
-#include "amanda.h"
-#include "arglist.h"
-#include "util.h"
-#include "clientconf.h"
-#include "clock.h"
-
-#ifndef AMANDATES_FILE
-#define AMANDATES_FILE "/etc/amandates"
-#endif
-
-/* configuration parameters */
-static char *cln_config_dir = NULL;
-
-val_t client_conf[CLN_CLN];
-
-command_option_t *client_options      = NULL;
-int               client_options_size = 0;
-
-/* predeclare local functions */
-
-static void init_defaults(void);
-static void read_conffile_recursively(char *filename);
-
-static int read_confline(void);
-
-keytab_t client_keytab[] = {
-    { "CONF", CONF_CONF },
-    { "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_USERNAME", CONF_CLIENT_USERNAME },
-    { "GNUTAR_LIST_DIR", CONF_GNUTAR_LIST_DIR },
-    { "AMANDATES", CONF_AMANDATES },
-    { "INCLUDEFILE", CONF_INCLUDEFILE },
-    { NULL, CONF_UNKNOWN },
-};
-
-t_conf_var client_var [] = {
-   { CONF_CONF           , CONFTYPE_STRING, read_string, CLN_CONF           , NULL },
-   { CONF_INDEX_SERVER   , CONFTYPE_STRING, read_string, CLN_INDEX_SERVER   , NULL },
-   { CONF_TAPE_SERVER    , CONFTYPE_STRING, read_string, CLN_TAPE_SERVER    , NULL },
-   { CONF_TAPEDEV        , CONFTYPE_STRING, read_string, CLN_TAPEDEV        , NULL },
-   { CONF_AUTH           , CONFTYPE_STRING, read_string, CLN_AUTH           , NULL },
-   { CONF_SSH_KEYS       , CONFTYPE_STRING, read_string, CLN_SSH_KEYS       , NULL },
-   { CONF_AMANDAD_PATH   , CONFTYPE_STRING, read_string, CLN_AMANDAD_PATH   , NULL },
-   { CONF_CLIENT_USERNAME, CONFTYPE_STRING, read_string, CLN_CLIENT_USERNAME, NULL },
-   { CONF_GNUTAR_LIST_DIR, CONFTYPE_STRING, read_string, CLN_GNUTAR_LIST_DIR, NULL },
-   { CONF_AMANDATES      , CONFTYPE_STRING, read_string, CLN_AMANDATES      , NULL },
-   { CONF_UNKNOWN        , CONFTYPE_INT   , NULL       , CLN_CLN            , NULL }
-};
-
-static int first_file = 1;
-
-/*
-** ------------------------
-**  External entry points
-** ------------------------
-*/
-
-/* return  0 on success        */
-/* return  1 on error          */
-/* return -1 if file not found */
-
-int read_clientconf(
-    char *filename)
-{
-    if(first_file == 1) {
-       init_defaults();
-       first_file = 0;
-    } else {
-       allow_overwrites = 1;
-    }
-
-    /* We assume that conf_confname & conf are initialized to NULL above */
-    read_conffile_recursively(filename);
-
-    command_overwrite(client_options, client_var, client_keytab, client_conf,
-                     "");
-
-    return got_parserror;
-}
-
-
-char *
-client_getconf_byname(
-    char *     str)
-{
-    static char *tmpstr;
-    char number[NUM_STR_SIZE];
-    t_conf_var *np;
-    keytab_t *kt;
-    char *s;
-    char ch;
-
-    tmpstr = stralloc(str);
-    s = tmpstr;
-    while((ch = *s++) != '\0') {
-       if(islower((int)ch))
-           s[-1] = (char)toupper(ch);
-    }
-
-    for(kt = client_keytab; kt->token != CONF_UNKNOWN; kt++)
-       if(kt->keyword && strcmp(kt->keyword, tmpstr) == 0) break;
-
-    if(kt->token == CONF_UNKNOWN) return NULL;
-
-    for(np = client_var; np->token != CONF_UNKNOWN; np++)
-       if(np->token == kt->token) break;
-
-    if(np->type == CONFTYPE_INT) {
-       snprintf(number, SIZEOF(number), "%d", client_getconf_int(np->parm));
-       tmpstr = newstralloc(tmpstr, number);
-    } else if(np->type == CONFTYPE_BOOL) {
-       if(client_getconf_boolean(np->parm) == 0) {
-           tmpstr = newstralloc(tmpstr, "off");
-       }
-       else {
-           tmpstr = newstralloc(tmpstr, "on");
-       }
-    } else if(np->type == CONFTYPE_REAL) {
-       snprintf(number, SIZEOF(number), "%lf", client_getconf_real(np->parm));
-       tmpstr = newstralloc(tmpstr, number);
-    } else {
-       tmpstr = newstralloc(tmpstr, client_getconf_str(np->parm));
-    }
-
-    return tmpstr;
-}
-
-int
-client_getconf_seen(
-    cconfparm_t parm)
-{
-    t_conf_var *np;
-    np = get_np(client_var, parm);
-    return(client_conf[np->parm].seen);
-}
-
-int
-client_getconf_boolean(
-    cconfparm_t        parm)
-{
-    t_conf_var *np;
-    np = get_np(client_var, parm);
-    if (np->type != CONFTYPE_BOOL) {
-       error("client_getconf_boolean: np is not a CONFTYPE_BOOL");
-       /*NOTREACHED*/
-    }
-    return(client_conf[np->parm].v.i != 0);
-}
-
-int
-client_getconf_int(
-    cconfparm_t        parm)
-{
-    t_conf_var *np;
-    np = get_np(client_var, parm);
-    if (np->type != CONFTYPE_INT) {
-       error("client_getconf_int: np is not a CONFTYPE_INT");
-       /*NOTREACHED*/
-    }
-
-    return(client_conf[np->parm].v.i);
-}
-
-off_t
-client_getconf_am64(
-    cconfparm_t        parm)
-{
-    t_conf_var *np;
-    np = get_np(client_var, parm);
-    if (np->type != CONFTYPE_AM64) {
-       error("client_getconf_am64: np is not a CONFTYPE_AM64");
-       /*NOTREACHED*/
-    }
-    return(client_conf[np->parm].v.am64);
-}
-
-double
-client_getconf_real(
-    cconfparm_t        parm)
-{
-    t_conf_var *np;
-    np = get_np(client_var, parm);
-    if (np->type != CONFTYPE_REAL) {
-       error("client_getconf_real: np is not a CONFTYPE_REAL");
-       /*NOTREACHED*/
-    }
-    return(client_conf[np->parm].v.r);
-}
-
-char *
-client_getconf_str(
-    cconfparm_t parm)
-{
-    t_conf_var *np;
-    np = get_np(client_var, parm);
-    if (np->type != CONFTYPE_STRING) {
-       error("client_getconf_string: np is not a CONFTYPE_STRING");
-       /*NOTREACHED*/
-    }
-    return(client_conf[np->parm].v.s);
-}
-
-/*
-** ------------------------
-**  Internal routines
-** ------------------------
-*/
-
-
-static void
-init_defaults(void)
-{
-    char *s;
-
-    /* defaults for exported variables */
-
-#ifdef DEFAULT_CONFIG
-    s = DEFAULT_CONFIG;
-#else
-    s = "";
-#endif
-    conf_init_string(&client_conf[CLN_CONF], s);
-
-#ifdef DEFAULT_SERVER
-    s = DEFAULT_SERVER;
-#else
-    s = "";
-#endif
-    conf_init_string(&client_conf[CLN_INDEX_SERVER], s);
-
-
-#ifdef DEFAULT_TAPE_SERVER
-    s = DEFAULT_TAPE_SERVER;
-#else
-#ifdef DEFAULT_SERVER
-    s = DEFAULT_SERVER;
-#else
-    s = "";
-#endif
-#endif
-    conf_init_string(&client_conf[CLN_TAPE_SERVER], s);
-
-#ifdef DEFAULT_TAPE_DEVICE
-    s = DEFAULT_TAPE_DEVICE;
-#else
-    s = NULL;
-#endif
-    conf_init_string(&client_conf[CLN_TAPEDEV], s);
-
-    conf_init_string(&client_conf[CLN_AUTH], "bsd");
-    conf_init_string(&client_conf[CLN_SSH_KEYS], "");
-    conf_init_string(&client_conf[CLN_AMANDAD_PATH], "");
-    conf_init_string(&client_conf[CLN_CLIENT_USERNAME], "");
-#ifdef GNUTAR_LISTED_INCREMENTAL_DIR
-    conf_init_string(&client_conf[CLN_GNUTAR_LIST_DIR],
-                    GNUTAR_LISTED_INCREMENTAL_DIR);
-#else
-    conf_init_string(&client_conf[CLN_GNUTAR_LIST_DIR], NULL);
-#endif
-    conf_init_string(&client_conf[CLN_AMANDATES], AMANDATES_FILE);
-    /* defaults for internal variables */
-
-    conf_line_num = got_parserror = 0;
-    allow_overwrites = 0;
-    token_pushed = 0;
-
-}
-
-static void
-read_conffile_recursively(
-    char *     filename)
-{
-    /* Save globals used in read_confline(), elsewhere. */
-    int  save_line_num  = conf_line_num;
-    FILE *save_conf     = conf_conf;
-    char *save_confname = conf_confname;
-    int        rc;
-
-    if (*filename == '/' || cln_config_dir == NULL) {
-       conf_confname = stralloc(filename);
-    } else {
-       conf_confname = stralloc2(cln_config_dir, filename);
-    }
-
-    if((conf_conf = fopen(conf_confname, "r")) == NULL) {
-       dbprintf(("Could not open conf file \"%s\": %s\n", conf_confname,
-                 strerror(errno)));
-       amfree(conf_confname);
-       got_parserror = -1;
-       return;
-    }
-    dbprintf(("Reading conf file \"%s\".\n", conf_confname));
-
-    conf_line_num = 0;
-
-    /* read_confline() can invoke us recursively via "includefile" */
-    do {
-       rc = read_confline();
-    } while (rc != 0);
-    afclose(conf_conf);
-
-    amfree(conf_confname);
-
-    /* Restore globals */
-    conf_line_num = save_line_num;
-    conf_conf     = save_conf;
-    conf_confname = save_confname;
-}
-
-
-/* ------------------------ */
-
-
-static int
-read_confline(void)
-{
-    t_conf_var *np;
-
-    keytable = client_keytab;
-
-    conf_line_num += 1;
-    get_conftoken(CONF_ANY);
-    switch(tok) {
-    case CONF_INCLUDEFILE:
-       {
-           char *fn;
-
-           get_conftoken(CONF_STRING);
-           fn = tokenval.v.s;
-           read_conffile_recursively(fn);
-       }
-       break;
-
-    case CONF_NL:      /* empty line */
-       break;
-
-    case CONF_END:     /* end of file */
-       return 0;
-
-    default:
-       {
-           for(np = client_var; np->token != CONF_UNKNOWN; np++)
-               if(np->token == tok) break;
-
-           if(np->token == CONF_UNKNOWN) {
-               conf_parserror("configuration keyword expected");
-           } else {
-               np->read_function(np, &client_conf[np->parm]);
-               if(np->validate)
-                   np->validate(np, &client_conf[np->parm]);
-           }
-       }
-    }
-    if(tok != CONF_NL)
-       get_conftoken(CONF_NL);
-    return 1;
-}
-
-
-
-/* ------------------------ */
-
-#ifdef TEST
-
-static char *cln_config_name = NULL;
-static char *cln_config_dir = NULL;
-
-void
-dump_client_configuration(
-    char *filename)
-{
-    printf("AMANDA CLIENT CONFIGURATION FROM FILE \"%s\":\n\n", filename);
-
-    printf("cln_conf = \"%s\"\n", client_getconf_str(CLN_CONF));
-    printf("cln_index_server = \"%s\"\n", client_getconf_str(CLN_INDEX_SERVER));
-    printf("cln_tape_server = \"%s\"\n", client_getconf_str(CLN_TAPE_SERVER));
-    printf("cln_tapedev = \"%s\"\n", client_getconf_str(CLN_TAPEDEV));
-    printf("cln_auth = \"%s\"\n", client_getconf_str(CLN_AUTH));
-    printf("cln_ssh_keys = \"%s\"\n", client_getconf_str(CLN_SSH_KEYS));
-}
-
-int
-main(
-    int                argc,
-    char **    argv)
-{
-  char *conffile;
-  char *diskfile;
-  disklist_t lst;
-  int result;
-  unsigned long malloc_hist_1, malloc_size_1;
-  unsigned long malloc_hist_2, malloc_size_2;
-
-  safe_fd(-1, 0);
-
-  set_pname("conffile");
-
-  /* Don't die when child closes pipe */
-  signal(SIGPIPE, SIG_IGN);
-
-  malloc_size_1 = malloc_inuse(&malloc_hist_1);
-
-  startclock();
-
-  if (argc > 1) {
-    if (argv[1][0] == '/') {
-      cln_config_dir = stralloc(argv[1]);
-      cln_config_name = strrchr(cln_config_dir, '/') + 1;
-      cln_config_name[-1] = '\0';
-      cln_config_dir = newstralloc2(cln_config_dir, cln_config_dir, "/");
-    } else {
-      cln_config_name = stralloc(argv[1]);
-      cln_config_dir = vstralloc(CONFIG_DIR, "/", cln_config_name, "/", NULL);
-    }
-  } else {
-    char my_cwd[STR_SIZE];
-
-    if (getcwd(my_cwd, SIZEOF(my_cwd)) == NULL) {
-      error("cannot determine current working directory");
-    }
-    cln_config_dir = stralloc2(my_cwd, "/");
-    if ((cln_config_name = strrchr(my_cwd, '/')) != NULL) {
-      cln_config_name = stralloc(cln_config_name + 1);
-    }
-  }
-
-  conffile = stralloc2(cln_config_dir, CONFFILE_NAME);
-  result = read_conffile(conffile);
-  if (result == 0) {
-      diskfile = client_getconf_str(CNF_DISKFILE);
-      if (diskfile != NULL && access(diskfile, R_OK) == 0) {
-         result = read_diskfile(diskfile, &lst);
-      }
-  }
-  dump_client_configuration(CONFFILE_NAME);
-  amfree(conffile);
-
-  malloc_size_2 = malloc_inuse(&malloc_hist_2);
-
-  if(malloc_size_1 != malloc_size_2) {
-    malloc_list(fileno(stderr), malloc_hist_1, malloc_hist_2);
-  }
-
-  return result;
-}
-
-#endif /* TEST */
-
-char *
-generic_client_get_security_conf(
-    char *     string,
-    void *     arg)
-{
-       (void)arg;      /* Quiet unused parameter warning */
-
-       if(!string || !*string)
-               return(NULL);
-
-       if(strcmp(string, "conf")==0) {
-               return(client_getconf_str(CLN_CONF));
-       } else if(strcmp(string, "index_server")==0) {
-               return(client_getconf_str(CLN_INDEX_SERVER));
-       } else if(strcmp(string, "tape_server")==0) {
-               return(client_getconf_str(CLN_TAPE_SERVER));
-       } else if(strcmp(string, "tapedev")==0) {
-               return(client_getconf_str(CLN_TAPEDEV));
-       } else if(strcmp(string, "auth")==0) {
-               return(client_getconf_str(CLN_AUTH));
-       } else if(strcmp(string, "ssh_keys")==0) {
-               return(client_getconf_str(CLN_SSH_KEYS));
-       } else if(strcmp(string, "amandad_path")==0) {
-               return(client_getconf_str(CLN_AMANDAD_PATH));
-       } else if(strcmp(string, "client_username")==0) {
-               return(client_getconf_str(CLN_CLIENT_USERNAME));
-       } else if(strcmp(string, "gnutar_list_dir")==0) {
-               return(client_getconf_str(CLN_GNUTAR_LIST_DIR));
-       } else if(strcmp(string, "amandates")==0) {
-               return(client_getconf_str(CLN_AMANDATES));
-/*
-       } else if(strcmp(string, "krb5principal")==0) {
-               return(client_getconf_str(CNF_KRB5PRINCIPAL));
-       } else if(strcmp(string, "krb5keytab")==0) {
-               return(client_getconf_str(CNF_KRB5KEYTAB));
-*/
-       }
-       return(NULL);
-}
-
-
-void
-parse_client_conf(
-    int parse_argc,
-    char **parse_argv,
-    int *new_argc,
-    char ***new_argv)
-{
-    int i;
-    char **my_argv;
-    char *myarg, *value;
-    command_option_t *client_option;
-
-    client_options = alloc((size_t)(parse_argc+1) * SIZEOF(*client_options));
-    client_options_size = parse_argc+1;
-    client_option = client_options;
-    client_option->name = NULL;
-
-    my_argv = alloc((size_t)parse_argc * SIZEOF(char *));
-    *new_argv = my_argv;
-    *new_argc = 0;
-    i=0;
-    while(i<parse_argc) {
-       if(strncmp(parse_argv[i],"-o",2) == 0) {
-           if(strlen(parse_argv[i]) > 2)
-               myarg = &parse_argv[i][2];
-           else {
-               i++;
-               if(i >= parse_argc)
-                   error("expect something after -o");
-               myarg = parse_argv[i];
-           }
-           value = index(myarg,'=');
-           if (value == NULL) {
-               conf_parserror("Must specify a value for %s.\n", myarg);
-           } else {
-               *value = '\0';
-               value++;
-               client_option->used = 0;
-               client_option->name = stralloc(myarg);
-               client_option->value = stralloc(value);
-               client_option++;
-               client_option->name = NULL;
-           }
-       }
-       else {
-           my_argv[*new_argc] = stralloc(parse_argv[i]);
-           *new_argc += 1;
-       }
-       i++;
-    }
-}
-
-/* return  0 on success             */
-/* return -1 if it is already there */
-/* return -2 if other failure       */
-int
-add_client_conf(
-    cconfparm_t parm,
-    char *value)
-{
-    t_conf_var *np;
-    keytab_t *kt;
-    command_option_t *command_option;
-    int nb_option;
-
-    for(np = client_var; np->token != CONF_UNKNOWN; np++)
-       if(np->parm == (int)parm) break;
-
-    if(np->token == CONF_UNKNOWN) return -2;
-
-    for(kt = client_keytab; kt->token != CONF_UNKNOWN; kt++)
-       if(kt->token == np->token) break;
-
-    if(kt->token == CONF_UNKNOWN) return -2;
-
-    /* Try to find it */
-    nb_option = 0;
-    for(command_option = client_options; command_option->name != NULL;
-                                                       command_option++) {
-       nb_option++;
-    }
-
-    /* Increase size of client_options if needed */
-    if(nb_option >= client_options_size-1) {
-       client_options_size *= 2;
-       client_options = realloc(client_options,
-                               client_options_size * SIZEOF(*client_options));
-       if (client_options == NULL) {
-           error("Can't realloc client_options: %s\n", strerror(errno));
-           /*NOTREACHED*/
-       }
-       for(command_option = client_options; command_option->name != NULL;
-                                                       command_option++) {
-       }
-    }
-
-    /* add it */
-    command_option->used = 0;
-    command_option->name = stralloc(kt->keyword);
-    command_option->value = stralloc(value);
-    command_option++;
-    command_option->name = NULL;
-    return 0;
-}
-
-void
-report_bad_client_arg(void)
-{
-    command_option_t *command_option;
-
-    for(command_option = client_options; command_option->name != NULL;
-                                                       command_option++) {
-       if(command_option->used == 0) {
-           fprintf(stderr,"argument -o%s=%s not used\n",
-                   command_option->name, command_option->value);
-       }
-    }
-}
diff --git a/client-src/clientconf.h b/client-src/clientconf.h
deleted file mode 100644 (file)
index d9157ac..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Amanda, The Advanced Maryland Automatic Network Disk Archiver
- * Copyright (c) 1991-2000 University of Maryland at College Park
- * All Rights Reserved.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of U.M. not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission.  U.M. makes no representations about the
- * suitability of this software for any purpose.  It is provided "as is"
- * without express or implied warranty.
- *
- * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Author: James da Silva, Systems Design and Analysis Group
- *                        Computer Science Department
- *                        University of Maryland at College Park
- */
-/*
- * $Id: clientconf.h,v 1.9 2006/07/25 19:06:46 martinea Exp $
- *
- * interface for client config file reading code
- */
-#ifndef CLIENTCONF_H
-#define CLIENTCONF_H
-
-#include "sl.h"
-
-#define CLIENTCONFFILE_NAME "client.conf"
-
-typedef enum conf_e {
-    CLN_CONF,
-    CLN_INDEX_SERVER,
-    CLN_TAPE_SERVER,
-    CLN_TAPEDEV,
-    CLN_AUTH,
-    CLN_SSH_KEYS,
-    CLN_AMANDAD_PATH,
-    CLN_CLIENT_USERNAME,
-    CLN_GNUTAR_LIST_DIR,
-    CLN_AMANDATES,
-    CLN_CLN
-} cconfparm_t;
-
-extern char *config_name;
-extern char *config_dir;
-
-void parse_client_conf(int, char **, int *, char ***);
-int  add_client_conf(cconfparm_t parm, char *value);
-void report_bad_client_arg(void);
-int read_clientconf(char *filename);
-int client_getconf_seen(cconfparm_t parameter);
-int client_getconf_boolean(cconfparm_t parameter);
-int client_getconf_int(cconfparm_t parameter);
-off_t client_getconf_am64(cconfparm_t parameter);
-double client_getconf_real(cconfparm_t parameter);
-char *client_getconf_str(cconfparm_t parameter);
-char *client_getconf_byname(char *confname);
-
-/* this is in securityconf.h */
-char *generic_client_get_security_conf(char *, void *);
-#endif /* ! CONFFILE_H */
index d29953bd0efe181d4336ad1da9d13675c0a54adb..03e68d8c3e23678e27681f3a1e48540b6383ba24 100644 (file)
@@ -314,10 +314,8 @@ get_fstab_nextentry(
     }
     fsent->fstype = lfsnam;
 
-#define sc "hs"
-    if (strncmp(fsent->fstype, sc, SIZEOF(sc)-1) == 0)
+    if (strncmp_const(fsent->fstype, "hs") == 0)
        fsent->fstype = "iso9660";
-#undef sc
 
     fsent->freq = 0;
     fsent->passno = 0;
index 3777d7d9ef342a7a89ba24ddbb87b9115fb06e5c..e2b983d7b89cb2bcfa784fb4af315ba854fc080d 100644 (file)
@@ -65,10 +65,10 @@ int main(
 
     dbopen(DBG_SUBDIR_CLIENT);
     if (argc < 2) {
-       error("%s: Need at least 2 arguments\n", debug_prefix(NULL));
+       error("%s: Need at least 2 arguments\n", debug_prefix_time(NULL));
        /*NOTREACHED*/
     }
-    dbprintf(("%s: version %s\n", debug_prefix(NULL), version()));
+    dbprintf(("%s: version %s\n", debug_prefix_time(NULL), version()));
     dbprintf(("config: %s\n", argv[1]));
     if (strcmp(argv[1], "NOCONFIG") != 0)
        dbrename(argv[1], DBG_SUBDIR_CLIENT);
index f42ed27803695f0f98894bd88e531a1337a5512c..5a9e50f53a798044bf46b322d5d97fcb8b723480 100644 (file)
@@ -74,11 +74,11 @@ main(
 
     dbopen(DBG_SUBDIR_CLIENT);
     if (argc < 3) {
-       error("%s: Need at least 3 arguments\n", debug_prefix(NULL));
+       error("%s: Need at least 3 arguments\n", debug_prefix_time(NULL));
        /*NOTREACHED*/
     }
 
-    dbprintf(("%s: version %s\n", debug_prefix(NULL), version()));
+    dbprintf(("%s: version %s\n", debug_prefix_time(NULL), version()));
 
 #ifdef ERRMSG                                                  /* { */
 
index 5d46111850c967efd9f1ed562b5d088e46ffde1c..f088ea13bf871f280308324e35b6c587d499c240 100644 (file)
@@ -60,15 +60,15 @@ main(
 
     dbopen(DBG_SUBDIR_CLIENT);
     if (argc < 3) {
-       error("%s: Need at least 3 arguments\n", debug_prefix(NULL));
+       error("%s: Need at least 3 arguments\n", debug_prefix_time(NULL));
        /*NOTREACHED*/
     }
 
-    dbprintf(("%s: version %s\n", debug_prefix(NULL), version()));
+    dbprintf(("%s: version %s\n", debug_prefix_time(NULL), version()));
 
     if (strcmp(argv[3], "--create") != 0) {
        error("%s: Can only be used to create tar archives\n",
-             debug_prefix(NULL));
+             debug_prefix_time(NULL));
        /*NOTREACHED*/
     }
 
index 2230bc5a54cfc3179aeab263e7c851289834ec45..fe6179c4ddf2ba6dfb96d43bc502cc473f4e6992 100644 (file)
@@ -25,7 +25,7 @@
  *                        University of Maryland at College Park
  */
 /* 
- * $Id: selfcheck.c,v 1.95.2.2 2007/01/19 01:03:34 martinea Exp $
+ * $Id: selfcheck.c,v 1.95 2006/08/29 11:21:00 martinea Exp $
  *
  * do self-check and send back any error messages
  */
 #include "pipespawn.h"
 #include "amfeatures.h"
 #include "client_util.h"
-#include "clientconf.h"
+#include "conffile.h"
 #include "amandad.h"
 
 #ifdef SAMBA_CLIENT
 #include "findpass.h"
 #endif
 
+#define selfcheck_debug(i,x) do {      \
+       if ((i) <= debug_selfcheck) {   \
+           dbprintf(x);                \
+       }                               \
+} while (0)
+
 int need_samba=0;
 int need_rundump=0;
 int need_dump=0;
@@ -61,7 +67,7 @@ int need_runtar=0;
 int need_gnutar=0;
 int need_compress_path=0;
 int need_calcsize=0;
-int program_is_wrapper=0;
+int program_is_backup_api=0;
 
 static char *amandad_auth = NULL;
 static am_feature_t *our_features = NULL;
@@ -72,7 +78,7 @@ static g_option_t *g_options = NULL;
 int main(int argc, char **argv);
 
 static void check_options(char *program, char *calcprog, char *disk, char *amdevice, option_t *options);
-static void check_disk(char *program, char *calcprog, char *disk, char *amdevice, int level, char *optstr);
+static void check_disk(char *program, char *calcprog, char *disk, char *amdevice, int level, option_t *options);
 static void check_overall(void);
 static void check_access(char *filename, int mode);
 static int check_file_exist(char *filename);
@@ -147,9 +153,7 @@ main(
        if (line[0] == '\0')
            continue;
 
-#define sc "OPTIONS "
-       if(strncmp(line, sc, SIZEOF(sc)-1) == 0) {
-#undef sc
+       if(strncmp_const(line, "OPTIONS ") == 0) {
            g_options = parse_g_options(line+8, 1);
            if(!g_options->hostname) {
                g_options->hostname = alloc(MAX_HOSTNAME_LENGTH+1);
@@ -194,9 +198,9 @@ main(
        skip_non_whitespace(s, ch);
        s[-1] = '\0';                           /* terminate the program name */
 
-       program_is_wrapper = 0;
-       if(strcmp(program,"DUMPER")==0) {
-           program_is_wrapper = 1;
+       program_is_backup_api = 0;
+       if(strcmp(program,"BACKUP")==0) {
+           program_is_backup_api = 1;
            skip_whitespace(s, ch);             /* find dumper name */
            if (ch == '\0') {
                goto err;                       /* no program */
@@ -206,7 +210,7 @@ main(
            s[-1] = '\0';                       /* terminate the program name */
        }
 
-       if(strncmp(program, "CALCSIZE", 8) == 0) {
+       if(strncmp_const(program, "CALCSIZE") == 0) {
            skip_whitespace(s, ch);             /* find program name */
            if (ch == '\0') {
                goto err;                       /* no program */
@@ -251,11 +255,7 @@ main(
        skip_integer(s, ch);
 
        skip_whitespace(s, ch);
-#define sc "OPTIONS "
-       if (ch && strncmp (s - 1, sc, SIZEOF(sc)-1) == 0) {
-           s += SIZEOF(sc)-1;
-           ch = s[-1];
-#undef sc
+       if (ch && strncmp_const_skip(s - 1, "OPTIONS ", s, ch) == 0) {
            skip_whitespace(s, ch);             /* find the option string */
            if(ch == '\0') {
                goto err;                       /* bad options string */
@@ -266,7 +266,7 @@ main(
            options = parse_options(optstr, disk, amdevice, g_options->features, 1);
            /*@ignore@*/
            check_options(program, calcprog, disk, amdevice, options);
-           check_disk(program, calcprog, disk, amdevice, level, &optstr[2]);
+           check_disk(program, calcprog, disk, amdevice, level, options);
            /*@end@*/
            free_sl(options->exclude_file);
            free_sl(options->exclude_list);
@@ -292,7 +292,7 @@ main(
            need_compress_path=1;
            need_calcsize=1;
            /*@ignore@*/
-           check_disk(program, calcprog, disk, amdevice, level, "");
+           check_disk(program, calcprog, disk, amdevice, level, NULL);
            /*@end@*/
        } else {
            goto err;                           /* bad syntax */
@@ -482,8 +482,8 @@ check_options(
            need_restore=1;
 #endif
     }
-    if ((options->compress == COMPR_BEST) || (options->compress == COMPR_FAST) 
-               || (options->compress == COMPR_CUST)) {
+    if ((options->compress == COMP_BEST) || (options->compress == COMP_FAST) 
+               || (options->compress == COMP_CUST)) {
        need_compress_path=1;
     }
     if(options->auth && amandad_auth) {
@@ -501,7 +501,7 @@ check_disk(
     char *     disk,
     char *     amdevice,
     int                level,
-    char *     optstr)
+    option_t    *options)
 {
     char *device = stralloc("nodevice");
     char *err = NULL;
@@ -517,6 +517,8 @@ check_disk(
     char *qdisk = quote_string(disk);
     char *qamdevice = quote_string(amdevice);
     char *qdevice = NULL;
+    FILE *toolin;
+    char number[NUM_STR_SIZE];
 
     (void)level;       /* Quiet unused parameter warning */
 
@@ -712,35 +714,95 @@ check_disk(
 #endif
        }
     }
-    else { /* program_is_wrapper==1 */
-       pid_t pid_wrapper;
-       fflush(stdout);fflush(stdin);
-       switch (pid_wrapper = fork()) {
+    else { /* program_is_backup_api==1 */
+       pid_t  backup_api_pid;
+       int    property_pipe[2];
+       backup_support_option_t *bsu;
+
+       bsu = backup_support_option(program, g_options, disk, amdevice);
+
+       if (pipe(property_pipe) < 0) {
+           err = vstralloc("pipe failed: ", strerror(errno), NULL);
+           goto common_exit;
+       }
+       fflush(stdout);fflush(stderr);
+       
+       switch (backup_api_pid = fork()) {
        case -1:
-           printf("ERROR [fork: %s]\n", strerror(errno));
-           error("fork: %s", strerror(errno));
-           /*NOTREACHED*/
+           err = vstralloc("fork failed: ", strerror(errno), NULL);
+           goto common_exit;
 
        case 0: /* child */
            {
-               char *argvchild[6];
+               char *argvchild[14];
                char *cmd = vstralloc(DUMPER_DIR, "/", program, NULL);
-               argvchild[0] = program;
-               argvchild[1] = "selfcheck";
-               argvchild[2] = disk;
-               argvchild[3] = amdevice;
-               argvchild[4] = optstr;
-               argvchild[5] = NULL;
+               int j=0;
+               argvchild[j++] = program;
+               argvchild[j++] = "selfcheck";
+               if (bsu->message_line == 1) {
+                   argvchild[j++] = "--message";
+                   argvchild[j++] = "line";
+               }
+               if (g_options->config != NULL && bsu->config == 1) {
+                   argvchild[j++] = "--config";
+                   argvchild[j++] = g_options->config;
+               }
+               if (g_options->hostname != NULL && bsu->host == 1) {
+                   argvchild[j++] = "--host";
+                   argvchild[j++] = g_options->hostname;
+               }
+               if (disk != NULL && bsu->disk == 1) {
+                   argvchild[j++] = "--disk";
+                   argvchild[j++] = disk;
+               }
+               argvchild[j++] = "--device";
+               argvchild[j++] = amdevice;
+               if(options && options->createindex && bsu->index_line == 1) {
+                   argvchild[j++] = "--index";
+                   argvchild[j++] = "line";
+               }
+               if (!options->no_record && bsu->record == 1) {
+                   argvchild[j++] = "--record";
+               }
+               argvchild[j++] = NULL;
+               dup2(property_pipe[0], 0);
+               aclose(property_pipe[1]);
                execve(cmd,argvchild,safe_env());
+               printf("ERROR [Can't execute %s: %s]\n", cmd, strerror(errno));
                exit(127);
            }
        default: /* parent */
            {
                int status;
-               waitpid(pid_wrapper, &status, 0);
+               aclose(property_pipe[0]);
+               toolin = fdopen(property_pipe[1],"w");
+               if (!toolin) {
+                   err = vstralloc("Can't fdopen: ", strerror(errno), NULL);
+                   goto common_exit;
+               }
+               output_tool_property(toolin, options);
+               fflush(toolin);
+               fclose(toolin);
+               if (waitpid(backup_api_pid, &status, 0) < 0) {
+                   if (!WIFEXITED(status)) {
+                       snprintf(number, SIZEOF(number), "%d",
+                                (int)WTERMSIG(status));
+                       err = vstralloc("Tool exited with signal ", number,
+                                       NULL);
+                   } else if (WEXITSTATUS(status) != 0) {
+                       snprintf(number, SIZEOF(number), "%d",
+                                (int)WEXITSTATUS(status));
+                       err = vstralloc("Tool exited with status ", number,
+                                       NULL);
+                   } else {
+                       err = stralloc("waitpid returned negative value");
+                   }
+                   goto common_exit;
+               }
            }
        }
-       fflush(stdout);fflush(stdin);
+       amfree(bsu);
+       fflush(stdout);fflush(stderr);
        amfree(device);
        amfree(qamdevice);
        amfree(qdisk);
@@ -751,7 +813,7 @@ check_disk(
     dbprintf(("%s: device %s\n", debug_prefix_time(NULL), qdevice));
 
     /* skip accessability test if this is an AFS entry */
-    if(strncmp(device, "afs:", 4) != 0) {
+    if(strncmp_const(device, "afs:") != 0) {
 #ifdef CHECK_FOR_ACCESS_WITH_OPEN
        access_result = open(device, O_RDONLY);
        access_type = "open";
@@ -899,7 +961,7 @@ check_overall(void)
        printf("ERROR [GNUTAR program not available]\n");
 #endif
        need_amandates = 1;
-       gnutar_list_dir = client_getconf_str(CLN_GNUTAR_LIST_DIR);
+       gnutar_list_dir = getconf_str(CNF_GNUTAR_LIST_DIR);
        if (strlen(gnutar_list_dir) == 0)
            gnutar_list_dir = NULL;
        if (gnutar_list_dir) 
@@ -908,7 +970,7 @@ check_overall(void)
 
     if (need_amandates) {
        char *amandates_file;
-       amandates_file = client_getconf_str(CLN_AMANDATES);
+       amandates_file = getconf_str(CNF_AMANDATES);
        check_file(amandates_file, R_OK|W_OK);
     }
     if( need_calcsize ) {
index 0e10dc702224320282e8304fee284c136f47fbcb..cb87624565257f5556764a132546e1a4c7e69a9c 100644 (file)
@@ -24,7 +24,7 @@
  * file named AUTHORS, in the root directory of this distribution.
  */
 /* 
- * $Id: sendbackup-dump.c,v 1.90.2.2 2006/11/24 18:10:38 martinea Exp $
+ * $Id: sendbackup-dump.c,v 1.90 2006/07/25 18:10:07 martinea Exp $
  *
  * send backup data using BSD dump
  */
@@ -41,40 +41,44 @@ static amregex_t re_table[] = {
   /* the various encodings of dump size */
   /* this should also match BSDI pre-3.0's buggy dump program, that
      produced doubled DUMP: DUMP: messages */
-  AM_SIZE_RE("DUMP: [0-9][0-9]* tape blocks", 1024),
-  AM_SIZE_RE("dump: Actual: [0-9][0-9]* tape blocks", 1024),
+  AM_SIZE_RE("DUMP: [0-9][0-9]* tape blocks", 1024, 1),
+  AM_SIZE_RE("dump: Actual: [0-9][0-9]* tape blocks", 1024, 1),
   AM_SIZE_RE("backup: There are [0-9][0-9]* tape blocks on [0-9][0-9]* tapes",
-            1024),
+            1024, 1),
   AM_SIZE_RE("backup: [0-9][0-9]* tape blocks on [0-9][0-9]* tape\\(s\\)",
-            1024),
+            1024, 1),
   AM_SIZE_RE("backup: [0-9][0-9]* 1k blocks on [0-9][0-9]* volume\\(s\\)",
-            1024),
+            1024, 1),
   AM_SIZE_RE("DUMP: [0-9][0-9]* blocks \\([0-9][0-9]*KB\\) on [0-9][0-9]* volume",
-            512),
+            512, 1),
   AM_SIZE_RE("DUMP: [0-9][0-9]* blocks \\([0-9][0-9]*\\.[0-9][0-9]*MB\\) on [0-9][0-9]* volume",
-            512),
-  AM_SIZE_RE("DUMP: [0-9][0-9]* blocks", 512),
-  AM_SIZE_RE("DUMP: [0-9][0-9]* bytes were dumped", 1),
+            512, 1),
+  AM_SIZE_RE("DUMP: [0-9][0-9]* blocks \\([0-9][0-9]*KB\\)",
+            1024, 2),
+  AM_SIZE_RE("DUMP: [0-9][0-9]* blocks \\([0-9][0-9]*\\.[0-9][0-9]*MB\\)",
+            1048576, 2),
+  AM_SIZE_RE("DUMP: [0-9][0-9]* blocks", 512, 1),
+  AM_SIZE_RE("DUMP: [0-9][0-9]* bytes were dumped", 1, 1),
   /* OSF's vdump */
-  AM_SIZE_RE("vdump: Dumped  [0-9][0-9]* of [0-9][0-9]* bytes", 1),
+  AM_SIZE_RE("vdump: Dumped  [0-9][0-9]* of [0-9][0-9]* bytes", 1, 1),
   /* DU 4.0a dump */
-  AM_SIZE_RE("dump: Actual: [0-9][0-9]* blocks output to pipe", 1024),
+  AM_SIZE_RE("dump: Actual: [0-9][0-9]* blocks output to pipe", 1024, 1),
   /* DU 4.0 vdump */
-  AM_SIZE_RE("dump: Dumped  [0-9][0-9]* of [0-9][0-9]* bytes", 1),
+  AM_SIZE_RE("dump: Dumped  [0-9][0-9]* of [0-9][0-9]* bytes", 1, 1),
   /* HPUX dump */
-  AM_SIZE_RE("DUMP: [0-9][0-9]* KB actual output", 1024),
+  AM_SIZE_RE("DUMP: [0-9][0-9]* KB actual output", 1024, 1),
   /* HPUX 10.20 and above vxdump */
-  AM_SIZE_RE("vxdump: [0-9][0-9]* tape blocks", 1024),
+  AM_SIZE_RE("vxdump: [0-9][0-9]* tape blocks", 1024, 1),
   /* UnixWare vxdump */
-  AM_SIZE_RE("vxdump: [0-9][0-9]* blocks", 1024),
+  AM_SIZE_RE("vxdump: [0-9][0-9]* blocks", 1024, 1),
   /* SINIX vxdump */
-  AM_SIZE_RE("   VXDUMP: [0-9][0-9]* blocks", 512),
+  AM_SIZE_RE("   VXDUMP: [0-9][0-9]* blocks", 512, 1),
   /* SINIX ufsdump */
-  AM_SIZE_RE("   UFSDUMP: [0-9][0-9]* blocks", 512),
+  AM_SIZE_RE("   UFSDUMP: [0-9][0-9]* blocks", 512, 1),
   /* Irix 6.2 xfs dump */
-  AM_SIZE_RE("xfsdump: media file size [0-9][0-9]* bytes", 1),
+  AM_SIZE_RE("xfsdump: media file size [0-9][0-9]* bytes", 1, 1),
   /* NetApp dump */
-  AM_SIZE_RE("DUMP: [0-9][0-9]* KB", 1024),
+  AM_SIZE_RE("DUMP: [0-9][0-9]* KB", 1024, 1),
 
   /* strange dump lines */
   AM_STRANGE_RE("should not happen"),
@@ -170,11 +174,11 @@ start_backup(
     /*  now do the client-side compression */
 
 
-    if(options->compress == COMPR_FAST || options->compress == COMPR_BEST) {
+    if(options->compress == COMP_FAST || options->compress == COMP_BEST) {
        compopt = skip_argument;
 
 #if defined(COMPRESS_BEST_OPT) && defined(COMPRESS_FAST_OPT)
-       if(options->compress == COMPR_BEST) {
+       if(options->compress == COMP_BEST) {
            compopt = COMPRESS_BEST_OPT;
        } else {
            compopt = COMPRESS_FAST_OPT;
@@ -189,7 +193,7 @@ start_backup(
            dbprintf((" %s", compopt));
        }
        dbprintf(("\n"));
-     } else if (options->compress == COMPR_CUST) {
+     } else if (options->compress == COMP_CUST) {
         compopt = skip_argument;
        comppid = pipespawn(options->clntcompprog, STDIN_PIPE,
                            &dumpout, &compout, &mesgf,
index 0ef79374d6a6fa7b8b553fcb1d6448ac188f18d3..0aef9c707fc1f9ea98746dae0fddb211697dfc6d 100644 (file)
@@ -24,7 +24,7 @@
  * file named AUTHORS, in the root directory of this distribution.
  */
 /* 
- * $Id: sendbackup-gnutar.c,v 1.98.2.1 2006/11/24 18:10:38 martinea Exp $
+ * $Id: sendbackup-gnutar.c,v 1.98 2006/07/25 18:35:21 martinea Exp $
  *
  * send backup data using GNU tar
  */
@@ -36,7 +36,7 @@
 #include "util.h"
 #include "getfsent.h"                  /* for amname_to_dirname lookup */
 #include "version.h"
-#include "clientconf.h"
+#include "conffile.h"
 
 #ifdef SAMBA_CLIENT
 #include "findpass.h"
@@ -44,7 +44,7 @@
 
 static amregex_t re_table[] = {
   /* tar prints the size in bytes */
-  AM_SIZE_RE("^ *Total bytes written: [0-9][0-9]*", 1),
+  AM_SIZE_RE("^ *Total bytes written: [0-9][0-9]*", 1, 1),
   AM_NORMAL_RE("^Elapsed time:"),
   AM_NORMAL_RE("^Throughput"),
 
@@ -182,10 +182,10 @@ start_backup(
        encpid = -1;
     } 
      /*  now do the client-side compression */
-    if(options->compress == COMPR_FAST || options->compress == COMPR_BEST) {
+    if(options->compress == COMP_FAST || options->compress == COMP_BEST) {
           compopt = skip_argument;
 #if defined(COMPRESS_BEST_OPT) && defined(COMPRESS_FAST_OPT)
-       if(options->compress == COMPR_BEST) {
+       if(options->compress == COMP_BEST) {
            compopt = COMPRESS_BEST_OPT;
        } else {
            compopt = COMPRESS_FAST_OPT;
@@ -200,7 +200,7 @@ start_backup(
            dbprintf((" %s", compopt));
        }
        dbprintf(("\n"));
-     } else if (options->compress == COMPR_CUST) {
+     } else if (options->compress == COMP_CUST) {
         compopt = skip_argument;
        comppid = pipespawn(options->clntcompprog, STDIN_PIPE,
                            &dumpout, &compout, &mesgf,
@@ -216,7 +216,7 @@ start_backup(
        comppid = -1;
     }
 
-    gnutar_list_dir = client_getconf_str(CLN_GNUTAR_LIST_DIR);
+    gnutar_list_dir = getconf_str(CNF_GNUTAR_LIST_DIR);
     if (strlen(gnutar_list_dir) == 0)
        gnutar_list_dir = NULL;
 
@@ -329,7 +329,7 @@ start_backup(
 
     /* find previous dump time */
 
-    amandates_file = client_getconf_str(CLN_AMANDATES);
+    amandates_file = getconf_str(CNF_AMANDATES);
     if(!start_amandates(amandates_file, 0)) {
        error("error [opening %s: %s]", amandates_file, strerror(errno));
        /*NOTREACHED*/
index 737d4f89a0965ee529ee93135128abd838ad6f1c..9cfa39732d122407a17560461fb5338ea52fe63f 100644 (file)
@@ -24,7 +24,7 @@
  * file named AUTHORS, in the root directory of this distribution.
  */
 /* 
- * $Id: sendbackup.c,v 1.88.2.3 2006/12/12 14:56:38 martinea Exp $
+ * $Id: sendbackup.c,v 1.88 2006/07/25 18:27:56 martinea Exp $
  *
  * common code for the sendbackup-* programs.
  */
 #include "arglist.h"
 #include "getfsent.h"
 #include "version.h"
-#include "clientconf.h"
+#include "conffile.h"
+
+#define sendbackup_debug(i,x) do {     \
+       if ((i) <= debug_sendbackup) {  \
+           dbprintf(x);                \
+       }                               \
+} while (0)
 
 #define TIMEOUT 30
 
@@ -75,9 +81,9 @@ pid_t pipefork(void (*func)(void), char *fname, int *stdinfd,
 void parse_backup_messages(int mesgin);
 static void process_dumpline(char *str);
 static void save_fd(int *, int);
+void backup_api_info_tapeheader(int mesgfd, char *prog, option_t *options);
 
-double first_num(char *str);
-
+double the_num(char *str, int pos);
 
 
 char *
@@ -96,17 +102,17 @@ optionstr(
     char *exc = NULL;
     sle_t *excl;
 
-    if(options->compress == COMPR_BEST)
+    if(options->compress == COMP_BEST)
        compress_opt = stralloc("compress-best;");
-    else if(options->compress == COMPR_FAST)
+    else if(options->compress == COMP_FAST)
        compress_opt = stralloc("compress-fast;");
-    else if(options->compress == COMPR_SERVER_BEST)
+    else if(options->compress == COMP_SERVER_BEST)
        compress_opt = stralloc("srvcomp-best;");
-    else if(options->compress == COMPR_SERVER_FAST)
+    else if(options->compress == COMP_SERVER_FAST)
        compress_opt = stralloc("srvcomp-fast;");
-    else if(options->compress == COMPR_SERVER_CUST)
+    else if(options->compress == COMP_SERVER_CUST)
        compress_opt = vstralloc("srvcomp-cust=", options->srvcompprog, ";", NULL);
-    else if(options->compress == COMPR_CUST)
+    else if(options->compress == COMP_CUST)
        compress_opt = vstralloc("comp-cust=", options->clntcompprog, ";", NULL);
     else
        compress_opt = stralloc("");
@@ -179,6 +185,7 @@ main(
     int level = 0;
     int mesgpipe[2];
     char *prog, *dumpdate, *stroptions;
+    int program_is_backup_api;
     char *disk = NULL;
     char *qdisk = NULL;
     char *amdevice = NULL;
@@ -191,6 +198,8 @@ main(
     int ch;
     unsigned long malloc_hist_1, malloc_size_1;
     unsigned long malloc_hist_2, malloc_size_2;
+    FILE *toolin;
+    int status;
 
     /* initialize */
 
@@ -252,6 +261,7 @@ main(
     amdevice = NULL;
     dumpdate = NULL;
     stroptions = NULL;
+    program_is_backup_api=0;
 
     for(; (line = agets(stdin)) != NULL; free(line)) {
        if (line[0] == '\0')
@@ -260,9 +270,7 @@ main(
            fprintf(stderr, "%s> ", get_pname());
            fflush(stderr);
        }
-#define sc "OPTIONS "
-       if(strncmp(line, sc, SIZEOF(sc)-1) == 0) {
-#undef sc
+       if(strncmp_const(line, "OPTIONS ") == 0) {
            g_options = parse_g_options(line+8, 1);
            if(!g_options->hostname) {
                g_options->hostname = alloc(MAX_HOSTNAME_LENGTH+1);
@@ -301,6 +309,17 @@ main(
        prog = s - 1;
        skip_non_whitespace(s, ch);
        s[-1] = '\0';
+
+       if(strcmp(prog,"BACKUP")==0) {
+           program_is_backup_api=1;
+           skip_whitespace(s, ch);             /* find dumper name */
+           if (ch == '\0') {
+               goto err;                       /* no program */
+           }
+           prog = s - 1;
+           skip_non_whitespace(s, ch);
+           s[-1] = '\0';
+       }
        prog = stralloc(prog);
 
        skip_whitespace(s, ch);                 /* find the disk name */
@@ -327,16 +346,18 @@ main(
        if(!isdigit((int)s[-1])) {
            amfree(amdevice);
            amfree(qamdevice);
-           amdevice = s - 1;
-           skip_non_whitespace(s, ch);
+           qamdevice = s - 1;
+           ch = *qamdevice;
+           skip_quoted_string(s, ch);
            s[-1] = '\0';
-           amdevice = stralloc(amdevice);
+           qamdevice = stralloc(qamdevice);
+           amdevice = unquote_string(qamdevice);
            skip_whitespace(s, ch);             /* find level number */
        }
        else {
            amdevice = stralloc(disk);
+           qamdevice = stralloc(qdisk);
        }
-       qamdevice = quote_string(amdevice);
                                                /* find the level number */
        if(ch == '\0' || sscanf(s - 1, "%d", &level) != 1) {
            err_extra = "bad level";
@@ -360,14 +381,10 @@ main(
            err_extra = "no options";
            goto err;                           /* no options */
        }
-#define sc "OPTIONS "
-       if(strncmp(s - 1, sc, SIZEOF(sc)-1) != 0) {
+       if(strncmp_const_skip(s - 1, "OPTIONS ", s, ch) != 0) {
            err_extra = "no OPTIONS keyword";
            goto err;                           /* no options */
        }
-       s += SIZEOF(sc)-1;
-       ch = s[-1];
-#undef sc
        skip_whitespace(s, ch);                 /* find the options string */
        if(ch == '\0') {
            err_extra = "bad options string";
@@ -394,16 +411,22 @@ main(
     dbprintf(("                     since %s\n", dumpdate));
     dbprintf(("                     options `%s'\n", stroptions));
 
-    for(i = 0; programs[i]; i++) {
-       if (strcmp(programs[i]->name, prog) == 0) {
-           break;
-       }
+    if(program_is_backup_api==1) {
+       /* check that the backup_api exist */
     }
-    if (programs[i] == NULL) {
-       error("ERROR [%s: unknown program %s]", get_pname(), prog);
-       /*NOTREACHED*/
+    else {
+       for(i = 0; programs[i]; i++) {
+           if (strcmp(programs[i]->name, prog) == 0) {
+               break;
+           }
+       }
+       if (programs[i] == NULL) {
+           dbprintf(("ERROR [%s: unknown program %s]\n", get_pname(), prog));
+           error("ERROR [%s: unknown program %s]", get_pname(), prog);
+           /*NOTREACHED*/
+       }
+       program = programs[i];
     }
-    program = programs[i];
 
     options = parse_options(stroptions, disk, amdevice, g_options->features, 0);
 
@@ -462,27 +485,136 @@ main(
       }
     }
 
-    if(!interactive) {
-      /* redirect stderr */
-      if(dup2(mesgfd, 2) == -1) {
-         dbprintf(("%s: error redirecting stderr to fd %d: %s\n",
-             debug_prefix_time(NULL), mesgfd, strerror(errno)));
-         dbclose();
-         exit(1);
-      }
-    }
+    if(program_is_backup_api==1) {
+       pid_t backup_api_pid;
+       int i, j;
+       char *cmd=NULL;
+       char *argvchild[20];
+       char levelstr[20];
+       int property_pipe[2];
+       backup_support_option_t *bsu;
+
+       if (pipe(property_pipe) < 0) {
+           error("Can't create pipe: %s",strerror(errno));
+           /*NOTREACHED*/
+       }
+       bsu = backup_support_option(prog, g_options, disk, amdevice);
+
+       switch(backup_api_pid=fork()) {
+       case 0:
+           aclose(property_pipe[1]);
+           if(dup2(property_pipe[0], 0) == -1) {
+               error("Can't dup2: %s",strerror(errno));
+               /*NOTREACHED*/
+           }
+           if(dup2(datafd, 1) == -1) {
+               error("Can't dup2: %s",strerror(errno));
+               /*NOTREACHED*/
+           }
+           if(dup2(mesgfd, 2) == -1) {
+               error("Can't dup2: %s",strerror(errno));
+               /*NOTREACHED*/
+           }
+           if(indexfd != 0) {
+               if(dup2(indexfd, 3) == -1) {
+                   error("Can't dup2: %s",strerror(errno));
+                   /*NOTREACHED*/
+               }
+               fcntl(indexfd, F_SETFD, 0);
+               fcntl(3, F_SETFD, 0);
+           }
+           cmd = vstralloc(DUMPER_DIR, "/", prog, NULL);
+           i=0;
+           argvchild[i++] = prog;
+           argvchild[i++] = "backup";
+           if (bsu->message_line == 1) {
+               argvchild[i++] = "--message";
+               argvchild[i++] = "line";
+           }
+           if (g_options->config && bsu->config == 1) {
+               argvchild[i++] = "--config";
+               argvchild[i++] = g_options->config;
+           }
+           if (g_options->hostname && bsu->host == 1) {
+               argvchild[i++] = "--host";
+               argvchild[i++] = g_options->hostname;
+           }
+           if (disk && bsu->disk == 1) {
+               argvchild[i++] = "--disk";
+               argvchild[i++] = disk;
+           }
+           argvchild[i++] = "--device";
+           argvchild[i++] = amdevice;
+           if (level <= bsu->max_level) {
+               argvchild[i++] = "--level";
+               snprintf(levelstr,19,"%d",level);
+               argvchild[i++] = levelstr;
+           }
+           if (indexfd != 0 && bsu->index_line == 1) {
+               argvchild[i++] = "--index";
+               argvchild[i++] = "line";
+           }
+           if (!options->no_record && bsu->record == 1) {
+               argvchild[i++] = "--record";
+           }
+           argvchild[i] = NULL;
+           dbprintf(("%s: running \"%s", get_pname(), cmd));
+           for(j=1;j<i;j++) dbprintf((" %s",argvchild[j]));
+           dbprintf(("\"\n"));
+           backup_api_info_tapeheader(mesgfd, prog, options);
+           execve(cmd, argvchild, safe_env());
+           exit(1);
+           break;
+       default:
+           aclose(property_pipe[0]);
+           toolin = fdopen(property_pipe[1],"w");
+           if (!toolin) {
+               error("Can't fdopen: %s", strerror(errno));
+               /*NOTREACHED*/
+           }
+           output_tool_property(toolin, options);
+           fflush(toolin);
+           fclose(toolin);
+           break;
+       case -1:
+           error("%s: fork returned: %s", get_pname(), strerror(errno));
+       }
+       amfree(bsu);
+       if (waitpid(backup_api_pid, &status, 0) < 0) {
+           if (!WIFEXITED(status)) {
+               dbprintf(("Tool exited with signal %d", WTERMSIG(status)));
+           } else if (WEXITSTATUS(status) != 0) {
+               dbprintf(("Tool exited with status %d", WEXITSTATUS(status)));
+           } else {
+               dbprintf(("waitpid returned negative value"));
+           }
+       }
+     }
+    else {
+       if(!interactive) {
+           /* redirect stderr */
+           if(dup2(mesgfd, 2) == -1) {
+               dbprintf(("%s: error redirecting stderr to fd %d: %s\n",
+                         debug_prefix_time(NULL), mesgfd, strerror(errno)));
+               dbclose();
+               exit(1);
+           }
+       }
+       if(pipe(mesgpipe) == -1) {
+           s = strerror(errno);
+           dbprintf(("error [opening mesg pipe: %s]\n", s));
+           error("error [opening mesg pipe: %s]", s);
+       }
 
-    if(pipe(mesgpipe) == -1) {
-      error("error [opening mesg pipe: %s]", strerror(errno));
-      /*NOTREACHED*/
+       program->start_backup(g_options->hostname, disk, amdevice, level,
+                             dumpdate, datafd, mesgpipe[1], indexfd);
+       dbprintf(("%s: started backup\n", debug_prefix_time(NULL)));
+       parse_backup_messages(mesgpipe[0]);
+       dbprintf(("%s: parsed backup messages\n", debug_prefix_time(NULL)));
     }
 
-    program->start_backup(g_options->hostname, disk, amdevice, level, dumpdate, datafd, mesgpipe[1],
-                         indexfd);
-    dbprintf(("%s: started backup\n", debug_prefix_time(NULL)));
-    parse_backup_messages(mesgpipe[0]);
-    dbprintf(("%s: parsed backup messages\n", debug_prefix_time(NULL)));
-
     amfree(prog);
     amfree(disk);
     amfree(qdisk);
@@ -650,7 +782,7 @@ info_tapeheader(void)
     fprintf(stderr, "%s: info BACKUP=%s\n", get_pname(), program->backup_name);
 
     fprintf(stderr, "%s: info RECOVER_CMD=", get_pname());
-    if (options->compress == COMPR_FAST || options->compress == COMPR_BEST)
+    if (options->compress == COMP_FAST || options->compress == COMP_BEST)
        fprintf(stderr, "%s %s |", UNCOMPRESS_PATH,
 #ifdef UNCOMPRESS_OPT
                UNCOMPRESS_OPT
@@ -659,15 +791,76 @@ info_tapeheader(void)
 #endif
                );
 
-    fprintf(stderr, "%s -f - ...\n", program->restore_name);
+    fprintf(stderr, "%s -xpGf - ...\n", program->restore_name);
 
-    if (options->compress == COMPR_FAST || options->compress == COMPR_BEST)
+    if (options->compress == COMP_FAST || options->compress == COMP_BEST)
        fprintf(stderr, "%s: info COMPRESS_SUFFIX=%s\n",
                        get_pname(), COMPRESS_SUFFIX);
 
     fprintf(stderr, "%s: info end\n", get_pname());
 }
 
+void
+backup_api_info_tapeheader(
+    int       mesgfd,
+    char     *prog,
+    option_t *options)
+{
+    char line[1024];
+
+    snprintf(line, 1024, "%s: info BACKUP=DUMPER\n", get_pname());
+    if (fullwrite(mesgfd, line, strlen(line)) != (ssize_t)strlen(line)) {
+       dbprintf(("error writing to mesgfd socket: %s", strerror(errno)));
+       return;
+    }
+
+    snprintf(line, 1024, "%s: info DUMPER=%s\n", get_pname(), prog);
+    if (fullwrite(mesgfd, line, strlen(line)) != (ssize_t)strlen(line)) {
+       dbprintf(("error writing to mesgfd socket: %s", strerror(errno)));
+       return;
+    }
+
+    snprintf(line, 1024, "%s: info RECOVER_CMD=", get_pname());
+    if (fullwrite(mesgfd, line, strlen(line)) != (ssize_t)strlen(line)) {
+       dbprintf(("error writing to mesgfd socket: %s", strerror(errno)));
+       return;
+    }
+
+    if (options->compress) {
+       snprintf(line, 1024, "%s %s |", UNCOMPRESS_PATH,
+#ifdef UNCOMPRESS_OPT
+                UNCOMPRESS_OPT
+#else
+                ""
+#endif
+                );
+       if (fullwrite(mesgfd, line, strlen(line)) != (ssize_t)strlen(line)) {
+           dbprintf(("error writing to mesgfd socket: %s", strerror(errno)));
+           return;
+       }
+    }
+    snprintf(line, 1024, "%s -f... -\n", prog);
+    if (fullwrite(mesgfd, line, strlen(line)) != (ssize_t)strlen(line)) {
+       dbprintf(("error writing to mesgfd socket: %s", strerror(errno)));
+       return;
+    }
+
+    if (options->compress) {
+       snprintf(line, 1024, "%s: info COMPRESS_SUFFIX=%s\n",
+                get_pname(), COMPRESS_SUFFIX);
+       if (fullwrite(mesgfd, line, strlen(line)) != (ssize_t)strlen(line)) {
+           dbprintf(("error writing to mesgfd socket: %s", strerror(errno)));
+           return;
+       }
+    }
+
+    snprintf(line, 1024, "%s: info end\n", get_pname());
+    if (fullwrite(mesgfd, line, strlen(line)) != (ssize_t)strlen(line)) {
+       dbprintf(("error writing to mesgfd socket: %s", strerror(errno)));
+       return;
+    }
+}
+
 pid_t
 pipefork(
     void       (*func)(void),
@@ -803,15 +996,21 @@ parse_backup_messages(
  */
 
 double
-first_num(
-    char *     str)
+the_num(
+    char *     str,
+    int         pos)
 {
     char *num;
     int ch;
     double d;
 
-    ch = *str++;
-    while(ch && !isdigit(ch)) ch = *str++;
+    do {
+       ch = *str++;
+       while(ch && !isdigit(ch)) ch = *str++;
+       if (pos == 1) break;
+       pos--;
+       while(ch && (isdigit(ch) || ch == '.')) ch = *str++;
+    } while (ch);
     num = str - 1;
     while(isdigit(ch) || ch == '.') ch = *str++;
     str[-1] = '\0';
@@ -835,7 +1034,7 @@ process_dumpline(
        }
     }
     if(rp->typ == DMP_SIZE) {
-       dump_size = (long)((first_num(str) * rp->scale + 1023.0)/1024.0);
+       dump_size = (long)((the_num(str, rp->field)* rp->scale+1023.0)/1024.0);
     }
     switch(rp->typ) {
     case DMP_NORMAL:
index 2a4cdb8d8b20af68c6408e70fde9f4d9b5fb1cfc..134e6fb65bf084489d37b1005cfbe976e60aa1ae 100644 (file)
@@ -64,13 +64,14 @@ typedef struct regex_s {
     char *regex;
     int srcline;
     int scale;                  /* only used for size lines */
+    int field;
     dmpline_t typ;
 } amregex_t;
 
-#define AM_NORMAL_RE(re)       {(re), __LINE__, 0, DMP_NORMAL}
-#define AM_STRANGE_RE(re)      {(re), __LINE__, 0, DMP_STRANGE}
-#define AM_SIZE_RE(re,s)       {(re), __LINE__, (s), DMP_SIZE}
-#define AM_ERROR_RE(re)                {(re), __LINE__, 0, DMP_ERROR}
+#define AM_NORMAL_RE(re)       {(re), __LINE__, 0, 0, DMP_NORMAL}
+#define AM_STRANGE_RE(re)      {(re), __LINE__, 0, 0, DMP_STRANGE}
+#define AM_SIZE_RE(re,s,f)     {(re), __LINE__, (s), (f), DMP_SIZE}
+#define AM_ERROR_RE(re)                {(re), __LINE__, 0, 0, DMP_ERROR}
 
 extern pid_t  comppid, dumppid, encpid, tarpid;
 extern pid_t indexpid;
index e99071c24f9747a25d079fd2ee4374e9c2463656..aec977e13d65b5649614f7d4d71174bfd33a0eb6 100644 (file)
@@ -24,7 +24,7 @@
  * file named AUTHORS, in the root directory of this distribution.
  */
 /* 
- * $Id: sendsize.c,v 1.171.2.4 2006/12/22 14:42:42 martinea Exp $
+ * $Id: sendsize.c,v 1.171 2006/08/24 01:57:15 paddy_s Exp $
  *
  * send estimated backup sizes using dump
  */
 #include "getfsent.h"
 #include "version.h"
 #include "client_util.h"
-#include "clientconf.h"
+#include "conffile.h"
 #include "amandad.h"
 
 #ifdef SAMBA_CLIENT
 #include "findpass.h"
 #endif
 
+#define sendsize_debug(i,x) do {       \
+       if ((i) <= debug_sebdsize) {    \
+           dbprintf(x);                \
+       }                               \
+} while (0)
+
 #ifdef HAVE_SETPGID
 #  define SETPGRP      setpgid(getpid(), getpid())
 #  define SETPGRP_FAILED() do {                                                \
@@ -85,7 +91,7 @@ typedef struct disk_estimates_s {
     char *qdirname;
     char *program;
     char *calcprog;
-    int program_is_wrapper;
+    int program_is_backup_api;
     int spindle;
     pid_t child;
     int done;
@@ -102,7 +108,7 @@ static g_option_t *g_options = NULL;
 /* local functions */
 int main(int argc, char **argv);
 void add_diskest(char *disk, char *amdevice, int level, int spindle, 
-                   int program_is_wrapper, char *prog, char *calcprog,
+                   int program_is_backup_api, char *prog, char *calcprog,
                    option_t *options);
 void calc_estimates(disk_estimates_t *est);
 void free_estimates(disk_estimates_t *est);
@@ -110,7 +116,7 @@ void dump_calc_estimates(disk_estimates_t *);
 void star_calc_estimates(disk_estimates_t *);
 void smbtar_calc_estimates(disk_estimates_t *);
 void gnutar_calc_estimates(disk_estimates_t *);
-void wrapper_calc_estimates(disk_estimates_t *);
+void backup_api_calc_estimate(disk_estimates_t *);
 void generic_calc_estimates(disk_estimates_t *);
 
 
@@ -122,7 +128,7 @@ main(
     int level, spindle;
     char *prog, *calcprog, *dumpdate;
     option_t *options = NULL;
-    int program_is_wrapper;
+    int program_is_backup_api;
     disk_estimates_t *est;
     disk_estimates_t *est1;
     disk_estimates_t *est_prev;
@@ -185,9 +191,7 @@ main(
     for(; (line = agets(stdin)) != NULL; free(line)) {
        if (line[0] == '\0')
            continue;
-#define sc "OPTIONS "
-       if(strncmp(line, sc, SIZEOF(sc)-1) == 0) {
-#undef sc
+       if(strncmp_const(line, "OPTIONS ") == 0) {
            g_options = parse_g_options(line+8, 1);
            if(!g_options->hostname) {
                g_options->hostname = alloc(MAX_HOSTNAME_LENGTH+1);
@@ -224,7 +228,7 @@ main(
        }
 
        if (amandates_read == 0) {
-           amandates_file = client_getconf_str(CLN_AMANDATES);
+           amandates_file = getconf_str(CNF_AMANDATES);
            if(!start_amandates(amandates_file, 0))
                error("error [opening %s: %s]", amandates_file,
                      strerror(errno));
@@ -243,19 +247,8 @@ main(
        skip_non_whitespace(s, ch);
        s[-1] = '\0';
 
-       program_is_wrapper=0;
-       if(strcmp(prog,"DUMPER")==0) {
-           program_is_wrapper=1;
-           skip_whitespace(s, ch);             /* find dumper name */
-           if (ch == '\0') {
-               goto err;                       /* no program */
-           }
-           prog = s - 1;
-           skip_non_whitespace(s, ch);
-           s[-1] = '\0';
-       }
-
-       if(strncmp(prog, "CALCSIZE", 8) == 0) {
+       program_is_backup_api=0;
+       if(strncmp_const(prog, "CALCSIZE") == 0) {
            skip_whitespace(s, ch);             /* find the program name */
            if(ch == '\0') {
                err_extra = stralloc("no program name");
@@ -264,9 +257,29 @@ main(
            calcprog = s - 1;
            skip_non_whitespace(s, ch);
            s[-1] = '\0';
+           if (strcmp(calcprog,"BACKUP") == 0) {
+               program_is_backup_api=1;
+               skip_whitespace(s, ch);         /* find dumper name */
+               if (ch == '\0') {
+                   goto err;                   /* no program */
+               }
+               calcprog = s - 1;
+               skip_non_whitespace(s, ch);
+               s[-1] = '\0';
+           }
        }
        else {
            calcprog = NULL;
+           if (strcmp(prog,"BACKUP") == 0) {
+               program_is_backup_api=1;
+               skip_whitespace(s, ch);         /* find dumper name */
+               if (ch == '\0') {
+                   goto err;                   /* no program */
+               }
+               prog = s - 1;
+               skip_non_whitespace(s, ch);
+               s[-1] = '\0';
+           }
        }
 
        skip_whitespace(s, ch);                 /* find the disk name */
@@ -337,7 +350,7 @@ main(
 
            skip_whitespace(s, ch);             /* find the parameters */
            if(ch != '\0') {
-               if(strncmp(s-1, "OPTIONS |;",10) == 0) {
+               if(strncmp_const(s-1, "OPTIONS |;") == 0) {
                    options = parse_options(s + 8,
                                            disk,
                                            amdevice,
@@ -348,25 +361,25 @@ main(
                    options = alloc(SIZEOF(option_t));
                    init_options(options);
                    while (ch != '\0') {
-                       if(strncmp(s-1, "exclude-file=", 13) == 0) {
+                       if(strncmp_const(s-1, "exclude-file=") == 0) {
                            qlist = unquote_string(s+12);
                            options->exclude_file =
                                append_sl(options->exclude_file, qlist);
                            amfree(qlist);
-                       } else if(strncmp(s-1, "exclude-list=", 13) == 0) {
+                       } else if(strncmp_const(s-1, "exclude-list=") == 0) {
+                           qlist = unquote_string(s+12);
                            options->exclude_list =
                                append_sl(options->exclude_list, qlist);
-                           qlist = unquote_string(s+12);
                            amfree(qlist);
-                       } else if(strncmp(s-1, "include-file=", 13) == 0) {
+                       } else if(strncmp_const(s-1, "include-file=") == 0) {
+                           qlist = unquote_string(s+12);
                            options->include_file =
                                append_sl(options->include_file, qlist);
-                           qlist = unquote_string(s+12);
                            amfree(qlist);
-                       } else if(strncmp(s-1, "include-list=", 13) == 0) {
+                       } else if(strncmp_const(s-1, "include-list=") == 0) {
+                           qlist = unquote_string(s+12);
                            options->include_list =
                                append_sl(options->include_list, qlist);
-                           qlist = unquote_string(s+12);
                            amfree(qlist);
                        } else {
                            err_extra = vstralloc("Invalid parameter (",
@@ -390,7 +403,7 @@ main(
        }
 
        /*@ignore@*/
-       add_diskest(disk, amdevice, level, spindle, program_is_wrapper, prog, calcprog, options);
+       add_diskest(disk, amdevice, level, spindle, program_is_backup_api, prog, calcprog, options);
        /*@end@*/
        amfree(disk);
        amfree(qdisk);
@@ -563,7 +576,7 @@ add_diskest(
     char *     amdevice,
     int                level,
     int                spindle,
-    int                program_is_wrapper,
+    int                program_is_backup_api,
     char *     prog,
     char *     calcprog,
     option_t * options)
@@ -610,7 +623,7 @@ add_diskest(
        newp->calcprog = stralloc(calcprog);
     else
        newp->calcprog = NULL;
-    newp->program_is_wrapper = program_is_wrapper;
+    newp->program_is_backup_api = program_is_backup_api;
     newp->spindle = spindle;
     newp->est[level].needestimate = 1;
     newp->options = options;
@@ -665,8 +678,8 @@ calc_estimates(
              debug_prefix_time(NULL),
              est->qamname, est->qdirname, est->spindle));
        
-    if(est->program_is_wrapper ==  1)
-       wrapper_calc_estimates(est);
+    if(est->program_is_backup_api ==  1)
+       backup_api_calc_estimate(est);
     else
 #ifndef USE_GENERIC_CALCSIZE
     if(strcmp(est->program, "DUMP") == 0)
@@ -704,45 +717,54 @@ calc_estimates(
  */
 
 /* local functions */
-off_t getsize_dump(char *disk, char *amdevice, int level, option_t *options);
-off_t getsize_star(char *disk, char *amdevice, int level,
-                      option_t *options, time_t dumpsince);
-off_t getsize_smbtar(char *disk, char *amdevice, int level, option_t *options);
+off_t getsize_dump(char *disk, char *amdevice, int level, option_t *options,
+                  char **errmsg);
+off_t getsize_smbtar(char *disk, char *amdevice, int level, option_t *options,
+                    char **errmsg);
 off_t getsize_gnutar(char *disk, char *amdevice, int level,
-                      option_t *options, time_t dumpsince);
-off_t getsize_wrapper(char *program, char *disk, char *amdevice, int level,
-                       option_t *options, time_t dumpsince);
+                      option_t *options, time_t dumpsince, char **errmsg);
+off_t getsize_backup_api(char *program, char *disk, char *amdevice, int level,
+                       option_t *options, time_t dumpsince, char **errmsg);
 off_t handle_dumpline(char *str);
 double first_num(char *str);
 
 void
-wrapper_calc_estimates(
+backup_api_calc_estimate(
     disk_estimates_t * est)
 {
-  int level;
-  off_t size;
-
-  for(level = 0; level < DUMP_LEVELS; level++) {
-      if (est->est[level].needestimate) {
-         dbprintf(("%s: getting size via wrapper for %s level %d\n",
-                   debug_prefix_time(NULL), est->qamname, level));
-         size = getsize_wrapper(est->program, est->amname, est->amdevice,
-                       level, est->options, est->est[level].dumpsince);
-
-         amflock(1, "size");
-
-         if (fseek(stdout, 0L, SEEK_END) < 0) {
-             dbprintf(("wrapper_calc_estimates: warning - seek failed: %s\n",
-                       strerror(errno)));
-         }
-
-         printf("%s %d SIZE " OFF_T_FMT "\n", est->qamname, level,
-                (OFF_T_FMT_TYPE)size);
-         fflush(stdout);
-
-         amfunlock(1, "size");
-      }
-  }
+    int    level;
+    off_t  size;
+    char  *errmsg = NULL, *qerrmsg;
+
+    for(level = 0; level < DUMP_LEVELS; level++) {
+       if (est->est[level].needestimate) {
+           dbprintf(("%s: getting size via backup-api for %s %s level %d\n",
+                     debug_prefix_time(NULL), est->qamname, est->qamdevice,
+                     level));
+           size = getsize_backup_api(est->program, est->amname, est->amdevice,
+                                     level, est->options,
+                                     est->est[level].dumpsince, &errmsg);
+
+           amflock(1, "size");
+
+           printf("%s %d SIZE " OFF_T_FMT "\n", est->qamname, level,
+                  (OFF_T_FMT_TYPE)size);
+           if (errmsg && errmsg[0] != '\0') {
+               if(am_has_feature(g_options->features,
+                                 fe_rep_sendsize_quoted_error)) {
+                   qerrmsg = quote_string(errmsg);
+                   dbprintf(("errmsg is %s\n", errmsg));
+                   printf("%s %d ERROR %s\n",
+                          est->qamname, level, qerrmsg);
+                   amfree(qerrmsg);
+               }
+           }
+           amfree(errmsg);
+           fflush(stdout);
+
+           amfunlock(1, "size");
+       }
+    }
 }
 
 
@@ -754,7 +776,7 @@ generic_calc_estimates(
     char *cmd;
     char *my_argv[DUMP_LEVELS*2+22];
     char number[NUM_STR_SIZE];
-    int i, level, my_argc, status;
+    int i, level, my_argc;
     pid_t calcpid;
     int nb_exclude = 0;
     int nb_include = 0;
@@ -765,6 +787,8 @@ generic_calc_estimates(
     off_t size = (off_t)1;
     char *line = NULL;
     char *match_expr;
+    amwait_t wait_status;
+    char *errmsg = NULL, *qerrmsg;
 
     cmd = vstralloc(libexecdir, "/", "calcsize", versionsuffix(), NULL);
 
@@ -830,7 +854,9 @@ generic_calc_estimates(
     fflush(stderr); fflush(stdout);
 
     if ((nullfd = open("/dev/null", O_RDWR)) == -1) {
-       dbprintf(("Cannot access /dev/null : %s\n", strerror(errno)));
+       errmsg = vstrallocf("Cannot access /dev/null : %s",
+                           strerror(errno));
+       dbprintf(("%s\n", errmsg));
        goto common_exit;
     }
 
@@ -844,33 +870,61 @@ generic_calc_estimates(
     }
     match_expr = vstralloc(est->qamname," %d SIZE " OFF_T_FMT, NULL);
     for(size = (off_t)-1; (line = agets(dumpout)) != NULL; free(line)) {
+       OFF_T_FMT_TYPE size_ = (OFF_T_FMT_TYPE)0;
        if (line[0] == '\0')
            continue;
-       if(sscanf(line, match_expr, &level, &size) == 2) {
+       if(sscanf(line, match_expr, &level, &size_) == 2) {
            printf("%s\n", line); /* write to amandad */
            dbprintf(("%s: estimate size for %s level %d: " OFF_T_FMT " KB\n",
-                     debug_prefix(NULL),
+                     debug_prefix_time(NULL),
                      est->qamname,
                      level,
-                     size));
+                     size_));
        }
+       size = (off_t)size_;
     }
     amfree(match_expr);
 
     dbprintf(("%s: waiting for %s %s child (pid=%d)\n",
              debug_prefix_time(NULL), my_argv[0], est->qamdevice, calcpid));
-    wait(&status);
+    waitpid(calcpid, &wait_status, 0);
+    if (WIFSIGNALED(wait_status)) {
+       errmsg = vstrallocf("%s terminated with signal %d: see %s",
+                           "calcsize", WTERMSIG(wait_status),
+                           debug_fn());
+    } else if (WIFEXITED(wait_status)) {
+       if (WEXITSTATUS(wait_status) != 0) {
+           errmsg = vstrallocf("%s exited with status %d: see %s",
+                               "calcsize", WEXITSTATUS(wait_status),
+                               debug_fn());
+       } else {
+           /* Normal exit */
+       }
+    } else {
+       errmsg = vstrallocf("%s got bad exit: see %s",
+                            "calcsize", debug_fn());
+    }
     dbprintf(("%s: after %s %s wait: child pid=%d status=%d\n",
              debug_prefix_time(NULL), my_argv[0], est->qamdevice,
-             calcpid, WEXITSTATUS(status)));
+             calcpid, WEXITSTATUS(wait_status)));
 
     dbprintf(("%s: .....\n", debug_prefix_time(NULL)));
     dbprintf(("%s: estimate time for %s: %s\n",
-             debug_prefix(NULL),
+             debug_prefix_time(NULL),
              est->qamname,
              walltime_str(timessub(curclock(), start_time))));
 
 common_exit:
+    if (errmsg && errmsg[0] != '\0') {
+       if(am_has_feature(g_options->features, fe_rep_sendsize_quoted_error)) {
+           qerrmsg = quote_string(errmsg);
+           dbprintf(("errmsg is %s\n", errmsg));
+           printf("%s %d ERROR %s\n",
+                   est->qamname, 0, qerrmsg);
+           amfree(qerrmsg);
+       }
+    }
+    amfree(errmsg);
     for(i = 0; i < my_argc; i++) {
        amfree(my_argv[i]);
     }
@@ -884,23 +938,30 @@ dump_calc_estimates(
 {
     int level;
     off_t size;
+    char *errmsg=NULL, *qerrmsg;
 
     for(level = 0; level < DUMP_LEVELS; level++) {
        if(est->est[level].needestimate) {
            dbprintf(("%s: getting size via dump for %s level %d\n",
                      debug_prefix_time(NULL), est->qamname, level));
            size = getsize_dump(est->amname, est->amdevice,
-                       level, est->options);
+                               level, est->options, &errmsg);
 
            amflock(1, "size");
 
-           if (fseek(stdout, 0L, SEEK_END) < 0) {
-               dbprintf(("dump_calc_estimates: warning - seek failed: %s\n",
-                               strerror(errno)));
-           }
-
            printf("%s %d SIZE " OFF_T_FMT "\n",
                   est->qamname, level, (OFF_T_FMT_TYPE)size);
+           if (errmsg && errmsg[0] != '\0') {
+               if(am_has_feature(g_options->features,
+                                 fe_rep_sendsize_quoted_error)) {
+                   qerrmsg = quote_string(errmsg);
+                   dbprintf(("errmsg is %s\n", errmsg));
+                   printf("%s %d ERROR %s\n",
+                          est->qamname, level, qerrmsg);
+                   amfree(qerrmsg);
+               }
+           }
+           amfree(errmsg);
            fflush(stdout);
 
            amfunlock(1, "size");
@@ -915,22 +976,30 @@ smbtar_calc_estimates(
 {
     int level;
     off_t size;
+    char  *errmsg = NULL, *qerrmsg;
 
     for(level = 0; level < DUMP_LEVELS; level++) {
        if(est->est[level].needestimate) {
            dbprintf(("%s: getting size via smbclient for %s level %d\n",
                      debug_prefix_time(NULL), est->qamname, level));
-           size = getsize_smbtar(est->amname, est->amdevice, level, est->options);
+           size = getsize_smbtar(est->amname, est->amdevice, level,
+                                 est->options, &errmsg);
 
            amflock(1, "size");
 
-           if (fseek(stdout, 0L, SEEK_END) < 0) {
-               dbprintf(("smbtar_calc_estimates: warning - seek failed: %s\n",
-                               strerror(errno)));
-           }
-
            printf("%s %d SIZE " OFF_T_FMT "\n",
                   est->qamname, level, (OFF_T_FMT_TYPE)size);
+           if (errmsg && errmsg[0] != '\0') {
+               if(am_has_feature(g_options->features,
+                                 fe_rep_sendsize_quoted_error)) {
+                   qerrmsg = quote_string(errmsg);
+                   dbprintf(("errmsg is %s\n", errmsg));
+                   printf("%s %d ERROR %s\n",
+                          est->qamname, level, qerrmsg);
+                   amfree(qerrmsg);
+               }
+           }
+           amfree(errmsg);
            fflush(stdout);
 
            amfunlock(1, "size");
@@ -944,30 +1013,38 @@ void
 gnutar_calc_estimates(
     disk_estimates_t * est)
 {
-  int level;
-  off_t size;
-
-  for(level = 0; level < DUMP_LEVELS; level++) {
-      if (est->est[level].needestimate) {
-         dbprintf(("%s: getting size via gnutar for %s level %d\n",
-                   debug_prefix_time(NULL), est->qamname, level));
-         size = getsize_gnutar(est->amname, est->amdevice, level,
-                               est->options, est->est[level].dumpsince);
-
-         amflock(1, "size");
-
-         if (fseek(stdout, 0L, SEEK_END) < 0) {
-             dbprintf(("gnutar_calc_estimates: warning - seek failed: %s\n",
-                               strerror(errno)));
-         }
-
-         printf("%s %d SIZE " OFF_T_FMT "\n",
-                est->qamname, level, (OFF_T_FMT_TYPE)size);
-         fflush(stdout);
-
-         amfunlock(1, "size");
-      }
-  }
+    int level;
+    off_t size;
+    char *errmsg = NULL, *qerrmsg;
+
+    for(level = 0; level < DUMP_LEVELS; level++) {
+       if (est->est[level].needestimate) {
+           dbprintf(("%s: getting size via gnutar for %s level %d\n",
+                     debug_prefix_time(NULL), est->qamname, level));
+           size = getsize_gnutar(est->amname, est->amdevice, level,
+                                 est->options, est->est[level].dumpsince,
+                                 &errmsg);
+
+           amflock(1, "size");
+
+           printf("%s %d SIZE " OFF_T_FMT "\n",
+                  est->qamname, level, (OFF_T_FMT_TYPE)size);
+           if (errmsg && errmsg[0] != '\0') {
+               if(am_has_feature(g_options->features,
+                                 fe_rep_sendsize_quoted_error)) {
+                   qerrmsg = quote_string(errmsg);
+                   dbprintf(("errmsg is %s\n", errmsg));
+                   printf("%s %d ERROR %s\n",
+                          est->qamname, level, qerrmsg);
+                   amfree(qerrmsg);
+               }
+           }
+           amfree(errmsg);
+           fflush(stdout);
+
+           amfunlock(1, "size");
+       }
+    }
 }
 #endif
 
@@ -1037,10 +1114,11 @@ regex_t re_size[] = {
 
 off_t
 getsize_dump(
-    char       *disk,
-    char       *amdevice,
+    char       *disk,
+    char       *amdevice,
     int                level,
-    option_t * options)
+    option_t   *options,
+    char      **errmsg)
 {
     int pipefd[2], nullfd, stdoutfd, killctl[2];
     pid_t dumppid;
@@ -1059,6 +1137,7 @@ getsize_dump(
     char *qdisk = quote_string(disk);
     char *qdevice;
     char *config;
+    amwait_t wait_status;
 #if defined(DUMP) || defined(VDUMP) || defined(VXDUMP) || defined(XFSDUMP)
     int is_rundump = 1;
 #endif
@@ -1083,8 +1162,9 @@ getsize_dump(
     else
         config = "NOCONFIG";
     if ((stdoutfd = nullfd = open("/dev/null", O_RDWR)) == -1) {
-       dbprintf(("getsize_dump could not open /dev/null: %s\n",
-                 strerror(errno)));
+       *errmsg = vstrallocf("getsize_dump could not open /dev/null: %s",
+                            strerror(errno));
+       dbprintf(("%s\n", *errmsg));
        amfree(cmd);
        amfree(rundump_cmd);
        amfree(fstype);
@@ -1095,8 +1175,9 @@ getsize_dump(
     }
     pipefd[0] = pipefd[1] = killctl[0] = killctl[1] = -1;
     if (pipe(pipefd) < 0) {
-       dbprintf(("getsize_dump could create data pipes: %s\n",
-                 strerror(errno)));
+       *errmsg = vstrallocf("getsize_dump could create data pipes: %s",
+                            strerror(errno));
+       dbprintf(("%s\n", *errmsg));
        amfree(cmd);
        amfree(rundump_cmd);
        amfree(fstype);
@@ -1190,7 +1271,7 @@ getsize_dump(
 #  endif
        dumpkeys = vstralloc(level_str,
                             PARAM_DUMP_ESTIMATE,
-                            PARAM_DUMP_ESTIMATE,
+                            PARAM_HONOR_NODUMP,
                             "s", "f", NULL);
 
 #  ifdef HAVE_DUMP_ESTIMATE
@@ -1215,7 +1296,7 @@ getsize_dump(
 
     if (pipe(killctl) < 0) {
        dbprintf(("%s: Could not create pipe: %s\n",
-               debug_prefix(NULL), strerror(errno)));
+               debug_prefix_time(NULL), strerror(errno)));
        /* Message will be printed later... */
        killctl[0] = killctl[1] = -1;
     }
@@ -1223,8 +1304,9 @@ getsize_dump(
     start_time = curclock();
     switch(dumppid = fork()) {
     case -1:
-       dbprintf(("%s: cannot fork for killpgrp: %s\n",
-                 debug_prefix(NULL), strerror(errno)));
+       *errmsg = vstrallocf("cannot fork for killpgrp: %s",
+                            strerror(errno));
+       dbprintf(("%s\n", *errmsg));
        amfree(dumpkeys);
        amfree(cmd);
        amfree(rundump_cmd);
@@ -1240,12 +1322,12 @@ getsize_dump(
        if(SETPGRP == -1)
            SETPGRP_FAILED();
        else if (killctl[0] == -1 || killctl[1] == -1)
-           dbprintf(("%s: Trying without killpgrp\n", debug_prefix(NULL)));
+           dbprintf(("%s: Trying without killpgrp\n", debug_prefix_time(NULL)));
        else {
            switch(fork()) {
            case -1:
                dbprintf(("%s: fork failed, trying without killpgrp\n",
-                         debug_prefix(NULL)));
+                         debug_prefix_time(NULL)));
                break;
 
            default:
@@ -1269,7 +1351,7 @@ getsize_dump(
                execle(killpgrp_cmd, killpgrp_cmd, config, (char *)0,
                       safe_env());
                dbprintf(("%s: cannot execute %s: %s\n",
-                         debug_prefix(NULL), killpgrp_cmd, strerror(errno)));
+                         debug_prefix_time(NULL), killpgrp_cmd, strerror(errno)));
                exit(-1);
            }
 
@@ -1394,26 +1476,29 @@ getsize_dump(
 
     dbprintf(("%s: .....\n", debug_prefix_time(NULL)));
     dbprintf(("%s: estimate time for %s level %d: %s\n",
-             debug_prefix(NULL),
+             debug_prefix_time(NULL),
              qdisk,
              level,
              walltime_str(timessub(curclock(), start_time))));
     if(size == (off_t)-1) {
-       dbprintf(("%s: no size line match in %s%s output for \"%s\"\n",
-                 debug_prefix(NULL), cmd, name, disk));
-       dbprintf(("%s: .....\n", debug_prefix(NULL)));
+       *errmsg = vstrallocf("no size line match in %s%s output",
+                            cmd, name);
+       dbprintf(("%s: %s for %s\n", debug_prefix_time(NULL),
+                 *errmsg, qdisk));
+
+       dbprintf(("%s: .....\n", debug_prefix_time(NULL)));
        dbprintf(("%s: Run %s%s manually to check for errors\n",
-                   debug_prefix(NULL), cmd, name));
+                   debug_prefix_time(NULL), cmd, name));
     } else if(size == (off_t)0 && level == 0) {
        dbprintf(("%s: possible %s%s problem -- is \"%s\" really empty?\n",
-                 debug_prefix(NULL), cmd, name, disk));
-       dbprintf(("%s: .....\n", debug_prefix(NULL)));
+                 debug_prefix_time(NULL), cmd, name, disk));
+       dbprintf(("%s: .....\n", debug_prefix_time(NULL)));
     } else {
-           dbprintf(("%s: estimate size for %s level %d: %ld KB\n",
-             debug_prefix(NULL),
+           dbprintf(("%s: estimate size for %s level %d: " OFF_T_FMT " KB\n",
+             debug_prefix_time(NULL),
              qdisk,
              level,
-             size));
+             (OFF_T_FMT_TYPE)size));
     }
 
     if (killctl[1] != -1) {
@@ -1435,7 +1520,7 @@ getsize_dump(
              debug_prefix_time(NULL), (long)dumppid));
     if (kill(-dumppid, SIGTERM) == -1) {
        dbprintf(("%s: kill failed: %s\n",
-                 debug_prefix(NULL), strerror(errno)));
+                 debug_prefix_time(NULL), strerror(errno)));
     }
     /* Now check whether it dies */
     for(s = 5; s > 0; --s) {
@@ -1448,7 +1533,7 @@ getsize_dump(
              debug_prefix_time(NULL), (long)dumppid));
     if (kill(-dumppid, SIGKILL) == -1) {
        dbprintf(("%s: kill failed: %s\n",
-                 debug_prefix(NULL), strerror(errno)));
+                 debug_prefix_time(NULL), strerror(errno)));
     }
     for(s = 5; s > 0; --s) {
        sleep(1);
@@ -1458,7 +1543,21 @@ getsize_dump(
 
     dbprintf(("%s: waiting for %s%s \"%s\" child\n",
              debug_prefix_time(NULL), cmd, name, qdisk));
-    wait(NULL);
+    waitpid(dumppid, &wait_status, 0);
+    if (WIFSIGNALED(wait_status)) {
+       *errmsg = vstrallocf("%s terminated with signal %d: see %s",
+                            cmd, WTERMSIG(wait_status), debug_fn());
+    } else if (WIFEXITED(wait_status)) {
+       if (WEXITSTATUS(wait_status) != 0) {
+           *errmsg = vstrallocf("%s exited with status %d: see %s",
+                                cmd, WEXITSTATUS(wait_status), debug_fn());
+       } else {
+           /* Normal exit */
+       }
+    } else {
+       *errmsg = vstrallocf("%s got bad exit: see %s",
+                            cmd, debug_fn());
+    }
     dbprintf(("%s: after %s%s %s wait\n",
              debug_prefix_time(NULL), cmd, name, qdisk));
 
@@ -1481,10 +1580,11 @@ getsize_dump(
 #ifdef SAMBA_CLIENT
 off_t
 getsize_smbtar(
-    char       *disk,
-    char       *amdevice,
+    char       *disk,
+    char       *amdevice,
     int                level,
-    option_t * options)
+    option_t   *options,
+    char      **errmsg)
 {
     int pipefd = -1, nullfd = -1, passwdfd = -1;
     pid_t dumppid;
@@ -1500,6 +1600,7 @@ getsize_smbtar(
     times_t start_time;
     char *error_pn = NULL;
     char *qdisk = quote_string(disk);
+    amwait_t wait_status;
 
     (void)options;     /* Quiet unused parameter warning */
 
@@ -1662,30 +1763,47 @@ getsize_smbtar(
 
     dbprintf(("%s: .....\n", debug_prefix_time(NULL)));
     dbprintf(("%s: estimate time for %s level %d: %s\n",
-             debug_prefix(NULL),
+             debug_prefix_time(NULL),
              qdisk,
              level,
              walltime_str(timessub(curclock(), start_time))));
     if(size == (off_t)-1) {
-       dbprintf(("%s: no size line match in %s output for \"%s\"\n",
-                 debug_prefix(NULL), SAMBA_CLIENT, disk));
-       dbprintf(("%s: .....\n", debug_prefix(NULL)));
+       *errmsg = vstrallocf("no size line match in %s output",
+                            SAMBA_CLIENT);
+       dbprintf(("%s: %s for %s\n", debug_prefix_time(NULL),
+                 *errmsg, qdisk));
+       dbprintf(("%s: .....\n", debug_prefix_time(NULL)));
     } else if(size == (off_t)0 && level == 0) {
        dbprintf(("%s: possible %s problem -- is \"%s\" really empty?\n",
-                 debug_prefix(NULL), SAMBA_CLIENT, disk));
-       dbprintf(("%s: .....\n", debug_prefix(NULL)));
+                 debug_prefix_time(NULL), SAMBA_CLIENT, disk));
+       dbprintf(("%s: .....\n", debug_prefix_time(NULL)));
     }
-    dbprintf(("%s: estimate size for %s level %d: %ld KB\n",
-             debug_prefix(NULL),
+    dbprintf(("%s: estimate size for %s level %d: " OFF_T_FMT " KB\n",
+             debug_prefix_time(NULL),
              qdisk,
              level,
-             size));
+             (OFF_T_FMT_TYPE)size));
 
     kill(-dumppid, SIGTERM);
 
     dbprintf(("%s: waiting for %s \"%s\" child\n",
              debug_prefix_time(NULL), SAMBA_CLIENT, qdisk));
-    wait(NULL);
+    waitpid(dumppid, &wait_status, 0);
+    if (WIFSIGNALED(wait_status)) {
+       *errmsg = vstrallocf("%s terminated with signal %d: see %s",
+                            "smbclient", WTERMSIG(wait_status), debug_fn());
+    } else if (WIFEXITED(wait_status)) {
+       if (WEXITSTATUS(wait_status) != 0) {
+           *errmsg = vstrallocf("%s exited with status %d: see %s",
+                                "smbclient", WEXITSTATUS(wait_status),
+                                debug_fn());
+       } else {
+           /* Normal exit */
+       }
+    } else {
+       *errmsg = vstrallocf("%s got bad exit: see %s",
+                            "smbclient", debug_fn());
+    }
     dbprintf(("%s: after %s %s wait\n",
              debug_prefix_time(NULL), SAMBA_CLIENT, qdisk));
 
@@ -1702,11 +1820,12 @@ getsize_smbtar(
 #ifdef GNUTAR
 off_t
 getsize_gnutar(
-    char       *disk,
-    char       *amdevice,
+    char       *disk,
+    char       *amdevice,
     int                level,
-    option_t * options,
-    time_t     dumpsince)
+    option_t   *options,
+    time_t     dumpsince,
+    char      **errmsg)
 {
     int pipefd = -1, nullfd = -1;
     pid_t dumppid;
@@ -1734,6 +1853,7 @@ getsize_gnutar(
     char buf[32768];
     char *qdisk = quote_string(disk);
     char *gnutar_list_dir;
+    amwait_t wait_status;
 
     if(options->exclude_file) nb_exclude += options->exclude_file->nb_element;
     if(options->exclude_list) nb_exclude += options->exclude_list->nb_element;
@@ -1746,7 +1866,7 @@ getsize_gnutar(
     my_argv = alloc(SIZEOF(char *) * 22);
     i = 0;
 
-    gnutar_list_dir = client_getconf_str(CLN_GNUTAR_LIST_DIR);
+    gnutar_list_dir = getconf_str(CNF_GNUTAR_LIST_DIR);
     if (strlen(gnutar_list_dir) == 0)
        gnutar_list_dir = NULL;
     if (gnutar_list_dir) {
@@ -1789,13 +1909,14 @@ getsize_gnutar(
                inputname = newstralloc(inputname, "/dev/null");
            }
            if ((infd = open(inputname, O_RDONLY)) == -1) {
-               int save_errno = errno;
 
-               dbprintf(("%s: gnutar: error opening %s: %s\n",
-                         debug_prefix(NULL), inputname, strerror(save_errno)));
+               *errmsg = vstrallocf("gnutar: error opening %s: %s",
+                                    inputname, strerror(errno));
+               dbprintf(("%s: %s\n", debug_prefix_time(NULL), *errmsg));
                if (baselevel < 0) {
                    goto common_exit;
                }
+               amfree(*errmsg);
            }
        }
 
@@ -1803,33 +1924,38 @@ getsize_gnutar(
         * Copy the previous listed incremental file to the new one.
         */
        if ((outfd = open(incrname, O_WRONLY|O_CREAT, 0600)) == -1) {
-           dbprintf(("%s: opening %s: %s\n",
-                     debug_prefix(NULL), incrname, strerror(errno)));
+           *errmsg = vstrallocf("opening %s: %s",
+                                incrname, strerror(errno));
+           dbprintf(("%s: %s\n", debug_prefix_time(NULL), *errmsg));
            goto common_exit;
        }
 
        while ((nb = read(infd, &buf, SIZEOF(buf))) > 0) {
            if (fullwrite(outfd, &buf, (size_t)nb) < nb) {
-               dbprintf(("%s: writing to %s: %s\n",
-                          debug_prefix(NULL), incrname, strerror(errno)));
+               *errmsg = vstrallocf("writing to %s: %s",
+                                    incrname, strerror(errno));
+               dbprintf(("%s: %s\n", debug_prefix_time(NULL), *errmsg));
                goto common_exit;
            }
        }
 
        if (nb < 0) {
-           dbprintf(("%s: reading from %s: %s\n",
-                     debug_prefix(NULL), inputname, strerror(errno)));
+           *errmsg = vstrallocf("reading from %s: %s",
+                                inputname, strerror(errno));
+           dbprintf(("%s: %s\n", debug_prefix_time(NULL), *errmsg));
            goto common_exit;
        }
 
        if (close(infd) != 0) {
-           dbprintf(("%s: closing %s: %s\n",
-                     debug_prefix(NULL), inputname, strerror(errno)));
+           *errmsg = vstrallocf("closing %s: %s",
+                                inputname, strerror(errno));
+           dbprintf(("%s: %s\n", debug_prefix_time(NULL), *errmsg));
            goto common_exit;
        }
        if (close(outfd) != 0) {
-           dbprintf(("%s: closing %s: %s\n",
-                     debug_prefix(NULL), incrname, strerror(errno)));
+           *errmsg = vstrallocf("closing %s: %s",
+                                incrname, strerror(errno));
+           dbprintf(("%s: %s\n", debug_prefix_time(NULL), *errmsg));
            goto common_exit;
        }
 
@@ -1900,7 +2026,9 @@ getsize_gnutar(
     start_time = curclock();
 
     if ((nullfd = open("/dev/null", O_RDWR)) == -1) {
-       dbprintf(("Cannot access /dev/null : %s\n", strerror(errno)));
+       *errmsg = vstrallocf("Cannot access /dev/null : %s",
+                            strerror(errno));
+       dbprintf(("%s: %s\n", debug_prefix_time(NULL), *errmsg));
        goto common_exit;
     }
 
@@ -1936,30 +2064,45 @@ getsize_gnutar(
 
     dbprintf(("%s: .....\n", debug_prefix_time(NULL)));
     dbprintf(("%s: estimate time for %s level %d: %s\n",
-             debug_prefix(NULL),
+             debug_prefix_time(NULL),
              qdisk,
              level,
              walltime_str(timessub(curclock(), start_time))));
     if(size == (off_t)-1) {
-       dbprintf(("%s: no size line match in %s output for \"%s\"\n",
-                 debug_prefix(NULL), my_argv[0], disk));
-       dbprintf(("%s: .....\n", debug_prefix(NULL)));
+       *errmsg = vstrallocf("no size line match in %s output", my_argv[0]);
+       dbprintf(("%s: %s for %s\n", debug_prefix_time(NULL),
+                 *errmsg, qdisk));
+       dbprintf(("%s: .....\n", debug_prefix_time(NULL)));
     } else if(size == (off_t)0 && level == 0) {
        dbprintf(("%s: possible %s problem -- is \"%s\" really empty?\n",
-                 debug_prefix(NULL), my_argv[0], disk));
-       dbprintf(("%s: .....\n", debug_prefix(NULL)));
+                 debug_prefix_time(NULL), my_argv[0], disk));
+       dbprintf(("%s: .....\n", debug_prefix_time(NULL)));
     }
-    dbprintf(("%s: estimate size for %s level %d: %ld KB\n",
-             debug_prefix(NULL),
+    dbprintf(("%s: estimate size for %s level %d: " OFF_T_FMT " KB\n",
+             debug_prefix_time(NULL),
              qdisk,
              level,
-             size));
+             (OFF_T_FMT_TYPE)size));
 
     kill(-dumppid, SIGTERM);
 
     dbprintf(("%s: waiting for %s \"%s\" child\n",
              debug_prefix_time(NULL), my_argv[0], qdisk));
-    wait(NULL);
+    waitpid(dumppid, &wait_status, 0);
+    if (WIFSIGNALED(wait_status)) {
+       *errmsg = vstrallocf("%s terminated with signal %d: see %s",
+                            cmd, WTERMSIG(wait_status), debug_fn());
+    } else if (WIFEXITED(wait_status)) {
+       if (WEXITSTATUS(wait_status) != 0) {
+           *errmsg = vstrallocf("%s exited with status %d: see %s",
+                                cmd, WEXITSTATUS(wait_status), debug_fn());
+       } else {
+           /* Normal exit */
+       }
+    } else {
+       *errmsg = vstrallocf("%s got bad exit: see %s",
+                            cmd, debug_fn());
+    }
     dbprintf(("%s: after %s %s wait\n",
              debug_prefix_time(NULL), my_argv[0], qdisk));
 
@@ -1988,18 +2131,19 @@ common_exit:
 #endif
 
 off_t
-getsize_wrapper(
+getsize_backup_api(
     char       *program,
     char       *disk,
     char       *amdevice,
-    int                level,
-    option_t * options,
-    time_t     dumpsince)
+    int                 level,
+    option_t   *options,
+    time_t      dumpsince,
+    char        **errmsg)
 {
-    int pipefd[2], nullfd;
+    int pipeinfd[2], pipeoutfd[2], nullfd;
     pid_t dumppid;
     off_t size = (off_t)-1;
-    FILE *dumpout;
+    FILE *dumpout, *toolin;
     char *line = NULL;
     char *cmd = NULL;
     char dumptimestr[80];
@@ -2011,7 +2155,11 @@ getsize_wrapper(
     times_t start_time;
     char *qdisk = quote_string(disk);
     char *qamdevice = quote_string(amdevice);
+    amwait_t wait_status;
+    char levelstr[NUM_STR_SIZE];
+    backup_support_option_t *bsu;
 
+    (void)options;
     gmtm = gmtime(&dumpsince);
     snprintf(dumptimestr, SIZEOF(dumptimestr),
                "%04d-%02d-%02d %2d:%02d:%02d GMT",
@@ -2020,20 +2168,35 @@ getsize_wrapper(
 
     cmd = vstralloc(DUMPER_DIR, "/", program, NULL);
 
+    bsu = backup_support_option(program, g_options, disk, amdevice);
+
     i=0;
     argvchild[i++] = program;
     argvchild[i++] = "estimate";
-    if(level == 0)
-       argvchild[i++] = "full";
-    else {
-       char levelstr[NUM_STR_SIZE];
+    if (bsu->message_line == 1) {
+       argvchild[i++] = "--message";
+       argvchild[i++] = "line";
+    }
+    if (g_options->config && bsu->config == 1) {
+       argvchild[i++] = "--config";
+       argvchild[i++] = g_options->config;
+    }
+    if (g_options->hostname && bsu->host == 1) {
+       argvchild[i++] = "--host";
+       argvchild[i++] = g_options->hostname;
+    }
+    argvchild[i++] = "--device";
+    argvchild[i++] = amdevice;
+    if (disk && bsu->disk == 1) {
+       argvchild[i++] = "--disk";
+       argvchild[i++] = disk;
+    }
+    if (level <= bsu->max_level) {
+       argvchild[i++] = "--level";
        snprintf(levelstr,SIZEOF(levelstr),"%d",level);
-       argvchild[i++] = "level";
        argvchild[i++] = levelstr;
     }
-    argvchild[i++] = amdevice;
-    newoptstr = vstralloc(options->str,"estimate-direct;", NULL);
-    argvchild[i++] = newoptstr;
+
     argvchild[i] = NULL;
 
     dbprintf(("%s: running %s", debug_prefix_time(NULL), cmd));
@@ -2043,13 +2206,23 @@ getsize_wrapper(
     dbprintf(("\n"));
 
     if ((nullfd = open("/dev/null", O_RDWR)) == -1) {
-       dbprintf(("Cannot access /dev/null : %s\n", strerror(errno)));
+       *errmsg = vstrallocf("Cannot access /dev/null : %s",
+                            strerror(errno));
+       dbprintf(("%s: %s\n", debug_prefix_time(NULL), *errmsg));
        goto common_exit;
     }
 
-    if (pipe(pipefd) < 0) {
-       dbprintf(("getsize_wrapper could create data pipes: %s\n",
-                 strerror(errno)));
+    if (pipe(pipeinfd) < 0) {
+       *errmsg = vstrallocf("getsize_backup_api could create data pipes: %s",
+                            strerror(errno));
+       dbprintf(("%s: %s\n", debug_prefix_time(NULL), *errmsg));
+       goto common_exit;
+    }
+
+    if (pipe(pipeoutfd) < 0) {
+       *errmsg = vstrallocf("getsize_backup_api could create data pipes: %s",
+                            strerror(errno));
+       dbprintf(("%s: %s\n", debug_prefix_time(NULL), *errmsg));
        goto common_exit;
     }
 
@@ -2062,10 +2235,11 @@ getsize_wrapper(
     default:
       break; /* parent */
     case 0:
-      dup2(nullfd, 0);
+      dup2(pipeinfd[0], 0);
+      dup2(pipeoutfd[1], 1);
       dup2(nullfd, 2);
-      dup2(pipefd[1], 1);
-      aclose(pipefd[0]);
+      aclose(pipeinfd[1]);
+      aclose(pipeoutfd[0]);
 
       execve(cmd, argvchild, safe_env());
       error("exec %s failed: %s", cmd, strerror(errno));
@@ -2073,20 +2247,34 @@ getsize_wrapper(
     }
     amfree(newoptstr);
 
-    aclose(pipefd[1]);
-    dumpout = fdopen(pipefd[0],"r");
+    aclose(pipeinfd[0]);
+    aclose(pipeoutfd[1]);
+
+    toolin = fdopen(pipeinfd[1],"w");
+    if (!toolin) {
+       error("Can't fdopen: %s", strerror(errno));
+       /*NOTREACHED*/
+    }
+
+    output_tool_property(toolin, options);
+    fflush(toolin);
+    fclose(toolin);
+
+    dumpout = fdopen(pipeoutfd[0],"r");
     if (!dumpout) {
        error("Can't fdopen: %s", strerror(errno));
        /*NOTREACHED*/
     }
 
     for(size = (off_t)-1; (line = agets(dumpout)) != NULL; free(line)) {
+       OFF_T_FMT_TYPE size1_ = (OFF_T_FMT_TYPE)0;
+       OFF_T_FMT_TYPE size2_ = (OFF_T_FMT_TYPE)0;
        if (line[0] == '\0')
            continue;
        dbprintf(("%s: %s\n", debug_prefix_time(NULL), line));
-       i = sscanf(line, OFF_T_FMT " " OFF_T_FMT,
-               (OFF_T_FMT_TYPE *)&size1, 
-               (OFF_T_FMT_TYPE *)&size2);
+       i = sscanf(line, OFF_T_FMT " " OFF_T_FMT, &size1_, &size2_);
+       size1 = (off_t)size1_;
+       size2 = (off_t)size2_;
        if(i == 2) {
            size = size1 * size2;
        }
@@ -2107,30 +2295,44 @@ getsize_wrapper(
 
     dbprintf(("%s: .....\n", debug_prefix_time(NULL)));
     dbprintf(("%s: estimate time for %s level %d: %s\n",
-             debug_prefix(NULL),
+             debug_prefix_time(NULL),
              qamdevice,
              level,
              walltime_str(timessub(curclock(), start_time))));
     if(size == (off_t)-1) {
-       dbprintf(("%s: no size line match in %s output for \"%s\"\n",
-                 debug_prefix(NULL), cmd, qdisk));
-       dbprintf(("%s: .....\n", debug_prefix(NULL)));
+       *errmsg = vstrallocf("no size line match in %s output", cmd);
+       dbprintf(("%s: %s for %s\n", debug_prefix_time(NULL), cmd, qdisk));
+       dbprintf(("%s: .....\n", debug_prefix_time(NULL)));
     } else if(size == (off_t)0 && level == 0) {
        dbprintf(("%s: possible %s problem -- is \"%s\" really empty?\n",
-                 debug_prefix(NULL), cmd, qdisk));
-       dbprintf(("%s: .....\n", debug_prefix(NULL)));
+                 debug_prefix_time(NULL), cmd, qdisk));
+       dbprintf(("%s: .....\n", debug_prefix_time(NULL)));
     }
     dbprintf(("%s: estimate size for %s level %d: " OFF_T_FMT " KB\n",
-             debug_prefix(NULL),
+             debug_prefix_time(NULL),
              qamdevice,
              level,
-             size));
+             (OFF_T_FMT_TYPE)size));
 
     kill(-dumppid, SIGTERM);
 
     dbprintf(("%s: waiting for %s \"%s\" child\n",
              debug_prefix_time(NULL), cmd, qdisk));
-    wait(NULL);
+    waitpid(dumppid, &wait_status, 0);
+    if (WIFSIGNALED(wait_status)) {
+       *errmsg = vstrallocf("%s terminated with signal %d: see %s",
+                            cmd, WTERMSIG(wait_status), debug_fn());
+    } else if (WIFEXITED(wait_status)) {
+       if (WEXITSTATUS(wait_status) != 0) {
+           *errmsg = vstrallocf("%s exited with status %d: see %s", cmd,
+                                WEXITSTATUS(wait_status), debug_fn());
+       } else {
+           /* Normal exit */
+       }
+    } else {
+       *errmsg = vstrallocf("%s got bad exit: see %s",
+                            cmd, debug_fn());
+    }
     dbprintf(("%s: after %s %s wait\n",
              debug_prefix_time(NULL), cmd, qdisk));
 
index 7f25d62e856a929272840b8c3588bfe64949c96b..672eb190448ff175287acedd06e4ff46bd87cb89 100644 (file)
@@ -1,11 +1,8 @@
 # Makefile for Amanda library.
 
-lib_LTLIBRARIES =      libamanda.la
-
-REGDIR = ../regex-src
-REGsrcdir = $(srcdir)/$(REGDIR)
+INCLUDES =      -I$(top_srcdir)/gnulib   
 
-INCLUDES = -I$(REGsrcdir)
+lib_LTLIBRARIES =      libamanda.la
 
 LINT=@AMLINT@
 LINTFLAGS=@AMLINTFLAGS@
@@ -18,6 +15,7 @@ libamanda_la_SOURCES =                \
        bsdtcp-security.c       \
        bsdudp-security.c       \
        clock.c                 \
+       conffile.c              \
        debug.c                 \
        dgram.c                 \
        error.c                 \
@@ -30,10 +28,6 @@ libamanda_la_SOURCES =               \
        packet.c                \
        pipespawn.c             \
        protocol.c              \
-       regcomp.c               \
-       regerror.c              \
-       regexec.c               \
-       regfree.c               \
        rsh-security.c          \
        security.c              \
        security-util.c         \
@@ -47,15 +41,16 @@ libamanda_la_SOURCES =              \
        version.c               \
        versuff.c
 
-libamanda_la_LIBADD =  @LTLIBOBJS@ @LTALLOCA@
+#libamanda_la_LIBADD = @LTLIBOBJS@
+
 libamanda_la_LDFLAGS =  -release $(VERSION)
 
 noinst_HEADERS =               \
        amanda.h                \
        amfeatures.h            \
-       amregex.h               \
        arglist.h               \
        clock.h                 \
+       conffile.h              \
        dgram.h                 \
        event.h                 \
        fileheader.h            \
@@ -94,39 +89,13 @@ version.c:  genversion$(EXEEXT)
        -rm -f version.c
        ./genversion > version.c
 
-match.@OBJEXT@ match.lo: regex.h
-regcomp.@OBJEXT@ regcomp.lo: regex.h regcomp.ih
-regexec.@OBJEXT@ regexec.lo: regex.h engine.ih
-regerror.@OBJEXT@ regerror.lo: regex.h regerror.ih
-regfree.@OBJEXT@ regfree.lo: regex.h
-
-REGEXCSRC =    $(REGsrcdir)/regcomp.c  \
-               $(REGsrcdir)/regexec.c  \
-               $(REGsrcdir)/regerror.c \
-               $(REGsrcdir)/regfree.c
-
-REGEXHSRC =    $(REGsrcdir)/regex2.h   \
-               $(REGEXCSRC)
-
 # these are used for testing only:
 TEST_PROGS = statfs token file bsdsecurity amfeatures
 
-CLEANFILES = regex.h regcomp.ih engine.ih regerror.ih *.test.c
+CLEANFILES = *.test.c
 
 DISTCLEANFILES = version.c genversion.h genversion amanda-int.h
 
-regex.h: $(REGEXHSRC) $(REGsrcdir)/mkh
-       sh $(REGsrcdir)/mkh -i _REGEX_H_ $(REGEXHSRC) >$@
-
-regcomp.ih: $(REGsrcdir)/regcomp.c $(REGsrcdir)/mkh
-       sh $(REGsrcdir)/mkh -p $(REGsrcdir)/regcomp.c >$@
-
-engine.ih: $(REGsrcdir)/engine.c $(REGsrcdir)/mkh
-       sh $(REGsrcdir)/mkh -p $(REGsrcdir)/engine.c >$@
-
-regerror.ih: $(REGsrcdir)/regerror.c $(REGsrcdir)/mkh
-       sh $(REGsrcdir)/mkh -p $(REGsrcdir)/regerror.c >$@
-
 # used for testing only
 
 STANDARD_COMMON_STUFF_NOT_FILE = \
@@ -135,7 +104,8 @@ STANDARD_COMMON_STUFF_NOT_FILE = \
        debug.$(OBJEXT) \
        error.$(OBJEXT) \
        util.$(OBJEXT) \
-       match.$(OBJEXT)
+       match.$(OBJEXT) \
+       sl.$(OBJEXT)
 
 STANDARD_COMMON_STUFF = \
        $(STANDARD_COMMON_STUFF_NOT_FILE) \
index ac25aee6ba0c68da4048a08bc2024e9cbecc0cab..e22c64b02b3a31186fab0ea3e5acc71c6ceba3c3 100644 (file)
@@ -43,11 +43,44 @@ target_triplet = @target@
 EXTRA_PROGRAMS = genversion$(EXEEXT) $(am__EXEEXT_1)
 subdir = common-src
 DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
-       $(srcdir)/Makefile.in $(srcdir)/versuff.c.in alloca.c getcwd.c \
-       memmove.c mktime.c snprintf.c strcasecmp.c strerror.c \
-       strftime.c strncasecmp.c strstr.c waitpid.c writev.c
+       $(srcdir)/Makefile.in $(srcdir)/versuff.c.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+       $(top_srcdir)/config/gnulib/absolute-header.m4 \
+       $(top_srcdir)/config/gnulib/alloca.m4 \
+       $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/eoverflow.m4 \
+       $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/getaddrinfo.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-cache.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-common.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-comp.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-tool.m4 \
+       $(top_srcdir)/config/gnulib/inet_ntop.m4 \
+       $(top_srcdir)/config/gnulib/intmax_t.m4 \
+       $(top_srcdir)/config/gnulib/inttypes_h.m4 \
+       $(top_srcdir)/config/gnulib/lib-ld.m4 \
+       $(top_srcdir)/config/gnulib/lib-link.m4 \
+       $(top_srcdir)/config/gnulib/lib-prefix.m4 \
+       $(top_srcdir)/config/gnulib/lock.m4 \
+       $(top_srcdir)/config/gnulib/longdouble.m4 \
+       $(top_srcdir)/config/gnulib/longlong.m4 \
+       $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
+       $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \
+       $(top_srcdir)/config/gnulib/size_max.m4 \
+       $(top_srcdir)/config/gnulib/snprintf.m4 \
+       $(top_srcdir)/config/gnulib/socklen.m4 \
+       $(top_srcdir)/config/gnulib/sockpfaf.m4 \
+       $(top_srcdir)/config/gnulib/stdbool.m4 \
+       $(top_srcdir)/config/gnulib/stdint_h.m4 \
+       $(top_srcdir)/config/gnulib/strdup.m4 \
+       $(top_srcdir)/config/gnulib/string_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
+       $(top_srcdir)/config/gnulib/vasnprintf.m4 \
+       $(top_srcdir)/config/gnulib/visibility.m4 \
+       $(top_srcdir)/config/gnulib/wchar_t.m4 \
+       $(top_srcdir)/config/gnulib/wint_t.m4 \
+       $(top_srcdir)/config/gnulib/xsize.m4 \
        $(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
@@ -63,23 +96,22 @@ am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
 am__installdirs = "$(DESTDIR)$(libdir)"
 libLTLIBRARIES_INSTALL = $(INSTALL)
 LTLIBRARIES = $(lib_LTLIBRARIES)
-libamanda_la_DEPENDENCIES = @LTLIBOBJS@ @LTALLOCA@
+libamanda_la_LIBADD =
 am_libamanda_la_OBJECTS = alloc.lo amfeatures.lo amflock.lo \
        bsd-security.lo bsdtcp-security.lo bsdudp-security.lo clock.lo \
-       debug.lo dgram.lo error.lo event.lo file.lo fileheader.lo \
-       krb4-security.lo krb5-security.lo match.lo packet.lo \
-       pipespawn.lo protocol.lo regcomp.lo regerror.lo regexec.lo \
-       regfree.lo rsh-security.lo security.lo security-util.lo sl.lo \
-       ssh-security.lo statfs.lo stream.lo tapelist.lo token.lo \
-       util.lo version.lo versuff.lo
+       conffile.lo debug.lo dgram.lo error.lo event.lo file.lo \
+       fileheader.lo krb4-security.lo krb5-security.lo match.lo \
+       packet.lo pipespawn.lo protocol.lo rsh-security.lo security.lo \
+       security-util.lo sl.lo ssh-security.lo statfs.lo stream.lo \
+       tapelist.lo token.lo util.lo version.lo versuff.lo
 libamanda_la_OBJECTS = $(am_libamanda_la_OBJECTS)
 am__EXEEXT_1 = statfs$(EXEEXT) token$(EXEEXT) file$(EXEEXT) \
        bsdsecurity$(EXEEXT) amfeatures$(EXEEXT)
 am_amfeatures_OBJECTS = amfeatures.test.$(OBJEXT)
 amfeatures_OBJECTS = $(am_amfeatures_OBJECTS)
-am__DEPENDENCIES_1 = @LTLIBOBJS@ @LTALLOCA@
+am__DEPENDENCIES_1 =
 am__DEPENDENCIES_2 = alloc.$(OBJEXT) clock.$(OBJEXT) debug.$(OBJEXT) \
-       error.$(OBJEXT) util.$(OBJEXT) match.$(OBJEXT)
+       error.$(OBJEXT) util.$(OBJEXT) match.$(OBJEXT) sl.$(OBJEXT)
 am__DEPENDENCIES_3 = $(am__DEPENDENCIES_2) file.$(OBJEXT)
 amfeatures_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_3)
 am_bsdsecurity_OBJECTS = bsd-security.test.$(OBJEXT)
@@ -121,8 +153,10 @@ HEADERS = $(noinst_HEADERS)
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ABSOLUTE_STRING_H = @ABSOLUTE_STRING_H@
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
+ALLOCA_H = @ALLOCA_H@
 AMANDA_DBGDIR = @AMANDA_DBGDIR@
 AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@
 AMANDA_TMPDIR = @AMANDA_TMPDIR@
@@ -137,18 +171,17 @@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@
 AMTAR = @AMTAR@
 AM_CFLAGS = @AM_CFLAGS@
 AR = @AR@
+ARPA_INET_H = @ARPA_INET_H@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
-AWK_VAR_ASSIGNMENT_OPT = @AWK_VAR_ASSIGNMENT_OPT@
 BINARY_OWNER = @BINARY_OWNER@
-BUILD_MAN_PAGES_FALSE = @BUILD_MAN_PAGES_FALSE@
-BUILD_MAN_PAGES_TRUE = @BUILD_MAN_PAGES_TRUE@
 CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
+CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
 CHIO = @CHIO@
 CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
@@ -181,18 +214,40 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
+ENABLE_MANPAGE_BUILD_FALSE = @ENABLE_MANPAGE_BUILD_FALSE@
+ENABLE_MANPAGE_BUILD_TRUE = @ENABLE_MANPAGE_BUILD_TRUE@
+EOVERFLOW = @EOVERFLOW@
+EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@
 EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
+GCC_COMPILER_FALSE = @GCC_COMPILER_FALSE@
+GCC_COMPILER_TRUE = @GCC_COMPILER_TRUE@
 GETCONF = @GETCONF@
+GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@
+GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
 GNUTAR_LISTED_INCREMENTAL_DIRX = @GNUTAR_LISTED_INCREMENTAL_DIRX@
 GREP = @GREP@
 GZIP = @GZIP@
-HAVE_XSLTPROC_FALSE = @HAVE_XSLTPROC_FALSE@
-HAVE_XSLTPROC_TRUE = @HAVE_XSLTPROC_TRUE@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRNDUP = @HAVE_STRNDUP@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE__BOOL = @HAVE__BOOL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -201,22 +256,31 @@ LDFLAGS = @LDFLAGS@
 LEX = @LEX@
 LEXLIB = @LEXLIB@
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
+LIBPTH = @LIBPTH@
+LIBPTH_PREFIX = @LIBPTH_PREFIX@
 LIBS = @LIBS@
+LIBTHREAD = @LIBTHREAD@
 LIBTOOL = @LIBTOOL@
 LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LL_FMT = @LL_FMT@
 LL_RFMT = @LL_RFMT@
 LN_S = @LN_S@
 LTALLOCA = @LTALLOCA@
+LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
 LTLIBOBJS = @LTLIBOBJS@
+LTLIBPTH = @LTLIBPTH@
+LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
 MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@
 MCUTIL = @MCUTIL@
+MKDIR_P = @MKDIR_P@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
+NETINET_IN_H = @NETINET_IN_H@
 OBJEXT = @OBJEXT@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -230,6 +294,9 @@ PERL = @PERL@
 PRINT = @PRINT@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
+REPLACE_STRCASECMP = @REPLACE_STRCASECMP@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRSTR = @REPLACE_STRSTR@
 RESTORE = @RESTORE@
 SAMBA_CLIENT = @SAMBA_CLIENT@
 SERVICE_SUFFIX = @SERVICE_SUFFIX@
@@ -238,7 +305,10 @@ SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 SNAPSHOT_STAMP = @SNAPSHOT_STAMP@
 SORT = @SORT@
+SSH = @SSH@
+STDBOOL_H = @STDBOOL_H@
 STRIP = @STRIP@
+SYS_SOCKET_H = @SYS_SOCKET_H@
 USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@
 VDUMP = @VDUMP@
 VERSION = @VERSION@
@@ -277,6 +347,7 @@ WANT_TAPE_TRUE = @WANT_TAPE_TRUE@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
 XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
 YACC = @YACC@
 ac_c = @ac_c@
 ac_ct_AR = @ac_ct_AR@
@@ -303,6 +374,8 @@ build_os = @build_os@
 build_vendor = @build_vendor@
 datadir = @datadir@
 exec_prefix = @exec_prefix@
+gl_LIBOBJS = @gl_LIBOBJS@
+gl_LTLIBOBJS = @gl_LTLIBOBJS@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -327,10 +400,8 @@ target_alias = @target_alias@
 target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
+INCLUDES = -I$(top_srcdir)/gnulib   
 lib_LTLIBRARIES = libamanda.la
-REGDIR = ../regex-src
-REGsrcdir = $(srcdir)/$(REGDIR)
-INCLUDES = -I$(REGsrcdir)
 LINT = @AMLINT@
 LINTFLAGS = @AMLINTFLAGS@
 libamanda_la_SOURCES = \
@@ -341,6 +412,7 @@ libamanda_la_SOURCES = \
        bsdtcp-security.c       \
        bsdudp-security.c       \
        clock.c                 \
+       conffile.c              \
        debug.c                 \
        dgram.c                 \
        error.c                 \
@@ -353,10 +425,6 @@ libamanda_la_SOURCES = \
        packet.c                \
        pipespawn.c             \
        protocol.c              \
-       regcomp.c               \
-       regerror.c              \
-       regexec.c               \
-       regfree.c               \
        rsh-security.c          \
        security.c              \
        security-util.c         \
@@ -370,14 +438,15 @@ libamanda_la_SOURCES = \
        version.c               \
        versuff.c
 
-libamanda_la_LIBADD = @LTLIBOBJS@ @LTALLOCA@
+
+#libamanda_la_LIBADD = @LTLIBOBJS@
 libamanda_la_LDFLAGS = -release $(VERSION)
 noinst_HEADERS = \
        amanda.h                \
        amfeatures.h            \
-       amregex.h               \
        arglist.h               \
        clock.h                 \
+       conffile.h              \
        dgram.h                 \
        event.h                 \
        fileheader.h            \
@@ -397,18 +466,10 @@ noinst_HEADERS = \
 
 genversion_SOURCES = genversion.c
 genversion_LDADD = $(libamanda_la_LIBADD) versuff.lo
-REGEXCSRC = $(REGsrcdir)/regcomp.c     \
-               $(REGsrcdir)/regexec.c  \
-               $(REGsrcdir)/regerror.c \
-               $(REGsrcdir)/regfree.c
-
-REGEXHSRC = $(REGsrcdir)/regex2.h      \
-               $(REGEXCSRC)
-
 
 # these are used for testing only:
 TEST_PROGS = statfs token file bsdsecurity amfeatures
-CLEANFILES = regex.h regcomp.ih engine.ih regerror.ih *.test.c
+CLEANFILES = *.test.c
 DISTCLEANFILES = version.c genversion.h genversion amanda-int.h
 
 # used for testing only
@@ -418,7 +479,8 @@ STANDARD_COMMON_STUFF_NOT_FILE = \
        debug.$(OBJEXT) \
        error.$(OBJEXT) \
        util.$(OBJEXT) \
-       match.$(OBJEXT)
+       match.$(OBJEXT) \
+       sl.$(OBJEXT)
 
 STANDARD_COMMON_STUFF = \
        $(STANDARD_COMMON_STUFF_NOT_FILE) \
@@ -535,18 +597,6 @@ mostlyclean-compile:
 distclean-compile:
        -rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/alloca.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/getcwd.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/memmove.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/mktime.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/snprintf.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strcasecmp.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strerror.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strftime.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strncasecmp.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/strstr.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/waitpid.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/writev.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alloc.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amfeatures.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amfeatures.test.Po@am__quote@
@@ -556,6 +606,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsdtcp-security.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsdudp-security.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clock.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conffile.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debug.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dgram.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error.Plo@am__quote@
@@ -570,10 +621,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/packet.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipespawn.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocol.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regcomp.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regerror.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regexec.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regfree.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rsh-security.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/security-util.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/security.Plo@am__quote@
@@ -734,7 +781,7 @@ clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
        mostlyclean-am
 
 distclean: distclean-am
-       -rm -rf $(DEPDIR) ./$(DEPDIR)
+       -rm -rf ./$(DEPDIR)
        -rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
        distclean-libtool distclean-tags
@@ -760,7 +807,7 @@ install-man:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
-       -rm -rf $(DEPDIR) ./$(DEPDIR)
+       -rm -rf ./$(DEPDIR)
        -rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
@@ -809,24 +856,6 @@ version.c: genversion$(EXEEXT)
        -rm -f version.c
        ./genversion > version.c
 
-match.@OBJEXT@ match.lo: regex.h
-regcomp.@OBJEXT@ regcomp.lo: regex.h regcomp.ih
-regexec.@OBJEXT@ regexec.lo: regex.h engine.ih
-regerror.@OBJEXT@ regerror.lo: regex.h regerror.ih
-regfree.@OBJEXT@ regfree.lo: regex.h
-
-regex.h: $(REGEXHSRC) $(REGsrcdir)/mkh
-       sh $(REGsrcdir)/mkh -i _REGEX_H_ $(REGEXHSRC) >$@
-
-regcomp.ih: $(REGsrcdir)/regcomp.c $(REGsrcdir)/mkh
-       sh $(REGsrcdir)/mkh -p $(REGsrcdir)/regcomp.c >$@
-
-engine.ih: $(REGsrcdir)/engine.c $(REGsrcdir)/mkh
-       sh $(REGsrcdir)/mkh -p $(REGsrcdir)/engine.c >$@
-
-regerror.ih: $(REGsrcdir)/regerror.c $(REGsrcdir)/mkh
-       sh $(REGsrcdir)/mkh -p $(REGsrcdir)/regerror.c >$@
-
 lint:
        @echo $(LINT) $(libamanda_la_SOURCES)
        @$(LINT) $(LINTFLAGS) $(CPPFLAGS) $(DEFS) -I. -I../config $(INCLUDES) $(libamanda_la_SOURCES)
index 81670ea80bcbab0a131adccc0635db99553c6e71..50cfc084772911587884597618930ffab6302a57 100644 (file)
@@ -34,6 +34,7 @@
 #include "arglist.h"
 #include "queue.h"
 
+#define MIN_ALLOC 64
 static char *internal_vstralloc(const char *, va_list);
 
 /*
@@ -383,6 +384,43 @@ arglist_function1(
 }
 
 
+/*
+ * vstrallocf - copies printf formatted string into newly allocated memory.
+ */
+char *
+debug_vstrallocf(
+    const char *fmt,
+    ...)
+{
+    char *      result;
+    size_t      size;
+    va_list     argp;
+
+    debug_alloc_pop();
+    malloc_enter(debug_caller_loc(saved_file, saved_line));
+
+    result = debug_alloc(saved_file, saved_line, MIN_ALLOC);
+    if (result != NULL) {
+
+       arglist_start(argp, fmt);
+       size = vsnprintf(result, MIN_ALLOC, fmt, argp);
+       arglist_end(argp);
+
+       if (size >= (size_t)MIN_ALLOC) {
+           amfree(result);
+           result = debug_alloc(saved_file, saved_line, size + 1);
+
+           arglist_start(argp, fmt);
+           (void)vsnprintf(result, size + 1, fmt, argp);
+           arglist_end(argp);
+       }
+    }
+
+    malloc_leave(debug_caller_loc(saved_file, saved_line));
+    return result;
+}
+
+extern char **environ;
 /*
  * safe_env - build a "safe" environment list.
  */
@@ -415,6 +453,27 @@ safe_env(void)
     char *s;
     char *v;
     size_t l1, l2;
+    char **env;
+    int    env_cnt;
+
+    if (getuid() == geteuid() && getgid() == getegid()) {
+       env_cnt = 1;
+       for (env = environ; *env != NULL; env++)
+           env_cnt++;
+       if ((q = (char **)malloc(env_cnt*SIZEOF(char *))) != NULL) {
+           envp = q;
+           p = envp;
+           for (env = environ; *env != NULL; env++) {
+               if (strncmp("LANG=", *env, 5) != 0 &&
+                   strncmp("LC_", *env, 3) != 0) {
+                   *p = stralloc(*env);
+                   p++;
+               }
+           }
+           *p = NULL;
+       }
+       return envp;
+    }
 
     if ((q = (char **)malloc(SIZEOF(safe_env_list))) != NULL) {
        envp = q;
diff --git a/common-src/alloca.c b/common-src/alloca.c
deleted file mode 100644 (file)
index c6664b7..0000000
+++ /dev/null
@@ -1,479 +0,0 @@
-/* alloca.c -- allocate automatically reclaimed memory
-   (Mostly) portable public-domain implementation -- D A Gwyn
-
-   This implementation of the PWB library alloca function,
-   which is used to allocate space off the run-time stack so
-   that it is automatically reclaimed upon procedure exit,
-   was inspired by discussions with J. Q. Johnson of Cornell.
-   J.Otto Tennant <jot@cray.com> contributed the Cray support.
-
-   There are some preprocessor constants that can
-   be defined when compiling for your specific system, for
-   improved efficiency; however, the defaults should be okay.
-
-   The general concept of this implementation is to keep
-   track of all alloca-allocated blocks, and reclaim any
-   that are found to be deeper in the stack than the current
-   invocation.  This heuristic does not reclaim storage as
-   soon as it becomes invalid, but it will do so eventually.
-
-   As a special case, alloca(0) reclaims storage without
-   allocating any.  It is a good idea to use alloca(0) in
-   your main control loop, etc. to force garbage collection.  */
-
-#include "amanda.h"
-
-#ifndef HAVE_ALLOCA
-
-/* If compiling with GCC 2, this file's not needed.  */
-#if !defined (__GNUC__) || __GNUC__ < 2
-
-/* If someone has defined alloca as a macro,
-   there must be some other way alloca is supposed to work.  */
-#ifndef alloca
-
-#ifdef emacs
-#ifdef static
-/* actually, only want this if static is defined as ""
-   -- this is for usg, in which emacs must undefine static
-   in order to make unexec workable
-   */
-#ifndef STACK_DIRECTION
-you
-lose
--- must know STACK_DIRECTION at compile-time
-#endif /* STACK_DIRECTION undefined */
-#endif /* static */
-#endif /* emacs */
-
-/* If your stack is a linked list of frames, you have to
-   provide an "address metric" ADDRESS_FUNCTION macro.  */
-
-#if defined (CRAY) && defined (CRAY_STACKSEG_END)
-long i00afunc ();
-#define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg))
-#else
-#define ADDRESS_FUNCTION(arg) &(arg)
-#endif
-
-#if __STDC__
-typedef void *pointer;
-#else
-typedef char *pointer;
-#endif
-
-#define        NULL    0
-
-/* Different portions of Emacs need to call different versions of
-   malloc.  The Emacs executable needs alloca to call xmalloc, because
-   ordinary malloc isn't protected from input signals.  On the other
-   hand, the utilities in lib-src need alloca to call malloc; some of
-   them are very simple, and don't have an xmalloc routine.
-
-   Non-Emacs programs expect this to call use xmalloc.
-
-   Callers below should use malloc.  */
-
-extern pointer malloc ();
-
-/* Define STACK_DIRECTION if you know the direction of stack
-   growth for your system; otherwise it will be automatically
-   deduced at run-time.
-
-   STACK_DIRECTION > 0 => grows toward higher addresses
-   STACK_DIRECTION < 0 => grows toward lower addresses
-   STACK_DIRECTION = 0 => direction of growth unknown  */
-
-#ifndef STACK_DIRECTION
-#define        STACK_DIRECTION 0       /* Direction unknown.  */
-#endif
-
-#if STACK_DIRECTION != 0
-
-#define        STACK_DIR       STACK_DIRECTION /* Known at compile-time.  */
-
-#else /* STACK_DIRECTION == 0; need run-time code.  */
-
-static int stack_dir;          /* 1 or -1 once known.  */
-#define        STACK_DIR       stack_dir
-
-static void
-find_stack_direction ()
-{
-  static char *addr = NULL;    /* Address of first `dummy', once known.  */
-  auto char dummy;             /* To get stack address.  */
-
-  if (addr == NULL)
-    {                          /* Initial entry.  */
-      addr = ADDRESS_FUNCTION (dummy);
-
-      find_stack_direction (); /* Recurse once.  */
-    }
-  else
-    {
-      /* Second entry.  */
-      if (ADDRESS_FUNCTION (dummy) > addr)
-       stack_dir = 1;          /* Stack grew upward.  */
-      else
-       stack_dir = -1;         /* Stack grew downward.  */
-    }
-}
-
-#endif /* STACK_DIRECTION == 0 */
-
-/* An "alloca header" is used to:
-   (a) chain together all alloca'ed blocks;
-   (b) keep track of stack depth.
-
-   It is very important that sizeof(header) agree with malloc
-   alignment chunk size.  The following default should work okay.  */
-
-#ifndef        ALIGN_SIZE
-#define        ALIGN_SIZE      SIZEOF(double)
-#endif
-
-typedef union hdr
-{
-  char align[ALIGN_SIZE];      /* To force sizeof(header).  */
-  struct
-    {
-      union hdr *next;         /* For chaining headers.  */
-      char *deep;              /* For stack depth measure.  */
-    } h;
-} header;
-
-static header *last_alloca_header = NULL;      /* -> last alloca header.  */
-
-/* Return a pointer to at least SIZE bytes of storage,
-   which will be automatically reclaimed upon exit from
-   the procedure that called alloca.  Originally, this space
-   was supposed to be taken from the current stack frame of the
-   caller, but that method cannot be made to work for some
-   implementations of C, for example under Gould's UTX/32.  */
-
-pointer
-alloca (size)
-     unsigned size;
-{
-  auto char probe;             /* Probes stack depth: */
-  register char *depth = ADDRESS_FUNCTION (probe);
-
-#if STACK_DIRECTION == 0
-  if (STACK_DIR == 0)          /* Unknown growth direction.  */
-    find_stack_direction ();
-#endif
-
-  /* Reclaim garbage, defined as all alloca'd storage that
-     was allocated from deeper in the stack than currently. */
-
-  {
-    register header *hp;       /* Traverses linked list.  */
-
-    for (hp = last_alloca_header; hp != NULL;)
-      if ((STACK_DIR > 0 && hp->h.deep > depth)
-         || (STACK_DIR < 0 && hp->h.deep < depth))
-       {
-         register header *np = hp->h.next;
-
-         free ((pointer) hp);  /* Collect garbage.  */
-
-         hp = np;              /* -> next header.  */
-       }
-      else
-       break;                  /* Rest are not deeper.  */
-
-    last_alloca_header = hp;   /* -> last valid storage.  */
-  }
-
-  if (size == 0)
-    return NULL;               /* No allocation required.  */
-
-  /* Allocate combined header + user data storage.  */
-
-  {
-    register pointer new = malloc (SIZEOF (header) + size);
-    /* Address of header.  */
-
-    ((header *) new)->h.next = last_alloca_header;
-    ((header *) new)->h.deep = depth;
-
-    last_alloca_header = (header *) new;
-
-    /* User storage begins just after header.  */
-
-    return (pointer) ((char *) new + SIZEOF (header));
-  }
-}
-
-#if defined (CRAY) && defined (CRAY_STACKSEG_END)
-
-#ifdef DEBUG_I00AFUNC
-#include <stdio.h>
-#endif
-
-#ifndef CRAY_STACK
-#define CRAY_STACK
-#ifndef CRAY2
-/* Stack structures for CRAY-1, CRAY X-MP, and CRAY Y-MP */
-struct stack_control_header
-  {
-    long shgrow:32;            /* Number of times stack has grown.  */
-    long shaseg:32;            /* Size of increments to stack.  */
-    long shhwm:32;             /* High water mark of stack.  */
-    long shsize:32;            /* Current size of stack (all segments).  */
-  };
-
-/* The stack segment linkage control information occurs at
-   the high-address end of a stack segment.  (The stack
-   grows from low addresses to high addresses.)  The initial
-   part of the stack segment linkage control information is
-   0200 (octal) words.  This provides for register storage
-   for the routine which overflows the stack.  */
-
-struct stack_segment_linkage
-  {
-    long ss[0200];             /* 0200 overflow words.  */
-    long sssize:32;            /* Number of words in this segment.  */
-    long ssbase:32;            /* Offset to stack base.  */
-    long:32;
-    long sspseg:32;            /* Offset to linkage control of previous
-                                  segment of stack.  */
-    long:32;
-    long sstcpt:32;            /* Pointer to task common address block.  */
-    long sscsnm;               /* Private control structure number for
-                                  microtasking.  */
-    long ssusr1;               /* Reserved for user.  */
-    long ssusr2;               /* Reserved for user.  */
-    long sstpid;               /* Process ID for pid based multi-tasking.  */
-    long ssgvup;               /* Pointer to multitasking thread giveup.  */
-    long sscray[7];            /* Reserved for Cray Research.  */
-    long ssa0;
-    long ssa1;
-    long ssa2;
-    long ssa3;
-    long ssa4;
-    long ssa5;
-    long ssa6;
-    long ssa7;
-    long sss0;
-    long sss1;
-    long sss2;
-    long sss3;
-    long sss4;
-    long sss5;
-    long sss6;
-    long sss7;
-  };
-
-#else /* CRAY2 */
-/* The following structure defines the vector of words
-   returned by the STKSTAT library routine.  */
-struct stk_stat
-  {
-    long now;                  /* Current total stack size.  */
-    long maxc;                 /* Amount of contiguous space which would
-                                  be required to satisfy the maximum
-                                  stack demand to date.  */
-    long high_water;           /* Stack high-water mark.  */
-    long overflows;            /* Number of stack overflow ($STKOFEN) calls.  */
-    long hits;                 /* Number of internal buffer hits.  */
-    long extends;              /* Number of block extensions.  */
-    long stko_mallocs;         /* Block allocations by $STKOFEN.  */
-    long underflows;           /* Number of stack underflow calls ($STKRETN).  */
-    long stko_free;            /* Number of deallocations by $STKRETN.  */
-    long stkm_free;            /* Number of deallocations by $STKMRET.  */
-    long segments;             /* Current number of stack segments.  */
-    long maxs;                 /* Maximum number of stack segments so far.  */
-    long pad_size;             /* Stack pad size.  */
-    long current_address;      /* Current stack segment address.  */
-    long current_size;         /* Current stack segment size.  This
-                                  number is actually corrupted by STKSTAT to
-                                  include the fifteen word trailer area.  */
-    long initial_address;      /* Address of initial segment.  */
-    long initial_size;         /* Size of initial segment.  */
-  };
-
-/* The following structure describes the data structure which trails
-   any stack segment.  I think that the description in 'asdef' is
-   out of date.  I only describe the parts that I am sure about.  */
-
-struct stk_trailer
-  {
-    long this_address;         /* Address of this block.  */
-    long this_size;            /* Size of this block (does not include
-                                  this trailer).  */
-    long unknown2;
-    long unknown3;
-    long link;                 /* Address of trailer block of previous
-                                  segment.  */
-    long unknown5;
-    long unknown6;
-    long unknown7;
-    long unknown8;
-    long unknown9;
-    long unknown10;
-    long unknown11;
-    long unknown12;
-    long unknown13;
-    long unknown14;
-  };
-
-#endif /* CRAY2 */
-#endif /* not CRAY_STACK */
-
-#ifdef CRAY2
-/* Determine a "stack measure" for an arbitrary ADDRESS.
-   I doubt that "lint" will like this much. */
-
-static long
-i00afunc (long *address)
-{
-  struct stk_stat status;
-  struct stk_trailer *trailer;
-  long *block, size;
-  long result = 0;
-
-  /* We want to iterate through all of the segments.  The first
-     step is to get the stack status structure.  We could do this
-     more quickly and more directly, perhaps, by referencing the
-     $LM00 common block, but I know that this works.  */
-
-  STKSTAT (&status);
-
-  /* Set up the iteration.  */
-
-  trailer = (struct stk_trailer *) (status.current_address
-                                   + status.current_size
-                                   - 15);
-
-  /* There must be at least one stack segment.  Therefore it is
-     a fatal error if "trailer" is null.  */
-
-  if (trailer == 0)
-    abort ();
-
-  /* Discard segments that do not contain our argument address.  */
-
-  while (trailer != 0)
-    {
-      block = (long *) trailer->this_address;
-      size = trailer->this_size;
-      if (block == 0 || size == 0)
-       abort ();
-      trailer = (struct stk_trailer *) trailer->link;
-      if ((block <= address) && (address < (block + size)))
-       break;
-    }
-
-  /* Set the result to the offset in this segment and add the sizes
-     of all predecessor segments.  */
-
-  result = address - block;
-
-  if (trailer == 0)
-    {
-      return result;
-    }
-
-  do
-    {
-      if (trailer->this_size <= 0)
-       abort ();
-      result += trailer->this_size;
-      trailer = (struct stk_trailer *) trailer->link;
-    }
-  while (trailer != 0);
-
-  /* We are done.  Note that if you present a bogus address (one
-     not in any segment), you will get a different number back, formed
-     from subtracting the address of the first block.  This is probably
-     not what you want.  */
-
-  return result;
-}
-
-#else /* not CRAY2 */
-/* Stack address function for a CRAY-1, CRAY X-MP, or CRAY Y-MP.
-   Determine the number of the cell within the stack,
-   given the address of the cell.  The purpose of this
-   routine is to linearize, in some sense, stack addresses
-   for alloca.  */
-
-static long
-i00afunc (long address)
-{
-  long stkl = 0;
-
-  long size, pseg, this_segment, stack;
-  long result = 0;
-
-  struct stack_segment_linkage *ssptr;
-
-  /* Register B67 contains the address of the end of the
-     current stack segment.  If you (as a subprogram) store
-     your registers on the stack and find that you are past
-     the contents of B67, you have overflowed the segment.
-
-     B67 also points to the stack segment linkage control
-     area, which is what we are really interested in.  */
-
-  stkl = CRAY_STACKSEG_END ();
-  ssptr = (struct stack_segment_linkage *) stkl;
-
-  /* If one subtracts 'size' from the end of the segment,
-     one has the address of the first word of the segment.
-
-     If this is not the first segment, 'pseg' will be
-     nonzero.  */
-
-  pseg = ssptr->sspseg;
-  size = ssptr->sssize;
-
-  this_segment = stkl - size;
-
-  /* It is possible that calling this routine itself caused
-     a stack overflow.  Discard stack segments which do not
-     contain the target address.  */
-
-  while (!(this_segment <= address && address <= stkl))
-    {
-#ifdef DEBUG_I00AFUNC
-      fprintf (stderr, "%011o %011o %011o\n", this_segment, address, stkl);
-#endif
-      if (pseg == 0)
-       break;
-      stkl = stkl - pseg;
-      ssptr = (struct stack_segment_linkage *) stkl;
-      size = ssptr->sssize;
-      pseg = ssptr->sspseg;
-      this_segment = stkl - size;
-    }
-
-  result = address - this_segment;
-
-  /* If you subtract pseg from the current end of the stack,
-     you get the address of the previous stack segment's end.
-     This seems a little convoluted to me, but I'll bet you save
-     a cycle somewhere.  */
-
-  while (pseg != 0)
-    {
-#ifdef DEBUG_I00AFUNC
-      fprintf (stderr, "%011o %011o\n", pseg, size);
-#endif
-      stkl = stkl - pseg;
-      ssptr = (struct stack_segment_linkage *) stkl;
-      size = ssptr->sssize;
-      pseg = ssptr->sspseg;
-      result += size;
-    }
-  return result;
-}
-
-#endif /* not CRAY2 */
-#endif /* CRAY */
-
-#endif /* no alloca */
-#endif /* not GCC version 2 */
-
-#endif /* ifndef HAVE_ALLOCA */
index 62971d5b844d7c6d183f71942d98d83f8a6f2147..2858516b7e7df17c1619b07bad7b2d1337139c3b 100644 (file)
@@ -24,7 +24,7 @@
  * file named AUTHORS, in the root directory of this distribution.
  */
 /*
- * $Id: amanda.h,v 1.131.2.5 2006/12/12 14:56:38 martinea Exp $
+ * $Id: amanda.h,v 1.131 2006/07/25 18:27:56 martinea Exp $
  *
  * the central header file included by all amanda sources
  */
@@ -268,6 +268,94 @@ struct iovec {
 #include <arpa/inet.h>
 #endif
 
+#ifndef HAVE_SOCKADDR_STORAGE
+#  define sockaddr_storage sockaddr_in
+#  define ss_family sin_family
+#endif
+
+#ifndef INET_ADDRSTRLEN
+#define INET_ADDRSTRLEN 16
+#endif
+
+/* Calculate the length of the data in a struct sockaddr_storage.
+ * THIS IS A HACK.
+ *
+ * To be truly portable, the length of an address should be passed
+ * in a companion variable.  When such lengths are available
+ * everywhere they are needed, this macro should be removed.
+ */
+#ifdef WORKING_IPV6
+# define SS_LEN(ss) (((struct sockaddr *)(ss))->sa_family==AF_INET6?sizeof(struct sockaddr_in6):sizeof(struct sockaddr_in))
+#else
+# define SS_LEN(ss) (sizeof(struct sockaddr_in))
+#endif
+
+
+/* AF_NATIVE is the "best" address family we support, backward compatible
+ * through to AF_INET.
+ */
+#ifdef WORKING_IPV6
+#define AF_NATIVE AF_INET6
+#else
+#define AF_NATIVE AF_INET
+#endif
+
+/* SS_INIT(ss, family) initializes ss to all zeroes (as directed by RFC),
+ * and sets its ss_family as specified
+ */
+#define SS_INIT(ss, family) do { \
+    memset((ss), 0, sizeof(*(ss))); \
+    (ss)->ss_family = (family); \
+} while (0);
+
+/* SS_SET_INADDR_ANY(ss) sets ss to the family-appropriate equivalent of
+ * INADDR_ANY, a wildcard address and port.
+ */
+#ifdef WORKING_IPV6
+#define SS_SET_INADDR_ANY(ss) do { \
+    switch ((ss)->ss_family) { \
+        case AF_INET6: \
+            ((struct sockaddr_in6 *)(ss))->sin6_flowinfo = 0; \
+            ((struct sockaddr_in6 *)(ss))->sin6_addr = in6addr_any; \
+            break; \
+        case AF_INET: \
+            ((struct sockaddr_in *)(ss))->sin_addr.s_addr = INADDR_ANY; \
+            break; \
+    } \
+} while (0);
+#else
+#define SS_SET_INADDR_ANY(ss) do { \
+    ((struct sockaddr_in *)(ss))->sin_addr.s_addr = INADDR_ANY; \
+} while (0);
+#endif
+
+/* Set/get the port in a sockaddr_storage that already has an family */
+#ifdef WORKING_IPV6
+#define SS_SET_PORT(ss, port) \
+switch ((ss)->ss_family) { \
+    case AF_INET: \
+        ((struct sockaddr_in *)(ss))->sin_port = (in_port_t)htons((port)); \
+        break; \
+    case AF_INET6: \
+        ((struct sockaddr_in6 *)(ss))->sin6_port = (in_port_t)htons((port)); \
+        break; \
+    default: assert(0); \
+}
+#else
+#define SS_SET_PORT(ss, port) \
+        ((struct sockaddr_in *)(ss))->sin_port = (in_port_t)htons((port));
+#endif
+
+#ifdef WORKING_IPV6
+#define SS_GET_PORT(ss) (ntohs( \
+       (ss)->ss_family == AF_INET6? \
+        ((struct sockaddr_in6 *)(ss))->sin6_port \
+       :((struct sockaddr_in *)(ss))->sin_port))
+#else
+#define SS_GET_PORT(ss) (ntohs( \
+        ((struct sockaddr_in *)(ss))->sin_port))
+#endif
+
 /*
  * The dbmalloc package comes from:
  *
@@ -539,9 +627,12 @@ extern void debug_alloc_pop (void);
 
 #define vstralloc debug_alloc_push(__FILE__,__LINE__)?0:debug_vstralloc
 #define newvstralloc debug_alloc_push(__FILE__,__LINE__)?0:debug_newvstralloc
+#define vstrallocf debug_alloc_push(__FILE__,__LINE__)?0:debug_vstrallocf
 
 extern char  *debug_vstralloc(const char *str, ...);
 extern char  *debug_newvstralloc(char *oldstr, const char *newstr, ...);
+extern char  *debug_vstrallocf(const char *fmt, ...)
+                              __attribute__ ((format (printf, 1, 2)));
 
 #define        stralloc2(s1,s2)      vstralloc((s1),(s2),NULL)
 #define        newstralloc2(p,s1,s2) newvstralloc((p),(s1),(s2),NULL)
@@ -730,6 +821,12 @@ void       areads_relbuf(int fd);
  *    -- skip an integer field
  *  skip_line (ptr, var)
  *    -- skip just past the next newline
+ *  strncmp_const (str, const_str)
+ *    -- compare str to const_str, a string constant
+ *  strncmp_const_skip (str, const_var, ptr, var)
+ *    -- like strncmp_const, but skip the string if a match is
+ *       found; this macro only tests for equality, discarding
+ *       ordering information.
  *
  * where:
  *
@@ -844,6 +941,15 @@ void       areads_relbuf(int fd);
      && ((s)[1] == '\0'                                                        \
         || ((s)[1] == '.' && (s)[2] == '\0')))
 
+#define strncmp_const(str, cnst)                                       \
+       strncmp((str), (cnst), sizeof((cnst))-1)
+
+/* (have to roll this up in an expression, so it can be used in if()) */
+#define strncmp_const_skip(str, cnst, ptr, var)                                \
+       ((strncmp((str), (cnst), sizeof((cnst))-1) == 0)?               \
+                ((ptr)+=sizeof((cnst))-1, (var)=(ptr)[-1], 0)          \
+               :1)
+
 /* from amflock.c */
 extern int    amflock(int fd, char *resource);
 extern int    amroflock(int fd, char *resource);
@@ -857,7 +963,7 @@ extern char  *old_sanitise_filename(char *inp);
 
 /* from old bsd-security.c */
 extern int debug;
-extern int check_security(struct sockaddr_in *, char *, unsigned long, char **);
+extern int check_security(struct sockaddr_storage *, char *, unsigned long, char **);
 
 /*
  * Handle functions which are not always declared on all systems.  This
@@ -1244,6 +1350,12 @@ extern int vfprintf(FILE *stream, const char *format, va_list ap);
 extern int vprintf(const char *format, va_list ap);
 #endif
 
+/* GNULIB include */
+#ifndef CONFIGURE_TEST
+#include "getaddrinfo.h"
+#include "inet_ntop.h"
+#endif
+
 #if !defined(S_ISCHR) && defined(_S_IFCHR) && defined(_S_IFMT)
 #define S_ISCHR(mode) (((mode) & _S_IFMT) == _S_IFCHR)
 #endif
@@ -1466,4 +1578,20 @@ void     add_history(const char *line);
 #define DBG_SUBDIR_CLIENT  "client"
 #define DBG_SUBDIR_AMANDAD "amandad"
 
+#define MAX_DUMPERS 63
+
+#ifndef NI_MAXHOST
+#define NI_MAXHOST 1025
+#endif
+
+#define _(x) x
+
+#ifndef AI_V4MAPPED
+#define AI_V4MAPPED 0
+#endif
+
+#ifndef AI_ALL
+#define AI_ALL 0
+#endif
+
 #endif /* !AMANDA_H */
index 89a1c3829dbc542acb02404295665584dc93f554..8775912237e27b584b53bd70e1a4e23e7a729acc 100644 (file)
@@ -72,6 +72,7 @@ am_init_feature_set(void)
 
        am_add_feature(f, fe_program_dump);
        am_add_feature(f, fe_program_gnutar);
+       am_add_feature(f, fe_program_backup_api);
 
        am_add_feature(f, fe_options_compress_fast);
        am_add_feature(f, fe_options_compress_best);
@@ -145,6 +146,7 @@ am_init_feature_set(void)
 
        am_add_feature(f, fe_req_options_config);
 
+       am_add_feature(f, fe_rep_sendsize_quoted_error);
     }
     return f;
 }
index 562ca2193d99b5fe687b0b96b3bed429b386dc9e..1398c646382c08f06e9a58b01dd43982ee5902a2 100644 (file)
@@ -93,7 +93,7 @@ typedef enum {
 
     fe_program_dump,
     fe_program_gnutar,
-    fe_program_dumper_api,             /* require fe_sendsize_req_options */
+    fe_program_backup_api,             /* require fe_sendsize_req_options */
 
     fe_options_compress_fast,
     fe_options_compress_best,
@@ -171,6 +171,8 @@ typedef enum {
 
     fe_req_options_config,
 
+    fe_rep_sendsize_quoted_error,
+
     /*
      * All new features must be inserted immediately *before* this entry.
      */
index 2a00b38835e33cf4ec3b819b62d41fed8725caf0..cc1cd4e46550ed2e32077a04975f45edf49ff42b 100644 (file)
@@ -440,7 +440,6 @@ main(
     int lockfd;
     char *filen = "/tmp/conftest.lock";
     char *resn = "test";
-    int fd;
 
     (void)argc;                /* Quiet compiler warning */
     (void)argv;                /* Quiet compiler warning */
diff --git a/common-src/amregex.h b/common-src/amregex.h
deleted file mode 100644 (file)
index dfbc3b4..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Amanda, The Advanced Maryland Automatic Network Disk Archiver
- * Copyright (c) 1991-1998 University of Maryland at College Park
- * All Rights Reserved.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of U.M. not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission.  U.M. makes no representations about the
- * suitability of this software for any purpose.  It is provided "as is"
- * without express or implied warranty.
- *
- * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Authors: the Amanda Development Team.  Its members are listed in a
- * file named AUTHORS, in the root directory of this distribution.
- */
-/*
- * $Id: amregex.h,v 1.11 2006/05/25 01:47:11 johnfranks Exp $
- *
- * compatibility header file for Henry Spencer's regex library.
- */
-#ifndef AMREGEX_H
-#define AMREGEX_H
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-
-#include <limits.h>
-
-#ifndef HAVE__POSIX2_RE_DUP_MAX
-#define _POSIX2_RE_DUP_MAX 255
-#endif
-
-#ifndef HAVE_CHAR_MIN
-#define CHAR_MIN (-128)
-#endif
-
-#ifndef HAVE_CHAR_MAX
-#define CHAR_MAX 127
-#endif
-
-#ifndef HAVE_CHAR_BIT
-#define CHAR_BIT 8
-#endif
-
-/*
- * So that we can use GNUC attributes (such as to get -Wall warnings
- * for printf-like functions).  Only do this in gcc 2.7 or later ...
- * it may work on earlier stuff, but why chance it.
- */
-#if !defined(__GNUC__) || __GNUC__ < 2 || __GNUC_MINOR__ < 7
-#define __attribute__(__x)
-#endif
-
-#ifndef HAVE_BCOPY_DECL
-extern void bcopy(const void *from, void *to, size_t n);
-#endif
-
-#ifndef HAVE_MEMMOVE_DECL
-extern char *memmove(char *to, char *from, size_t n);
-#endif
-
-#ifndef HAVE_MEMSET_DECL
-extern void *memset(void *s, int c, size_t n);
-#endif
-
-#if !defined(HAVE_MEMMOVE) && defined(HAVE_BCOPY)
-#define USEBCOPY
-#endif
-
-#ifndef HAVE_SNPRINTF_DECL
-#include "arglist.h"
-int snprintf (char *buf, size_t len, const char *format,...)
-                   __attribute__((format(printf,3,4)));
-#endif
-#ifndef HAVE_VSNPRINTF_DECL
-#include "arglist.h"
-int vsnprintf(char *buf, size_t len, const char *format, va_list ap);
-#endif
-
-#define POSIX_MISTAKE
-
-#ifdef HAVE_UNSIGNED_LONG_CONSTANTS
-#undef NO_UL_CNSTS
-#else
-#define NO_UL_CNSTS
-#endif
-
-#endif /* AMREGEX_H */
index 303c4d040f598b922a73baad0391f8348faa1931..18102ba63b47d3dc163d966595a28f95e1205440 100644 (file)
@@ -24,7 +24,7 @@
  * file named AUTHORS, in the root directory of this distribution.
  */
 /*
- * $Id: bsd-security.c,v 1.75.2.1 2006/09/28 18:46:08 martinea Exp $
+ * $Id: bsd-security.c,v 1.75 2006/07/19 17:41:14 martinea Exp $
  *
  * "BSD" security module
  */
 #include "stream.h"
 #include "version.h"
 
-/*#define       BSD_DEBUG*/
-
-#ifdef BSD_DEBUG
-#define bsdprintf(x)    dbprintf(x)
-#else
-#define bsdprintf(x)
-#endif
-
 #ifndef SO_RCVBUF
 #undef DUMPER_SOCKET_BUFFERING
 #endif
  */
 #undef SHOW_SECURITY_DETAIL
 
-#if defined(TEST)                                              /* { */
-#define SHOW_SECURITY_DETAIL
-#undef bsdprintf
-#define bsdprintf(p)   printf p
-#endif                                                         /* } */
-
 /*
  * Interface functions
  */
@@ -107,14 +93,18 @@ const security_driver_t bsd_security_driver = {
     bsd_stream_read_sync,
     bsd_stream_read_cancel,
     sec_close_connection_none,
+    NULL,
+    NULL
 };
 
 /*
  * This is data local to the datagram socket.  We have one datagram
  * per process, so it is global.
  */
-static udp_handle_t netfd;
-static int not_init = 1;
+static udp_handle_t netfd4;
+static udp_handle_t netfd6;
+static int not_init4 = 1;
+static int not_init6 = 1;
 
 /* generate new handles from here */
 static int newhandle = 0;
@@ -139,12 +129,14 @@ bsd_connect(
 {
     struct sec_handle *bh;
     struct servent *se;
-    struct hostent *he;
     in_port_t port = 0;
     struct timeval sequence_time;
     amanda_timezone dontcare;
     int sequence;
     char *handle;
+    int result;
+    struct addrinfo hints;
+    struct addrinfo *res = NULL;
 
     assert(hostname != NULL);
 
@@ -153,24 +145,60 @@ bsd_connect(
 
     bh = alloc(SIZEOF(*bh));
     bh->proto_handle=NULL;
-    bh->udp = &netfd;
     security_handleinit(&bh->sech, &bsd_security_driver);
 
     /*
      * Only init the socket once
      */
-    if (not_init == 1) {
+#ifdef WORKING_IPV6
+    hints.ai_flags = AI_CANONNAME | AI_V4MAPPED | AI_ALL;
+    hints.ai_family = AF_INET6;
+#else
+    hints.ai_flags = AI_CANONNAME;
+    hints.ai_family = AF_INET;
+#endif
+    hints.ai_socktype = SOCK_DGRAM;
+    hints.ai_protocol = IPPROTO_UDP;
+    hints.ai_addrlen = 0;
+    hints.ai_addr = NULL;
+    hints.ai_canonname = NULL;
+    hints.ai_next = NULL;
+    result = getaddrinfo(hostname, NULL, &hints, &res);
+#ifdef WORKING_IPV6
+    if (result != 0) {
+       hints.ai_flags = AI_CANONNAME;
+       hints.ai_family = AF_UNSPEC;
+       result = getaddrinfo(hostname, NULL, &hints, &res);
+    }
+#endif
+    if(result != 0) {
+       dbprintf(("getaddrinfo(%s): %s\n", hostname, gai_strerror(result)));
+       security_seterror(&bh->sech, "getaddrinfo(%s): %s\n", hostname,
+                         gai_strerror(result));
+       (*fn)(arg, &bh->sech, S_ERROR);
+       return;
+    }
+    if (res->ai_canonname == NULL) {
+       dbprintf(("getaddrinfo(%s) did not return a canonical name\n", hostname));
+       security_seterror(&bh->sech,
+               _("getaddrinfo(%s) did not return a canonical name\n"), hostname);
+       (*fn)(arg, &bh->sech, S_ERROR);
+       return;
+    }
+
+#ifdef WORKING_IPV6
+    if (res->ai_addr->sa_family == AF_INET6 && not_init6 == 1) {
        uid_t euid;
-       dgram_zero(&netfd.dgram);
+       dgram_zero(&netfd6.dgram);
 
        euid = geteuid();
        seteuid((uid_t)0);
-       dgram_bind(&netfd.dgram, &port);
+       dgram_bind(&netfd6.dgram, res->ai_addr->sa_family, &port);
        seteuid(euid);
-       netfd.handle = NULL;
-       netfd.pkt.body = NULL;
-       netfd.recv_security_ok = &bsd_recv_security_ok;
-       netfd.prefix_packet = &bsd_prefix_packet;
+       netfd6.handle = NULL;
+       netfd6.pkt.body = NULL;
+       netfd6.recv_security_ok = &bsd_recv_security_ok;
+       netfd6.prefix_packet = &bsd_prefix_packet;
        /*
         * We must have a reserved port.  Bomb if we didn't get one.
         */
@@ -181,32 +209,65 @@ bsd_connect(
            (*fn)(arg, &bh->sech, S_ERROR);
            return;
        }
-       not_init = 0;
+       not_init6 = 0;
+       bh->udp = &netfd6;
     }
+#endif
 
-    if ((he = gethostbyname(hostname)) == NULL) {
-       security_seterror(&bh->sech,
-           "%s: could not resolve hostname", hostname);
-       (*fn)(arg, &bh->sech, S_ERROR);
-       return;
+    if (res->ai_addr->sa_family == AF_INET && not_init4 == 1) {
+       uid_t euid;
+       dgram_zero(&netfd4.dgram);
+
+       euid = geteuid();
+       seteuid((uid_t)0);
+       dgram_bind(&netfd4.dgram, res->ai_addr->sa_family, &port);
+       seteuid(euid);
+       netfd4.handle = NULL;
+       netfd4.pkt.body = NULL;
+       netfd4.recv_security_ok = &bsd_recv_security_ok;
+       netfd4.prefix_packet = &bsd_prefix_packet;
+       /*
+        * We must have a reserved port.  Bomb if we didn't get one.
+        */
+       if (port >= IPPORT_RESERVED) {
+           security_seterror(&bh->sech,
+               "unable to bind to a reserved port (got port %u)",
+               (unsigned int)port);
+           (*fn)(arg, &bh->sech, S_ERROR);
+           return;
+       }
+       not_init4 = 0;
+       bh->udp = &netfd4;
     }
-    bsdprintf(("Resolved hostname=%s\n", hostname));
+
+#ifdef WORKING_IPV6
+    if (res->ai_addr->sa_family == AF_INET6)
+       bh->udp = &netfd6;
+    else
+#endif
+       bh->udp = &netfd4;
+
+    auth_debug(1, ("Resolved hostname=%s\n", res->ai_canonname));
     if ((se = getservbyname(AMANDA_SERVICE_NAME, "udp")) == NULL)
-       port = (in_port_t)htons(AMANDA_SERVICE_DEFAULT);
+       port = AMANDA_SERVICE_DEFAULT;
     else
-       port = (in_port_t)se->s_port;
+       port = (in_port_t)ntohs(se->s_port);
     amanda_gettimeofday(&sequence_time, &dontcare);
     sequence = (int)sequence_time.tv_sec ^ (int)sequence_time.tv_usec;
     handle=alloc(15);
     snprintf(handle, 14, "000-%08x",  (unsigned)newhandle++);
-    if (udp_inithandle(&netfd, bh, he, port, handle, sequence) < 0) {
+    if (udp_inithandle(bh->udp, bh, res->ai_canonname,
+       (struct sockaddr_storage *)res->ai_addr, port, handle, sequence) < 0) {
        (*fn)(arg, &bh->sech, S_ERROR);
        amfree(bh->hostname);
        amfree(bh);
     }
-    else
+    else {
        (*fn)(arg, &bh->sech, S_OK);
+    }
     amfree(handle);
+
+    freeaddrinfo(res);
 }
 
 /*
@@ -230,19 +291,20 @@ bsd_accept(
      * We assume in and out point to the same socket, and just use
      * in.
      */
-    dgram_socket(&netfd.dgram, in);
+    dgram_socket(&netfd4.dgram, in);
+    dgram_socket(&netfd6.dgram, in);
 
     /*
      * Assign the function and return.  When they call recvpkt later,
      * the recvpkt callback will call this function when it discovers
      * new incoming connections
      */
-    netfd.accept_fn = fn;
-    netfd.recv_security_ok = &bsd_recv_security_ok;
-    netfd.prefix_packet = &bsd_prefix_packet;
-    netfd.driver = &bsd_security_driver;
+    netfd4.accept_fn = fn;
+    netfd4.recv_security_ok = &bsd_recv_security_ok;
+    netfd4.prefix_packet = &bsd_prefix_packet;
+    netfd4.driver = &bsd_security_driver;
 
-    udp_addref(&netfd, &udp_netfd_read_callback);
+    udp_addref(&netfd4, &udp_netfd_read_callback);
 }
 
 /*
@@ -258,21 +320,27 @@ bsd_close(
        return;
     }
 
-    bsdprintf(("%s: bsd: close handle '%s'\n",
-              debug_prefix_time(NULL), bh->proto_handle));
+    auth_debug(1, ("%s: bsd: close handle '%s'\n",
+                  debug_prefix_time(NULL), bh->proto_handle));
 
     udp_recvpkt_cancel(bh);
     if(bh->next) {
        bh->next->prev = bh->prev;
     }
     else {
-       netfd.bh_last = bh->prev;
+       if (!not_init6 && netfd6.bh_last == bh)
+           netfd6.bh_last = bh->prev;
+       else
+           netfd4.bh_last = bh->prev;
     }
     if(bh->prev) {
        bh->prev->next = bh->next;
     }
     else {
-       netfd.bh_first = bh->next;
+       if (!not_init6 && netfd6.bh_first == bh)
+           netfd6.bh_first = bh->next;
+       else
+           netfd4.bh_first = bh->next;
     }
 
     amfree(bh->proto_handle);
@@ -288,7 +356,6 @@ static void *
 bsd_stream_server(
     void *     h)
 {
-#ifndef TEST                                                   /* { */
     struct sec_stream *bs = NULL;
     struct sec_handle *bh = h;
 
@@ -307,9 +374,6 @@ bsd_stream_server(
     bs->fd = -1;
     bs->ev_read = NULL;
     return (bs);
-#else
-    return (NULL);
-#endif /* !TEST */                                             /* } */
 }
 
 /*
@@ -320,7 +384,6 @@ static int
 bsd_stream_accept(
     void *     s)
 {
-#ifndef TEST                                                   /* { */
     struct sec_stream *bs = s;
 
     assert(bs != NULL);
@@ -333,7 +396,6 @@ bsd_stream_accept(
            "can't accept new stream connection: %s", strerror(errno));
        return (-1);
     }
-#endif /* !TEST */                                             /* } */
     return (0);
 }
 
@@ -346,10 +408,9 @@ bsd_stream_client(
     int                id)
 {
     struct sec_stream *bs = NULL;
-#ifndef TEST                                                   /* { */
     struct sec_handle *bh = h;
 #ifdef DUMPER_SOCKET_BUFFERING
-    size_t rcvbuf = SIZEOF(bs->databuf) * 2;
+    int rcvbuf = SIZEOF(bs->databuf) * 2;
 #endif
 
     assert(bh != NULL);
@@ -370,7 +431,6 @@ bsd_stream_client(
 #ifdef DUMPER_SOCKET_BUFFERING
     setsockopt(bs->fd, SOL_SOCKET, SO_RCVBUF, (void *)&rcvbuf, SIZEOF(rcvbuf));
 #endif
-#endif /* !TEST */                                             /* } */
     return (bs);
 }
 
@@ -480,8 +540,8 @@ stream_read_sync_callback(
 
     assert(bs != NULL);
 
-    bsdprintf(("%s: bsd: stream_read_callback_sync: fd %d\n",
-                debug_prefix_time(NULL), bs->fd));
+    auth_debug(1, ("%s: bsd: stream_read_callback_sync: fd %d\n",
+                  debug_prefix_time(NULL), bs->fd));
 
     /*
      * Remove the event first, in case they reschedule it in the callback.
@@ -539,198 +599,3 @@ stream_read_callback(
 }
 
 #endif /* BSD_SECURITY */                                      /* } */
-
-#if defined(TEST)                                              /* { */
-
-/*
- * The following dummy bind_portrange function is so we do not need to
- * drag in util.o just for the test program.
- */
-int
-bind_portrange(
-    int                        s,
-    struct sockaddr_in *addrp,
-    in_port_t          first_port,
-    in_port_t          last_port,
-    char *             proto)
-{
-    (void)s;           /* Quiet unused parameter warning */
-    (void)addrp;       /* Quiet unused parameter warning */
-    (void)first_port;  /* Quiet unused parameter warning */
-    (void)last_port;   /* Quiet unused parameter warning */
-    (void)proto;       /* Quiet unused parameter warning */
-
-    return 0;
-}
-
-/*
- * Construct a datestamp (YYYYMMDD) from a time_t.
- */
-char *
-construct_datestamp(
-    time_t *   t)
-{
-    struct tm *tm;
-    char datestamp[3*NUM_STR_SIZE];
-    time_t when;
-
-    if(t == NULL) {
-       when = time((time_t *)NULL);
-    } else {
-       when = *t;
-    }
-    tm = localtime(&when);
-    snprintf(datestamp, SIZEOF(datestamp),
-             "%04d%02d%02d", tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday);
-    return stralloc(datestamp);
-}
-
-/*
- * Construct a timestamp (YYYYMMDDHHMMSS) from a time_t.
- */
-char *
-construct_timestamp(
-    time_t *   t)
-{
-    struct tm *tm;
-    char timestamp[6*NUM_STR_SIZE];
-    time_t when;
-
-    if(t == NULL) {
-       when = time((time_t *)NULL);
-    } else {
-       when = *t;
-    }
-    tm = localtime(&when);
-    snprintf(timestamp, SIZEOF(timestamp),
-            "%04d%02d%02d%02d%02d%02d",
-            tm->tm_year+1900, tm->tm_mon+1, tm->tm_mday,
-            tm->tm_hour, tm->tm_min, tm->tm_sec);
-    return stralloc(timestamp);
-}
-
-/*
- * The following are so we can include security.o but not all the rest
- * of the security modules.
- */
-const security_driver_t krb4_security_driver = {};
-const security_driver_t krb5_security_driver = {};
-const security_driver_t rsh_security_driver = {};
-const security_driver_t ssh_security_driver = {};
-const security_driver_t bsdtcp_security_driver = {};
-const security_driver_t bsdudp_security_driver = {};
-
-/*
- * This function will be called to accept the connection and is used
- * to report success or failure.
- */
-static void fake_accept_function(
-    security_handle_t *        handle,
-    pkt_t *            pkt)
-{
-    if (pkt == NULL) {
-       fputs(handle->error, stdout);
-       fputc('\n', stdout);
-    } else {
-       fputs("access is allowed\n", stdout);
-    }
-}
-
-int
-main (
-    int                argc,
-    char **    argv)
-{
-    char *remoteuser;
-    char *remotehost;
-    struct hostent *hp;
-    struct sec_handle *bh;
-    void *save_cur;
-    struct passwd *pwent;
-
-    /* Don't die when child closes pipe */
-    signal(SIGPIPE, SIG_IGN);
-
-    /*
-     * The following is stolen from amandad to emulate what it would
-     * do on startup.
-     */
-    if(client_uid == (uid_t) -1 && (pwent = getpwnam(CLIENT_LOGIN)) != NULL) {
-       client_uid = pwent->pw_uid;
-       client_gid = pwent->pw_gid;
-       endpwent();
-    }
-
-#ifdef FORCE_USERID
-    /* we'd rather not run as root */
-    if (geteuid() == 0) {
-       if(client_uid == (uid_t) -1) {
-           error("error [cannot find user %s in passwd file]\n", CLIENT_LOGIN);
-           /*NOTREACHED*/
-       }
-       initgroups(CLIENT_LOGIN, client_gid);
-       setgid(client_gid);
-       setegid(client_gid);
-       seteuid(client_uid);
-    }
-#endif /* FORCE_USERID */
-
-    if (isatty(0)) {
-       fputs("Remote user: ", stdout);
-       fflush(stdout);
-    }
-    do {
-       amfree(remoteuser);
-       remoteuser = agets(stdin);
-       if (remoteuser == NULL)
-           return 0;
-    } while (remoteuser[0] == '\0');
-
-    if (isatty(0)) {
-       fputs("Remote host: ", stdout);
-       fflush(stdout);
-    }
-
-    do {
-       amfree(remotehost);
-       remotehost = agets(stdin);
-       if (remotehost == NULL)
-           return 0;
-    } while (remotehost[0] == '\0');
-
-    set_pname("security");
-    dbopen(NULL);
-
-    startclock();
-
-    if ((hp = gethostbyname(remotehost)) == NULL) {
-       fprintf(stderr, "cannot look up remote host %s\n", remotehost);
-       return 1;
-    }
-    memcpy((char *)&netfd.peer.sin_addr,
-          (char *)hp->h_addr,
-          SIZEOF(hp->h_addr));
-    /*
-     * Fake that it is coming from a reserved port.
-     */
-    netfd.peer.sin_port = htons(IPPORT_RESERVED - 1);
-
-    bh = alloc(SIZEOF(*bh));
-    bh->proto_handle=NULL;
-    bh->udp = &netfd;
-    netfd.pkt.type = P_REQ;
-    dgram_zero(&netfd.dgram);
-    save_cur = netfd.dgram.cur;                                /* cheating */
-    dgram_cat(&netfd.dgram, "%s", pkthdr2str(bh, &netfd.pkt));
-    dgram_cat(&netfd.dgram, "SECURITY USER %s\n", remoteuser);
-    netfd.dgram.cur = save_cur;                                /* cheating */
-
-    netfd.accept_fn = fake_accept_function;
-    netfd.recv_security_ok = &bsd_recv_security_ok;
-    netfd.prefix_packet = &bsd_prefix_packet;
-    udp_netfd_read_callback(&netfd);
-
-    return 0;
-}
-
-#endif                                                         /* } */
index 78b8ae1c4baaed60f126cf5919962d49cc03356c..485186ffb8d24d61279302acf4c5f1eb89b0d8ca 100644 (file)
@@ -25,7 +25,7 @@
  */
 
 /*
- * $Id: bsdtcp-security.c,v 1.7.2.2 2006/09/29 11:28:55 martinea Exp $
+ * $Id: bsdtcp-security.c,v 1.7 2006/07/13 03:22:20 paddy_s Exp $
  *
  * bsdtcp-security.c - security and transport over bsdtcp or a bsdtcp-like command.
  *
 
 #ifdef BSDTCP_SECURITY
 
-/*#define      BSDTCP_DEBUG*/
-
-#ifdef BSDTCP_DEBUG
-#define        bsdtcpprintf(x) dbprintf(x)
-#else
-#define        bsdtcpprintf(x)
-#endif
-
-
 /*
  * Number of seconds bsdtcp has to start up
  */
@@ -90,6 +81,8 @@ const security_driver_t bsdtcp_security_driver = {
     tcpm_stream_read_sync,
     tcpm_stream_read_cancel,
     tcpm_close_connection,
+    NULL,
+    NULL
 };
 
 static int newhandle = 1;
@@ -113,15 +106,17 @@ bsdtcp_connect(
     void *     datap)
 {
     struct sec_handle *rh;
-    struct hostent *he;
+    int result;
+    struct addrinfo hints;
+    struct addrinfo *res = NULL;
 
     assert(fn != NULL);
     assert(hostname != NULL);
     (void)conf_fn;     /* Quiet unused parameter warning */
     (void)datap;       /* Quiet unused parameter warning */
 
-    bsdtcpprintf(("%s: bsdtcp: bsdtcp_connect: %s\n", debug_prefix_time(NULL),
-              hostname));
+    auth_debug(1, ("%s: bsdtcp: bsdtcp_connect: %s\n", debug_prefix_time(NULL),
+                  hostname));
 
     rh = alloc(sizeof(*rh));
     security_handleinit(&rh->sech, &bsdtcp_security_driver);
@@ -130,13 +125,43 @@ bsdtcp_connect(
     rh->ev_timeout = NULL;
     rh->rc = NULL;
 
-    if ((he = gethostbyname(hostname)) == NULL) {
-       security_seterror(&rh->sech,
-           "%s: could not resolve hostname", hostname);
+#ifdef WORKING_IPV6
+    hints.ai_flags = AI_CANONNAME | AI_V4MAPPED | AI_ALL;
+    hints.ai_family = AF_UNSPEC;
+#else
+    hints.ai_flags = AI_CANONNAME;
+    hints.ai_family = AF_INET;
+#endif
+    hints.ai_socktype = SOCK_DGRAM;
+    hints.ai_protocol = IPPROTO_UDP;
+    hints.ai_addrlen = 0;
+    hints.ai_addr = NULL;
+    hints.ai_canonname = NULL;
+    hints.ai_next = NULL;
+    result = getaddrinfo(hostname, NULL, &hints, &res);
+#ifdef WORKING_IPV6
+    if (result != 0) {
+       hints.ai_flags = AI_CANONNAME;
+       hints.ai_family = AF_UNSPEC;
+       result = getaddrinfo(hostname, NULL, &hints, &res);
+    }
+#endif
+    if(result != 0) {
+        dbprintf(("getaddrinfo(%s): %s\n", hostname, gai_strerror(result)));
+       security_seterror(&rh->sech, "getaddrinfo(%s): %s\n", hostname,
+                         gai_strerror(result));
        (*fn)(arg, &rh->sech, S_ERROR);
        return;
     }
-    rh->hostname = stralloc(he->h_name);       /* will be replaced */
+    if (res->ai_canonname == NULL) {
+       dbprintf(("getaddrinfo(%s) did not return a canonical name\n", hostname));
+       security_seterror(&rh->sech,
+               _("getaddrinfo(%s) did not return a canonical name\n"), hostname);
+       (*fn)(arg, &rh->sech, S_ERROR);
+       return;
+    }
+
+    rh->hostname = stralloc(res->ai_canonname);        /* will be replaced */
     rh->rs = tcpma_stream_client(rh, newhandle++);
     rh->rc->recv_security_ok = &bsd_recv_security_ok;
     rh->rc->prefix_packet = &bsd_prefix_packet;
@@ -173,10 +198,12 @@ bsdtcp_connect(
     rh->ev_timeout = event_register(CONNECT_TIMEOUT, EV_TIME,
        sec_connect_timeout, rh);
 
+    freeaddrinfo(res);
     return;
 
 error:
     (*fn)(arg, &rh->sech, S_ERROR);
+    freeaddrinfo(res);
 }
 
 /*
@@ -189,10 +216,12 @@ bsdtcp_accept(
     int                out,
     void       (*fn)(security_handle_t *, pkt_t *))
 {
-    struct sockaddr_in sin;
+    struct sockaddr_storage sin;
     socklen_t len;
     struct tcp_conn *rc;
-    struct hostent *he;
+    char hostname[NI_MAXHOST];
+    int result;
+    char *errmsg = NULL;
 
     len = sizeof(sin);
     if (getpeername(in, (struct sockaddr *)&sin, &len) < 0) {
@@ -200,18 +229,22 @@ bsdtcp_accept(
                  strerror(errno)));
        return;
     }
-    he = gethostbyaddr((void *)&sin.sin_addr, sizeof(sin.sin_addr), AF_INET);
-    if (he == NULL) {
-       dbprintf(("%s: he returned NULL: h_errno = %d\n",
-                 debug_prefix_time(NULL), h_errno));
+    if ((result = getnameinfo((struct sockaddr *)&sin, len,
+                             hostname, NI_MAXHOST, NULL, 0, 0) != 0)) {
+       dbprintf(("%s: getnameinfo failed: %s\n",
+                 debug_prefix_time(NULL), gai_strerror(result)));
+       return;
+    }
+    if (check_name_give_sockaddr(hostname,
+                                (struct sockaddr *)&sin, &errmsg) < 0) {
+       amfree(errmsg);
        return;
     }
 
-    rc = sec_tcp_conn_get(he->h_name, 0);
+    rc = sec_tcp_conn_get(hostname, 0);
     rc->recv_security_ok = &bsd_recv_security_ok;
     rc->prefix_packet = &bsd_prefix_packet;
-    memcpy(&rc->peer.sin_addr, he->h_addr, sizeof(rc->peer.sin_addr));
-    rc->peer.sin_port = sin.sin_port;
+    memcpy(&rc->peer, &sin, sizeof(rc->peer));
     rc->read = in;
     rc->write = out;
     rc->accept_fn = fn;
index ae2325ff1cbd061eb21d5dc1778baac044af038f..9a3949d5ad8bb5a0ff5d71d8946a00b3945053d6 100644 (file)
 
 #ifdef BSDUDP_SECURITY
 
-/*#define       BSDUDP_DEBUG*/
-
-#ifdef BSDUDP_DEBUG
-#define bsdudpprintf(x)    dbprintf(x)
-#else
-#define bsdudpprintf(x)
-#endif
-
 #ifndef SO_RCVBUF
 #undef DUMPER_SOCKET_BUFFERING
 #endif
  */
 #undef SHOW_SECURITY_DETAIL
 
-#if defined(TEST)                                              /* { */
-#define SHOW_SECURITY_DETAIL
-#undef bsdudpprintf
-#define bsdudpprintf(p)        printf p
-#endif                                                         /* } */
-
 /*
  * Interface functions
  */
@@ -97,14 +83,18 @@ const security_driver_t bsdudp_security_driver = {
     tcpm_stream_read_sync,
     tcpm_stream_read_cancel,
     sec_close_connection_none,
+    NULL,
+    NULL
 };
 
 /*
  * This is data local to the datagram socket.  We have one datagram
  * per process, so it is global.
  */
-static udp_handle_t netfd;
-static int not_init = 1;
+static udp_handle_t netfd4;
+static udp_handle_t netfd6;
+static int not_init4 = 1;
+static int not_init6 = 1;
 
 /* generate new handles from here */
 static unsigned int newhandle = 0;
@@ -122,12 +112,14 @@ bsdudp_connect(
 {
     struct sec_handle *bh;
     struct servent *se;
-    struct hostent *he;
     in_port_t port;
     struct timeval sequence_time;
     amanda_timezone dontcare;
     int sequence;
     char *handle;
+    int result;
+    struct addrinfo hints;
+    struct addrinfo *res = NULL;
 
     (void)conf_fn;     /* Quiet unused parameter warning */
     (void)datap;       /* Quiet unused parameter warning */
@@ -135,25 +127,61 @@ bsdudp_connect(
 
     bh = alloc(sizeof(*bh));
     bh->proto_handle=NULL;
-    bh->udp = &netfd;
     bh->rc = NULL;
     security_handleinit(&bh->sech, &bsdudp_security_driver);
 
+#ifdef WORKING_IPV6
+    hints.ai_flags = AI_CANONNAME | AI_V4MAPPED | AI_ALL;
+    hints.ai_family = AF_INET6;
+#else
+    hints.ai_flags = AI_CANONNAME;
+    hints.ai_family = AF_INET;
+#endif
+    hints.ai_socktype = SOCK_DGRAM;
+    hints.ai_protocol = IPPROTO_UDP;
+    hints.ai_addrlen = 0;
+    hints.ai_addr = NULL;
+    hints.ai_canonname = NULL;
+    hints.ai_next = NULL;
+    result = getaddrinfo(hostname, NULL, &hints, &res);
+#ifdef WORKING_IPV6
+    if (result != 0) {
+       hints.ai_flags = AI_CANONNAME;
+       hints.ai_family = AF_UNSPEC;
+       result = getaddrinfo(hostname, NULL, &hints, &res);
+    }
+#endif
+    if(result != 0) {
+        dbprintf(("getaddrinfo: %s\n", gai_strerror(result)));
+       security_seterror(&bh->sech, "getaddrinfo(%s): %s\n", hostname,
+                         gai_strerror(result));
+       (*fn)(arg, &bh->sech, S_ERROR);
+        return;
+    }
+    if (res->ai_canonname == NULL) {
+       dbprintf(("getaddrinfo(%s) did not return a canonical name\n", hostname));
+       security_seterror(&bh->sech,
+               _("getaddrinfo(%s) did not return a canonical name\n"), hostname);
+       (*fn)(arg, &bh->sech, S_ERROR);
+       return;
+    }
+
     /*
      * Only init the socket once
      */
-    if (not_init == 1) {
+#ifdef WORKING_IPV6
+    if (res->ai_addr->sa_family == AF_INET6 && not_init6 == 1) {
        uid_t euid;
-       dgram_zero(&netfd.dgram);
+       dgram_zero(&netfd6.dgram);
        
        euid = geteuid();
        seteuid(0);
-       dgram_bind(&netfd.dgram, &port);
+       dgram_bind(&netfd6.dgram, res->ai_addr->sa_family, &port);
        seteuid(euid);
-       netfd.handle = NULL;
-       netfd.pkt.body = NULL;
-       netfd.recv_security_ok = &bsd_recv_security_ok;
-       netfd.prefix_packet = &bsd_prefix_packet;
+       netfd6.handle = NULL;
+       netfd6.pkt.body = NULL;
+       netfd6.recv_security_ok = &bsd_recv_security_ok;
+       netfd6.prefix_packet = &bsd_prefix_packet;
        /*
         * We must have a reserved port.  Bomb if we didn't get one.
         */
@@ -164,24 +192,56 @@ bsdudp_connect(
            (*fn)(arg, &bh->sech, S_ERROR);
            return;
        }
-       not_init = 0;
+       not_init6 = 0;
+       bh->udp = &netfd6;
     }
+#endif
 
-    if ((he = gethostbyname(hostname)) == NULL) {
-       security_seterror(&bh->sech,
-           "%s: could not resolve hostname", hostname);
-       (*fn)(arg, &bh->sech, S_ERROR);
-       return;
+    if (res->ai_addr->sa_family == AF_INET && not_init4 == 1) {
+       uid_t euid;
+       dgram_zero(&netfd4.dgram);
+
+       euid = geteuid();
+       seteuid((uid_t)0);
+       dgram_bind(&netfd4.dgram, res->ai_addr->sa_family, &port);
+       seteuid(euid);
+       netfd4.handle = NULL;
+       netfd4.pkt.body = NULL;
+       netfd4.recv_security_ok = &bsd_recv_security_ok;
+       netfd4.prefix_packet = &bsd_prefix_packet;
+       /*
+        * We must have a reserved port.  Bomb if we didn't get one.
+        */
+       if (port >= IPPORT_RESERVED) {
+           security_seterror(&bh->sech,
+               "unable to bind to a reserved port (got port %u)",
+               (unsigned int)port);
+           (*fn)(arg, &bh->sech, S_ERROR);
+           return;
+       }
+       not_init4 = 0;
+       bh->udp = &netfd4;
     }
+
+#ifdef WORKING_IPV6
+    if (res->ai_addr->sa_family == AF_INET6)
+       bh->udp = &netfd6;
+    else
+#endif
+       bh->udp = &netfd4;
+
+    auth_debug(1, ("Resolved hostname=%s\n", res->ai_canonname));
     if ((se = getservbyname(AMANDA_SERVICE_NAME, "udp")) == NULL)
-       port = (in_port_t)htons(AMANDA_SERVICE_DEFAULT);
+       port = AMANDA_SERVICE_DEFAULT;
     else
-       port = (in_port_t)se->s_port;
+       port = (in_port_t)ntohs(se->s_port);
     amanda_gettimeofday(&sequence_time, &dontcare);
     sequence = (int)sequence_time.tv_sec ^ (int)sequence_time.tv_usec;
     handle=alloc(15);
     snprintf(handle,14,"000-%08x", newhandle++);
-    if (udp_inithandle(&netfd, bh, he, port, handle, sequence) < 0) {
+    if (udp_inithandle(bh->udp, bh, res->ai_canonname,
+                      (struct sockaddr_storage *)res->ai_addr, port,
+                      handle, sequence) < 0) {
        (*fn)(arg, &bh->sech, S_ERROR);
        amfree(bh->hostname);
        amfree(bh);
@@ -189,6 +249,8 @@ bsdudp_connect(
        (*fn)(arg, &bh->sech, S_OK);
     }
     amfree(handle);
+
+    freeaddrinfo(res);
 }
 
 /*
@@ -211,20 +273,21 @@ bsdudp_accept(
      * We assume in and out point to the same socket, and just use
      * in.
      */
-    dgram_socket(&netfd.dgram, in);
+    dgram_socket(&netfd4.dgram, in);
+    dgram_socket(&netfd6.dgram, in);
 
     /*
      * Assign the function and return.  When they call recvpkt later,
      * the recvpkt callback will call this function when it discovers
      * new incoming connections
      */
-    netfd.accept_fn = fn;
-    netfd.recv_security_ok = &bsd_recv_security_ok;
-    netfd.prefix_packet = &bsd_prefix_packet;
-    netfd.driver = &bsdudp_security_driver;
+    netfd4.accept_fn = fn;
+    netfd4.recv_security_ok = &bsd_recv_security_ok;
+    netfd4.prefix_packet = &bsd_prefix_packet;
+    netfd4.driver = &bsdudp_security_driver;
 
 
-    udp_addref(&netfd, &udp_netfd_read_callback);
+    udp_addref(&netfd4, &udp_netfd_read_callback);
 }
 
 /*
@@ -240,21 +303,27 @@ bsdudp_close(
        return;
     }
 
-    bsdudpprintf(("%s: bsdudp: close handle '%s'\n",
-              debug_prefix_time(NULL), bh->proto_handle));
+    auth_debug(1, ("%s: bsdudp: close handle '%s'\n",
+                  debug_prefix_time(NULL), bh->proto_handle));
 
     udp_recvpkt_cancel(bh);
     if(bh->next) {
        bh->next->prev = bh->prev;
     }
     else {
-       netfd.bh_last = bh->prev;
+       if (!not_init6 && netfd6.bh_last == bh)
+           netfd6.bh_last = bh->prev;
+       else
+           netfd4.bh_last = bh->prev;
     }
     if(bh->prev) {
        bh->prev->next = bh->next;
     }
     else {
-       netfd.bh_first = bh->next;
+       if (!not_init6 && netfd6.bh_first == bh)
+           netfd6.bh_first = bh->next;
+       else
+           netfd4.bh_first = bh->next;
     }
 
     amfree(bh->proto_handle);
index 8f6d6699bd4ac2cfc88cfc3f581cbf7cd8d43447..ff41fa641edba607feaec4360b8dd1e5df27747c 100644 (file)
@@ -25,7 +25,7 @@
  *                        University of Maryland at College Park
  */
 /*
- * $Id: clock.c,v 1.7.2.1 2007/02/06 12:44:03 martinea Exp $
+ * $Id: clock.c,v 1.7 2006/07/27 18:12:10 martinea Exp $
  *
  * timing functions
  */
diff --git a/common-src/conffile.c b/common-src/conffile.c
new file mode 100644 (file)
index 0000000..986d9b4
--- /dev/null
@@ -0,0 +1,5168 @@
+/*
+ * Amanda, The Advanced Maryland Automatic Network Disk Archiver
+ * Copyright (c) 1991-2000 University of Maryland at College Park
+ * All Rights Reserved.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of U.M. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  U.M. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
+ * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Author: James da Silva, Systems Design and Analysis Group
+ *                        Computer Science Department
+ *                        University of Maryland at College Park
+ */
+/*
+ * $Id: conffile.c,v 1.156 2006/07/26 15:17:37 martinea Exp $
+ *
+ * read configuration file
+ */
+
+#include "amanda.h"
+#include "arglist.h"
+#include "util.h"
+#include "conffile.h"
+#include "clock.h"
+
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+
+#ifndef AMANDATES_FILE
+#define AMANDATES_FILE "/etc/amandates"
+#endif
+
+#ifndef INT_MAX
+#define INT_MAX 2147483647
+#endif
+
+/* this corresponds to the normal output of amanda, but may
+ * be adapted to any spacing as you like.
+ */
+ColumnInfo ColumnData[] = {
+    { "HostName",   0, 12, 12, 0, "%-*.*s", "HOSTNAME" },
+    { "Disk",       1, 11, 11, 0, "%-*.*s", "DISK" },
+    { "Level",      1, 1,  1,  0, "%*.*d",  "L" },
+    { "OrigKB",     1, 7,  0,  0, "%*.*lf", "ORIG-KB" },
+    { "OutKB",      1, 7,  0,  0, "%*.*lf", "OUT-KB" },
+    { "Compress",   1, 6,  1,  0, "%*.*lf", "COMP%" },
+    { "DumpTime",   1, 7,  7,  0, "%*.*s",  "MMM:SS" },
+    { "DumpRate",   1, 6,  1,  0, "%*.*lf", "KB/s" },
+    { "TapeTime",   1, 6,  6,  0, "%*.*s",  "MMM:SS" },
+    { "TapeRate",   1, 6,  1,  0, "%*.*lf", "KB/s" },
+    { NULL,         0, 0,  0,  0, NULL,     NULL }
+};
+
+char *config_name = NULL;
+char *config_dir = NULL;
+
+int debug_amandad    = 0;
+int debug_amidxtaped = 0;
+int debug_amindexd   = 0;
+int debug_amrecover  = 0;
+int debug_auth       = 0;
+int debug_event      = 0;
+int debug_holding    = 0;
+int debug_protocol   = 0;
+int debug_planner    = 0;
+int debug_driver     = 0;
+int debug_dumper     = 0;
+int debug_chunker    = 0;
+int debug_taper      = 0;
+int debug_selfcheck  = 0;
+int debug_sendsize   = 0;
+int debug_sendbackup = 0;
+
+/* visible holding disk variables */
+
+holdingdisk_t *holdingdisks;
+int num_holdingdisks;
+
+long int unit_divisor = 1;
+
+/* configuration parameters */
+
+val_t conf_data[CNF_CNF];
+int conffile_init = 0;
+
+command_option_t *program_options      = NULL;
+int               program_options_size = 0;
+
+/* other internal variables */
+static holdingdisk_t hdcur;
+
+static tapetype_t tpcur;
+
+static dumptype_t dpcur;
+
+static interface_t ifcur;
+
+static dumptype_t *dumplist = NULL;
+static tapetype_t *tapelist = NULL;
+static interface_t *interface_list = NULL;
+
+static int allow_overwrites;
+static int token_pushed;
+static tok_t tok, pushed_tok;
+static val_t tokenval;
+
+static int conf_line_num;
+static int got_parserror;
+static FILE *conf_conf = (FILE *)NULL;
+static char *conf_confname = NULL;
+static char *conf_line = NULL;
+static char *conf_char = NULL;
+static keytab_t *keytable = NULL;
+
+/* predeclare local functions */
+
+char *get_token_name(tok_t);
+
+
+static void validate_positive0            (t_conf_var *, val_t *);
+static void validate_positive1            (t_conf_var *, val_t *);
+static void validate_runspercycle         (t_conf_var *, val_t *);
+static void validate_bumppercent          (t_conf_var *, val_t *);
+static void validate_bumpmult             (t_conf_var *, val_t *);
+static void validate_inparallel           (t_conf_var *, val_t *);
+static void validate_displayunit          (t_conf_var *, val_t *);
+static void validate_reserve              (t_conf_var *, val_t *);
+static void validate_use                  (t_conf_var *, val_t *);
+static void validate_chunksize            (t_conf_var *, val_t *);
+static void validate_blocksize            (t_conf_var *, val_t *);
+static void validate_debug                (t_conf_var *, val_t *);
+static void validate_reserved_port_range  (t_conf_var *, val_t *);
+static void validate_unreserved_port_range(t_conf_var *, val_t *);
+
+/*static t_conf_var  *get_np(t_conf_var *get_var, int parm);*/
+static int     get_int(void);
+/*static long    get_long(void);*/
+static time_t  get_time(void);
+static ssize_t get_size(void);
+static off_t   get_am64_t(void);
+static int     get_bool(void);
+static void    ckseen(int *seen);
+static void    conf_parserror(const char *format, ...)
+                __attribute__ ((format (printf, 1, 2)));
+static tok_t   lookup_keyword(char *str);
+
+static void read_string(t_conf_var *, val_t *);
+static void read_ident(t_conf_var *, val_t *);
+static void read_int(t_conf_var *, val_t *);
+/*static void read_long(t_conf_var *, val_t *);*/
+static void read_size(t_conf_var *, val_t *);
+static void read_am64(t_conf_var *, val_t *);
+static void read_bool(t_conf_var *, val_t *);
+static void read_real(t_conf_var *, val_t *);
+static void read_time(t_conf_var *, val_t *);
+static void read_intrange(t_conf_var *, val_t *);
+static void conf_init_string(val_t *, char *);
+static void conf_init_ident(val_t *, char *);
+static void conf_init_int(val_t *, int);
+static void conf_init_bool(val_t *, int);
+static void conf_init_strategy(val_t *, int);
+static void conf_init_estimate(val_t *, int);
+static void conf_init_taperalgo(val_t *, int);
+static void conf_init_priority(val_t *, int);
+static void conf_init_strategy(val_t *, int);
+static void conf_init_compress(val_t *, comp_t);
+static void conf_init_encrypt(val_t *, encrypt_t);
+static void conf_init_holding(val_t *, dump_holdingdisk_t);
+/*static void conf_init_long(val_t *, long);*/
+static void conf_init_size(val_t *, ssize_t);
+static void conf_init_am64(val_t *, off_t);
+static void conf_init_real(val_t *, double);
+static void conf_init_rate(val_t *, double, double);
+static void conf_init_intrange(val_t *, int, int);
+static void conf_init_time(val_t *, time_t);
+/*static void conf_init_sl(val_t *, sl_t *);*/
+static void conf_init_exinclude(val_t *);
+static void conf_set_string(val_t *, char *);
+/*static void conf_set_int(val_t *, int);*/
+static void conf_set_bool(val_t *, int);
+static void conf_set_compress(val_t *, comp_t);
+/*static void conf_set_encrypt(val_t *, encrypt_t);*/
+static void conf_set_holding(val_t *, dump_holdingdisk_t);
+static void conf_set_strategy(val_t *, int);
+
+static void init_defaults(void);
+static void read_conffile_recursively(char *filename);
+static void read_client_conffile_recursively(char *filename);
+
+static int read_confline(void);
+static int read_client_confline(void);
+
+static void read_block(command_option_t *command_options, t_conf_var *read_var,
+                       keytab_t *keytab, val_t *valarray, char *prefix,
+                      char *errormsg, int read_brace,
+                      void (*copy_function)(void));
+
+static void copy_val_t(val_t *, val_t *);
+static void free_val_t(val_t *);
+static char *conf_print(val_t *, int, char *);
+static void conf_print_exinclude(val_t *, int, int, char *prefix, char **buf, int *free_space);
+
+static void get_holdingdisk(void);
+static void init_holdingdisk_defaults(void);
+static void save_holdingdisk(void);
+static void get_dumptype(void);
+static void init_dumptype_defaults(void);
+static void save_dumptype(void);
+static void copy_dumptype(void);
+static void get_tapetype(void);
+static void init_tapetype_defaults(void);
+static void save_tapetype(void);
+static void copy_tapetype(void);
+static void get_interface(void);
+static void init_interface_defaults(void);
+static void save_interface(void);
+static void copy_interface(void);
+static void get_comprate(t_conf_var *, val_t *);
+static void get_compress(t_conf_var *, val_t *);
+static void get_encrypt (t_conf_var *, val_t *);
+static void get_holding (t_conf_var *, val_t *);
+static void get_priority(t_conf_var *, val_t *);
+static void get_strategy(t_conf_var *, val_t *);
+static void get_estimate(t_conf_var *, val_t *);
+static void get_exclude (t_conf_var *, val_t *);
+/*static void get_include(t_conf_var *, val_t *);*/
+static void get_taperalgo(t_conf_var *, val_t *);
+
+static int  conftoken_getc(void);
+static int  conftoken_ungetc(int c);
+static void unget_conftoken(void);
+static void get_conftoken(tok_t exp);
+
+keytab_t   *my_keytab = NULL;
+t_conf_var *my_var = NULL;
+
+keytab_t client_keytab[] = {
+    { "CONF", CONF_CONF },
+    { "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_USERNAME", CONF_CLIENT_USERNAME },
+    { "GNUTAR_LIST_DIR", CONF_GNUTAR_LIST_DIR },
+    { "AMANDATES", CONF_AMANDATES },
+    { "KRB5KEYTAB", CONF_KRB5KEYTAB },
+    { "KRB5PRINCIPAL", CONF_KRB5PRINCIPAL },
+    { "INCLUDEFILE", CONF_INCLUDEFILE },
+    { "CONNECT_TRIES", CONF_CONNECT_TRIES },
+    { "REP_TRIES", CONF_REP_TRIES },
+    { "REQ_TRIES", CONF_REQ_TRIES },
+    { "DEBUG_AMANDAD", CONF_DEBUG_AMANDAD },
+    { "DEBUG_AMIDXTAPED", CONF_DEBUG_AMIDXTAPED },
+    { "DEBUG_AMINDEXD", CONF_DEBUG_AMINDEXD },
+    { "DEBUG_AMRECOVER", CONF_DEBUG_AMRECOVER },
+    { "DEBUG_AUTH", CONF_DEBUG_AUTH },
+    { "DEBUG_EVENT", CONF_DEBUG_EVENT },
+    { "DEBUG_HOLDING", CONF_DEBUG_HOLDING },
+    { "DEBUG_PROTOCOL", CONF_DEBUG_PROTOCOL },
+    { "DEBUG_PLANNER", CONF_DEBUG_PLANNER },
+    { "DEBUG_DRIVER", CONF_DEBUG_DRIVER },
+    { "DEBUG_DUMPER", CONF_DEBUG_DUMPER },
+    { "DEBUG_CHUNKER", CONF_DEBUG_CHUNKER },
+    { "DEBUG_TAPER", CONF_DEBUG_TAPER },
+    { "DEBUG_SELFCHECK", CONF_DEBUG_SELFCHECK },
+    { "DEBUG_SENDSIZE", CONF_DEBUG_SENDSIZE },
+    { "DEBUG_SENDBACKUP", CONF_DEBUG_SENDBACKUP },
+    { "UNRESERVED-TCP-PORT", CONF_UNRESERVED_TCP_PORT },
+    { NULL, CONF_UNKNOWN },
+};
+
+t_conf_var client_var [] = {
+   { CONF_CONF               , CONFTYPE_STRING  , read_string  , CNF_CONF               , NULL },
+   { CONF_INDEX_SERVER       , CONFTYPE_STRING  , read_string  , CNF_INDEX_SERVER       , NULL },
+   { CONF_TAPE_SERVER        , CONFTYPE_STRING  , read_string  , CNF_TAPE_SERVER        , NULL },
+   { CONF_TAPEDEV            , CONFTYPE_STRING  , read_string  , CNF_TAPEDEV            , NULL },
+   { CONF_AUTH               , CONFTYPE_STRING  , read_string  , CNF_AUTH               , NULL },
+   { CONF_SSH_KEYS           , CONFTYPE_STRING  , read_string  , CNF_SSH_KEYS           , NULL },
+   { CONF_AMANDAD_PATH       , CONFTYPE_STRING  , read_string  , CNF_AMANDAD_PATH       , NULL },
+   { CONF_CLIENT_USERNAME    , CONFTYPE_STRING  , read_string  , CNF_CLIENT_USERNAME    , NULL },
+   { CONF_GNUTAR_LIST_DIR    , CONFTYPE_STRING  , read_string  , CNF_GNUTAR_LIST_DIR    , NULL },
+   { CONF_AMANDATES          , CONFTYPE_STRING  , read_string  , CNF_AMANDATES          , NULL },
+   { CONF_KRB5KEYTAB         , CONFTYPE_STRING  , read_string  , CNF_KRB5KEYTAB         , NULL },
+   { CONF_KRB5PRINCIPAL      , CONFTYPE_STRING  , read_string  , CNF_KRB5PRINCIPAL      , NULL },
+   { CONF_CONNECT_TRIES      , CONFTYPE_INT     , read_int     , CNF_CONNECT_TRIES      , validate_positive1 },
+   { CONF_REP_TRIES          , CONFTYPE_INT     , read_int     , CNF_REP_TRIES          , validate_positive1 },
+   { CONF_REQ_TRIES          , CONFTYPE_INT     , read_int     , CNF_REQ_TRIES          , validate_positive1 },
+   { CONF_DEBUG_AMANDAD      , CONFTYPE_INT     , read_int     , CNF_DEBUG_AMANDAD      , validate_debug },
+   { CONF_DEBUG_AMIDXTAPED   , CONFTYPE_INT     , read_int     , CNF_DEBUG_AMIDXTAPED   , validate_debug },
+   { CONF_DEBUG_AMINDEXD     , CONFTYPE_INT     , read_int     , CNF_DEBUG_AMINDEXD     , validate_debug },
+   { CONF_DEBUG_AMRECOVER    , CONFTYPE_INT     , read_int     , CNF_DEBUG_AMRECOVER    , validate_debug },
+   { CONF_DEBUG_AUTH         , CONFTYPE_INT     , read_int     , CNF_DEBUG_AUTH         , validate_debug },
+   { CONF_DEBUG_EVENT        , CONFTYPE_INT     , read_int     , CNF_DEBUG_EVENT        , validate_debug },
+   { CONF_DEBUG_HOLDING      , CONFTYPE_INT     , read_int     , CNF_DEBUG_HOLDING      , validate_debug },
+   { CONF_DEBUG_PROTOCOL     , CONFTYPE_INT     , read_int     , CNF_DEBUG_PROTOCOL     , validate_debug },
+   { CONF_DEBUG_PLANNER      , CONFTYPE_INT     , read_int     , CNF_DEBUG_PLANNER      , validate_debug },
+   { CONF_DEBUG_DRIVER       , CONFTYPE_INT     , read_int     , CNF_DEBUG_DRIVER       , validate_debug },
+   { CONF_DEBUG_DUMPER       , CONFTYPE_INT     , read_int     , CNF_DEBUG_DUMPER       , validate_debug },
+   { CONF_DEBUG_CHUNKER      , CONFTYPE_INT     , read_int     , CNF_DEBUG_CHUNKER      , validate_debug },
+   { CONF_DEBUG_TAPER        , CONFTYPE_INT     , read_int     , CNF_DEBUG_TAPER        , validate_debug },
+   { CONF_DEBUG_SELFCHECK    , CONFTYPE_INT     , read_int     , CNF_DEBUG_SELFCHECK    , validate_debug },
+   { CONF_DEBUG_SENDSIZE     , CONFTYPE_INT     , read_int     , CNF_DEBUG_SENDSIZE     , validate_debug },
+   { CONF_DEBUG_SENDBACKUP   , CONFTYPE_INT     , read_int     , CNF_DEBUG_SENDBACKUP   , validate_debug },
+   { CONF_UNRESERVED_TCP_PORT, CONFTYPE_INTRANGE, read_intrange, CNF_UNRESERVED_TCP_PORT, validate_unreserved_port_range },
+   { CONF_UNKNOWN            , CONFTYPE_INT     , NULL         , CNF_CNF                , NULL }
+};
+
+keytab_t server_keytab[] = {
+    { "AMANDAD_PATH", CONF_AMANDAD_PATH },
+    { "AMRECOVER_CHANGER", CONF_AMRECOVER_CHANGER },
+    { "AMRECOVER_CHECK_LABEL", CONF_AMRECOVER_CHECK_LABEL },
+    { "AMRECOVER_DO_FSF", CONF_AMRECOVER_DO_FSF },
+    { "APPEND", CONF_APPEND },
+    { "AUTH", CONF_AUTH },
+    { "AUTO", CONF_AUTO },
+    { "AUTOFLUSH", CONF_AUTOFLUSH },
+    { "BEST", CONF_BEST },
+    { "BLOCKSIZE", CONF_BLOCKSIZE },
+    { "BUMPDAYS", CONF_BUMPDAYS },
+    { "BUMPMULT", CONF_BUMPMULT },
+    { "BUMPPERCENT", CONF_BUMPPERCENT },
+    { "BUMPSIZE", CONF_BUMPSIZE },
+    { "CALCSIZE", CONF_CALCSIZE },
+    { "CHANGERDEV", CONF_CHNGRDEV },
+    { "CHANGERFILE", CONF_CHNGRFILE },
+    { "CHUNKSIZE", CONF_CHUNKSIZE },
+    { "CLIENT", CONF_CLIENT },
+    { "CLIENT_CUSTOM_COMPRESS", CONF_CLNTCOMPPROG },
+    { "CLIENT_DECRYPT_OPTION", CONF_CLNT_DECRYPT_OPT },
+    { "CLIENT_ENCRYPT", CONF_CLNT_ENCRYPT },
+    { "CLIENT_USERNAME", CONF_CLIENT_USERNAME },
+    { "COLUMNSPEC", CONF_COLUMNSPEC },
+    { "COMMENT", CONF_COMMENT },
+    { "COMPRATE", CONF_COMPRATE },
+    { "COMPRESS", CONF_COMPRESS },
+    { "CONNECT_TRIES", CONF_CONNECT_TRIES },
+    { "CTIMEOUT", CONF_CTIMEOUT },
+    { "CUSTOM", CONF_CUSTOM },
+    { "DEBUG_AMANDAD"    , CONF_DEBUG_AMANDAD },
+    { "DEBUG_AMIDXTAPED" , CONF_DEBUG_AMIDXTAPED },
+    { "DEBUG_AMINDEXD"   , CONF_DEBUG_AMINDEXD },
+    { "DEBUG_AMRECOVER"  , CONF_DEBUG_AMRECOVER },
+    { "DEBUG_AUTH"       , CONF_DEBUG_AUTH },
+    { "DEBUG_EVENT"      , CONF_DEBUG_EVENT },
+    { "DEBUG_HOLDING"    , CONF_DEBUG_HOLDING },
+    { "DEBUG_PROTOCOL"   , CONF_DEBUG_PROTOCOL },
+    { "DEBUG_PLANNER"    , CONF_DEBUG_PLANNER },
+    { "DEBUG_DRIVER"     , CONF_DEBUG_DRIVER },
+    { "DEBUG_DUMPER"     , CONF_DEBUG_DUMPER },
+    { "DEBUG_CHUNKER"    , CONF_DEBUG_CHUNKER },
+    { "DEBUG_TAPER"      , CONF_DEBUG_TAPER },
+    { "DEBUG_SELFCHECK"  , CONF_DEBUG_SELFCHECK },
+    { "DEBUG_SENDSIZE"   , CONF_DEBUG_SENDSIZE },
+    { "DEBUG_SENDBACKUP" , CONF_DEBUG_SENDBACKUP },
+    { "DEFINE", CONF_DEFINE },
+    { "DIRECTORY", CONF_DIRECTORY },
+    { "DISKFILE", CONF_DISKFILE },
+    { "DISPLAYUNIT", CONF_DISPLAYUNIT },
+    { "DTIMEOUT", CONF_DTIMEOUT },
+    { "DUMPCYCLE", CONF_DUMPCYCLE },
+    { "DUMPORDER", CONF_DUMPORDER },
+    { "DUMPTYPE", CONF_DUMPTYPE },
+    { "DUMPUSER", CONF_DUMPUSER },
+    { "ENCRYPT", CONF_ENCRYPT },
+    { "ESTIMATE", CONF_ESTIMATE },
+    { "ETIMEOUT", CONF_ETIMEOUT },
+    { "EXCLUDE", CONF_EXCLUDE },
+    { "EXCLUDE-FILE", CONF_EXCLUDE_FILE },
+    { "EXCLUDE-LIST", CONF_EXCLUDE_LIST },
+    { "FALLBACK_SPLITSIZE", CONF_FALLBACK_SPLITSIZE },
+    { "FAST", CONF_FAST },
+    { "FILE", CONF_EFILE },
+    { "FILE-PAD", CONF_FILE_PAD },
+    { "FILEMARK", CONF_FILEMARK },
+    { "FIRST", CONF_FIRST },
+    { "FIRSTFIT", CONF_FIRSTFIT },
+    { "HANOI", CONF_HANOI },
+    { "HIGH", CONF_HIGH },
+    { "HOLDINGDISK", CONF_HOLDING },
+    { "IGNORE", CONF_IGNORE },
+    { "INCLUDE", CONF_INCLUDE },
+    { "INCLUDEFILE", CONF_INCLUDEFILE },
+    { "INCRONLY", CONF_INCRONLY },
+    { "INDEX", CONF_INDEX },
+    { "INDEXDIR", CONF_INDEXDIR },
+    { "INFOFILE", CONF_INFOFILE },
+    { "INPARALLEL", CONF_INPARALLEL },
+    { "INTERFACE", CONF_INTERFACE },
+    { "KENCRYPT", CONF_KENCRYPT },
+    { "KRB5KEYTAB", CONF_KRB5KEYTAB },
+    { "KRB5PRINCIPAL", CONF_KRB5PRINCIPAL },
+    { "LABELSTR", CONF_LABELSTR },
+    { "LABEL_NEW_TAPES", CONF_LABEL_NEW_TAPES },
+    { "LARGEST", CONF_LARGEST },
+    { "LARGESTFIT", CONF_LARGESTFIT },
+    { "LAST", CONF_LAST },
+    { "LBL-TEMPL", CONF_LBL_TEMPL },
+    { "LENGTH", CONF_LENGTH },
+    { "LIST", CONF_LIST },
+    { "LOGDIR", CONF_LOGDIR },
+    { "LOW", CONF_LOW },
+    { "MAILTO", CONF_MAILTO },
+    { "READBLOCKSIZE", CONF_READBLOCKSIZE },
+    { "MAXDUMPS", CONF_MAXDUMPS },
+    { "MAXDUMPSIZE", CONF_MAXDUMPSIZE },
+    { "MAXPROMOTEDAY", CONF_MAXPROMOTEDAY },
+    { "MEDIUM", CONF_MEDIUM },
+    { "NETUSAGE", CONF_NETUSAGE },     /* XXX - historical */
+    { "NEVER", CONF_NEVER },
+    { "NOFULL", CONF_NOFULL },
+    { "NOINC", CONF_NOINC },
+    { "NONE", CONF_NONE },
+    { "OPTIONAL", CONF_OPTIONAL },
+    { "ORG", CONF_ORG },
+    { "PRINTER", CONF_PRINTER },
+    { "PRIORITY", CONF_PRIORITY },
+    { "PROGRAM", CONF_PROGRAM },
+    { "RAWTAPEDEV", CONF_RAWTAPEDEV },
+    { "RECORD", CONF_RECORD },
+    { "REP_TRIES", CONF_REP_TRIES },
+    { "REQ_TRIES", CONF_REQ_TRIES },
+    { "REQUIRED", CONF_REQUIRED },
+    { "RESERVE", CONF_RESERVE },
+    { "RESERVED-UDP-PORT", CONF_RESERVED_UDP_PORT },
+    { "RESERVED-TCP-PORT", CONF_RESERVED_TCP_PORT },
+    { "RUNSPERCYCLE", CONF_RUNSPERCYCLE },
+    { "RUNTAPES", CONF_RUNTAPES },
+    { "SERVER", CONF_SERVER },
+    { "SERVER_CUSTOM_COMPRESS", CONF_SRVCOMPPROG },
+    { "SERVER_DECRYPT_OPTION", CONF_SRV_DECRYPT_OPT },
+    { "SERVER_ENCRYPT", CONF_SRV_ENCRYPT },
+    { "SKIP", CONF_SKIP },
+    { "SKIP-FULL", CONF_SKIP_FULL },
+    { "SKIP-INCR", CONF_SKIP_INCR },
+    { "SMALLEST", CONF_SMALLEST },
+    { "SPEED", CONF_SPEED },
+    { "SPLIT_DISKBUFFER", CONF_SPLIT_DISKBUFFER },
+    { "SSH_KEYS", CONF_SSH_KEYS },
+    { "STANDARD", CONF_STANDARD },
+    { "STARTTIME", CONF_STARTTIME },
+    { "STRATEGY", CONF_STRATEGY },
+    { "TAPEBUFS", CONF_TAPEBUFS },
+    { "TAPECYCLE", CONF_TAPECYCLE },
+    { "TAPEDEV", CONF_TAPEDEV },
+    { "TAPELIST", CONF_TAPELIST },
+    { "TAPERALGO", CONF_TAPERALGO },
+    { "TAPETYPE", CONF_TAPETYPE },
+    { "TAPE_SPLITSIZE", CONF_TAPE_SPLITSIZE },
+    { "TPCHANGER", CONF_TPCHANGER },
+    { "UNRESERVED-TCP-PORT", CONF_UNRESERVED_TCP_PORT },
+    { "USE", CONF_USE },
+    { "USETIMESTAMPS", CONF_USETIMESTAMPS },
+    { NULL, CONF_IDENT },
+    { NULL, CONF_UNKNOWN }
+};
+
+t_conf_var server_var [] = {
+   { CONF_ORG                  , CONFTYPE_STRING   , read_string  , CNF_ORG                  , NULL },
+   { CONF_MAILTO               , CONFTYPE_STRING   , read_string  , CNF_MAILTO               , NULL },
+   { CONF_DUMPUSER             , CONFTYPE_STRING   , read_string  , CNF_DUMPUSER             , NULL },
+   { CONF_PRINTER              , CONFTYPE_STRING   , read_string  , CNF_PRINTER              , NULL },
+   { CONF_TAPEDEV              , CONFTYPE_STRING   , read_string  , CNF_TAPEDEV              , NULL },
+   { CONF_TPCHANGER            , CONFTYPE_STRING   , read_string  , CNF_TPCHANGER            , NULL },
+   { CONF_CHNGRDEV             , CONFTYPE_STRING   , read_string  , CNF_CHNGRDEV             , NULL },
+   { CONF_CHNGRFILE            , CONFTYPE_STRING   , read_string  , CNF_CHNGRFILE            , NULL },
+   { CONF_LABELSTR             , CONFTYPE_STRING   , read_string  , CNF_LABELSTR             , NULL },
+   { CONF_TAPELIST             , CONFTYPE_STRING   , read_string  , CNF_TAPELIST             , NULL },
+   { CONF_DISKFILE             , CONFTYPE_STRING   , read_string  , CNF_DISKFILE             , NULL },
+   { CONF_INFOFILE             , CONFTYPE_STRING   , read_string  , CNF_INFOFILE             , NULL },
+   { CONF_LOGDIR               , CONFTYPE_STRING   , read_string  , CNF_LOGDIR               , NULL },
+   { CONF_INDEXDIR             , CONFTYPE_STRING   , read_string  , CNF_INDEXDIR             , NULL },
+   { CONF_TAPETYPE             , CONFTYPE_IDENT    , read_ident   , CNF_TAPETYPE             , NULL },
+   { CONF_DUMPCYCLE            , CONFTYPE_INT      , read_int     , CNF_DUMPCYCLE            , validate_positive0 },
+   { CONF_RUNSPERCYCLE         , CONFTYPE_INT      , read_int     , CNF_RUNSPERCYCLE         , validate_runspercycle },
+   { CONF_RUNTAPES             , CONFTYPE_INT      , read_int     , CNF_RUNTAPES             , validate_positive0 },
+   { CONF_TAPECYCLE            , CONFTYPE_INT      , read_int     , CNF_TAPECYCLE            , validate_positive1 },
+   { CONF_BUMPDAYS             , CONFTYPE_INT      , read_int     , CNF_BUMPDAYS             , validate_positive1 },
+   { CONF_BUMPSIZE             , CONFTYPE_AM64     , read_am64    , CNF_BUMPSIZE             , validate_positive1 },
+   { CONF_BUMPPERCENT          , CONFTYPE_INT      , read_int     , CNF_BUMPPERCENT          , validate_bumppercent },
+   { CONF_BUMPMULT             , CONFTYPE_REAL     , read_real    , CNF_BUMPMULT             , validate_bumpmult },
+   { CONF_NETUSAGE             , CONFTYPE_INT      , read_int     , CNF_NETUSAGE             , validate_positive1 },
+   { CONF_INPARALLEL           , CONFTYPE_INT      , read_int     , CNF_INPARALLEL           , validate_inparallel },
+   { CONF_DUMPORDER            , CONFTYPE_STRING   , read_string  , CNF_DUMPORDER            , NULL },
+   { CONF_MAXDUMPS             , CONFTYPE_INT      , read_int     , CNF_MAXDUMPS             , validate_positive1 },
+   { CONF_ETIMEOUT             , CONFTYPE_INT      , read_int     , CNF_ETIMEOUT             , NULL },
+   { CONF_DTIMEOUT             , CONFTYPE_INT      , read_int     , CNF_DTIMEOUT             , validate_positive1 },
+   { CONF_CTIMEOUT             , CONFTYPE_INT      , read_int     , CNF_CTIMEOUT             , validate_positive1 },
+   { CONF_TAPEBUFS             , CONFTYPE_INT      , read_int     , CNF_TAPEBUFS             , validate_positive1 },
+   { CONF_RAWTAPEDEV           , CONFTYPE_STRING   , read_string  , CNF_RAWTAPEDEV           , NULL },
+   { CONF_COLUMNSPEC           , CONFTYPE_STRING   , read_string  , CNF_COLUMNSPEC           , NULL },
+   { CONF_TAPERALGO            , CONFTYPE_TAPERALGO, get_taperalgo, CNF_TAPERALGO            , NULL },
+   { CONF_DISPLAYUNIT          , CONFTYPE_STRING   , read_string  , CNF_DISPLAYUNIT          , validate_displayunit },
+   { CONF_AUTOFLUSH            , CONFTYPE_BOOL     , read_bool    , CNF_AUTOFLUSH            , NULL },
+   { CONF_RESERVE              , CONFTYPE_INT      , read_int     , CNF_RESERVE              , validate_reserve },
+   { CONF_MAXDUMPSIZE          , CONFTYPE_AM64     , read_am64    , CNF_MAXDUMPSIZE          , NULL },
+   { CONF_KRB5KEYTAB           , CONFTYPE_STRING   , read_string  , CNF_KRB5KEYTAB           , NULL },
+   { CONF_KRB5PRINCIPAL        , CONFTYPE_STRING   , read_string  , CNF_KRB5PRINCIPAL        , NULL },
+   { CONF_LABEL_NEW_TAPES      , CONFTYPE_STRING   , read_string  , CNF_LABEL_NEW_TAPES      , NULL },
+   { CONF_USETIMESTAMPS        , CONFTYPE_BOOL     , read_bool    , CNF_USETIMESTAMPS        , NULL },
+   { CONF_AMRECOVER_DO_FSF     , CONFTYPE_BOOL     , read_bool    , CNF_AMRECOVER_DO_FSF     , NULL },
+   { CONF_AMRECOVER_CHANGER    , CONFTYPE_STRING   , read_string  , CNF_AMRECOVER_CHANGER    , NULL },
+   { CONF_AMRECOVER_CHECK_LABEL, CONFTYPE_BOOL     , read_bool    , CNF_AMRECOVER_CHECK_LABEL, NULL },
+   { CONF_CONNECT_TRIES        , CONFTYPE_INT      , read_int     , CNF_CONNECT_TRIES        , validate_positive1 },
+   { CONF_REP_TRIES            , CONFTYPE_INT      , read_int     , CNF_REP_TRIES            , validate_positive1 },
+   { CONF_REQ_TRIES            , CONFTYPE_INT      , read_int     , CNF_REQ_TRIES            , validate_positive1 },
+   { CONF_DEBUG_AMANDAD        , CONFTYPE_INT      , read_int     , CNF_DEBUG_AMANDAD        , validate_debug },
+   { CONF_DEBUG_AMIDXTAPED     , CONFTYPE_INT      , read_int     , CNF_DEBUG_AMIDXTAPED     , validate_debug },
+   { CONF_DEBUG_AMINDEXD       , CONFTYPE_INT      , read_int     , CNF_DEBUG_AMINDEXD       , validate_debug },
+   { CONF_DEBUG_AMRECOVER      , CONFTYPE_INT      , read_int     , CNF_DEBUG_AMRECOVER      , validate_debug },
+   { CONF_DEBUG_AUTH           , CONFTYPE_INT      , read_int     , CNF_DEBUG_AUTH           , validate_debug },
+   { CONF_DEBUG_EVENT          , CONFTYPE_INT      , read_int     , CNF_DEBUG_EVENT          , validate_debug },
+   { CONF_DEBUG_HOLDING        , CONFTYPE_INT      , read_int     , CNF_DEBUG_HOLDING        , validate_debug },
+   { CONF_DEBUG_PROTOCOL       , CONFTYPE_INT      , read_int     , CNF_DEBUG_PROTOCOL       , validate_debug },
+   { CONF_DEBUG_PLANNER        , CONFTYPE_INT      , read_int     , CNF_DEBUG_PLANNER        , validate_debug },
+   { CONF_DEBUG_DRIVER         , CONFTYPE_INT      , read_int     , CNF_DEBUG_DRIVER         , validate_debug },
+   { CONF_DEBUG_DUMPER         , CONFTYPE_INT      , read_int     , CNF_DEBUG_DUMPER         , validate_debug },
+   { CONF_DEBUG_CHUNKER        , CONFTYPE_INT      , read_int     , CNF_DEBUG_CHUNKER        , validate_debug },
+   { CONF_DEBUG_TAPER          , CONFTYPE_INT      , read_int     , CNF_DEBUG_TAPER          , validate_debug },
+   { CONF_DEBUG_SELFCHECK      , CONFTYPE_INT      , read_int     , CNF_DEBUG_SELFCHECK      , validate_debug },
+   { CONF_DEBUG_SENDSIZE       , CONFTYPE_INT      , read_int     , CNF_DEBUG_SENDSIZE       , validate_debug },
+   { CONF_DEBUG_SENDBACKUP     , CONFTYPE_INT      , read_int     , CNF_DEBUG_SENDBACKUP     , validate_debug },
+   { CONF_RESERVED_UDP_PORT    , CONFTYPE_INTRANGE , read_intrange, CNF_RESERVED_UDP_PORT    , validate_reserved_port_range },
+   { CONF_RESERVED_TCP_PORT    , CONFTYPE_INTRANGE , read_intrange, CNF_RESERVED_TCP_PORT    , validate_reserved_port_range },
+   { CONF_UNRESERVED_TCP_PORT  , CONFTYPE_INTRANGE , read_intrange, CNF_UNRESERVED_TCP_PORT  , validate_unreserved_port_range },
+   { CONF_UNKNOWN              , CONFTYPE_INT      , NULL         , CNF_CNF                  , NULL }
+};
+
+t_conf_var tapetype_var [] = {
+   { CONF_COMMENT     , CONFTYPE_STRING, read_string, TAPETYPE_COMMENT      , NULL },
+   { CONF_LBL_TEMPL   , CONFTYPE_STRING, read_string, TAPETYPE_LBL_TEMPL    , NULL },
+   { CONF_BLOCKSIZE   , CONFTYPE_SIZE  , read_size  , TAPETYPE_BLOCKSIZE    , validate_blocksize },
+   { CONF_READBLOCKSIZE, CONFTYPE_SIZE  , read_size , TAPETYPE_READBLOCKSIZE, validate_blocksize },
+   { CONF_LENGTH      , CONFTYPE_AM64  , read_am64  , TAPETYPE_LENGTH       , validate_positive0 },
+   { CONF_FILEMARK    , CONFTYPE_AM64  , read_am64  , TAPETYPE_FILEMARK     , NULL },
+   { CONF_SPEED       , CONFTYPE_INT   , read_int   , TAPETYPE_SPEED        , validate_positive0 },
+   { CONF_FILE_PAD    , CONFTYPE_BOOL  , read_bool  , TAPETYPE_FILE_PAD     , NULL },
+   { CONF_UNKNOWN     , CONFTYPE_INT   , NULL       , TAPETYPE_TAPETYPE     , NULL }
+};
+
+t_conf_var dumptype_var [] = {
+   { CONF_COMMENT           , CONFTYPE_STRING   , read_string , DUMPTYPE_COMMENT           , NULL },
+   { CONF_AUTH              , CONFTYPE_STRING   , read_string , DUMPTYPE_SECURITY_DRIVER   , NULL },
+   { CONF_BUMPDAYS          , CONFTYPE_INT      , read_int    , DUMPTYPE_BUMPDAYS          , NULL },
+   { CONF_BUMPMULT          , CONFTYPE_REAL     , read_real   , DUMPTYPE_BUMPMULT          , NULL },
+   { CONF_BUMPSIZE          , CONFTYPE_AM64     , read_am64   , DUMPTYPE_BUMPSIZE          , NULL },
+   { CONF_BUMPPERCENT       , CONFTYPE_INT      , read_int    , DUMPTYPE_BUMPPERCENT       , NULL },
+   { CONF_COMPRATE          , CONFTYPE_REAL     , get_comprate, DUMPTYPE_COMPRATE          , NULL },
+   { CONF_COMPRESS          , CONFTYPE_INT      , get_compress, DUMPTYPE_COMPRESS          , NULL },
+   { CONF_ENCRYPT           , CONFTYPE_INT      , get_encrypt , DUMPTYPE_ENCRYPT           , NULL },
+   { CONF_DUMPCYCLE         , CONFTYPE_INT      , read_int    , DUMPTYPE_DUMPCYCLE         , validate_positive0 },
+   { CONF_EXCLUDE           , CONFTYPE_EXINCLUDE, get_exclude , DUMPTYPE_EXCLUDE           , NULL },
+   { CONF_INCLUDE           , CONFTYPE_EXINCLUDE, get_exclude , DUMPTYPE_INCLUDE           , NULL },
+   { CONF_IGNORE            , CONFTYPE_BOOL     , read_bool   , DUMPTYPE_IGNORE            , NULL },
+   { CONF_HOLDING           , CONFTYPE_HOLDING  , get_holding , DUMPTYPE_HOLDINGDISK       , NULL },
+   { CONF_INDEX             , CONFTYPE_BOOL     , read_bool   , DUMPTYPE_INDEX             , NULL },
+   { CONF_KENCRYPT          , CONFTYPE_BOOL     , read_bool   , DUMPTYPE_KENCRYPT          , NULL },
+   { CONF_MAXDUMPS          , CONFTYPE_INT      , read_int    , DUMPTYPE_MAXDUMPS          , validate_positive1 },
+   { CONF_MAXPROMOTEDAY     , CONFTYPE_INT      , read_int    , DUMPTYPE_MAXPROMOTEDAY     , validate_positive0 },
+   { CONF_PRIORITY          , CONFTYPE_PRIORITY , get_priority, DUMPTYPE_PRIORITY          , NULL },
+   { CONF_PROGRAM           , CONFTYPE_STRING   , read_string , DUMPTYPE_PROGRAM           , NULL },
+   { CONF_RECORD            , CONFTYPE_BOOL     , read_bool   , DUMPTYPE_RECORD            , NULL },
+   { CONF_SKIP_FULL         , CONFTYPE_BOOL     , read_bool   , DUMPTYPE_SKIP_FULL         , NULL },
+   { CONF_SKIP_INCR         , CONFTYPE_BOOL     , read_bool   , DUMPTYPE_SKIP_INCR         , NULL },
+   { CONF_STARTTIME         , CONFTYPE_TIME     , read_time   , DUMPTYPE_STARTTIME         , NULL },
+   { CONF_STRATEGY          , CONFTYPE_INT      , get_strategy, DUMPTYPE_STRATEGY          , NULL },
+   { CONF_TAPE_SPLITSIZE    , CONFTYPE_AM64     , read_am64   , DUMPTYPE_TAPE_SPLITSIZE    , validate_positive0 },
+   { CONF_SPLIT_DISKBUFFER  , CONFTYPE_STRING   , read_string , DUMPTYPE_SPLIT_DISKBUFFER  , NULL },
+   { CONF_ESTIMATE          , CONFTYPE_INT      , get_estimate, DUMPTYPE_ESTIMATE          , NULL },
+   { CONF_SRV_ENCRYPT       , CONFTYPE_STRING   , read_string , DUMPTYPE_SRV_ENCRYPT       , NULL },
+   { CONF_CLNT_ENCRYPT      , CONFTYPE_STRING   , read_string , DUMPTYPE_CLNT_ENCRYPT      , NULL },
+   { CONF_AMANDAD_PATH      , CONFTYPE_STRING   , read_string , DUMPTYPE_AMANDAD_PATH      , NULL },
+   { CONF_CLIENT_USERNAME   , CONFTYPE_STRING   , read_string , DUMPTYPE_CLIENT_USERNAME   , NULL },
+   { CONF_SSH_KEYS          , CONFTYPE_STRING   , read_string , DUMPTYPE_SSH_KEYS          , NULL },
+   { CONF_SRVCOMPPROG       , CONFTYPE_STRING   , read_string , DUMPTYPE_SRVCOMPPROG       , NULL },
+   { CONF_CLNTCOMPPROG      , CONFTYPE_STRING   , read_string , DUMPTYPE_CLNTCOMPPROG      , NULL },
+   { CONF_FALLBACK_SPLITSIZE, CONFTYPE_AM64     , read_am64   , DUMPTYPE_FALLBACK_SPLITSIZE, NULL },
+   { CONF_SRV_DECRYPT_OPT   , CONFTYPE_STRING   , read_string , DUMPTYPE_SRV_DECRYPT_OPT   , NULL },
+   { CONF_CLNT_DECRYPT_OPT  , CONFTYPE_STRING   , read_string , DUMPTYPE_CLNT_DECRYPT_OPT  , NULL },
+   { CONF_UNKNOWN           , CONFTYPE_INT      , NULL        , DUMPTYPE_DUMPTYPE          , NULL }
+};
+
+t_conf_var holding_var [] = {
+   { CONF_DIRECTORY, CONFTYPE_STRING, read_string, HOLDING_DISKDIR  , NULL },
+   { CONF_COMMENT  , CONFTYPE_STRING, read_string, HOLDING_COMMENT  , NULL },
+   { CONF_USE      , CONFTYPE_AM64  , read_am64  , HOLDING_DISKSIZE , validate_use },
+   { CONF_CHUNKSIZE, CONFTYPE_AM64  , read_am64  , HOLDING_CHUNKSIZE, validate_chunksize },
+   { CONF_UNKNOWN  , CONFTYPE_INT   , NULL       , HOLDING_HOLDING  , NULL }
+};
+
+/*
+** ------------------------
+**  External entry points
+** ------------------------
+*/
+
+int
+read_conffile(
+    char *filename)
+{
+    interface_t *ip;
+
+    my_keytab = server_keytab;
+    my_var = server_var;
+    init_defaults();
+
+    /* We assume that conf_confname & conf are initialized to NULL above */
+    read_conffile_recursively(filename);
+
+    /* overwrite with command line option */
+    command_overwrite(program_options, my_var, my_keytab, conf_data,
+                     "");
+
+    if(got_parserror != -1 ) {
+       if(lookup_tapetype(conf_data[CNF_TAPETYPE].v.s) == NULL) {
+           char *save_confname = conf_confname;
+
+           conf_confname = filename;
+           if(!conf_data[CNF_TAPETYPE].seen)
+               conf_parserror("default tapetype %s not defined", conf_data[CNF_TAPETYPE].v.s);
+           else {
+               conf_line_num = conf_data[CNF_TAPETYPE].seen;
+               conf_parserror("tapetype %s not defined", conf_data[CNF_TAPETYPE].v.s);
+           }
+           conf_confname = save_confname;
+       }
+    }
+
+    ip = alloc(SIZEOF(interface_t));
+    ip->name = stralloc("default");
+    ip->seen = conf_data[CNF_NETUSAGE].seen;
+    conf_init_string(&ip->value[INTER_COMMENT], "implicit from NETUSAGE");
+    conf_init_int(&ip->value[INTER_MAXUSAGE], conf_data[CNF_NETUSAGE].v.i);
+    ip->curusage = 0;
+    ip->next = interface_list;
+    interface_list = ip;
+
+    debug_amandad    = getconf_int(CNF_DEBUG_AMANDAD);
+    debug_amidxtaped = getconf_int(CNF_DEBUG_AMIDXTAPED);
+    debug_amindexd   = getconf_int(CNF_DEBUG_AMINDEXD);
+    debug_amrecover  = getconf_int(CNF_DEBUG_AMRECOVER);
+    debug_auth       = getconf_int(CNF_DEBUG_AUTH);
+    debug_event      = getconf_int(CNF_DEBUG_EVENT);
+    debug_holding    = getconf_int(CNF_DEBUG_HOLDING);
+    debug_protocol   = getconf_int(CNF_DEBUG_PROTOCOL);
+    debug_planner    = getconf_int(CNF_DEBUG_PLANNER);
+    debug_driver     = getconf_int(CNF_DEBUG_DRIVER);
+    debug_dumper     = getconf_int(CNF_DEBUG_DUMPER);
+    debug_chunker    = getconf_int(CNF_DEBUG_CHUNKER);
+    debug_taper      = getconf_int(CNF_DEBUG_TAPER);
+    debug_selfcheck  = getconf_int(CNF_DEBUG_SELFCHECK);
+    debug_sendsize   = getconf_int(CNF_DEBUG_SENDSIZE);
+    debug_sendbackup = getconf_int(CNF_DEBUG_SENDBACKUP);
+
+    return got_parserror;
+}
+
+static void
+validate_positive0(
+    struct s_conf_var *np,
+    val_t        *val)
+{
+    switch(val->type) {
+    case CONFTYPE_INT:
+       if(val->v.i < 0)
+           conf_parserror("%s must be positive", get_token_name(np->token));
+       break;
+    case CONFTYPE_LONG:
+       if(val->v.l < 0)
+           conf_parserror("%s must be positive", get_token_name(np->token));
+       break;
+    case CONFTYPE_AM64:
+       if(val->v.am64 < 0)
+           conf_parserror("%s must be positive", get_token_name(np->token));
+       break;
+    default:
+       conf_parserror("validate_positive0 invalid type %d\n", val->type);
+    }
+}
+
+static void
+validate_positive1(
+    struct s_conf_var *np,
+    val_t        *val)
+{
+    switch(val->type) {
+    case CONFTYPE_INT:
+       if(val->v.i < 1)
+           conf_parserror("%s must be positive", get_token_name(np->token));
+       break;
+    case CONFTYPE_LONG:
+       if(val->v.l < 1)
+           conf_parserror("%s must be positive", get_token_name(np->token));
+       break;
+    case CONFTYPE_AM64:
+       if(val->v.am64 < 1)
+           conf_parserror("%s must be positive", get_token_name(np->token));
+       break;
+    case CONFTYPE_TIME:
+       if(val->v.t < 1)
+           conf_parserror("%s must be positive", get_token_name(np->token));
+       break;
+    default:
+       conf_parserror("validate_positive1 invalid type %d\n", val->type);
+    }
+}
+
+static void
+validate_runspercycle(
+    struct s_conf_var *np,
+    val_t        *val)
+{
+    np = np;
+    if(val->v.i < -1)
+       conf_parserror("runspercycle must be >= -1");
+}
+
+static void
+validate_bumppercent(
+    struct s_conf_var *np,
+    val_t        *val)
+{
+    np = np;
+    if(val->v.i < 0 || val->v.i > 100)
+       conf_parserror("bumppercent must be between 0 and 100");
+}
+
+static void
+validate_inparallel(
+    struct s_conf_var *np,
+    val_t        *val)
+{
+    np = np;
+    if(val->v.i < 1 || val->v.i >MAX_DUMPERS)
+       conf_parserror("inparallel must be between 1 and MAX_DUMPERS (%d)",
+                      MAX_DUMPERS);
+}
+
+static void
+validate_bumpmult(
+    struct s_conf_var *np,
+    val_t        *val)
+{
+    np = np;
+    if(val->v.r < 0.999) {
+       conf_parserror("bumpmult must be positive");
+    }
+}
+
+static void
+validate_displayunit(
+    struct s_conf_var *np,
+    val_t        *val)
+{
+    np = np;
+    if(strcmp(val->v.s, "k") == 0 ||
+       strcmp(val->v.s, "K") == 0) {
+       val->v.s[0] = (char)toupper(val->v.s[0]);
+       unit_divisor=1;
+    }
+    else if(strcmp(val->v.s, "m") == 0 ||
+       strcmp(val->v.s, "M") == 0) {
+       val->v.s[0] = (char)toupper(val->v.s[0]);
+       unit_divisor=1024;
+    }
+    else if(strcmp(val->v.s, "g") == 0 ||
+       strcmp(val->v.s, "G") == 0) {
+       val->v.s[0] = (char)toupper(val->v.s[0]);
+       unit_divisor=1024*1024;
+    }
+    else if(strcmp(val->v.s, "t") == 0 ||
+       strcmp(val->v.s, "T") == 0) {
+       val->v.s[0] = (char)toupper(val->v.s[0]);
+       unit_divisor=1024*1024*1024;
+    }
+    else {
+       conf_parserror("displayunit must be k,m,g or t.");
+    }
+}
+
+static void
+validate_reserve(
+    struct s_conf_var *np,
+    val_t        *val)
+{
+    np = np;
+    if(val->v.i < 0 || val->v.i > 100)
+       conf_parserror("reserve must be between 0 and 100");
+}
+
+static void
+validate_use(
+    struct s_conf_var *np,
+    val_t        *val)
+{
+    np = np;
+    val->v.am64 = am_floor(val->v.am64, DISK_BLOCK_KB);
+}
+
+static void
+validate_chunksize(
+    struct s_conf_var *np,
+    val_t        *val)
+{
+    np = np;
+    if(val->v.am64 == 0) {
+       val->v.am64 = ((AM64_MAX / 1024) - (2 * DISK_BLOCK_KB));
+    }
+    else if(val->v.am64 < 0) {
+       conf_parserror("Negative chunksize (" OFF_T_FMT
+                       ") is no longer supported", val->v.am64);
+    }
+    val->v.am64 = am_floor(val->v.am64, (off_t)DISK_BLOCK_KB);
+    if (val->v.am64 < 2*DISK_BLOCK_KB) {
+       conf_parserror("chunksize must be at least %dkb", 2*DISK_BLOCK_KB);
+    }
+}
+
+static void
+validate_blocksize(
+    struct s_conf_var *np,
+    val_t        *val)
+{
+    np = np;
+    if(val->v.l < DISK_BLOCK_KB) {
+       conf_parserror("Tape blocksize must be at least %d KBytes",
+                 DISK_BLOCK_KB);
+    } else if(val->v.l > MAX_TAPE_BLOCK_KB) {
+       conf_parserror("Tape blocksize must not be larger than %d KBytes",
+                 MAX_TAPE_BLOCK_KB);
+    }
+}
+
+static void
+validate_debug(
+    struct s_conf_var *np,
+    val_t        *val)
+{
+    np = np;
+    if(val->v.i < 0 || val->v.i > 9) {
+       conf_parserror("Debug must be between 0 and 9");
+    }
+}
+
+static void
+validate_reserved_port_range(
+    struct s_conf_var *np,
+    val_t        *val)
+{
+    np = np;
+    if(val->v.intrange[0] < 1 || val->v.intrange[0] > IPPORT_RESERVED-1) {
+       conf_parserror("portrange must be between 1 and %d", IPPORT_RESERVED-1);
+    } else if(val->v.intrange[1] < 1 || val->v.intrange[1] > IPPORT_RESERVED-1) {
+       conf_parserror("portrange must be between 1 and IPPORT_RESERVED-1");
+    }
+}
+
+static void
+validate_unreserved_port_range(
+    struct s_conf_var *np,
+    val_t        *val)
+{
+    np = np;
+    if(val->v.intrange[0] < IPPORT_RESERVED+1 || val->v.intrange[0] > 65536) {
+       conf_parserror("portrange must be between %d and 65536", IPPORT_RESERVED+1);
+    } else if(val->v.intrange[1] < IPPORT_RESERVED+1 || val->v.intrange[1] > 65536) {
+       conf_parserror("portrange must be between %d and 65536", IPPORT_RESERVED+1);
+    }
+}
+
+char *
+getconf_byname(
+    char *str)
+{
+    static char *tmpstr;
+    t_conf_var *np;
+    keytab_t *kt;
+    char *s;
+    char ch;
+    char *first_delim;
+    char *second_delim;
+    tapetype_t *tp;
+    dumptype_t *dp;
+    interface_t *ip;
+    holdingdisk_t *hp;
+
+    tmpstr = stralloc(str);
+    s = tmpstr;
+    while((ch = *s++) != '\0') {
+       if(islower((int)ch))
+           s[-1] = (char)toupper(ch);
+    }
+
+    first_delim = strchr(tmpstr, ':');
+    if (first_delim) {
+       *first_delim = '\0';
+       first_delim++;
+       second_delim = strchr(first_delim,':');
+       if(!second_delim) {
+           amfree(tmpstr);
+           return(NULL);
+       }
+       *second_delim = '\0';
+       second_delim++;
+
+       for(kt = my_keytab; kt->token != CONF_UNKNOWN; kt++) {
+           if(kt->keyword && strcmp(kt->keyword, second_delim) == 0)
+               break;
+       }
+
+       if(kt->token == CONF_UNKNOWN)
+           return NULL;
+
+       if (strcmp(tmpstr, "TAPETYPE") == 0) {
+           tp = lookup_tapetype(first_delim);
+           if (!tp) {
+               amfree(tmpstr);
+               return(NULL);
+           }
+           for(np = tapetype_var; np->token != CONF_UNKNOWN; np++) {
+               if(np->token == kt->token)
+                  break;
+           }
+           if (np->token == CONF_UNKNOWN) return NULL;
+           tmpstr = stralloc(conf_print(&tp->value[np->parm], 0, ""));
+       } else if (strcmp(tmpstr, "DUMPTYPE") == 0) {
+           dp = lookup_dumptype(first_delim);
+           if (!dp) {
+               amfree(tmpstr);
+               return(NULL);
+           }
+           for(np = dumptype_var; np->token != CONF_UNKNOWN; np++) {
+               if(np->token == kt->token)
+                  break;
+           }
+           if (np->token == CONF_UNKNOWN) return NULL;
+           tmpstr = stralloc(conf_print(&dp->value[np->parm], 0, ""));
+       } else if (strcmp(tmpstr, "HOLDINGDISK") == 0) {
+           hp = lookup_holdingdisk(first_delim);
+           if (!hp) {
+               amfree(tmpstr);
+               return(NULL);
+           }
+           for(np = holding_var; np->token != CONF_UNKNOWN; np++) {
+               if(np->token == kt->token)
+                  break;
+           }
+           if (np->token == CONF_UNKNOWN) return NULL;
+           tmpstr = stralloc(conf_print(&hp->value[np->parm], 0, ""));
+       } else if (strcmp(tmpstr, "INTERFACE") == 0) {
+           ip = lookup_interface(first_delim);
+           if (!ip) {
+               amfree(tmpstr);
+               return(NULL);
+           }
+           for(np = holding_var; np->token != CONF_UNKNOWN; np++) {
+               if(np->token == kt->token)
+                  break;
+           }
+           if (np->token == CONF_UNKNOWN) return NULL;
+           tmpstr = stralloc(conf_print(&ip->value[np->parm], 0, ""));
+       } else {
+           amfree(tmpstr);
+           return(NULL);
+       }
+    } else {
+       for(kt = my_keytab; kt->token != CONF_UNKNOWN; kt++) {
+           if(kt->keyword && strcmp(kt->keyword, tmpstr) == 0)
+               break;
+       }
+
+       if(kt->token == CONF_UNKNOWN)
+           return NULL;
+
+       for(np = my_var; np->token != CONF_UNKNOWN; np++) {
+           if(np->token == kt->token)
+               break;
+       }
+
+       if(np->token == CONF_UNKNOWN) return NULL;
+
+       tmpstr = stralloc(conf_print(&conf_data[np->parm], 0, ""));
+    }
+
+    return tmpstr;
+}
+
+
+char *
+getconf_list(
+    char *listname)
+{
+    char *result = NULL;
+    tapetype_t *tp;
+    dumptype_t *dp;
+    interface_t *ip;
+    holdingdisk_t *hp;
+
+    if (strcasecmp(listname,"tapetype") == 0) {
+       result = stralloc("");
+       for(tp = tapelist; tp != NULL; tp=tp->next) {
+           result = vstrextend(&result, tp->name, "\n", NULL);
+       }
+    } else if (strcasecmp(listname,"dumptype") == 0) {
+       result = stralloc("");
+       for(dp = dumplist; dp != NULL; dp=dp->next) {
+           result = vstrextend(&result, dp->name, "\n", NULL);
+       }
+    } else if (strcasecmp(listname,"holdingdisk") == 0) {
+       result = stralloc("");
+       for(hp = holdingdisks; hp != NULL; hp=hp->next) {
+           result = vstrextend(&result, hp->name, "\n", NULL);
+       }
+    } else if (strcasecmp(listname,"interface") == 0) {
+       result = stralloc("");
+       for(ip = interface_list; ip != NULL; ip=ip->next) {
+           result = vstrextend(&result, ip->name, "\n", NULL);
+       }
+    }
+    return result;
+}
+
+
+int
+getconf_seen(
+    confparm_t parm)
+{
+    return(conf_data[parm].seen);
+}
+
+int
+getconf_boolean(
+    confparm_t parm)
+{
+    if (conf_data[parm].type != CONFTYPE_BOOL) {
+       error("getconf_boolean: parm is not a CONFTYPE_BOOL");
+       /*NOTREACHED*/
+    }
+    return(conf_data[parm].v.i != 0);
+}
+
+int
+getconf_int(
+    confparm_t parm)
+{
+    if (conf_data[parm].type != CONFTYPE_INT) {
+       error("getconf_int: parm is not a CONFTYPE_INT");
+       /*NOTREACHED*/
+    }
+    return(conf_data[parm].v.i);
+}
+
+long
+getconf_long(
+    confparm_t parm)
+{
+    if (conf_data[parm].type != CONFTYPE_LONG) {
+       error("getconf_long: parm is not a CONFTYPE_LONG");
+       /*NOTREACHED*/
+    }
+    return(conf_data[parm].v.l);
+}
+
+time_t
+getconf_time(
+    confparm_t parm)
+{
+    if (conf_data[parm].type != CONFTYPE_TIME) {
+       error("getconf_time: parm is not a CONFTYPE_TIME");
+       /*NOTREACHED*/
+    }
+    return(conf_data[parm].v.t);
+}
+
+ssize_t
+getconf_size(
+    confparm_t parm)
+{
+    if (conf_data[parm].type != CONFTYPE_SIZE) {
+       error("getconf_size: parm is not a CONFTYPE_SIZE");
+       /*NOTREACHED*/
+    }
+    return(conf_data[parm].v.size);
+}
+
+off_t
+getconf_am64(
+    confparm_t parm)
+{
+    if (conf_data[parm].type != CONFTYPE_AM64) {
+       error("getconf_am64: parm is not a CONFTYPE_AM64");
+       /*NOTREACHED*/
+    }
+    return(conf_data[parm].v.am64);
+}
+
+double
+getconf_real(
+    confparm_t parm)
+{
+    if (conf_data[parm].type != CONFTYPE_REAL) {
+       error("getconf_real: parm is not a CONFTYPE_REAL");
+       /*NOTREACHED*/
+    }
+    return(conf_data[parm].v.r);
+}
+
+char *
+getconf_str(
+    confparm_t parm)
+{
+    if (conf_data[parm].type != CONFTYPE_STRING &&
+        conf_data[parm].type != CONFTYPE_IDENT) {
+       error("getconf_str: parm is not a CONFTYPE_STRING|CONFTYPE_IDENT: %d", parm);
+       /*NOTREACHED*/
+    }
+    return(conf_data[parm].v.s);
+}
+
+int
+getconf_taperalgo(
+    confparm_t parm)
+{
+    if (conf_data[parm].type != CONFTYPE_TAPERALGO) {
+       error("getconf_taperalgo: parm is not a CONFTYPE_TAPERALGO");
+       /*NOTREACHED*/
+    }
+    return(conf_data[parm].v.i);
+}
+
+int*
+getconf_intrange(
+    confparm_t parm)
+{
+    if (conf_data[parm].type != CONFTYPE_INTRANGE) {
+       error("getconf_intrange: parm is not a CONFTYPE_INTRANGE");
+       /*NOTREACHED*/
+    }
+    return(conf_data[parm].v.intrange);
+}
+
+holdingdisk_t *
+getconf_holdingdisks(
+    void)
+{
+    return holdingdisks;
+}
+
+dumptype_t *
+lookup_dumptype(
+    char *str)
+{
+    dumptype_t *p;
+
+    for(p = dumplist; p != NULL; p = p->next) {
+       if(strcasecmp(p->name, str) == 0) return p;
+    }
+    return NULL;
+}
+
+tapetype_t *
+lookup_tapetype(
+    char *str)
+{
+    tapetype_t *p;
+
+    for(p = tapelist; p != NULL; p = p->next) {
+       if(strcasecmp(p->name, str) == 0) return p;
+    }
+    return NULL;
+}
+
+holdingdisk_t *
+lookup_holdingdisk(
+    char *str)
+{
+    holdingdisk_t *p;
+
+    for(p = holdingdisks; p != NULL; p = p->next) {
+       if(strcasecmp(p->name, str) == 0) return p;
+    }
+    return NULL;
+}
+
+interface_t *
+lookup_interface(
+    char *str)
+{
+#ifndef __lint
+    interface_t *p;
+#endif
+
+    if (str == NULL)
+       return interface_list;
+
+#ifndef __lint
+    for (p = interface_list; p != NULL; p = p->next) {
+       if (strcasecmp(p->name, str) == 0)
+           return p;
+    }
+#endif
+    return NULL;
+}
+
+
+/*
+** ------------------------
+**  Internal routines
+** ------------------------
+*/
+
+
+static void
+init_defaults(
+    void)
+{
+    char *s;
+
+    /* defaults for exported variables */
+
+#ifdef DEFAULT_CONFIG
+    s = DEFAULT_CONFIG;
+#else
+    s = "YOUR ORG";
+#endif
+#ifdef DEFAULT_CONFIG
+    s = DEFAULT_CONFIG;
+#else
+    s = "";
+#endif
+    conf_init_string(&conf_data[CNF_CONF], s);
+#ifdef DEFAULT_SERVER
+    s = DEFAULT_SERVER;
+#else
+    s = "";
+#endif
+    conf_init_string(&conf_data[CNF_INDEX_SERVER], s);
+
+
+#ifdef DEFAULT_TAPE_SERVER
+    s = DEFAULT_TAPE_SERVER;
+#else
+#ifdef DEFAULT_SERVER
+    s = DEFAULT_SERVER;
+#else
+    s = "";
+#endif
+#endif
+    conf_init_string(&conf_data[CNF_TAPE_SERVER], s);
+    conf_init_string(&conf_data[CNF_AUTH], "bsd");
+    conf_init_string(&conf_data[CNF_SSH_KEYS], "");
+    conf_init_string(&conf_data[CNF_AMANDAD_PATH], "");
+    conf_init_string(&conf_data[CNF_CLIENT_USERNAME], "");
+#ifdef GNUTAR_LISTED_INCREMENTAL_DIR
+    conf_init_string(&conf_data[CNF_GNUTAR_LIST_DIR],
+                     GNUTAR_LISTED_INCREMENTAL_DIR);
+#else
+    conf_init_string(&conf_data[CNF_GNUTAR_LIST_DIR], NULL);
+#endif
+    conf_init_string(&conf_data[CNF_AMANDATES], AMANDATES_FILE);
+    conf_init_string(&conf_data[CNF_KRB5KEYTAB], "/.amanda-v5-keytab");
+    conf_init_string(&conf_data[CNF_KRB5PRINCIPAL], "service/amanda");
+
+    conf_init_string(&conf_data[CNF_ORG], s);
+    conf_init_string(&conf_data[CNF_MAILTO], "operators");
+    conf_init_string(&conf_data[CNF_DUMPUSER], CLIENT_LOGIN);
+#ifdef DEFAULT_TAPE_DEVICE
+    s = DEFAULT_TAPE_DEVICE;
+#else
+    s = NULL;
+#endif
+    conf_init_string(&conf_data[CNF_TAPEDEV], s);
+#ifdef DEFAULT_CHANGER_DEVICE
+    s = DEFAULT_CHANGER_DEVICE;
+#else
+    s = "/dev/null";
+#endif
+    conf_init_string(&conf_data[CNF_CHNGRDEV], s);
+    conf_init_string(&conf_data[CNF_CHNGRFILE], "/usr/adm/amanda/changer-status");
+#ifdef DEFAULT_RAW_TAPE_DEVICE
+    s = DEFAULT_RAW_TAPE_DEVICE;
+#else
+    s = "/dev/rawft0";
+#endif
+    conf_init_string   (&conf_data[CNF_LABELSTR]             , ".*");
+    conf_init_string   (&conf_data[CNF_TAPELIST]             , "tapelist");
+    conf_init_string   (&conf_data[CNF_DISKFILE]             , "disklist");
+    conf_init_string   (&conf_data[CNF_INFOFILE]             , "/usr/adm/amanda/curinfo");
+    conf_init_string   (&conf_data[CNF_LOGDIR]               , "/usr/adm/amanda");
+    conf_init_string   (&conf_data[CNF_INDEXDIR]             , "/usr/adm/amanda/index");
+    conf_init_ident    (&conf_data[CNF_TAPETYPE]             , "EXABYTE");
+    conf_init_int      (&conf_data[CNF_DUMPCYCLE]            , 10);
+    conf_init_int      (&conf_data[CNF_RUNSPERCYCLE]         , 0);
+    conf_init_int      (&conf_data[CNF_TAPECYCLE]            , 15);
+    conf_init_int      (&conf_data[CNF_NETUSAGE]             , 300);
+    conf_init_int      (&conf_data[CNF_INPARALLEL]           , 10);
+    conf_init_string   (&conf_data[CNF_DUMPORDER]            , "ttt");
+    conf_init_int      (&conf_data[CNF_BUMPPERCENT]          , 0);
+    conf_init_am64     (&conf_data[CNF_BUMPSIZE]             , (off_t)10*1024);
+    conf_init_real     (&conf_data[CNF_BUMPMULT]             , 1.5);
+    conf_init_int      (&conf_data[CNF_BUMPDAYS]             , 2);
+    conf_init_string   (&conf_data[CNF_TPCHANGER]            , "");
+    conf_init_int      (&conf_data[CNF_RUNTAPES]             , 1);
+    conf_init_int      (&conf_data[CNF_MAXDUMPS]             , 1);
+    conf_init_int      (&conf_data[CNF_ETIMEOUT]             , 300);
+    conf_init_int      (&conf_data[CNF_DTIMEOUT]             , 1800);
+    conf_init_int      (&conf_data[CNF_CTIMEOUT]             , 30);
+    conf_init_int      (&conf_data[CNF_TAPEBUFS]             , 20);
+    conf_init_string   (&conf_data[CNF_RAWTAPEDEV]           , s);
+    conf_init_string   (&conf_data[CNF_PRINTER]              , "");
+    conf_init_bool     (&conf_data[CNF_AUTOFLUSH]            , 0);
+    conf_init_int      (&conf_data[CNF_RESERVE]              , 100);
+    conf_init_am64     (&conf_data[CNF_MAXDUMPSIZE]          , (off_t)-1);
+    conf_init_string   (&conf_data[CNF_COLUMNSPEC]           , "");
+    conf_init_bool     (&conf_data[CNF_AMRECOVER_DO_FSF]     , 1);
+    conf_init_string   (&conf_data[CNF_AMRECOVER_CHANGER]    , "");
+    conf_init_bool     (&conf_data[CNF_AMRECOVER_CHECK_LABEL], 1);
+    conf_init_taperalgo(&conf_data[CNF_TAPERALGO]            , 0);
+    conf_init_string   (&conf_data[CNF_DISPLAYUNIT]          , "k");
+    conf_init_string   (&conf_data[CNF_KRB5KEYTAB]           , "/.amanda-v5-keytab");
+    conf_init_string   (&conf_data[CNF_KRB5PRINCIPAL]        , "service/amanda");
+    conf_init_string   (&conf_data[CNF_LABEL_NEW_TAPES]      , "");
+    conf_init_bool     (&conf_data[CNF_USETIMESTAMPS]        , 0);
+    conf_init_int      (&conf_data[CNF_CONNECT_TRIES]        , 3);
+    conf_init_int      (&conf_data[CNF_REP_TRIES]            , 5);
+    conf_init_int      (&conf_data[CNF_REQ_TRIES]            , 3);
+    conf_init_int      (&conf_data[CNF_DEBUG_AMANDAD]        , 0);
+    conf_init_int      (&conf_data[CNF_DEBUG_AMIDXTAPED]     , 0);
+    conf_init_int      (&conf_data[CNF_DEBUG_AMINDEXD]       , 0);
+    conf_init_int      (&conf_data[CNF_DEBUG_AMRECOVER]      , 0);
+    conf_init_int      (&conf_data[CNF_DEBUG_AUTH]           , 0);
+    conf_init_int      (&conf_data[CNF_DEBUG_EVENT]          , 0);
+    conf_init_int      (&conf_data[CNF_DEBUG_HOLDING]        , 0);
+    conf_init_int      (&conf_data[CNF_DEBUG_PROTOCOL]       , 0);
+    conf_init_int      (&conf_data[CNF_DEBUG_PLANNER]        , 0);
+    conf_init_int      (&conf_data[CNF_DEBUG_DRIVER]         , 0);
+    conf_init_int      (&conf_data[CNF_DEBUG_DUMPER]         , 0);
+    conf_init_int      (&conf_data[CNF_DEBUG_CHUNKER]        , 0);
+    conf_init_int      (&conf_data[CNF_DEBUG_TAPER]          , 0);
+    conf_init_int      (&conf_data[CNF_DEBUG_SELFCHECK]      , 0);
+    conf_init_int      (&conf_data[CNF_DEBUG_SENDSIZE]       , 0);
+    conf_init_int      (&conf_data[CNF_DEBUG_SENDBACKUP]     , 0);
+#ifdef UDPPORTRANGE
+    conf_init_intrange (&conf_data[CNF_RESERVED_UDP_PORT]    , UDPPORTRANGE);
+#else
+    conf_init_intrange (&conf_data[CNF_RESERVED_UDP_PORT]    , 512, 1023);
+#endif
+#ifdef LOW_TCPPORTRANGE
+    conf_init_intrange (&conf_data[CNF_RESERVED_TCP_PORT]    , LOW_TCPPORTRANGE);
+#else
+    conf_init_intrange (&conf_data[CNF_RESERVED_TCP_PORT]    , 512, 1023);
+#endif
+#ifdef TCPPORTRANGE
+    conf_init_intrange (&conf_data[CNF_UNRESERVED_TCP_PORT]  , TCPPORTRANGE);
+#else
+    conf_init_intrange (&conf_data[CNF_UNRESERVED_TCP_PORT]  , 0, 0);
+#endif
+
+    /* defaults for internal variables */
+
+    conf_line_num = got_parserror = 0;
+    allow_overwrites = 0;
+    token_pushed = 0;
+
+    while(holdingdisks != NULL) {
+       holdingdisk_t *hp;
+
+       hp = holdingdisks;
+       holdingdisks = holdingdisks->next;
+       amfree(hp);
+    }
+    num_holdingdisks = 0;
+
+    /* free any previously declared dump, tape and interface types */
+
+    while(dumplist != NULL) {
+       dumptype_t *dp;
+
+       dp = dumplist;
+       dumplist = dumplist->next;
+       amfree(dp);
+    }
+    while(tapelist != NULL) {
+       tapetype_t *tp;
+
+       tp = tapelist;
+       tapelist = tapelist->next;
+       amfree(tp);
+    }
+    while(interface_list != NULL) {
+       interface_t *ip;
+
+       ip = interface_list;
+       interface_list = interface_list->next;
+       amfree(ip);
+    }
+
+    /* create some predefined dumptypes for backwards compatability */
+    init_dumptype_defaults();
+    dpcur.name = stralloc("NO-COMPRESS");
+    dpcur.seen = -1;
+    conf_set_compress(&dpcur.value[DUMPTYPE_COMPRESS], COMP_NONE);
+    save_dumptype();
+
+    init_dumptype_defaults();
+    dpcur.name = stralloc("COMPRESS-FAST");
+    dpcur.seen = -1;
+    conf_set_compress(&dpcur.value[DUMPTYPE_COMPRESS], COMP_FAST);
+    save_dumptype();
+
+    init_dumptype_defaults();
+    dpcur.name = stralloc("COMPRESS-BEST");
+    dpcur.seen = -1;
+    conf_set_compress(&dpcur.value[DUMPTYPE_COMPRESS], COMP_BEST);
+    save_dumptype();
+
+    init_dumptype_defaults();
+    dpcur.name = stralloc("COMPRESS-CUST");
+    dpcur.seen = -1;
+    conf_set_compress(&dpcur.value[DUMPTYPE_COMPRESS], COMP_CUST);
+    save_dumptype();
+
+    init_dumptype_defaults();
+    dpcur.name = stralloc("SRVCOMPRESS");
+    dpcur.seen = -1;
+    conf_set_compress(&dpcur.value[DUMPTYPE_COMPRESS], COMP_SERVER_FAST);
+    save_dumptype();
+
+    init_dumptype_defaults();
+    dpcur.name = stralloc("BSD-AUTH");
+    dpcur.seen = -1;
+    conf_set_string(&dpcur.value[DUMPTYPE_SECURITY_DRIVER], "BSD");
+    save_dumptype();
+
+    init_dumptype_defaults();
+    dpcur.name = stralloc("KRB4-AUTH");
+    dpcur.seen = -1;
+    conf_set_string(&dpcur.value[DUMPTYPE_SECURITY_DRIVER], "KRB4");
+    save_dumptype();
+
+    init_dumptype_defaults();
+    dpcur.name = stralloc("NO-RECORD");
+    dpcur.seen = -1;
+    conf_set_bool(&dpcur.value[DUMPTYPE_RECORD], 0);
+    save_dumptype();
+
+    init_dumptype_defaults();
+    dpcur.name = stralloc("NO-HOLD");
+    dpcur.seen = -1;
+    conf_set_holding(&dpcur.value[DUMPTYPE_HOLDINGDISK], HOLD_NEVER);
+    save_dumptype();
+
+    init_dumptype_defaults();
+    dpcur.name = stralloc("NO-FULL");
+    dpcur.seen = -1;
+    conf_set_strategy(&dpcur.value[DUMPTYPE_STRATEGY], DS_NOFULL);
+    save_dumptype();
+    conffile_init = 1;
+}
+
+static void
+read_conffile_recursively(
+    char *filename)
+{
+    /* Save globals used in read_confline(), elsewhere. */
+    int  save_line_num  = conf_line_num;
+    FILE *save_conf     = conf_conf;
+    char *save_confname = conf_confname;
+    int        rc;
+
+    if (*filename == '/' || config_dir == NULL) {
+       conf_confname = stralloc(filename);
+    } else {
+       conf_confname = stralloc2(config_dir, filename);
+    }
+
+    if((conf_conf = fopen(conf_confname, "r")) == NULL) {
+       fprintf(stderr, "could not open conf file \"%s\": %s\n", conf_confname,
+               strerror(errno));
+       amfree(conf_confname);
+       got_parserror = -1;
+       return;
+    }
+
+    conf_line_num = 0;
+
+    /* read_confline() can invoke us recursively via "includefile" */
+    do {
+       rc = read_confline();
+    } while (rc != 0);
+    afclose(conf_conf);
+
+    amfree(conf_confname);
+
+    /* Restore servers */
+    conf_line_num = save_line_num;
+    conf_conf     = save_conf;
+    conf_confname = save_confname;
+}
+
+
+/* ------------------------ */
+
+
+static int
+read_confline(
+    void)
+{
+    t_conf_var *np;
+
+    keytable = server_keytab;
+
+    conf_line_num += 1;
+    get_conftoken(CONF_ANY);
+    switch(tok) {
+    case CONF_INCLUDEFILE:
+       {
+           char *fn;
+           char *cname;
+
+           get_conftoken(CONF_STRING);
+           fn = tokenval.v.s;
+           if (*fn == '/' || config_dir == NULL) {
+               cname = stralloc(fn);
+           } else {
+               cname = stralloc2(config_dir, fn);
+           }
+           if ( cname != NULL &&  (access(cname, R_OK) == 0)) {
+               read_conffile_recursively(cname);
+               amfree(cname);
+           } else {
+               conf_parserror("cannot open %s: %s\n", fn, strerror(errno));
+           }
+           amfree(cname);
+           
+       }
+       break;
+
+    case CONF_HOLDING:
+       get_holdingdisk();
+       break;
+
+    case CONF_DEFINE:
+       get_conftoken(CONF_ANY);
+       if(tok == CONF_DUMPTYPE) get_dumptype();
+       else if(tok == CONF_TAPETYPE) get_tapetype();
+       else if(tok == CONF_INTERFACE) get_interface();
+       else conf_parserror("DUMPTYPE, INTERFACE or TAPETYPE expected");
+       break;
+
+    case CONF_NL:      /* empty line */
+       break;
+
+    case CONF_END:     /* end of file */
+       return 0;
+
+    default:
+       {
+           for(np = server_var; np->token != CONF_UNKNOWN; np++) 
+               if(np->token == tok) break;
+
+           if(np->token == CONF_UNKNOWN) {
+               conf_parserror("configuration keyword expected");
+           } else {
+               np->read_function(np, &conf_data[np->parm]);
+               if(np->validate)
+                   np->validate(np, &conf_data[np->parm]);
+           }
+       }
+    }
+    if(tok != CONF_NL)
+       get_conftoken(CONF_NL);
+    return 1;
+}
+
+static void
+get_holdingdisk(
+    void)
+{
+    char *prefix;
+    int save_overwrites;
+
+    save_overwrites = allow_overwrites;
+    allow_overwrites = 1;
+
+    init_holdingdisk_defaults();
+
+    get_conftoken(CONF_IDENT);
+    hdcur.name = stralloc(tokenval.v.s);
+    hdcur.seen = conf_line_num;
+
+    prefix = vstralloc( "HOLDINGDISK:", hdcur.name, ":", NULL);
+    read_block(program_options, holding_var, server_keytab, hdcur.value, prefix,
+              "holding disk parameter expected", 1, NULL);
+    amfree(prefix);
+    get_conftoken(CONF_NL);
+
+    hdcur.disksize = holdingdisk_get_disksize(&hdcur);
+    save_holdingdisk();
+
+    allow_overwrites = save_overwrites;
+}
+
+static void
+init_holdingdisk_defaults(
+    void)
+{
+    conf_init_string(&hdcur.value[HOLDING_COMMENT]  , "");
+    conf_init_string(&hdcur.value[HOLDING_DISKDIR]  , "");
+    conf_init_am64(&hdcur.value[HOLDING_DISKSIZE] , (off_t)0);
+                    /* 1 Gb = 1M counted in 1Kb blocks */
+    conf_init_am64(&hdcur.value[HOLDING_CHUNKSIZE], (off_t)1024*1024);
+
+    hdcur.up = (void *)0;
+    hdcur.disksize = 0LL;
+}
+
+static void
+save_holdingdisk(
+    void)
+{
+    holdingdisk_t *hp;
+
+    hp = alloc(sizeof(holdingdisk_t));
+    *hp = hdcur;
+    hp->next = holdingdisks;
+    holdingdisks = hp;
+
+    num_holdingdisks++;
+}
+
+
+dumptype_t *
+read_dumptype(
+    char *name,
+    FILE *from,
+    char *fname,
+    int *linenum)
+{
+    int save_overwrites;
+    FILE *saved_conf = NULL;
+    char *saved_fname = NULL;
+    char *prefix;
+
+    if (from) {
+       saved_conf = conf_conf;
+       conf_conf = from;
+    }
+
+    if (fname) {
+       saved_fname = conf_confname;
+       conf_confname = fname;
+    }
+
+    if (linenum)
+       conf_line_num = *linenum;
+
+    save_overwrites = allow_overwrites;
+    allow_overwrites = 1;
+
+    init_dumptype_defaults();
+    if (name) {
+       dpcur.name = name;
+    } else {
+       get_conftoken(CONF_IDENT);
+       dpcur.name = stralloc(tokenval.v.s);
+    }
+    dpcur.seen = conf_line_num;
+
+    prefix = vstralloc( "DUMPTYPE:", dpcur.name, ":", NULL);
+    read_block(program_options, dumptype_var, server_keytab, dpcur.value,
+              prefix, "dumptype parameter expected",
+              (name == NULL), *copy_dumptype);
+    amfree(prefix);
+    if(!name)
+       get_conftoken(CONF_NL);
+
+    /* XXX - there was a stupidity check in here for skip-incr and
+    ** skip-full.  This check should probably be somewhere else. */
+
+    save_dumptype();
+
+    allow_overwrites = save_overwrites;
+
+    if (linenum)
+       *linenum = conf_line_num;
+
+    if (fname)
+       conf_confname = saved_fname;
+
+    if (from)
+       conf_conf = saved_conf;
+
+    return lookup_dumptype(dpcur.name);
+}
+
+static void
+get_dumptype(void)
+{
+    read_dumptype(NULL, NULL, NULL, NULL);
+}
+
+static void
+init_dumptype_defaults(void)
+{
+    dpcur.name = NULL;
+    conf_init_string   (&dpcur.value[DUMPTYPE_COMMENT]           , "");
+    conf_init_string   (&dpcur.value[DUMPTYPE_PROGRAM]           , "DUMP");
+    conf_init_string   (&dpcur.value[DUMPTYPE_SRVCOMPPROG]       , "");
+    conf_init_string   (&dpcur.value[DUMPTYPE_CLNTCOMPPROG]      , "");
+    conf_init_string   (&dpcur.value[DUMPTYPE_SRV_ENCRYPT]       , "");
+    conf_init_string   (&dpcur.value[DUMPTYPE_CLNT_ENCRYPT]      , "");
+    conf_init_string   (&dpcur.value[DUMPTYPE_AMANDAD_PATH]      , "X");
+    conf_init_string   (&dpcur.value[DUMPTYPE_CLIENT_USERNAME]   , "X");
+    conf_init_string   (&dpcur.value[DUMPTYPE_SSH_KEYS]          , "X");
+    conf_init_string   (&dpcur.value[DUMPTYPE_SECURITY_DRIVER]   , "BSD");
+    conf_init_exinclude(&dpcur.value[DUMPTYPE_EXCLUDE]);
+    conf_init_exinclude(&dpcur.value[DUMPTYPE_INCLUDE]);
+    conf_init_priority (&dpcur.value[DUMPTYPE_PRIORITY]          , 1);
+    conf_init_int      (&dpcur.value[DUMPTYPE_DUMPCYCLE]         , conf_data[CNF_DUMPCYCLE].v.i);
+    conf_init_int      (&dpcur.value[DUMPTYPE_MAXDUMPS]          , conf_data[CNF_MAXDUMPS].v.i);
+    conf_init_int      (&dpcur.value[DUMPTYPE_MAXPROMOTEDAY]     , 10000);
+    conf_init_int      (&dpcur.value[DUMPTYPE_BUMPPERCENT]       , conf_data[CNF_BUMPPERCENT].v.i);
+    conf_init_am64     (&dpcur.value[DUMPTYPE_BUMPSIZE]          , conf_data[CNF_BUMPSIZE].v.am64);
+    conf_init_int      (&dpcur.value[DUMPTYPE_BUMPDAYS]          , conf_data[CNF_BUMPDAYS].v.i);
+    conf_init_real     (&dpcur.value[DUMPTYPE_BUMPMULT]          , conf_data[CNF_BUMPMULT].v.r);
+    conf_init_time     (&dpcur.value[DUMPTYPE_STARTTIME]         , (time_t)0);
+    conf_init_strategy (&dpcur.value[DUMPTYPE_STRATEGY]          , DS_STANDARD);
+    conf_init_estimate (&dpcur.value[DUMPTYPE_ESTIMATE]          , ES_CLIENT);
+    conf_init_compress (&dpcur.value[DUMPTYPE_COMPRESS]          , COMP_FAST);
+    conf_init_encrypt  (&dpcur.value[DUMPTYPE_ENCRYPT]           , ENCRYPT_NONE);
+    conf_init_string   (&dpcur.value[DUMPTYPE_SRV_DECRYPT_OPT]   , "-d");
+    conf_init_string   (&dpcur.value[DUMPTYPE_CLNT_DECRYPT_OPT]  , "-d");
+    conf_init_rate     (&dpcur.value[DUMPTYPE_COMPRATE]          , 0.50, 0.50);
+    conf_init_am64     (&dpcur.value[DUMPTYPE_TAPE_SPLITSIZE]    , (off_t)0);
+    conf_init_am64     (&dpcur.value[DUMPTYPE_FALLBACK_SPLITSIZE], (off_t)10 * 1024);
+    conf_init_string   (&dpcur.value[DUMPTYPE_SPLIT_DISKBUFFER]  , NULL);
+    conf_init_bool     (&dpcur.value[DUMPTYPE_RECORD]            , 1);
+    conf_init_bool     (&dpcur.value[DUMPTYPE_SKIP_INCR]         , 0);
+    conf_init_bool     (&dpcur.value[DUMPTYPE_SKIP_FULL]         , 0);
+    conf_init_holding  (&dpcur.value[DUMPTYPE_HOLDINGDISK]       , HOLD_AUTO);
+    conf_init_bool     (&dpcur.value[DUMPTYPE_KENCRYPT]          , 0);
+    conf_init_bool     (&dpcur.value[DUMPTYPE_IGNORE]            , 0);
+    conf_init_bool     (&dpcur.value[DUMPTYPE_INDEX]             , 1);
+}
+
+static void
+save_dumptype(void)
+{
+    dumptype_t *dp, *dp1;;
+
+    dp = lookup_dumptype(dpcur.name);
+
+    if(dp != (dumptype_t *)0) {
+       conf_parserror("dumptype %s already defined on line %d", dp->name, dp->seen);
+       return;
+    }
+
+    dp = alloc(sizeof(dumptype_t));
+    *dp = dpcur;
+    dp->next = NULL;
+    /* add at end of list */
+    if(!dumplist)
+       dumplist = dp;
+    else {
+       dp1 = dumplist;
+       while (dp1->next != NULL) {
+            dp1 = dp1->next;
+       }
+       dp1->next = dp;
+    }
+}
+
+static void
+copy_dumptype(void)
+{
+    dumptype_t *dt;
+    int i;
+
+    dt = lookup_dumptype(tokenval.v.s);
+
+    if(dt == NULL) {
+       conf_parserror("dumptype parameter expected");
+       return;
+    }
+
+    for(i=0; i < DUMPTYPE_DUMPTYPE; i++) {
+       if(dt->value[i].seen) {
+           free_val_t(&dpcur.value[i]);
+           copy_val_t(&dpcur.value[i], &dt->value[i]);
+       }
+    }
+}
+
+static void
+get_tapetype(void)
+{
+    int save_overwrites;
+    char *prefix;
+
+    save_overwrites = allow_overwrites;
+    allow_overwrites = 1;
+
+    init_tapetype_defaults();
+
+    get_conftoken(CONF_IDENT);
+    tpcur.name = stralloc(tokenval.v.s);
+    tpcur.seen = conf_line_num;
+
+    prefix = vstralloc( "TAPETYPE:", tpcur.name, ":", NULL);
+    read_block(program_options, tapetype_var, server_keytab, tpcur.value,
+              prefix, "tapetype parameter expected", 1, &copy_tapetype);
+    amfree(prefix);
+    get_conftoken(CONF_NL);
+
+    save_tapetype();
+
+    allow_overwrites = save_overwrites;
+}
+
+static void
+init_tapetype_defaults(void)
+{
+    conf_init_string(&tpcur.value[TAPETYPE_COMMENT]      , "");
+    conf_init_string(&tpcur.value[TAPETYPE_LBL_TEMPL]    , "");
+    conf_init_size  (&tpcur.value[TAPETYPE_BLOCKSIZE]    , DISK_BLOCK_KB);
+    conf_init_size  (&tpcur.value[TAPETYPE_READBLOCKSIZE], MAX_TAPE_BLOCK_KB);
+    conf_init_am64  (&tpcur.value[TAPETYPE_LENGTH]       , (off_t)2000);
+    conf_init_am64  (&tpcur.value[TAPETYPE_FILEMARK]     , (off_t)1);
+    conf_init_int   (&tpcur.value[TAPETYPE_SPEED]        , 200);
+    conf_init_bool  (&tpcur.value[TAPETYPE_FILE_PAD]     , 1);
+}
+
+static void
+save_tapetype(void)
+{
+    tapetype_t *tp, *tp1;
+
+    tp = lookup_tapetype(tpcur.name);
+
+    if(tp != (tapetype_t *)0) {
+       amfree(tpcur.name);
+       conf_parserror("tapetype %s already defined on line %d", tp->name, tp->seen);
+       return;
+    }
+
+    tp = alloc(sizeof(tapetype_t));
+    *tp = tpcur;
+    /* add at end of list */
+    if(!tapelist)
+       tapelist = tp;
+    else {
+       tp1 = tapelist;
+       while (tp1->next != NULL) {
+           tp1 = tp1->next;
+       }
+       tp1->next = tp;
+    }
+}
+
+static void
+copy_tapetype(void)
+{
+    tapetype_t *tp;
+    int i;
+
+    tp = lookup_tapetype(tokenval.v.s);
+
+    if(tp == NULL) {
+       conf_parserror("tape type parameter expected");
+       return;
+    }
+
+    for(i=0; i < TAPETYPE_TAPETYPE; i++) {
+       if(tp->value[i].seen) {
+           free_val_t(&tpcur.value[i]);
+           copy_val_t(&tpcur.value[i], &tp->value[i]);
+       }
+    }
+}
+
+t_conf_var interface_var [] = {
+   { CONF_COMMENT, CONFTYPE_STRING, read_string, INTER_COMMENT , NULL },
+   { CONF_USE    , CONFTYPE_INT   , read_int   , INTER_MAXUSAGE, validate_positive1 },
+   { CONF_UNKNOWN, CONFTYPE_INT   , NULL       , INTER_INTER   , NULL }
+};
+
+static void
+get_interface(void)
+{
+    int save_overwrites;
+    char *prefix;
+
+    save_overwrites = allow_overwrites;
+    allow_overwrites = 1;
+
+    init_interface_defaults();
+
+    get_conftoken(CONF_IDENT);
+    ifcur.name = stralloc(tokenval.v.s);
+    ifcur.seen = conf_line_num;
+
+    prefix = vstralloc( "INTERFACE:", ifcur.name, ":", NULL);
+    read_block(program_options, interface_var, server_keytab, ifcur.value,
+              prefix, "interface parameter expected", 1, &copy_interface);
+    amfree(prefix);
+    get_conftoken(CONF_NL);
+
+    save_interface();
+
+    allow_overwrites = save_overwrites;
+
+    return;
+}
+
+static void
+init_interface_defaults(void)
+{
+    conf_init_string(&ifcur.value[INTER_COMMENT] , "");
+    conf_init_int   (&ifcur.value[INTER_MAXUSAGE], 300);
+
+    ifcur.curusage = 0;
+}
+
+static void
+save_interface(void)
+{
+    interface_t *ip, *ip1;
+
+    ip = lookup_interface(ifcur.name);
+
+    if(ip != (interface_t *)0) {
+       conf_parserror("interface %s already defined on line %d", ip->name,
+                      ip->seen);
+       return;
+    }
+
+    ip = alloc(sizeof(interface_t));
+    *ip = ifcur;
+    /* add at end of list */
+    if(!interface_list) {
+       interface_list = ip;
+    } else {
+       ip1 = interface_list;
+       while (ip1->next != NULL) {
+           ip1 = ip1->next;
+       }
+       ip1->next = ip;
+    }
+}
+
+static void
+copy_interface(void)
+{
+/*
+    int i;
+    t_xxx *np;
+    keytab_t *kt;
+    
+    val_t val;
+*/
+    interface_t *ip;
+    int i;
+
+    ip = lookup_interface(tokenval.v.s);
+
+    if(ip == NULL) {
+       conf_parserror("interface parameter expected");
+       return;
+    }
+
+    for(i=0; i < INTER_INTER; i++) {
+       if(ip->value[i].seen) {
+           free_val_t(&ifcur.value[i]);
+           copy_val_t(&ifcur.value[i], &ip->value[i]);
+       }
+    }
+}
+
+static void
+get_comprate(
+    t_conf_var *np,
+    val_t *val)
+{
+    np = np;
+    get_conftoken(CONF_REAL);
+    val->v.rate[0] = tokenval.v.r;
+    val->v.rate[1] = tokenval.v.r;
+    val->seen = tokenval.seen;
+    if(tokenval.v.r < 0) {
+       conf_parserror("full compression rate must be >= 0");
+    }
+
+    get_conftoken(CONF_ANY);
+    switch(tok) {
+    case CONF_NL:
+       return;
+
+    case CONF_END:
+       return;
+
+    case CONF_COMMA:
+       break;
+
+    default:
+       unget_conftoken();
+    }
+
+    get_conftoken(CONF_REAL);
+    val->v.rate[1] = tokenval.v.r;
+    if(tokenval.v.r < 0) {
+       conf_parserror("incremental compression rate must be >= 0");
+    }
+}
+
+static void
+read_intrange(
+    t_conf_var *np,
+    val_t *val)
+{
+    np = np;
+    get_conftoken(CONF_INT);
+    val->v.intrange[0] = tokenval.v.i;
+    val->v.intrange[1] = tokenval.v.i;
+    val->seen = tokenval.seen;
+
+    get_conftoken(CONF_ANY);
+    switch(tok) {
+    case CONF_NL:
+       return;
+
+    case CONF_END:
+       return;
+
+    case CONF_COMMA:
+       break;
+
+    default:
+       unget_conftoken();
+    }
+
+    get_conftoken(CONF_INT);
+    val->v.intrange[1] = tokenval.v.i;
+}
+
+static void
+get_compress(
+    t_conf_var *np,
+    val_t *val)
+{
+    int serv, clie, none, fast, best, custom;
+    int done;
+    comp_t comp;
+
+    np = np;
+    ckseen(&val->seen);
+
+    serv = clie = none = fast = best = custom  = 0;
+
+    done = 0;
+    do {
+       get_conftoken(CONF_ANY);
+       switch(tok) {
+       case CONF_NONE:   none = 1; break;
+       case CONF_FAST:   fast = 1; break;
+       case CONF_BEST:   best = 1; break;
+       case CONF_CLIENT: clie = 1; break;
+       case CONF_SERVER: serv = 1; break;
+       case CONF_CUSTOM: custom=1; break;
+       case CONF_NL:     done = 1; break;
+       case CONF_END:    done = 1; break;
+       default:
+           done = 1;
+           serv = clie = 1; /* force an error */
+       }
+    } while(!done);
+
+    if(serv + clie == 0) clie = 1;     /* default to client */
+    if(none + fast + best + custom  == 0) fast = 1; /* default to fast */
+
+    comp = -1;
+
+    if(!serv && clie) {
+       if(none && !fast && !best && !custom) comp = COMP_NONE;
+       if(!none && fast && !best && !custom) comp = COMP_FAST;
+       if(!none && !fast && best && !custom) comp = COMP_BEST;
+       if(!none && !fast && !best && custom) comp = COMP_CUST;
+    }
+
+    if(serv && !clie) {
+       if(none && !fast && !best && !custom) comp = COMP_NONE;
+       if(!none && fast && !best && !custom) comp = COMP_SERVER_FAST;
+       if(!none && !fast && best && !custom) comp = COMP_SERVER_BEST;
+       if(!none && !fast && !best && custom) comp = COMP_SERVER_CUST;
+    }
+
+    if((int)comp == -1) {
+       conf_parserror("NONE, CLIENT FAST, CLIENT BEST, CLIENT CUSTOM, SERVER FAST, SERVER BEST or SERVER CUSTOM expected");
+       comp = COMP_NONE;
+    }
+
+    val->v.i = (int)comp;
+}
+
+static void
+get_encrypt(
+    t_conf_var *np,
+    val_t *val)
+{
+   encrypt_t encrypt;
+
+   np = np;
+   ckseen(&val->seen);
+
+   get_conftoken(CONF_ANY);
+   switch(tok) {
+   case CONF_NONE:  
+     encrypt = ENCRYPT_NONE; 
+     break;
+
+   case CONF_CLIENT:  
+     encrypt = ENCRYPT_CUST;
+     break;
+
+   case CONF_SERVER: 
+     encrypt = ENCRYPT_SERV_CUST;
+     break;
+
+   default:
+     conf_parserror("NONE, CLIENT or SERVER expected");
+     encrypt = ENCRYPT_NONE;
+     break;
+   }
+
+   val->v.i = (int)encrypt;
+}
+
+static void
+get_holding(
+    t_conf_var *np,
+    val_t *val)
+{
+   dump_holdingdisk_t holding;
+
+   np = np;
+   ckseen(&val->seen);
+
+   get_conftoken(CONF_ANY);
+   switch(tok) {
+   case CONF_NEVER:  
+     holding = HOLD_NEVER; 
+     break;
+
+   case CONF_AUTO:  
+     holding = HOLD_AUTO;
+     break;
+
+   case CONF_REQUIRED: 
+     holding = HOLD_REQUIRED;
+     break;
+
+   default: /* can be a BOOLEAN */
+     unget_conftoken();
+     holding =  (dump_holdingdisk_t)get_bool();
+     if (holding == 0)
+       holding = HOLD_NEVER;
+     else if (holding == 1 || holding == 2)
+       holding = HOLD_AUTO;
+     else
+       conf_parserror("NEVER, AUTO or REQUIRED expected");
+     break;
+   }
+
+   val->v.i = (int)holding;
+}
+
+static void
+get_taperalgo(
+    t_conf_var *np,
+    val_t *val)
+{
+    np = np;
+    ckseen(&val->seen);
+
+    get_conftoken(CONF_ANY);
+    switch(tok) {
+    case CONF_FIRST:      val->v.i = ALGO_FIRST;      break;
+    case CONF_FIRSTFIT:   val->v.i = ALGO_FIRSTFIT;   break;
+    case CONF_LARGEST:    val->v.i = ALGO_LARGEST;    break;
+    case CONF_LARGESTFIT: val->v.i = ALGO_LARGESTFIT; break;
+    case CONF_SMALLEST:   val->v.i = ALGO_SMALLEST;   break;
+    case CONF_LAST:       val->v.i = ALGO_LAST;       break;
+    default:
+       conf_parserror("FIRST, FIRSTFIT, LARGEST, LARGESTFIT, SMALLEST or LAST expected");
+    }
+}
+
+static void
+get_priority(
+    t_conf_var *np,
+    val_t *val)
+{
+    int pri;
+
+    np = np;
+    ckseen(&val->seen);
+
+    get_conftoken(CONF_ANY);
+    switch(tok) {
+    case CONF_LOW: pri = 0; break;
+    case CONF_MEDIUM: pri = 1; break;
+    case CONF_HIGH: pri = 2; break;
+    case CONF_INT: pri = tokenval.v.i; break;
+    default:
+       conf_parserror("LOW, MEDIUM, HIGH or integer expected");
+       pri = 0;
+    }
+    val->v.i = pri;
+}
+
+static void
+get_strategy(
+    t_conf_var *np,
+    val_t *val)
+{
+    int strat;
+
+    np = np;
+    ckseen(&val->seen);
+
+    get_conftoken(CONF_ANY);
+    switch(tok) {
+    case CONF_SKIP:
+       strat = DS_SKIP;
+       break;
+    case CONF_STANDARD:
+       strat = DS_STANDARD;
+       break;
+    case CONF_NOFULL:
+       strat = DS_NOFULL;
+       break;
+    case CONF_NOINC:
+       strat = DS_NOINC;
+       break;
+    case CONF_HANOI:
+       strat = DS_HANOI;
+       break;
+    case CONF_INCRONLY:
+       strat = DS_INCRONLY;
+       break;
+    default:
+       conf_parserror("STANDARD or NOFULL expected");
+       strat = DS_STANDARD;
+    }
+    val->v.i = strat;
+}
+
+static void
+get_estimate(
+    t_conf_var *np,
+    val_t *val)
+{
+    int estime;
+
+    np = np;
+    ckseen(&val->seen);
+
+    get_conftoken(CONF_ANY);
+    switch(tok) {
+    case CONF_CLIENT:
+       estime = ES_CLIENT;
+       break;
+    case CONF_SERVER:
+       estime = ES_SERVER;
+       break;
+    case CONF_CALCSIZE:
+       estime = ES_CALCSIZE;
+       break;
+    default:
+       conf_parserror("CLIENT, SERVER or CALCSIZE expected");
+       estime = ES_CLIENT;
+    }
+    val->v.i = estime;
+}
+
+static void
+get_exclude(
+    t_conf_var *np,
+    val_t *val)
+{
+    int file, got_one = 0;
+    sl_t *exclude;
+    int optional = 0;
+
+    np = np;
+    get_conftoken(CONF_ANY);
+    if(tok == CONF_LIST) {
+       file = 0;
+       get_conftoken(CONF_ANY);
+       exclude = val->v.exinclude.sl_list;
+    }
+    else {
+       file = 1;
+       if(tok == CONF_EFILE) get_conftoken(CONF_ANY);
+       exclude = val->v.exinclude.sl_file;
+    }
+    ckseen(&val->seen);
+
+    if(tok == CONF_OPTIONAL) {
+       get_conftoken(CONF_ANY);
+       optional = 1;
+    }
+
+    if(tok == CONF_APPEND) {
+       get_conftoken(CONF_ANY);
+    }
+    else {
+       free_sl(exclude);
+       exclude = NULL;
+    }
+
+    while(tok == CONF_STRING) {
+       exclude = append_sl(exclude, tokenval.v.s);
+       got_one = 1;
+       get_conftoken(CONF_ANY);
+    }
+    unget_conftoken();
+
+    if(got_one == 0) { free_sl(exclude); exclude = NULL; }
+
+    if (file == 0)
+       val->v.exinclude.sl_list = exclude;
+    else
+       val->v.exinclude.sl_file = exclude;
+    val->v.exinclude.optional = optional;
+}
+
+/*
+static void get_include(np, val)
+    t_conf_var *np;
+    val_t *val;
+{
+    int list, got_one = 0;
+    sl_t *include;
+    int optional = 0;
+    int append = 0;
+
+    get_conftoken(CONF_ANY);
+    if(tok == CONF_LIST) {
+       list = 1;
+       include = dpcur.value[DUMPTYPE_INCLUDE_LIST].v.sl;
+       ckseen(&dpcur.value[DUMPTYPE_INCLUDE_LIST].seen);
+       get_conftoken(CONF_ANY);
+    }
+    else {
+       list = 0;
+       include = dpcur.value[DUMPTYPE_INCLUDE_FILE].v.sl;
+       ckseen(&dpcur.value[DUMPTYPE_INCLUDE_FILE].seen);
+       if(tok == CONF_EFILE) get_conftoken(CONF_ANY);
+    }
+
+    if(tok == CONF_OPTIONAL) {
+       get_conftoken(CONF_ANY);
+       optional = 1;
+    }
+
+    if(tok == CONF_APPEND) {
+       get_conftoken(CONF_ANY);
+       append = 1;
+    }
+    else {
+       free_sl(include);
+       include = NULL;
+       append = 0;
+    }
+
+    while(tok == CONF_STRING) {
+       include = append_sl(include, tokenval.v.s);
+       got_one = 1;
+       get_conftoken(CONF_ANY);
+    }
+    unget_conftoken();
+
+    if(got_one == 0) { free_sl(include); include = NULL; }
+
+    if(list == 0)
+       dpcur.value[DUMPTYPE_INCLUDE_FILE].v.sl = include;
+    else {
+       dpcur.value[DUMPTYPE_INCLUDE_LIST].v.sl = include;
+       if(!append || optional)
+           dpcur.value[DUMPTYPE_INCLUDE_OPTIONAL].v.i = optional;
+    }
+}
+*/
+
+/* ------------------------ */
+
+int
+ColumnDataCount(void )
+{
+    return (int)(SIZEOF(ColumnData) / SIZEOF(ColumnData[0]));
+}
+
+/* conversion from string to table index
+ */
+int
+StringToColumn(
+    char *s)
+{
+    int cn;
+
+    for (cn=0; ColumnData[cn].Name != NULL; cn++) {
+       if (strcasecmp(s, ColumnData[cn].Name) == 0) {
+           break;
+       }
+    }
+    return cn;
+}
+
+char
+LastChar(
+    char *s)
+{
+    return s[strlen(s)-1];
+}
+
+int
+SetColumDataFromString(
+    ColumnInfo* ci,
+    char *s,
+    char **errstr)
+{
+#ifdef TEST
+    char *myname= "SetColumDataFromString";
+#endif
+    ci = ci;
+
+    /* Convert from a Columspec string to our internal format
+     * of columspec. The purpose is to provide this string
+     * as configuration paramter in the amanda.conf file or
+     * (maybe) as environment variable.
+     * 
+     * This text should go as comment into the sample amanda.conf
+     *
+     * The format for such a ColumnSpec string s is a ',' seperated
+     * list of triples. Each triple consists of
+     *   -the name of the column (as in ColumnData.Name)
+     *   -prefix before the column
+     *   -the width of the column
+     *       if set to -1 it will be recalculated
+     *  to the maximum length of a line to print.
+     * Example:
+     *         "Disk=1:17,HostName=1:10,OutKB=1:7"
+     * or
+     *         "Disk=1:-1,HostName=1:10,OutKB=1:7"
+     * 
+     * You need only specify those colums that should be changed from
+     * the default. If nothing is specified in the configfile, the
+     * above compiled in values will be in effect, resulting in an
+     * output as it was all the time.
+     *                                                 ElB, 1999-02-24.
+     */
+
+    while (s && *s) {
+       int Space, Width;
+       int cn;
+       char *eon= strchr(s, '=');
+
+       if (eon == NULL) {
+           *errstr = stralloc2("invalid columnspec: ", s);
+#ifdef TEST
+           fprintf(stderr, "%s: %s\n", myname, *errstr);
+#endif
+           return -1;
+       }
+       *eon= '\0';
+       cn=StringToColumn(s);
+       if (ColumnData[cn].Name == NULL) {
+           *errstr = stralloc2("invalid column name: ", s);
+#ifdef TEST
+           fprintf(stderr, "%s: %s\n", myname, *errstr);
+#endif
+           return -1;
+       }
+       if (sscanf(eon+1, "%d:%d", &Space, &Width) != 2) {
+           *errstr = stralloc2("invalid format: ", eon + 1);
+#ifdef TEST
+           fprintf(stderr, "%s: %s\n", myname, *errstr);
+#endif
+           return -1;
+       }
+       ColumnData[cn].Width= Width;
+       ColumnData[cn].PrefixSpace = Space;
+       if (LastChar(ColumnData[cn].Format) == 's') {
+           if (Width < 0)
+               ColumnData[cn].MaxWidth= 1;
+           else
+               if (Width > ColumnData[cn].Precision)
+                   ColumnData[cn].Precision= Width;
+       }
+       else if (Width < ColumnData[cn].Precision)
+           ColumnData[cn].Precision = Width;
+       s= strchr(eon+1, ',');
+       if (s != NULL)
+           s++;
+    }
+    return 0;
+}
+
+
+long int
+getconf_unit_divisor(void)
+{
+    return unit_divisor;
+}
+
+/* ------------------------ */
+
+
+void
+dump_configuration(
+    char *filename)
+{
+    tapetype_t *tp;
+    dumptype_t *dp;
+    interface_t *ip;
+    holdingdisk_t *hp;
+    int i;
+    t_conf_var *np;
+    keytab_t *kt;
+    char *prefix;
+    char kt_prefix[100];
+
+    printf("AMANDA CONFIGURATION FROM FILE \"%s\":\n\n", filename);
+
+    for(np=server_var; np->token != CONF_UNKNOWN; np++) {
+       for(kt = server_keytab; kt->token != CONF_UNKNOWN; kt++) 
+           if (np->token == kt->token) break;
+
+       if(kt->token == CONF_UNKNOWN)
+           error("server bad token");
+
+       if (kt->token != CONF_IDENT)
+           snprintf(kt_prefix, 100, "%-21s ", kt->keyword);
+           printf("%s\n",
+                  conf_print(&conf_data[np->parm], 1, kt_prefix));
+    }
+
+    for(hp = holdingdisks; hp != NULL; hp = hp->next) {
+       printf("\nHOLDINGDISK %s {\n", hp->name);
+       for(i=0; i < HOLDING_HOLDING; i++) {
+           for(np=holding_var; np->token != CONF_UNKNOWN; np++) {
+               if(np->parm == i)
+                       break;
+           }
+           if(np->token == CONF_UNKNOWN)
+               error("holding bad value");
+
+           for(kt = server_keytab; kt->token != CONF_UNKNOWN; kt++) {
+               if(kt->token == np->token)
+                   break;
+           }
+           if(kt->token == CONF_UNKNOWN)
+               error("holding bad token");
+
+           snprintf(kt_prefix, 100, "      %-9s ", kt->keyword);
+           printf("%s\n", conf_print(&hp->value[i], 1, kt_prefix));
+       }
+       printf("}\n");
+    }
+
+    for(tp = tapelist; tp != NULL; tp = tp->next) {
+       printf("\nDEFINE TAPETYPE %s {\n", tp->name);
+       for(i=0; i < TAPETYPE_TAPETYPE; i++) {
+           for(np=tapetype_var; np->token != CONF_UNKNOWN; np++)
+               if(np->parm == i) break;
+           if(np->token == CONF_UNKNOWN)
+               error("tapetype bad value");
+
+           for(kt = server_keytab; kt->token != CONF_UNKNOWN; kt++)
+               if(kt->token == np->token) break;
+           if(kt->token == CONF_UNKNOWN)
+               error("tapetype bad token");
+
+           snprintf(kt_prefix, 100, "      %-9s ", kt->keyword);
+           printf("%s\n", conf_print(&tp->value[i], 1, kt_prefix));
+       }
+       printf("}\n");
+    }
+
+    for(dp = dumplist; dp != NULL; dp = dp->next) {
+       if (strncmp(dp->name, "custom(", 7) != 0) {
+           if(dp->seen == -1)
+               prefix = "#";
+           else
+               prefix = "";
+           printf("\n%sDEFINE DUMPTYPE %s {\n", prefix, dp->name);
+           for(i=0; i < DUMPTYPE_DUMPTYPE; i++) {
+               for(np=dumptype_var; np->token != CONF_UNKNOWN; np++)
+                   if(np->parm == i) break;
+               if(np->token == CONF_UNKNOWN)
+                   error("dumptype bad value");
+
+               for(kt = server_keytab; kt->token != CONF_UNKNOWN; kt++)
+                   if(kt->token == np->token) break;
+               if(kt->token == CONF_UNKNOWN)
+                   error("dumptype bad token");
+
+               snprintf(kt_prefix, 100, "%s      %-19s ", prefix,kt->keyword);
+               printf("%s\n", conf_print(&dp->value[i], 1, kt_prefix));
+           }
+           printf("%s}\n", prefix);
+       }
+    }
+
+    for(ip = interface_list; ip != NULL; ip = ip->next) {
+       if(strcmp(ip->name,"default") == 0)
+           prefix = "#";
+       else
+           prefix = "";
+       printf("\n%sDEFINE INTERFACE %s {\n", prefix, ip->name);
+       for(i=0; i < INTER_INTER; i++) {
+           for(np=interface_var; np->token != CONF_UNKNOWN; np++)
+               if(np->parm == i) break;
+           if(np->token == CONF_UNKNOWN)
+               error("interface bad value");
+
+           for(kt = server_keytab; kt->token != CONF_UNKNOWN; kt++)
+               if(kt->token == np->token) break;
+           if(kt->token == CONF_UNKNOWN)
+               error("interface bad token");
+
+           snprintf(kt_prefix, 100, "%s      %-19s ", prefix, kt->keyword);
+           printf("%s\n", conf_print(&ip->value[i], 1, kt_prefix));
+       }
+       printf("%s}\n",prefix);
+    }
+
+}
+
+char *
+generic_get_security_conf(
+       char *string,
+       void *arg)
+{
+       arg = arg;
+       if(!string || !*string)
+               return(NULL);
+
+       if(strcmp(string, "krb5principal")==0) {
+               return(getconf_str(CNF_KRB5PRINCIPAL));
+       } else if(strcmp(string, "krb5keytab")==0) {
+               return(getconf_str(CNF_KRB5KEYTAB));
+       }
+       return(NULL);
+}
+
+char *
+get_token_name(
+    tok_t token)
+{
+    keytab_t *kt;
+
+    if (my_keytab == NULL) {
+       error("my_keytab == NULL");
+       /*NOTREACHED*/
+    }
+
+    for(kt = my_keytab; kt->token != CONF_UNKNOWN; kt++)
+       if(kt->token == token) break;
+
+    if(kt->token == CONF_UNKNOWN)
+       return("");
+    return(kt->keyword);
+}
+
+void
+parse_conf(
+    int parse_argc,
+    char **parse_argv,
+    int *new_argc,
+    char ***new_argv)
+{
+    int i;
+    char **my_argv;
+    char *myarg, *value;
+    command_option_t *program_option;
+
+    program_options = alloc((size_t)(parse_argc+1) * SIZEOF(*program_options));
+    program_options_size = parse_argc+1;
+    program_option = program_options;
+    program_option->name = NULL;
+
+    my_argv = alloc((size_t)parse_argc * SIZEOF(char *));
+    *new_argv = my_argv;
+    *new_argc = 0;
+    i=0;
+    while(i<parse_argc) {
+       if(strncmp(parse_argv[i],"-o",2) == 0) {
+           if(strlen(parse_argv[i]) > 2)
+               myarg = &parse_argv[i][2];
+           else {
+               i++;
+               if(i >= parse_argc)
+                   error("expect something after -o");
+               myarg = parse_argv[i];
+           }
+           value = index(myarg,'=');
+           if (value == NULL) {
+               conf_parserror("Must specify a value for %s.\n", myarg);
+           } else {
+               *value = '\0';
+               value++;
+               program_option->used = 0;
+               program_option->name = stralloc(myarg);
+               program_option->value = stralloc(value);
+               program_option++;
+               program_option->name = NULL;
+           }
+       }
+       else {
+           my_argv[*new_argc] = stralloc(parse_argv[i]);
+           *new_argc += 1;
+       }
+       i++;
+    }
+}
+
+char **
+get_config_options(
+    int first)
+{
+    char             **config_options;
+    char            **config_option;
+    command_option_t  *command_options;
+
+    config_options = alloc((first+program_options_size+1)*SIZEOF(char *));
+    for(command_options = program_options,
+        config_option = config_options + first;
+       command_options->name != NULL; command_options++) {
+       *config_option = vstralloc("-o", command_options->name, "=",
+                                  command_options->value, NULL);
+       config_option++;
+    }
+    *config_option = NULL;
+    return(config_options);
+}
+
+void
+report_bad_conf_arg(void)
+{
+    command_option_t *command_option;
+
+    for(command_option = program_options; command_option->name != NULL;
+                                                       command_option++) {
+       if(command_option->used == 0) {
+           fprintf(stderr,"argument -o%s=%s not used\n",
+                   command_option->name, command_option->value);
+       }
+    }
+}
+
+void
+free_server_config(void)
+{
+    holdingdisk_t    *hp, *hpnext;
+    dumptype_t       *dp, *dpnext;
+    tapetype_t       *tp, *tpnext;
+    interface_t      *ip, *ipnext;
+    command_option_t *server_option;
+    int               i;
+
+    for(hp=holdingdisks; hp != NULL; hp = hpnext) {
+       amfree(hp->name);
+       for(i=0; i<HOLDING_HOLDING-1; i++) {
+          free_val_t(&hp->value[i]);
+       }
+       hpnext = hp->next;
+       amfree(hp);
+    }
+
+    for(dp=dumplist; dp != NULL; dp = dpnext) {
+       amfree(dp->name);
+       for(i=0; i<DUMPTYPE_DUMPTYPE-1; i++) {
+          free_val_t(&dp->value[i]);
+       }
+       dpnext = dp->next;
+       amfree(dp);
+    }
+
+    for(tp=tapelist; tp != NULL; tp = tpnext) {
+       amfree(tp->name);
+       for(i=0; i<TAPETYPE_TAPETYPE-1; i++) {
+          free_val_t(&tp->value[i]);
+       }
+       tpnext = tp->next;
+       amfree(tp);
+    }
+
+    for(ip=interface_list; ip != NULL; ip = ipnext) {
+       amfree(ip->name);
+       for(i=0; i<INTER_INTER-1; i++) {
+          free_val_t(&ip->value[i]);
+       }
+       ipnext = ip->next;
+       amfree(ip);
+    }
+
+    if(program_options) {
+       for(server_option = program_options; server_option->name != NULL;
+                                               server_option++) {
+           amfree(server_option->name);
+           amfree(server_option->value);
+        }
+       amfree(program_options);
+    }
+
+    for(i=0; i<CNF_CNF-1; i++)
+       free_val_t(&conf_data[i]);
+}
+
+
+
+/* configuration parameters */
+static char *cln_config_dir = NULL;
+
+/* predeclare local functions */
+
+static void read_client_conffile_recursively(char *filename);
+static int read_client_confline(void);
+
+static int first_file = 1;
+
+/*
+** ------------------------
+**  External entry points
+** ------------------------
+*/
+
+/* return  0 on success        */
+/* return  1 on error          */
+/* return -1 if file not found */
+
+int read_clientconf(
+    char *filename)
+{
+    my_keytab = server_keytab;
+    my_var = client_var;
+
+    if(first_file == 1) {
+       init_defaults();
+       first_file = 0;
+    } else {
+       allow_overwrites = 1;
+    }
+
+    /* We assume that conf_confname & conf are initialized to NULL above */
+    read_client_conffile_recursively(filename);
+
+    command_overwrite(program_options, client_var, client_keytab, conf_data,
+                     "");
+
+    debug_amandad    = getconf_int(CNF_DEBUG_AMANDAD);
+    debug_amidxtaped = getconf_int(CNF_DEBUG_AMIDXTAPED);
+    debug_amindexd   = getconf_int(CNF_DEBUG_AMINDEXD);
+    debug_amrecover  = getconf_int(CNF_DEBUG_AMRECOVER);
+    debug_auth       = getconf_int(CNF_DEBUG_AUTH);
+    debug_event      = getconf_int(CNF_DEBUG_EVENT);
+    debug_holding    = getconf_int(CNF_DEBUG_HOLDING);
+    debug_protocol   = getconf_int(CNF_DEBUG_PROTOCOL);
+    debug_planner    = getconf_int(CNF_DEBUG_PLANNER);
+    debug_driver     = getconf_int(CNF_DEBUG_DRIVER);
+    debug_dumper     = getconf_int(CNF_DEBUG_DUMPER);
+    debug_chunker    = getconf_int(CNF_DEBUG_CHUNKER);
+    debug_taper      = getconf_int(CNF_DEBUG_TAPER);
+    debug_selfcheck  = getconf_int(CNF_DEBUG_SELFCHECK);
+    debug_sendsize   = getconf_int(CNF_DEBUG_SENDSIZE);
+    debug_sendbackup = getconf_int(CNF_DEBUG_SENDBACKUP);
+
+    return got_parserror;
+}
+
+
+/*
+** ------------------------
+**  Internal routines
+** ------------------------
+*/
+
+
+static void
+read_client_conffile_recursively(
+    char *     filename)
+{
+    /* Save globals used in read_client_confline(), elsewhere. */
+    int  save_line_num  = conf_line_num;
+    FILE *save_conf     = conf_conf;
+    char *save_confname = conf_confname;
+    int        rc;
+
+    if (*filename == '/' || cln_config_dir == NULL) {
+       conf_confname = stralloc(filename);
+    } else {
+       conf_confname = stralloc2(cln_config_dir, filename);
+    }
+
+    if((conf_conf = fopen(conf_confname, "r")) == NULL) {
+       dbprintf(("Could not open conf file \"%s\": %s\n", conf_confname,
+                 strerror(errno)));
+       amfree(conf_confname);
+       got_parserror = -1;
+       return;
+    }
+    dbprintf(("Reading conf file \"%s\".\n", conf_confname));
+
+    conf_line_num = 0;
+
+    /* read_client_confline() can invoke us recursively via "includefile" */
+    do {
+       rc = read_client_confline();
+    } while (rc != 0);
+    afclose(conf_conf);
+
+    amfree(conf_confname);
+
+    /* Restore globals */
+    conf_line_num = save_line_num;
+    conf_conf     = save_conf;
+    conf_confname = save_confname;
+}
+
+
+/* ------------------------ */
+
+
+static int
+read_client_confline(void)
+{
+    t_conf_var *np;
+
+    keytable = client_keytab;
+
+    conf_line_num += 1;
+    get_conftoken(CONF_ANY);
+    switch(tok) {
+    case CONF_INCLUDEFILE:
+       {
+           char *fn;
+
+           get_conftoken(CONF_STRING);
+           fn = tokenval.v.s;
+           read_client_conffile_recursively(fn);
+       }
+       break;
+
+    case CONF_NL:      /* empty line */
+       break;
+
+    case CONF_END:     /* end of file */
+       return 0;
+
+    default:
+       {
+           for(np = client_var; np->token != CONF_UNKNOWN; np++)
+               if(np->token == tok) break;
+
+           if(np->token == CONF_UNKNOWN) {
+               conf_parserror("configuration keyword expected");
+           } else {
+               np->read_function(np, &conf_data[np->parm]);
+               if(np->validate)
+                   np->validate(np, &conf_data[np->parm]);
+           }
+       }
+    }
+    if(tok != CONF_NL)
+       get_conftoken(CONF_NL);
+    return 1;
+}
+
+
+char *
+generic_client_get_security_conf(
+    char *     string,
+    void *     arg)
+{
+       (void)arg;      /* Quiet unused parameter warning */
+
+       if(!string || !*string)
+               return(NULL);
+
+       if(strcmp(string, "conf")==0) {
+               return(getconf_str(CNF_CONF));
+       } else if(strcmp(string, "index_server")==0) {
+               return(getconf_str(CNF_INDEX_SERVER));
+       } else if(strcmp(string, "tape_server")==0) {
+               return(getconf_str(CNF_TAPE_SERVER));
+       } else if(strcmp(string, "tapedev")==0) {
+               return(getconf_str(CNF_TAPEDEV));
+       } else if(strcmp(string, "auth")==0) {
+               return(getconf_str(CNF_AUTH));
+       } else if(strcmp(string, "ssh_keys")==0) {
+               return(getconf_str(CNF_SSH_KEYS));
+       } else if(strcmp(string, "amandad_path")==0) {
+               return(getconf_str(CNF_AMANDAD_PATH));
+       } else if(strcmp(string, "client_username")==0) {
+               return(getconf_str(CNF_CLIENT_USERNAME));
+       } else if(strcmp(string, "gnutar_list_dir")==0) {
+               return(getconf_str(CNF_GNUTAR_LIST_DIR));
+       } else if(strcmp(string, "amandates")==0) {
+               return(getconf_str(CNF_AMANDATES));
+       } else if(strcmp(string, "krb5principal")==0) {
+               return(getconf_str(CNF_KRB5PRINCIPAL));
+       } else if(strcmp(string, "krb5keytab")==0) {
+               return(getconf_str(CNF_KRB5KEYTAB));
+       }
+       return(NULL);
+}
+
+
+/* return  0 on success             */
+/* return -1 if it is already there */
+/* return -2 if other failure       */
+int
+add_client_conf(
+    confparm_t parm,
+    char *value)
+{
+    t_conf_var *np;
+    keytab_t *kt;
+    command_option_t *command_option;
+    int nb_option;
+
+    for(np = client_var; np->token != CONF_UNKNOWN; np++)
+       if(np->parm == (int)parm) break;
+
+    if(np->token == CONF_UNKNOWN) return -2;
+
+    for(kt = client_keytab; kt->token != CONF_UNKNOWN; kt++)
+       if(kt->token == np->token) break;
+
+    if(kt->token == CONF_UNKNOWN) return -2;
+
+    /* Try to find it */
+    nb_option = 0;
+    for(command_option = program_options; command_option->name != NULL;
+                                                       command_option++) {
+       nb_option++;
+    }
+
+    /* Increase size of program_options if needed */
+    if(nb_option >= program_options_size-1) {
+       program_options_size *= 2;
+       program_options = realloc(program_options,
+                               program_options_size * SIZEOF(*program_options));
+       if (program_options == NULL) {
+           error("Can't realloc program_options: %s\n", strerror(errno));
+           /*NOTREACHED*/
+       }
+       for(command_option = program_options; command_option->name != NULL;
+                                                       command_option++) {
+       }
+    }
+
+    /* add it */
+    command_option->used = 0;
+    command_option->name = stralloc(kt->keyword);
+    command_option->value = stralloc(value);
+    command_option++;
+    command_option->name = NULL;
+    return 0;
+}
+
+/*
+static t_conf_var *
+get_np(
+    t_conf_var *get_var,
+    int        parm)
+{
+    t_conf_var *np;
+
+    for(np = get_var; np->token != CONF_UNKNOWN; np++) {
+       if(np->parm == parm)
+           break;
+    }
+
+    if(np->token == CONF_UNKNOWN) {
+       error("error [unknown get_np parm: %d]", parm);
+       NOTREACHED
+    }
+    return np;
+}
+*/
+
+static time_t
+get_time(void)
+{
+    time_t hhmm;
+
+    get_conftoken(CONF_ANY);
+    switch(tok) {
+    case CONF_INT:
+#if SIZEOF_TIME_T < SIZEOF_INT
+       if ((off_t)tokenval.v.i >= (off_t)TIME_MAX)
+           conf_parserror("value too large");
+#endif
+       hhmm = (time_t)tokenval.v.i;
+       break;
+
+    case CONF_LONG:
+#if SIZEOF_TIME_T < SIZEOF_LONG
+       if ((off_t)tokenval.v.l >= (off_t)TIME_MAX)
+           conf_parserror("value too large");
+#endif
+       hhmm = (time_t)tokenval.v.l;
+       break;
+
+    case CONF_SIZE:
+#if SIZEOF_TIME_T < SIZEOF_SSIZE_T
+       if ((off_t)tokenval.v.size >= (off_t)TIME_MAX)
+           conf_parserror("value too large");
+#endif
+       hhmm = (time_t)tokenval.v.size;
+       break;
+
+    case CONF_AM64:
+#if SIZEOF_TIME_T < SIZEOF_LONG_LONG
+       if ((off_t)tokenval.v.am64 >= (off_t)TIME_MAX)
+           conf_parserror("value too large");
+#endif
+       hhmm = (time_t)tokenval.v.am64;
+       break;
+
+    case CONF_AMINFINITY:
+       hhmm = TIME_MAX;
+       break;
+
+    default:
+       conf_parserror("a time is expected");
+       hhmm = 0;
+       break;
+    }
+    return hhmm;
+}
+
+keytab_t numb_keytable[] = {
+    { "B", CONF_MULT1 },
+    { "BPS", CONF_MULT1 },
+    { "BYTE", CONF_MULT1 },
+    { "BYTES", CONF_MULT1 },
+    { "DAY", CONF_MULT1 },
+    { "DAYS", CONF_MULT1 },
+    { "INF", CONF_AMINFINITY },
+    { "K", CONF_MULT1K },
+    { "KB", CONF_MULT1K },
+    { "KBPS", CONF_MULT1K },
+    { "KBYTE", CONF_MULT1K },
+    { "KBYTES", CONF_MULT1K },
+    { "KILOBYTE", CONF_MULT1K },
+    { "KILOBYTES", CONF_MULT1K },
+    { "KPS", CONF_MULT1K },
+    { "M", CONF_MULT1M },
+    { "MB", CONF_MULT1M },
+    { "MBPS", CONF_MULT1M },
+    { "MBYTE", CONF_MULT1M },
+    { "MBYTES", CONF_MULT1M },
+    { "MEG", CONF_MULT1M },
+    { "MEGABYTE", CONF_MULT1M },
+    { "MEGABYTES", CONF_MULT1M },
+    { "G", CONF_MULT1G },
+    { "GB", CONF_MULT1G },
+    { "GBPS", CONF_MULT1G },
+    { "GBYTE", CONF_MULT1G },
+    { "GBYTES", CONF_MULT1G },
+    { "GIG", CONF_MULT1G },
+    { "GIGABYTE", CONF_MULT1G },
+    { "GIGABYTES", CONF_MULT1G },
+    { "MPS", CONF_MULT1M },
+    { "TAPE", CONF_MULT1 },
+    { "TAPES", CONF_MULT1 },
+    { "WEEK", CONF_MULT7 },
+    { "WEEKS", CONF_MULT7 },
+    { NULL, CONF_IDENT }
+};
+
+static int
+get_int(void)
+{
+    int val;
+    keytab_t *save_kt;
+
+    save_kt = keytable;
+    keytable = numb_keytable;
+
+    get_conftoken(CONF_ANY);
+    switch(tok) {
+    case CONF_INT:
+       val = tokenval.v.i;
+       break;
+
+    case CONF_LONG:
+#if SIZEOF_INT < SIZEOF_LONG
+       if ((off_t)tokenval.v.l > (off_t)INT_MAX)
+           conf_parserror("value too large");
+       if ((off_t)tokenval.v.l < (off_t)INT_MIN)
+           conf_parserror("value too small");
+#endif
+       val = (int)tokenval.v.l;
+       break;
+
+    case CONF_SIZE:
+#if SIZEOF_INT < SIZEOF_SSIZE_T
+       if ((off_t)tokenval.v.size > (off_t)INT_MAX)
+           conf_parserror("value too large");
+       if ((off_t)tokenval.v.size < (off_t)INT_MIN)
+           conf_parserror("value too small");
+#endif
+       val = (int)tokenval.v.size;
+       break;
+
+    case CONF_AM64:
+#if SIZEOF_INT < SIZEOF_LONG_LONG
+       if (tokenval.v.am64 > (off_t)INT_MAX)
+           conf_parserror("value too large");
+       if (tokenval.v.am64 < (off_t)INT_MIN)
+           conf_parserror("value too small");
+#endif
+       val = (int)tokenval.v.am64;
+       break;
+
+    case CONF_AMINFINITY:
+       val = INT_MAX;
+       break;
+
+    default:
+       conf_parserror("an integer is expected");
+       val = 0;
+       break;
+    }
+
+    /* get multiplier, if any */
+    get_conftoken(CONF_ANY);
+    switch(tok) {
+    case CONF_NL:                      /* multiply by one */
+    case CONF_END:
+    case CONF_MULT1:
+    case CONF_MULT1K:
+       break;
+
+    case CONF_MULT7:
+       if (val > (INT_MAX / 7))
+           conf_parserror("value too large");
+       if (val < (INT_MIN / 7))
+           conf_parserror("value too small");
+       val *= 7;
+       break;
+
+    case CONF_MULT1M:
+       if (val > (INT_MAX / 1024))
+           conf_parserror("value too large");
+       if (val < (INT_MIN / 1024))
+           conf_parserror("value too small");
+       val *= 1024;
+       break;
+
+    case CONF_MULT1G:
+       if (val > (INT_MAX / (1024 * 1024)))
+           conf_parserror("value too large");
+       if (val < (INT_MIN / (1024 * 1024)))
+           conf_parserror("value too small");
+       val *= 1024 * 1024;
+       break;
+
+    default:   /* it was not a multiplier */
+       unget_conftoken();
+       break;
+    }
+
+    keytable = save_kt;
+    return val;
+}
+
+/*
+static long
+get_long(void)
+{
+    long val;
+    keytab_t *save_kt;
+
+    save_kt = keytable;
+    keytable = numb_keytable;
+
+    get_conftoken(CONF_ANY);
+
+    switch(tok) {
+    case CONF_LONG:
+       val = tokenval.v.l;
+       break;
+
+    case CONF_INT:
+#if SIZEOF_LONG < SIZEOF_INT
+       if ((off_t)tokenval.v.i > (off_t)LONG_MAX)
+           conf_parserror("value too large");
+       if ((off_t)tokenval.v.i < (off_t)LONG_MIN)
+           conf_parserror("value too small");
+#endif
+       val = (long)tokenval.v.i;
+       break;
+
+    case CONF_SIZE:
+#if SIZEOF_LONG < SIZEOF_SSIZE_T
+       if ((off_t)tokenval.v.size > (off_t)LONG_MAX)
+           conf_parserror("value too large");
+       if ((off_t)tokenval.v.size < (off_t)LONG_MIN)
+           conf_parserror("value too small");
+#endif
+       val = (long)tokenval.v.size;
+       break;
+
+    case CONF_AM64:
+#if SIZEOF_LONG < SIZEOF_LONG_LONG
+       if (tokenval.v.am64 > (off_t)LONG_MAX)
+           conf_parserror("value too large");
+       if (tokenval.v.am64 < (off_t)LONG_MIN)
+           conf_parserror("value too small");
+#endif
+       val = (long)tokenval.v.am64;
+       break;
+
+    case CONF_AMINFINITY:
+       val = (long)LONG_MAX;
+       break;
+
+    default:
+       conf_parserror("an integer is expected");
+       val = 0;
+       break;
+    }
+
+    get_conftoken(CONF_ANY);
+
+    switch(tok) {
+    case CONF_NL:
+    case CONF_MULT1:
+    case CONF_MULT1K:
+       break;
+
+    case CONF_MULT7:
+       if (val > (LONG_MAX / 7L))
+           conf_parserror("value too large");
+       if (val < (LONG_MIN / 7L))
+           conf_parserror("value too small");
+       val *= 7L;
+       break;
+
+    case CONF_MULT1M:
+       if (val > (LONG_MAX / 1024L))
+           conf_parserror("value too large");
+       if (val < (LONG_MIN / 1024L))
+           conf_parserror("value too small");
+       val *= 1024L;
+       break;
+
+    case CONF_MULT1G:
+       if (val > (LONG_MAX / (1024L * 1024L)))
+           conf_parserror("value too large");
+       if (val < (LONG_MIN / (1024L * 1024L)))
+           conf_parserror("value too small");
+       val *= 1024L * 1024L;
+       break;
+
+    default:
+       unget_conftoken();
+       break;
+    }
+
+    keytable = save_kt;
+    return val;
+}
+*/
+
+static ssize_t
+get_size(void)
+{
+    ssize_t val;
+    keytab_t *save_kt;
+
+    save_kt = keytable;
+    keytable = numb_keytable;
+
+    get_conftoken(CONF_ANY);
+
+    switch(tok) {
+    case CONF_SIZE:
+       val = tokenval.v.size;
+       break;
+
+    case CONF_INT:
+#if SIZEOF_SIZE_T < SIZEOF_INT
+       if ((off_t)tokenval.v.i > (off_t)SSIZE_MAX)
+           conf_parserror("value too large");
+       if ((off_t)tokenval.v.i < (off_t)SSIZE_MIN)
+           conf_parserror("value too small");
+#endif
+       val = (ssize_t)tokenval.v.i;
+       break;
+
+    case CONF_LONG:
+#if SIZEOF_SIZE_T < SIZEOF_LONG
+       if ((off_t)tokenval.v.l > (off_t)SSIZE_MAX)
+           conf_parserror("value too large");
+       if ((off_t)tokenval.v.l < (off_t)SSIZE_MIN)
+           conf_parserror("value too small");
+#endif
+       val = (ssize_t)tokenval.v.l;
+       break;
+
+    case CONF_AM64:
+#if SIZEOF_SIZE_T < SIZEOF_LONG_LONG
+       if (tokenval.v.am64 > (off_t)SSIZE_MAX)
+           conf_parserror("value too large");
+       if (tokenval.v.am64 < (off_t)SSIZE_MIN)
+           conf_parserror("value too small");
+#endif
+       val = (ssize_t)tokenval.v.am64;
+       break;
+
+    case CONF_AMINFINITY:
+       val = (ssize_t)SSIZE_MAX;
+       break;
+
+    default:
+       conf_parserror("an integer is expected");
+       val = 0;
+       break;
+    }
+
+    /* get multiplier, if any */
+    get_conftoken(CONF_ANY);
+
+    switch(tok) {
+    case CONF_NL:                      /* multiply by one */
+    case CONF_MULT1:
+    case CONF_MULT1K:
+       break;
+
+    case CONF_MULT7:
+       if (val > (ssize_t)(SSIZE_MAX / 7))
+           conf_parserror("value too large");
+       if (val < (ssize_t)(SSIZE_MIN / 7))
+           conf_parserror("value too small");
+       val *= (ssize_t)7;
+       break;
+
+    case CONF_MULT1M:
+       if (val > (ssize_t)(SSIZE_MAX / (ssize_t)1024))
+           conf_parserror("value too large");
+       if (val < (ssize_t)(SSIZE_MIN / (ssize_t)1024))
+           conf_parserror("value too small");
+       val *= (ssize_t)1024;
+       break;
+
+    case CONF_MULT1G:
+       if (val > (ssize_t)(SSIZE_MAX / (1024 * 1024)))
+           conf_parserror("value too large");
+       if (val < (ssize_t)(SSIZE_MIN / (1024 * 1024)))
+           conf_parserror("value too small");
+       val *= (ssize_t)(1024 * 1024);
+       break;
+
+    default:   /* it was not a multiplier */
+       unget_conftoken();
+       break;
+    }
+
+    keytable = save_kt;
+    return val;
+}
+
+static off_t
+get_am64_t(void)
+{
+    off_t val;
+    keytab_t *save_kt;
+
+    save_kt = keytable;
+    keytable = numb_keytable;
+
+    get_conftoken(CONF_ANY);
+
+    switch(tok) {
+    case CONF_INT:
+       val = (off_t)tokenval.v.i;
+       break;
+
+    case CONF_LONG:
+       val = (off_t)tokenval.v.l;
+       break;
+
+    case CONF_SIZE:
+       val = (off_t)tokenval.v.size;
+       break;
+
+    case CONF_AM64:
+       val = tokenval.v.am64;
+       break;
+
+    case CONF_AMINFINITY:
+       val = AM64_MAX;
+       break;
+
+    default:
+       conf_parserror("an integer is expected");
+       val = 0;
+       break;
+    }
+
+    /* get multiplier, if any */
+    get_conftoken(CONF_ANY);
+
+    switch(tok) {
+    case CONF_NL:                      /* multiply by one */
+    case CONF_MULT1:
+    case CONF_MULT1K:
+       break;
+
+    case CONF_MULT7:
+       if (val > AM64_MAX/7 || val < AM64_MIN/7)
+           conf_parserror("value too large");
+       val *= 7;
+       break;
+
+    case CONF_MULT1M:
+       if (val > AM64_MAX/1024 || val < AM64_MIN/1024)
+           conf_parserror("value too large");
+       val *= 1024;
+       break;
+
+    case CONF_MULT1G:
+       if (val > AM64_MAX/(1024*1024) || val < AM64_MIN/(1024*1024))
+           conf_parserror("value too large");
+       val *= 1024*1024;
+       break;
+
+    default:   /* it was not a multiplier */
+       unget_conftoken();
+       break;
+    }
+
+    keytable = save_kt;
+
+    return val;
+}
+
+keytab_t bool_keytable[] = {
+    { "Y", CONF_ATRUE },
+    { "YES", CONF_ATRUE },
+    { "T", CONF_ATRUE },
+    { "TRUE", CONF_ATRUE },
+    { "ON", CONF_ATRUE },
+    { "N", CONF_AFALSE },
+    { "NO", CONF_AFALSE },
+    { "F", CONF_AFALSE },
+    { "FALSE", CONF_AFALSE },
+    { "OFF", CONF_AFALSE },
+    { NULL, CONF_IDENT }
+};
+
+static int
+get_bool(void)
+{
+    int val;
+    keytab_t *save_kt;
+
+    save_kt = keytable;
+    keytable = bool_keytable;
+
+    get_conftoken(CONF_ANY);
+
+    switch(tok) {
+    case CONF_INT:
+       if (tokenval.v.i != 0)
+           val = 1;
+       else
+           val = 0;
+       break;
+
+    case CONF_LONG:
+       if (tokenval.v.l != 0L)
+           val = 1;
+       else
+           val = 0;
+       break;
+
+    case CONF_SIZE:
+       if (tokenval.v.size != (size_t)0)
+           val = 1;
+       else
+           val = 0;
+       break;
+
+    case CONF_AM64:
+       if (tokenval.v.am64 != (off_t)0)
+           val = 1;
+       else
+           val = 0;
+       break;
+
+    case CONF_ATRUE:
+       val = 1;
+       break;
+
+    case CONF_AFALSE:
+       val = 0;
+       break;
+
+    case CONF_NL:
+       unget_conftoken();
+       val = 2; /* no argument - most likely TRUE */
+       break;
+    default:
+       unget_conftoken();
+       val = 3; /* a bad argument - most likely TRUE */
+       conf_parserror("YES, NO, TRUE, FALSE, ON, OFF expected");
+       break;
+    }
+
+    keytable = save_kt;
+    return val;
+}
+
+void
+ckseen(
+    int *seen)
+{
+    if (*seen && !allow_overwrites && conf_line_num != -2) {
+       conf_parserror("duplicate parameter, prev def on line %d", *seen);
+    }
+    *seen = conf_line_num;
+}
+
+printf_arglist_function(void conf_parserror, const char *, format)
+{
+    va_list argp;
+
+    /* print error message */
+
+    if(conf_line)
+       fprintf(stderr, "argument \"%s\": ", conf_line);
+    else
+       fprintf(stderr, "\"%s\", line %d: ", conf_confname, conf_line_num);
+    arglist_start(argp, format);
+    vfprintf(stderr, format, argp);
+    arglist_end(argp);
+    fputc('\n', stderr);
+
+    got_parserror = 1;
+}
+
+tok_t
+lookup_keyword(
+    char *     str)
+{
+    keytab_t *kwp;
+
+    /* switch to binary search if performance warrants */
+
+    for(kwp = keytable; kwp->keyword != NULL; kwp++) {
+       if (strcasecmp(kwp->keyword, str) == 0) break;
+    }
+    return kwp->token;
+}
+
+char tkbuf[4096];
+
+/* push the last token back (can only unget ANY tokens) */
+static void
+unget_conftoken(void)
+{
+    token_pushed = 1;
+    pushed_tok = tok;
+    tok = CONF_UNKNOWN;
+    return;
+}
+
+static int
+conftoken_getc(void)
+{
+    if(conf_line == NULL)
+       return getc(conf_conf);
+    if(*conf_char == '\0')
+       return -1;
+    return(*conf_char++);
+}
+
+static int
+conftoken_ungetc(
+    int c)
+{
+    if(conf_line == NULL)
+       return ungetc(c, conf_conf);
+    else if(conf_char > conf_line) {
+       if(c == -1)
+           return c;
+       conf_char--;
+       if(*conf_char != c) {
+           error("*conf_char != c   : %c %c", *conf_char, c);
+           /* NOTREACHED */
+       }
+    } else {
+       error("conf_char == conf_line");
+       /* NOTREACHED */
+    }
+    return c;
+}
+
+static void
+get_conftoken(
+    tok_t      exp)
+{
+    int ch, d;
+    off_t am64;
+    char *buf;
+    char *tmps;
+    int token_overflow;
+    int inquote = 0;
+    int escape = 0;
+    int sign;
+
+    if (token_pushed) {
+       token_pushed = 0;
+       tok = pushed_tok;
+
+       /*
+       ** If it looked like a key word before then look it
+       ** up again in the current keyword table.
+       */
+       switch(tok) {
+       case CONF_LONG:    case CONF_AM64:    case CONF_SIZE:
+       case CONF_INT:     case CONF_REAL:    case CONF_STRING:
+       case CONF_LBRACE:  case CONF_RBRACE:  case CONF_COMMA:
+       case CONF_NL:      case CONF_END:     case CONF_UNKNOWN:
+       case CONF_TIME:
+           break;
+
+       default:
+           if (exp == CONF_IDENT)
+               tok = CONF_IDENT;
+           else
+               tok = lookup_keyword(tokenval.v.s);
+           break;
+       }
+    }
+    else {
+       ch = conftoken_getc();
+
+       while(ch != EOF && ch != '\n' && isspace(ch))
+           ch = conftoken_getc();
+       if (ch == '#') {        /* comment - eat everything but eol/eof */
+           while((ch = conftoken_getc()) != EOF && ch != '\n') {
+               (void)ch; /* Quiet empty loop complaints */     
+           }
+       }
+
+       if (isalpha(ch)) {              /* identifier */
+           buf = tkbuf;
+           token_overflow = 0;
+           do {
+               if (buf < tkbuf+sizeof(tkbuf)-1) {
+                   *buf++ = (char)ch;
+               } else {
+                   *buf = '\0';
+                   if (!token_overflow) {
+                       conf_parserror("token too long: %.20s...", tkbuf);
+                   }
+                   token_overflow = 1;
+               }
+               ch = conftoken_getc();
+           } while(isalnum(ch) || ch == '_' || ch == '-');
+
+           if (ch != EOF && conftoken_ungetc(ch) == EOF) {
+               if (ferror(conf_conf)) {
+                   conf_parserror("Pushback of '%c' failed: %s",
+                                  ch, strerror(ferror(conf_conf)));
+               } else {
+                   conf_parserror("Pushback of '%c' failed: EOF", ch);
+               }
+           }
+           *buf = '\0';
+
+           tokenval.v.s = tkbuf;
+
+           if (token_overflow) tok = CONF_UNKNOWN;
+           else if (exp == CONF_IDENT) tok = CONF_IDENT;
+           else tok = lookup_keyword(tokenval.v.s);
+       }
+       else if (isdigit(ch)) { /* integer */
+           sign = 1;
+
+negative_number: /* look for goto negative_number below sign is set there */
+           am64 = 0;
+           do {
+               am64 = am64 * 10 + (ch - '0');
+               ch = conftoken_getc();
+           } while (isdigit(ch));
+
+           if (ch != '.') {
+               if (exp == CONF_INT) {
+                   tok = CONF_INT;
+                   tokenval.v.i = sign * (int)am64;
+               } else if (exp == CONF_LONG) {
+                   tok = CONF_LONG;
+                   tokenval.v.l = (long)sign * (long)am64;
+               } else if (exp != CONF_REAL) {
+                   tok = CONF_AM64;
+                   tokenval.v.am64 = (off_t)sign * am64;
+               } else {
+                   /* automatically convert to real when expected */
+                   tokenval.v.r = (double)sign * (double)am64;
+                   tok = CONF_REAL;
+               }
+           } else {
+               /* got a real number, not an int */
+               tokenval.v.r = sign * (double) am64;
+               am64 = 0;
+               d = 1;
+               ch = conftoken_getc();
+               while (isdigit(ch)) {
+                   am64 = am64 * 10 + (ch - '0');
+                   d = d * 10;
+                   ch = conftoken_getc();
+               }
+               tokenval.v.r += sign * ((double)am64) / d;
+               tok = CONF_REAL;
+           }
+
+           if (ch != EOF &&  conftoken_ungetc(ch) == EOF) {
+               if (ferror(conf_conf)) {
+                   conf_parserror("Pushback of '%c' failed: %s",
+                                  ch, strerror(ferror(conf_conf)));
+               } else {
+                   conf_parserror("Pushback of '%c' failed: EOF", ch);
+               }
+           }
+       } else switch(ch) {
+       case '"':                       /* string */
+           buf = tkbuf;
+           token_overflow = 0;
+           inquote = 1;
+           *buf++ = (char)ch;
+           while (inquote && ((ch = conftoken_getc()) != EOF)) {
+               if (ch == '\n') {
+                   if (!escape)
+                       break;
+                   escape = 0;
+                   buf--; /* Consume escape in buffer */
+               } else if (ch == '\\') {
+                   escape = 1;
+               } else {
+                   if (ch == '"') {
+                       if (!escape)
+                           inquote = 0;
+                   }
+                   escape = 0;
+               }
+
+               if(buf >= &tkbuf[sizeof(tkbuf) - 1]) {
+                   if (!token_overflow) {
+                       conf_parserror("string too long: %.20s...", tkbuf);
+                   }
+                   token_overflow = 1;
+                   break;
+               }
+               *buf++ = (char)ch;
+           }
+           *buf = '\0';
+
+           /*
+            * A little manuver to leave a fully unquoted, unallocated  string
+            * in tokenval.v.s
+            */
+           tmps = unquote_string(tkbuf);
+           strncpy(tkbuf, tmps, sizeof(tkbuf));
+           amfree(tmps);
+           tokenval.v.s = tkbuf;
+
+           tok = (token_overflow) ? CONF_UNKNOWN :
+                       (exp == CONF_IDENT) ? CONF_IDENT : CONF_STRING;
+           break;
+
+       case '-':
+           ch = conftoken_getc();
+           if (isdigit(ch)) {
+               sign = -1;
+               goto negative_number;
+           }
+           else {
+               if (ch != EOF && conftoken_ungetc(ch) == EOF) {
+                   if (ferror(conf_conf)) {
+                       conf_parserror("Pushback of '%c' failed: %s",
+                                      ch, strerror(ferror(conf_conf)));
+                   } else {
+                       conf_parserror("Pushback of '%c' failed: EOF", ch);
+                   }
+               }
+               tok = CONF_UNKNOWN;
+           }
+           break;
+
+       case ',':
+           tok = CONF_COMMA;
+           break;
+
+       case '{':
+           tok = CONF_LBRACE;
+           break;
+
+       case '}':
+           tok = CONF_RBRACE;
+           break;
+
+       case '\n':
+           tok = CONF_NL;
+           break;
+
+       case EOF:
+           tok = CONF_END;
+           break;
+
+       default:
+           tok = CONF_UNKNOWN;
+           break;
+       }
+    }
+
+    if (exp != CONF_ANY && tok != exp) {
+       char *str;
+       keytab_t *kwp;
+
+       switch(exp) {
+       case CONF_LBRACE:
+           str = "\"{\"";
+           break;
+
+       case CONF_RBRACE:
+           str = "\"}\"";
+           break;
+
+       case CONF_COMMA:
+           str = "\",\"";
+           break;
+
+       case CONF_NL:
+           str = "end of line";
+           break;
+
+       case CONF_END:
+           str = "end of file";
+           break;
+
+       case CONF_INT:
+           str = "an integer";
+           break;
+
+       case CONF_REAL:
+           str = "a real number";
+           break;
+
+       case CONF_STRING:
+           str = "a quoted string";
+           break;
+
+       case CONF_IDENT:
+           str = "an identifier";
+           break;
+
+       default:
+           for(kwp = keytable; kwp->keyword != NULL; kwp++) {
+               if (exp == kwp->token)
+                   break;
+           }
+           if (kwp->keyword == NULL)
+               str = "token not";
+           else
+               str = kwp->keyword;
+           break;
+       }
+       conf_parserror("%s is expected", str);
+       tok = exp;
+       if (tok == CONF_INT)
+           tokenval.v.i = 0;
+       else
+           tokenval.v.s = "";
+    }
+}
+
+
+static void
+read_string(
+    t_conf_var *np,
+    val_t *val)
+{
+    np = np;
+    ckseen(&val->seen);
+    get_conftoken(CONF_STRING);
+    val->v.s = newstralloc(val->v.s, tokenval.v.s);
+}
+
+static void
+read_ident(
+    t_conf_var *np,
+    val_t *val)
+{
+    np = np;
+    ckseen(&val->seen);
+    get_conftoken(CONF_IDENT);
+    val->v.s = newstralloc(val->v.s, tokenval.v.s);
+}
+
+static void
+read_int(
+    t_conf_var *np,
+    val_t *val)
+{
+    np = np;
+    ckseen(&val->seen);
+    val->v.i = get_int();
+}
+
+/*
+static void
+read_long(
+    t_conf_var *np,
+    val_t *val)
+{
+    np = np;
+    ckseen(&val->seen);
+    val->v.l = get_long();
+}
+*/
+
+static void
+read_size(
+    t_conf_var *np,
+    val_t *val)
+{
+    np = np;
+    ckseen(&val->seen);
+    val->v.size = get_size();
+}
+
+static void
+read_am64(
+    t_conf_var *np,
+    val_t *val)
+{
+    np = np;
+    ckseen(&val->seen);
+    val->v.am64 = get_am64_t();
+}
+
+static void
+read_bool(
+    t_conf_var *np,
+    val_t *val)
+{
+    np = np;
+    ckseen(&val->seen);
+    val->v.i = get_bool();
+}
+
+static void
+read_real(
+    t_conf_var *np,
+    val_t *val)
+{
+    np = np;
+    ckseen(&val->seen);
+    get_conftoken(CONF_REAL);
+    val->v.r = tokenval.v.r;
+}
+
+static void
+read_time(
+    t_conf_var *np,
+    val_t *val)
+{
+    np = np;
+    ckseen(&val->seen);
+    val->v.t = get_time();
+}
+
+static void
+copy_val_t(
+    val_t *valdst,
+    val_t *valsrc)
+{
+    if(valsrc->seen) {
+       valdst->type = valsrc->type;
+       valdst->seen = valsrc->seen;
+       switch(valsrc->type) {
+       case CONFTYPE_INT:
+       case CONFTYPE_BOOL:
+       case CONFTYPE_COMPRESS:
+       case CONFTYPE_ENCRYPT:
+       case CONFTYPE_HOLDING:
+       case CONFTYPE_ESTIMATE:
+       case CONFTYPE_STRATEGY:
+       case CONFTYPE_TAPERALGO:
+       case CONFTYPE_PRIORITY:
+           valdst->v.i = valsrc->v.i;
+           break;
+
+       case CONFTYPE_LONG:
+           valdst->v.l = valsrc->v.l;
+           break;
+
+       case CONFTYPE_SIZE:
+           valdst->v.size = valsrc->v.size;
+           break;
+
+       case CONFTYPE_AM64:
+           valdst->v.am64 = valsrc->v.am64;
+           break;
+
+       case CONFTYPE_REAL:
+           valdst->v.r = valsrc->v.r;
+           break;
+
+       case CONFTYPE_RATE:
+           valdst->v.rate[0] = valsrc->v.rate[0];
+           valdst->v.rate[1] = valsrc->v.rate[1];
+           break;
+
+       case CONFTYPE_IDENT:
+       case CONFTYPE_STRING:
+           valdst->v.s = stralloc(valsrc->v.s);
+           break;
+
+       case CONFTYPE_TIME:
+           valdst->v.t = valsrc->v.t;
+           break;
+
+       case CONFTYPE_SL:
+           valdst->v.sl = duplicate_sl(valsrc->v.sl);
+           break;
+
+       case CONFTYPE_EXINCLUDE:
+           valdst->v.exinclude.optional = valsrc->v.exinclude.optional;
+           valdst->v.exinclude.sl_list = duplicate_sl(valsrc->v.exinclude.sl_list);
+           valdst->v.exinclude.sl_file = duplicate_sl(valsrc->v.exinclude.sl_file);
+           break;
+
+       case CONFTYPE_INTRANGE:
+           valdst->v.intrange[0] = valsrc->v.intrange[0];
+           valdst->v.intrange[1] = valsrc->v.intrange[1];
+           break;
+
+       }
+    }
+}
+
+static void
+free_val_t(
+    val_t *val)
+{
+    switch(val->type) {
+       case CONFTYPE_INT:
+       case CONFTYPE_BOOL:
+       case CONFTYPE_COMPRESS:
+       case CONFTYPE_ENCRYPT:
+       case CONFTYPE_HOLDING:
+       case CONFTYPE_ESTIMATE:
+       case CONFTYPE_STRATEGY:
+       case CONFTYPE_SIZE:
+       case CONFTYPE_TAPERALGO:
+       case CONFTYPE_PRIORITY:
+       case CONFTYPE_LONG:
+       case CONFTYPE_AM64:
+       case CONFTYPE_REAL:
+       case CONFTYPE_RATE:
+       case CONFTYPE_INTRANGE:
+           break;
+
+       case CONFTYPE_IDENT:
+       case CONFTYPE_STRING:
+           amfree(val->v.s);
+           break;
+
+       case CONFTYPE_TIME:
+           break;
+
+       case CONFTYPE_SL:
+           free_sl(val->v.sl);
+           break;
+
+       case CONFTYPE_EXINCLUDE:
+           free_sl(val->v.exinclude.sl_list);
+           free_sl(val->v.exinclude.sl_file);
+           break;
+    }
+    val->seen = 0;
+}
+
+char *
+taperalgo2str(
+    int taperalgo)
+{
+    if(taperalgo == ALGO_FIRST) return "FIRST";
+    if(taperalgo == ALGO_FIRSTFIT) return "FIRSTFIT";
+    if(taperalgo == ALGO_LARGEST) return "LARGEST";
+    if(taperalgo == ALGO_LARGESTFIT) return "LARGESTFIT";
+    if(taperalgo == ALGO_SMALLEST) return "SMALLEST";
+    if(taperalgo == ALGO_LAST) return "LAST";
+    return "UNKNOWN";
+}
+
+static char buffer_conf_print[2049];
+
+static char *
+conf_print(
+    val_t *val,
+    int    str_need_quote,
+    char  *prefix)
+{
+    char *buf;
+    int   free_space;
+
+    buffer_conf_print[0] = '\0';
+    snprintf(buffer_conf_print, SIZEOF(buffer_conf_print), prefix);
+    free_space = SIZEOF(buffer_conf_print) - strlen(buffer_conf_print);
+    buf = buffer_conf_print + strlen(buffer_conf_print);
+    switch(val->type) {
+    case CONFTYPE_INT:
+       snprintf(buf, free_space, "%d", val->v.i);
+       break;
+
+    case CONFTYPE_LONG:
+       snprintf(buf, free_space, "%ld", val->v.l);
+       break;
+
+    case CONFTYPE_SIZE:
+       snprintf(buf, free_space, SSIZE_T_FMT, (SSIZE_T_FMT_TYPE)val->v.size);
+       break;
+
+    case CONFTYPE_AM64:
+       snprintf(buf, free_space, OFF_T_FMT, (OFF_T_FMT_TYPE)val->v.am64);
+       break;
+
+    case CONFTYPE_REAL:
+       snprintf(buf, free_space, "%0.5f" , val->v.r);
+       break;
+
+    case CONFTYPE_RATE:
+       snprintf(buf, free_space, "%0.5f %0.5f",
+                val->v.rate[0], val->v.rate[1]);
+       break;
+
+    case CONFTYPE_INTRANGE:
+       snprintf(buf, free_space, "%d,%d",
+                val->v.intrange[0], val->v.intrange[1]);
+       break;
+
+    case CONFTYPE_IDENT:
+       if(val->v.s) {
+           strncpy(buf, val->v.s, free_space);
+       }
+       break;
+
+    case CONFTYPE_STRING:
+       if(str_need_quote) {
+           *buf++ = '"';
+           free_space++;
+            if(val->v.s) {
+               strncpy(buf, val->v.s, free_space);
+               buffer_conf_print[SIZEOF(buffer_conf_print) - 2] = '\0';
+               buffer_conf_print[strlen(buffer_conf_print)] = '"';
+               buffer_conf_print[strlen(buffer_conf_print) + 1] = '\0';
+            } else {
+               *buf++ = '"';
+               *buf++ = '\0';
+               free_space -= 2;
+            }
+       } else {
+           if(val->v.s) {
+               strncpy(buf, val->v.s, free_space);
+           }
+       }
+       break;
+
+    case CONFTYPE_TIME:
+       snprintf(buf, free_space, "%2d%02d",
+                (int)val->v.t/100, (int)val->v.t % 100);
+       break;
+
+    case CONFTYPE_SL:
+       break;
+
+    case CONFTYPE_EXINCLUDE:
+       buf = buffer_conf_print;
+       free_space = SIZEOF(buffer_conf_print);
+
+       conf_print_exinclude(val, 1, 0, prefix, &buf ,&free_space);
+       *buf++ = '\n';
+       free_space -= 1;
+
+       conf_print_exinclude(val, 1, 1, prefix, &buf, &free_space);
+       break;
+
+    case CONFTYPE_BOOL:
+       if(val->v.i)
+           strncpy(buf, "yes", free_space);
+       else
+           strncpy(buf, "no", free_space);
+       break;
+
+    case CONFTYPE_STRATEGY:
+       switch(val->v.i) {
+       case DS_SKIP:
+           strncpy(buf, "SKIP", free_space);
+           break;
+
+       case DS_STANDARD:
+           strncpy(buf, "STANDARD", free_space);
+           break;
+
+       case DS_NOFULL:
+           strncpy(buf, "NOFULL", free_space);
+           break;
+
+       case DS_NOINC:
+           strncpy(buf, "NOINC", free_space);
+           break;
+
+       case DS_HANOI:
+           strncpy(buf, "HANOI", free_space);
+           break;
+
+       case DS_INCRONLY:
+           strncpy(buf, "INCRONLY", free_space);
+           break;
+       }
+       break;
+
+    case CONFTYPE_COMPRESS:
+       switch(val->v.i) {
+       case COMP_NONE:
+           strncpy(buf, "NONE", free_space);
+           break;
+
+       case COMP_FAST:
+           strncpy(buf, "CLIENT FAST", free_space);
+           break;
+
+       case COMP_BEST:
+           strncpy(buf, "CLIENT BEST", free_space);
+           break;
+
+       case COMP_CUST:
+           strncpy(buf, "CLIENT CUSTOM", free_space);
+           break;
+
+       case COMP_SERVER_FAST:
+           strncpy(buf, "SERVER FAST", free_space);
+           break;
+
+       case COMP_SERVER_BEST:
+           strncpy(buf, "SERVER FAST", free_space);
+           break;
+
+       case COMP_SERVER_CUST:
+           strncpy(buf, "SERVER CUSTOM", free_space);
+           break;
+       }
+       break;
+
+    case CONFTYPE_ESTIMATE:
+       switch(val->v.i) {
+       case ES_CLIENT:
+           strncpy(buf, "CLIENT", free_space);
+           break;
+
+       case ES_SERVER:
+           strncpy(buf, "SERVER", free_space);
+           break;
+
+       case ES_CALCSIZE:
+           strncpy(buf, "CALCSIZE", free_space);
+           break;
+       }
+       break;
+
+     case CONFTYPE_ENCRYPT:
+       switch(val->v.i) {
+       case ENCRYPT_NONE:
+           strncpy(buf, "NONE", free_space);
+           break;
+
+       case ENCRYPT_CUST:
+           strncpy(buf, "CLIENT", free_space);
+           break;
+
+       case ENCRYPT_SERV_CUST:
+           strncpy(buf, "SERVER", free_space);
+           break;
+       }
+       break;
+
+     case CONFTYPE_HOLDING:
+       switch(val->v.i) {
+       case HOLD_NEVER:
+           strncpy(buf, "NEVER", free_space);
+           break;
+
+       case HOLD_AUTO:
+           strncpy(buf, "AUTO", free_space);
+           break;
+
+       case HOLD_REQUIRED:
+           strncpy(buf, "REQUIRED", free_space);
+           break;
+       }
+       break;
+
+     case CONFTYPE_TAPERALGO:
+       strncpy(buf, taperalgo2str(val->v.i), free_space);
+       break;
+
+     case CONFTYPE_PRIORITY:
+       switch(val->v.i) {
+       case 0:
+           strncpy(buf, "LOW", free_space);
+           break;
+
+       case 1:
+           strncpy(buf, "MEDIUM", free_space);
+           break;
+
+       case 2:
+           strncpy(buf, "HIGH", free_space);
+           break;
+       }
+       break;
+    }
+    buffer_conf_print[SIZEOF(buffer_conf_print) - 1] = '\0';
+    return buffer_conf_print;
+}
+
+void  conf_print_exinclude(
+    val_t *val,
+    int    str_need_quote,
+    int    file,
+    char  *prefix,
+    char **buf,
+    int   *free_space)
+{
+    sl_t  *sl;
+    sle_t *excl;
+
+    (void)str_need_quote;
+
+    snprintf(*buf, *free_space, prefix);
+    *free_space -= strlen(prefix);
+    *buf += strlen(prefix);
+
+    if (val->type != CONFTYPE_EXINCLUDE) {
+       strcpy(*buf,
+         "ERROR: conf_print_exinclude called for type != CONFTYPE_EXINCLUDE");
+       return;
+    }
+
+    if (file == 0) {
+       sl = val->v.exinclude.sl_list;
+       strncpy(*buf, "LIST ", *free_space);
+       *buf += 5;
+       *free_space -= 5;
+    } else {
+       sl = val->v.exinclude.sl_file;
+       strncpy(*buf, "FILE ", *free_space);
+       *buf += 5;
+       *free_space -= 5;
+    }
+
+    if (val->v.exinclude.optional == 1) {
+       strncpy(*buf, "OPTIONAL ", *free_space);
+       *buf += 9;
+       *free_space -= 9;
+    }
+
+    if (sl != NULL) {
+       for(excl = sl->first; excl != NULL; excl = excl->next) {
+           if (3 + (int)strlen(excl->name) < *free_space) {
+               *(*buf)++ = ' ';
+               *(*buf)++ = '"';
+               strcpy(*buf, excl->name);
+               *buf += strlen(excl->name);
+               *(*buf)++ = '"';
+               *free_space -= 3 + strlen(excl->name);
+           }
+       }
+    }
+
+    return;
+}
+
+static void
+conf_init_string(
+    val_t *val,
+    char  *s)
+{
+    val->seen = 0;
+    val->type = CONFTYPE_STRING;
+    if(s)
+       val->v.s = stralloc(s);
+    else
+       val->v.s = NULL;
+}
+
+static void
+conf_init_ident(
+    val_t *val,
+    char  *s)
+{
+    val->seen = 0;
+    val->type = CONFTYPE_IDENT;
+    if(s)
+       val->v.s = stralloc(s);
+    else
+       val->v.s = NULL;
+}
+
+static void
+conf_init_int(
+    val_t *val,
+    int    i)
+{
+    val->seen = 0;
+    val->type = CONFTYPE_INT;
+    val->v.i = i;
+}
+
+static void
+conf_init_bool(
+    val_t *val,
+    int    i)
+{
+    val->seen = 0;
+    val->type = CONFTYPE_BOOL;
+    val->v.i = i;
+}
+
+static void
+conf_init_strategy(
+    val_t *val,
+    int    i)
+{
+    val->seen = 0;
+    val->type = CONFTYPE_STRATEGY;
+    val->v.i = i;
+}
+
+static void
+conf_init_estimate(
+    val_t *val,
+    int    i)
+{
+    val->seen = 0;
+    val->type = CONFTYPE_ESTIMATE;
+    val->v.i = i;
+}
+
+static void
+conf_init_taperalgo(
+    val_t *val,
+    int    i)
+{
+    val->seen = 0;
+    val->type = CONFTYPE_TAPERALGO;
+    val->v.i = i;
+}
+
+static void
+conf_init_priority(
+    val_t *val,
+    int    i)
+{
+    val->seen = 0;
+    val->type = CONFTYPE_PRIORITY;
+    val->v.i = i;
+}
+
+static void
+conf_init_compress(
+    val_t *val,
+    comp_t    i)
+{
+    val->seen = 0;
+    val->type = CONFTYPE_COMPRESS;
+    val->v.i = (int)i;
+}
+
+static void
+conf_init_encrypt(
+    val_t *val,
+    encrypt_t    i)
+{
+    val->seen = 0;
+    val->type = CONFTYPE_ENCRYPT;
+    val->v.i = (int)i;
+}
+
+static void
+conf_init_holding(
+    val_t              *val,
+    dump_holdingdisk_t  i)
+{
+    val->seen = 0;
+    val->type = CONFTYPE_HOLDING;
+    val->v.i = (int)i;
+}
+
+/*
+static void
+conf_init_long(
+    val_t *val,
+    long   l)
+{
+    val->seen = 0;
+    val->type = CONFTYPE_LONG;
+    val->v.l = l;
+}
+*/
+
+static void
+conf_init_size(
+    val_t *val,
+    ssize_t   sz)
+{
+    val->seen = 0;
+    val->type = CONFTYPE_SIZE;
+    val->v.size = sz;
+}
+
+static void
+conf_init_am64(
+    val_t *val,
+    off_t   l)
+{
+    val->seen = 0;
+    val->type = CONFTYPE_AM64;
+    val->v.am64 = l;
+}
+
+static void
+conf_init_real(
+    val_t  *val,
+    double r)
+{
+    val->seen = 0;
+    val->type = CONFTYPE_REAL;
+    val->v.r = r;
+}
+
+static void
+conf_init_rate(
+    val_t  *val,
+    double r1,
+    double r2)
+{
+    val->seen = 0;
+    val->type = CONFTYPE_RATE;
+    val->v.rate[0] = r1;
+    val->v.rate[1] = r2;
+}
+
+static void
+conf_init_intrange(
+    val_t *val,
+    int    i1,
+    int    i2)
+{
+    val->seen = 0;
+    val->type = CONFTYPE_INTRANGE;
+    val->v.intrange[0] = i1;
+    val->v.intrange[1] = i2;
+}
+
+static void
+conf_init_time(
+    val_t *val,
+    time_t   t)
+{
+    val->seen = 0;
+    val->type = CONFTYPE_TIME;
+    val->v.t = t;
+}
+
+/*
+static void
+conf_init_sl(
+    val_t *val,
+    sl_t  *sl)
+{
+    val->seen = 0;
+    val->type = CONFTYPE_AM64;
+    val->v.sl = sl;
+}
+*/
+
+static void
+conf_init_exinclude(
+    val_t *val)
+{
+    val->seen = 0;
+    val->type = CONFTYPE_EXINCLUDE;
+    val->v.exinclude.optional = 0;
+    val->v.exinclude.sl_list = NULL;
+    val->v.exinclude.sl_file = NULL;
+}
+
+static void
+conf_set_string(
+    val_t *val,
+    char *s)
+{
+    val->seen = -1;
+    val->type = CONFTYPE_STRING;
+    amfree(val->v.s);
+    val->v.s = stralloc(s);
+}
+
+/*
+static void
+conf_set_int(
+    val_t *val,
+    int    i)
+{
+    val->seen = -1;
+    val->type = CONFTYPE_INT;
+    val->v.i = i;
+}
+*/
+
+static void
+conf_set_bool(
+    val_t *val,
+    int    i)
+{
+    val->seen = -1;
+    val->type = CONFTYPE_BOOL;
+    val->v.i = i;
+}
+
+static void
+conf_set_compress(
+    val_t *val,
+    comp_t    i)
+{
+    val->seen = -1;
+    val->type = CONFTYPE_COMPRESS;
+    val->v.i = (int)i;
+}
+
+/*
+static void
+conf_set_encrypt(
+    val_t *val,
+    encrypt_t    i)
+{
+    val->seen = -1;
+    val->type = CONFTYPE_COMPRESS;
+    val->v.i = (int)i;
+}
+*/
+
+static void
+conf_set_holding(
+    val_t              *val,
+    dump_holdingdisk_t  i)
+{
+    val->seen = -1;
+    val->type = CONFTYPE_HOLDING;
+    val->v.i = (int)i;
+}
+
+static void
+conf_set_strategy(
+    val_t *val,
+    int    i)
+{
+    val->seen = -1;
+    val->type = CONFTYPE_STRATEGY;
+    val->v.i = i;
+}
+
+
+int
+get_conftype_int(
+    val_t *val)
+{
+    if (val->type != CONFTYPE_INT) {
+       error("get_conftype_int: val.type is not CONFTYPE_INT");
+       /*NOTREACHED*/
+    }
+    return val->v.i;
+}
+
+long
+get_conftype_long(
+    val_t *val)
+{
+    if (val->type != CONFTYPE_LONG) {
+       error("get_conftype_long: val.type is not CONFTYPE_LONG");
+       /*NOTREACHED*/
+    }
+    return val->v.l;
+}
+
+off_t
+get_conftype_am64(
+    val_t *val)
+{
+    if (val->type != CONFTYPE_AM64) {
+       error("get_conftype_am64: val.type is not CONFTYPE_AM64");
+       /*NOTREACHED*/
+    }
+    return val->v.am64;
+}
+
+double
+get_conftype_real(
+    val_t *val)
+{
+    if (val->type != CONFTYPE_REAL) {
+       error("get_conftype_real: val.type is not CONFTYPE_REAL");
+       /*NOTREACHED*/
+    }
+    return val->v.r;
+}
+
+char *
+get_conftype_string(
+    val_t *val)
+{
+    if (val->type != CONFTYPE_STRING) {
+       error("get_conftype_string: val.type is not CONFTYPE_STRING");
+       /*NOTREACHED*/
+    }
+    return val->v.s;
+}
+
+char *
+get_conftype_ident(
+    val_t *val)
+{
+    if (val->type != CONFTYPE_IDENT) {
+       error("get_conftype_ident: val.type is not CONFTYPE_IDENT");
+       /*NOTREACHED*/
+    }
+    return val->v.s;
+}
+
+time_t
+get_conftype_time(
+    val_t *val)
+{
+    if (val->type != CONFTYPE_TIME) {
+       error("get_conftype_time: val.type is not CONFTYPE_TIME");
+       /*NOTREACHED*/
+    }
+    return val->v.t;
+}
+
+ssize_t
+get_conftype_size(
+    val_t *val)
+{
+    if (val->type != CONFTYPE_SIZE) {
+       error("get_conftype_size: val.type is not CONFTYPE_SIZE");
+       /*NOTREACHED*/
+    }
+    return val->v.size;
+}
+
+sl_t *
+get_conftype_sl(
+    val_t *val)
+{
+    if (val->type != CONFTYPE_SL) {
+       error("get_conftype_size: val.type is not CONFTYPE_SL");
+       /*NOTREACHED*/
+    }
+    return val->v.sl;
+}
+
+int
+get_conftype_bool(
+    val_t *val)
+{
+    if (val->type != CONFTYPE_BOOL) {
+       error("get_conftype_bool: val.type is not CONFTYPE_BOOL");
+       /*NOTREACHED*/
+    }
+    return val->v.i;
+}
+
+int
+get_conftype_hold(
+    val_t *val)
+{
+    if (val->type != CONFTYPE_HOLDING) {
+       error("get_conftype_hold: val.type is not CONFTYPE_HOLDING");
+       /*NOTREACHED*/
+    }
+    return val->v.i;
+}
+
+int
+get_conftype_compress(
+    val_t *val)
+{
+    if (val->type != CONFTYPE_COMPRESS) {
+       error("get_conftype_compress: val.type is not CONFTYPE_COMPRESS");
+       /*NOTREACHED*/
+    }
+    return val->v.i;
+}
+
+int
+get_conftype_encrypt(
+    val_t *val)
+{
+    if (val->type != CONFTYPE_ENCRYPT) {
+       error("get_conftype_encrypt: val.type is not CONFTYPE_ENCRYPT");
+       /*NOTREACHED*/
+    }
+    return val->v.i;
+}
+
+int
+get_conftype_estimate(
+    val_t *val)
+{
+    if (val->type != CONFTYPE_ESTIMATE) {
+       error("get_conftype_extimate: val.type is not CONFTYPE_ESTIMATE");
+       /*NOTREACHED*/
+    }
+    return val->v.i;
+}
+
+int
+get_conftype_strategy(
+    val_t *val)
+{
+    if (val->type != CONFTYPE_STRATEGY) {
+       error("get_conftype_strategy: val.type is not CONFTYPE_STRATEGY");
+       /*NOTREACHED*/
+    }
+    return val->v.i;
+}
+
+int
+get_conftype_taperalgo(
+    val_t *val)
+{
+    if (val->type != CONFTYPE_TAPERALGO) {
+       error("get_conftype_taperalgo: val.type is not CONFTYPE_TAPERALGO");
+       /*NOTREACHED*/
+    }
+    return val->v.i;
+}
+
+int
+get_conftype_priority(
+    val_t *val)
+{
+    if (val->type != CONFTYPE_PRIORITY) {
+       error("get_conftype_priority: val.type is not CONFTYPE_PRIORITY");
+       /*NOTREACHED*/
+    }
+    return val->v.i;
+}
+
+exinclude_t
+get_conftype_exinclude(
+    val_t *val)
+{
+    if (val->type != CONFTYPE_EXINCLUDE) {
+       error("get_conftype_exinclude: val.type is not CONFTYPE_EXINCLUDE");
+       /*NOTREACHED*/
+    }
+    return val->v.exinclude;
+}
+
+
+static void
+read_block(
+    command_option_t *command_options,
+    t_conf_var    *read_var,
+    keytab_t *keytab,
+    val_t    *valarray,
+    char     *prefix,
+    char     *errormsg,
+    int       read_brace,
+    void      (*copy_function)(void))
+{
+    t_conf_var *np;
+    int    saved_conf_line_num;
+    int    done;
+
+    if(read_brace) {
+       get_conftoken(CONF_LBRACE);
+       get_conftoken(CONF_NL);
+    }
+
+    done = 0;
+    do {
+       conf_line_num += 1;
+       get_conftoken(CONF_ANY);
+       switch(tok) {
+       case CONF_RBRACE:
+           done = 1;
+           break;
+       case CONF_NL:   /* empty line */
+           break;
+       case CONF_END:  /* end of file */
+           done = 1;
+           break;
+        case CONF_IDENT:
+        case CONF_STRING:
+           if(copy_function) 
+               copy_function();
+           else
+               conf_parserror("ident not expected");
+           break;
+       default:
+           {
+               for(np = read_var; np->token != CONF_UNKNOWN; np++)
+                   if(np->token == tok) break;
+
+               if(np->token == CONF_UNKNOWN)
+                   conf_parserror(errormsg);
+               else {
+                   np->read_function(np, &valarray[np->parm]);
+                   if(np->validate)
+                       np->validate(np, &valarray[np->parm]);
+               }
+           }
+       }
+       if(tok != CONF_NL && tok != CONF_END && tok != CONF_RBRACE)
+           get_conftoken(CONF_NL);
+    } while(!done);
+
+    /* overwrite with command line option */
+    saved_conf_line_num = conf_line_num;
+    command_overwrite(command_options, read_var, keytab, valarray, prefix);
+    conf_line_num = saved_conf_line_num;
+}
+
+void
+command_overwrite(
+    command_option_t *command_options,
+    t_conf_var    *overwrite_var,
+    keytab_t *keytab,
+    val_t    *valarray,
+    char     *prefix)
+{
+    t_conf_var      *np;
+    keytab_t        *kt;
+    char            *myprefix;
+    command_option_t *command_option;
+    int                      duplicate;
+
+    if(!command_options) return;
+
+    for(np = overwrite_var; np->token != CONF_UNKNOWN; np++) {
+       for(kt = keytab; kt->token != CONF_UNKNOWN; kt++)
+           if(kt->token == np->token) break;
+
+       if(kt->token == CONF_UNKNOWN) {
+           error("command_overwrite: invalid token");
+           /* NOTREACHED */
+       }
+
+       for(command_option = command_options; command_option->name != NULL;
+                                                           command_option++) {
+           myprefix = stralloc2(prefix, kt->keyword);
+           if(strcasecmp(myprefix, command_option->name) == 0) {
+               duplicate = 0;
+               if (command_option->used == 0 &&
+                   valarray[np->parm].seen == -2) {
+                   duplicate = 1;
+               }
+               command_option->used = 1;
+               valarray[np->parm].seen = -2;
+               if(np->type == CONFTYPE_STRING &&
+                  command_option->value[0] != '"') {
+                   conf_line = vstralloc("\"", command_option->value, "\"",
+                                         NULL);
+               }
+               else {
+                   conf_line = stralloc(command_option->value);
+               }
+               conf_char = conf_line;
+               token_pushed = 0;
+               conf_line_num = -2;
+               np->read_function(np, &valarray[np->parm]);
+               amfree(conf_line);
+               conf_line = conf_char = NULL;
+
+               if (np->validate)
+                   np->validate(np, &valarray[np->parm]);
+               if (duplicate == 1) {
+                   fprintf(stderr,"Duplicate %s option, using %s\n",
+                           command_option->name, command_option->value);
+               }
+           }
+           amfree(myprefix);
+       }
+    }
+}
+
+void
+free_new_argv(
+    int new_argc,
+    char **new_argv)
+{
+    int i;
+    for(i=0; i<new_argc; i++)
+       amfree(new_argv[i]);
+    amfree(new_argv);
+}
+
+ssize_t
+getconf_readblocksize(void)
+{
+    tapetype_t *tape;
+    char       *conf_tapetype;
+
+    if (conffile_init == 1) {
+       conf_tapetype = getconf_str(CNF_TAPETYPE);
+
+       if (!conf_tapetype || strlen(conf_tapetype) == 0)
+           return MAX_TAPE_BLOCK_KB;
+
+       tape = lookup_tapetype(conf_tapetype);
+       if (!tape)
+           return MAX_TAPE_BLOCK_KB;
+       return tapetype_get_readblocksize(tape);
+    }
+
+    return MAX_TAPE_BLOCK_KB;
+}
diff --git a/common-src/conffile.h b/common-src/conffile.h
new file mode 100644 (file)
index 0000000..787f514
--- /dev/null
@@ -0,0 +1,637 @@
+/*
+ * Amanda, The Advanced Maryland Automatic Network Disk Archiver
+ * Copyright (c) 1991-2000 University of Maryland at College Park
+ * All Rights Reserved.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of U.M. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  U.M. makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
+ * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Author: James da Silva, Systems Design and Analysis Group
+ *                        Computer Science Department
+ *                        University of Maryland at College Park
+ */
+/*
+ * $Id: conffile.h,v 1.72 2006/07/26 15:17:37 martinea Exp $
+ *
+ * interface for config file reading code
+ */
+#ifndef CONFFILE_H
+#define CONFFILE_H
+
+#include "amanda.h"
+#include "conffile.h"
+#include "util.h"
+
+#define CONFFILE_NAME "amanda.conf"
+
+typedef enum {
+    CNF_ORG,
+    CNF_CONF,
+    CNF_INDEX_SERVER,
+    CNF_TAPE_SERVER,
+    CNF_AUTH,
+    CNF_SSH_KEYS,
+    CNF_AMANDAD_PATH,
+    CNF_CLIENT_USERNAME,
+    CNF_GNUTAR_LIST_DIR,
+    CNF_AMANDATES,
+    CNF_MAILTO,
+    CNF_DUMPUSER,
+    CNF_TAPEDEV,
+    CNF_CHNGRDEV,
+    CNF_CHNGRFILE,
+    CNF_LABELSTR,
+    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_TAPEBUFS,
+    CNF_RAWTAPEDEV,
+    CNF_PRINTER,
+    CNF_AUTOFLUSH,
+    CNF_RESERVE,
+    CNF_MAXDUMPSIZE,
+    CNF_COLUMNSPEC,
+    CNF_AMRECOVER_DO_FSF,
+    CNF_AMRECOVER_CHECK_LABEL,
+    CNF_AMRECOVER_CHANGER,
+    CNF_TAPERALGO,
+    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_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_CNF
+} confparm_t;
+
+typedef enum {
+    CONF_UNKNOWN,              CONF_ANY,               CONF_COMMA,
+    CONF_LBRACE,               CONF_RBRACE,            CONF_NL,
+    CONF_END,                  CONF_IDENT,             CONF_INT,
+    CONF_LONG,                 CONF_AM64,              CONF_BOOL,
+    CONF_REAL,                 CONF_STRING,            CONF_TIME,
+    CONF_SIZE,
+
+    /* config parameters */
+    CONF_INCLUDEFILE,          CONF_ORG,               CONF_MAILTO,
+    CONF_DUMPUSER,             CONF_TAPECYCLE,         CONF_TAPEDEV,
+    CONF_CHNGRDEV,             CONF_CHNGRFILE,         CONF_LABELSTR,
+    CONF_BUMPPERCENT,          CONF_BUMPSIZE,          CONF_BUMPDAYS,
+    CONF_BUMPMULT,             CONF_ETIMEOUT,          CONF_DTIMEOUT,
+    CONF_CTIMEOUT,             CONF_TAPEBUFS,          CONF_TAPELIST,
+    CONF_DISKFILE,             CONF_INFOFILE,          CONF_LOGDIR,
+    CONF_LOGFILE,              CONF_DISKDIR,           CONF_DISKSIZE,
+    CONF_INDEXDIR,             CONF_NETUSAGE,          CONF_INPARALLEL,
+    CONF_DUMPORDER,            CONF_TIMEOUT,           CONF_TPCHANGER,
+    CONF_RUNTAPES,             CONF_DEFINE,            CONF_DUMPTYPE,
+    CONF_TAPETYPE,             CONF_INTERFACE,         CONF_PRINTER,
+    CONF_AUTOFLUSH,            CONF_RESERVE,           CONF_MAXDUMPSIZE,
+    CONF_COLUMNSPEC,           CONF_AMRECOVER_DO_FSF,  CONF_AMRECOVER_CHECK_LABEL,
+    CONF_AMRECOVER_CHANGER,    CONF_LABEL_NEW_TAPES,   CONF_USETIMESTAMPS,
+
+    CONF_TAPERALGO,            CONF_FIRST,             CONF_FIRSTFIT,
+    CONF_LARGEST,              CONF_LARGESTFIT,        CONF_SMALLEST,
+    CONF_LAST,                 CONF_DISPLAYUNIT,       CONF_RESERVED_UDP_PORT,
+    CONF_RESERVED_TCP_PORT,    CONF_UNRESERVED_TCP_PORT,
+
+    /* kerberos 5 */
+    CONF_KRB5KEYTAB,           CONF_KRB5PRINCIPAL,
+
+    /* holding disk */
+    CONF_COMMENT,              CONF_DIRECTORY,         CONF_USE,
+    CONF_CHUNKSIZE,
+
+    /* dump type */
+    /*COMMENT,*/               CONF_PROGRAM,           CONF_DUMPCYCLE,
+    CONF_RUNSPERCYCLE,         CONF_MAXCYCLE,          CONF_MAXDUMPS,
+    CONF_OPTIONS,              CONF_PRIORITY,          CONF_FREQUENCY,
+    CONF_INDEX,                        CONF_MAXPROMOTEDAY,     CONF_STARTTIME,
+    CONF_COMPRESS,             CONF_ENCRYPT,           CONF_AUTH,
+    CONF_STRATEGY,             CONF_ESTIMATE,          CONF_SKIP_INCR,
+    CONF_SKIP_FULL,            CONF_RECORD,            CONF_HOLDING,
+    CONF_EXCLUDE,              CONF_INCLUDE,           CONF_KENCRYPT,
+    CONF_IGNORE,               CONF_COMPRATE,          CONF_TAPE_SPLITSIZE,
+    CONF_SPLIT_DISKBUFFER,     CONF_FALLBACK_SPLITSIZE,CONF_SRVCOMPPROG,
+    CONF_CLNTCOMPPROG,         CONF_SRV_ENCRYPT,       CONF_CLNT_ENCRYPT,
+    CONF_SRV_DECRYPT_OPT,      CONF_CLNT_DECRYPT_OPT,  CONF_AMANDAD_PATH,
+    CONF_CLIENT_USERNAME,
+
+    /* tape type */
+    /*COMMENT,*/               CONF_BLOCKSIZE,         CONF_FILE_PAD,
+    CONF_LBL_TEMPL,            CONF_FILEMARK,          CONF_LENGTH,
+    CONF_SPEED,                        CONF_READBLOCKSIZE,
+
+    /* client conf */
+    CONF_CONF,                 CONF_INDEX_SERVER,      CONF_TAPE_SERVER,
+    CONF_SSH_KEYS,             CONF_GNUTAR_LIST_DIR,   CONF_AMANDATES,
+
+    /* protocol config */
+    CONF_REP_TRIES,            CONF_CONNECT_TRIES,     CONF_REQ_TRIES,
+
+    /* debug config */
+    CONF_DEBUG_AMANDAD,                CONF_DEBUG_AMIDXTAPED,  CONF_DEBUG_AMINDEXD,
+    CONF_DEBUG_AMRECOVER,      CONF_DEBUG_AUTH,        CONF_DEBUG_EVENT,
+    CONF_DEBUG_HOLDING,                CONF_DEBUG_PROTOCOL,    CONF_DEBUG_PLANNER,
+    CONF_DEBUG_DRIVER,         CONF_DEBUG_DUMPER,      CONF_DEBUG_CHUNKER,
+    CONF_DEBUG_TAPER,          CONF_DEBUG_SELFCHECK,   CONF_DEBUG_SENDSIZE,
+    CONF_DEBUG_SENDBACKUP,
+
+    /* network interface */
+    /* COMMENT, */             /* USE, */
+
+    /* dump options (obsolete) */
+    CONF_EXCLUDE_FILE,         CONF_EXCLUDE_LIST,
+
+    /* compress, estimate, encryption */
+    CONF_NONE,                 CONF_FAST,              CONF_BEST,
+    CONF_SERVER,               CONF_CLIENT,            CONF_CALCSIZE,
+    CONF_CUSTOM,
+
+    /* holdingdisk */
+    CONF_NEVER,                        CONF_AUTO,              CONF_REQUIRED,
+
+    /* priority */
+    CONF_LOW,                  CONF_MEDIUM,            CONF_HIGH,
+
+    /* dump strategy */
+    CONF_SKIP,                 CONF_STANDARD,          CONF_NOFULL,
+    CONF_NOINC,                        CONF_HANOI,             CONF_INCRONLY,
+
+    /* exclude list */
+    CONF_LIST,                 CONF_EFILE,             CONF_APPEND,
+    CONF_OPTIONAL,
+
+    /* numbers */
+    CONF_AMINFINITY,           CONF_MULT1,             CONF_MULT7,
+    CONF_MULT1K,               CONF_MULT1M,            CONF_MULT1G,
+
+    /* boolean */
+    CONF_ATRUE,                        CONF_AFALSE,
+
+    CONF_RAWTAPEDEV
+} tok_t;
+
+/* internal types and variables */
+
+/* */
+typedef enum {
+    CONFTYPE_INT,
+    CONFTYPE_LONG,
+    CONFTYPE_AM64,
+    CONFTYPE_REAL,
+    CONFTYPE_STRING,
+    CONFTYPE_IDENT,
+    CONFTYPE_TIME,             /* hhmm */
+    CONFTYPE_SIZE,
+    CONFTYPE_SL,
+    CONFTYPE_BOOL,
+    CONFTYPE_COMPRESS,
+    CONFTYPE_ENCRYPT,
+    CONFTYPE_HOLDING,
+    CONFTYPE_ESTIMATE,
+    CONFTYPE_STRATEGY,
+    CONFTYPE_TAPERALGO,
+    CONFTYPE_PRIORITY,
+    CONFTYPE_RATE,
+    CONFTYPE_INTRANGE,
+    CONFTYPE_EXINCLUDE
+} conftype_t;
+
+/* Compression types */
+typedef enum {
+    COMP_NONE,          /* No compression */
+    COMP_FAST,          /* Fast compression on client */
+    COMP_BEST,          /* Best compression on client */
+    COMP_CUST,          /* Custom compression on client */
+    COMP_SERVER_FAST,   /* Fast compression on server */
+    COMP_SERVER_BEST,   /* Best compression on server */
+    COMP_SERVER_CUST    /* Custom compression on server */
+} comp_t;
+
+/* Encryption types */
+typedef enum {
+    ENCRYPT_NONE,               /* No encryption */
+    ENCRYPT_CUST,               /* Custom encryption on client */
+    ENCRYPT_SERV_CUST           /* Custom encryption on server */
+} encrypt_t;
+
+/* holdingdisk types */
+typedef enum {
+    HOLD_NEVER,                        /* Always direct to tape  */
+    HOLD_AUTO,                 /* If possible            */
+    HOLD_REQUIRED              /* Always to holding disk */
+} dump_holdingdisk_t;
+
+typedef struct {        /* token table entry */
+    char *keyword;
+    tok_t token;
+} keytab_t;
+
+typedef struct {
+    char *name;
+    char *value;
+    int   used;
+} command_option_t;
+
+typedef struct exinclude_s {
+    sl_t *sl_list;
+    sl_t *sl_file;
+    int  optional;
+} exinclude_t;
+
+typedef struct val_s {
+    union {
+       int             i;
+       long            l;
+       off_t           am64;
+       double          r;
+       char            *s;
+       sl_t            *sl;
+       ssize_t         size;
+       time_t          t;
+       float           rate[2];
+       exinclude_t     exinclude;
+       int             intrange[2];
+    } v;
+    int seen;
+    conftype_t type;
+} val_t;
+
+typedef struct s_conf_var {
+    tok_t      token;
+    conftype_t type;
+    void       (*read_function) (struct s_conf_var *, val_t*);
+    int                parm;
+    void       (*validate) (struct s_conf_var *, val_t *);
+} t_conf_var;
+
+typedef enum tapetype_e  {
+    TAPETYPE_COMMENT,
+    TAPETYPE_LBL_TEMPL,
+    TAPETYPE_BLOCKSIZE,
+    TAPETYPE_READBLOCKSIZE,
+    TAPETYPE_LENGTH,
+    TAPETYPE_FILEMARK,
+    TAPETYPE_SPEED,
+    TAPETYPE_FILE_PAD,
+    TAPETYPE_TAPETYPE
+} tapetype_ee;
+
+typedef struct tapetype_s {
+    struct tapetype_s *next;
+    int seen;
+    char *name;
+
+    val_t value[TAPETYPE_TAPETYPE];
+} tapetype_t;
+
+#define tapetype_get(tapetype, field) (tapetype->field)
+#define tapetype_get_name(tapetype) tapetype->name
+#define tapetype_get_seen(tapetype) tapetype->seen
+#define tapetype_get_comment(tapetype)       get_conftype_string(&tapetype->value[TAPETYPE_COMMENT])
+#define tapetype_get_lbl_templ(tapetype)     get_conftype_string(&tapetype->value[TAPETYPE_LBL_TEMPL])
+#define tapetype_get_blocksize(tapetype)     get_conftype_size  (&tapetype->value[TAPETYPE_BLOCKSIZE])
+#define tapetype_get_readblocksize(tapetype) get_conftype_size  (&tapetype->value[TAPETYPE_READBLOCKSIZE])
+#define tapetype_get_length(tapetype)        get_conftype_am64  (&tapetype->value[TAPETYPE_LENGTH])
+#define tapetype_get_filemark(tapetype)      get_conftype_am64  (&tapetype->value[TAPETYPE_FILEMARK])
+#define tapetype_get_speed(tapetype)         get_conftype_int   (&tapetype->value[TAPETYPE_SPEED])
+#define tapetype_get_file_pad(tapetype)      get_conftype_bool  (&tapetype->value[TAPETYPE_FILE_PAD])
+
+/* Dump strategies */
+#define DS_SKIP                0       /* Don't do any dumps at all */
+#define DS_STANDARD    1       /* Standard (0 1 1 1 1 2 2 2 ...) */
+#define DS_NOFULL      2       /* No full's (1 1 1 ...) */
+#define DS_NOINC       3       /* No inc's (0 0 0 ...) */
+#define DS_4           4       /* ? (0 1 2 3 4 5 6 7 8 9 10 11 ...) */
+#define DS_5           5       /* ? (0 1 1 1 1 1 1 1 1 1 1 1 ...) */
+#define DS_HANOI       6       /* Tower of Hanoi (? ? ? ? ? ...) */
+#define DS_INCRONLY    7       /* Forced fulls (0 1 1 2 2 FORCE0 1 1 ...) */
+
+/* Estimate strategies */
+#define ES_CLIENT      0       /* client estimate */
+#define ES_SERVER      1       /* server estimate */
+#define ES_CALCSIZE    2       /* calcsize estimate */
+
+#define ALGO_FIRST     0
+#define ALGO_FIRSTFIT  1
+#define ALGO_LARGEST   2
+#define ALGO_LARGESTFIT        3
+#define ALGO_SMALLEST  4
+#define ALGO_LAST      5
+
+typedef enum dumptype_e  {
+    DUMPTYPE_COMMENT,
+    DUMPTYPE_PROGRAM,
+    DUMPTYPE_SRVCOMPPROG,
+    DUMPTYPE_CLNTCOMPPROG,
+    DUMPTYPE_SRV_ENCRYPT,
+    DUMPTYPE_CLNT_ENCRYPT,
+    DUMPTYPE_AMANDAD_PATH,
+    DUMPTYPE_CLIENT_USERNAME,
+    DUMPTYPE_SSH_KEYS,
+    DUMPTYPE_SECURITY_DRIVER,
+    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_ESTIMATE,
+    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_DUMPTYPE
+} dumptype_ee;
+
+typedef struct dumptype_s {
+    struct dumptype_s *next;
+    int seen;
+    char *name;
+
+    val_t value[DUMPTYPE_DUMPTYPE];
+} dumptype_t;
+
+#define dumptype_get_name(dumptype) dumptype->name
+#define dumptype_get_seen(dumptype) dumptype->seen
+#define dumptype_get_comment(dumptype)            get_conftype_string   (&dumptype->value[DUMPTYPE_COMMENT])
+#define dumptype_get_program(dumptype)            get_conftype_string   (&dumptype->value[DUMPTYPE_PROGRAM])
+#define dumptype_get_srvcompprog(dumptype)        get_conftype_string   (&dumptype->value[DUMPTYPE_SRVCOMPPROG])
+#define dumptype_get_clntcompprog(dumptype)       get_conftype_string   (&dumptype->value[DUMPTYPE_CLNTCOMPPROG])
+#define dumptype_get_srv_encrypt(dumptype)        get_conftype_string   (&dumptype->value[DUMPTYPE_SRV_ENCRYPT])
+#define dumptype_get_clnt_encrypt(dumptype)       get_conftype_string   (&dumptype->value[DUMPTYPE_CLNT_ENCRYPT])
+#define dumptype_get_amandad_path(dumptype)       get_conftype_string   (&dumptype->value[DUMPTYPE_AMANDAD_PATH])
+#define dumptype_get_client_username(dumptype)    get_conftype_string   (&dumptype->value[DUMPTYPE_CLIENT_USERNAME])
+#define dumptype_get_ssh_keys(dumptype)           get_conftype_string   (&dumptype->value[DUMPTYPE_SSH_KEYS])
+#define dumptype_get_security_driver(dumptype)    get_conftype_string   (&dumptype->value[DUMPTYPE_SECURITY_DRIVER])
+#define dumptype_get_exclude(dumptype)            get_conftype_exinclude(&dumptype->value[DUMPTYPE_EXCLUDE])
+#define dumptype_get_include(dumptype)            get_conftype_exinclude(&dumptype->value[DUMPTYPE_INCLUDE])
+#define dumptype_get_priority(dumptype)           get_conftype_priority (&dumptype->value[DUMPTYPE_PRIORITY])
+#define dumptype_get_dumpcycle(dumptype)          get_conftype_int      (&dumptype->value[DUMPTYPE_DUMPCYCLE])
+#define dumptype_get_maxcycle(dumptype)           get_conftype_int      (&dumptype->value[DUMPTYPE_MAXCYCLE])
+#define dumptype_get_frequency(dumptype)          get_conftype_int      (&dumptype->value[DUMPTYPE_FREQUENCY])
+#define dumptype_get_maxdumps(dumptype)           get_conftype_int      (&dumptype->value[DUMPTYPE_MAXDUMPS])
+#define dumptype_get_maxpromoteday(dumptype)      get_conftype_int      (&dumptype->value[DUMPTYPE_MAXPROMOTEDAY])
+#define dumptype_get_bumppercent(dumptype)        get_conftype_int      (&dumptype->value[DUMPTYPE_BUMPPERCENT])
+#define dumptype_get_bumpsize(dumptype)           get_conftype_am64     (&dumptype->value[DUMPTYPE_BUMPSIZE])
+#define dumptype_get_bumpdays(dumptype)           get_conftype_int      (&dumptype->value[DUMPTYPE_BUMPDAYS])
+#define dumptype_get_bumpmult(dumptype)           get_conftype_real     (&dumptype->value[DUMPTYPE_BUMPMULT])
+#define dumptype_get_starttime(dumptype)          get_conftype_time     (&dumptype->value[DUMPTYPE_STARTTIME])
+#define dumptype_get_strategy(dumptype)           get_conftype_strategy (&dumptype->value[DUMPTYPE_STRATEGY])
+#define dumptype_get_estimate(dumptype)           get_conftype_estimate (&dumptype->value[DUMPTYPE_ESTIMATE])
+#define dumptype_get_compress(dumptype)           get_conftype_compress (&dumptype->value[DUMPTYPE_COMPRESS])
+#define dumptype_get_encrypt(dumptype)            get_conftype_encrypt  (&dumptype->value[DUMPTYPE_ENCRYPT])
+#define dumptype_get_srv_decrypt_opt(dumptype)    get_conftype_string   (&dumptype->value[DUMPTYPE_SRV_DECRYPT_OPT])
+#define dumptype_get_clnt_decrypt_opt(dumptype)   get_conftype_string   (&dumptype->value[DUMPTYPE_CLNT_DECRYPT_OPT])
+#define dumptype_get_comprate(dumptype)                                   dumptype->value[DUMPTYPE_COMPRATE].v.rate
+#define dumptype_get_tape_splitsize(dumptype)     get_conftype_am64     (&dumptype->value[DUMPTYPE_TAPE_SPLITSIZE])
+#define dumptype_get_fallback_splitsize(dumptype) get_conftype_am64     (&dumptype->value[DUMPTYPE_FALLBACK_SPLITSIZE])
+#define dumptype_get_split_diskbuffer(dumptype)   get_conftype_string   (&dumptype->value[DUMPTYPE_SPLIT_DISKBUFFER])
+#define dumptype_get_record(dumptype)             get_conftype_bool     (&dumptype->value[DUMPTYPE_RECORD])
+#define dumptype_get_skip_incr(dumptype)          get_conftype_bool     (&dumptype->value[DUMPTYPE_SKIP_INCR])
+#define dumptype_get_skip_full(dumptype)          get_conftype_bool     (&dumptype->value[DUMPTYPE_SKIP_FULL])
+#define dumptype_get_to_holdingdisk(dumptype)     get_conftype_hold     (&dumptype->value[DUMPTYPE_HOLDINGDISK])
+#define dumptype_get_kencrypt(dumptype)           get_conftype_bool     (&dumptype->value[DUMPTYPE_KENCRYPT])
+#define dumptype_get_ignore(dumptype)             get_conftype_bool     (&dumptype->value[DUMPTYPE_IGNORE])
+#define dumptype_get_index(dumptype)              get_conftype_bool     (&dumptype->value[DUMPTYPE_INDEX])
+
+/* A network interface */
+typedef enum interface_e  {
+    INTER_COMMENT,
+    INTER_MAXUSAGE,
+    INTER_INTER
+} interface_ee;
+
+
+typedef struct interface_s {
+    struct interface_s *next;
+    int seen;
+    char *name;
+
+    val_t value[INTER_INTER];
+
+    unsigned long curusage;            /* current usage */
+} interface_t;
+
+#define interface_get_name(interface) interface->name
+#define interface_get_seen(interface) interface->seen
+#define interface_get_comment(interface)  get_conftype_string(&interface->value[INTER_COMMENT])
+#define interface_get_maxusage(interface) get_conftype_int   (&interface->value[INTER_MAXUSAGE])
+
+/* A holding disk */
+typedef enum holdingdisk_e  {
+    HOLDING_COMMENT,
+    HOLDING_DISKDIR,
+    HOLDING_DISKSIZE,
+    HOLDING_CHUNKSIZE,
+    HOLDING_HOLDING
+} holdingdisk_ee;
+
+typedef struct holdingdisk_s {
+    struct holdingdisk_s *next;
+    int seen;
+    char *name;
+
+    val_t value[HOLDING_HOLDING];
+
+    void *up;                  /* generic user pointer */
+    off_t disksize;
+} holdingdisk_t;
+
+#define holdingdisk_get_name(holdingdisk) (holdingdisk)->name
+#define holdingdisk_get_seen(holdingdisk) (holdingdisk)->seen
+#define holdingdisk_get_comment(holdingdisk)   get_conftype_string(&(holdingdisk)->value[HOLDING_COMMENT])
+#define holdingdisk_get_diskdir(holdingdisk)   get_conftype_string(&(holdingdisk)->value[HOLDING_DISKDIR])
+#define holdingdisk_get_disksize(holdingdisk)  get_conftype_am64  (&(holdingdisk)->value[HOLDING_DISKSIZE])
+#define holdingdisk_get_chunksize(holdingdisk) get_conftype_am64  (&(holdingdisk)->value[HOLDING_CHUNKSIZE])
+
+/* for each column we define some values on how to
+ * format this column element
+ */
+typedef struct {
+    char *Name;                /* column name */
+    int PrefixSpace;   /* the blank space to print before this
+                        * column. It is used to get the space
+                        * between the colums
+                        */
+    int Width;         /* the width of the column itself */
+    int Precision;     /* the precision if its a float */
+    int MaxWidth;      /* if set, Width will be recalculated
+                        * to the space needed */
+    char *Format;      /* the printf format string for this
+                        * column element
+                        */
+    char *Title;       /* the title to use for this column */
+} ColumnInfo;
+
+
+/* predeclare local functions */
+
+int          get_conftype_int      (val_t *);
+long         get_conftype_long     (val_t *);
+off_t        get_conftype_am64     (val_t *);
+double       get_conftype_real     (val_t *);
+char        *get_conftype_string   (val_t *);
+char        *get_conftype_ident    (val_t *);
+time_t       get_conftype_time     (val_t *);
+ssize_t      get_conftype_size     (val_t *);
+sl_t        *get_conftype_sl       (val_t *);
+int          get_conftype_bool     (val_t *);
+int          get_conftype_hold     (val_t *);
+int          get_conftype_compress (val_t *);
+int          get_conftype_encrypt  (val_t *);
+int          get_conftype_estimate (val_t *);
+int          get_conftype_strategy (val_t *);
+int          get_conftype_taperalgo(val_t *);
+int          get_conftype_priority (val_t *);
+float       *get_conftype_rate     (val_t *);
+exinclude_t  get_conftype_exinclude(val_t *);
+int         *get_conftype_intrange (val_t *);
+
+void command_overwrite(command_option_t *command_options, t_conf_var *overwrite_var,
+                      keytab_t *keytab, val_t *valarray, char *prefix);
+
+void free_new_argv(int new_argc, char **new_argv);
+/* this corresponds to the normal output of amanda, but may
+ * be adapted to any spacing as you like.
+ */
+extern ColumnInfo ColumnData[];
+
+extern char *config_name;
+extern char *config_dir;
+
+extern int debug_amandad;
+extern int debug_amidxtaped;
+extern int debug_amindexd;
+extern int debug_amrecover;
+extern int debug_auth;
+extern int debug_event;
+extern int debug_holding;
+extern int debug_protocol;
+extern int debug_planner;
+extern int debug_driver;
+extern int debug_dumper;
+extern int debug_chunker;
+extern int debug_taper;
+extern int debug_selfcheck;
+extern int debug_sendsize;
+extern int debug_sendbackup;
+
+extern holdingdisk_t *holdingdisks;
+extern int num_holdingdisks;
+
+void parse_conf(int parse_argc, char **parse_argv, int *new_argc,
+                      char ***new_argv);
+char **get_config_options(int);
+void report_bad_conf_arg(void);
+void free_server_config(void);
+
+int read_conffile(char *filename);
+
+#define CLIENTCONFFILE_NAME "client.conf"
+
+int  add_client_conf(confparm_t parm, char *value);
+int read_clientconf(char *filename);
+char *generic_client_get_security_conf(char *, void *);
+
+int getconf_seen(confparm_t parameter);
+int getconf_boolean(confparm_t parameter);
+int getconf_int(confparm_t parameter);
+long getconf_long(confparm_t parameter);
+ssize_t getconf_size(confparm_t parameter);
+time_t getconf_time(confparm_t parameter);
+off_t getconf_am64(confparm_t parameter);
+double getconf_real(confparm_t parameter);
+char *getconf_str(confparm_t parameter);
+int getconf_taperalgo(confparm_t parameter);
+int *getconf_intrange(confparm_t parameter);
+char *getconf_byname(char *confname);
+char *getconf_list(char *listname);
+dumptype_t *lookup_dumptype(char *identifier);
+dumptype_t *read_dumptype(char *name, FILE *from, char *fname, int *linenum);
+tapetype_t *lookup_tapetype(char *identifier);
+holdingdisk_t *lookup_holdingdisk(char *identifier);
+interface_t *lookup_interface(char *identifier);
+holdingdisk_t *getconf_holdingdisks(void);
+long int getconf_unit_divisor(void);
+void dump_configuration(char *filename);
+int ColumnDataCount(void);
+int StringToColumn(char *s);
+char LastChar(char *s);
+int SetColumDataFromString(ColumnInfo* ci, char *s, char **errstr);
+ssize_t getconf_readblocksize(void);
+
+/* this is in securityconf.h */
+char *generic_get_security_conf(char *, void *);
+#endif /* ! CONFFILE_H */
index b958b6325fef1015e2dfa69ab60eccb816780d56..86c3be141131c8e2e90635920d78bc2ebfe2a12a 100644 (file)
@@ -54,6 +54,8 @@ static pid_t debug_prefix_pid = 0;
 static char *get_debug_name(time_t t, int n);
 static void debug_setup_1(char *config, char *subdir);
 static void debug_setup_2(char *s, int fd, char *notation);
+static times_t debug_start_time;
+static int debug_clock_is_running = 0;
 
 /*
  * Format and write a debug message to the process debug file.
@@ -161,7 +163,7 @@ debug_setup_1(char *config, char *subdir)
        dbgdir = stralloc2(AMANDA_DBGDIR, "/");
     if(mkpdir(dbgdir, 02700, client_uid, client_gid) == -1) {
         error("create debug directory \"%s\": %s",
-             AMANDA_DBGDIR, strerror(errno));
+             dbgdir, strerror(errno));
         /*NOTREACHED*/
     }
     amfree(sane_config);
@@ -172,9 +174,9 @@ debug_setup_1(char *config, char *subdir)
      * We assume no system has 17 digit PID-s :-) and that there will
      * not be a conflict between an old and new name.
      */
-    if((d = opendir(AMANDA_DBGDIR)) == NULL) {
+    if((d = opendir(dbgdir)) == NULL) {
         error("open debug directory \"%s\": %s",
-             AMANDA_DBGDIR, strerror(errno));
+             dbgdir, strerror(errno));
         /*NOTREACHED*/
     }
     time(&curtime);
@@ -290,6 +292,10 @@ debug_open(char *subdir)
     int i;
     char *s = NULL;
     mode_t mask;
+    amanda_timezone dontcare;
+
+    amanda_gettimeofday(&debug_start_time.r, &dontcare);
+    debug_clock_is_running = 1;
 
     /*
      * Do initial setup.
@@ -519,11 +525,16 @@ debug_prefix_time(
     static char *s = NULL;
     char *t1;
     char *t2;
+    times_t diff;
+    times_t debug_end_time;
+    amanda_timezone dontcare;
 
     save_errno = errno;
-    if (clock_is_running()) {
+    if (debug_clock_is_running == 1) {
+       amanda_gettimeofday(&debug_end_time.r, &dontcare);
+       diff = timessub(debug_end_time,debug_start_time);
        t1 = ": time ";
-       t2 = walltime_str(curclock());
+       t2 = walltime_str(diff);
     } else {
        t1 = t2 = NULL;
     }
index a4c4ba378f773ae129e6a40525091e8fd8980aeb..e6d267bb99f45bb646aa4503c3c2fd908dea2dc2 100644 (file)
@@ -25,7 +25,7 @@
  *                        University of Maryland at College Park
  */
 /* 
- * $Id: dgram.c,v 1.32.2.4 2006/10/16 18:23:53 martinea Exp $
+ * $Id: dgram.c,v 1.32 2006/07/05 19:54:20 martinea Exp $
  *
  * library routines to marshall/send, recv/unmarshall UDP packets
  */
@@ -33,6 +33,7 @@
 #include "arglist.h"
 #include "dgram.h"
 #include "util.h"
+#include "conffile.h"
 
 void
 dgram_socket(
@@ -51,34 +52,36 @@ dgram_socket(
 int
 dgram_bind(
     dgram_t *  dgram,
+    sa_family_t family,
     in_port_t *        portp)
 {
     int s, retries;
     socklen_t len;
-    struct sockaddr_in name;
+    struct sockaddr_storage name;
     int save_errno;
+    int *portrange;
 
+    portrange = getconf_intrange(CNF_RESERVED_UDP_PORT);
     *portp = (in_port_t)0;
-    if((s = socket(AF_INET, SOCK_DGRAM, 0)) == -1) {
+    if((s = socket(family, SOCK_DGRAM, 0)) == -1) {
        save_errno = errno;
        dbprintf(("%s: dgram_bind: socket() failed: %s\n",
-                 debug_prefix(NULL),
+                 debug_prefix_time(NULL),
                  strerror(save_errno)));
        errno = save_errno;
        return -1;
     }
     if(s < 0 || s >= (int)FD_SETSIZE) {
        dbprintf(("%s: dgram_bind: socket out of range: %d\n",
-                 debug_prefix(NULL),
+                 debug_prefix_time(NULL),
                  s));
        aclose(s);
        errno = EMFILE;                         /* out of range */
        return -1;
     }
 
-    memset(&name, 0, SIZEOF(name));
-    name.sin_family = (sa_family_t)AF_INET;
-    name.sin_addr.s_addr = INADDR_ANY;
+    SS_INIT(&name, family);
+    SS_SET_INADDR_ANY(&name);
 
     /*
      * If a port range was specified, we try to get a port in that
@@ -92,38 +95,24 @@ dgram_bind(
      * is within the range it requires.
      */
     for (retries = 0; ; retries++) {
-#ifdef UDPPORTRANGE
-       if (bind_portrange(s, &name, UDPPORTRANGE, "udp") == 0)
-           goto out;
-       dbprintf(("%s: dgram_bind: Could to bind to port in range: %d - %d.\n",
-                 debug_prefix(NULL), UDPPORTRANGE));
-#endif
-
-       if (bind_portrange(s, &name, (in_port_t)512,
-               (in_port_t)(IPPORT_RESERVED - 1), "udp") == 0)
-           goto out;
-       dbprintf(("%s: dgram_bind: Could to bind to port in range: 512 - %d.\n",
-                 debug_prefix(NULL), IPPORT_RESERVED - 1));
-
-       name.sin_port = INADDR_ANY;
-       if (bind(s, (struct sockaddr *)&name, (socklen_t)sizeof(name)) == 0)
+       if (bind_portrange(s, &name, portrange[0], portrange[1], "udp") == 0)
            goto out;
-       dbprintf(("%s: dgram_bind: Could to bind to any port: %s\n",
-                 debug_prefix(NULL), strerror(errno)));
-
+       dbprintf(("%s: dgram_bind: Could not bind to port in range: %d - %d.\n",
+                 debug_prefix_time(NULL), portrange[0], portrange[1]));
        if (retries >= BIND_CYCLE_RETRIES) {
-           dbprintf(("%s: dgram_bind: Giving up...\n", debug_prefix(NULL)));
+           dbprintf(("%s: dgram_bind: Giving up...\n",
+                     debug_prefix_time(NULL)));
            break;
        }
 
        dbprintf(("%s: dgram_bind: Retrying entire range after 10 second delay.\n",
-                 debug_prefix(NULL)));
+                 debug_prefix_time(NULL)));
        sleep(15);
     }
 
     save_errno = errno;
-    dbprintf(("%s: dgram_bind: bind(INADDR_ANY) failed: %s\n",
-                 debug_prefix(NULL),
+    dbprintf(("%s: dgram_bind: bind(in6addr_any) failed: %s\n",
+                 debug_prefix_time(NULL),
                  strerror(save_errno)));
     aclose(s);
     errno = save_errno;
@@ -136,31 +125,28 @@ out:
     if(getsockname(s, (struct sockaddr *)&name, &len) == -1) {
        save_errno = errno;
        dbprintf(("%s: dgram_bind: getsockname() failed: %s\n",
-                 debug_prefix(NULL),
+                 debug_prefix_time(NULL),
                  strerror(save_errno)));
        errno = save_errno;
        aclose(s);
        return -1;
     }
-    *portp = (in_port_t)ntohs(name.sin_port);
+    *portp = SS_GET_PORT(&name);
     dgram->socket = s;
 
-    dbprintf(("%s: dgram_bind: socket bound to %s.%d\n",
-             debug_prefix_time(NULL),
-             inet_ntoa(name.sin_addr),
-             *portp));
+    dbprintf(("%s: dgram_bind: socket %d bound to %s\n",
+             debug_prefix_time(NULL), dgram->socket, str_sockaddr(&name)));
     return 0;
 }
 
 
 int
 dgram_send_addr(
-    struct sockaddr_in addr,
+    struct sockaddr_storage    *addr,
     dgram_t *          dgram)
 {
     int s, rc;
     int socket_opened;
-    struct sockaddr_in addr_save;
     int save_errno;
     int max_wait;
     int wait_count;
@@ -170,18 +156,18 @@ dgram_send_addr(
 #endif
 
     dbprintf(("%s: dgram_send_addr(addr=%p, dgram=%p)\n",
-                       debug_prefix(NULL), &addr, dgram));
-    dump_sockaddr(&addr);
+             debug_prefix_time(NULL), addr, dgram));
+    dump_sockaddr(addr);
     dbprintf(("%s: dgram_send_addr: %p->socket = %d\n",
-                       debug_prefix(NULL), dgram, dgram->socket));
+             debug_prefix_time(NULL), dgram, dgram->socket));
     if(dgram->socket != -1) {
        s = dgram->socket;
        socket_opened = 0;
     } else {
-       if((s = socket(AF_INET, SOCK_DGRAM, 0)) == -1) {
+       if((s = socket(addr->ss_family, SOCK_DGRAM, 0)) == -1) {
            save_errno = errno;
            dbprintf(("%s: dgram_send_addr: socket() failed: %s\n",
-                     debug_prefix(NULL),
+                     debug_prefix_time(NULL),
                      strerror(save_errno)));
            errno = save_errno;
            return -1;
@@ -192,16 +178,15 @@ dgram_send_addr(
                (void *)&on, (socklen_t)sizeof(on));
        if (r < 0) {
            dbprintf(("%s: dgram_send_addr: setsockopt(SO_REUSEADDR) failed: %s\n",
-                         debug_prefix(NULL),
-                         strerror(errno)));
+                     debug_prefix_time(NULL),
+                     strerror(errno)));
        }
 #endif
     }
 
-    memcpy(&addr_save, &addr, SIZEOF(addr));
     if(s < 0 || s >= FD_SETSIZE) {
        dbprintf(("%s: dgram_send_addr: socket out of range: %d\n",
-                 debug_prefix(NULL),
+                 debug_prefix_time(NULL),
                  s));
        errno = EMFILE;                         /* out of range */
        rc = -1;
@@ -213,15 +198,14 @@ dgram_send_addr(
                 dgram->data,
                 dgram->len,
                 0, 
-                (struct sockaddr *)&addr,
-                (int)sizeof(struct sockaddr_in)) == -1) {
+                (struct sockaddr *)addr,
+                SS_LEN(addr)) == -1) {
 #ifdef ECONNREFUSED
            if(errno == ECONNREFUSED && wait_count++ < max_wait) {
                sleep(5);
-               dbprintf(("%s: dgram_send_addr: sendto(%s.%hu): retry %d after ECONNREFUSED\n",
+               dbprintf(("%s: dgram_send_addr: sendto(%s): retry %d after ECONNREFUSED\n",
                      debug_prefix_time(NULL),
-                     inet_ntoa(addr_save.sin_addr),
-                     (in_port_t)ntohs(addr.sin_port),
+                     str_sockaddr(addr),
                      wait_count));
                continue;
            }
@@ -229,19 +213,17 @@ dgram_send_addr(
 #ifdef EAGAIN
            if(errno == EAGAIN && wait_count++ < max_wait) {
                sleep(5);
-               dbprintf(("%s: dgram_send_addr: sendto(%s.%hu): retry %d after EAGAIN\n",
+               dbprintf(("%s: dgram_send_addr: sendto(%s): retry %d after EAGAIN\n",
                      debug_prefix_time(NULL),
-                     inet_ntoa(addr_save.sin_addr),
-                     (in_port_t)ntohs(addr.sin_port),
+                     str_sockaddr(addr),
                      wait_count));
                continue;
            }
 #endif
            save_errno = errno;
-           dbprintf(("%s: dgram_send_addr: sendto(%s.%d) failed: %s \n",
+           dbprintf(("%s: dgram_send_addr: sendto(%s) failed: %s \n",
                  debug_prefix_time(NULL),
-                 inet_ntoa(addr_save.sin_addr),
-                 (int) ntohs(addr.sin_port),
+                 str_sockaddr(addr),
                  strerror(save_errno)));
            errno = save_errno;
            rc = -1;
@@ -252,10 +234,9 @@ dgram_send_addr(
     if(socket_opened) {
        save_errno = errno;
        if(close(s) == -1) {
-           dbprintf(("%s: dgram_send_addr: close(%s.%d): failed: %s\n",
-                     debug_prefix(NULL),
-                     inet_ntoa(addr_save.sin_addr),
-                     (int) ntohs(addr.sin_port),
+           dbprintf(("%s: dgram_send_addr: close(%s): failed: %s\n",
+                     debug_prefix_time(NULL),
+                     str_sockaddr(addr),
                      strerror(errno)));
            /*
             * Calling function should not care that the close failed.
@@ -269,37 +250,11 @@ dgram_send_addr(
 }
 
 
-int
-dgram_send(
-    char *     hostname,
-    in_port_t  port,
-    dgram_t *  dgram)
-{
-    struct sockaddr_in name;
-    struct hostent *hp;
-    int save_errno;
-
-    if((hp = gethostbyname(hostname)) == 0) {
-       save_errno = errno;
-       dbprintf(("%s: dgram_send: gethostbyname(%s) failed\n",
-                 debug_prefix_time(NULL),
-                 hostname));
-       errno = save_errno;
-       return -1;
-    }
-    memcpy(&name.sin_addr, hp->h_addr, (size_t)hp->h_length);
-    name.sin_family = (sa_family_t)AF_INET;
-    name.sin_port = (in_port_t)htons(port);
-
-    return dgram_send_addr(name, dgram);
-}
-
-
 ssize_t
 dgram_recv(
     dgram_t *          dgram,
     int                        timeout,
-    struct sockaddr_in *fromaddr)
+    struct sockaddr_storage *fromaddr)
 {
     SELECT_ARG_TYPE ready;
     struct timeval to;
@@ -350,13 +305,13 @@ dgram_recv(
        return nfound;
     }
 
-    addrlen = (socklen_t)sizeof(struct sockaddr_in);
+    addrlen = (socklen_t)sizeof(struct sockaddr_storage);
     size = recvfrom(sock, dgram->data, (size_t)MAX_DGRAM, 0,
                    (struct sockaddr *)fromaddr, &addrlen);
     if(size == -1) {
        save_errno = errno;
        dbprintf(("%s: dgram_recv: recvfrom() failed: %s\n",
-                 debug_prefix(NULL),
+                 debug_prefix_time(NULL),
                  strerror(save_errno)));
        errno = save_errno;
        return -1;
index dbacc9f4b869fd73f1b2a077409468dee39c32b4..eb5fbfd33b673d0c7035fd3a938d5cdddf548ba4 100644 (file)
@@ -48,11 +48,11 @@ typedef struct dgram_s {
     char data[MAX_DGRAM+1];
 } dgram_t;
 
-int    dgram_bind(dgram_t *dgram, in_port_t *portp);
+int    dgram_bind(dgram_t *dgram, sa_family_t family, in_port_t *portp);
 void   dgram_socket(dgram_t *dgram, int sock);
-int    dgram_send(char *hostname, in_port_t port, dgram_t *dgram);
-int    dgram_send_addr(struct sockaddr_in addr, dgram_t *dgram);
-ssize_t        dgram_recv(dgram_t *dgram, int timeout, struct sockaddr_in *fromaddr);
+int    dgram_send_addr(struct sockaddr_storage *addr, dgram_t *dgram);
+ssize_t        dgram_recv(dgram_t *dgram, int timeout,
+                  struct sockaddr_storage *fromaddr);
 void   dgram_zero(dgram_t *dgram);
 int    dgram_cat(dgram_t *dgram, const char *fmt, ...)
     __attribute__ ((format (printf, 2, 3)));
index 94ae1ac7aeb0efe946972c46b0235bfdde22833c..0959c721ebb47c58d9b8ce4ffc9e91dbeac99871 100644 (file)
  * file named AUTHORS, in the root directory of this distribution.
  */
 /*
- * $Id: event.c,v 1.24.2.1 2006/12/12 14:56:38 martinea Exp $
+ * $Id: event.c,v 1.24 2006/06/16 10:55:05 martinea Exp $
  *
  * Event handler.  Serializes different kinds of events to allow for
  * a uniform interface, central state storage, and centralized
  * interdependency logic.
  */
 
-/*#define      EVENT_DEBUG*/
-
-#ifdef EVENT_DEBUG
-#define eventprintf(x)    dbprintf(x)
-#else
-#define eventprintf(x)
-#endif
-
 #include "amanda.h"
 #include "event.h"
 #include "queue.h"
+#include "conffile.h"
+
+#define event_debug(i,x) do {                          \
+       if ((i) <= debug_event) {       \
+           dbprintf(x);                                \
+       }                                               \
+} while (0)
 
 /*
  * The opaque handle passed back to the caller.  This is typedefed to
@@ -89,9 +88,7 @@ static struct sigtabent {
     void (*oldhandler)(int);/* old handler (for unsetting) */
 } sigtable[NSIG];
 
-#ifdef EVENT_DEBUG
 static const char *event_type2str(event_type_t);
-#endif
 #define        fire(eh)        (*(eh)->fn)((eh)->arg)
 static void signal_handler(int);
 static event_handle_t *gethandle(void);
@@ -143,9 +140,9 @@ event_register(
     eventq_add(eventq, handle);
     eventq.qlength++;
 
-    eventprintf(("%s: event: register: %p->data=%lu, type=%s\n",
-               debug_prefix_time(NULL), handle, handle->data,
-               event_type2str(handle->type)));
+    event_debug(1, ("%s: event: register: %p->data=%lu, type=%s\n",
+                   debug_prefix_time(NULL), handle, handle->data,
+                   event_type2str(handle->type)));
     return (handle);
 }
 
@@ -161,9 +158,9 @@ event_release(
 
     assert(handle != NULL);
 
-    eventprintf(("%s: event: release (mark): %p data=%lu, type=%s\n",
-                debug_prefix_time(NULL), handle, handle->data,
-                event_type2str(handle->type)));
+    event_debug(1, ("%s: event: release (mark): %p data=%lu, type=%s\n",
+                   debug_prefix_time(NULL), handle, handle->data,
+                   event_type2str(handle->type)));
     assert(handle->type != EV_DEAD);
 
     /*
@@ -201,14 +198,14 @@ event_wakeup(
     event_handle_t *eh;
     int nwaken = 0;
 
-    eventprintf(("%s: event: wakeup: enter (%lu)\n",
-                debug_prefix_time(NULL), id));
+    event_debug(1, ("%s: event: wakeup: enter (%lu)\n",
+                   debug_prefix_time(NULL), id));
 
     for (eh = eventq_first(eventq); eh != NULL; eh = eventq_next(eh)) {
 
        if (eh->type == EV_WAIT && eh->data == id) {
-           eventprintf(("%s: event: wakeup: %p id=%lu\n",
-                        debug_prefix_time(NULL), eh, id));
+           event_debug(1, ("%s: event: wakeup: %p id=%lu\n",
+                           debug_prefix_time(NULL), eh, id));
            fire(eh);
            nwaken++;
        }
@@ -251,7 +248,7 @@ event_loop_wait(
 #ifdef ASSERTIONS
     static int entry = 0;
 #endif
-    fd_set readfds, writefds, errfds, werrfds;
+    SELECT_ARG_TYPE readfds, writefds, errfds, werrfds;
     struct timeval timeout, *tvptr;
     int ntries, maxfd, rc;
     long interval;
@@ -261,9 +258,9 @@ event_loop_wait(
     int event_wait_fired = 0;
     int see_event;
 
-    eventprintf(("%s: event: loop: enter: dontblock=%d, qlength=%d, eh=%p\n",
-                debug_prefix_time(NULL),
-                dontblock, eventq.qlength, wait_eh));
+    event_debug(1, ("%s: event: loop: enter: dontblock=%d, qlength=%d, eh=%p\n",
+                   debug_prefix_time(NULL),
+                   dontblock, eventq.qlength, wait_eh));
 
     /*
      * If we have no events, we have nothing to do
@@ -285,17 +282,17 @@ event_loop_wait(
     curtime = time(NULL);
 
     do {
-#ifdef EVENT_DEBUG
-       eventprintf(("%s: event: loop: dontblock=%d, qlength=%d eh=%p\n",
-                    debug_prefix_time(NULL), dontblock, eventq.qlength,
-                    wait_eh));
-       for (eh = eventq_first(eventq); eh != NULL; eh = eventq_next(eh)) {
-           eventprintf(("%s: %p): %s data=%lu fn=%p arg=%p\n",
-                        debug_prefix_time(NULL), eh,
-                        event_type2str(eh->type), eh->data, eh->fn,
-                        eh->arg));
+       if (debug_event >= 1) {
+           event_debug(1, ("%s: event: loop: dontblock=%d, qlength=%d eh=%p\n",
+                           debug_prefix_time(NULL), dontblock, eventq.qlength,
+                           wait_eh));
+           for (eh = eventq_first(eventq); eh != NULL; eh = eventq_next(eh)) {
+               event_debug(1, ("%s: %p): %s data=%lu fn=%p arg=%p\n",
+                               debug_prefix_time(NULL), eh,
+                               event_type2str(eh->type), eh->data, eh->fn,
+                               eh->arg));
+           }
        }
-#endif
        /*
         * Set ourselves up with no timeout initially.
         */
@@ -429,13 +426,13 @@ event_loop_wait(
        /*
         * Let 'er rip
         */
-       eventprintf((
-                   "%s: event: select: dontblock=%d, maxfd=%d, timeout=%ld\n",
-                   debug_prefix_time(NULL), dontblock, maxfd,
-                   tvptr != NULL ? timeout.tv_sec : -1));
+       event_debug(1,
+                   ("%s: event: select: dontblock=%d, maxfd=%d, timeout=%ld\n",
+                    debug_prefix_time(NULL), dontblock, maxfd,
+                    tvptr != NULL ? timeout.tv_sec : -1));
        rc = select(maxfd + 1, &readfds, &writefds, &errfds, tvptr);
-       eventprintf(("%s: event: select returns %d\n",
-                    debug_prefix_time(NULL), rc));
+       event_debug(1, ("%s: event: select returns %d\n",
+                       debug_prefix_time(NULL), rc));
 
        /*
         * Select errors can mean many things.  Interrupted events should
@@ -601,7 +598,6 @@ puthandle(
     cache.qlength++;
 }
 
-#ifdef EVENT_DEBUG
 /*
  * Convert an event type into a string
  */
@@ -629,4 +625,3 @@ event_type2str(
            return (event_types[i].name);
     return ("BOGUS EVENT TYPE");
 }
-#endif /* EVENT_DEBUG */
index 62cf171bab4da3dc2c53ce53c4a3dece1ddabc62..cadcf0a31499b47c240a68451a75d59f71422ce5 100644 (file)
@@ -23,7 +23,7 @@
  * Author: AMANDA core development group.
  */
 /*
- * $Id: file.c,v 1.40.2.1 2006/11/24 18:05:05 martinea Exp $
+ * $Id: file.c,v 1.40 2006/07/19 17:41:15 martinea Exp $
  *
  * file and directory bashing routines
  */
@@ -31,7 +31,6 @@
 #include "amanda.h"
 #include "util.h"
 
-void amanda_setup(int argc, char **argv, int setup_flags);
 static int mk1dir(const char *, mode_t, uid_t, gid_t);
 static void areads_getbuf(const char *s, int l, int fd);
 
@@ -54,8 +53,8 @@ mk1dir(
     int rc;    /* return code */
 
     if((rc = mkdir(dir, mode)) == 0) {
-       if ((rc = chmod(dir, mode)) == 0) { /* mkdir() affected by the umask */
-           rc = chown(dir, uid, gid);
+       if ((rc = chown(dir, uid, gid)) == 0) { /* mkdir() affected by the umask */
+           rc = chmod(dir, mode);
        }
     } else {                   /* maybe someone beat us to it */
        int serrno;
@@ -156,28 +155,6 @@ rmpdir(
 }
 
 
-/*
- *=====================================================================
- * Do Amanda setup for all programs.
- *
- * void amanda_setup (int argc, char **argv, int setup_flags)
- *
- * entry:      setup_flags (see AMANDA_SETUP_FLAG_xxx)
- * exit:       none
- *=====================================================================
- */
-
-void
-amanda_setup (
-    int                argc,
-    char **    argv,
-    int                setup_flags)
-{
-    (void)argc;                /* Quiet unused parameter warning */
-    (void)argv;                /* Quiet unused parameter warning */
-    (void)setup_flags; /* Quiet unused parameter warning */
-}
-
 /*
  *=====================================================================
  * Change directory to a "safe" location and set some base environment.
index f6786a891cb128ee7ab5dbb01f9c94167ac30b2b..9d18d8cf1d30fc246f1880e1ea836c0f16a629db 100644 (file)
@@ -383,7 +383,7 @@ parse_file_header(
            line += SIZEOF(SC) - 1;
            strncpy(file->cont_filename, line,
                    SIZEOF(file->cont_filename) - 1);
-                   continue;
+           continue;
        }
 #undef SC
 
@@ -394,6 +394,14 @@ parse_file_header(
            continue;
        }
 #undef SC
+#define SC "DUMPER="
+       if (strncmp(line, SC, SIZEOF(SC) - 1) == 0) {
+           line += SIZEOF(SC) - 1;
+           strncpy(file->dumper, line,
+                   SIZEOF(file->dumper) - 1);
+           continue;
+       }
+#undef SC
 
 #define SC "To restore, position tape at start of file and run:"
        if (strncmp(line, SC, SIZEOF(SC) - 1) == 0)
@@ -479,6 +487,7 @@ dump_dumpfile_t(
        dbprintf(("%s:     name             = '%s'\n", pname, file->name));
        dbprintf(("%s:     disk             = '%s'\n", pname, file->disk));
        dbprintf(("%s:     program          = '%s'\n", pname, file->program));
+       dbprintf(("%s:     dumper           = '%s'\n", pname, file->dumper));
        dbprintf(("%s:     srvcompprog      = '%s'\n", pname,
                        file->srvcompprog));
        dbprintf(("%s:     clntcompprog     = '%s'\n", pname,
@@ -602,7 +611,7 @@ build_header(
          buflen -= n;
          n = 0;
        }
-     
+
        if (strcmp(file->encrypt_suffix, "enc") == 0) {  /* only output crypt if it's enabled */
          n = snprintf(buffer, buflen, " crypt %s", file->encrypt_suffix);
        }
@@ -658,6 +667,11 @@ build_header(
            buffer += n;
            buflen -= n;
        }
+       if (file->dumper[0] != '\0') {
+           n = snprintf(buffer, buflen, "DUMPER=%s\n", file->dumper);
+           buffer += n;
+           buflen -= n;
+       }
        if (file->is_partial != 0) {
            n = snprintf(buffer, buflen, "PARTIAL=YES\n");
            buffer += n;
index c6213fec31854d42936f2b1c6adc942b60a64783..ea7bda5eeca33de70c3de12f08b06695922e7cce 100644 (file)
@@ -53,6 +53,7 @@ typedef struct file_s {
     string_t name;     /* hostname or label */
     string_t disk;
     string_t program;
+    string_t dumper;
     string_t srvcompprog;
     string_t clntcompprog;
     string_t srv_encrypt;
diff --git a/common-src/getcwd.c b/common-src/getcwd.c
deleted file mode 100644 (file)
index 74baeb9..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/* 
- * getcwd.c --
- *
- *     This file provides an implementation of the getcwd procedure
- *     that uses getwd, for systems with getwd but without getcwd.
- *
- * Copyright (c) 1993 The Regents of the University of California.
- * All rights reserved.
- *
- * Permission is hereby granted, without written agreement and without
- * license or royalty fees, to use, copy, modify, and distribute this
- * software and its documentation for any purpose, provided that the
- * above copyright notice and the following two paragraphs appear in
- * all copies of this software.
- * 
- * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
- * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT
- * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
- * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
- * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
- * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
- * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
- */
-
-/* $Id: getcwd.c,v 1.5 2006/05/25 01:47:12 johnfranks Exp $ */
-
-#ifndef lint
-static char rcsid[] = "$Header: /cvsroot/amanda/amanda/common-src/getcwd.c,v 1.5 2006/05/25 01:47:12 johnfranks Exp $ SPRITE (Berkeley)";
-#endif /* not lint */
-
-#include "amanda.h"
-
-extern char *getwd();
-extern int errno;
-
-char *
-getcwd(buf, size)
-    char *buf;                 /* Where to put path for current directory. */
-    size_t size;                       /* Number of bytes at buf. */
-{
-    char realBuffer[MAXPATHLEN+1];
-    int length;
-
-    if (getwd(realBuffer) == NULL) {
-       /*
-        * There's not much we can do besides guess at an errno to
-        * use for the result (the error message in realBuffer isn't
-        * much use...).
-        */
-
-       errno = EACCES;
-       return NULL;
-    }
-    length = strlen(realBuffer);
-    if (length >= size) {
-       errno = ERANGE;
-       return NULL;
-    }
-    strncpy(buf, realBuffer, size-1);
-    buf[size-1] = '\0';
-    return buf;
-}
index 6a3dad380be0713e9afabfafcb66dbc24a70ad4f..b4ca980c2a7de080b758c9a70356a25081723516 100644 (file)
@@ -69,7 +69,7 @@ int kuserok(AUTH_DAT *, char *);
  */
 struct krb4_handle {
     security_handle_t sech;    /* MUST be first */
-    struct sockaddr_in peer;   /* host on other side */
+    struct sockaddr_in6 peer;  /* host on other side */
     char hostname[MAX_HOSTNAME_LENGTH+1];      /* human form of above */
     char proto_handle[32];     /* protocol handle for this req */
     int sequence;              /* last sequence number we received */
@@ -156,6 +156,8 @@ const security_driver_t krb4_security_driver = {
     krb4_stream_read_sync,
     krb4_stream_read_cancel,
     sec_close_connection_none,
+    NULL,
+    NULL
 };
 
 /*
@@ -375,9 +377,9 @@ krb4_connect(
        return;
     }
     if ((se = getservbyname(KAMANDA_SERVICE_NAME, "udp")) == NULL)
-       port = (int)htons(KAMANDA_SERVICE_DEFAULT);
+       port = (int)KAMANDA_SERVICE_DEFAULT;
     else
-       port = se->s_port;
+       port = ntohs(se->s_port);
     snprintf(handle, SIZEOF(handle), "%ld", (long)time(NULL));
     inithandle(kh, he, (int)port, handle);
     (*fn)(arg, &kh->sech, S_OK);
@@ -451,9 +453,9 @@ inithandle(
      * Setup our peer info.  We don't do anything with the sequence yet,
      * so just leave it at 0.
      */
-    kh->peer.sin_family = (sa_family_t)AF_INET;
-    kh->peer.sin_port = (in_port_t)port;
-    kh->peer.sin_addr = *(struct in_addr *)he->h_addr;
+    kh->peer.sin6_family = (sa_family_t)AF_INET6;
+    kh->peer.sin6_port = (in_port_t)port;
+    kh->peer.sin6_addr = *(struct in6_addr *)he->h_addr;
     strncpy(kh->proto_handle, handle, SIZEOF(kh->proto_handle) - 1);
     kh->proto_handle[SIZEOF(kh->proto_handle) - 1] = '\0';
     kh->sequence = 0;
@@ -532,7 +534,7 @@ krb4_sendpkt(
      * Add the body, and send it
      */
     dgram_cat(&netfd, pkt->body);
-    if (dgram_send_addr(kh->peer, &netfd) != 0) {
+    if (dgram_send_addr(&kh->peer, &netfd) != 0) {
        security_seterror(&kh->sech,
            "send %s to %s failed: %s", pkt_type2str(pkt->type),
            kh->hostname, strerror(errno));
@@ -972,7 +974,7 @@ recvpkt_callback(
     void *     cookie)
 {
     char handle[32];
-    struct sockaddr_in peer;
+    struct sockaddr_in6 peer;
     pkt_t pkt;
     int sequence;
     struct krb4_handle *kh;
@@ -995,9 +997,7 @@ recvpkt_callback(
 
     for (kh = handleq_first(); kh != NULL; kh = handleq_next(kh)) {
        if (strcmp(kh->proto_handle, handle) == 0 &&
-           memcmp(&kh->peer.sin_addr, &peer.sin_addr,
-           SIZEOF(peer.sin_addr)) == 0 &&
-           kh->peer.sin_port == peer.sin_port) {
+           cmp_sockaddr(&kh->peer, &peer, 0) == 0) {
            kh->sequence = sequence;
 
            /*
@@ -1021,12 +1021,12 @@ recvpkt_callback(
     if (accept_fn == NULL)
        return;
 
-    he = gethostbyaddr((void *)&peer.sin_addr, SIZEOF(peer.sin_addr), AF_INET);
+    he = gethostbyaddr((void *)&peer.sin6_addr, SIZEOF(peer.sin6_addr), AF_INET6);
     if (he == NULL)
        return;
     kh = alloc(SIZEOF(*kh));
     security_handleinit(&kh->sech, &krb4_security_driver);
-    inithandle(kh, he, (int)peer.sin_port, handle);
+    inithandle(kh, he, (int)peer.sin6_port, handle);
 
     /*
      * Check the security of the packet.  If it is bad, then pass NULL
@@ -1315,7 +1315,7 @@ check_ticket(
 
     /* get the checksum out of the ticket */
     rc = krb_rd_req(&ticket, CLIENT_HOST_PRINCIPLE, inst,
-       kh->peer.sin_addr.s_addr, &auth, CLIENT_HOST_KEY_FILE);
+       kh->peer.sin6_addr.s_addr, &auth, CLIENT_HOST_KEY_FILE);
     if (rc != 0) {
        security_seterror(&kh->sech,
            "krb_rd_req failed for %s: %s (%d)", kh->hostname,
@@ -1695,7 +1695,7 @@ net_read(
     char *buf = vbuf;  /* ptr arith */
     ssize_t n;
     int neof = 0;
-    fd_set readfds;
+    SELECT_ARG_TYPE readfds;
     struct timeval tv;
 
     while (size > 0) {
index b7e6e710caaccad17d03783922071156b5aeafff..5b3d76a416afe55584d4e0c245fbc3caaf0c9350 100644 (file)
  * $Id: krb5-security.c,v 1.22 2006/06/16 10:55:05 martinea Exp $
  *
  * krb5-security.c - kerberos V5 security module
+ *
+ * XXX still need to check for initial keyword on connect so we can skip
+ * over shell garbage and other stuff that krb5 might want to spew out.
  */
 
-#include "config.h"
-#ifdef KRB5_SECURITY
 #include "amanda.h"
 #include "util.h"
-#include "arglist.h"
 #include "event.h"
 #include "packet.h"
 #include "queue.h"
 #include "stream.h"
 #include "version.h"
 
-#define        BROKEN_MEMORY_CCACHE
+#ifdef KRB5_HEIMDAL_INCLUDES
+#include "com_err.h"
+#endif
+
+#ifdef KRB5_SECURITY
+
+#define BROKEN_MEMORY_CCACHE
 
 #ifdef BROKEN_MEMORY_CCACHE
 /*
@@ -59,7 +65,6 @@
 #endif  /* HAVE_ON_EXIT */
 #endif  /* ! HAVE_ATEXIT */
 #endif
-
 #ifndef KRB5_HEIMDAL_INCLUDES
 #include <gssapi/gssapi_generic.h>
 #else
 #include <krb5.h>
 
 #ifndef KRB5_ENV_CCNAME
-#define        KRB5_ENV_CCNAME "KRB5CCNAME"
+#define KRB5_ENV_CCNAME "KRB5CCNAME"
 #endif
 
-/*#define      KRB5_DEBUG*/
+#define k5printf(x)     auth_debug(1,x)
 
-#ifdef KRB5_DEBUG
-#define        k5printf(x)     dbprintf(x)
-#else
-#define        k5printf(x)
-#endif
 
 /*
  * consider undefining when kdestroy() is fixed.  The current version does
  * not work under krb5-1.2.4 in rh7.3, perhaps others.
  */
-#define KDESTROY_VIA_UNLINK    1
+#define KDESTROY_VIA_UNLINK     1
 
 /*
  * Define this if you want all network traffic encrypted.  This will
  *
  * It would be nice if we could do this on a filesystem-by-filesystem basis.
  */
-/*#define      AMANDA_KRB5_ENCRYPT*/
+/*#define       AMANDA_KRB5_ENCRYPT*/
 
 /*
  * Where the keytab lives, if defined.  Otherwise it expects something in the
  * config file.
  */
-/* #define AMANDA_KEYTAB       "/.amanda-v5-keytab" */
+/* #define AMANDA_KEYTAB        "/.amanda-v5-keytab" */
 
 /*
  * The name of the principal we authenticate with, if defined.  Otherwise
  * it expects something in the config file.
  */
-/* #define     AMANDA_PRINCIPAL        "service/amanda" */
+/* #define      AMANDA_PRINCIPAL        "service/amanda" */
 
 /*
  * The lifetime of our tickets in seconds.  This may or may not need to be
  * configurable.
  */
-#define        AMANDA_TKT_LIFETIME     (12*60*60)
+#define AMANDA_TKT_LIFETIME     (12*60*60)
+
 
 /*
  * The name of the service in /etc/services.  This probably shouldn't be
  * configurable.
  */
-#define        AMANDA_KRB5_SERVICE_NAME        "k5amanda"
+#define AMANDA_KRB5_SERVICE_NAME        "k5amanda"
 
 /*
  * The default port to use if above entry in /etc/services doesn't exist
  */
-#define        AMANDA_KRB5_DEFAULT_PORT        10082
+#define AMANDA_KRB5_DEFAULT_PORT        10082
 
 /*
  * The timeout in seconds for each step of the GSS negotiation phase
  */
-#define        GSS_TIMEOUT                     30
+#define GSS_TIMEOUT                     30
 
 /*
  * The largest buffer we can send/receive.
  */
-#define        AMANDA_MAX_TOK_SIZE             (MAX_TAPE_BLOCK_BYTES * 4)
-
-/*
- * Magic values for krb5_conn->handle
- */
-#define        H_EOF   -1              /* this connection has been shut down */
+#define AMANDA_MAX_TOK_SIZE             (MAX_TAPE_BLOCK_BYTES * 4)
 
 /*
  * This is the tcp stream buffer size
  */
-#define        KRB5_STREAM_BUFSIZE     (MAX_TAPE_BLOCK_BYTES * 2)
+#define KRB5_STREAM_BUFSIZE     (MAX_TAPE_BLOCK_BYTES * 2)
 
 /*
  * This is the max number of outgoing connections we can have at once.
  * to contact everything.  We need to limit this to avoid blowing
  * the max number of open file descriptors a process can have.
  */
-#define        AMANDA_KRB5_MAXCONN     40
+#define AMANDA_KRB5_MAXCONN     40
 
-/*
- * This is a frame read off of the connection.  Each frame has an
- * associated handle and a gss_buffer which contains a len,value pair.
- */
-struct krb5_frame {
-    int handle;                                /* proto handle */
-    gss_buffer_desc tok;               /* token */
-    TAILQ_ENTRY(krb5_frame) tq;                /* queue handle */
-};
 
 /*
- * This is a krb5 connection to a host.  We should only have
- * one connection per host.
+ * Number of seconds krb5 has to start up
  */
-struct krb5_conn {
-    int fd;                                    /* tcp connection */
-    struct {                                   /* buffer read() calls */
-       char buf[KRB5_STREAM_BUFSIZE];          /* buffer */
-       size_t left;                    /* unread data */
-       ssize_t size;                   /* size of last read */
-    } readbuf;
-    enum { unauthed, authed } state;
-    event_handle_t *ev_read;                   /* read (EV_READFD) handle */
-    int ev_read_refcnt;                                /* number of readers */
-    char hostname[MAX_HOSTNAME_LENGTH+1];      /* human form of above */
-    char *errmsg;                              /* error passed up */
-    gss_ctx_id_t gss_context;                  /* GSSAPI context */
-    int refcnt;                                        /* number of handles using */
-    TAILQ_HEAD(, krb5_frame) frameq;           /* queue of read frames */
-    TAILQ_ENTRY(krb5_conn) tq;                 /* queue handle */
-};
-
-
-struct krb5_stream;
+#define        CONNECT_TIMEOUT 20
 
 /*
- * This is the private handle data.
+ * Cache the local hostname
  */
-struct krb5_handle {
-    security_handle_t sech;            /* MUST be first */
-    char *hostname;                    /* ptr to kc->hostname */
-    struct krb5_stream *ks;            /* virtual stream we xmit over */
-
-    union {
-       void (*recvpkt)(void *, pkt_t *, security_status_t);
-                                       /* func to call when packet recvd */
-       void (*connect)(void *, security_handle_t *, security_status_t);
-                                       /* func to call when connected */
-    } fn;
-    void *arg;                         /* argument to pass function */
-    void *datap;                       /* argument to pass function */
-    event_handle_t *ev_wait;           /* wait handle for connects */
-    char *(*conf_fn)(char *, void *); /* used to get config info */
-    event_handle_t *ev_timeout;                /* timeout handle for recv */
-};
+static char myhostname[MAX_HOSTNAME_LENGTH+1];
 
-/*
- * This is the internal security_stream data for krb5.
- */
-struct krb5_stream {
-    security_stream_t secstr;          /* MUST be first */
-    struct krb5_conn *kc;              /* physical connection */
-    int handle;                                /* protocol handle */
-    event_handle_t *ev_read;           /* read (EV_WAIT) event handle */
-    void (*fn)(void *, void *, ssize_t);/* read event fn */
-    void *arg;                         /* arg for previous */
-    char buf[KRB5_STREAM_BUFSIZE];
-    ssize_t len;
-};
 
 /*
  * Interface functions
  */
-static ssize_t krb5_sendpkt(void *, pkt_t *);
-static int     krb5_stream_accept(void *);
-static int     krb5_stream_auth(void *);
-static int     krb5_stream_id(void *);
-static int     krb5_stream_write(void *, const void *, size_t);
-static void *  krb5_stream_client(void *, int);
-static void *  krb5_stream_server(void *);
-static void    krb5_accept(const struct security_driver *, int, int,
-                       void (*)(security_handle_t *, pkt_t *));
-static void    krb5_close(void *);
-static void    krb5_connect(const char *, char *(*)(char *, void *),
-                       void (*)(void *, security_handle_t *, security_status_t),
-                       void *, void *);
-static void    krb5_recvpkt(void *, void (*)(void *, pkt_t *, security_status_t),
-                       void *, int);
-static void    krb5_recvpkt_cancel(void *);
-static void    krb5_stream_close(void *);
-static void    krb5_stream_read(void *, void (*)(void *, void *, ssize_t), void *);
-static ssize_t krb5_stream_read_sync(void *, void **);
-static void    krb5_stream_read_cancel(void *);
+static void krb5_accept(const struct security_driver *, int, int,
+    void (*)(security_handle_t *, pkt_t *));
+static void krb5_connect(const char *,
+    char *(*)(char *, void *), 
+    void (*)(void *, security_handle_t *, security_status_t), void *, void *);
+
+static void krb5_init(void);
+#ifdef BROKEN_MEMORY_CCACHE
+static void cleanup(void);
+#endif
+static const char *get_tgt(char *keytab_name, char *principal_name);
+static int        gss_server(struct tcp_conn *);
+static int        gss_client(struct sec_handle *);
+static const char *gss_error(OM_uint32, OM_uint32);
+static char       *krb5_checkuser(char *host, char *name, char *realm);
+
+#ifdef AMANDA_KRB5_ENCRYPT
+static int k5_encrypt(void *cookie, void *buf, ssize_t buflen,
+                     void **encbuf, ssize_t *encbuflen);
+static int k5_decrypt(void *cookie, void *buf, ssize_t buflen,
+                     void **encbuf, ssize_t *encbuflen);
+#endif
 
 /*
  * This is our interface to the outside world.
  */
 const security_driver_t krb5_security_driver = {
-    "krb5",
+    "KRB5",
     krb5_connect,
     krb5_accept,
-    krb5_close,
-    krb5_sendpkt,
-    krb5_recvpkt,
-    krb5_recvpkt_cancel,
-    krb5_stream_server,
-    krb5_stream_accept,
-    krb5_stream_client,
-    krb5_stream_close,
-    krb5_stream_auth,
-    krb5_stream_id,
-    krb5_stream_write,
-    krb5_stream_read,
-    krb5_stream_read_sync,
-    krb5_stream_read_cancel,
-    sec_close_connection_none,
-};
-
-/*
- * Cache the local hostname
- */
-static char hostname[MAX_HOSTNAME_LENGTH+1];
-
-/*
- * This is a queue of open connections
- */
-static struct {
-    TAILQ_HEAD(, krb5_conn) tailq;
-    int qlength;
-} krb5_connq = {
-    TAILQ_HEAD_INITIALIZER(krb5_connq.tailq), 0
+    sec_close,
+    stream_sendpkt,
+    stream_recvpkt,
+    stream_recvpkt_cancel,
+    tcpma_stream_server,
+    tcpma_stream_accept,
+    tcpma_stream_client,
+    tcpma_stream_close,
+    sec_stream_auth,
+    sec_stream_id,
+    tcpm_stream_write,
+    tcpm_stream_read,
+    tcpm_stream_read_sync,
+    tcpm_stream_read_cancel,
+    tcpm_close_connection,
+#ifdef AMANDA_KRB5_ENCRYPT
+    k5_encrypt,
+    k5_decrypt,
+#else
+    NULL,
+    NULL,
+#endif
 };
-#define        krb5_connq_first()              TAILQ_FIRST(&krb5_connq.tailq)
-#define        krb5_connq_next(kc)             TAILQ_NEXT(kc, tq)
-#define        krb5_connq_append(kc)   do {                                    \
-    TAILQ_INSERT_TAIL(&krb5_connq.tailq, kc, tq);                              \
-    krb5_connq.qlength++;                                                      \
-} while (0)
-#define        krb5_connq_remove(kc)   do {                                    \
-    assert(krb5_connq.qlength > 0);                                            \
-    TAILQ_REMOVE(&krb5_connq.tailq, kc, tq);                                   \
-    krb5_connq.qlength--;                                                      \
-} while (0)
 
 static int newhandle = 1;
 
-/*
- * This is a function that should be called if a new security_handle_t is
- * created.  If NULL, no new handles are created.
- * It is passed the new handle and the received pkt
- */
-static void (*accept_fn)(security_handle_t *, pkt_t *);
-
 /*
  * Local functions
  */
-static void init(void);
-#ifdef BROKEN_MEMORY_CCACHE
-static void cleanup(void);
-#endif
-static const char *get_tgt(char *, char *);
-static void    open_callback(void *);
-static void    connect_callback(void *);
-static void    connect_timeout(void *);
-static int     send_token(struct krb5_conn *, int, const gss_buffer_desc *);
-static ssize_t recv_token(struct krb5_conn *, int *, gss_buffer_desc *, int);
-static void    recvpkt_callback(void *, void *, ssize_t);
-static void    recvpkt_timeout(void *);
-static void    stream_read_callback(void *);
-static void    stream_read_sync_callback2(void *, void *, ssize_t);
-static int     gss_server(struct krb5_conn *);
-static int     gss_client(struct krb5_handle *);
-static const char *gss_error(OM_uint32, OM_uint32);
-
-#ifdef AMANDA_KRB5_ENCRYPT
-static int     kdecrypt(struct krb5_stream *, gss_buffer_desc *, gss_buffer_desc *);
-static int     kencrypt(struct krb5_stream *, gss_buffer_desc *, gss_buffer_desc *);
-#endif
-static struct krb5_conn *conn_get(const char *);
-static void    conn_put(struct krb5_conn *);
-static void    conn_read(struct krb5_conn *);
-static void    conn_read_cancel(struct krb5_conn *);
-static void    conn_read_callback(void *);
-static int     conn_run_frameq(struct krb5_conn *, struct krb5_stream *);
-static char *  krb5_checkuser(char *, char *, char *);
+static int runkrb5(struct sec_handle *);
 
+char *keytab_name;
+char *principal_name;
 
 /*
  * krb5 version of a security handle allocator.  Logically sets
@@ -349,181 +237,113 @@ krb5_connect(
     void *     arg,
     void *     datap)
 {
-    struct krb5_handle *kh;
-    struct hostent *he;
-    struct servent *se;
-    int fd;
-    int port;
-    const char *err;
-    char *keytab_name = NULL;
-    char *principal_name = NULL;
+    struct sec_handle *rh;
+    int result;
+    struct addrinfo hints;
+    struct addrinfo *res = NULL;
 
+    assert(fn != NULL);
     assert(hostname != NULL);
+    (void)conf_fn;     /* Quiet unused parameter warning */
+    (void)datap;       /* Quiet unused parameter warning */
 
-    k5printf(("krb5_connect: %s\n", hostname));
+    k5printf(("%s: krb5: krb5_connect: %s\n", debug_prefix_time(NULL),
+              hostname));
 
-    /*
-     * Make sure we're initted
-     */
-    init();
+    krb5_init();
+
+    rh = alloc(sizeof(*rh));
+    security_handleinit(&rh->sech, &krb5_security_driver);
+    rh->hostname = NULL;
+    rh->rs = NULL;
+    rh->ev_timeout = NULL;
+    rh->rc = NULL;
+
+#ifdef WORKING_IPV6
+    hints.ai_flags = AI_CANONNAME | AI_V4MAPPED | AI_ALL;
+    hints.ai_family = AF_UNSPEC;
+#else
+    hints.ai_flags = AI_CANONNAME;
+    hints.ai_family = AF_INET;
+#endif
+    hints.ai_socktype = SOCK_DGRAM;
+    hints.ai_protocol = IPPROTO_UDP;
+    hints.ai_addrlen = 0;
+    hints.ai_addr = NULL;
+    hints.ai_canonname = NULL;
+    hints.ai_next = NULL;
+    result = getaddrinfo(hostname, NULL, &hints, &res);
+#ifdef WORKING_IPV6
+    if (result != 0) {
+       hints.ai_flags = AI_CANONNAME;
+       hints.ai_family = AF_UNSPEC;
+       result = getaddrinfo(hostname, NULL, &hints, &res);
+    }
+#endif
+    if(result != 0) {
+       dbprintf(("krb5_connect: getaddrinfo(%s): %s\n", hostname, gai_strerror(result)));
+       security_seterror(&rh->sech, "getaddrinfo(%s): %s\n", hostname,
+                         gai_strerror(result));
+       (*fn)(arg, &rh->sech, S_ERROR);
+       return;
+    }
+
+    rh->hostname = stralloc(res->ai_canonname);        /* will be replaced */
+    rh->rs = tcpma_stream_client(rh, newhandle++);
+    rh->rc->recv_security_ok = NULL;
+    rh->rc->prefix_packet = NULL;
+
+    if (rh->rs == NULL)
+       goto error;
 
-    kh = alloc(SIZEOF(*kh));
-    security_handleinit(&kh->sech, &krb5_security_driver);
-    kh->hostname = NULL;
-    kh->ks = NULL;
-    kh->ev_wait = NULL;
-    kh->ev_timeout = NULL;
+    amfree(rh->hostname);
+    rh->hostname = stralloc(rh->rs->rc->hostname);
 
 #ifdef AMANDA_KEYTAB
     keytab_name = AMANDA_KEYTAB;
 #else
     if(conf_fn) {
-       keytab_name = conf_fn("krb5keytab", datap);
+        keytab_name = conf_fn("krb5keytab", datap);
     }
 #endif
 #ifdef AMANDA_PRINCIPAL
     principal_name = AMANDA_PRINCIPAL;
 #else
     if(conf_fn) {
-       principal_name = conf_fn("krb5principal", datap);
+        principal_name = conf_fn("krb5principal", datap);
     }
 #endif
 
-    if ((err = get_tgt(keytab_name, principal_name)) != NULL) {
-       security_seterror(&kh->sech, "%s: could not get TGT: %s",
-           hostname, err);
-       (*fn)(arg, &kh->sech, S_ERROR);
-       return;
-    }
-
-    if ((he = gethostbyname(hostname)) == NULL) {
-       security_seterror(&kh->sech,
-           "%s: could not resolve hostname", hostname);
-       (*fn)(arg, &kh->sech, S_ERROR);
-       return;
-    }
-    kh->fn.connect = fn;
-    kh->conf_fn = conf_fn;
-    kh->arg = arg;
-    kh->datap = datap;
-    kh->hostname = stralloc(he->h_name);
-    kh->ks = krb5_stream_client(kh, newhandle++);
-
-    if (kh->ks == NULL)
-       goto error;
-
-    fd = kh->ks->kc->fd;
-
-    if (fd < 0) {
-       /*
-        * We need to open a new connection.  See if we have too
-        * many connections open.
-        */
-       if (krb5_connq.qlength > AMANDA_KRB5_MAXCONN) {
-           k5printf(("krb5_connect: too many conections (%d), delaying %s\n",
-               krb5_connq.qlength, kh->hostname));
-           krb5_stream_close(kh->ks);
-           kh->ev_wait = event_register((event_id_t)open_callback,
-               EV_WAIT, open_callback, kh);
-           return;
-       }
-
-       if ((se = getservbyname(AMANDA_KRB5_SERVICE_NAME, "tcp")) == NULL)
-           port = htons(AMANDA_KRB5_DEFAULT_PORT);
-       else
-           port = se->s_port;
-
-       /*
-        * Get a non-blocking socket.
-        */
-       fd = stream_client(kh->hostname, ntohs(port), KRB5_STREAM_BUFSIZE,
-           KRB5_STREAM_BUFSIZE, NULL, 1);
-       if (fd < 0) {
-           security_seterror(&kh->sech,
-               "can't connect to %s:%d: %s", hostname, ntohs(port),
-               strerror(errno));
+    /*
+     * We need to open a new connection.
+     *
+     * XXX need to eventually limit number of outgoing connections here.
+     */
+    if(rh->rc->read == -1) {
+       if (runkrb5(rh) < 0)
            goto error;
-       }
-       kh->ks->kc->fd = fd;
+       rh->rc->refcnt++;
     }
+
     /*
      * The socket will be opened async so hosts that are down won't
      * block everything.  We need to register a write event
      * so we will know when the socket comes alive.
+     *
+     * Overload rh->rs->ev_read to provide a write event handle.
      * We also register a timeout.
      */
-    kh->ev_wait = event_register((event_id_t)fd, EV_WRITEFD,
-               connect_callback, kh);
-    kh->ev_timeout = event_register((event_id_t)GSS_TIMEOUT, EV_TIME,
-               connect_timeout, kh);
+    rh->fn.connect = fn;
+    rh->arg = arg;
+    rh->rs->ev_read = event_register((event_id_t)(rh->rs->rc->write),
+       EV_WRITEFD, sec_connect_callback, rh);
+    rh->ev_timeout = event_register(CONNECT_TIMEOUT, EV_TIME,
+       sec_connect_timeout, rh);
 
     return;
 
 error:
-    (*fn)(arg, &kh->sech, S_ERROR);
-}
-
-/*
- * Called when there are not too many connections open such that
- * we can open more.
- */
-static void
-open_callback(
-    void *     cookie)
-{
-    struct krb5_handle *kh = cookie;
-
-    event_release(kh->ev_wait);
-
-    k5printf(("krb5: open_callback: possible connections available, retry %s\n",
-       kh->hostname));
-    krb5_connect(kh->hostname, kh->conf_fn, kh->fn.connect, kh->arg,kh->datap);
-    amfree(kh->hostname);
-    amfree(kh);
-}
-
-/*
- * Called when a tcp connection is finished connecting and is ready
- * to be authenticated.
- */
-static void
-connect_callback(
-    void *     cookie)
-{
-    struct krb5_handle *kh = cookie;
-
-    event_release(kh->ev_wait);
-    kh->ev_wait = NULL;
-    event_release(kh->ev_timeout);
-    kh->ev_timeout = NULL;
-
-    if (kh->ks->kc->state == unauthed) {
-       if (gss_client(kh) < 0) {
-           (*kh->fn.connect)(kh->arg, &kh->sech, S_ERROR);
-           return;
-       }
-       kh->ks->kc->state = authed;
-    }
-    assert(kh->ks->kc->gss_context != GSS_C_NO_CONTEXT);
-
-    (*kh->fn.connect)(kh->arg, &kh->sech, S_OK);
-}
-
-/*
- * Called if a connection times out before completion.
- */
-static void
-connect_timeout(
-    void *     cookie)
-{
-    struct krb5_handle *kh = cookie;
-
-    event_release(kh->ev_wait);
-    kh->ev_wait = NULL;
-    event_release(kh->ev_timeout);
-    kh->ev_timeout = NULL;
-
-    (*kh->fn.connect)(kh->arg, &kh->sech, S_TIMEOUT);
+    (*fn)(arg, &rh->sech, S_ERROR);
 }
 
 /*
@@ -536,849 +356,133 @@ krb5_accept(
     int                out,
     void       (*fn)(security_handle_t *, pkt_t *))
 {
-    struct sockaddr_in sin;
+    struct sockaddr_storage sin;
     socklen_t len;
-    struct krb5_conn *kc;
-    struct hostent *he;
+    struct tcp_conn *rc;
+    char hostname[NI_MAXHOST];
+    int result;
+    char *errmsg = NULL;
 
-    /*
-     * Make sure we're initted
-     */
-    init();
-
-    /* shut up compiler */
-    driver=driver;
-    out=out;
+    krb5_init();
 
-    len = SIZEOF(sin);
-    if (getpeername(in, (struct sockaddr *)&sin, &len) < 0)
+    len = sizeof(sin);
+    if (getpeername(in, (struct sockaddr *)&sin, &len) < 0) {
+       dbprintf(("%s: getpeername returned: %s\n", debug_prefix_time(NULL),
+                 strerror(errno)));
        return;
-    he = gethostbyaddr((void *)&sin.sin_addr, SIZEOF(sin.sin_addr), AF_INET);
-    if (he == NULL)
-       return;
-
-    kc = conn_get(he->h_name);
-    kc->fd = in;
-    if (gss_server(kc) < 0)
-       error("gss_server failed: %s\n", kc->errmsg);
-    kc->state = authed;
-    accept_fn = fn;
-    conn_read(kc);
-}
-
-/*
- * Locate an existing connection to the given host, or create a new,
- * unconnected entry if none exists.  The caller is expected to check
- * for the lack of a connection (kc->fd == -1) and set one up.
- */
-static struct krb5_conn *
-conn_get(
-    const char *       hostname)
-{
-    struct krb5_conn *kc;
-
-    k5printf(("krb5: conn_get: %s\n", hostname));
-
-    for (kc = krb5_connq_first(); kc != NULL; kc = krb5_connq_next(kc)) {
-       if (strcasecmp(hostname, kc->hostname) == 0)
-           break;
-    }
-
-    if (kc != NULL) {
-       kc->refcnt++;
-       k5printf(("krb5: conn_get: exists, refcnt to %s is now %d\n",
-           kc->hostname, kc->refcnt));
-       return (kc);
     }
-
-    k5printf(("krb5: conn_get: creating new handle\n"));
-    /*
-     * We can't be creating a new handle if we are the client
-     */
-    assert(accept_fn == NULL);
-    kc = alloc(SIZEOF(*kc));
-    kc->fd = -1;
-    kc->readbuf.left = 0;
-    kc->readbuf.size = 0;
-    kc->state = unauthed;
-    kc->ev_read = NULL;
-    strncpy(kc->hostname, hostname, SIZEOF(kc->hostname) - 1);
-    kc->hostname[SIZEOF(kc->hostname) - 1] = '\0';
-    kc->errmsg = NULL;
-    kc->gss_context = GSS_C_NO_CONTEXT;
-    /*
-     * [XXX] this is set to 2 in order to force the connection to stay
-     * open and process more protocol requests.  (basically consistant
-     * with bsd-security.c, and theoretically krb4-security.c.   This
-     * needs to be addressed in a cleaner way.
-     */
-    kc->refcnt = 2;
-    TAILQ_INIT(&kc->frameq);
-    krb5_connq_append(kc);
-    return (kc);
-}
-
-/*
- * Delete a reference to a connection, and close it if it is the last
- * reference.
- */
-static void
-conn_put(
-    struct krb5_conn * kc)
-{
-    OM_uint32 min_stat;
-    struct krb5_frame *kf;
-
-    assert(kc->refcnt > 0);
-    if (--kc->refcnt > 0) {
-       k5printf(("krb5: conn_put: decrementing refcnt for %s to %d\n",
-           kc->hostname, kc->refcnt));
+    if ((result = getnameinfo((struct sockaddr *)&sin, len,
+                             hostname, NI_MAXHOST, NULL, 0, 0) != 0)) {
+       dbprintf(("%s: getnameinfo failed: %s\n",
+                 debug_prefix_time(NULL), gai_strerror(result)));
        return;
     }
-    k5printf(("krb5: conn_put: closing connection to %s\n", kc->hostname));
-    if (kc->fd != -1)
-       aclose(kc->fd);
-    if (kc->ev_read != NULL)
-       event_release(kc->ev_read);
-    if (kc->errmsg != NULL)
-       amfree(kc->errmsg);
-    gss_delete_sec_context(&min_stat, &kc->gss_context, GSS_C_NO_BUFFER);
-    while ((kf = TAILQ_FIRST(&kc->frameq)) != NULL) {
-       TAILQ_REMOVE(&kc->frameq, kf, tq);
-       if (kf->tok.value != NULL)
-           amfree(kf->tok.value);
-       amfree(kf);
-    }
-    krb5_connq_remove(kc);
-    amfree(kc);
-    /* signal that a connection is available */
-    event_wakeup((event_id_t)open_callback);
-}
-
-/*
- * Turn on read events for a conn.  Or, increase a refcnt if we are
- * already receiving read events.
- */
-static void
-conn_read(
-    struct krb5_conn *kc)
-{
-
-    if (kc->ev_read != NULL) {
-       kc->ev_read_refcnt++;
-       k5printf(("krb5: conn_read: incremented refcnt to %d for %s\n",
-           kc->ev_read_refcnt, kc->hostname));
-       return;
-    }
-    k5printf(("krb5: conn_read registering event handler for %s\n",
-       kc->hostname));
-    kc->ev_read = event_register((event_id_t)kc->fd, EV_READFD, conn_read_callback, kc);
-    kc->ev_read_refcnt = 1;
-}
-
-static void
-conn_read_cancel(
-    struct krb5_conn * kc)
-{
-
-    if (--kc->ev_read_refcnt > 0) {
-       k5printf(("krb5: conn_read_cancel: decremented refcnt to %d for %s\n",
-           kc->ev_read_refcnt, kc->hostname));
+    if (check_name_give_sockaddr(hostname,
+                                (struct sockaddr *)&sin, &errmsg) < 0) {
+       amfree(errmsg);
        return;
     }
-    k5printf(("krb5: conn_read_cancel: releasing event handler for %s\n",
-       kc->hostname));
-    event_release(kc->ev_read);
-    kc->ev_read = NULL;
-}
-
-/*
- * frees a handle allocated by the above
- */
-static void
-krb5_close(
-    void *     inst)
-{
-    struct krb5_handle *kh = inst;
-
-    assert(kh != NULL);
 
-    k5printf(("krb5: closing handle to %s\n", kh->hostname));
-
-    if (kh->ks != NULL) {
-       /* This may be null if we get here on an error */
-       krb5_recvpkt_cancel(kh);
-       security_stream_close(&kh->ks->secstr);
-    }
-    amfree(kh->hostname);
-    amfree(kh);
+    rc = sec_tcp_conn_get(hostname, 0);
+    rc->recv_security_ok = NULL;
+    rc->prefix_packet = NULL;
+    memcpy(&rc->peer, &sin, sizeof(rc->peer));
+    rc->read = in;
+    rc->write = out;
+    rc->driver = driver;
+    if (gss_server(rc) < 0)
+       error("gss_server failed: %s\n", rc->errmsg);
+    rc->accept_fn = fn;
+    sec_tcp_conn_read(rc);
 }
 
 /*
- * Transmit a packet.  Encrypt first.
- */
-static ssize_t
-krb5_sendpkt(
-    void *     cookie,
-    pkt_t *    pkt)
-{
-    struct krb5_handle *kh = cookie;
-    gss_buffer_desc tok;
-    int rval;
-    unsigned char *buf;
-
-    assert(kh != NULL);
-    assert(pkt != NULL);
-
-    k5printf(("krb5: sendpkt: enter\n"));
-
-    if (pkt->body[0] == '\0') {
-       tok.length = 1;
-       tok.value = alloc(SIZEOF(pkt->type));
-       memcpy(tok.value, &pkt->type, sizeof(unsigned char));
-    } else {
-       tok.length = strlen(pkt->body) + 2;
-       tok.value = alloc(tok.length);
-       buf = tok.value;
-       *buf++ = (unsigned char)pkt->type;
-       strncpy((char *)buf, pkt->body, tok.length - 2);
-       buf[tok.length - 2] = '\0';
-    }
-
-    k5printf(("krb5: sendpkt: %s (%d) pkt_t (len %d) contains:\n\n\"%s\"\n\n",
-       pkt_type2str(pkt->type), pkt->type, strlen(pkt->body), pkt->body));
-
-    rval = krb5_stream_write(kh->ks, tok.value, tok.length);
-    if (rval < 0)
-       security_seterror(&kh->sech, security_stream_geterror(&kh->ks->secstr));
-    /*@ignore@*/
-    amfree(tok.value);
-    /*@end@*/
-    return (rval);
-}
-
-/*
- * Set up to receive a packet asyncronously, and call back when
- * it has been read.
- */
-static void
-krb5_recvpkt(
-    void *     cookie,
-    void       (*fn)(void *, pkt_t *, security_status_t),
-    void *     arg,
-    int                timeout)
-{
-    struct krb5_handle *kh = cookie;
-
-    assert(kh != NULL);
-
-    k5printf(("krb5: recvpkt registered for %s\n", kh->hostname));
-
-    /*
-     * Reset any pending timeout on this handle
-     */
-    if (kh->ev_timeout != NULL)
-       event_release(kh->ev_timeout);
-
-    /*
-     * Negative timeouts mean no timeout
-     */
-    if (timeout < 0)
-       kh->ev_timeout = NULL;
-    else
-       kh->ev_timeout = event_register((event_id_t)timeout, EV_TIME,
-               recvpkt_timeout, kh);
-
-    kh->fn.recvpkt = fn;
-    kh->arg = arg;
-    krb5_stream_read(kh->ks, recvpkt_callback, kh);
-}
-
-/*
- * Remove a async receive request from the queue
- */
-static void
-krb5_recvpkt_cancel(
-    void *     cookie)
-{
-    struct krb5_handle *kh = cookie;
-
-    k5printf(("krb5: cancelling recvpkt for %s\n", kh->hostname));
-
-    assert(kh != NULL);
-
-    krb5_stream_read_cancel(kh->ks);
-    if (kh->ev_timeout != NULL) {
-       event_release(kh->ev_timeout);
-       kh->ev_timeout = NULL;
-    }
-}
-
-/*
- * This is called when a handle is woken up because data read off of the
- * net is for it.
- */
-static void
-recvpkt_callback(
-    void *cookie,
-    void *buf,
-    ssize_t bufsize)
-{
-    pkt_t pkt;
-    struct krb5_handle *kh = cookie;
-
-    assert(kh != NULL);
-
-    /*
-     * We need to cancel the recvpkt request before calling
-     * the callback because the callback may reschedule us.
-     */
-    krb5_recvpkt_cancel(kh);
-
-    switch (bufsize) {
-    case 0:
-       security_seterror(&kh->sech,
-           "EOF on read from %s", kh->hostname);
-       (*kh->fn.recvpkt)(kh->arg, NULL, S_ERROR);
-       return;
-    case -1:
-       security_seterror(&kh->sech, security_stream_geterror(&kh->ks->secstr));
-       (*kh->fn.recvpkt)(kh->arg, NULL, S_ERROR);
-       return;
-    default:
-       parse_pkt(&pkt, buf, (size_t)bufsize);
-       k5printf(("krb5: received %s pkt (%d) from %s, contains:\n\n\"%s\"\n\n",
-           pkt_type2str(pkt.type), pkt.type, kh->hostname, pkt.body));
-       (*kh->fn.recvpkt)(kh->arg, &pkt, S_OK);
-       return;
-    }
-}
-
-/*
- * This is called when a handle times out before receiving a packet.
- */
-static void
-recvpkt_timeout(
-    void *     cookie)
-{
-    struct krb5_handle *kh = cookie;
-
-    assert(kh != NULL);
-
-    k5printf(("krb5: recvpkt timeout for %s\n", kh->hostname));
-
-    krb5_recvpkt_cancel(kh);
-    (*kh->fn.recvpkt)(kh->arg, NULL, S_TIMEOUT);
-}
-
-/*
- * Create the server end of a stream.  For krb5, this means setup a stream
- * object and allocate a new handle for it.
- */
-static void *
-krb5_stream_server(
-    void *     h)
-{
-    struct krb5_handle *kh = h;
-    struct krb5_stream *ks;
-
-    assert(kh != NULL);
-
-    ks = alloc(SIZEOF(*ks));
-    security_streaminit(&ks->secstr, &krb5_security_driver);
-    ks->kc = conn_get(kh->hostname);
-    /*
-     * Stream should already be setup!
-     */
-    if (ks->kc->fd < 0) {
-       conn_put(ks->kc);
-       amfree(ks);
-       security_seterror(&kh->sech, "lost connection");
-       return (NULL);
-    }
-    /*
-     * so as not to conflict with the amanda server's handle numbers,
-     * we start at 5000 and work down
-     */
-    ks->handle = (int)(5000 - newhandle++);
-    ks->ev_read = NULL;
-    k5printf(("krb5: stream_server: created stream %d\n", ks->handle));
-    return (ks);
-}
-
-/*
- * Accept an incoming connection on a stream_server socket
- * Nothing needed for krb5.
+ * Forks a krb5 to the host listed in rc->hostname
+ * Returns negative on error, with an errmsg in rc->errmsg.
  */
 static int
-krb5_stream_accept(
-    void *     s)
+runkrb5(
+    struct sec_handle *        rh)
 {
+    struct servent *   sp;
+    int                        server_socket;
+    in_port_t          my_port, port;
+    uid_t              euid;
+    struct tcp_conn *  rc = rh->rc;
+    const char *err;
 
-    /* shut up compiler */
-    s = s;
-
-    return (0);
-}
-
-/*
- * Return a connected stream.  For krb5, this means setup a stream
- * with the supplied handle.
- */
-static void *
-krb5_stream_client(
-    void *     h,
-    int                id)
-{
-    struct krb5_handle *kh = h;
-    struct krb5_stream *ks;
+    if ((sp = getservbyname(AMANDA_KRB5_SERVICE_NAME, "tcp")) == NULL)
+       port = htons(AMANDA_KRB5_DEFAULT_PORT);
+    else
+       port = sp->s_port;
 
-    assert(kh != NULL);
+    euid = geteuid();
 
-    if (id <= 0) {
-       security_seterror(&kh->sech,
-           "%d: invalid security stream id", id);
-       return (NULL);
+    if ((err = get_tgt(keytab_name, principal_name)) != NULL) {
+        security_seterror(&rh->sech, "%s: could not get TGT: %s",
+            rc->hostname, err);
+        return -1;
     }
 
-    ks = alloc(SIZEOF(*ks));
-    security_streaminit(&ks->secstr, &krb5_security_driver);
-    ks->handle = (int)id;
-    ks->ev_read = NULL;
-    ks->kc = conn_get(kh->hostname);
-
-    k5printf(("krb5: stream_client: connected to stream %d\n", id));
-
-    return (ks);
-}
-
-/*
- * Close and unallocate resources for a stream.
- */
-static void
-krb5_stream_close(
-    void *     s)
-{
-    struct krb5_stream *ks = s;
-
-    assert(ks != NULL);
-
-    k5printf(("krb5: stream_close: closing stream %d\n", ks->handle));
-
-    krb5_stream_read_cancel(ks);
-    conn_put(ks->kc);
-    amfree(ks);
-}
-
-/*
- * Authenticate a stream
- * Nothing needed for krb5.  The tcp connection is authenticated
- * on startup.
- */
-static int
-krb5_stream_auth(
-    void *     s)
-{
-    /* shut up compiler */
-    s = s;
-
-    return (0);
-}
-
-/*
- * Returns the stream id for this stream.  This is just the local
- * port.
- */
-static int
-krb5_stream_id(
-    void *     s)
-{
-    struct krb5_stream *ks = s;
-
-    assert(ks != NULL);
-
-    return (ks->handle);
-}
-
-/*
- * Write a chunk of data to a stream.  Blocks until completion.
- */
-static int
-krb5_stream_write(
-    void *     s,
-    const void *buf,
-    size_t     size)
-{
-    struct krb5_stream *ks = s;
-    gss_buffer_desc tok;
-#ifdef AMANDA_KRB5_ENCRYPT
-    gss_buffer_desc enctok;
-    OM_uint32 min_stat;
-#endif
-    int rc;
-
-    assert(ks != NULL);
-
-    k5printf(("krb5: stream_write: writing %d bytes to %s:%d\n", size,
-       ks->kc->hostname, ks->handle));
-
-    tok.length = size;
-    tok.value = (void *)buf;   /* safe to discard const */
-#ifdef AMANDA_KRB5_ENCRYPT
-    if (kencrypt(ks, &tok, &enctok) < 0)
-       return (-1);
-    rc = send_token(ks->kc, ks->handle, &enctok);
-#else
-    rc = send_token(ks->kc, ks->handle, &tok);
-#endif
-    if (rc < 0)
-       security_stream_seterror(&ks->secstr, ks->kc->errmsg);
-#ifdef AMANDA_KRB5_ENCRYPT
-    gss_release_buffer(&min_stat, &enctok);
-#endif
-    return (rc);
-}
-
-/*
- * Submit a request to read some data.  Calls back with the given
- * function and arg when completed.
- */
-static void
-krb5_stream_read(
-    void *     s,
-    void       (*fn)(void *, void *, ssize_t),
-    void *     arg)
-{
-    struct krb5_stream *ks = s;
-
-    assert(ks != NULL);
-
-    /*
-     * Only one read request can be active per stream.
-     */
-    ks->fn = fn;
-    ks->arg = arg;
-
-    /*
-     * First see if there's any queued frames for this stream.
-     * If so, we're done.
-     */
-    if (conn_run_frameq(ks->kc, ks) > 0)
-       return;
+    server_socket = stream_client(rc->hostname,
+                                    (in_port_t)(ntohs(port)),
+                                    STREAM_BUFSIZE,
+                                    STREAM_BUFSIZE,
+                                    &my_port,
+                                    0);
 
-    if (ks->ev_read == NULL) {
-       ks->ev_read = event_register((event_id_t)ks->kc, EV_WAIT,
-           stream_read_callback, ks);
-       conn_read(ks->kc);
+    if(server_socket < 0) {
+       security_seterror(&rh->sech,
+           "%s", strerror(errno));
+       
+       return -1;
     }
-}
-
-/*
- * Submit a request to read some data.  Calls back with the given
- * function and arg when completed.
- */
-static ssize_t
-krb5_stream_read_sync(
-    void *     s,
-    void       **buf)
-{
-    struct krb5_stream *ks = s;
-
-    assert(ks != NULL);
-
-    /*
-     * Only one read request can be active per stream.
-     */
-    ks->fn = stream_read_sync_callback2;
-    ks->arg = ks;
-
-    /*
-     * First see if there's any queued frames for this stream.
-     * If so, we're done.
-     */
-    if (conn_run_frameq(ks->kc, ks) > 0)
-       return ks->len;
-
-    if (ks->ev_read != NULL)
-       event_release(ks->ev_read);
-
-    ks->ev_read = event_register((event_id_t)ks->kc, EV_WAIT,
-       stream_read_callback, ks);
-    conn_read(ks->kc);
-    event_wait(ks->ev_read);
-    buf = (void **)&ks->buf;
-    return ks->len;
-}
-
-
-/*
- * Callback for krb5_stream_read_sync
- */
-static void
-stream_read_sync_callback2(
-    void *     arg,
-    void *     buf,
-    ssize_t    size)
-{
-    struct krb5_stream *ks = arg;
-
-    assert(ks != NULL);
-
-    k5printf(("krb5: stream_read_sync_callback2: handle %d\n", ks->handle));
-
-    memcpy(ks->buf, buf, (size_t)size);
-    ks->len = size;
-}
-
-/*
- * Cancel a previous stream read request.  It's ok if we didn't have a read
- * scheduled.
- */
-static void
-krb5_stream_read_cancel(
-    void *     s)
-{
-    struct krb5_stream *ks = s;
+    seteuid(euid);
 
-    assert(ks != NULL);
+    rc->read = rc->write = server_socket;
 
-    if (ks->ev_read != NULL) {
-       event_release(ks->ev_read);
-       ks->ev_read = NULL;
-       conn_read_cancel(ks->kc);
+    if (gss_client(rh) < 0) {
+       return -1;
     }
-}
-
-/*
- * Callback for krb5_stream_read
- */
-static void
-stream_read_callback(
-    void *     arg)
-{
-    struct krb5_stream *ks = arg;
-
-    assert(ks != NULL);
 
-    k5printf(("krb5: stream_read_callback: handle %d\n", ks->handle));
-
-    conn_run_frameq(ks->kc, ks);
+    return 0;
 }
 
-/*
- * Run down a list of queued frames for a krb5_conn, and if we find one
- * that matches the passed handle, fire the read event.  Only
- * process one frame.
- *
- * Returns 1 if a frame was found and processed.
- */
-static int
-conn_run_frameq(
-    /*@keep@*/ struct krb5_conn *      kc,
-    /*@keep@*/ struct krb5_stream *    ks)
-{
-    struct krb5_frame *kf, *nextkf;
-    gss_buffer_desc *enctok, *dectok;
-#ifdef AMANDA_KRB5_ENCRYPT
-    OM_uint32 min_stat;
-    gss_buffer_desc tok;
-#endif
-
-    /*
-     * Iterate through all of the frames in the queue.  If one
-     * is for us, process it.  If we hit an EOF frame, shut down.
-     * Stop after processing one frame, because we are only supposed
-     * to return one read request.
-     */
-    for (kf = TAILQ_FIRST(&kc->frameq); kf != NULL; kf = nextkf) {
-       nextkf = TAILQ_NEXT(kf, tq);
-
-       if (kf->handle != ks->handle && kf->handle != H_EOF) {
-           k5printf(("krb5: conn_frameq_run: not for us (handle %d)\n",
-               kf->handle));
-           continue;
-       }
-       /*
-        * We want all listeners to see the EOF, so never remove it.
-        * It will get cleaned up when the connection is closed
-        * in conn_put().
-        */
-       if (kf->handle != H_EOF)
-           TAILQ_REMOVE(&kc->frameq, kf, tq);
-
-       /*
-        * Remove the event first, and then call the callback.
-        * We remove it first because we don't want to get in their
-        * way if they reschedule it.
-        */
-       krb5_stream_read_cancel(ks);
-
-       enctok = &kf->tok;
-
-       if (enctok->length == 0) {
-           assert(kf->handle == H_EOF);
-           k5printf(("krb5: stream_read_callback: EOF\n"));
-           (*ks->fn)(ks->arg, NULL, 0);
-           return (1); /* stop after EOF */
-       }
-
-#ifdef AMANDA_KRB5_ENCRYPT
-       dectok = &tok;
-       if (kdecrypt(ks, enctok, &tok) < 0) {
-           k5printf(("krb5: stream_read_callback: kdecrypt error\n"));
-           (*ks->fn)(ks->arg, NULL, -1);
-       } else
-#else
-       dectok = enctok;
-#endif
-       {
-           k5printf(("krb5: stream_read_callback: read %d bytes from %s:%d\n",
-               dectok->length, ks->kc->hostname, ks->handle));
-           (*ks->fn)(ks->arg, dectok->value, (ssize_t)dectok->length);
-#ifdef AMANDA_KRB5_ENCRYPT
-           gss_release_buffer(&min_stat, dectok);
-#endif
-       }
-       amfree(enctok->value);
-       amfree(kf);
-       return (1);             /* stop after one frame */
-    }
-    return (0);
-}
-
-/*
- * The callback for the netfd for the event handler
- * Determines if this packet is for this security handle,
- * and does the real callback if so.
- */
-static void
-conn_read_callback(
-    void *     cookie)
-{
-    struct krb5_conn *kc = cookie;
-    struct krb5_handle *kh;
-    struct krb5_frame *kf;
-    pkt_t pkt;
-    gss_buffer_desc *dectok;
-    int rc;
-#ifdef AMANDA_KRB5_ENCRYPT
-    gss_buffer_desc tok;
-    OM_uint32 min_stat;
-#endif
-
-    assert(cookie != NULL);
-
-    k5printf(("krb5: conn_read_callback\n"));
-
-    kf = alloc(SIZEOF(*kf));
-    TAILQ_INSERT_TAIL(&kc->frameq, kf, tq);
-
-    /* Read the data off the wire.  If we get errors, shut down. */
-    rc = recv_token(kc, &kf->handle, &kf->tok, 5);
-    k5printf(("krb5: conn_read_callback: recv_token returned %d handle = %d\n",
-       rc, kf->handle));
-    if (rc <= 0) {
-       kf->tok.value = NULL;
-       kf->tok.length = 0;
-       kf->handle = H_EOF;
-       rc = event_wakeup((event_id_t)kc);
-       k5printf(("krb5: conn_read_callback: event_wakeup return %d\n", rc));
-       return;
-    }
-
-    /* If there are events waiting on this handle, we're done */
-    rc = event_wakeup((event_id_t)kc);
-    k5printf(("krb5: conn_read_callback: event_wakeup return %d\n", rc));
-    if (rc > 0)
-       return;
-
-    /*
-     * If there is no accept fn registered, then just leave the
-     * packet queued.  The caller may register a function later.
-     */
-    if (accept_fn == NULL) {
-       k5printf(("krb5: no accept_fn so leaving packet queued.\n"));
-       return;
-    }
-
-    kh = alloc(SIZEOF(*kh));
-    security_handleinit(&kh->sech, &krb5_security_driver);
-    kh->hostname = stralloc(kc->hostname);
-    kh->ks = krb5_stream_client(kh, kf->handle);
-    kh->ev_wait = NULL;
-    kh->ev_timeout = NULL;
-
-    TAILQ_REMOVE(&kc->frameq, kf, tq);
-    k5printf(("krb5: new connection\n"));
-#ifdef AMANDA_KRB5_ENCRYPT
-    dectok = &tok;
-    rc = kdecrypt(kh->ks, &kf->tok, dectok);
-#else
-    dectok = &kf->tok;
-#endif
-
-#ifdef AMANDA_KRB5_ENCRYPT
-    if (rc < 0) {
-       security_seterror(&kh->sech, security_geterror(&kh->ks->secstr));
-       (*accept_fn)(&kh->sech, NULL);
-    } else
-#endif
-    {
-       parse_pkt(&pkt, dectok->value, dectok->length);
-#ifdef AMANDA_KRB5_ENCRYPT
-       gss_release_buffer(&min_stat, dectok);
-#endif
-       (*accept_fn)(&kh->sech, &pkt);
-    }
-    amfree(kf->tok.value);
-    amfree(kf);
-
-    /*
-     * We can only accept one connection per process, since we're tcp
-     * based and run out of inetd.  So, delete our accept reference once
-     * we've gotten the first connection.
-     */
-
-    /*
-     * [XXX] actually, the protocol has been changed to have multiple
-     * requests in one session be possible.  By not resetting accept_fn,
-     * this will caused them to be properly processed.  this needs to be
-     * addressed in a much cleaner way.
-     */
-    if (accept_fn != NULL)
-       conn_put(kc);
-    /* accept_fn = NULL; */
-}
 
 /*
  * Negotiate a krb5 gss context from the client end.
  */
 static int
 gss_client(
-    struct krb5_handle *kh)
+    struct sec_handle *rh)
 {
-    struct krb5_stream *ks = kh->ks;
-    struct krb5_conn *kc = ks->kc;
-    gss_buffer_desc send_tok, recv_tok;
+    struct sec_stream *rs = rh->rs;
+    struct tcp_conn *rc = rs->rc;
+    gss_buffer_desc send_tok, recv_tok, AA;
+    gss_OID doid;
     OM_uint32 maj_stat, min_stat;
     unsigned int ret_flags;
-    int rc, rval = -1;
+    int rval = -1;
+    int rvalue;
     gss_name_t gss_name;
+    char *errmsg = NULL;
 
     k5printf(("gss_client\n"));
 
-    send_tok.value = vstralloc("host/", ks->kc->hostname, NULL);
+    send_tok.value = vstralloc("host/", rs->rc->hostname, NULL);
     send_tok.length = strlen(send_tok.value) + 1;
     maj_stat = gss_import_name(&min_stat, &send_tok, GSS_C_NULL_OID,
        &gss_name);
     if (maj_stat != (OM_uint32)GSS_S_COMPLETE) {
-       security_seterror(&kh->sech, "can't import name %s: %s",
+       security_seterror(&rh->sech, "can't import name %s: %s",
            (char *)send_tok.value, gss_error(maj_stat, min_stat));
        amfree(send_tok.value);
        return (-1);
     }
     amfree(send_tok.value);
-    kc->gss_context = GSS_C_NO_CONTEXT;
+    rc->gss_context = GSS_C_NO_CONTEXT;
+    maj_stat = gss_display_name(&min_stat, gss_name, &AA, &doid);
+    dbprintf(("gss_name %s\n", (char *)AA.value));
 
     /*
      * Perform the context-establishement loop.
@@ -1399,7 +503,7 @@ gss_client(
        min_stat = 0;
        maj_stat = gss_init_sec_context(&min_stat,
            GSS_C_NO_CREDENTIAL,
-           &kc->gss_context,
+           &rc->gss_context,
            gss_name,
            GSS_C_NULL_OID,
            (OM_uint32)GSS_C_MUTUAL_FLAG|GSS_C_REPLAY_FLAG,
@@ -1414,19 +518,18 @@ gss_client(
            amfree(recv_tok.value);
            recv_tok.length = 0;
        }
-
        if (maj_stat != (OM_uint32)GSS_S_COMPLETE && maj_stat != (OM_uint32)GSS_S_CONTINUE_NEEDED) {
-           security_seterror(&kh->sech,
-               "error getting gss context: %s",
-               gss_error(maj_stat, min_stat));
+           security_seterror(&rh->sech,
+               "error getting gss context: %s %s",
+               gss_error(maj_stat, min_stat), (char *)send_tok.value);
            goto done;
        }
 
        /*
         * Send back the response
         */
-       if (send_tok.length != 0 && send_token(kc, ks->handle, &send_tok) < 0) {
-           security_seterror(&kh->sech, kc->errmsg);
+       if (send_tok.length != 0 && tcpm_send_token(rc, rc->write, rs->handle, &errmsg, send_tok.value, send_tok.length) < 0) {
+           security_seterror(&rh->sech, rc->errmsg);
            gss_release_buffer(&min_stat, &send_tok);
            goto done;
        }
@@ -1438,17 +541,21 @@ gss_client(
        if (maj_stat != (OM_uint32)GSS_S_CONTINUE_NEEDED)
            break;
 
-       if ((rc = recv_token(kc, NULL, &recv_tok, GSS_TIMEOUT)) <= 0) {
-           if (rc < 0)
-               security_seterror(&kh->sech,
-                   "recv error in gss loop: %s", kc->errmsg);
+        rvalue = tcpm_recv_token(rc, rc->read, &rc->handle, &rc->errmsg,
+                                (void *)&recv_tok.value,
+                                (ssize_t *)&recv_tok.length, 60);
+       if (rvalue <= 0) {
+           if (rvalue < 0)
+               security_seterror(&rh->sech,
+                   "recv error in gss loop: %s", rc->errmsg);
            else
-               security_seterror(&kh->sech, "EOF in gss loop");
+               security_seterror(&rh->sech, "EOF in gss loop");
            goto done;
        }
     }
 
     rval = 0;
+    rc->auth = 1;
 done:
     gss_release_name(&min_stat, &gss_name);
     return (rval);
@@ -1459,21 +566,23 @@ done:
  */
 static int
 gss_server(
-    struct krb5_conn * kc)
+    struct tcp_conn *rc)
 {
     OM_uint32 maj_stat, min_stat, ret_flags;
-    gss_buffer_desc send_tok, recv_tok;
+    gss_buffer_desc send_tok, recv_tok, AA;
     gss_OID doid;
     gss_name_t gss_name;
     gss_cred_id_t gss_creds;
     char *p, *realm, *msg;
     uid_t euid;
-    int rc, rval = -1;
+    int rval = -1;
+    int rvalue;
     char errbuf[256];
+    char *errmsg = NULL;
 
     k5printf(("gss_server\n"));
 
-    assert(kc != NULL);
+    assert(rc != NULL);
 
     /*
      * We need to be root while in gss_acquire_cred() to read the host key
@@ -1493,7 +602,8 @@ gss_server(
        goto out;
     }
 
-    send_tok.value = vstralloc("host/", hostname, NULL);
+    rc->gss_context = GSS_C_NO_CONTEXT;
+    send_tok.value = vstralloc("host/", myhostname, NULL);
     send_tok.length = strlen(send_tok.value) + 1;
     for (p = send_tok.value; *p != '\0'; p++) {
        if (isupper((int)*p))
@@ -1511,11 +621,13 @@ gss_server(
     }
     amfree(send_tok.value);
 
+    maj_stat = gss_display_name(&min_stat, gss_name, &AA, &doid);
+    dbprintf(("gss_name %s\n", (char *)AA.value));
     maj_stat = gss_acquire_cred(&min_stat, gss_name, 0,
        GSS_C_NULL_OID_SET, GSS_C_ACCEPT, &gss_creds, NULL, NULL);
     if (maj_stat != (OM_uint32)GSS_S_COMPLETE) {
        snprintf(errbuf, SIZEOF(errbuf),
-           "can't acquire creds for host key host/%s: %s", hostname,
+           "can't acquire creds for host key host/%s: %s", myhostname,
            gss_error(maj_stat, min_stat));
        gss_release_name(&min_stat, &gss_name);
        seteuid(euid);
@@ -1524,17 +636,21 @@ gss_server(
     gss_release_name(&min_stat, &gss_name);
 
     for (recv_tok.length = 0;;) {
-       if ((rc = recv_token(kc, NULL, &recv_tok, GSS_TIMEOUT)) <= 0) {
-           if (rc < 0) {
+       recv_tok.value = NULL;
+        rvalue = tcpm_recv_token(rc, rc->read, &rc->handle, &rc->errmsg,
+                                (char **)&recv_tok.value,
+                                (ssize_t *)&recv_tok.length, 60);
+       if (rvalue <= 0) {
+           if (rvalue < 0) {
                snprintf(errbuf, SIZEOF(errbuf),
-                   "recv error in gss loop: %s", kc->errmsg);
-               amfree(kc->errmsg);
+                   "recv error in gss loop: %s", rc->errmsg);
+               amfree(rc->errmsg);
            } else
                snprintf(errbuf, SIZEOF(errbuf), "EOF in gss loop");
            goto out;
        }
 
-       maj_stat = gss_accept_sec_context(&min_stat, &kc->gss_context,
+       maj_stat = gss_accept_sec_context(&min_stat, &rc->gss_context,
            gss_creds, &recv_tok, GSS_C_NO_CHANNEL_BINDINGS,
            &gss_name, &doid, &send_tok, &ret_flags, NULL, NULL);
 
@@ -1547,10 +663,10 @@ gss_server(
        }
        amfree(recv_tok.value);
 
-       if (send_tok.length > 0 && send_token(kc, 0, &send_tok) < 0) {
-           strncpy(errbuf, kc->errmsg, SIZEOF(errbuf) - 1);
+       if (send_tok.length != 0 && tcpm_send_token(rc, rc->write, 0, &errmsg, send_tok.value, send_tok.length) < 0) {
+           strncpy(errbuf, rc->errmsg, SIZEOF(errbuf) - 1);
            errbuf[SIZEOF(errbuf) - 1] = '\0';
-           amfree(kc->errmsg);
+           amfree(rc->errmsg);
            gss_release_buffer(&min_stat, &send_tok);
            goto out;
        }
@@ -1587,7 +703,7 @@ gss_server(
     /* 
      * If the principal doesn't match, complain
      */
-    if ((msg = krb5_checkuser(kc->hostname, send_tok.value, realm)) != NULL) {
+    if ((msg = krb5_checkuser(rc->hostname, send_tok.value, realm)) != NULL) {
        snprintf(errbuf, SIZEOF(errbuf),
            "access not allowed from %s: %s", (char *)send_tok.value, msg);
        amfree(send_tok.value);
@@ -1598,8 +714,11 @@ gss_server(
     rval = 0;
 out:
     seteuid(euid);
-    if (rval != 0)
-       kc->errmsg = stralloc(errbuf);
+    if (rval != 0) {
+       rc->errmsg = stralloc(errbuf);
+    } else {
+       rc->auth = 1;
+    }
     k5printf(("gss_server returning %d\n", rval));
     return (rval);
 }
@@ -1608,18 +727,18 @@ out:
  * Setup some things about krb5.  This should only be called once.
  */
 static void
-init(void)
+krb5_init(void)
 {
     static int beenhere = 0;
-    struct hostent *he;
     char *p;
+    char *myfqhostname=NULL;
 
     if (beenhere)
        return;
     beenhere = 1;
 
 #ifndef BROKEN_MEMORY_CCACHE
-    setenv(KRB5_ENV_CCNAME, "MEMORY:amanda_ccache", 1);
+    putenv(stralloc("KRB5_ENV_CCNAME=MEMORY:amanda_ccache"));
 #else
     /*
      * MEMORY ccaches seem buggy and cause a lot of internal heap
@@ -1631,26 +750,34 @@ init(void)
      */
     atexit(cleanup);
     {
-       char ccache[64];
-       snprintf(ccache, SIZEOF(ccache), "FILE:/tmp/amanda_ccache.%ld.%ld",
-           (long)geteuid(), (long)getpid());
-       setenv(KRB5_ENV_CCNAME, ccache, 1);
+       char *ccache;
+       ccache = malloc(128);
+       snprintf(ccache, SIZEOF(ccache),
+                "KRB5_ENV_CCNAME=FILE:/tmp/amanda_ccache.%ld.%ld",
+                (long)geteuid(), (long)getpid());
+       putenv(ccache);
     }
 #endif
 
-    gethostname(hostname, SIZEOF(hostname) - 1);
-    hostname[SIZEOF(hostname) - 1] = '\0';
+    gethostname(myhostname, SIZEOF(myhostname) - 1);
+    myhostname[SIZEOF(myhostname) - 1] = '\0';
+
     /*
-     * In case it isn't fully qualified, do a DNS lookup.
+     * In case it isn't fully qualified, do a DNS lookup.  Ignore
+     * any errors (this is best-effort).
      */
-    if ((he = gethostbyname(hostname)) != NULL)
-       strncpy(hostname, he->h_name, SIZEOF(hostname) - 1);
+    if (try_resolving_hostname(myhostname, &myfqhostname) == 0
+       && myfqhostname != NULL) {
+       strncpy(myhostname, myfqhostname, SIZEOF(myhostname)-1);
+       myhostname[SIZEOF(myhostname)-1] = '\0';
+       amfree(myfqhostname);
+    }
 
     /*
      * Lowercase the results.  We assume all host/ principals will be
      * lowercased.
      */
-    for (p = hostname; *p != '\0'; p++) {
+    for (p = myhostname; *p != '\0'; p++) {
        if (isupper((int)*p))
            *p = tolower(*p);
     }
@@ -1683,17 +810,20 @@ get_tgt(
     krb5_error_code ret;
     krb5_principal client = NULL, server = NULL;
     krb5_creds creds;
-    krb5_keytab keytab = NULL;
+    krb5_keytab keytab;
     krb5_ccache ccache;
     krb5_timestamp now;
+#ifdef KRB5_HEIMDAL_INCLUDES
+    krb5_data tgtname = { KRB5_TGS_NAME_SIZE, KRB5_TGS_NAME };
+#else
     krb5_data tgtname = { 0, KRB5_TGS_NAME_SIZE, KRB5_TGS_NAME };
+#endif
     static char *error = NULL;
 
     if (error != NULL) {
        amfree(error);
        error = NULL;
     }
-
     if ((ret = krb5_init_context(&context)) != 0) {
        error = vstralloc("error initializing krb5 context: ",
            error_message(ret), NULL);
@@ -1716,7 +846,7 @@ get_tgt(
      * Resolve keytab file into a keytab object
      */
     if ((ret = krb5_kt_resolve(context, keytab_name, &keytab)) != 0) {
-       error = vstralloc("error resolving keytab ", keytab, ": ",
+       error = vstralloc("error resolving keytab ", keytab_name, ": ",
            error_message(ret), NULL);
        return (error);
     }
@@ -1732,6 +862,15 @@ get_tgt(
        return (error);
     }
 
+#ifdef KRB5_HEIMDAL_INCLUDES
+    ret = krb5_build_principal_ext(context, &server,
+        krb5_realm_length(*krb5_princ_realm(context, client)),
+        krb5_realm_data(*krb5_princ_realm(context, client)),
+        tgtname.length, tgtname.data,
+        krb5_realm_length(*krb5_princ_realm(context, client)),
+        krb5_realm_data(*krb5_princ_realm(context, client)),
+        0);
+#else
     ret = krb5_build_principal_ext(context, &server,
        krb5_princ_realm(context, client)->length,
        krb5_princ_realm(context, client)->data,
@@ -1739,6 +878,7 @@ get_tgt(
        krb5_princ_realm(context, client)->length,
        krb5_princ_realm(context, client)->data,
        0);
+#endif
     if (ret != 0) {
        error = vstralloc("error while building server name: ",
            error_message(ret), NULL);
@@ -1798,6 +938,7 @@ cleanup2:
     return (error);
 }
 
+#ifndef KDESTROY_VIA_UNLINK
 /*
  * get rid of tickets
  */
@@ -1821,6 +962,7 @@ cleanup:
      krb5_free_context(context);
      return;
 }
+#endif
 
 /*
  * Formats an error from the gss api
@@ -1846,166 +988,88 @@ gss_error(
     return ((const char *)msg.value);
 }
 
-/*
- * Transmits a gss_buffer_desc over a krb5_handle, adding
- * the necessary headers to allow the remote end to decode it.
- * Encryption must be done by the caller.
- */
+#ifdef AMANDA_KRB5_ENCRYPT
 static int
-send_token(
-    struct krb5_conn *         kc,
-    int                                handle,
-    const gss_buffer_desc *    tok)
+k5_encrypt(
+    void *cookie,
+    void *buf,
+    ssize_t buflen,
+    void **encbuf,
+    ssize_t *encbuflen)
 {
-    OM_uint32 netlength, nethandle;
-    struct iovec iov[3];
-
-    k5printf(("krb5: send_token: writing %d bytes to %s\n", tok->length,
-       kc->hostname));
-
-    if (tok->length > AMANDA_MAX_TOK_SIZE) {
-       kc->errmsg = newvstralloc(kc->errmsg, "krb5 write error to ",
-           kc->hostname, ": token too large", NULL);
-       return (-1);
-    }
-
-    /*
-     * Format is:
-     *   32 bit length (network byte order)
-     *   32 bit handle (network byte order)
-     *   data
-     */
-    netlength = (OM_uint32)htonl(tok->length);
-    iov[0].iov_base = (void *)&netlength;
-    iov[0].iov_len = SIZEOF(netlength);
+    struct tcp_conn *rc = cookie;
+    gss_buffer_desc dectok;
+    gss_buffer_desc enctok;
+    OM_uint32 maj_stat, min_stat;
+    int conf_state;
 
-    nethandle = (OM_uint32)htonl((uint32_t)handle);
-    iov[1].iov_base = (void *)&nethandle;
-    iov[1].iov_len = SIZEOF(nethandle);
+    k5printf(("krb5: k5_encrypt: enter %p\n", rc));
 
-    iov[2].iov_base = (void *)tok->value;
-    iov[2].iov_len = tok->length;
+    dectok.length = buflen;
+    dectok.value  = buf;    
 
-    if (net_writev(kc->fd, iov, 3) < 0) {
-       kc->errmsg = newvstralloc(kc->errmsg, "krb5 write error to ",
-           kc->hostname, ": ", strerror(errno), NULL);
-       return (-1);
+    if (rc->auth == 1) {
+       assert(rc->gss_context != GSS_C_NO_CONTEXT);
+       maj_stat = gss_seal(&min_stat, rc->gss_context, 1,
+                           GSS_C_QOP_DEFAULT, &dectok, &conf_state, &enctok);
+       if (maj_stat != (OM_uint32)GSS_S_COMPLETE || conf_state == 0) {
+           k5printf(("krb5 encrypt error to %s: %s\n",
+                     rc->hostname, gss_error(maj_stat, min_stat)));
+           return (-1);
+       }
+       k5printf(("krb5: k5_encrypt: give %zu bytes\n", enctok.length));
+       *encbuf = enctok.value;
+       *encbuflen = enctok.length;
+    } else {
+       *encbuf = buf;
+       *encbuflen = buflen;
     }
+       k5printf(("krb5: k5_encrypt: exit\n"));
     return (0);
 }
 
-static ssize_t
-recv_token(
-    struct krb5_conn * kc,
-    int *              handle,
-    gss_buffer_desc *  gtok,
-    int                        timeout)
-{
-    OM_uint32 netint[2];
-
-    assert(kc->fd >= 0);
-    assert(gtok != NULL);
-
-    k5printf(("krb5: recv_token: reading from %s\n", kc->hostname));
-
-    switch (net_read(kc->fd, &netint, SIZEOF(netint), timeout)) {
-    case -1:
-       kc->errmsg = newvstralloc(kc->errmsg, "recv error: ", strerror(errno),
-           NULL);
-       k5printf(("krb5 recv_token error return: %s\n", kc->errmsg));
-       return (-1);
-    case 0:
-       gtok->length = 0;
-       return (0);
-    default:
-       break;
-    }
-    gtok->length = ntohl(netint[0]);
-
-    if (gtok->length > AMANDA_MAX_TOK_SIZE) {
-       kc->errmsg = newstralloc(kc->errmsg, "recv error: buffer too large");
-       k5printf(("krb5 recv_token error return: %s\n", kc->errmsg));
-       return (-1);
-    }
-
-    if (handle != NULL)
-       *handle = ntohl(netint[1]);
-
-    gtok->value = alloc(gtok->length);
-    switch (net_read(kc->fd, gtok->value, gtok->length, timeout)) {
-    case -1:
-       kc->errmsg = newvstralloc(kc->errmsg, "recv error: ", strerror(errno),
-           NULL);
-       k5printf(("krb5 recv_token error return: %s\n", kc->errmsg));
-       amfree(gtok->value);
-       return (-1);
-    case 0:
-       amfree(gtok->value);
-       gtok->length = 0;
-       break;
-    default:
-       break;
-    }
-
-    k5printf(("krb5: recv_token: read %d bytes from %s\n", gtok->length,
-       kc->hostname));
-    return ((ssize_t)gtok->length);
-}
-
-#ifdef AMANDA_KRB5_ENCRYPT
 static int
-kencrypt(
-    struct krb5_stream *ks,
-    gss_buffer_desc *  tok,
-    gss_buffer_desc *  enctok)
+k5_decrypt(
+    void *cookie,
+    void *buf,
+    ssize_t buflen,
+    void **decbuf,
+    ssize_t *decbuflen)
 {
-    int conf_state;
+    struct tcp_conn *rc = cookie;
+    gss_buffer_desc enctok;
+    gss_buffer_desc dectok;
     OM_uint32 maj_stat, min_stat;
+    int conf_state, qop_state;
 
-    assert(ks->kc->gss_context != GSS_C_NO_CONTEXT);
-    maj_stat = gss_seal(&min_stat, ks->kc->gss_context, 1,
-       GSS_C_QOP_DEFAULT, tok, &conf_state, enctok);
-    if (maj_stat != (OM_uint32)GSS_S_COMPLETE || conf_state == 0) {
-       security_stream_seterror(&ks->secstr,
-           "krb5 encryption failed to %s: %s",
-           ks->kc->hostname, gss_error(maj_stat, min_stat));
-       return (-1);
-    }
-    return (0);
-}
+    k5printf(("krb5: k5_decrypt: enter\n"));
 
-static int
-kdecrypt(
-    struct krb5_stream *ks,
-    gss_buffer_desc *  enctok,
-    gss_buffer_desc *  tok)
-{
-    OM_uint32 maj_stat, min_stat;
-    int conf_state, qop_state;
+    if (rc->auth == 1) {
+       enctok.length = buflen;
+       enctok.value  = buf;    
 
-    k5printf(("krb5: kdecrypt: decrypting %d bytes\n", enctok->length));
+       k5printf(("krb5: k5_decrypt: decrypting %zu bytes\n", enctok.length));
 
-    assert(ks->kc->gss_context != GSS_C_NO_CONTEXT);
-    maj_stat = gss_unseal(&min_stat, ks->kc->gss_context, enctok, tok,
-       &conf_state, &qop_state);
-    if (maj_stat != (OM_uint32)GSS_S_COMPLETE) {
-       security_stream_seterror(&ks->secstr, "krb5 decrypt error from %s: %s",
-           ks->kc->hostname, gss_error(maj_stat, min_stat));
-       return (-1);
+       assert(rc->gss_context != GSS_C_NO_CONTEXT);
+       maj_stat = gss_unseal(&min_stat, rc->gss_context, &enctok, &dectok,
+                             &conf_state, &qop_state);
+       if (maj_stat != (OM_uint32)GSS_S_COMPLETE) {
+           k5printf(("krb5 decrypt error from %s: %s\n",
+                     rc->hostname, gss_error(maj_stat, min_stat)));
+           return (-1);
+       }
+       k5printf(("krb5: k5_decrypt: give %zu bytes\n", dectok.length));
+       *decbuf = dectok.value;
+       *decbuflen = dectok.length;
+    } else {
+       *decbuf = buf;
+       *decbuflen = buflen;
     }
+    k5printf(("krb5: k5_decrypt: exit\n"));
     return (0);
 }
 #endif
 
-/*
- * hackish, but you can #undef AMANDA_PRINCIPAL here, and you can both
- * hardcode a principal in your build and use the .k5amandahosts.  This is
- * available because sites that run pre-releases of amanda 2.5.0 before 
- * this feature was there do not behave this way...
- */
-
-/*#undef AMANDA_PRINCIPAL*/
-
 /*
  * check ~/.k5amandahosts to see if this principal is allowed in.  If it's
  * hardcoded, then we don't check the realm
index 5ddc1da290f6f886d5e744a4c9d589870e89d013..dba15c802c28add576135af2f4a85476a2ccfd57 100644 (file)
@@ -30,7 +30,7 @@
  */
 
 #include "amanda.h"
-#include "regex.h"
+#include <regex.h>
 
 static int match_word(const char *glob, const char *word, const char separator);
 
diff --git a/common-src/memmove.c b/common-src/memmove.c
deleted file mode 100644 (file)
index 6cbd9dd..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Amanda, The Advanced Maryland Automatic Network Disk Archiver
- * Copyright (c) 1991-1998 University of Maryland at College Park
- * All Rights Reserved.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of U.M. not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission.  U.M. makes no representations about the
- * suitability of this software for any purpose.  It is provided "as is"
- * without express or implied warranty.
- *
- * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Authors: the Amanda Development Team.  Its members are listed in a
- * file named AUTHORS, in the root directory of this distribution.
- */
-/* $Id: memmove.c,v 1.4 1998/07/04 00:18:48 oliva Exp $
- *
- * wrapper file for Henry Spencer's memmove.c
- */
-
-#include "amanda.h"
-
-#ifndef HAVE_MEMMOVE
-
-#ifdef HAVE_BCOPY
-
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-
-char *memmove(to, from, n)
-char *to, *from;
-size_t n;
-{
-  bcopy(from, to, n);
-  return to;
-}
-
-#else
-
-#include "../regex-src/fake/memmove.c"
-
-#endif
-
-#endif
diff --git a/common-src/mktime.c b/common-src/mktime.c
deleted file mode 100644 (file)
index 5d4373d..0000000
+++ /dev/null
@@ -1,266 +0,0 @@
-/*
- * Copyright (c) 1987, 1989 Regents of the University of California.
- * All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Arthur David Olson of the National Cancer Institute.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *     This product includes software developed by the University of
- *     California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.  */
-
-/*static char *sccsid = "from: @(#)ctime.c     5.26 (Berkeley) 2/23/91";*/
-/*static char *rcsid = "$Id: mktime.c,v 1.5 2006/05/25 01:47:12 johnfranks Exp $";*/
-
-/*
- * This implementation of mktime is lifted straight from the NetBSD (BSD 4.4)
- * version.  I modified it slightly to divorce it from the internals of the
- * ctime library.  Thus this version can't use details of the internal
- * timezone state file to figure out strange unnormalized struct tm values,
- * as might result from someone doing date math on the tm struct then passing
- * it to mktime.
- *
- * It just does as well as it can at normalizing the tm input, then does a
- * binary search of the time space using the system's localtime() function.
- *
- * The original binary search was defective in that it didn't consider the
- * setting of tm_isdst when comparing tm values, causing the search to be
- * flubbed for times near the dst/standard time changeover.  The original
- * code seems to make up for this by grubbing through the timezone info
- * whenever the binary search barfed.  Since I don't have that luxury in
- * portable code, I have to take care of tm_isdst in the comparison routine.
- * This requires knowing how many minutes offset dst is from standard time.
- *
- * So, if you live somewhere in the world where dst is not 60 minutes offset,
- * and your vendor doesn't supply mktime(), you'll have to edit this variable
- * by hand.  Sorry about that.
- */
-
-#include "amanda.h"
-
-#ifndef DSTMINUTES
-#define DSTMINUTES 60
-#endif
-
-#define FALSE 0
-#define TRUE 1
-
-/* some constants from tzfile.h */
-#define SECSPERMIN      60
-#define MINSPERHOUR     60
-#define HOURSPERDAY     24
-#define DAYSPERWEEK     7
-#define DAYSPERNYEAR    365
-#define DAYSPERLYEAR    366
-#define SECSPERHOUR     (SECSPERMIN * MINSPERHOUR)
-#define SECSPERDAY      ((long) SECSPERHOUR * HOURSPERDAY)
-#define MONSPERYEAR     12
-#define TM_YEAR_BASE    1900
-#define isleap(y) ((((y) % 4) == 0 && ((y) % 100) != 0) || ((y) % 400) == 0)
-
-static int     mon_lengths[2][MONSPERYEAR] = {
-       { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 },
-       { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
-};
-
-static int     year_lengths[2] = {
-       DAYSPERNYEAR, DAYSPERLYEAR
-};
-
-/*
-** Adapted from code provided by Robert Elz, who writes:
-**     The "best" way to do mktime I think is based on an idea of Bob
-**     Kridle's (so its said...) from a long time ago. (mtxinu!kridle now).
-**     It does a binary search of the time_t space.  Since time_t's are
-**     just 32 bits, its a max of 32 iterations (even at 64 bits it
-**     would still be very reasonable).
-*/
-
-#ifndef WRONG
-#define WRONG  (-1)
-#endif /* !defined WRONG */
-
-static void
-normalize(tensptr, unitsptr, base)
-int * tensptr;
-int * unitsptr;
-int    base;
-{
-       if (*unitsptr >= base) {
-               *tensptr += *unitsptr / base;
-               *unitsptr %= base;
-       } else if (*unitsptr < 0) {
-               --*tensptr;
-               *unitsptr += base;
-               if (*unitsptr < 0) {
-                       *tensptr -= 1 + (-*unitsptr) / base;
-                       *unitsptr = base - (-*unitsptr) % base;
-               }
-       }
-}
-
-static struct tm *
-mkdst(tmp)
-struct tm *    tmp;
-{
-    /* jds */
-    static struct tm tmbuf;
-
-    tmbuf = *tmp;
-    tmbuf.tm_isdst = 1;
-    tmbuf.tm_min += DSTMINUTES;
-    normalize(&tmbuf.tm_hour, &tmbuf.tm_min, MINSPERHOUR);
-    return &tmbuf;
-}
-
-static int
-tmcomp(atmp, btmp)
-register struct tm * atmp;
-register struct tm * btmp;
-{
-       register int    result;
-
-       /* compare down to the same day */
-
-       if ((result = (atmp->tm_year - btmp->tm_year)) == 0 &&
-           (result = (atmp->tm_mon - btmp->tm_mon)) == 0)
-           result = (atmp->tm_mday - btmp->tm_mday);
-
-       if(result != 0)
-           return result;
-
-       /* get rid of one-sided dst bias */
-
-       if(atmp->tm_isdst == 1 && !btmp->tm_isdst)
-           btmp = mkdst(btmp);
-       else if(btmp->tm_isdst == 1 && !atmp->tm_isdst)
-           atmp = mkdst(atmp);
-
-       /* compare the rest of the way */
-
-       if ((result = (atmp->tm_hour - btmp->tm_hour)) == 0 &&
-           (result = (atmp->tm_min - btmp->tm_min)) == 0)
-           result = atmp->tm_sec - btmp->tm_sec;
-       return result;
-}
-
-
-static time_t
-time2(tmp, okayp)
-struct tm *    tmp;
-int *          okayp;
-{
-       register int                    dir;
-       register int                    bits;
-       register int                    i;
-       register int                    saved_seconds;
-       time_t                          t;
-       struct tm                       yourtm, mytm;
-
-       *okayp = FALSE;
-       yourtm = *tmp;
-       if (yourtm.tm_sec >= SECSPERMIN + 2 || yourtm.tm_sec < 0)
-               normalize(&yourtm.tm_min, &yourtm.tm_sec, SECSPERMIN);
-       normalize(&yourtm.tm_hour, &yourtm.tm_min, MINSPERHOUR);
-       normalize(&yourtm.tm_mday, &yourtm.tm_hour, HOURSPERDAY);
-       normalize(&yourtm.tm_year, &yourtm.tm_mon, MONSPERYEAR);
-       while (yourtm.tm_mday <= 0) {
-               --yourtm.tm_year;
-               yourtm.tm_mday +=
-                       year_lengths[isleap(yourtm.tm_year + TM_YEAR_BASE)];
-       }
-       for ( ; ; ) {
-               i = mon_lengths[isleap(yourtm.tm_year +
-                       TM_YEAR_BASE)][yourtm.tm_mon];
-               if (yourtm.tm_mday <= i)
-                       break;
-               yourtm.tm_mday -= i;
-               if (++yourtm.tm_mon >= MONSPERYEAR) {
-                       yourtm.tm_mon = 0;
-                       ++yourtm.tm_year;
-               }
-       }
-       saved_seconds = yourtm.tm_sec;
-       yourtm.tm_sec = 0;
-       /*
-       ** Calculate the number of magnitude bits in a time_t
-       ** (this works regardless of whether time_t is
-       ** signed or unsigned, though lint complains if unsigned).
-       */
-       for (bits = 0, t = 1; t > 0; ++bits, t <<= 1)
-               ;
-       /*
-       ** If time_t is signed, then 0 is the median value,
-       ** if time_t is unsigned, then 1 << bits is median.
-       */
-       t = (t < 0) ? 0 : ((time_t) 1 << bits);
-       for ( ; ; ) {
-               mytm = *localtime(&t);
-               dir = tmcomp(&mytm, &yourtm);
-               if (dir != 0) {
-                       if (bits-- < 0)
-                               return WRONG;
-                       if (bits < 0)
-                               --t;
-                       else if (dir > 0)
-                               t -= (time_t) 1 << bits;
-                       else    t += (time_t) 1 << bits;
-                       continue;
-               }
-               if (yourtm.tm_isdst < 0 || mytm.tm_isdst == yourtm.tm_isdst)
-                       break;
-
-               return WRONG;
-       }
-       t += saved_seconds;
-       *tmp = *localtime(&t);
-       *okayp = TRUE;
-       return t;
-}
-
-static time_t
-time1(tmp)
-struct tm * tmp;
-{
-       register time_t                 t;
-       int                             okay;
-
-       if (tmp->tm_isdst > 1)
-               tmp->tm_isdst = 1;
-       t = time2(tmp, &okay);
-       if (okay || tmp->tm_isdst < 0)
-               return t;
-
-       return WRONG;
-}
-
-time_t
-mktime(tmp)
-struct tm * tmp;
-{
-       return time1(tmp);
-}
index 2b2fdf98534ca5f7da7c7c1394211b06b56d1069..87b5f5043448ec956dd55cb0cc4340c7420cf975 100644 (file)
@@ -24,7 +24,7 @@
  * file named AUTHORS, in the root directory of this distribution.
  */
 /*
- * $Id: packet.c,v 1.8.2.4 2006/12/18 20:43:50 martinea Exp $
+ * $Id: packet.c,v 1.8 2006/05/25 01:47:12 johnfranks Exp $
  *
  * Routines for modifying the amanda protocol packet type
  */
index 9983a495817f951572473cee1269a30e79ffdfde..cd40615698df3b84c1146ca084f0dbb0b6a09b2c 100644 (file)
@@ -24,7 +24,7 @@
  * file named AUTHORS, in the root directory of this distribution.
  */
 /*
- * $Id: packet.h,v 1.8.2.1 2006/12/18 20:43:51 martinea Exp $
+ * $Id: packet.h,v 1.8 2006/05/25 01:47:12 johnfranks Exp $
  *
  * interfaces for modifying amanda protocol packet type
  */
index a56a1d48d92c605a5b25c45de03e7d24e76043d5..09553b6ce3db42d0112619ff341c2f67209b53e0 100644 (file)
@@ -91,7 +91,7 @@ pipespawnv_passwd(
      * Log the command line and count the args.
      */
     dbprintf(("%s: spawning %s in pipeline\n", debug_prefix_time(NULL), prog));
-    dbprintf(("%s: argument list:", debug_prefix(NULL)));
+    dbprintf(("%s: argument list:", debug_prefix_time(NULL)));
     if ((pipedef & PASSWD_PIPE) != 0) {
        passwdvar = *my_argv++;
        passwdfd  = (int *)*my_argv++;
index 077e34e178b498a3f8e05f9244a21b1edd559735..4b3f54ffd02db456644cd82e37b25b141483f294 100644 (file)
  * file named AUTHORS, in the root directory of this distribution.
  */
 /*
- * $Id: protocol.c,v 1.45.2.2 2006/12/18 20:43:51 martinea Exp $
+ * $Id: protocol.c,v 1.45 2006/05/25 17:07:31 martinea Exp $
  *
  * implements amanda protocol
  */
 #include "amanda.h"
+#include "conffile.h"
 #include "event.h"
 #include "packet.h"
 #include "security.h"
 #include "protocol.h"
 
-/*#define      PROTO_DEBUG*/
+#define proto_debug(i,x) do {                          \
+       if ((i) <= debug_protocol) {    \
+           dbprintf(x);                                \
+       }                                               \
+} while (0)
 
 /*
  * Valid actions that can be passed to the state machine
@@ -73,19 +78,17 @@ typedef struct proto {
     time_t origtime;                   /* orig start time of this request */
     time_t curtime;                    /* time when this attempt started */
     int connecttries;                  /* times we'll retry a connect */
-    int reqtries;                      /* times we'll resend a REQ */
-    int acktries;                      /* times we'll wait for an a ACK */
+    int resettries;                    /* times we'll resend a REQ */
+    int reqtries;                      /* times we'll wait for an a ACK */
     pkt_t req;                         /* the actual wire request */
     protocol_sendreq_callback continuation; /* call when req dies/finishes */
     void *datap;                       /* opaque cookie passed to above */
     char *(*conf_fn)(char *, void *);  /* configuration function */
 } proto_t;
 
-#define        CONNECT_TRIES   3       /* num retries after connect errors */
 #define        CONNECT_WAIT    5       /* secs between connect attempts */
 #define ACK_WAIT       10      /* time (secs) to wait for ACK - keep short */
-#define ACK_TRIES      3       /* num retries after ACK_WAIT timeout */
-#define REQ_TRIES      2       /* num restarts (reboot/crash) */
+#define RESET_TRIES    2       /* num restarts (reboot/crash) */
 #define CURTIME        (time(0) - proto_init_time) /* time relative to start */
 
 /* if no reply in an hour, just forget it */
@@ -101,10 +104,8 @@ static time_t proto_init_time;
 
 /* local functions */
 
-#ifdef PROTO_DEBUG
 static const char *action2str(p_action_t);
 static const char *pstate2str(pstate_t);
-#endif
 
 static void connect_callback(void *, security_handle_t *, security_status_t);
 static void connect_wait_callback(void *);
@@ -154,9 +155,9 @@ protocol_sendreq(
     p->repwait = repwait;
     p->origtime = CURTIME;
     /* p->curtime set in the sendreq state */
-    p->connecttries = CONNECT_TRIES;
-    p->reqtries = REQ_TRIES;
-    p->acktries = ACK_TRIES;
+    p->connecttries = getconf_int(CNF_CONNECT_TRIES);
+    p->resettries = RESET_TRIES;
+    p->reqtries = getconf_int(CNF_REQ_TRIES);
     p->conf_fn = conf_fn;
     pkt_init(&p->req, P_REQ, req);
 
@@ -169,10 +170,8 @@ protocol_sendreq(
     p->continuation = continuation;
     p->datap = datap;
 
-#ifdef PROTO_DEBUG
-    dbprintf(("%s: security_connect: host %s -> p %p\n", 
-             debug_prefix_time(": protocol"), hostname, p));
-#endif
+    proto_debug(1, ("%s: security_connect: host %s -> p %p\n", 
+                   debug_prefix_time(": protocol"), hostname, p));
 
     security_connect(p->security_driver, p->hostname, conf_fn, connect_callback,
                         p, p->datap);
@@ -197,10 +196,8 @@ connect_callback(
     assert(p != NULL);
     p->security_handle = security_handle;
 
-#ifdef PROTO_DEBUG
-    dbprintf(("%s: connect_callback: p %p\n",
-             debug_prefix_time(": protocol"), p));
-#endif
+    proto_debug(1, ("%s: connect_callback: p %p\n",
+                   debug_prefix_time(": protocol"), p));
 
     switch (status) {
     case S_OK:
@@ -220,10 +217,8 @@ connect_callback(
        if (--p->connecttries == 0) {
            state_machine(p, PA_ABORT, NULL);
        } else {
-#ifdef PROTO_DEBUG
-    dbprintf(("%s: connect_callback: p %p: retrying %s\n",
-             debug_prefix_time(": protocol"), p, p->hostname));
-#endif
+           proto_debug(1, ("%s: connect_callback: p %p: retrying %s\n",
+                           debug_prefix_time(": protocol"), p, p->hostname));
            security_close(p->security_handle);
            /* XXX overload p->security handle to hold the event handle */
            p->security_handle =
@@ -306,30 +301,25 @@ state_machine(
     pstate_t curstate;
     p_action_t retaction;
 
-#ifdef PROTO_DEBUG
-       dbprintf(("%s: state_machine: initial: p %p action %s pkt %p\n",
-               debug_prefix_time(": protocol"),
-               p, action2str(action), NULL));
-#endif
+    proto_debug(1, ("protocol: state_machine: initial: p %p action %s pkt %p\n",
+                   p, action2str(action), (void *)NULL));
 
     assert(p != NULL);
     assert(action == PA_RCVDATA || pkt == NULL);
     assert(p->state != NULL);
 
     for (;;) {
-#ifdef PROTO_DEBUG
-       dbprintf(("%s: state_machine: p %p state %s action %s\n",
-                 debug_prefix_time(": protocol"),
-                 p, pstate2str(p->state), action2str(action)));
+       proto_debug(1, ("%s: state_machine: p %p state %s action %s\n",
+                       debug_prefix_time(": protocol"),
+                       p, pstate2str(p->state), action2str(action)));
        if (pkt != NULL) {
-           dbprintf(("%s: pkt: %s (t %d) orig REQ (t %d cur %d)\n",
-                     debug_prefix(": protocol"),
-                     pkt_type2str(pkt->type), (int)CURTIME,
-                     (int)p->origtime, (int)p->curtime));
-           dbprintf(("%s: pkt contents:\n-----\n%s-----\n",
-                     debug_prefix(": protocol"), pkt->body));
+           proto_debug(1, ("%s: pkt: %s (t %d) orig REQ (t %d cur %d)\n",
+                           debug_prefix_time(": protocol"),
+                           pkt_type2str(pkt->type), (int)CURTIME,
+                           (int)p->origtime, (int)p->curtime));
+           proto_debug(1, ("%s: pkt contents:\n-----\n%s-----\n",
+                           debug_prefix_time(": protocol"), pkt->body));
        }
-#endif
 
        /*
         * p->state is a function pointer to the current state a request
@@ -354,11 +344,9 @@ state_machine(
             */
            retaction = (*curstate)(p, action, pkt);
 
-#ifdef PROTO_DEBUG
-       dbprintf(("%s: state_machine: p %p state %s returned %s\n",
-                 debug_prefix_time(": protocol"),
-                 p, pstate2str(p->state), action2str(retaction)));
-#endif
+       proto_debug(1, ("%s: state_machine: p %p state %s returned %s\n",
+                       debug_prefix_time(": protocol"),
+                       p, pstate2str(p->state), action2str(retaction)));
 
        /*
         * The state function is expected to return one of the following
@@ -376,11 +364,9 @@ state_machine(
            /* FALLTHROUGH */
 
        case PA_PENDING:
-#ifdef PROTO_DEBUG
-           dbprintf(("%s: state_machine: p %p state %s: timeout %d\n",
-                     debug_prefix_time(": protocol"),
-                     p, pstate2str(p->state), (int)p->timeout));
-#endif
+           proto_debug(1, ("%s: state_machine: p %p state %s: timeout %d\n",
+                           debug_prefix_time(": protocol"),
+                           p, pstate2str(p->state), (int)p->timeout));
            /*
             * Get the security layer to register a receive event for this
             * security handle on our behalf.  Have it timeout in p->timeout
@@ -396,12 +382,10 @@ state_machine(
         */
        case PA_CONTINUE:
            assert(p->state != curstate);
-#ifdef PROTO_DEBUG
-           dbprintf(("%s: state_machine: p %p: moved from %s to %s\n",
-                     debug_prefix_time(": protocol"),
-                     p, pstate2str(curstate),
-                     pstate2str(p->state)));
-#endif
+           proto_debug(1, ("%s: state_machine: p %p: moved from %s to %s\n",
+                           debug_prefix_time(": protocol"),
+                           p, pstate2str(curstate),
+                           pstate2str(p->state)));
            continue;
 
        /*
@@ -506,7 +490,7 @@ s_ackwait(
     if (action == PA_TIMEOUT) {
        assert(pkt == NULL);
 
-       if (--p->acktries == 0) {
+       if (--p->reqtries == 0) {
            security_seterror(p->security_handle, "timeout waiting for ACK");
            return (PA_ABORT);
        }
@@ -582,7 +566,7 @@ s_repwait(
         * If we've blown our timeout limit, free up this packet and
         * return.
         */
-       if (p->reqtries == 0 || DROP_DEAD_TIME(p->origtime)) {
+       if (p->resettries == 0 || DROP_DEAD_TIME(p->origtime)) {
            security_seterror(p->security_handle, "timeout waiting for REP");
            return (PA_ABORT);
        }
@@ -590,9 +574,9 @@ s_repwait(
        /*
         * We still have some tries left.  Resend the request.
         */
-       p->reqtries--;
+       p->resettries--;
        p->state = s_sendreq;
-       p->acktries = ACK_TRIES;
+       p->reqtries = getconf_int(CNF_REQ_TRIES);
        return (PA_CONTINUE);
     }
 
@@ -661,7 +645,6 @@ recvpkt_callback(
  * Misc functions
  */
 
-#ifdef PROTO_DEBUG
 /*
  * Convert a pstate_t into a printable form.
  */
@@ -717,4 +700,3 @@ action2str(
            return (actions[i].name);
     return ("BOGUS ACTION");
 }
-#endif /* PROTO_DEBUG */
diff --git a/common-src/regcomp.c b/common-src/regcomp.c
deleted file mode 100644 (file)
index 01a86da..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Amanda, The Advanced Maryland Automatic Network Disk Archiver
- * Copyright (c) 1991-1998 University of Maryland at College Park
- * All Rights Reserved.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of U.M. not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission.  U.M. makes no representations about the
- * suitability of this software for any purpose.  It is provided "as is"
- * without express or implied warranty.
- *
- * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Authors: the Amanda Development Team.  Its members are listed in a
- * file named AUTHORS, in the root directory of this distribution.
- */
-/* $Id: regcomp.c,v 1.4 2006/05/25 01:47:12 johnfranks Exp $
- *
- * wrapper file for Henry Spencer's regcomp.c
- */
-
-#include "amanda.h"
-#include "amregex.h"
-#include "../regex-src/regcomp.c"
diff --git a/common-src/regerror.c b/common-src/regerror.c
deleted file mode 100644 (file)
index 04cd760..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Amanda, The Advanced Maryland Automatic Network Disk Archiver
- * Copyright (c) 1991-1998 University of Maryland at College Park
- * All Rights Reserved.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of U.M. not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission.  U.M. makes no representations about the
- * suitability of this software for any purpose.  It is provided "as is"
- * without express or implied warranty.
- *
- * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Authors: the Amanda Development Team.  Its members are listed in a
- * file named AUTHORS, in the root directory of this distribution.
- */
-/*
- * $Id: regerror.c,v 1.3 1998/07/04 00:18:52 oliva Exp $
- *
- * wrapper file for Henry Spencer's regerror.c
- */
-
-#include "amregex.h"
-#include "../regex-src/regerror.c"
diff --git a/common-src/regexec.c b/common-src/regexec.c
deleted file mode 100644 (file)
index 27f0dd5..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Amanda, The Advanced Maryland Automatic Network Disk Archiver
- * Copyright (c) 1991-1998 University of Maryland at College Park
- * All Rights Reserved.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of U.M. not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission.  U.M. makes no representations about the
- * suitability of this software for any purpose.  It is provided "as is"
- * without express or implied warranty.
- *
- * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Authors: the Amanda Development Team.  Its members are listed in a
- * file named AUTHORS, in the root directory of this distribution.
- */
-/*
- * $Id: regexec.c,v 1.3 1998/07/04 00:18:53 oliva Exp $
- *
- * wrapper file for Henry Spencer's regexec.c
- */
-
-#include "amregex.h"
-#include "../regex-src/regexec.c"
diff --git a/common-src/regfree.c b/common-src/regfree.c
deleted file mode 100644 (file)
index 06ace3b..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Amanda, The Advanced Maryland Automatic Network Disk Archiver
- * Copyright (c) 1991-1998 University of Maryland at College Park
- * All Rights Reserved.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of U.M. not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission.  U.M. makes no representations about the
- * suitability of this software for any purpose.  It is provided "as is"
- * without express or implied warranty.
- *
- * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Authors: the Amanda Development Team.  Its members are listed in a
- * file named AUTHORS, in the root directory of this distribution.
- */
-/*
- * $Id: regfree.c,v 1.3 1998/07/04 00:18:54 oliva Exp $
- *
- * wrapper file for Henry Spencer's regfree.c
- */
-
-#include "amregex.h"
-#include "../regex-src/regfree.c"
index 4c626ac54fc18c6a631157e3ffdab51e42759bb1..c98aed744d5cadd2bcdfde852afc9f87f405f77f 100644 (file)
@@ -25,7 +25,7 @@
  */
 
 /*
- * $Id: rsh-security.c,v 1.31.2.1 2006/10/25 19:13:11 martinea Exp $
+ * $Id: rsh-security.c,v 1.31 2006/08/21 20:17:10 martinea Exp $
  *
  * rsh-security.c - security and transport over rsh or a rsh-like command.
  *
 
 #ifdef RSH_SECURITY
 
-/*#define      RSH_DEBUG*/
-
-#ifdef RSH_DEBUG
-#define        rshprintf(x)    dbprintf(x)
-#else
-#define        rshprintf(x)
-#endif
-
 /*
  * Path to the rsh binary.  This should be configurable.
  */
@@ -103,6 +95,8 @@ const security_driver_t rsh_security_driver = {
     tcpm_stream_read_sync,
     tcpm_stream_read_cancel,
     tcpm_close_connection,
+    NULL,
+    NULL
 };
 
 static int newhandle = 1;
@@ -126,14 +120,13 @@ rsh_connect(
     void *             datap)
 {
     struct sec_handle *rh;
-    struct hostent *he;
     char *amandad_path=NULL, *client_username=NULL;
 
     assert(fn != NULL);
     assert(hostname != NULL);
 
-    rshprintf(("%s: rsh: rsh_connect: %s\n", debug_prefix_time(NULL),
-              hostname));
+    auth_debug(1, ("%s: rsh: rsh_connect: %s\n", debug_prefix_time(NULL),
+                  hostname));
 
     rh = alloc(SIZEOF(*rh));
     security_handleinit(&rh->sech, &rsh_security_driver);
@@ -142,14 +135,13 @@ rsh_connect(
     rh->ev_timeout = NULL;
     rh->rc = NULL;
 
-
-    if ((he = gethostbyname(hostname)) == NULL) {
+    rh->hostname = NULL;
+    if (try_resolving_hostname(hostname, &rh->hostname)) {
        security_seterror(&rh->sech,
            "%s: could not resolve hostname", hostname);
        (*fn)(arg, &rh->sech, S_ERROR);
        return;
     }
-    rh->hostname = stralloc(he->h_name);       /* will be replaced */
     rh->rs = tcpma_stream_client(rh, newhandle++);
 
     if (rh->rs == NULL)
index a55bafbbe22ed8c326b3faa8ccf50d864774e3ea..4035cbad58d2876bd0be817aec96572b13001d4f 100644 (file)
@@ -25,7 +25,7 @@
  */
 
 /*
- * $Id: security-util.c,v 1.25.2.10 2007/01/24 00:35:14 martinea Exp $
+ * $Id: security-util.c,v 1.25 2006/07/22 12:04:47 martinea Exp $
  *
  * sec-security.c - security and transport over sec or a sec-like command.
  *
 #include "stream.h"
 #include "version.h"
 
-/* #define     SEC_DEBUG */
-#define        SHOW_SECURITY_DETAIL
-
-#ifdef SEC_DEBUG
-#  define      secprintf(x)    dbprintf(x)
-#else
-#  ifdef __lint
-#    define    secprintf(x)    (void)(x)
-#  else
-#    define    secprintf(x)
-#  endif
-#endif
-
 /*
  * Magic values for sec_conn->handle
  */
@@ -141,8 +128,8 @@ sec_close(
 
     assert(rh != NULL);
 
-    secprintf(("%s: sec: closing handle to %s\n", debug_prefix_time(NULL),
-              rh->hostname));
+    auth_debug(1, ("%s: sec: closing handle to %s\n", debug_prefix_time(NULL),
+                  rh->hostname));
 
     if (rh->rs != NULL) {
        /* This may be null if we get here on an error */
@@ -219,7 +206,8 @@ stream_sendpkt(
     assert(rh != NULL);
     assert(pkt != NULL);
 
-    secprintf(("%s: sec: stream_sendpkt: enter\n", debug_prefix_time(NULL)));
+    auth_debug(1, ("%s: sec: stream_sendpkt: enter\n",
+                  debug_prefix_time(NULL)));
 
     if (rh->rc->prefix_packet)
        s = rh->rc->prefix_packet(rh, pkt);
@@ -233,10 +221,10 @@ stream_sendpkt(
     if (strlen(s) > 0)
        amfree(s);
 
-    secprintf((
-           "%s: sec: stream_sendpkt: %s (%d) pkt_t (len %d) contains:\n\n\"%s\"\n\n",
-           debug_prefix_time(NULL), pkt_type2str(pkt->type), pkt->type,
-           strlen(pkt->body), pkt->body));
+    auth_debug(1,
+     ("%s: sec: stream_sendpkt: %s (%d) pkt_t (len " SIZE_T_FMT ") contains:\n\n\"%s\"\n\n",
+      debug_prefix_time(NULL), pkt_type2str(pkt->type), pkt->type,
+      strlen(pkt->body), pkt->body));
 
     if (security_stream_write(&rh->rs->secstr, buf, len) < 0) {
        security_seterror(&rh->sech, security_stream_geterror(&rh->rs->secstr));
@@ -261,8 +249,8 @@ stream_recvpkt(
 
     assert(rh != NULL);
 
-    secprintf(("%s: sec: recvpkt registered for %s\n",
-              debug_prefix_time(NULL), rh->hostname));
+    auth_debug(1, ("%s: sec: recvpkt registered for %s\n",
+                  debug_prefix_time(NULL), rh->hostname));
 
     /*
      * Reset any pending timeout on this handle
@@ -295,8 +283,8 @@ stream_recvpkt_timeout(
 
     assert(rh != NULL);
 
-    secprintf(("%s: sec: recvpkt timeout for %s\n",
-              debug_prefix_time(NULL), rh->hostname));
+    auth_debug(1, ("%s: sec: recvpkt timeout for %s\n",
+                  debug_prefix_time(NULL), rh->hostname));
 
     stream_recvpkt_cancel(rh);
     (*rh->fn.recvpkt)(rh->arg, NULL, S_TIMEOUT);
@@ -311,8 +299,8 @@ stream_recvpkt_cancel(
 {
     struct sec_handle *rh = cookie;
 
-    secprintf(("%s: sec: cancelling recvpkt for %s\n",
-              debug_prefix_time(NULL), rh->hostname));
+    auth_debug(1, ("%s: sec: cancelling recvpkt for %s\n",
+                  debug_prefix_time(NULL), rh->hostname));
 
     assert(rh != NULL);
 
@@ -337,11 +325,11 @@ tcpm_stream_write(
     assert(rs != NULL);
     assert(rs->rc != NULL);
 
-    secprintf(("%s: sec: stream_write: writing %d bytes to %s:%d %d\n",
-              debug_prefix_time(NULL), size, rs->rc->hostname, rs->handle,
-              rs->rc->write));
+    auth_debug(1, ("%s: sec: stream_write: writing " SIZE_T_FMT " bytes to %s:%d %d\n",
+                  debug_prefix_time(NULL), size, rs->rc->hostname, rs->handle,
+                  rs->rc->write));
 
-    if (tcpm_send_token(rs->rc->write, rs->handle, &rs->rc->errmsg,
+    if (tcpm_send_token(rs->rc, rs->rc->write, rs->handle, &rs->rc->errmsg,
                             buf, size)) {
        security_stream_seterror(&rs->secstr, rs->rc->errmsg);
        return (-1);
@@ -426,6 +414,7 @@ tcpm_stream_read_cancel(
  */
 ssize_t
 tcpm_send_token(
+    struct tcp_conn *rc,
     int                fd,
     int                handle,
     char **    errmsg,
@@ -436,9 +425,14 @@ tcpm_send_token(
     uint32_t           netlength;
     struct iovec       iov[3];
     int                        nb_iov = 3;
+    int                        rval;
+    char               *encbuf;
+    ssize_t            encsize;
 
     assert(SIZEOF(netlength) == 4);
 
+    auth_debug(1, ("%s: tcpm_send_token: write %zd bytes to handle %d\n",
+         debug_prefix_time(NULL), len, handle));
     /*
      * Format is:
      *   32 bit length (network byte order)
@@ -453,16 +447,32 @@ tcpm_send_token(
     iov[1].iov_base = (void *)&nethandle;
     iov[1].iov_len = SIZEOF(nethandle);
 
+    encbuf = (char *)buf;
+    encsize = len;
+
     if(len == 0) {
        nb_iov = 2;
     }
     else {
-       iov[2].iov_base = (void *)buf;
-       iov[2].iov_len = len;
+       if (rc->driver->data_encrypt == NULL) {
+           iov[2].iov_base = (void *)buf;
+           iov[2].iov_len = len;
+       } else {
+           /* (the extra (void *) cast is to quiet type-punning warnings) */
+           rc->driver->data_encrypt(rc, (void *)buf, len, (void **)(void *)&encbuf, &encsize);
+           iov[2].iov_base = (void *)encbuf;
+           iov[2].iov_len = encsize;
+           netlength = htonl(encsize);
+       }
         nb_iov = 3;
     }
 
-    if (net_writev(fd, iov, nb_iov) < 0) {
+    rval = net_writev(fd, iov, nb_iov);
+    if (len != 0 && rc->driver->data_encrypt != NULL && buf != encbuf) {
+       amfree(encbuf);
+    }
+
+    if (rval < 0) {
        if (errmsg)
             *errmsg = newvstralloc(*errmsg, "write error to ",
                                   ": ", strerror(errno), NULL);
@@ -480,6 +490,7 @@ tcpm_send_token(
 
 ssize_t
 tcpm_recv_token(
+    struct tcp_conn    *rc,
     int                fd,
     int *      handle,
     char **    errmsg,
@@ -496,15 +507,15 @@ tcpm_recv_token(
        if (errmsg)
            *errmsg = newvstralloc(*errmsg, "recv error: ", strerror(errno),
                                   NULL);
-       secprintf(("%s: tcpm_recv_token: A return(-1)\n",
-                  debug_prefix_time(NULL)));
+       auth_debug(1, ("%s: tcpm_recv_token: A return(-1)\n",
+                      debug_prefix_time(NULL)));
        return (-1);
     case 0:
        *size = 0;
        *handle = H_EOF;
        *errmsg = newvstralloc(*errmsg, "SOCKET_EOF", NULL);
-       secprintf(("%s: tcpm_recv_token: A return(0)\n",
-                  debug_prefix_time(NULL)));
+       auth_debug(1, ("%s: tcpm_recv_token: A return(0)\n",
+                      debug_prefix_time(NULL)));
        return (0);
     default:
        break;
@@ -514,20 +525,20 @@ tcpm_recv_token(
     *handle = (int)ntohl(netint[1]);
     /* amanda protocol packet can be above NETWORK_BLOCK_BYTES */
     if (*size > 128*NETWORK_BLOCK_BYTES || *size < 0) {
-       if (isprint((*size        ) & 0xFF) &&
-           isprint((*size   >> 8 ) & 0xFF) &&
-           isprint((*size   >> 16) & 0xFF) &&
-           isprint((*size   >> 24) & 0xFF) &&
+       if (isprint((int)(*size        ) & 0xFF) &&
+           isprint((int)(*size   >> 8 ) & 0xFF) &&
+           isprint((int)(*size   >> 16) & 0xFF) &&
+           isprint((int)(*size   >> 24) & 0xFF) &&
            isprint((*handle      ) & 0xFF) &&
            isprint((*handle >> 8 ) & 0xFF) &&
            isprint((*handle >> 16) & 0xFF) &&
            isprint((*handle >> 24) & 0xFF)) {
            char s[101];
            int i;
-           s[0] = (*size   >> 24) & 0xFF;
-           s[1] = (*size   >> 16) & 0xFF;
-           s[2] = (*size   >>  8) & 0xFF;
-           s[3] = (*size        ) & 0xFF;
+           s[0] = ((int)(*size)  >> 24) & 0xFF;
+           s[1] = ((int)(*size)  >> 16) & 0xFF;
+           s[2] = ((int)(*size)  >>  8) & 0xFF;
+           s[3] = ((int)(*size)       ) & 0xFF;
            s[4] = (*handle >> 24) & 0xFF;
            s[5] = (*handle >> 16) & 0xFF;
            s[6] = (*handle >> 8 ) & 0xFF;
@@ -548,7 +559,7 @@ tcpm_recv_token(
        } else {
            *errmsg = newvstralloc(*errmsg, "tcpm_recv_token: invalid size",
                                   NULL);
-           dbprintf(("%s: tcpm_recv_token: invalid size %zd\n",
+           dbprintf(("%s: tcpm_recv_token: invalid size " SSIZE_T_FMT "\n",
                      debug_prefix_time(NULL), *size));
        }
        *size = -1;
@@ -558,8 +569,8 @@ tcpm_recv_token(
     *buf = alloc((size_t)*size);
 
     if(*size == 0) {
-       secprintf(("%s: tcpm_recv_token: read EOF from %d\n",
-                  debug_prefix_time(NULL), *handle));
+       auth_debug(1, ("%s: tcpm_recv_token: read EOF from %d\n",
+                      debug_prefix_time(NULL), *handle));
        *errmsg = newvstralloc(*errmsg, "EOF",
                                   NULL);
        return 0;
@@ -569,21 +580,34 @@ tcpm_recv_token(
        if (errmsg)
            *errmsg = newvstralloc(*errmsg, "recv error: ", strerror(errno),
                                   NULL);
-       secprintf(("%s: tcpm_recv_token: B return(-1)\n",
-                  debug_prefix_time(NULL)));
+       auth_debug(1, ("%s: tcpm_recv_token: B return(-1)\n",
+                      debug_prefix_time(NULL)));
        return (-1);
     case 0:
        *size = 0;
        *errmsg = newvstralloc(*errmsg, "SOCKET_EOF", NULL);
-       secprintf(("%s: tcpm_recv_token: B return(0)\n",
-                  debug_prefix_time(NULL)));
+       auth_debug(1, ("%s: tcpm_recv_token: B return(0)\n",
+                      debug_prefix_time(NULL)));
        return (0);
     default:
        break;
     }
 
-    secprintf(("%s: tcpm_recv_token: read %zd bytes from %d\n",
-              debug_prefix_time(NULL), *size, *handle));
+    auth_debug(1, ("%s: tcpm_recv_token: read " SSIZE_T_FMT " bytes from %d\n",
+                  debug_prefix_time(NULL), *size, *handle));
+
+    if (*size > 0 && rc->driver->data_decrypt != NULL) {
+       char *decbuf;
+       ssize_t decsize;
+       /* (the extra (void *) cast is to quiet type-punning warnings) */
+       rc->driver->data_decrypt(rc, *buf, *size, (void **)(void *)&decbuf, &decsize);
+       if (*buf != decbuf) {
+           amfree(*buf);
+           *buf = decbuf;
+       }
+       *size = decsize;
+    }
+
     return((*size));
 }
 
@@ -594,9 +618,9 @@ tcpm_close_connection(
 {
     struct sec_handle *rh = h;
 
-    hostname = hostname;
+    (void)hostname;
 
-    if(rh->rc->toclose == 0) {
+    if (rh && rh->rc && rh->rc->toclose == 0) {
        rh->rc->toclose = 1;
        sec_tcp_conn_put(rh->rc);
     }
@@ -653,8 +677,8 @@ tcpma_stream_client(
        rh->rc = rs->rc;
     }
 
-    secprintf(("%s: sec: stream_client: connected to stream %d\n",
-              debug_prefix_time(NULL), id));
+    auth_debug(1, ("%s: sec: stream_client: connected to stream %d\n",
+                  debug_prefix_time(NULL), id));
 
     return (rs);
 }
@@ -701,8 +725,8 @@ tcpma_stream_server(
      */
     rs->handle = 500000 - newhandle++;
     rs->ev_read = NULL;
-    secprintf(("%s: sec: stream_server: created stream %d\n",
-              debug_prefix_time(NULL), rs->handle));
+    auth_debug(1, ("%s: sec: stream_server: created stream %d\n",
+                  debug_prefix_time(NULL), rs->handle));
     return (rs);
 }
 
@@ -718,8 +742,8 @@ tcpma_stream_close(
 
     assert(rs != NULL);
 
-    secprintf(("%s: sec: tcpma_stream_close: closing stream %d\n",
-              debug_prefix_time(NULL), rs->handle));
+    auth_debug(1, ("%s: sec: tcpma_stream_close: closing stream %d\n",
+                  debug_prefix_time(NULL), rs->handle));
 
     if(rs->closed_by_network == 0 && rs->rc->write != -1)
        tcpm_stream_write(rs, &buf, 0);
@@ -826,6 +850,7 @@ tcp1_stream_client(
     }
     else {
        rh->rc = sec_tcp_conn_get(rh->hostname, 1);
+       rh->rc->driver = rh->sech.driver;
        rs->rc = rh->rc;
        rh->rc->read = stream_client(rh->hostname, (in_port_t)id,
                        STREAM_BUFSIZE, STREAM_BUFSIZE, &rs->port, 0);
@@ -901,13 +926,15 @@ bsd_recv_security_ok(
     char *tok, *security, *body, *result;
     char *service = NULL, *serviceX, *serviceY;
     char *security_line;
+    char *s, ch;
     size_t len;
+    in_port_t port;
 
     /*
      * Now, find the SECURITY line in the body, and parse it out
      * into an argv.
      */
-    if (strncmp(pkt->body, "SECURITY ", SIZEOF("SECURITY ") - 1) == 0) {
+    if (strncmp_const(pkt->body, "SECURITY ") == 0) {
        security = pkt->body;
        len = 0;
        while(*security != '\n' && len < pkt->size) {
@@ -934,8 +961,9 @@ bsd_recv_security_ok(
      * Now, find the SERVICE line in the body, and parse it out
      * into an argv.
      */
-    if (strncmp(body, "SERVICE", SIZEOF("SERVICE") - 1) == 0) {
-       serviceX = stralloc(body + strlen("SERVICE "));
+    s = body;
+    if (strncmp_const_skip(s, "SERVICE ", s, ch) == 0) {
+       serviceX = stralloc(s);
        serviceY = strtok(serviceX, "\n");
        if (serviceY)
            service  = stralloc(serviceY);
@@ -951,10 +979,11 @@ bsd_recv_security_ok(
        /*
         * Request packets must come from a reserved port
         */
-       if (ntohs(rh->peer.sin_port) >= IPPORT_RESERVED) {
+    port = SS_GET_PORT(&rh->peer);
+       if (port >= IPPORT_RESERVED) {
            security_seterror(&rh->sech,
-               "host %s: port %d not secure", rh->hostname,
-               ntohs(rh->peer.sin_port));
+               "host %s: port %u not secure", rh->hostname,
+               (unsigned int)port);
            amfree(service);
            amfree(security_line);
            return (-1);
@@ -1045,7 +1074,7 @@ udpbsd_sendpkt(
     assert(rh != NULL);
     assert(pkt != NULL);
 
-    secprintf(("%s: udpbsd_sendpkt: enter\n", get_pname()));
+    auth_debug(1, ("%s: udpbsd_sendpkt: enter\n", get_pname()));
     /*
      * Initialize this datagram, and add the header
      */
@@ -1078,12 +1107,12 @@ udpbsd_sendpkt(
      */
     dgram_cat(&rh->udp->dgram, pkt->body);
 
-    secprintf((
-           "%s: sec: udpbsd_sendpkt: %s (%d) pkt_t (len %d) contains:\n\n\"%s\"\n\n",
-           debug_prefix_time(NULL), pkt_type2str(pkt->type), pkt->type,
-           strlen(pkt->body), pkt->body));
+    auth_debug(1,
+     ("%s: sec: udpbsd_sendpkt: %s (%d) pkt_t (len " SIZE_T_FMT ") contains:\n\n\"%s\"\n\n",
+      debug_prefix_time(NULL), pkt_type2str(pkt->type), pkt->type,
+      strlen(pkt->body), pkt->body));
 
-    if (dgram_send_addr(rh->peer, &rh->udp->dgram) != 0) {
+    if (dgram_send_addr(&rh->peer, &rh->udp->dgram) != 0) {
        security_seterror(&rh->sech,
            "send %s to %s failed: %s", pkt_type2str(pkt->type),
            rh->hostname, strerror(errno));
@@ -1102,8 +1131,8 @@ udp_close(
        return;
     }
 
-    secprintf(("%s: udp: close handle '%s'\n",
-              debug_prefix_time(NULL), rh->proto_handle));
+    auth_debug(1, ("%s: udp: close handle '%s'\n",
+                  debug_prefix_time(NULL), rh->proto_handle));
 
     udp_recvpkt_cancel(rh);
     if (rh->next) {
@@ -1137,8 +1166,8 @@ udp_recvpkt(
 {
     struct sec_handle *rh = cookie;
 
-    secprintf(("%s: udp_recvpkt(cookie=%p, fn=%p, arg=%p, timeout=%u)\n",
-       debug_prefix(NULL), cookie, fn, arg, timeout));
+    auth_debug(1, ("%s: udp_recvpkt(cookie=%p, fn=%p, arg=%p, timeout=%u)\n",
+                  debug_prefix_time(NULL), cookie, fn, arg, timeout));
     assert(rh != NULL);
     assert(fn != NULL);
 
@@ -1199,16 +1228,19 @@ udp_recvpkt_callback(
     void (*fn)(void *, pkt_t *, security_status_t);
     void *arg;
 
-    secprintf(("%s: udp: receive handle '%s' netfd '%s'\n",
-              debug_prefix_time(NULL), rh->proto_handle, rh->udp->handle));
+    auth_debug(1, ("%s: udp: receive handle '%s' netfd '%s'\n",
+                  debug_prefix_time(NULL), rh->proto_handle, rh->udp->handle));
     assert(rh != NULL);
 
-    if (strcmp(rh->proto_handle, rh->udp->handle) != 0) assert(1);
+    /* if it doesn't correspond to this handle, something is wrong */
+    assert(strcmp(rh->proto_handle, rh->udp->handle) == 0);
+
     /* if it didn't come from the same host/port, forget it */
-    if (memcmp(&rh->peer.sin_addr, &rh->udp->peer.sin_addr,
-       SIZEOF(rh->udp->peer.sin_addr)) != 0 ||
-       rh->peer.sin_port != rh->udp->peer.sin_port) {
+    if (cmp_sockaddr(&rh->peer, &rh->udp->peer, 0) != 0) {
        amfree(rh->udp->handle);
+       dbprintf(("not form same host\n"));
+       dump_sockaddr(&rh->peer);
+       dump_sockaddr(&rh->udp->peer);
        return;
     }
 
@@ -1225,10 +1257,11 @@ udp_recvpkt_callback(
      * to the packet handling function instead of a packet.
      */
     if (rh->udp->recv_security_ok &&
-       rh->udp->recv_security_ok(rh, &rh->udp->pkt) < 0)
+       rh->udp->recv_security_ok(rh, &rh->udp->pkt) < 0) {
        (*fn)(arg, NULL, S_ERROR);
-    else
+    } else {
        (*fn)(arg, &rh->udp->pkt, S_OK);
+    }
 }
 
 /*
@@ -1258,81 +1291,23 @@ int
 udp_inithandle(
     udp_handle_t *     udp,
     struct sec_handle *        rh,
-    struct hostent *   he,
+    char *              hostname,
+    struct sockaddr_storage *addr,
     in_port_t          port,
     char *             handle,
     int                        sequence)
 {
-    int i;
-
     /*
      * Save the hostname and port info
      */
-    secprintf(("%s: udp_inithandle port %u handle %s sequence %d\n",
-              debug_prefix_time(NULL), (unsigned int)ntohs(port),
-              handle, sequence));
-    assert(he != NULL);
-
-    rh->hostname = stralloc(he->h_name);
-    memcpy(&rh->peer.sin_addr, he->h_addr, SIZEOF(rh->peer.sin_addr));
-    rh->peer.sin_port = port;
-    rh->peer.sin_family = (sa_family_t)AF_INET;
-
-    /*
-     * Do a forward lookup of the hostname.  This is unnecessary if we
-     * are initiating the connection, but is very serious if we are
-     * receiving.  We want to make sure the hostname
-     * resolves back to the remote ip for security reasons.
-     */
-    if ((he = gethostbyname(rh->hostname)) == NULL) {
-    secprintf(("%s: udp: bb\n", debug_prefix_time(NULL)));
-       security_seterror(&rh->sech,
-           "%s: could not resolve hostname", rh->hostname);
-       return (-1);
-    }
-
-    /*
-     * Make sure the hostname matches.  This should always work.
-     */
-    if (strncasecmp(rh->hostname, he->h_name, strlen(rh->hostname)) != 0) {
-    secprintf(("%s: udp: cc\n", debug_prefix_time(NULL)));
-       security_seterror(&rh->sech,
-                         "%s: did not resolve to itself, it resolv to %s",
-                         rh->hostname, he->h_name);
-       return (-1);
-    }
-
-    /*
-     * Now look for a matching ip address.
-     */
-    for (i = 0; he->h_addr_list[i] != NULL; i++) {
-       if (memcmp(&rh->peer.sin_addr, he->h_addr_list[i],
-           SIZEOF(struct in_addr)) == 0) {
-           break;
-       }
-    }
+    auth_debug(1, ("%s: udp_inithandle port %u handle %s sequence %d\n",
+                  debug_prefix_time(NULL), (unsigned int)ntohs(port),
+                  handle, sequence));
+    assert(addr != NULL);
 
-    /*
-     * If we didn't find it, try the aliases.  This is a workaround for
-     * Solaris if DNS goes over NIS.
-     */
-    if (he->h_addr_list[i] == NULL) {
-       const char *ipstr = inet_ntoa(rh->peer.sin_addr);
-       for (i = 0; he->h_aliases[i] != NULL; i++) {
-           if (strcmp(he->h_aliases[i], ipstr) == 0)
-               break;
-       }
-       /*
-        * No aliases either.  Failure.  Someone is fooling with us or
-        * DNS is messed up.
-        */
-       if (he->h_aliases[i] == NULL) {
-           security_seterror(&rh->sech,
-               "DNS check failed: no matching ip address for %s",
-               rh->hostname);
-           return (-1);
-       }
-    }
+    rh->hostname = stralloc(hostname);
+    memcpy(&rh->peer, addr, SIZEOF(rh->peer));
+    SS_SET_PORT(&rh->peer, port);
 
     rh->prev = udp->bh_last;
     if (udp->bh_last) {
@@ -1353,8 +1328,8 @@ udp_inithandle(
     rh->ev_read = NULL;
     rh->ev_timeout = NULL;
 
-    secprintf(("%s: udp: adding handle '%s'\n",
-              debug_prefix_time(NULL), rh->proto_handle));
+    auth_debug(1, ("%s: udp: adding handle '%s'\n",
+                  debug_prefix_time(NULL), rh->proto_handle));
 
     return(0);
 }
@@ -1371,11 +1346,14 @@ udp_netfd_read_callback(
 {
     struct udp_handle *udp = cookie;
     struct sec_handle *rh;
-    struct hostent *he;
     int a;
+    char hostname[NI_MAXHOST];
+    in_port_t port;
+    char *errmsg = NULL;
+    int result;
 
-    secprintf(("%s: udp_netfd_read_callback(cookie=%p)\n",
-               debug_prefix(NULL), cookie));
+    auth_debug(1, ("%s: udp_netfd_read_callback(cookie=%p)\n",
+                  debug_prefix_time(NULL), cookie));
     assert(udp != NULL);
     
 #ifndef TEST                                                   /* { */
@@ -1399,8 +1377,7 @@ udp_netfd_read_callback(
     rh = udp->bh_first;
     while(rh != NULL && (strcmp(rh->proto_handle, udp->handle) != 0 ||
                         rh->sequence != udp->sequence ||
-                        rh->peer.sin_addr.s_addr != udp->peer.sin_addr.s_addr ||
-                        rh->peer.sin_port != udp->peer.sin_port)) {
+                        cmp_sockaddr(&rh->peer, &udp->peer, 0) != 0)) {
        rh = rh->next;
     }
     if (rh && event_wakeup(rh->event_id) > 0)
@@ -1410,26 +1387,44 @@ udp_netfd_read_callback(
      * If we didn't find a handle, then check for a new incoming packet.
      * If no accept handler was setup, then just return.
      */
-    if (udp->accept_fn == NULL)
+    if (udp->accept_fn == NULL) {
+       dbprintf(("%s: Receive packet from unknown source", debug_prefix_time(NULL)));
        return;
+    }
 
-    he = gethostbyaddr((void *)&udp->peer.sin_addr,
-       (socklen_t)sizeof(udp->peer.sin_addr), AF_INET);
-    if (he == NULL)
-       return;
     rh = alloc(SIZEOF(*rh));
     rh->proto_handle=NULL;
     rh->udp = udp;
     rh->rc = NULL;
     security_handleinit(&rh->sech, udp->driver);
+
+    result = getnameinfo((struct sockaddr *)&udp->peer, SS_LEN(&udp->peer),
+                        hostname, sizeof(hostname), NULL, 0, 0);
+    if (result != 0) {
+       dbprintf(("%s: getnameinfo failed: %s\n",
+                 debug_prefix_time(NULL), gai_strerror(result)));
+       security_seterror(&rh->sech, "getnameinfo failed: %s",
+                         gai_strerror(result));
+       return;
+    }
+    if (check_name_give_sockaddr(hostname,
+                                (struct sockaddr *)&udp->peer, &errmsg) < 0) {
+       security_seterror(&rh->sech, "%s",errmsg);
+       amfree(errmsg);
+       amfree(rh);
+       return;
+    }
+
+    port = SS_GET_PORT(&udp->peer);
     a = udp_inithandle(udp, rh,
-                  he,
-                  udp->peer.sin_port,
+                  hostname,
+                  &udp->peer,
+                  port,
                   udp->handle,
                   udp->sequence);
     if (a < 0) {
-       secprintf(("%s: bsd: closeX handle '%s'\n",
-                 debug_prefix_time(NULL), rh->proto_handle));
+       auth_debug(1, ("%s: bsd: closeX handle '%s'\n",
+                      debug_prefix_time(NULL), rh->proto_handle));
 
        amfree(rh);
        return;
@@ -1456,25 +1451,27 @@ sec_tcp_conn_get(
 {
     struct tcp_conn *rc;
 
-    secprintf(("%s: sec_tcp_conn_get: %s\n", debug_prefix_time(NULL), hostname));
+    auth_debug(1, ("%s: sec_tcp_conn_get: %s\n",
+                  debug_prefix_time(NULL), hostname));
 
     if (want_new == 0) {
-    for (rc = connq_first(); rc != NULL; rc = connq_next(rc)) {
-       if (strcasecmp(hostname, rc->hostname) == 0)
-           break;
-    }
+       for (rc = connq_first(); rc != NULL; rc = connq_next(rc)) {
+           if (strcasecmp(hostname, rc->hostname) == 0)
+               break;
+       }
 
-    if (rc != NULL) {
-       rc->refcnt++;
-       secprintf(("%s: sec_tcp_conn_get: exists, refcnt to %s is now %d\n",
-                  debug_prefix_time(NULL),
-                  rc->hostname, rc->refcnt));
-       return (rc);
-    }
+       if (rc != NULL) {
+           rc->refcnt++;
+           auth_debug(1,
+                     ("%s: sec_tcp_conn_get: exists, refcnt to %s is now %d\n",
+                      debug_prefix_time(NULL),
+                      rc->hostname, rc->refcnt));
+           return (rc);
+       }
     }
 
-    secprintf(("%s: sec_tcp_conn_get: creating new handle\n",
-              debug_prefix_time(NULL)));
+    auth_debug(1, ("%s: sec_tcp_conn_get: creating new handle\n",
+                  debug_prefix_time(NULL)));
     /*
      * We can't be creating a new handle if we are the client
      */
@@ -1494,6 +1491,7 @@ sec_tcp_conn_get(
     rc->accept_fn = NULL;
     rc->recv_security_ok = NULL;
     rc->prefix_packet = NULL;
+    rc->auth = 0;
     connq_append(rc);
     return (rc);
 }
@@ -1510,14 +1508,14 @@ sec_tcp_conn_put(
 
     assert(rc->refcnt > 0);
     --rc->refcnt;
-    secprintf(("%s: sec_tcp_conn_put: decrementing refcnt for %s to %d\n",
-              debug_prefix_time(NULL),
+    auth_debug(1, ("%s: sec_tcp_conn_put: decrementing refcnt for %s to %d\n",
+                  debug_prefix_time(NULL),
        rc->hostname, rc->refcnt));
     if (rc->refcnt > 0) {
        return;
     }
-    secprintf(("%s: sec_tcp_conn_put: closing connection to %s\n",
-              debug_prefix_time(NULL), rc->hostname));
+    auth_debug(1, ("%s: sec_tcp_conn_put: closing connection to %s\n",
+                  debug_prefix_time(NULL), rc->hostname));
     if (rc->read != -1)
        aclose(rc->read);
     if (rc->write != -1)
@@ -1549,13 +1547,13 @@ sec_tcp_conn_read(
 
     if (rc->ev_read != NULL) {
        rc->ev_read_refcnt++;
-       secprintf((
-              "%s: sec: conn_read: incremented ev_read_refcnt to %d for %s\n",
+       auth_debug(1,
+             ("%s: sec: conn_read: incremented ev_read_refcnt to %d for %s\n",
               debug_prefix_time(NULL), rc->ev_read_refcnt, rc->hostname));
        return;
     }
-    secprintf(("%s: sec: conn_read registering event handler for %s\n",
-              debug_prefix_time(NULL), rc->hostname));
+    auth_debug(1, ("%s: sec: conn_read registering event handler for %s\n",
+                  debug_prefix_time(NULL), rc->hostname));
     rc->ev_read = event_register((event_id_t)rc->read, EV_READFD,
                sec_tcp_conn_read_callback, rc);
     rc->ev_read_refcnt = 1;
@@ -1567,15 +1565,16 @@ sec_tcp_conn_read_cancel(
 {
 
     --rc->ev_read_refcnt;
-    secprintf((
-       "%s: sec: conn_read_cancel: decremented ev_read_refcnt to %d for %s\n",
+    auth_debug(1,
+       ("%s: sec: conn_read_cancel: decremented ev_read_refcnt to %d for %s\n",
        debug_prefix_time(NULL),
        rc->ev_read_refcnt, rc->hostname));
     if (rc->ev_read_refcnt > 0) {
        return;
     }
-    secprintf(("%s: sec: conn_read_cancel: releasing event handler for %s\n",
-              debug_prefix_time(NULL), rc->hostname));
+    auth_debug(1,
+                ("%s: sec: conn_read_cancel: releasing event handler for %s\n",
+                debug_prefix_time(NULL), rc->hostname));
     event_release(rc->ev_read);
     rc->ev_read = NULL;
 }
@@ -1595,8 +1594,8 @@ recvpkt_callback(
 
     assert(rh != NULL);
 
-    secprintf(("%s: sec: recvpkt_callback: %d\n",
-              debug_prefix_time(NULL), bufsize));
+    auth_debug(1, ("%s: sec: recvpkt_callback: " SSIZE_T_FMT "\n",
+                  debug_prefix_time(NULL), bufsize));
     /*
      * We need to cancel the recvpkt request before calling
      * the callback because the callback may reschedule us.
@@ -1618,8 +1617,8 @@ recvpkt_callback(
     }
 
     parse_pkt(&pkt, buf, (size_t)bufsize);
-    secprintf((
-          "%s: sec: received %s packet (%d) from %s, contains:\n\n\"%s\"\n\n",
+    auth_debug(1,
+         ("%s: sec: received %s packet (%d) from %s, contains:\n\n\"%s\"\n\n",
           debug_prefix_time(NULL), pkt_type2str(pkt.type), pkt.type,
           rh->hostname, pkt.body));
     if (rh->rc->recv_security_ok && (rh->rc->recv_security_ok)(rh, &pkt) < 0)
@@ -1639,8 +1638,8 @@ stream_read_sync_callback(
     struct sec_stream *rs = s;
     assert(rs != NULL);
 
-    secprintf(("%s: sec: stream_read_callback_sync: handle %d\n",
-              debug_prefix_time(NULL), rs->handle));
+    auth_debug(1, ("%s: sec: stream_read_callback_sync: handle %d\n",
+                  debug_prefix_time(NULL), rs->handle));
 
     /*
      * Make sure this was for us.  If it was, then blow away the handle
@@ -1649,12 +1648,12 @@ stream_read_sync_callback(
      * If the handle is EOF, pass that up to our callback.
      */
     if (rs->rc->handle == rs->handle) {
-        secprintf(("%s: sec: stream_read_callback_sync: it was for us\n",
-                  debug_prefix_time(NULL)));
+        auth_debug(1, ("%s: sec: stream_read_callback_sync: it was for us\n",
+                      debug_prefix_time(NULL)));
         rs->rc->handle = H_TAKEN;
     } else if (rs->rc->handle != H_EOF) {
-        secprintf(("%s: sec: stream_read_callback_sync: not for us\n",
-                  debug_prefix_time(NULL)));
+        auth_debug(1, ("%s: sec: stream_read_callback_sync: not for us\n",
+                      debug_prefix_time(NULL)));
         return;
     }
 
@@ -1666,16 +1665,16 @@ stream_read_sync_callback(
     tcpm_stream_read_cancel(rs);
 
     if (rs->rc->pktlen <= 0) {
-       secprintf(("%s: sec: stream_read_sync_callback: %s\n",
-                  debug_prefix_time(NULL), rs->rc->errmsg));
+       auth_debug(1, ("%s: sec: stream_read_sync_callback: %s\n",
+                      debug_prefix_time(NULL), rs->rc->errmsg));
        security_stream_seterror(&rs->secstr, rs->rc->errmsg);
        if(rs->closed_by_me == 0 && rs->closed_by_network == 0)
            sec_tcp_conn_put(rs->rc);
        rs->closed_by_network = 1;
        return;
     }
-    secprintf((
-            "%s: sec: stream_read_callback_sync: read %zd bytes from %s:%d\n",
+    auth_debug(1,
+           ("%s: sec: stream_read_callback_sync: read " SSIZE_T_FMT " bytes from %s:%d\n",
             debug_prefix_time(NULL),
         rs->rc->pktlen, rs->rc->hostname, rs->handle));
 }
@@ -1690,8 +1689,8 @@ stream_read_callback(
     struct sec_stream *rs = arg;
     assert(rs != NULL);
 
-    secprintf(("%s: sec: stream_read_callback: handle %d\n",
-              debug_prefix_time(NULL), rs->handle));
+    auth_debug(1, ("%s: sec: stream_read_callback: handle %d\n",
+                  debug_prefix_time(NULL), rs->handle));
 
     /*
      * Make sure this was for us.  If it was, then blow away the handle
@@ -1700,12 +1699,12 @@ stream_read_callback(
      * If the handle is EOF, pass that up to our callback.
      */
     if (rs->rc->handle == rs->handle) {
-       secprintf(("%s: sec: stream_read_callback: it was for us\n",
-                  debug_prefix_time(NULL)));
+       auth_debug(1, ("%s: sec: stream_read_callback: it was for us\n",
+                      debug_prefix_time(NULL)));
        rs->rc->handle = H_TAKEN;
     } else if (rs->rc->handle != H_EOF) {
-       secprintf(("%s: sec: stream_read_callback: not for us\n",
-                  debug_prefix_time(NULL)));
+       auth_debug(1, ("%s: sec: stream_read_callback: not for us\n",
+                      debug_prefix_time(NULL)));
        return;
     }
 
@@ -1717,8 +1716,8 @@ stream_read_callback(
     tcpm_stream_read_cancel(rs);
 
     if (rs->rc->pktlen <= 0) {
-       secprintf(("%s: sec: stream_read_callback: %s\n",
-                  debug_prefix_time(NULL), rs->rc->errmsg));
+       auth_debug(1, ("%s: sec: stream_read_callback: %s\n",
+                      debug_prefix_time(NULL), rs->rc->errmsg));
        security_stream_seterror(&rs->secstr, rs->rc->errmsg);
        if(rs->closed_by_me == 0 && rs->closed_by_network == 0)
            sec_tcp_conn_put(rs->rc);
@@ -1726,12 +1725,12 @@ stream_read_callback(
        (*rs->fn)(rs->arg, NULL, rs->rc->pktlen);
        return;
     }
-    secprintf(("%s: sec: stream_read_callback: read %zd bytes from %s:%d\n",
-              debug_prefix_time(NULL),
+    auth_debug(1, ("%s: sec: stream_read_callback: read " SSIZE_T_FMT " bytes from %s:%d\n",
+                  debug_prefix_time(NULL),
        rs->rc->pktlen, rs->rc->hostname, rs->handle));
     (*rs->fn)(rs->arg, rs->rc->pkt, rs->rc->pktlen);
-    secprintf(("%s: sec: after callback stream_read_callback\n",
-              debug_prefix_time(NULL)));
+    auth_debug(1, ("%s: sec: after callback stream_read_callback\n",
+                  debug_prefix_time(NULL)));
 }
 
 /*
@@ -1751,19 +1750,19 @@ sec_tcp_conn_read_callback(
 
     assert(cookie != NULL);
 
-    secprintf(("%s: sec: conn_read_callback\n", debug_prefix_time(NULL)));
+    auth_debug(1, ("%s: sec: conn_read_callback\n", debug_prefix_time(NULL)));
 
     /* Read the data off the wire.  If we get errors, shut down. */
-    rval = tcpm_recv_token(rc->read, &rc->handle, &rc->errmsg, &rc->pkt,
+    rval = tcpm_recv_token(rc, rc->read, &rc->handle, &rc->errmsg, &rc->pkt,
                                &rc->pktlen, 60);
-    secprintf(("%s: sec: conn_read_callback: tcpm_recv_token returned %d\n",
-              debug_prefix_time(NULL), rval));
+    auth_debug(1, ("%s: sec: conn_read_callback: tcpm_recv_token returned " SSIZE_T_FMT "\n",
+                  debug_prefix_time(NULL), rval));
     if (rval < 0 || rc->handle == H_EOF) {
        rc->pktlen = rval;
        rc->handle = H_EOF;
        revent = event_wakeup((event_id_t)rc);
-       secprintf(("%s: sec: conn_read_callback: event_wakeup return %d\n",
-                  debug_prefix_time(NULL), revent));
+       auth_debug(1, ("%s: sec: conn_read_callback: event_wakeup return %d\n",
+                      debug_prefix_time(NULL), revent));
        /* delete our 'accept' reference */
        if (rc->accept_fn != NULL) {
            if(rc->refcnt != 1) {
@@ -1780,16 +1779,17 @@ sec_tcp_conn_read_callback(
     if(rval == 0) {
        rc->pktlen = 0;
        revent = event_wakeup((event_id_t)rc);
-       secprintf(("%s: 0 sec: conn_read_callback: event_wakeup return %d\n",
-                  debug_prefix_time(NULL), revent));
+       auth_debug(1,
+                  ("%s: 0 sec: conn_read_callback: event_wakeup return %d\n",
+                   debug_prefix_time(NULL), revent));
        return;
     }
 
     /* If there are events waiting on this handle, we're done */
     rc->donotclose = 1;
     revent = event_wakeup((event_id_t)rc);
-    secprintf(("%s: sec: conn_read_callback: event_wakeup return %d\n",
-              debug_prefix_time(NULL), rval));
+    auth_debug(1, ("%s: sec: conn_read_callback: event_wakeup return " SSIZE_T_FMT "\n",
+                  debug_prefix_time(NULL), rval));
     rc->donotclose = 0;
     if (rc->handle == H_TAKEN || rc->pktlen == 0) {
        if(rc->refcnt == 0) amfree(rc);
@@ -1810,10 +1810,10 @@ sec_tcp_conn_read_callback(
     rh->peer = rc->peer;
     rh->rs = tcpma_stream_client(rh, rc->handle);
 
-    secprintf(("%s: sec: new connection\n", debug_prefix_time(NULL)));
+    auth_debug(1, ("%s: sec: new connection\n", debug_prefix_time(NULL)));
     pkt.body = NULL;
     parse_pkt(&pkt, rc->pkt, (size_t)rc->pktlen);
-    secprintf(("%s: sec: calling accept_fn\n", debug_prefix_time(NULL)));
+    auth_debug(1, ("%s: sec: calling accept_fn\n", debug_prefix_time(NULL)));
     if (rh->rc->recv_security_ok && (rh->rc->recv_security_ok)(rh, &pkt) < 0)
        (*rc->accept_fn)(&rh->sech, NULL);
     else
@@ -1829,8 +1829,8 @@ parse_pkt(
 {
     const unsigned char *bufp = buf;
 
-    secprintf(("%s: sec: parse_pkt: parsing buffer of %d bytes\n",
-              debug_prefix_time(NULL), bufsize));
+    auth_debug(1, ("%s: sec: parse_pkt: parsing buffer of " SSIZE_T_FMT " bytes\n",
+                  debug_prefix_time(NULL), bufsize));
 
     pkt->type = (pktype_t)*bufp++;
     bufsize--;
@@ -1845,9 +1845,9 @@ parse_pkt(
     }
     pkt->size = strlen(pkt->body);
 
-    secprintf(("%s: sec: parse_pkt: %s (%d): \"%s\"\n",
-              debug_prefix_time(NULL), pkt_type2str(pkt->type),
-              pkt->type, pkt->body));
+    auth_debug(1, ("%s: sec: parse_pkt: %s (%d): \"%s\"\n",
+                  debug_prefix_time(NULL), pkt_type2str(pkt->type),
+                  pkt->type, pkt->body));
 }
 
 /*
@@ -1867,8 +1867,8 @@ pkthdr2str(
        VERSION_MAJOR, VERSION_MINOR, pkt_type2str(pkt->type),
        rh->proto_handle, rh->sequence);
 
-    secprintf(("%s: bsd: pkthdr2str handle '%s'\n",
-              debug_prefix_time(NULL), rh->proto_handle));
+    auth_debug(1, ("%s: bsd: pkthdr2str handle '%s'\n",
+                  debug_prefix_time(NULL), rh->proto_handle));
 
     /* check for truncation.  If only we had asprintf()... */
     assert(retbuf[strlen(retbuf) - 1] == '\n');
@@ -1971,7 +1971,7 @@ check_user(
 #ifndef USE_AMANDAHOSTS
     r = check_user_ruserok(rh->hostname, pwd, remoteuser);
 #else
-    r = check_user_amandahosts(rh->hostname, rh->peer.sin_addr, pwd, remoteuser, service);
+    r = check_user_amandahosts(rh->hostname, &rh->peer, pwd, remoteuser, service);
 #endif
     if (r != NULL) {
        result = vstralloc("user ", remoteuser, " from ", rh->hostname,
@@ -2040,30 +2040,28 @@ check_user_ruserok(
            exit(1);
        }
 
-#if defined(SHOW_SECURITY_DETAIL)                              /* { */
-       {
-       char *dir = stralloc(pwd->pw_dir);
+       if (debug_auth >= 9) {
+           char *dir = stralloc(pwd->pw_dir);
 
-       secprintf(("%s: bsd: calling ruserok(%s, %d, %s, %s)\n",
-                  debug_prefix_time(NULL),
-                  host, ((myuid == 0) ? 1 : 0), remoteuser, pwd->pw_name));
-       if (myuid == 0) {
-           secprintf(("%s: bsd: because you are running as root, ",
-                      debug_prefix(NULL)));
-           secprintf(("/etc/hosts.equiv will not be used\n"));
-       } else {
-           show_stat_info("/etc/hosts.equiv", NULL);
-       }
-       show_stat_info(dir, "/.rhosts");
-       amfree(dir);
+           auth_debug(9, ("%s: bsd: calling ruserok(%s, %d, %s, %s)\n",
+                          debug_prefix_time(NULL), host,
+                          ((myuid == 0) ? 1 : 0), remoteuser, pwd->pw_name));
+           if (myuid == 0) {
+               auth_debug(9, ("%s: bsd: because you are running as root, ",
+                              debug_prefix_time(NULL)));
+               auth_debug(9, ("/etc/hosts.equiv will not be used\n"));
+           } else {
+               show_stat_info("/etc/hosts.equiv", NULL);
+           }
+           show_stat_info(dir, "/.rhosts");
+           amfree(dir);
        }
-#endif                                                         /* } */
 
        saved_stderr = dup(2);
        close(2);
        if (open("/dev/null", O_RDWR) == -1) {
-            secprintf(("%s: Could not open /dev/null: %s\n",
-                     debug_prefix(NULL), strerror(errno)));
+            auth_debug(1, ("%s: Could not open /dev/null: %s\n",
+                          debug_prefix_time(NULL), strerror(errno)));
            ec = 1;
        } else {
            ok = ruserok(host, myuid == 0, remoteuser, CLIENT_LOGIN);
@@ -2129,7 +2127,7 @@ check_user_ruserok(
 char *
 check_user_amandahosts(
     const char *       host,
-    struct in_addr      addr,
+    struct sockaddr_storage *addr,
     struct passwd *    pwd,
     const char *       remoteuser,
     const char *       service)
@@ -2147,15 +2145,20 @@ check_user_amandahosts(
     int hostmatch;
     int usermatch;
     char *aservice = NULL;
+#ifdef WORKING_IPV6
+    char ipstr[INET6_ADDRSTRLEN];
+#else
+    char ipstr[INET_ADDRSTRLEN];
+#endif
 
-    secprintf(("check_user_amandahosts(host=%s, pwd=%p, "
-               "remoteuser=%s, service=%s)\n",
-               host, pwd, remoteuser, service));
+    auth_debug(1, ("check_user_amandahosts(host=%s, pwd=%p, "
+                  "remoteuser=%s, service=%s)\n",
+                  host, pwd, remoteuser, service));
 
     ptmp = stralloc2(pwd->pw_dir, "/.amandahosts");
-#if defined(SHOW_SECURITY_DETAIL)                              /* { */
-    show_stat_info(ptmp, "");;
-#endif                                                         /* } */
+    if (debug_auth >= 9) {
+       show_stat_info(ptmp, "");;
+    }
     if ((fp = fopen(ptmp, "r")) == NULL) {
        result = vstralloc("cannot open ", ptmp, ": ", strerror(errno), NULL);
        amfree(ptmp);
@@ -2195,9 +2198,8 @@ check_user_amandahosts(
            continue;
        }
 
-#if defined(SHOW_SECURITY_DETAIL)                              /* { */
-       secprintf(("%s: bsd: processing line: <%s>\n", debug_prefix(NULL), line));
-#endif                                                         /* } */
+       auth_debug(9, ("%s: bsd: processing line: <%s>\n",
+                      debug_prefix_time(NULL), line));
        /* get the host out of the file */
        if ((filehost = strtok(line, " \t")) == NULL) {
            amfree(line);
@@ -2211,24 +2213,31 @@ check_user_amandahosts(
 
        hostmatch = (strcasecmp(filehost, host) == 0);
        /*  ok if addr=127.0.0.1 and
-        *  either localhost or localhost.domain is in .amandahost */
-       if ( !hostmatch ) {
-         if (strcmp(inet_ntoa(addr), "127.0.0.1")== 0  &&
-             (strcasecmp(filehost, "localhost")== 0 ||
-             strcasecmp(filehost, "localhost.localdomain")== 0))
-           {
-             hostmatch = 1;
-           }
-       }
+        *  either localhost or localhost.domain is in .amandahost */
+       if (!hostmatch  &&
+           (strcasecmp(filehost, "localhost")== 0 ||
+            strcasecmp(filehost, "localhost.localdomain")== 0)) {
+#ifdef WORKING_IPV6
+           if (addr->ss_family == (sa_family_t)AF_INET6)
+               inet_ntop(AF_INET6, &((struct sockaddr_in6 *)addr)->sin6_addr,
+                         ipstr, sizeof(ipstr));
+           else
+#endif
+               inet_ntop(AF_INET, &((struct sockaddr_in *)addr)->sin_addr,
+                         ipstr, sizeof(ipstr));
+           if (strcmp(ipstr, "127.0.0.1") == 0 ||
+               strcmp(ipstr, "::1") == 0)
+               hostmatch = 1;
+       }
        usermatch = (strcasecmp(fileuser, remoteuser) == 0);
-#if defined(SHOW_SECURITY_DETAIL)                              /* { */
-       secprintf(("%s: bsd: comparing \"%s\" with\n", debug_prefix(NULL), filehost));
-       secprintf(("%s: bsd:           \"%s\" (%s)\n", host,
-                 debug_prefix(NULL), hostmatch ? "match" : "no match"));
-       secprintf(("%s: bsd:       and \"%s\" with\n", fileuser, debug_prefix(NULL)));
-       secprintf(("%s: bsd:           \"%s\" (%s)\n", remoteuser,
-                 debug_prefix(NULL), usermatch ? "match" : "no match"));
-#endif                                                         /* } */
+       auth_debug(9, ("%s: bsd: comparing \"%s\" with\n",
+                      debug_prefix_time(NULL), filehost));
+       auth_debug(9, ("%s: bsd:           \"%s\" (%s)\n", host,
+                 debug_prefix_time(NULL), hostmatch ? "match" : "no match"));
+       auth_debug(9, ("%s: bsd:       and \"%s\" with\n",
+                      fileuser, debug_prefix_time(NULL)));
+       auth_debug(9, ("%s: bsd:           \"%s\" (%s)\n", remoteuser,
+                      debug_prefix_time(NULL), usermatch ? "match" : "no match"));
        /* compare */
        if (!hostmatch || !usermatch) {
            amfree(line);
@@ -2289,14 +2298,14 @@ check_user_amandahosts(
        if (strcmp(service, "amindexd") == 0 ||
            strcmp(service, "amidxtaped") == 0) {
            result = vstralloc("Please add \"amindexd amidxtaped\" to "
-                              "the line in ", ptmp, NULL);
+                              "the line in ", ptmp, " on the client", NULL);
        } else if (strcmp(service, "amdump") == 0 ||
                   strcmp(service, "noop") == 0 ||
                   strcmp(service, "selfcheck") == 0 ||
                   strcmp(service, "sendsize") == 0 ||
                   strcmp(service, "sendbackup") == 0) {
            result = vstralloc("Please add \"amdump\" to the line in ",
-                              ptmp, NULL);
+                              ptmp, " on the client", NULL);
        } else {
            result = vstralloc(ptmp, ": ",
                               "invalid service ", service, NULL);
@@ -2314,105 +2323,54 @@ common_exit:
 /* return 1 on success, 0 on failure */
 int
 check_security(
-    struct sockaddr_in *addr,
+    struct sockaddr_storage *addr,
     char *             str,
     unsigned long      cksum,
     char **            errstr)
 {
     char *             remotehost = NULL, *remoteuser = NULL;
     char *             bad_bsd = NULL;
-    struct hostent *   hp;
     struct passwd *    pwptr;
     uid_t              myuid;
-    int                        i;
-    int                        j;
     char *             s;
     char *             fp;
     int                        ch;
+    char               hostname[NI_MAXHOST];
+    in_port_t          port;
+    int                        result;
 
     (void)cksum;       /* Quiet unused parameter warning */
 
-    secprintf(("%s: check_security(addr=%p, str='%s', cksum=%ul, errstr=%p\n",
-               debug_prefix(NULL), addr, str, cksum, errstr));
+    auth_debug(1,
+              ("%s: check_security(addr=%p, str='%s', cksum=%lu, errstr=%p\n",
+               debug_prefix_time(NULL), addr, str, cksum, errstr));
     dump_sockaddr(addr);
 
     *errstr = NULL;
 
     /* what host is making the request? */
-
-    hp = gethostbyaddr((char *)&addr->sin_addr, SIZEOF(addr->sin_addr),
-                      AF_INET);
-    if (hp == NULL) {
-       /* XXX include remote address in message */
-       *errstr = vstralloc("[",
-                           "addr ", inet_ntoa(addr->sin_addr), ": ",
-                           "hostname lookup failed",
-                           "]", NULL);
-       return 0;
-    }
-    remotehost = stralloc(hp->h_name);
-
-    /* Now let's get the hostent for that hostname */
-    hp = gethostbyname( remotehost );
-    if (hp == NULL) {
-       /* XXX include remote hostname in message */
-       *errstr = vstralloc("[",
-                           "host ", remotehost, ": ",
-                           "hostname lookup failed",
+    if ((result = getnameinfo((struct sockaddr *)addr, SS_LEN(addr),
+                              hostname, NI_MAXHOST, NULL, 0, 0) != 0)) {
+       dbprintf(("%s: getnameinfo failed: %s\n",
+                 debug_prefix_time(NULL), gai_strerror(result)));
+       *errstr = vstralloc("[", "addr ", str_sockaddr(addr), ": ",
+                           "getnameinfo failed: ", gai_strerror(result),
                            "]", NULL);
-       amfree(remotehost);
        return 0;
     }
-
-    /* Verify that the hostnames match -- they should theoretically */
-    if (strncasecmp( remotehost, hp->h_name, strlen(remotehost)+1 ) != 0 ) {
-       *errstr = vstralloc("[",
-                           "hostnames do not match: ",
-                           remotehost, " ", hp->h_name,
-                           "]", NULL);
+    remotehost = stralloc(hostname);
+    if( check_name_give_sockaddr(hostname,
+                                (struct sockaddr *)addr, errstr) < 0) {
        amfree(remotehost);
        return 0;
     }
 
-    /* Now let's verify that the ip which gave us this hostname
-     * is really an ip for this hostname; or is someone trying to
-     * break in? (THIS IS THE CRUCIAL STEP)
-     */
-    for (i = 0; hp->h_addr_list[i]; i++) {
-       if (memcmp(hp->h_addr_list[i],
-                  (char *) &addr->sin_addr, SIZEOF(addr->sin_addr)) == 0)
-           break;                     /* name is good, keep it */
-    }
-
-    /* If we did not find it, your DNS is messed up or someone is trying
-     * to pull a fast one on you. :(
-     */
-
-   /*   Check even the aliases list. Work around for Solaris if dns goes over NIS */
-
-    if (!hp->h_addr_list[i] ) {
-        for (j = 0; hp->h_aliases[j] !=0 ; j++) {
-            if (strcmp(hp->h_aliases[j],inet_ntoa(addr->sin_addr)) == 0)
-                break;                          /* name is good, keep it */
-        }
-       if (!hp->h_aliases[j] ) {
-           *errstr = vstralloc("[",
-                               "ip address ", inet_ntoa(addr->sin_addr),
-                               " is not in the ip list for ", remotehost,
-                               "]",
-                               NULL);
-           amfree(remotehost);
-           return 0;
-       }
-    }
-
     /* next, make sure the remote port is a "reserved" one */
-
-    if (ntohs(addr->sin_port) >= IPPORT_RESERVED) {
+    port = SS_GET_PORT(addr);
+    if (port >= IPPORT_RESERVED) {
        char number[NUM_STR_SIZE];
 
-       snprintf(number, SIZEOF(number), "%u",
-                (unsigned int)ntohs(addr->sin_port));
+       snprintf(number, SIZEOF(number), "%u", (unsigned int)port);
        *errstr = vstralloc("[",
                            "host ", remotehost, ": ",
                            "port ", number, " not secure",
@@ -2431,16 +2389,12 @@ check_security(
                        "bad bsd security line",
                        "]", NULL);
 
-#define sc "USER "
-    if (strncmp(s - 1, sc, SIZEOF(sc)-1) != 0) {
+    if (strncmp_const_skip(s - 1, "USER ", s, ch) != 0) {
        *errstr = bad_bsd;
        bad_bsd = NULL;
        amfree(remotehost);
        return 0;
     }
-    s += SIZEOF(sc)-1;
-    ch = s[-1];
-#undef sc
 
     skip_whitespace(s, ch);
     if (ch == '\0') {
@@ -2462,13 +2416,13 @@ check_security(
     if ((pwptr = getpwuid(myuid)) == NULL)
         error("error [getpwuid(%d) fails]", myuid);
 
-    secprintf(("%s: bsd security: remote host %s user %s local user %s\n",
-             debug_prefix(NULL), remotehost, remoteuser, pwptr->pw_name));
+    auth_debug(1, ("%s: bsd security: remote host %s user %s local user %s\n",
+                  debug_prefix_time(NULL), remotehost, remoteuser, pwptr->pw_name));
 
 #ifndef USE_AMANDAHOSTS
     s = check_user_ruserok(remotehost, pwptr, remoteuser);
 #else
-    s = check_user_amandahosts(remotehost, addr->sin_addr, pwptr, remoteuser, NULL);
+    s = check_user_amandahosts(remotehost, addr, pwptr, remoteuser, NULL);
 #endif
 
     if (s != NULL) {
@@ -2505,8 +2459,8 @@ net_writev(
        if (n < 0) {
            if (errno != EINTR)
                return (-1);
-           secprintf(("%s: net_writev got EINTR\n",
-                      debug_prefix(NULL)));
+           auth_debug(1, ("%s: net_writev got EINTR\n",
+                          debug_prefix_time(NULL)));
        }
        else if (n == 0) {
            errno = EIO;
@@ -2549,27 +2503,28 @@ net_read(
     ssize_t nread;
     size_t size = origsize;
 
-    secprintf(("%s: net_read: begin %d\n", debug_prefix_time(NULL), origsize));
+    auth_debug(1, ("%s: net_read: begin " SIZE_T_FMT "\n",
+                  debug_prefix_time(NULL), origsize));
 
     while (size > 0) {
-       secprintf(("%s: net_read: while %d\n",
-                  debug_prefix_time(NULL), size));
+       auth_debug(1, ("%s: net_read: while " SIZE_T_FMT "\n",
+                      debug_prefix_time(NULL), size));
        nread = net_read_fillbuf(fd, timeout, buf, size);
        if (nread < 0) {
-           secprintf(("%s: db: net_read: end return(-1)\n",
-                      debug_prefix_time(NULL)));
+           auth_debug(1, ("%s: db: net_read: end return(-1)\n",
+                          debug_prefix_time(NULL)));
            return (-1);
        }
        if (nread == 0) {
-           secprintf(("%s: net_read: end return(0)\n",
-                      debug_prefix_time(NULL)));
+           auth_debug(1, ("%s: net_read: end return(0)\n",
+                          debug_prefix_time(NULL)));
            return (0);
        }
        buf += nread;
        size -= nread;
     }
-    secprintf(("%s: net_read: end %d\n",
-              debug_prefix_time(NULL), origsize));
+    auth_debug(1, ("%s: net_read: end " SIZE_T_FMT "\n",
+                  debug_prefix_time(NULL), origsize));
     return ((ssize_t)origsize);
 }
 
@@ -2583,11 +2538,11 @@ net_read_fillbuf(
     void *     buf,
     size_t     size)
 {
-    fd_set readfds;
+    SELECT_ARG_TYPE readfds;
     struct timeval tv;
     ssize_t nread;
 
-    secprintf(("%s: net_read_fillbuf: begin\n", debug_prefix_time(NULL)));
+    auth_debug(1, ("%s: net_read_fillbuf: begin\n", debug_prefix_time(NULL)));
     FD_ZERO(&readfds);
     FD_SET(fd, &readfds);
     tv.tv_sec = timeout;
@@ -2597,25 +2552,25 @@ net_read_fillbuf(
        errno = ETIMEDOUT;
        /* FALLTHROUGH */
     case -1:
-       secprintf(("%s: net_read_fillbuf: case -1\n",
-                  debug_prefix_time(NULL)));
+       auth_debug(1, ("%s: net_read_fillbuf: case -1\n",
+                      debug_prefix_time(NULL)));
        return (-1);
     case 1:
-       secprintf(("%s: net_read_fillbuf: case 1\n",
-                  debug_prefix_time(NULL)));
+       auth_debug(1, ("%s: net_read_fillbuf: case 1\n",
+                      debug_prefix_time(NULL)));
        assert(FD_ISSET(fd, &readfds));
        break;
     default:
-       secprintf(("%s: net_read_fillbuf: case default\n",
-                  debug_prefix_time(NULL)));
+       auth_debug(1, ("%s: net_read_fillbuf: case default\n",
+                      debug_prefix_time(NULL)));
        assert(0);
        break;
     }
     nread = read(fd, buf, size);
     if (nread < 0)
        return (-1);
-    secprintf(("%s: net_read_fillbuf: end %d\n",
-              debug_prefix_time(NULL), nread));
+    auth_debug(1, ("%s: net_read_fillbuf: end " SSIZE_T_FMT "\n",
+                  debug_prefix_time(NULL), nread));
     return (nread);
 }
 
@@ -2637,8 +2592,8 @@ show_stat_info(
     char *group;
 
     if (stat(name, &sbuf) != 0) {
-       secprintf(("%s: bsd: cannot stat %s: %s\n",
-                  debug_prefix_time(NULL), name, strerror(errno)));
+       auth_debug(1, ("%s: bsd: cannot stat %s: %s\n",
+                      debug_prefix_time(NULL), name, strerror(errno)));
        amfree(name);
        return;
     }
@@ -2654,10 +2609,133 @@ show_stat_info(
     } else {
        group = stralloc(grptr->gr_name);
     }
-    secprintf(("%s: bsd: processing file: %s\n", debug_prefix(NULL), name));
-    secprintf(("%s: bsd:                  owner=%s group=%s mode=%03o\n",
-              debug_prefix(NULL), owner, group, (int) (sbuf.st_mode & 0777)));
+    auth_debug(1, ("%s: bsd: processing file: %s\n", debug_prefix_time(NULL), name));
+    auth_debug(1, ("%s: bsd:                  owner=%s group=%s mode=%03o\n",
+                  debug_prefix_time(NULL), owner, group,
+                  (int) (sbuf.st_mode & 0777)));
     amfree(name);
     amfree(owner);
     amfree(group);
 }
+
+int
+check_name_give_sockaddr(
+    const char *hostname,
+    struct sockaddr *addr,
+    char **errstr)
+{
+    struct addrinfo *res = NULL, *res1;
+    struct addrinfo hints;
+    int result;
+
+#ifdef WORKING_IPV6
+    if ((addr)->sa_family == AF_INET6)
+       hints.ai_flags = AI_CANONNAME | AI_V4MAPPED | AI_ALL;
+    else
+#endif
+       hints.ai_flags = AI_CANONNAME;
+    hints.ai_family = addr->sa_family;
+    hints.ai_socktype = 0;
+    hints.ai_protocol = 0;
+    hints.ai_addrlen = 0;
+    hints.ai_addr = NULL;
+    hints.ai_canonname = NULL;
+    hints.ai_next = NULL;
+    result = getaddrinfo(hostname, NULL, &hints, &res);
+    if (result != 0) {
+       dbprintf(("check_name_give_sockaddr: getaddrinfo(%s): %s\n", hostname, gai_strerror(result)));
+       *errstr = newvstralloc(*errstr,
+                              " getaddrinfo(", hostname, "): ",
+                              gai_strerror(result), NULL);
+       return -1;
+    }
+    if (res->ai_canonname == NULL) {
+       dbprintf(("getaddrinfo(%s) did not return a canonical name\n", hostname));
+       *errstr = newvstralloc(*errstr, 
+               " getaddrinfo(", hostname, ") did not return a canonical name", NULL);
+       return -1;
+    }
+
+    if (strncasecmp(hostname, res->ai_canonname, strlen(hostname)) != 0) {
+       auth_debug(1, ("%s: %s doesn't resolve to itself, it resolves to %s\n",
+                      debug_prefix_time(NULL),
+                      hostname, res->ai_canonname));
+       *errstr = newvstralloc(*errstr, hostname,
+                              _(" doesn't resolve to itself, it resolves to "),
+                              res->ai_canonname, NULL);
+       return -1;
+    }
+
+    for(res1=res; res1 != NULL; res1 = res1->ai_next) {
+       if (res1->ai_addr->sa_family == addr->sa_family) {
+           if (cmp_sockaddr((struct sockaddr_storage *)res1->ai_addr, (struct sockaddr_storage *)addr, 1) == 0) {
+               freeaddrinfo(res);
+               return 0;
+           }
+       }
+    }
+
+    *errstr = newvstralloc(*errstr,
+                          str_sockaddr((struct sockaddr_storage *)addr),
+                          " doesn't resolve to ",
+                          hostname, NULL);
+    freeaddrinfo(res);
+    return -1;
+}
+
+
+int
+check_addrinfo_give_name(
+    struct addrinfo *res,
+    const char *hostname,
+    char **errstr)
+{
+    if (strncasecmp(hostname, res->ai_canonname, strlen(hostname)) != 0) {
+       dbprintf(("%s: %s doesn't resolve to itself, it resolv to %s\n",
+                 debug_prefix_time(NULL),
+                 hostname, res->ai_canonname));
+       *errstr = newvstralloc(*errstr, hostname,
+                              " doesn't resolve to itself, it resolv to ",
+                              res->ai_canonname, NULL);
+       return -1;
+    }
+
+    return 0;
+}
+
+/* Try resolving the hostname, just to catch any potential
+ * problems down the road.  This is used from most security_connect
+ * methods, many of which also want the canonical name.  Returns 
+ * 0 on success.
+ */
+int
+try_resolving_hostname(
+       const char *hostname,
+       char **canonname)
+{
+    struct addrinfo hints;
+    struct addrinfo *gaires;
+    int res;
+
+#ifdef WORKING_IPV6
+    hints.ai_flags = AI_CANONNAME | AI_V4MAPPED | AI_ALL;
+    hints.ai_family = AF_UNSPEC;
+#else
+    hints.ai_flags = AI_CANONNAME;
+    hints.ai_family = AF_INET;
+#endif
+    hints.ai_socktype = 0;
+    hints.ai_protocol = 0;
+    hints.ai_addrlen = 0;
+    hints.ai_addr = NULL;
+    hints.ai_canonname = NULL;
+    hints.ai_next = NULL;
+    if ((res = getaddrinfo(hostname, NULL, &hints, &gaires)) != 0) {
+       return -1;
+    }
+    if (canonname && gaires && gaires->ai_canonname)
+       *canonname = stralloc(gaires->ai_canonname);
+    if (gaires) freeaddrinfo(gaires);
+
+    return 0;
+}
index b1d8faa7a26480c7311695506e438659721dd652..9b2dcc47ce855249dacd6d3d37ed79da385cbf2b 100644 (file)
 #include "stream.h"
 #include "dgram.h"
 #include "queue.h"
+#include "conffile.h"
+#include "security.h"
+#include "event.h"
+
+#define auth_debug(i,x) do {           \
+       if ((i) <= debug_auth) {        \
+           dbprintf(x);                \
+       }                               \
+} while (0)
+
+
+#ifdef KRB5_SECURITY
+#  define KRB5_DEPRECATED 1
+#  ifndef KRB5_HEIMDAL_INCLUDES
+#    include <gssapi/gssapi_generic.h>
+#  else
+#    include <gssapi/gssapi.h>
+#  endif
+#  include <krb5.h>
+#endif
 
 struct sec_handle;
 
@@ -56,12 +76,16 @@ struct tcp_conn {
     int                        refcnt;                 /* number of handles using */
     int                        handle;                 /* last proto handle read */
     void               (*accept_fn)(security_handle_t *, pkt_t *);
-    struct sockaddr_in peer;
+    struct sockaddr_storage    peer;
     TAILQ_ENTRY(tcp_conn) tq;                  /* queue handle */
     int                        (*recv_security_ok)(struct sec_handle *, pkt_t *);
     char *             (*prefix_packet)(void *, pkt_t *);
     int                        toclose;
     int                        donotclose;
+    int                        auth;
+#ifdef KRB5_SECURITY
+    gss_ctx_id_t       gss_context;
+#endif
 };
 
 
@@ -83,7 +107,7 @@ struct sec_handle {
     } fn;
     void *             arg;            /* argument to pass function */
     event_handle_t *   ev_timeout;     /* timeout handle for recv */
-    struct sockaddr_in peer;
+    struct sockaddr_storage    peer;
     int                        sequence;
     event_id_t         event_id;
     char *             proto_handle;
@@ -139,7 +163,7 @@ extern struct connq_s connq;
 typedef struct udp_handle {
     const struct security_driver *driver;      /* MUST be first */
     dgram_t dgram;             /* datagram to read/write from */
-    struct sockaddr_in peer;   /* who sent it to us */
+    struct sockaddr_storage peer;      /* who sent it to us */
     pkt_t pkt;                 /* parsed form of dgram */
     char *handle;              /* handle from recvd packet */
     int sequence;              /* seq no of packet */
@@ -200,8 +224,8 @@ int tcpm_stream_write(void *, const void *, size_t);
 void   tcpm_stream_read(void *, void (*)(void *, void *, ssize_t), void *);
 ssize_t        tcpm_stream_read_sync(void *, void **);
 void   tcpm_stream_read_cancel(void *);
-ssize_t        tcpm_send_token(int, int, char **, const void *, size_t);
-ssize_t        tcpm_recv_token(int, int *, char **, char **, ssize_t *, int);
+ssize_t        tcpm_send_token(struct tcp_conn *, int, int, char **, const void *, size_t);
+ssize_t        tcpm_recv_token(struct tcp_conn *, int, int *, char **, char **, ssize_t *, int);
 void   tcpm_close_connection(void *, char *);
 
 int    tcpma_stream_accept(void *);
@@ -225,8 +249,8 @@ void        udp_recvpkt(void *, void (*)(void *, pkt_t *, security_status_t),
 void   udp_recvpkt_cancel(void *);
 void   udp_recvpkt_callback(void *);
 void   udp_recvpkt_timeout(void *);
-int    udp_inithandle(udp_handle_t *, struct sec_handle *, struct hostent *,
-                       in_port_t, char *, int);
+int    udp_inithandle(udp_handle_t *, struct sec_handle *, char *hostname,
+                      struct sockaddr_storage *, in_port_t, char *, int);
 void   udp_netfd_read_callback(void *);
 
 struct tcp_conn *sec_tcp_conn_get(const char *, int);
@@ -241,7 +265,7 @@ char *      check_user_ruserok    (const char *host,
                                struct passwd *pwd,
                                const char *user);
 char * check_user_amandahosts(const char *host,
-                               struct in_addr addr,
+                               struct sockaddr_storage *addr,
                                struct passwd *pwd,
                                const char *user,
                                const char *service);
@@ -250,5 +274,11 @@ ssize_t    net_writev(int, struct iovec *, int);
 ssize_t        net_read(int, void *, size_t, int);
 ssize_t net_read_fillbuf(int, int, void *, size_t);
 void   show_stat_info(char *a, char *b);
+int     check_name_give_sockaddr(const char *hostname, struct sockaddr *addr,
+                                char **errstr);
+int     check_addrinfo_give_name(struct addrinfo *res, const char *hostname,
+                                char **errstr);
+int    try_resolving_hostname(const char *hostname,
+                              char **cannonname);
 
 #endif /* _SECURITY_INFO_H */
index 76cf78ddc345427be060b7b01b483e749c0c0387..4ee8eb7c25eb84937b0d317429324ed8f659d45d 100644 (file)
@@ -94,12 +94,13 @@ security_getdriver(
 
     for (i = 0; i < NDRIVERS; i++) {
        if (strcasecmp(name, drivers[i]->name) == 0) {
-           dbprintf(("security_getdriver(name=%s) returns %p\n",
-                       name, drivers[i]));
+           dbprintf(("%s: security_getdriver(name=%s) returns %p\n",
+                     debug_prefix_time(NULL), name, drivers[i]));
            return (drivers[i]);
        }
     }
-    dbprintf(("security_getdriver(name=%s) returns NULL\n", name));
+    dbprintf(("%s: security_getdriver(name=%s) returns NULL\n",
+             debug_prefix_time(NULL), name));
     return (NULL);
 }
 
@@ -111,8 +112,8 @@ security_handleinit(
     security_handle_t *                handle,
     const security_driver_t *  driver)
 {
-    dbprintf(("security_handleinit(handle=%p, driver=%p (%s))\n",
-               handle, driver, driver->name));
+    dbprintf(("%s: security_handleinit(handle=%p, driver=%p (%s))\n",
+             debug_prefix_time(NULL), handle, driver, driver->name));
     handle->driver = driver;
     handle->error = stralloc("unknown protocol error");
 }
@@ -128,16 +129,18 @@ printf_arglist_function1(void security_seterror, security_handle_t *, handle,
     vsnprintf(buf, SIZEOF(buf), fmt, argp);
     arglist_end(argp);
     handle->error = newstralloc(handle->error, buf);
-    dbprintf(("security_seterror(handle=%p, driver=%p (%s) error=%s)\n",
-               handle, handle->driver, handle->driver->name, handle->error));
+    dbprintf(("%s: security_seterror(handle=%p, driver=%p (%s) error=%s)\n",
+             debug_prefix_time(NULL), handle, handle->driver,
+             handle->driver->name, handle->error));
 }
 
 void
 security_close(
     security_handle_t *        handle)
 {
-    dbprintf(("security_close(handle=%p, driver=%p (%s))\n",
-               handle, handle->driver, handle->driver->name));
+    dbprintf(("%s: security_close(handle=%p, driver=%p (%s))\n",
+             debug_prefix_time(NULL), handle, handle->driver,
+             handle->driver->name));
     amfree(handle->error);
     (*handle->driver->close)(handle);
 }
@@ -150,8 +153,8 @@ security_streaminit(
     security_stream_t *                stream,
     const security_driver_t *  driver)
 {
-    dbprintf(("security_streaminit(stream=%p, driver=%p (%s))\n",
-               stream, driver, driver->name));
+    dbprintf(("%s: security_streaminit(stream=%p, driver=%p (%s))\n",
+             debug_prefix_time(NULL), stream, driver, driver->name));
     stream->driver = driver;
     stream->error = stralloc("unknown stream error");
 }
@@ -167,14 +170,16 @@ printf_arglist_function1(void security_stream_seterror,
     vsnprintf(buf, SIZEOF(buf), fmt, argp);
     arglist_end(argp);
     stream->error = newstralloc(stream->error, buf);
-    dbprintf(("security_stream_seterr(%p, %s)\n", stream, stream->error));
+    dbprintf(("%s: security_stream_seterr(%p, %s)\n",
+             debug_prefix_time(NULL), stream, stream->error));
 }
 
 void
 security_stream_close(
     security_stream_t *        stream)
 {
-    dbprintf(("security_stream_close(%p)\n", stream));
+    dbprintf(("%s: security_stream_close(%p)\n",
+             debug_prefix_time(NULL), stream));
     amfree(stream->error);
     (*stream->driver->stream_close)(stream);
 }
index d0971b4ab683cea573e6cad5eb30f684ad3dcda7..59b2bbf674f9f36fb12bb911773b77d8ae2c88b6 100644 (file)
@@ -154,6 +154,8 @@ typedef struct security_driver {
 
     void (*close_connection)(void *, char *);
 
+    int (*data_encrypt)(void *, void *, ssize_t, void **, ssize_t *);
+    int (*data_decrypt)(void *, void *, ssize_t, void **, ssize_t *);
 } security_driver_t;
 
 /*
diff --git a/common-src/snprintf.c b/common-src/snprintf.c
deleted file mode 100644 (file)
index fa060c9..0000000
+++ /dev/null
@@ -1,1037 +0,0 @@
-/* ====================================================================
- * Copyright (c) 1995-1997 The Apache Group.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer. 
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * 3. All advertising materials mentioning features or use of this
- *    software must display the following acknowledgment:
- *    "This product includes software developed by the Apache Group
- *    for use in the Apache HTTP server project (http://www.apache.org/)."
- *
- * 4. The names "Apache Server" and "Apache Group" must not be used to
- *    endorse or promote products derived from this software without
- *    prior written permission.
- *
- * 5. Redistributions of any form whatsoever must retain the following
- *    acknowledgment:
- *    "This product includes software developed by the Apache Group
- *    for use in the Apache HTTP server project (http://www.apache.org/)."
- *
- * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY
- * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE APACHE GROUP OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
- * OF THE POSSIBILITY OF SUCH DAMAGE.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Group and was originally based
- * on public domain software written at the National Center for
- * Supercomputing Applications, University of Illinois, Urbana-Champaign.
- * For more information on the Apache Group and the Apache HTTP server
- * project, please see <http://www.apache.org/>.
- *
- * This code is based on, and used with the permission of, the
- * SIO stdio-replacement strx_* functions by Panos Tsirigotis
- * <panos@alumni.cs.colorado.edu> for xinetd.
- */
-
-/* #include "conf.h"   -- original line from the Apache distribution */
-/*
- * These are what we need in Amanda.
- */
-#include "amanda.h"
-#include "arglist.h"
-#include <math.h>
-
-#if !(defined(HAVE_SNPRINTF) && defined(HAVE_VSNPRINTF))
-
-/*
-#include <stdio.h>
-#include <ctype.h>
-#include <sys/types.h>
-#include <stdarg.h>
-#include <string.h>
-#include <stdlib.h>
-#include <math.h>
-*/
-
-#ifdef HAVE_CVT
-
-# define ap_ecvt ecvt
-# define ap_fcvt fcvt
-# define ap_gcvt gcvt
-
-#else
-
-/*
- * cvt.c - IEEE floating point formatting routines for FreeBSD
- * from GNU libc-4.6.27
- */
-
-/*
- *    ap_ecvt converts to decimal
- *      the number of digits is specified by ndigit
- *      decpt is set to the position of the decimal point
- *      sign is set to 0 for positive, 1 for negative
- */
-
-#define        NDIG    80
-
-/*
-static char *
-     ap_cvt(double arg, int ndigits, int *decpt, int *sign, int eflag)
-*/
-static char *ap_cvt(arg, ndigits, decpt, sign, eflag)
-double arg;
-int ndigits;
-int *decpt;
-int *sign;
-int eflag;
-{
-    register int r2;
-    double fi, fj;
-    register char *p, *p1;
-    static char buf[NDIG];
-
-    if (ndigits >= NDIG - 1)
-       ndigits = NDIG - 2;
-    r2 = 0;
-    *sign = 0;
-    p = &buf[0];
-    if (arg < 0) {
-       *sign = 1;
-       arg = -arg;
-    }
-    arg = modf(arg, &fi);
-    p1 = &buf[NDIG];
-    /*
-     * Do integer part
-     */
-    if (fi != 0) {
-       p1 = &buf[NDIG];
-       while (fi != 0) {
-           fj = modf(fi / 10, &fi);
-           *--p1 = (int) ((fj + .03) * 10) + '0';
-           r2++;
-       }
-       while (p1 < &buf[NDIG])
-           *p++ = *p1++;
-    }
-    else if (arg > 0) {
-       while ((fj = arg * 10) < 1) {
-           arg = fj;
-           r2--;
-       }
-    }
-    p1 = &buf[ndigits];
-    if (eflag == 0)
-       p1 += r2;
-    *decpt = r2;
-    if (p1 < &buf[0]) {
-       buf[0] = '\0';
-       return (buf);
-    }
-    while (p <= p1 && p < &buf[NDIG]) {
-       arg *= 10;
-       arg = modf(arg, &fj);
-       *p++ = (int) fj + '0';
-    }
-    if (p1 >= &buf[NDIG]) {
-       buf[NDIG - 1] = '\0';
-       return (buf);
-    }
-    p = p1;
-    *p1 += 5;
-    while (*p1 > '9') {
-       *p1 = '0';
-       if (p1 > buf)
-           ++ * --p1;
-       else {
-           *p1 = '1';
-           (*decpt)++;
-           if (eflag == 0) {
-               if (p > buf)
-                   *p = '0';
-               p++;
-           }
-       }
-    }
-    *p = '\0';
-    return (buf);
-}
-
-/*
-static char *
-     ap_ecvt(double arg, int ndigits, int *decpt, int *sign)
-*/
-static char *ap_ecvt(arg, ndigits, decpt, sign)
-double arg;
-int ndigits;
-int *decpt;
-int *sign;
-{
-    return (ap_cvt(arg, ndigits, decpt, sign, 1));
-}
-
-/*
-static char *
-     ap_fcvt(double arg, int ndigits, int *decpt, int *sign)
-*/
-static char *ap_fcvt(arg, ndigits, decpt, sign)
-double arg;
-int ndigits;
-int *decpt;
-int *sign;
-{
-    return (ap_cvt(arg, ndigits, decpt, sign, 0));
-}
-
-/*
- * ap_gcvt  - Floating output conversion to
- * minimal length string
- */
-/*
-static char *
-     ap_gcvt(double number, int ndigit, char *buf)
-*/
-static char *ap_gcvt(number, ndigit, buf)
-double number;
-int ndigit;
-char *buf;
-{
-    int sign, decpt;
-    register char *p1, *p2;
-    register i;
-
-    p1 = ap_ecvt(number, ndigit, &decpt, &sign);
-    p2 = buf;
-    if (sign)
-       *p2++ = '-';
-    for (i = ndigit - 1; i > 0 && p1[i] == '0'; i--)
-       ndigit--;
-    if ((decpt >= 0 && decpt - ndigit > 4)
-       || (decpt < 0 && decpt < -3)) {         /* use E-style */
-       decpt--;
-       *p2++ = *p1++;
-       *p2++ = '.';
-       for (i = 1; i < ndigit; i++)
-           *p2++ = *p1++;
-       *p2++ = 'e';
-       if (decpt < 0) {
-           decpt = -decpt;
-           *p2++ = '-';
-       }
-       else
-           *p2++ = '+';
-       if (decpt / 100 > 0)
-           *p2++ = decpt / 100 + '0';
-       if (decpt / 10 > 0)
-           *p2++ = (decpt % 100) / 10 + '0';
-       *p2++ = decpt % 10 + '0';
-    }
-    else {
-       if (decpt <= 0) {
-           if (*p1 != '0')
-               *p2++ = '.';
-           while (decpt < 0) {
-               decpt++;
-               *p2++ = '0';
-           }
-       }
-       for (i = 1; i <= ndigit; i++) {
-           *p2++ = *p1++;
-           if (i == decpt)
-               *p2++ = '.';
-       }
-       if (ndigit < decpt) {
-           while (ndigit++ < decpt)
-               *p2++ = '0';
-           *p2++ = '.';
-       }
-    }
-    if (p2[-1] == '.')
-       p2--;
-    *p2 = '\0';
-    return (buf);
-}
-
-#endif /* HAVE_CVT */
-
-typedef enum {
-    NO = 0, YES = 1
-} boolean_e;
-
-#define FALSE                  0
-#define TRUE                   1
-#define NUL                    '\0'
-#define INT_NULL               ((int *)0)
-#define WIDE_INT               long
-
-typedef WIDE_INT               wide_int;
-typedef unsigned WIDE_INT      u_wide_int;
-typedef int                    bool_int;
-
-#define S_NULL                 "(null)"
-#define S_NULL_LEN             6
-
-#define FLOAT_DIGITS           6
-#define EXPONENT_LENGTH                10
-
-/*
- * NUM_BUF_SIZE is the size of the buffer used for arithmetic conversions
- *
- * XXX: this is a magic number; do not decrease it
- */
-#define NUM_BUF_SIZE           512
-
-
-/*
- * Descriptor for buffer area
- */
-struct buf_area {
-    char *buf_end;
-    char *nextb;               /* pointer to next byte to read/write   */
-};
-
-typedef struct buf_area buffy;
-
-/*
- * The INS_CHAR macro inserts a character in the buffer and writes
- * the buffer back to disk if necessary
- * It uses the char pointers sp and bep:
- *      sp points to the next available character in the buffer
- *      bep points to the end-of-buffer+1
- * While using this macro, note that the nextb pointer is NOT updated.
- *
- * NOTE: Evaluation of the c argument should not have any side-effects
- */
-#define INS_CHAR( c, sp, bep, cc )     \
-           {                           \
-               if ( sp < bep )         \
-               {                       \
-                   *sp++ = c ;         \
-                   cc++ ;              \
-               }                       \
-           }
-
-#define NUM( c )                       ( c - '0' )
-
-#define STR_TO_DEC( str, num )         \
-    num = NUM( *str++ ) ;              \
-    while ( isdigit( *str ) )          \
-    {                                  \
-       num *= 10 ;                     \
-       num += NUM( *str++ ) ;          \
-    }
-
-/*
- * This macro does zero padding so that the precision
- * requirement is satisfied. The padding is done by
- * adding '0's to the left of the string that is going
- * to be printed.
- */
-#define FIX_PRECISION( adjust, precision, s, s_len )   \
-    if ( adjust )                                      \
-       while ( s_len < precision )                     \
-       {                                               \
-           *--s = '0' ;                                \
-           s_len++ ;                                   \
-       }
-
-/*
- * Macro that does padding. The padding is done by printing
- * the character ch.
- */
-#define PAD( width, len, ch )  do              \
-       {                                       \
-           INS_CHAR( ch, sp, bep, cc ) ;       \
-           width-- ;                           \
-       }                                       \
-       while ( width > len )
-
-/*
- * Prefix the character ch to the string str
- * Increase length
- * Set the has_prefix flag
- */
-#define PREFIX( str, length, ch )       *--str = ch ; length++ ; has_prefix = YES
-
-
-/*
- * Convert num to its decimal format.
- * Return value:
- *   - a pointer to a string containing the number (no sign)
- *   - len contains the length of the string
- *   - is_negative is set to TRUE or FALSE depending on the sign
- *     of the number (always set to FALSE if is_unsigned is TRUE)
- *
- * The caller provides a buffer for the string: that is the buf_end argument
- * which is a pointer to the END of the buffer + 1 (i.e. if the buffer
- * is declared as buf[ 100 ], buf_end should be &buf[ 100 ])
- */
-/*
-static char *
-     conv_10(register wide_int num, register bool_int is_unsigned,
-         register bool_int * is_negative, char *buf_end, register int *len)
-*/
-static char *conv_10(num, is_unsigned, is_negative, buf_end, len)
-register wide_int num;
-register bool_int is_unsigned;
-register bool_int *is_negative;
-char *buf_end;
-register int *len;
-{
-    register char *p = buf_end;
-    register u_wide_int magnitude;
-
-    if (is_unsigned) {
-       magnitude = (u_wide_int) num;
-       *is_negative = FALSE;
-    }
-    else {
-       *is_negative = (num < 0);
-
-       /*
-        * On a 2's complement machine, negating the most negative integer 
-        * results in a number that cannot be represented as a signed integer.
-        * Here is what we do to obtain the number's magnitude:
-        *      a. add 1 to the number
-        *      b. negate it (becomes positive)
-        *      c. convert it to unsigned
-        *      d. add 1
-        */
-       if (*is_negative) {
-           wide_int t = num + 1;
-
-           magnitude = ((u_wide_int) - t) + 1;
-       }
-       else
-           magnitude = (u_wide_int) num;
-    }
-
-    /*
-     * We use a do-while loop so that we write at least 1 digit 
-     */
-    do {
-       register u_wide_int new_magnitude = magnitude / 10;
-
-       *--p = magnitude - new_magnitude * 10 + '0';
-       magnitude = new_magnitude;
-    }
-    while (magnitude);
-
-    *len = buf_end - p;
-    return (p);
-}
-
-
-
-/*
- * Convert a floating point number to a string formats 'f', 'e' or 'E'.
- * The result is placed in buf, and len denotes the length of the string
- * The sign is returned in the is_negative argument (and is not placed
- * in buf).
- */
-/*
-static char *
-     conv_fp(register char format, register double num,
-boolean_e add_dp, int precision, bool_int * is_negative, char *buf, int *len)
-*/
-static char *conv_fp(format, num, add_dp, precision, is_negative, buf, len)
-register char format;
-register double num;
-boolean_e add_dp;
-int precision;
-bool_int *is_negative;
-char *buf;
-int *len;
-{
-    register char *s = buf;
-    register char *p;
-    int decimal_point;
-
-    if (format == 'f')
-       p = ap_fcvt(num, precision, &decimal_point, is_negative);
-    else                       /* either e or E format */
-       p = ap_ecvt(num, precision + 1, &decimal_point, is_negative);
-
-    /*
-     * Check for Infinity and NaN
-     */
-    if (isalpha(*p)) {
-       *len = strlen(strcpy(buf, p));
-       *is_negative = FALSE;
-       return (buf);
-    }
-
-    if (format == 'f')
-       if (decimal_point <= 0) {
-           *s++ = '0';
-           if (precision > 0) {
-               *s++ = '.';
-               while (decimal_point++ < 0)
-                   *s++ = '0';
-           }
-           else if (add_dp)
-               *s++ = '.';
-       }
-       else {
-           while (decimal_point-- > 0)
-               *s++ = *p++;
-           if (precision > 0 || add_dp)
-               *s++ = '.';
-       }
-    else {
-       *s++ = *p++;
-       if (precision > 0 || add_dp)
-           *s++ = '.';
-    }
-
-    /*
-     * copy the rest of p, the NUL is NOT copied
-     */
-    while (*p)
-       *s++ = *p++;
-
-    if (format != 'f') {
-       char temp[EXPONENT_LENGTH];     /* for exponent conversion */
-       int t_len;
-       bool_int exponent_is_negative;
-
-       *s++ = format;          /* either e or E */
-       decimal_point--;
-       if (decimal_point != 0) {
-           p = conv_10((wide_int) decimal_point, FALSE, &exponent_is_negative,
-                       &temp[EXPONENT_LENGTH], &t_len);
-           *s++ = exponent_is_negative ? '-' : '+';
-
-           /*
-            * Make sure the exponent has at least 2 digits
-            */
-           if (t_len == 1)
-               *s++ = '0';
-           while (t_len--)
-               *s++ = *p++;
-       }
-       else {
-           *s++ = '+';
-           *s++ = '0';
-           *s++ = '0';
-       }
-    }
-
-    *len = s - buf;
-    return (buf);
-}
-
-
-/*
- * Convert num to a base X number where X is a power of 2. nbits determines X.
- * For example, if nbits is 3, we do base 8 conversion
- * Return value:
- *      a pointer to a string containing the number
- *
- * The caller provides a buffer for the string: that is the buf_end argument
- * which is a pointer to the END of the buffer + 1 (i.e. if the buffer
- * is declared as buf[ 100 ], buf_end should be &buf[ 100 ])
- */
-/*
-static char *
-     conv_p2(register u_wide_int num, register int nbits,
-            char format, char *buf_end, register int *len)
-*/
-static char *conv_p2(num, nbits, format, buf_end, len)
-register u_wide_int num;
-register int nbits;
-char format;
-char *buf_end;
-register int *len;
-{
-    register int mask = (1 << nbits) - 1;
-    register char *p = buf_end;
-    static char low_digits[] = "0123456789abcdef";
-    static char upper_digits[] = "0123456789ABCDEF";
-    register char *digits = (format == 'X') ? upper_digits : low_digits;
-
-    do {
-       *--p = digits[num & mask];
-       num >>= nbits;
-    }
-    while (num);
-
-    *len = buf_end - p;
-    return (p);
-}
-
-
-/*
- * Do format conversion placing the output in buffer
- */
-/*
-static int format_converter(register buffy * odp, const char *fmt,
-                             va_list ap)
-*/
-static int format_converter(odp, fmt, ap)
-register buffy *odp;
-const char *fmt;
-va_list ap;
-{
-    register char *sp;
-    register char *bep;
-    register int cc = 0;
-    register int i;
-
-    register char *s = NULL;
-    char *q;
-    int s_len;
-
-    register int min_width = 0;
-    int precision = 0;
-    enum {
-       LEFT, RIGHT
-    } adjust;
-    char pad_char;
-    char prefix_char;
-
-    double fp_num;
-    wide_int i_num = (wide_int) 0;
-    u_wide_int ui_num;
-
-    char num_buf[NUM_BUF_SIZE];
-    char char_buf[2];          /* for printing %% and %<unknown> */
-
-    /*
-     * Flag variables
-     */
-    boolean_e is_long;
-    boolean_e alternate_form;
-    boolean_e print_sign;
-    boolean_e print_blank;
-    boolean_e adjust_precision;
-    boolean_e adjust_width;
-    bool_int is_negative;
-
-    sp = odp->nextb;
-    bep = odp->buf_end;
-
-    while (*fmt) {
-       if (*fmt != '%') {
-           INS_CHAR(*fmt, sp, bep, cc);
-       }
-       else {
-           /*
-            * Default variable settings
-            */
-           adjust = RIGHT;
-           alternate_form = print_sign = print_blank = NO;
-           pad_char = ' ';
-           prefix_char = NUL;
-
-           fmt++;
-
-           /*
-            * Try to avoid checking for flags, width or precision
-            */
-           if (isascii(*fmt) && !islower(*fmt)) {
-               /*
-                * Recognize flags: -, #, BLANK, +
-                */
-               for (;; fmt++) {
-                   if (*fmt == '-')
-                       adjust = LEFT;
-                   else if (*fmt == '+')
-                       print_sign = YES;
-                   else if (*fmt == '#')
-                       alternate_form = YES;
-                   else if (*fmt == ' ')
-                       print_blank = YES;
-                   else if (*fmt == '0')
-                       pad_char = '0';
-                   else
-                       break;
-               }
-
-               /*
-                * Check if a width was specified
-                */
-               if (isdigit(*fmt)) {
-                   STR_TO_DEC(fmt, min_width);
-                   adjust_width = YES;
-               }
-               else if (*fmt == '*') {
-                   min_width = arglist_val(ap, int);
-                   fmt++;
-                   adjust_width = YES;
-                   if (min_width < 0) {
-                       adjust = LEFT;
-                       min_width = -min_width;
-                   }
-               }
-               else
-                   adjust_width = NO;
-
-               /*
-                * Check if a precision was specified
-                *
-                * XXX: an unreasonable amount of precision may be specified
-                * resulting in overflow of num_buf. Currently we
-                * ignore this possibility.
-                */
-               if (*fmt == '.') {
-                   adjust_precision = YES;
-                   fmt++;
-                   if (isdigit(*fmt)) {
-                       STR_TO_DEC(fmt, precision);
-                   }
-                   else if (*fmt == '*') {
-                       precision = arglist_val(ap, int);
-                       fmt++;
-                       if (precision < 0)
-                           precision = 0;
-                   }
-                   else
-                       precision = 0;
-               }
-               else
-                   adjust_precision = NO;
-           }
-           else
-               adjust_precision = adjust_width = NO;
-
-           /*
-            * Modifier check
-            */
-           if (*fmt == 'l') {
-               is_long = YES;
-               fmt++;
-           }
-           else
-               is_long = NO;
-
-           /*
-            * Argument extraction and printing.
-            * First we determine the argument type.
-            * Then, we convert the argument to a string.
-            * On exit from the switch, s points to the string that
-            * must be printed, s_len has the length of the string
-            * The precision requirements, if any, are reflected in s_len.
-            *
-            * NOTE: pad_char may be set to '0' because of the 0 flag.
-            *   It is reset to ' ' by non-numeric formats
-            */
-           switch (*fmt) {
-           case 'u':
-               if (is_long)
-                   i_num = arglist_val(ap, u_wide_int);
-               else
-                   i_num = (wide_int) arglist_val(ap, unsigned int);
-               /*
-                * The rest also applies to other integer formats, so fall
-                * into that case.
-                */
-           case 'd':
-           case 'i':
-               /*
-                * Get the arg if we haven't already.
-                */
-               if ((*fmt) != 'u') {
-                   if (is_long)
-                       i_num = arglist_val(ap, wide_int);
-                   else
-                       i_num = (wide_int) arglist_val(ap, int);
-               };
-               s = conv_10(i_num, (*fmt) == 'u', &is_negative,
-                           &num_buf[NUM_BUF_SIZE], &s_len);
-               FIX_PRECISION(adjust_precision, precision, s, s_len);
-
-               if (*fmt != 'u') {
-                   if (is_negative)
-                       prefix_char = '-';
-                   else if (print_sign)
-                       prefix_char = '+';
-                   else if (print_blank)
-                       prefix_char = ' ';
-               }
-               break;
-
-
-           case 'o':
-               if (is_long)
-                   ui_num = arglist_val(ap, u_wide_int);
-               else
-                   ui_num = (u_wide_int) arglist_val(ap, unsigned int);
-               s = conv_p2(ui_num, 3, *fmt,
-                           &num_buf[NUM_BUF_SIZE], &s_len);
-               FIX_PRECISION(adjust_precision, precision, s, s_len);
-               if (alternate_form && *s != '0') {
-                   *--s = '0';
-                   s_len++;
-               }
-               break;
-
-
-           case 'x':
-           case 'X':
-               if (is_long)
-                   ui_num = (u_wide_int) arglist_val(ap, u_wide_int);
-               else
-                   ui_num = (u_wide_int) arglist_val(ap, unsigned int);
-               s = conv_p2(ui_num, 4, *fmt,
-                           &num_buf[NUM_BUF_SIZE], &s_len);
-               FIX_PRECISION(adjust_precision, precision, s, s_len);
-               if (alternate_form && i_num != 0) {
-                   *--s = *fmt;        /* 'x' or 'X' */
-                   *--s = '0';
-                   s_len += 2;
-               }
-               break;
-
-
-           case 's':
-               s = arglist_val(ap, char *);
-               if (s != NULL) {
-                   s_len = strlen(s);
-                   if (adjust_precision && precision < s_len)
-                       s_len = precision;
-               }
-               else {
-                   s = S_NULL;
-                   s_len = S_NULL_LEN;
-               }
-               pad_char = ' ';
-               break;
-
-
-           case 'f':
-           case 'e':
-           case 'E':
-               fp_num = arglist_val(ap, double);
-
-               s = conv_fp(*fmt, fp_num, alternate_form,
-                       (adjust_precision == NO) ? FLOAT_DIGITS : precision,
-                           &is_negative, &num_buf[1], &s_len);
-               if (is_negative)
-                   prefix_char = '-';
-               else if (print_sign)
-                   prefix_char = '+';
-               else if (print_blank)
-                   prefix_char = ' ';
-               break;
-
-
-           case 'g':
-           case 'G':
-               if (adjust_precision == NO)
-                   precision = FLOAT_DIGITS;
-               else if (precision == 0)
-                   precision = 1;
-               /*
-                * * We use &num_buf[ 1 ], so that we have room for the sign
-                */
-               s = ap_gcvt(arglist_val(ap, double), precision, &num_buf[1]);
-               if (*s == '-')
-                   prefix_char = *s++;
-               else if (print_sign)
-                   prefix_char = '+';
-               else if (print_blank)
-                   prefix_char = ' ';
-
-               s_len = strlen(s);
-
-               if (alternate_form && (q = strchr(s, '.')) == NULL)
-                   s[s_len++] = '.';
-               if (*fmt == 'G' && (q = strchr(s, 'e')) != NULL)
-                   *q = 'E';
-               break;
-
-
-           case 'c':
-               char_buf[0] = (char) (arglist_val(ap, int));
-               s = &char_buf[0];
-               s_len = 1;
-               pad_char = ' ';
-               break;
-
-
-           case '%':
-               char_buf[0] = '%';
-               s = &char_buf[0];
-               s_len = 1;
-               pad_char = ' ';
-               break;
-
-
-           case 'n':
-               *(arglist_val(ap, int *)) = cc;
-               break;
-
-               /*
-                * Always extract the argument as a "char *" pointer. We 
-                * should be using "void *" but there are still machines 
-                * that don't understand it.
-                * If the pointer size is equal to the size of an unsigned
-                * integer we convert the pointer to a hex number, otherwise 
-                * we print "%p" to indicate that we don't handle "%p".
-                */
-           case 'p':
-               ui_num = (u_wide_int) arglist_val(ap, char *);
-
-               if (sizeof(char *) <= sizeof(u_wide_int))
-                        s = conv_p2(ui_num, 4, 'x',
-                                    &num_buf[NUM_BUF_SIZE], &s_len);
-               else {
-                   s = "%p";
-                   s_len = 2;
-               }
-               pad_char = ' ';
-               break;
-
-
-           case NUL:
-               /*
-                * The last character of the format string was %.
-                * We ignore it.
-                */
-               continue;
-
-
-               /*
-                * The default case is for unrecognized %'s.
-                * We print %<char> to help the user identify what
-                * option is not understood.
-                * This is also useful in case the user wants to pass
-                * the output of format_converter to another function
-                * that understands some other %<char> (like syslog).
-                * Note that we can't point s inside fmt because the
-                * unknown <char> could be preceded by width etc.
-                */
-           default:
-               char_buf[0] = '%';
-               char_buf[1] = *fmt;
-               s = char_buf;
-               s_len = 2;
-               pad_char = ' ';
-               break;
-           }
-
-           if (prefix_char != NUL) {
-               *--s = prefix_char;
-               s_len++;
-           }
-
-           if (adjust_width && adjust == RIGHT && min_width > s_len) {
-               if (pad_char == '0' && prefix_char != NUL) {
-                   INS_CHAR(*s, sp, bep, cc)
-                       s++;
-                   s_len--;
-                   min_width--;
-               }
-               PAD(min_width, s_len, pad_char);
-           }
-
-           /*
-            * Print the string s. 
-            */
-           for (i = s_len; i != 0; i--) {
-               INS_CHAR(*s, sp, bep, cc);
-               s++;
-           }
-
-           if (adjust_width && adjust == LEFT && min_width > s_len)
-               PAD(min_width, s_len, pad_char);
-       }
-       fmt++;
-    }
-    odp->nextb = sp;
-    return (cc);
-}
-
-
-/*
- * This is the general purpose conversion function.
- */
-/*
-static void strx_printv(int *ccp, char *buf, size_t len, const char *format,
-                       va_list ap)
-*/
-static void strx_printv(ccp, buf, len, format, ap)
-int *ccp;
-char *buf;
-size_t len;
-const char *format;
-va_list ap;
-{
-    buffy od;
-    int cc;
-
-    /*
-     * First initialize the descriptor
-     * Notice that if no length is given, we initialize buf_end to the
-     * highest possible address.
-     */
-    od.buf_end = len ? &buf[len] : (char *) ~0;
-    od.nextb = buf;
-
-    /*
-     * Do the conversion
-     */
-    cc = format_converter(&od, format, ap);
-    if (len == 0 || od.nextb <= od.buf_end)
-       *(od.nextb) = '\0';
-    if (ccp)
-       *ccp = cc;
-}
-
-
-/*
-int snprintf(char *buf, size_t len, const char *format,...)
-*/
-printf_arglist_function2(int snprintf,
-                        char *, buf,
-                        size_t, len,
-                        const char *, format)
-{
-    int cc;
-    va_list ap;
-
-    arglist_start(ap, format);
-    strx_printv(&cc, buf, (len - 1), format, ap);
-    arglist_end(ap);
-    return (cc);
-}
-
-
-/*
-int vsnprintf(char *buf, size_t len, const char *format, va_list ap)
-*/
-int vsnprintf(buf, len, format, ap)
-char *buf;
-size_t len;
-const char *format;
-va_list ap;
-{
-    int cc;
-
-    strx_printv(&cc, buf, (len - 1), format, ap);
-    return (cc);
-}
-
-#endif /* HAVE_SNPRINTF */
index c0b023c86aa79a4819163fcb89a1a9ae752e52de..3736927ca2da74f534367c8e890afb3f65a0207d 100644 (file)
 
 #ifdef SSH_SECURITY
 
-/*#define      SSH_DEBUG*/
-
-#ifdef SSH_DEBUG
-int    ssh_debug = 1; 
-#else
-int    ssh_debug = 0; 
-#endif
-
-#define        sshprintf(x)                            \
-           do {                                \
-               if (ssh_debug) {                \
-                   dbprintf(x);                \
-               }                               \
-           } while (0)
-
-/*
- * Path to the ssh binary.  This should be configurable.
- */
-#define        SSH_PATH        "/usr/bin/ssh"
-
-/*
- * Arguments to ssh.  This should also be configurable
- */
-#define        SSH_ARGS        "-x", "-o", "BatchMode=yes", "-o", "PreferredAuthentications=publickey"
-
 /*
  * Number of seconds ssh has to start up
  */
@@ -110,6 +85,8 @@ const security_driver_t ssh_security_driver = {
     tcpm_stream_read_sync,
     tcpm_stream_read_cancel,
     tcpm_close_connection,
+    NULL,
+    NULL
 };
 
 static int newhandle = 1;
@@ -132,7 +109,6 @@ ssh_connect(
     void *             datap)
 {
     struct sec_handle *rh;
-    struct hostent *he;
     char *amandad_path=NULL, *client_username=NULL, *ssh_keys=NULL;
 
     assert(fn != NULL);
@@ -140,8 +116,8 @@ ssh_connect(
 
     (void)conf_fn;     /* Quiet unused parameter warning */
 
-    sshprintf(("%s: ssh: ssh_connect: %s\n", debug_prefix_time(NULL),
-              hostname));
+    auth_debug(1, ("%s: ssh: ssh_connect: %s\n", debug_prefix_time(NULL),
+                  hostname));
 
     rh = alloc(SIZEOF(*rh));
     security_handleinit(&rh->sech, &ssh_security_driver);
@@ -150,13 +126,13 @@ ssh_connect(
     rh->ev_timeout = NULL;
     rh->rc = NULL;
 
-    if ((he = gethostbyname(hostname)) == NULL) {
+    rh->hostname = NULL;
+    if (try_resolving_hostname(hostname, &rh->hostname)) {
        security_seterror(&rh->sech,
            "%s: ssh could not resolve hostname", hostname);
        (*fn)(arg, &rh->sech, S_ERROR);
        return;
     }
-    rh->hostname = stralloc(he->h_name);       /* will be replaced */
     rh->rs = tcpma_stream_client(rh, newhandle++);
 
     if (rh->rs == NULL)
@@ -256,16 +232,16 @@ runssh(
     if(!xclient_username || strlen(xclient_username) <= 1)
        xclient_username = CLIENT_LOGIN;
     if(!ssh_keys || strlen(ssh_keys) <= 1) {
-       execlp(SSH_PATH, SSH_PATH, SSH_ARGS, "-l", xclient_username,
+       execlp(SSH, SSH, SSH_OPTIONS, "-l", xclient_username,
               rc->hostname, xamandad_path, "-auth=ssh", "amdump", "amindexd",
               "amidxtaped", (char *)NULL);
     }
     else {
-       execlp(SSH_PATH, SSH_PATH, SSH_ARGS, "-l", xclient_username,
+       execlp(SSH, SSH, SSH_OPTIONS, "-l", xclient_username,
               "-i", xssh_keys, rc->hostname, xamandad_path, "-auth=ssh",
               "amdump", "amindexd", "amidxtaped", (char *)NULL);
     }
-    error("error: couldn't exec %s: %s", SSH_PATH, strerror(errno));
+    error("error: couldn't exec %s: %s", SSH, strerror(errno));
 
     /* should never go here, shut up compiler warning */
     return(-1);
index 9e1d3cd1932cd190f5a3bc766093c558a9745f83..6f3e26ac158cbf95c39f37a6efeede697f26840d 100644 (file)
@@ -137,7 +137,9 @@ scale(
 {
     if (r == (off_t)-1)
        return (off_t)-1;
-    return r*(s/(off_t)1024);
+    if (s % 1024 == 0)
+       return r*(s/(off_t)1024);
+    return (off_t)(r*((double)s/1024.0));
 }
 
 int
@@ -191,10 +193,10 @@ main(
 
     printf("statfs (%s)\n",STATFS_TYP);
     printf(
-"name                             total    free   avail  files  ffree favail\n"
+"name                            total     free    avail   files   ffree  favail\n"
           );
     printf(
-"------------------------------ ------- ------- ------- ------ ------ ------\n"
+"---------------------------- -------- -------- -------- ------- ------- -------\n"
           );
 
     do {
@@ -203,7 +205,7 @@ main(
            perror(*argv);
            continue;
        }
-       printf("%-30.30s %7ld %7ld %7ld %6ld %6ld %6ld\n", *argv,
+       printf("%-28.28s %8ld %8ld %8ld %7ld %7ld %7ld\n", *argv,
               statbuf.total, statbuf.free, statbuf.avail,
               statbuf.files, statbuf.ffree, statbuf.favail);
     } while(argc > 1);
diff --git a/common-src/strcasecmp.c b/common-src/strcasecmp.c
deleted file mode 100644 (file)
index ac5f79f..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Provided by Michael Schmitz <mschmitz@sema.de>; public domain? */
-#include "amanda.h"
-
-/* Compare S1 and S2 ignoring case, returning less than,
-   equal to or greater than zero if S1 is lexicographically
-   less than, equal to or greater than S2.  */
-int
-strcasecmp(
-    const char *s1,
-    const char *s2)
-{
-  register const unsigned char *p1 = (const unsigned char *) s1;
-  register const unsigned char *p2 = (const unsigned char *) s2;
-  unsigned char c1, c2;
-
-  if (p1 == p2)
-    return 0;
-
-  do {
-      c1 = tolower (*p1++);
-      c2 = tolower (*p2++);
-      if (c1 == '\0' || c2 == '\0' || c1 != c2)
-        return c1 - c2;
-  } while ( 1 == 1 );
-}
index 8ec116f6eebdf34907b0637740c50737ebd3ca86..b7925e9a8b697504eb6f91d694fc3f6e3ca62a82 100644 (file)
@@ -25,7 +25,7 @@
  *                        University of Maryland at College Park
  */
 /*
- * $Id: stream.c,v 1.39.2.1 2006/12/12 14:56:38 martinea Exp $
+ * $Id: stream.c,v 1.39 2006/08/24 01:57:15 paddy_s Exp $
  *
  * functions for managing stream sockets
  */
@@ -33,6 +33,8 @@
 #include "dgram.h"
 #include "stream.h"
 #include "util.h"
+#include "conffile.h"
+#include "security-util.h"
 
 /* local functions */
 static void try_socksize(int sock, int which, size_t size);
@@ -53,14 +55,26 @@ stream_server(
     const int on = 1;
     int r;
 #endif
-    struct sockaddr_in server;
+    struct sockaddr_storage server;
     int save_errno;
+    int *portrange;
+    socklen_t socklen;
+    int socket_family;
 
     *portp = USHRT_MAX;                                /* in case we error exit */
-    if((server_socket = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
+    socket_family = AF_NATIVE;
+    server_socket = socket(AF_NATIVE, SOCK_STREAM, 0);
+#ifdef WORKING_IPV6
+    /* if that address family actually isn't supported, just try AF_INET */
+    if (server_socket == -1 && errno == EAFNOSUPPORT) {
+       socket_family = AF_INET;
+       server_socket = socket(AF_INET, SOCK_STREAM, 0);
+    }
+#endif
+    if (server_socket == -1) {
        save_errno = errno;
        dbprintf(("%s: stream_server: socket() failed: %s\n",
-                 debug_prefix(NULL),
+                 debug_prefix_time(NULL),
                  strerror(save_errno)));
        errno = save_errno;
        return -1;
@@ -70,21 +84,21 @@ stream_server(
        errno = EMFILE;                         /* out of range */
        save_errno = errno;
        dbprintf(("%s: stream_server: socket out of range: %d\n",
-                 debug_prefix(NULL),
+                 debug_prefix_time(NULL),
                  server_socket));
        errno = save_errno;
        return -1;
     }
-    memset(&server, 0, SIZEOF(server));
-    server.sin_family = (sa_family_t)AF_INET;
-    server.sin_addr.s_addr = INADDR_ANY;
+
+    SS_INIT(&server, socket_family);
+    SS_SET_INADDR_ANY(&server);
 
 #ifdef USE_REUSEADDR
     r = setsockopt(server_socket, SOL_SOCKET, SO_REUSEADDR,
        (void *)&on, (socklen_t)sizeof(on));
     if (r < 0) {
        dbprintf(("%s: stream_server: setsockopt(SO_REUSEADDR) failed: %s\n",
-                 debug_prefix(NULL),
+                 debug_prefix_time(NULL),
                  strerror(errno)));
     }
 #endif
@@ -104,39 +118,38 @@ stream_server(
      * is within the range it requires.
      */
     for (retries = 0; ; retries++) {
-#ifdef TCPPORTRANGE
-       if (bind_portrange(server_socket, &server, TCPPORTRANGE, "tcp") == 0)
-           goto out;
-       dbprintf(("%s: stream_server: Could not bind to port in range: %d - %d.\n",
-                 debug_prefix(NULL), TCPPORTRANGE));
-#endif
+       if (priv) {
+           portrange = getconf_intrange(CNF_RESERVED_TCP_PORT);
+       } else {
+           portrange = getconf_intrange(CNF_UNRESERVED_TCP_PORT);
+       }
 
-       if(priv) {
-           if (bind_portrange(server_socket, &server,
-                          (in_port_t)512, (in_port_t)(IPPORT_RESERVED - 1), "tcp") == 0)
+       if (portrange[0] != 0 && portrange[1] != 0) {
+           if (bind_portrange(server_socket, &server, (in_port_t)portrange[0],
+                              (in_port_t)portrange[1], "tcp") == 0)
                goto out;
-           dbprintf(("%s: stream_server: Could not bind to port in range 512 - %d.\n",
-                     debug_prefix(NULL), IPPORT_RESERVED - 1));
+           dbprintf(("%s: stream_server: Could not bind to port in range: %d - %d.\n",
+                     debug_prefix_time(NULL), portrange[0], portrange[1]));
+       } else {
+           socklen = SS_LEN(&server);
+           if (bind(server_socket, (struct sockaddr *)&server, socklen) == 0)
+               goto out;
+           dbprintf(("%s: stream_server: Could not bind to any port: %s\n",
+                     debug_prefix_time(NULL), strerror(errno)));
        }
 
-       server.sin_port = INADDR_ANY;
-       if (bind(server_socket, (struct sockaddr *)&server, (socklen_t)sizeof(server)) == 0)
-           goto out;
-       dbprintf(("%s: stream_server: Could not bind to any port: %s\n",
-                 debug_prefix(NULL), strerror(errno)));
-
        if (retries >= BIND_CYCLE_RETRIES)
            break;
 
        dbprintf(("%s: stream_server: Retrying entire range after 10 second delay.\n",
-                 debug_prefix(NULL)));
+                 debug_prefix_time(NULL)));
 
        sleep(15);
     }
 
     save_errno = errno;
-    dbprintf(("%s: stream_server: bind(INADDR_ANY) failed: %s\n",
-                 debug_prefix(NULL),
+    dbprintf(("%s: stream_server: bind(in6addr_any) failed: %s\n",
+                 debug_prefix_time(NULL),
                  strerror(save_errno)));
     aclose(server_socket);
     errno = save_errno;
@@ -151,7 +164,7 @@ out:
     if(getsockname(server_socket, (struct sockaddr *)&server, &len) == -1) {
        save_errno = errno;
        dbprintf(("%s: stream_server: getsockname() failed: %s\n",
-                 debug_prefix(NULL),
+                 debug_prefix_time(NULL),
                  strerror(save_errno)));
        aclose(server_socket);
        errno = save_errno;
@@ -164,7 +177,7 @@ out:
     if(r == -1) {
        save_errno = errno;
        dbprintf(("%s: stream_server: setsockopt(SO_KEEPALIVE) failed: %s\n",
-                 debug_prefix(NULL),
+                 debug_prefix_time(NULL),
                  strerror(save_errno)));
         aclose(server_socket);
        errno = save_errno;
@@ -172,11 +185,10 @@ out:
     }
 #endif
 
-    *portp = (in_port_t)ntohs(server.sin_port);
-    dbprintf(("%s: stream_server: waiting for connection: %s.%d\n",
+    *portp = SS_GET_PORT(&server);
+    dbprintf(("%s: stream_server: waiting for connection: %s\n",
              debug_prefix_time(NULL),
-             inet_ntoa(server.sin_addr),
-             *portp));
+             str_sockaddr(&server)));
     return server_socket;
 }
 
@@ -190,33 +202,49 @@ stream_client_internal(
     int nonblock,
     int priv)
 {
-    struct sockaddr_in svaddr, claddr;
-    struct hostent *hostp;
+    struct sockaddr_storage svaddr, claddr;
     int save_errno;
     char *f;
     int client_socket;
+    int *portrange;
+    int result;
+    struct addrinfo hints;
+    struct addrinfo *res = NULL;
 
     f = priv ? "stream_client_privileged" : "stream_client";
 
-    if((hostp = gethostbyname(hostname)) == NULL) {
-       save_errno = EHOSTUNREACH;
-       dbprintf(("%s: %s: gethostbyname(%s) failed\n",
-                 debug_prefix(NULL),
-                 f,
-                 hostname));
-       errno = save_errno;
+#ifdef WORKING_IPV6
+    hints.ai_flags = AI_CANONNAME | AI_V4MAPPED | AI_ALL;
+    hints.ai_family = (sa_family_t)AF_UNSPEC;
+#else
+    hints.ai_flags = AI_CANONNAME;
+    hints.ai_family = (sa_family_t)AF_INET;
+#endif
+    hints.ai_socktype = SOCK_DGRAM;
+    hints.ai_protocol = IPPROTO_UDP;
+    hints.ai_addrlen = 0;
+    hints.ai_addr = NULL;
+    hints.ai_canonname = NULL;
+    hints.ai_next = NULL;
+    result = getaddrinfo(hostname, NULL, &hints, &res);
+#ifdef WORKING_IPV6
+    if(result != 0) {
+       hints.ai_flags = AI_CANONNAME;
+       hints.ai_family = AF_UNSPEC;
+       result = getaddrinfo(hostname, NULL, &hints, &res);
+    }
+#endif
+    if(result != 0) {
+        dbprintf(("getaddrinfo: %s\n", gai_strerror(result)));
        return -1;
     }
 
-    memset(&svaddr, 0, SIZEOF(svaddr));
-    svaddr.sin_family = (sa_family_t)AF_INET;
-    svaddr.sin_port = (in_port_t)htons(port);
-    memcpy(&svaddr.sin_addr, hostp->h_addr, (size_t)hostp->h_length);
-
+    memcpy(&svaddr, res->ai_addr, (size_t)res->ai_addrlen);
+    freeaddrinfo(res);
+    SS_SET_PORT(&svaddr, port);
 
-    memset(&claddr, 0, SIZEOF(claddr));
-    claddr.sin_family = (sa_family_t)AF_INET;
-    claddr.sin_addr.s_addr = INADDR_ANY;
+    SS_INIT(&claddr, svaddr.ss_family);
+    SS_SET_INADDR_ANY(&claddr);
 
     /*
      * If a privileged port range was requested, we try to get a port in
@@ -229,49 +257,21 @@ stream_client_internal(
      * is within the range it requires.
      */
     if (priv) {
-#ifdef LOW_TCPPORTRANGE
-       client_socket = connect_portrange(&claddr, LOW_TCPPORTRANGE,
-                                          "tcp", &svaddr, nonblock);
-#else
-       client_socket = connect_portrange(&claddr, (socklen_t)512,
-                                         (socklen_t)(IPPORT_RESERVED - 1),
-                                          "tcp", &svaddr, nonblock);
-#endif
-                                         
-       if (client_socket > 0)
-           goto out;
-
-#ifdef LOW_TCPPORTRANGE
-       dbprintf((
-               "%s: stream_client: Could not bind to port in range %d-%d.\n",
-               debug_prefix(NULL), LOW_TCPPORTRANGE));
-#else
-       dbprintf((
-               "%s: stream_client: Could not bind to port in range 512-%d.\n",
-               debug_prefix(NULL), IPPORT_RESERVED - 1));
-#endif
+       portrange = getconf_intrange(CNF_RESERVED_TCP_PORT);
+    } else {
+       portrange = getconf_intrange(CNF_UNRESERVED_TCP_PORT);
     }
-
-#ifdef TCPPORTRANGE
-    client_socket = connect_portrange(&claddr, TCPPORTRANGE,
+    client_socket = connect_portrange(&claddr, (in_port_t)portrange[0],
+                                     (in_port_t)portrange[1],
                                       "tcp", &svaddr, nonblock);
-    if(client_socket > 0)
+    save_errno = errno;
+                                         
+    if (client_socket > 0)
        goto out;
 
-    dbprintf(("%s: stream_client: Could not bind to port in range %d - %d.\n",
-             debug_prefix(NULL), TCPPORTRANGE));
-#endif
-
-    client_socket = connect_portrange(&claddr, (socklen_t)(IPPORT_RESERVED+1),
-                                     (socklen_t)(65535),
-                                      "tcp", &svaddr, nonblock);
-
-    if(client_socket > 0)
-       goto out;
+    dbprintf(("%s: stream_client: Could not bind to port in range %d-%d.\n",
+             debug_prefix_time(NULL), portrange[0], portrange[1]));
 
-    save_errno = errno;
-    dbprintf(("%s: stream_client: Could not bind to any port: %s\n",
-             debug_prefix(NULL), strerror(save_errno)));
     errno = save_errno;
     return -1;
 
@@ -279,7 +279,7 @@ out:
     try_socksize(client_socket, SO_SNDBUF, sendsize);
     try_socksize(client_socket, SO_RCVBUF, recvsize);
     if (localport != NULL)
-       *localport = (in_port_t)ntohs(claddr.sin_port);
+       *localport = SS_GET_PORT(&claddr);
     return client_socket;
 }
 
@@ -320,7 +320,7 @@ stream_client(
 }
 
 /* don't care about these values */
-static struct sockaddr_in addr;
+static struct sockaddr_storage addr;
 static socklen_t addrlen;
 
 int
@@ -335,6 +335,7 @@ stream_accept(
     int nfound, connected_socket;
     int save_errno;
     int ntries = 0;
+    in_port_t port;
 
     assert(server_socket >= 0);
 
@@ -380,37 +381,48 @@ stream_accept(
     } while (nfound <= 0);
 
     while(1) {
-       addrlen = (socklen_t)sizeof(struct sockaddr);
+       addrlen = (socklen_t)sizeof(struct sockaddr_storage);
        connected_socket = accept(server_socket,
                                  (struct sockaddr *)&addr,
                                  &addrlen);
        if(connected_socket < 0) {
            break;
        }
-       dbprintf(("%s: stream_accept: connection from %s.%d\n",
+       dbprintf(("%s: stream_accept: connection from %s\n",
                  debug_prefix_time(NULL),
-                 inet_ntoa(addr.sin_addr),
-                 ntohs(addr.sin_port)));
+                 str_sockaddr(&addr)));
        /*
         * Make certain we got an inet connection and that it is not
         * from port 20 (a favorite unauthorized entry tool).
         */
-       if((addr.sin_family == (sa_family_t)AF_INET)
-         && (ntohs(addr.sin_port) != (in_port_t)20)) {
-           try_socksize(connected_socket, SO_SNDBUF, sendsize);
-           try_socksize(connected_socket, SO_RCVBUF, recvsize);
-           return connected_socket;
-       }
-       if(addr.sin_family != (sa_family_t)AF_INET) {
-           dbprintf(("%s: family is %d instead of %d(AF_INET): ignored\n",
+       if (addr.ss_family == (sa_family_t)AF_INET
+#ifdef WORKING_IPV6
+           || addr.ss_family == (sa_family_t)AF_INET6
+#endif
+           ){
+           port = SS_GET_PORT(&addr);
+           if (port != (in_port_t)20) {
+               try_socksize(connected_socket, SO_SNDBUF, sendsize);
+               try_socksize(connected_socket, SO_RCVBUF, recvsize);
+               return connected_socket;
+           } else {
+               dbprintf(("%s: remote port is %u: ignored\n",
+                         debug_prefix_time(NULL), (unsigned int)port));
+           }
+       } else {
+#ifdef WORKING_IPV6
+           dbprintf(("%s: family is %d instead of %d(AF_INET)"
+                     " or %d(AF_INET6): ignored\n",
                      debug_prefix_time(NULL),
-                     addr.sin_family,
-                     AF_INET));
-       }
-       if(ntohs(addr.sin_port) == 20) {
-           dbprintf(("%s: remote port is %d: ignored\n",
+                     addr.ss_family,
+                     AF_INET, AF_INET6));
+#else
+           dbprintf(("%s: family is %d instead of %d(AF_INET)"
+                     ": ignored\n",
                      debug_prefix_time(NULL),
-                     ntohs(addr.sin_port)));
+                     addr.ss_family,
+                     AF_INET));
+#endif
        }
        aclose(connected_socket);
     }
@@ -430,25 +442,27 @@ try_socksize(
     size_t size)
 {
     size_t origsize;
+    int    isize;
 
     if (size == 0)
        return;
 
     origsize = size;
+    isize = size;
     /* keep trying, get as big a buffer as possible */
-    while((size > 1024) &&
+    while((isize > 1024) &&
          (setsockopt(sock, SOL_SOCKET,
-                     which, (void *) &size, (socklen_t)sizeof(int)) < 0)) {
-       size -= 1024;
+                     which, (void *) &isize, (socklen_t)sizeof(isize)) < 0)) {
+       isize -= 1024;
     }
-    if(size > 1024) {
-       dbprintf(("%s: try_socksize: %s buffer size is %zu\n",
-                 debug_prefix(NULL),
+    if(isize > 1024) {
+       dbprintf(("%s: try_socksize: %s buffer size is %d\n",
+                 debug_prefix_time(NULL),
                  (which == SO_SNDBUF) ? "send" : "receive",
-                 size));
+                 isize));
     } else {
-       dbprintf(("%s: try_socksize: could not allocate %s buffer of %zu\n",
-                 debug_prefix(NULL),
+       dbprintf(("%s: try_socksize: could not allocate %s buffer of " SIZE_T_FMT "\n",
+                 debug_prefix_time(NULL),
                  (which == SO_SNDBUF) ? "send" : "receive",
                  origsize));
     }
diff --git a/common-src/strerror.c b/common-src/strerror.c
deleted file mode 100644 (file)
index 2ec138c..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are permitted
- * provided that the above copyright notice and this paragraph are
- * duplicated in all such forms and that any documentation,
- * advertising materials, and other materials related to such
- * distribution and use acknowledge that the software was developed
- * by the University of California, Berkeley.  The name of the
- * University may not be used to endorse or promote products derived
- * from this software without specific prior written permission.
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- */
-
-/* $Id: strerror.c,v 1.7 2006/05/25 01:47:12 johnfranks Exp $ */
-
-#include "amanda.h"
-
-#define        UPREFIX "Unknown error: %u"
-
-/*
- * Return the error message corresponding to some error number.
- */
-char *
-strerror(e)
-    int e;
-{
-    extern int sys_nerr;
-    extern char *sys_errlist[];
-    unsigned int errnum;
-    static char buf[NUM_STR_SIZE + SIZEOF(UPREFIX) + 1];
-
-    errnum = e;                /* convert to unsigned */
-
-    if (errnum < sys_nerr)
-       return (sys_errlist[errnum]);
-    snprintf(buf, SIZEOF(buf), UPREFIX, errnum);
-    return (buf);
-}
diff --git a/common-src/strftime.c b/common-src/strftime.c
deleted file mode 100644 (file)
index c180985..0000000
+++ /dev/null
@@ -1,253 +0,0 @@
-/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms are permitted
- * provided that: (1) source distributions retain this entire copyright
- * notice and comment, and (2) distributions including binaries display
- * the following acknowledgement:  ``This product includes software
- * developed by the University of California, Berkeley and its contributors''
- * in the documentation or other materials provided with the distribution
- * and in all advertising materials mentioning features or use of this
- * software. Neither the name of the University nor the names of its
- * contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)strftime.c 5.8 (Berkeley) 6/1/90";
-#endif /* LIBC_SCCS and not lint */
-
-#include "amanda.h"
-#include <tzfile.h>
-
-static char *afmt[] = {
-       "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat",
-};
-static char *Afmt[] = {
-       "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday",
-       "Saturday",
-};
-static char *bfmt[] = {
-       "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep",
-       "Oct", "Nov", "Dec",
-};
-static char *Bfmt[] = {
-       "January", "February", "March", "April", "May", "June", "July",
-       "August", "September", "October", "November", "December",
-};
-
-static size_t gsize;
-static char *pt;
-
-size_t
-strftime(s, maxsize, format, t)
-       char *s;
-       char *format;
-       size_t maxsize;
-       struct tm *t;
-{
-       size_t _fmt();
-
-       pt = s;
-       if ((gsize = maxsize) < 1)
-               return(0);
-       if (_fmt(format, t)) {
-               *pt = '\0';
-               return(maxsize - gsize);
-       }
-       return(0);
-}
-
-static size_t
-_fmt(format, t)
-       register char *format;
-       struct tm *t;
-{
-       for (; *format; ++format) {
-               if (*format == '%')
-                       switch(*++format) {
-                       case '\0':
-                               --format;
-                               break;
-                       case 'A':
-                               if (t->tm_wday < 0 || t->tm_wday > 6)
-                                       return(0);
-                               if (!_add(Afmt[t->tm_wday]))
-                                       return(0);
-                               continue;
-                       case 'a':
-                               if (t->tm_wday < 0 || t->tm_wday > 6)
-                                       return(0);
-                               if (!_add(afmt[t->tm_wday]))
-                                       return(0);
-                               continue;
-                       case 'B':
-                               if (t->tm_mon < 0 || t->tm_mon > 11)
-                                       return(0);
-                               if (!_add(Bfmt[t->tm_mon]))
-                                       return(0);
-                               continue;
-                       case 'b':
-                       case 'h':
-                               if (t->tm_mon < 0 || t->tm_mon > 11)
-                                       return(0);
-                               if (!_add(bfmt[t->tm_mon]))
-                                       return(0);
-                               continue;
-                       case 'C':
-                               if (!_fmt("%a %b %e %H:%M:%S %Y", t))
-                                       return(0);
-                               continue;
-                       case 'c':
-                               if (!_fmt("%m/%d/%y %H:%M:%S", t))
-                                       return(0);
-                               continue;
-                       case 'e':
-                               if (!_conv(t->tm_mday, 2, ' '))
-                                       return(0);
-                               continue;
-                       case 'D':
-                               if (!_fmt("%m/%d/%y", t))
-                                       return(0);
-                               continue;
-                       case 'd':
-                               if (!_conv(t->tm_mday, 2, '0'))
-                                       return(0);
-                               continue;
-                       case 'H':
-                               if (!_conv(t->tm_hour, 2, '0'))
-                                       return(0);
-                               continue;
-                       case 'I':
-                               if (!_conv(t->tm_hour % 12 ?
-                                   t->tm_hour % 12 : 12, 2, '0'))
-                                       return(0);
-                               continue;
-                       case 'j':
-                               if (!_conv(t->tm_yday + 1, 3, '0'))
-                                       return(0);
-                               continue;
-                       case 'k':
-                               if (!_conv(t->tm_hour, 2, ' '))
-                                       return(0);
-                               continue;
-                       case 'l':
-                               if (!_conv(t->tm_hour % 12 ?
-                                   t->tm_hour % 12 : 12, 2, ' '))
-                                       return(0);
-                               continue;
-                       case 'M':
-                               if (!_conv(t->tm_min, 2, '0'))
-                                       return(0);
-                               continue;
-                       case 'm':
-                               if (!_conv(t->tm_mon + 1, 2, '0'))
-                                       return(0);
-                               continue;
-                       case 'n':
-                               if (!_add("\n"))
-                                       return(0);
-                               continue;
-                       case 'p':
-                               if (!_add(t->tm_hour >= 12 ? "PM" : "AM"))
-                                       return(0);
-                               continue;
-                       case 'R':
-                               if (!_fmt("%H:%M", t))
-                                       return(0);
-                               continue;
-                       case 'r':
-                               if (!_fmt("%I:%M:%S %p", t))
-                                       return(0);
-                               continue;
-                       case 'S':
-                               if (!_conv(t->tm_sec, 2, '0'))
-                                       return(0);
-                               continue;
-                       case 'T':
-                       case 'X':
-                               if (!_fmt("%H:%M:%S", t))
-                                       return(0);
-                               continue;
-                       case 't':
-                               if (!_add("\t"))
-                                       return(0);
-                               continue;
-                       case 'U':
-                               if (!_conv((t->tm_yday + 7 - t->tm_wday) / 7,
-                                   2, '0'))
-                                       return(0);
-                               continue;
-                       case 'W':
-                               if (!_conv((t->tm_yday + 7 -
-                                   (t->tm_wday ? (t->tm_wday - 1) : 6))
-                                   / 7, 2, '0'))
-                                       return(0);
-                               continue;
-                       case 'w':
-                               if (!_conv(t->tm_wday, 1, '0'))
-                                       return(0);
-                               continue;
-                       case 'x':
-                               if (!_fmt("%m/%d/%y", t))
-                                       return(0);
-                               continue;
-                       case 'y':
-                               if (!_conv((t->tm_year + TM_YEAR_BASE)
-                                   % 100, 2, '0'))
-                                       return(0);
-                               continue;
-                       case 'Y':
-                               if (!_conv(t->tm_year + TM_YEAR_BASE, 4, '0'))
-                                       return(0);
-                               continue;
-                       case 'Z':
-                               if (!t->tm_zone || !_add(t->tm_zone))
-                                       return(0);
-                               continue;
-                       case '%':
-                       /*
-                        * X311J/88-090 (4.12.3.5): if conversion char is
-                        * undefined, behavior is undefined.  Print out the
-                        * character itself as printf(3) does.
-                        */
-                       default:
-                               break;
-               }
-               if (!gsize--)
-                       return(0);
-               *pt++ = *format;
-       }
-       return(gsize);
-}
-
-static
-_conv(n, digits, pad)
-       int n, digits;
-       char pad;
-{
-       static char buf[10];
-       register char *p;
-
-       for (p = buf + SIZEOF(buf) - 2; n > 0 && p > buf; n /= 10, --digits)
-               *p-- = n % 10 + '0';
-       while (p > buf && digits-- > 0)
-               *p-- = pad;
-       return(_add(++p));
-}
-
-static
-_add(str)
-       register char *str;
-{
-       for (;; ++pt, --gsize) {
-               if (!gsize)
-                       return(0);
-               if (!(*pt = *str++))
-                       return(1);
-       }
-}
diff --git a/common-src/strncasecmp.c b/common-src/strncasecmp.c
deleted file mode 100644 (file)
index 655746b..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-#include "amanda.h"
-
-/*
- * The following function compares the first 'n' characters in 's1'
- * and 's2' without considering case. It returns less than, equal to
- * or greater than zero if 's1' is lexicographically less than, equal
- * to or greater than 's2'.
- */
-
-int
-strncasecmp(s1, s2, n)
-      const char *s1;
-      const char *s2;
-      size_t n;
-{
-  unsigned char c1, c2;
-
-  if ( (s1 == s2 ) || (n == 0) ) 
-  {
-      /*
-       * the arguments are identical or there are no characters to be
-       * compared
-       */
-      return 0;
-  }
-
-  while (n > 0)
-  {
-      c1 = (unsigned char)tolower(*s1++);
-      c2 = (unsigned char)tolower(*s2++);
-
-      if (c1 != c2)
-      {
-         return(c1 - c2);
-      }
-
-      n--;
-  }
-
-  return(0);
-}
diff --git a/common-src/strstr.c b/common-src/strstr.c
deleted file mode 100644 (file)
index b3de11d..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Amanda, The Advanced Maryland Automatic Network Disk Archiver
- * Copyright (c) 1991-1998 University of Maryland at College Park
- * All Rights Reserved.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of U.M. not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission.  U.M. makes no representations about the
- * suitability of this software for any purpose.  It is provided "as is"
- * without express or implied warranty.
- *
- * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Author: James da Silva, Systems Design and Analysis Group
- *                        Computer Science Department
- *                        University of Maryland at College Park
- */
-/*
- * $Id: strstr.c,v 1.5 2002/02/11 01:32:10 jrjackson Exp $
- *
- * replacement for missing ANSI-C strstr function
- */
-#include "amanda.h"
-
-char *strstr(a, b)
-char *a, *b;
-{
-        size_t alen, blen, i;
-
-        alen = strlen(a);
-        blen = strlen(b);
-
-        for(i=0; i <= alen-blen; i++, a++)
-            if(strncmp(a, b, blen) == 0) return a;
-
-        return NULL;
-}
index 194db84287c5ce5ddc74db72fdeb581e00a85278..8a47596e30c207903a26e7152892e3625f97325f 100644 (file)
@@ -113,7 +113,6 @@ append_to_tapelist(
                amfree(cur_tape->files);
                cur_tape->files = newfiles;
            }
-           dump_tapelist(tapelist);
            return(tapelist);
        }
     }
@@ -139,7 +138,6 @@ append_to_tapelist(
        cur_tape->next = new_tape;
     }
 
-    dump_tapelist(tapelist);
     return(tapelist);
 }
 
index d168b6f1c3143a7956f24c347baf01bcb23a1232..bb27cfac0618d1af986bd06eae9a231d61111a0e 100644 (file)
@@ -24,7 +24,7 @@
  * file named AUTHORS, in the root directory of this distribution.
  */
 /*
- * $Id: util.c,v 1.42.2.13 2007/01/24 18:33:29 martinea Exp $
+ * $Id: util.c,v 1.42 2006/08/24 01:57:15 paddy_s Exp $
  */
 
 #include "amanda.h"
 #include "arglist.h"
 #include "clock.h"
 
-int allow_overwrites;
-int token_pushed;
-
-tok_t tok, pushed_tok;
-val_t tokenval;
-keytab_t *keytable;
-
-int conf_line_num, got_parserror;
-FILE *conf_conf = (FILE *)NULL;
-char *conf_confname = NULL;
-char *conf_line = NULL;
-char *conf_char = NULL;
-
 /*#define NET_READ_DEBUG*/
 
 #ifdef NET_READ_DEBUG
@@ -53,12 +40,9 @@ char *conf_char = NULL;
 #define netprintf(x)
 #endif
 
-static int make_socket(void);
-static int connect_port(struct sockaddr_in *addrp, in_port_t port, char *proto,
-                       struct sockaddr_in *svaddr, int nonblock);
-
-int conftoken_getc(void);
-int conftoken_ungetc(int c);
+static int make_socket(sa_family_t family);
+static int connect_port(struct sockaddr_storage *addrp, in_port_t port, char *proto,
+                       struct sockaddr_storage *svaddr, int nonblock);
 
 /*
  * Keep calling read() until we've read buflen's worth of data, or EOF,
@@ -123,7 +107,8 @@ fullwrite(
 }
 
 static int
-make_socket(void)
+make_socket(
+    sa_family_t family)
 {
     int s;
     int save_errno;
@@ -132,10 +117,11 @@ make_socket(void)
     int r;
 #endif
 
-    if ((s = socket(AF_INET, SOCK_STREAM, 0)) == -1) {
+    s = socket(family, SOCK_STREAM, 0);
+    if (s == -1) {
         save_errno = errno;
         dbprintf(("%s: make_socket: socket() failed: %s\n",
-                  debug_prefix(NULL),
+                  debug_prefix_time(NULL),
                   strerror(save_errno)));
         errno = save_errno;
         return -1;
@@ -151,7 +137,7 @@ make_socket(void)
     if (r < 0) {
        save_errno = errno;
        dbprintf(("%s: stream_server: setsockopt(SO_REUSEADDR) failed: %s\n",
-                 debug_prefix(NULL),
+                 debug_prefix_time(NULL),
                  strerror(errno)));
        errno = save_errno;
     }
@@ -163,7 +149,7 @@ make_socket(void)
     if (r == -1) {
        save_errno = errno;
        dbprintf(("%s: make_socket: setsockopt() failed: %s\n",
-                  debug_prefix(NULL),
+                  debug_prefix_time(NULL),
                   strerror(save_errno)));
        aclose(s);
        errno = save_errno;
@@ -180,11 +166,11 @@ make_socket(void)
 /* return -1     on failure */
 int
 connect_portrange(
-    struct sockaddr_in *addrp,
+    struct sockaddr_storage *addrp,
     in_port_t          first_port,
     in_port_t          last_port,
     char *             proto,
-    struct sockaddr_in *svaddr,
+    struct sockaddr_storage *svaddr,
     int                        nonblock)
 {
     int                        s;
@@ -194,7 +180,6 @@ connect_portrange(
     int                        i;
 
     assert(first_port <= last_port);
-
     /* Try a port already used */
     for(i=0; i < nb_port_in_use; i++) {
        port = port_in_use[i];
@@ -232,15 +217,16 @@ connect_portrange(
 /* return >0: this is the connected socket */
 int
 connect_port(
-    struct sockaddr_in *addrp,
+    struct sockaddr_storage *addrp,
     in_port_t                  port,
     char *             proto,
-    struct sockaddr_in *svaddr,
+    struct sockaddr_storage *svaddr,
     int                        nonblock)
 {
     int                        save_errno;
     struct servent *   servPort;
     socklen_t          len;
+    socklen_t          socklen;
     int                        s;
 
     servPort = getservbyport((int)htons(port), proto);
@@ -258,11 +244,11 @@ connect_port(
                  debug_prefix_time(NULL), port, servPort->s_name));
     }
 
-    if ((s = make_socket()) == -1) return -2;
+    if ((s = make_socket(addrp->ss_family)) == -1) return -2;
 
-    addrp->sin_port = (in_port_t)htons(port);
-
-    if (bind(s, (struct sockaddr *)addrp, sizeof(*addrp)) != 0) {
+    SS_SET_PORT(addrp, port);
+    socklen = SS_LEN(addrp);
+    if (bind(s, (struct sockaddr *)addrp, socklen) != 0) {
        save_errno = errno;
        aclose(s);
        if (save_errno != EADDRINUSE) {
@@ -281,7 +267,7 @@ connect_port(
     if (getsockname(s, (struct sockaddr *)addrp, &len) == -1) {
        save_errno = errno;
        dbprintf(("%s: connect_port: getsockname() failed: %s\n",
-                 debug_prefix(NULL),
+                 debug_prefix_time(NULL),
                  strerror(save_errno)));
        aclose(s);
        errno = save_errno;
@@ -290,18 +276,15 @@ connect_port(
 
     if (nonblock)
        fcntl(s, F_SETFL, fcntl(s, F_GETFL, 0)|O_NONBLOCK);
-    if (connect(s, (struct sockaddr *)svaddr,
-               (socklen_t)sizeof(*svaddr)) == -1 && !nonblock) {
+    if (connect(s, (struct sockaddr *)svaddr, SS_LEN(svaddr)) == -1 && !nonblock) {
        save_errno = errno;
-       dbprintf(("%s: connect_portrange: connect from %s.%d failed: %s\n",
+       dbprintf(("%s: connect_portrange: connect from %s failed: %s\n",
                  debug_prefix_time(NULL),
-                 inet_ntoa(addrp->sin_addr),
-                 ntohs(addrp->sin_port),
+                 str_sockaddr(addrp),
                  strerror(save_errno)));
-       dbprintf(("%s: connect_portrange: connect to %s.%d failed: %s\n",
+       dbprintf(("%s: connect_portrange: connect to %s failed: %s\n",
                  debug_prefix_time(NULL),
-                 inet_ntoa(svaddr->sin_addr),
-                 ntohs(svaddr->sin_port),
+                 str_sockaddr(svaddr),
                  strerror(save_errno)));
        aclose(s);
        errno = save_errno;
@@ -314,14 +297,12 @@ connect_port(
        return -1;
     }
 
-    dbprintf(("%s: connected to %s.%d\n",
+    dbprintf(("%s: connected to %s\n",
               debug_prefix_time(NULL),
-              inet_ntoa(svaddr->sin_addr),
-              ntohs(svaddr->sin_port)));
-    dbprintf(("%s: our side is %s.%d\n",
-              debug_prefix(NULL),
-              inet_ntoa(addrp->sin_addr),
-              ntohs(addrp->sin_port)));
+              str_sockaddr(svaddr)));
+    dbprintf(("%s: our side is %s\n",
+              debug_prefix_time(NULL),
+              str_sockaddr(addrp)));
     return s;
 }
 
@@ -335,13 +316,14 @@ connect_port(
 int
 bind_portrange(
     int                        s,
-    struct sockaddr_in *addrp,
+    struct sockaddr_storage *addrp,
     in_port_t          first_port,
     in_port_t          last_port,
     char *             proto)
 {
     in_port_t port;
     in_port_t cnt;
+    socklen_t socklen;
     struct servent *servPort;
     const in_port_t num_ports = (in_port_t)(last_port - first_port + 1);
 
@@ -368,8 +350,9 @@ bind_portrange(
                dbprintf(("%s: bind_portrange2: Try  port %d: Owned by %s - ",
                      debug_prefix_time(NULL), port, servPort->s_name));
            }
-           addrp->sin_port = (in_port_t)htons(port);
-           if (bind(s, (struct sockaddr *)addrp, (socklen_t)sizeof(*addrp)) >= 0) {
+           SS_SET_PORT(addrp, port);
+           socklen = SS_LEN(addrp);
+           if (bind(s, (struct sockaddr *)addrp, socklen) >= 0) {
                dbprintf(("Success\n"));
                return 0;
            }
@@ -607,14 +590,14 @@ hexdump(
 {
     ssize_t rc = -1;
 
-    FILE *stream = popen("od -w10 -c -x -", "w");
+    FILE *stream = popen("od -c -x -", "w");
        
     if (stream != NULL) {
        fflush(stdout);
        rc = (ssize_t)fwrite(buffer, len, 1, stream);
        if (ferror(stream))
            rc = -1;
-       fclose(stream);
+       pclose(stream);
     }
     return rc;
 }
@@ -633,2074 +616,137 @@ validate_mailto(
 }
 
 
-t_conf_var *
-get_np(
-    t_conf_var *get_var,
-    int        parm)
-{
-    t_conf_var *np;
-
-    for(np = get_var; np->token != CONF_UNKNOWN; np++) {
-       if(np->parm == parm)
-           break;
-    }
-
-    if(np->token == CONF_UNKNOWN) {
-       error("error [unknown getconf_np parm: %d]", parm);
-       /* NOTREACHED */
-    }
-    return np;
-}
-
 void
-get_simple(
-    val_t  *var,
-    tok_t  type)
-{
-    ckseen(&var->seen);
-
-    switch(type) {
-    case CONF_STRING:
-    case CONF_IDENT:
-       get_conftoken(type);
-       var->v.s = newstralloc(var->v.s, tokenval.v.s);
-       malloc_mark(var->v.s);
-       break;
-
-    case CONF_INT:
-       var->v.i = get_int();
-       break;
-
-    case CONF_LONG:
-       var->v.l = get_long();
-       break;
-
-    case CONF_SIZE:
-       var->v.size = get_size();
-       break;
-
-    case CONF_AM64:
-       var->v.am64 = get_am64_t();
-       break;
-
-    case CONF_BOOL:
-       var->v.i = get_bool();
-       break;
-
-    case CONF_REAL:
-       get_conftoken(CONF_REAL);
-       var->v.r = tokenval.v.r;
-       break;
-
-    case CONF_TIME:
-       var->v.t = get_time();
-       break;
-
-    default:
-       error("error [unknown get_simple type: %d]", type);
-       /* NOTREACHED */
-    }
-    return;
-}
-
-time_t
-get_time(void)
-{
-    time_t hhmm;
-
-    get_conftoken(CONF_ANY);
-    switch(tok) {
-    case CONF_INT:
-#if SIZEOF_TIME_T < SIZEOF_INT
-       if ((off_t)tokenval.v.i >= (off_t)TIME_MAX)
-           conf_parserror("value too large");
-#endif
-       hhmm = (time_t)tokenval.v.i;
-       break;
-
-    case CONF_LONG:
-#if SIZEOF_TIME_T < SIZEOF_LONG
-       if ((off_t)tokenval.v.l >= (off_t)TIME_MAX)
-           conf_parserror("value too large");
-#endif
-       hhmm = (time_t)tokenval.v.l;
-       break;
-
-    case CONF_SIZE:
-#if SIZEOF_TIME_T < SIZEOF_SSIZE_T
-       if ((off_t)tokenval.v.size >= (off_t)TIME_MAX)
-           conf_parserror("value too large");
-#endif
-       hhmm = (time_t)tokenval.v.size;
-       break;
-
-    case CONF_AM64:
-#if SIZEOF_TIME_T < SIZEOF_LONG_LONG
-       if ((off_t)tokenval.v.am64 >= (off_t)TIME_MAX)
-           conf_parserror("value too large");
-#endif
-       hhmm = (time_t)tokenval.v.am64;
-       break;
-
-    case CONF_AMINFINITY:
-       hhmm = TIME_MAX;
-       break;
-
-    default:
-       conf_parserror("a time is expected");
-       hhmm = 0;
-       break;
-    }
-    return hhmm;
-}
-
-keytab_t numb_keytable[] = {
-    { "B", CONF_MULT1 },
-    { "BPS", CONF_MULT1 },
-    { "BYTE", CONF_MULT1 },
-    { "BYTES", CONF_MULT1 },
-    { "DAY", CONF_MULT1 },
-    { "DAYS", CONF_MULT1 },
-    { "INF", CONF_AMINFINITY },
-    { "K", CONF_MULT1K },
-    { "KB", CONF_MULT1K },
-    { "KBPS", CONF_MULT1K },
-    { "KBYTE", CONF_MULT1K },
-    { "KBYTES", CONF_MULT1K },
-    { "KILOBYTE", CONF_MULT1K },
-    { "KILOBYTES", CONF_MULT1K },
-    { "KPS", CONF_MULT1K },
-    { "M", CONF_MULT1M },
-    { "MB", CONF_MULT1M },
-    { "MBPS", CONF_MULT1M },
-    { "MBYTE", CONF_MULT1M },
-    { "MBYTES", CONF_MULT1M },
-    { "MEG", CONF_MULT1M },
-    { "MEGABYTE", CONF_MULT1M },
-    { "MEGABYTES", CONF_MULT1M },
-    { "G", CONF_MULT1G },
-    { "GB", CONF_MULT1G },
-    { "GBPS", CONF_MULT1G },
-    { "GBYTE", CONF_MULT1G },
-    { "GBYTES", CONF_MULT1G },
-    { "GIG", CONF_MULT1G },
-    { "GIGABYTE", CONF_MULT1G },
-    { "GIGABYTES", CONF_MULT1G },
-    { "MPS", CONF_MULT1M },
-    { "TAPE", CONF_MULT1 },
-    { "TAPES", CONF_MULT1 },
-    { "WEEK", CONF_MULT7 },
-    { "WEEKS", CONF_MULT7 },
-    { NULL, CONF_IDENT }
-};
-
-int
-get_int(void)
+dump_sockaddr(
+    struct sockaddr_storage *sa)
 {
-    int val;
-    keytab_t *save_kt;
-
-    save_kt = keytable;
-    keytable = numb_keytable;
-
-    get_conftoken(CONF_ANY);
-    switch(tok) {
-    case CONF_INT:
-       val = tokenval.v.i;
-       break;
-
-    case CONF_LONG:
-#if SIZEOF_INT < SIZEOF_LONG
-       if ((off_t)tokenval.v.l > (off_t)INT_MAX)
-           conf_parserror("value too large");
-       if ((off_t)tokenval.v.l < (off_t)INT_MIN)
-           conf_parserror("value too small");
-#endif
-       val = (int)tokenval.v.l;
-       break;
-
-    case CONF_SIZE:
-#if SIZEOF_INT < SIZEOF_SSIZE_T
-       if ((off_t)tokenval.v.size > (off_t)INT_MAX)
-           conf_parserror("value too large");
-       if ((off_t)tokenval.v.size < (off_t)INT_MIN)
-           conf_parserror("value too small");
+#ifdef WORKING_IPV6
+    char ipstr[INET6_ADDRSTRLEN];
+#else
+    char ipstr[INET_ADDRSTRLEN];
 #endif
-       val = (int)tokenval.v.size;
-       break;
-
-    case CONF_AM64:
-#if SIZEOF_INT < SIZEOF_LONG_LONG
-       if (tokenval.v.am64 > (off_t)INT_MAX)
-           conf_parserror("value too large");
-       if (tokenval.v.am64 < (off_t)INT_MIN)
-           conf_parserror("value too small");
+    int port;
+
+    port = SS_GET_PORT(sa);
+#ifdef WORKING_IPV6
+    if ( sa->ss_family == (sa_family_t)AF_INET6) {
+       inet_ntop(AF_INET6, &((struct sockaddr_in6 *)sa)->sin6_addr,
+                 ipstr, sizeof(ipstr));
+       dbprintf(("%s: (sockaddr_in6 *)%p = { %d, %d, %s }\n",
+                 debug_prefix_time(NULL), sa,
+                 ((struct sockaddr_in6 *)sa)->sin6_family,
+                 port,
+                 ipstr));
+    } else
 #endif
-       val = (int)tokenval.v.am64;
-       break;
-
-    case CONF_AMINFINITY:
-       val = INT_MAX;
-       break;
-
-    default:
-       conf_parserror("an int is expected");
-       val = 0;
-       break;
-    }
-
-    /* get multiplier, if any */
-    get_conftoken(CONF_ANY);
-    switch(tok) {
-    case CONF_NL:                      /* multiply by one */
-    case CONF_END:
-    case CONF_MULT1:
-    case CONF_MULT1K:
-       break;
-
-    case CONF_MULT7:
-       if (val > (INT_MAX / 7))
-           conf_parserror("value too large");
-       if (val < (INT_MIN / 7))
-           conf_parserror("value too small");
-       val *= 7;
-       break;
-
-    case CONF_MULT1M:
-       if (val > (INT_MAX / 1024))
-           conf_parserror("value too large");
-       if (val < (INT_MIN / 1024))
-           conf_parserror("value too small");
-       val *= 1024;
-       break;
-
-    case CONF_MULT1G:
-       if (val > (INT_MAX / (1024 * 1024)))
-           conf_parserror("value too large");
-       if (val < (INT_MIN / (1024 * 1024)))
-           conf_parserror("value too small");
-       val *= 1024 * 1024;
-       break;
-
-    default:   /* it was not a multiplier */
-       unget_conftoken();
-       break;
+    {
+       inet_ntop(AF_INET, &((struct sockaddr_in *)sa)->sin_addr, ipstr,
+                 sizeof(ipstr));
+       dbprintf(("%s: (sockaddr_in *)%p = { %d, %d, %s }\n",
+                 debug_prefix_time(NULL), sa,
+                 ((struct sockaddr_in *)sa)->sin_family,
+                 port,
+                 ipstr));
     }
-
-    keytable = save_kt;
-    return val;
 }
 
-long
-get_long(void)
-{
-    long val;
-    keytab_t *save_kt;
-
-    save_kt = keytable;
-    keytable = numb_keytable;
-
-    get_conftoken(CONF_ANY);
 
-    switch(tok) {
-    case CONF_LONG:
-       val = tokenval.v.l;
-       break;
-
-    case CONF_INT:
-#if SIZEOF_LONG < SIZEOF_INT
-       if ((off_t)tokenval.v.i > (off_t)LONG_MAX)
-           conf_parserror("value too large");
-       if ((off_t)tokenval.v.i < (off_t)LONG_MIN)
-           conf_parserror("value too small");
-#endif
-       val = (long)tokenval.v.i;
-       break;
-
-    case CONF_SIZE:
-#if SIZEOF_LONG < SIZEOF_SSIZE_T
-       if ((off_t)tokenval.v.size > (off_t)LONG_MAX)
-           conf_parserror("value too large");
-       if ((off_t)tokenval.v.size < (off_t)LONG_MIN)
-           conf_parserror("value too small");
-#endif
-       val = (long)tokenval.v.size;
-       break;
-
-    case CONF_AM64:
-#if SIZEOF_LONG < SIZEOF_LONG_LONG
-       if (tokenval.v.am64 > (off_t)LONG_MAX)
-           conf_parserror("value too large");
-       if (tokenval.v.am64 < (off_t)LONG_MIN)
-           conf_parserror("value too small");
+#ifdef WORKING_IPV6
+static char mystr_sockaddr[INET6_ADDRSTRLEN + 20];
+#else
+static char mystr_sockaddr[INET_ADDRSTRLEN + 20];
 #endif
-       val = (long)tokenval.v.am64;
-       break;
-
-    case CONF_AMINFINITY:
-       val = (long)LONG_MAX;
-       break;
-
-    default:
-       conf_parserror("a long is expected");
-       val = 0;
-       break;
-    }
-
-    /* get multiplier, if any */
-    get_conftoken(CONF_ANY);
-
-    switch(tok) {
-    case CONF_NL:                      /* multiply by one */
-    case CONF_MULT1:
-    case CONF_MULT1K:
-       break;
-
-    case CONF_MULT7:
-       if (val > (LONG_MAX / 7L))
-           conf_parserror("value too large");
-       if (val < (LONG_MIN / 7L))
-           conf_parserror("value too small");
-       val *= 7L;
-       break;
-
-    case CONF_MULT1M:
-       if (val > (LONG_MAX / 1024L))
-           conf_parserror("value too large");
-       if (val < (LONG_MIN / 1024L))
-           conf_parserror("value too small");
-       val *= 1024L;
-       break;
-
-    case CONF_MULT1G:
-       if (val > (LONG_MAX / (1024L * 1024L)))
-           conf_parserror("value too large");
-       if (val < (LONG_MIN / (1024L * 1024L)))
-           conf_parserror("value too small");
-       val *= 1024L * 1024L;
-       break;
-
-    default:   /* it was not a multiplier */
-       unget_conftoken();
-       break;
-    }
-
-    keytable = save_kt;
-    return val;
-}
 
-ssize_t
-get_size(void)
+char *
+str_sockaddr(
+    struct sockaddr_storage *sa)
 {
-    ssize_t val;
-    keytab_t *save_kt;
-
-    save_kt = keytable;
-    keytable = numb_keytable;
-
-    get_conftoken(CONF_ANY);
-
-    switch(tok) {
-    case CONF_SIZE:
-       val = tokenval.v.size;
-       break;
-
-    case CONF_INT:
-#if SIZEOF_SIZE_T < SIZEOF_INT
-       if ((off_t)tokenval.v.i > (off_t)SSIZE_MAX)
-           conf_parserror("value too large");
-       if ((off_t)tokenval.v.i < (off_t)SSIZE_MIN)
-           conf_parserror("value too small");
-#endif
-       val = (ssize_t)tokenval.v.i;
-       break;
-
-    case CONF_LONG:
-#if SIZEOF_SIZE_T < SIZEOF_LONG
-       if ((off_t)tokenval.v.l > (off_t)SSIZE_MAX)
-           conf_parserror("value too large");
-       if ((off_t)tokenval.v.l < (off_t)SSIZE_MIN)
-           conf_parserror("value too small");
+#ifdef WORKING_IPV6
+    char ipstr[INET6_ADDRSTRLEN];
+#else
+    char ipstr[INET_ADDRSTRLEN];
 #endif
-       val = (ssize_t)tokenval.v.l;
-       break;
-
-    case CONF_AM64:
-#if SIZEOF_SIZE_T < SIZEOF_LONG_LONG
-       if (tokenval.v.am64 > (off_t)SSIZE_MAX)
-           conf_parserror("value too large");
-       if (tokenval.v.am64 < (off_t)SSIZE_MIN)
-           conf_parserror("value too small");
+    int port;
+
+    port = SS_GET_PORT(sa);
+#ifdef WORKING_IPV6
+    if ( sa->ss_family == (sa_family_t)AF_INET6) {
+       inet_ntop(AF_INET6, &((struct sockaddr_in6 *)sa)->sin6_addr,
+                 ipstr, sizeof(ipstr));
+    } else
 #endif
-       val = (ssize_t)tokenval.v.am64;
-       break;
-
-    case CONF_AMINFINITY:
-       val = (ssize_t)SSIZE_MAX;
-       break;
-
-    default:
-       conf_parserror("an integer is expected");
-       val = 0;
-       break;
-    }
-
-    /* get multiplier, if any */
-    get_conftoken(CONF_ANY);
-
-    switch(tok) {
-    case CONF_NL:                      /* multiply by one */
-    case CONF_MULT1:
-    case CONF_MULT1K:
-       break;
-
-    case CONF_MULT7:
-       if (val > (ssize_t)(SSIZE_MAX / 7))
-           conf_parserror("value too large");
-       if (val < (ssize_t)(SSIZE_MIN / 7))
-           conf_parserror("value too small");
-       val *= (ssize_t)7;
-       break;
-
-    case CONF_MULT1M:
-       if (val > (ssize_t)(SSIZE_MAX / (ssize_t)1024))
-           conf_parserror("value too large");
-       if (val < (ssize_t)(SSIZE_MIN / (ssize_t)1024))
-           conf_parserror("value too small");
-       val *= (ssize_t)1024;
-       break;
-
-    case CONF_MULT1G:
-       if (val > (ssize_t)(SSIZE_MAX / (1024 * 1024)))
-           conf_parserror("value too large");
-       if (val < (ssize_t)(SSIZE_MIN / (1024 * 1024)))
-           conf_parserror("value too small");
-       val *= (ssize_t)(1024 * 1024);
-       break;
-
-    default:   /* it was not a multiplier */
-       unget_conftoken();
-       break;
-    }
-
-    keytable = save_kt;
-    return val;
-}
-
-off_t
-get_am64_t(void)
-{
-    off_t val;
-    keytab_t *save_kt;
-
-    save_kt = keytable;
-    keytable = numb_keytable;
-
-    get_conftoken(CONF_ANY);
-
-    switch(tok) {
-    case CONF_INT:
-       val = (off_t)tokenval.v.i;
-       break;
-
-    case CONF_LONG:
-       val = (off_t)tokenval.v.l;
-       break;
-
-    case CONF_SIZE:
-       val = (off_t)tokenval.v.size;
-       break;
-
-    case CONF_AM64:
-       val = tokenval.v.am64;
-       break;
-
-    case CONF_AMINFINITY:
-       val = AM64_MAX;
-       break;
-
-    default:
-       conf_parserror("an am64 is expected %d", tok);
-       val = 0;
-       break;
+    {
+       inet_ntop(AF_INET, &((struct sockaddr_in *)sa)->sin_addr, ipstr,
+                 sizeof(ipstr));
     }
-
-    /* get multiplier, if any */
-    get_conftoken(CONF_ANY);
-
-    switch(tok) {
-    case CONF_NL:                      /* multiply by one */
-    case CONF_MULT1:
-    case CONF_MULT1K:
-       break;
-
-    case CONF_MULT7:
-       if (val > AM64_MAX/7 || val < AM64_MIN/7)
-           conf_parserror("value too large");
-       val *= 7;
-       break;
-
-    case CONF_MULT1M:
-       if (val > AM64_MAX/1024 || val < AM64_MIN/1024)
-           conf_parserror("value too large");
-       val *= 1024;
-       break;
-
-    case CONF_MULT1G:
-       if (val > AM64_MAX/(1024*1024) || val < AM64_MIN/(1024*1024))
-           conf_parserror("value too large");
-       val *= 1024*1024;
-       break;
-
-    default:   /* it was not a multiplier */
-       unget_conftoken();
-       break;
-    }
-
-    keytable = save_kt;
-
-    return val;
+    snprintf(mystr_sockaddr,sizeof(mystr_sockaddr),"%s.%d", ipstr, port);
+    return mystr_sockaddr;
 }
 
-keytab_t bool_keytable[] = {
-    { "Y", CONF_ATRUE },
-    { "YES", CONF_ATRUE },
-    { "T", CONF_ATRUE },
-    { "TRUE", CONF_ATRUE },
-    { "ON", CONF_ATRUE },
-    { "N", CONF_AFALSE },
-    { "NO", CONF_AFALSE },
-    { "F", CONF_AFALSE },
-    { "FALSE", CONF_AFALSE },
-    { "OFF", CONF_AFALSE },
-    { NULL, CONF_IDENT }
-};
 
 int
-get_bool(void)
-{
-    int val;
-    keytab_t *save_kt;
-
-    save_kt = keytable;
-    keytable = bool_keytable;
-
-    get_conftoken(CONF_ANY);
-
-    switch(tok) {
-    case CONF_INT:
-       if (tokenval.v.i != 0)
-           val = 1;
-       else
-           val = 0;
-       break;
-
-    case CONF_LONG:
-       if (tokenval.v.l != 0L)
-           val = 1;
-       else
-           val = 0;
-       break;
-
-    case CONF_SIZE:
-       if (tokenval.v.size != (size_t)0)
-           val = 1;
-       else
-           val = 0;
-       break;
-
-    case CONF_AM64:
-       if (tokenval.v.am64 != (off_t)0)
-           val = 1;
-       else
-           val = 0;
-       break;
-
-    case CONF_ATRUE:
-       val = 1;
-       break;
-
-    case CONF_AFALSE:
-       val = 0;
-       break;
-
-    case CONF_NL:
-       unget_conftoken();
-       val = 2; /* no argument - most likely TRUE */
-       break;
-    default:
-       unget_conftoken();
-       val = 3; /* a bad argument - most likely TRUE */
-       conf_parserror("YES, NO, TRUE, FALSE, ON, OFF expected");
-       break;
-    }
-
-    keytable = save_kt;
-    return val;
-}
-
-void
-ckseen(
-    int *seen)
-{
-    if (*seen && !allow_overwrites && conf_line_num != -2) {
-       conf_parserror("duplicate parameter, prev def on line %d", *seen);
-    }
-    *seen = conf_line_num;
-}
-
-printf_arglist_function(void conf_parserror, const char *, format)
-{
-    va_list argp;
-
-    /* print error message */
-
-    if(conf_line)
-       fprintf(stderr, "argument \"%s\": ", conf_line);
-    else
-       fprintf(stderr, "\"%s\", line %d: ", conf_confname, conf_line_num);
-    arglist_start(argp, format);
-    vfprintf(stderr, format, argp);
-    arglist_end(argp);
-    fputc('\n', stderr);
-
-    got_parserror = 1;
-}
-
-tok_t
-lookup_keyword(
-    char *     str)
-{
-    keytab_t *kwp;
-
-    /* switch to binary search if performance warrants */
-
-    for(kwp = keytable; kwp->keyword != NULL; kwp++) {
-       if (strcasecmp(kwp->keyword, str) == 0) break;
+cmp_sockaddr(
+    struct sockaddr_storage *ss1,
+    struct sockaddr_storage *ss2,
+    int addr_only)
+{
+    /* if addresses are v4mapped, "unmap" them */
+#ifdef WORKING_IPV6
+#ifdef IN6_IS_ADDR_V4MAPPED
+    struct sockaddr_in ss1_v4;
+    struct sockaddr_in ss2_v4;
+
+    if (ss1->ss_family == AF_INET6 &&
+        IN6_IS_ADDR_V4MAPPED(&((struct sockaddr_in6 *)ss1)->sin6_addr)) {
+       memset(&ss1_v4, 0, sizeof(struct sockaddr_in));
+       memcpy(&ss1_v4.sin_addr.s_addr,
+              &(((struct sockaddr_in6 *)ss1)->sin6_addr.s6_addr[12]),
+              sizeof(struct in_addr));
+       ss1_v4.sin_family = AF_INET;
+       SS_SET_PORT((struct sockaddr_storage *)&ss1_v4, SS_GET_PORT(ss1));
+       ss1 = (struct sockaddr_storage *)&ss1_v4;
+    }
+
+    if (ss2->ss_family == AF_INET6 &&
+        IN6_IS_ADDR_V4MAPPED(&((struct sockaddr_in6 *)ss2)->sin6_addr)) {
+       memset(&ss2_v4, 0, sizeof(struct sockaddr_in));
+       memcpy(&ss2_v4.sin_addr.s_addr,
+              &(((struct sockaddr_in6 *)ss2)->sin6_addr.s6_addr[12]),
+              sizeof(struct in_addr));
+       ss2_v4.sin_family = AF_INET;
+       SS_SET_PORT((struct sockaddr_storage *)&ss2_v4, SS_GET_PORT(ss2));
+       ss2 = (struct sockaddr_storage *)&ss2_v4;
     }
-    return kwp->token;
-}
-
-char tkbuf[4096];
-
-/* push the last token back (can only unget ANY tokens) */
-void
-unget_conftoken(void)
-{
-    token_pushed = 1;
-    pushed_tok = tok;
-    tok = CONF_UNKNOWN;
-    return;
-}
-
-int
-conftoken_getc(void)
-{
-    if(conf_line == NULL)
-       return getc(conf_conf);
-    if(*conf_char == '\0')
-       return -1;
-    return(*conf_char++);
-}
+#endif
+#endif
 
-int
-conftoken_ungetc(
-    int c)
-{
-    if(conf_line == NULL)
-       return ungetc(c, conf_conf);
-    else if(conf_char > conf_line) {
-       if(c == -1)
-           return c;
-       conf_char--;
-       if(*conf_char != c) {
-           error("*conf_char != c   : %c %c", *conf_char, c);
-           /* NOTREACHED */
-       }
+    if (ss1->ss_family == ss2->ss_family) {
+        if (addr_only) {
+#ifdef WORKING_IPV6
+            if(ss1->ss_family == (sa_family_t)AF_INET6)
+                return memcmp(
+                    &((struct sockaddr_in6 *)ss1)->sin6_addr,
+                    &((struct sockaddr_in6 *)ss2)->sin6_addr,
+                    sizeof(((struct sockaddr_in6 *)ss1)->sin6_addr));
+            else
+#endif
+                return memcmp(
+                    &((struct sockaddr_in *)ss1)->sin_addr,
+                    &((struct sockaddr_in *)ss2)->sin_addr,
+                    sizeof(((struct sockaddr_in *)ss1)->sin_addr));
+        } else {
+            return memcmp(ss1, ss2, SS_LEN(ss1));
+        }
     } else {
-       error("conf_char == conf_line");
-       /* NOTREACHED */
-    }
-    return c;
-}
-
-void
-get_conftoken(
-    tok_t      exp)
-{
-    int ch, d;
-    off_t am64;
-    char *buf;
-    char *tmps;
-    int token_overflow;
-    int inquote = 0;
-    int escape = 0;
-    int sign;
-
-    if (token_pushed) {
-       token_pushed = 0;
-       tok = pushed_tok;
-
-       /*
-       ** If it looked like a key word before then look it
-       ** up again in the current keyword table.
-       */
-       switch(tok) {
-       case CONF_LONG:    case CONF_AM64:    case CONF_SIZE:
-       case CONF_INT:     case CONF_REAL:    case CONF_STRING:
-       case CONF_LBRACE:  case CONF_RBRACE:  case CONF_COMMA:
-       case CONF_NL:      case CONF_END:     case CONF_UNKNOWN:
-       case CONF_TIME:
-           break;
-
-       default:
-           if (exp == CONF_IDENT)
-               tok = CONF_IDENT;
-           else
-               tok = lookup_keyword(tokenval.v.s);
-           break;
-       }
-    }
-    else {
-       ch = conftoken_getc();
-
-       while(ch != EOF && ch != '\n' && isspace(ch))
-           ch = conftoken_getc();
-       if (ch == '#') {        /* comment - eat everything but eol/eof */
-           while((ch = conftoken_getc()) != EOF && ch != '\n') {
-               (void)ch; /* Quiet empty loop complaints */     
-           }
-       }
-
-       if (isalpha(ch)) {              /* identifier */
-           buf = tkbuf;
-           token_overflow = 0;
-           do {
-               if (buf < tkbuf+sizeof(tkbuf)-1) {
-                   *buf++ = (char)ch;
-               } else {
-                   *buf = '\0';
-                   if (!token_overflow) {
-                       conf_parserror("token too long: %.20s...", tkbuf);
-                   }
-                   token_overflow = 1;
-               }
-               ch = conftoken_getc();
-           } while(isalnum(ch) || ch == '_' || ch == '-');
-
-           if (ch != EOF && conftoken_ungetc(ch) == EOF) {
-               if (ferror(conf_conf)) {
-                   conf_parserror("Pushback of '%c' failed: %s",
-                                  ch, strerror(ferror(conf_conf)));
-               } else {
-                   conf_parserror("Pushback of '%c' failed: EOF", ch);
-               }
-           }
-           *buf = '\0';
-
-           tokenval.v.s = tkbuf;
-
-           if (token_overflow) tok = CONF_UNKNOWN;
-           else if (exp == CONF_IDENT) tok = CONF_IDENT;
-           else tok = lookup_keyword(tokenval.v.s);
-       }
-       else if (isdigit(ch)) { /* integer */
-           sign = 1;
-
-negative_number: /* look for goto negative_number below sign is set there */
-           am64 = 0;
-           do {
-               am64 = am64 * 10 + (ch - '0');
-               ch = conftoken_getc();
-           } while (isdigit(ch));
-
-           if (ch != '.') {
-               if (exp == CONF_INT) {
-                   tok = CONF_INT;
-                   tokenval.v.i = sign * (int)am64;
-               } else if (exp == CONF_LONG) {
-                   tok = CONF_LONG;
-                   tokenval.v.l = (long)sign * (long)am64;
-               } else if (exp != CONF_REAL) {
-                   tok = CONF_AM64;
-                   tokenval.v.am64 = (off_t)sign * am64;
-               } else {
-                   /* automatically convert to real when expected */
-                   tokenval.v.r = (double)sign * (double)am64;
-                   tok = CONF_REAL;
-               }
-           } else {
-               /* got a real number, not an int */
-               tokenval.v.r = sign * (double) am64;
-               am64 = 0;
-               d = 1;
-               ch = conftoken_getc();
-               while (isdigit(ch)) {
-                   am64 = am64 * 10 + (ch - '0');
-                   d = d * 10;
-                   ch = conftoken_getc();
-               }
-               tokenval.v.r += sign * ((double)am64) / d;
-               tok = CONF_REAL;
-           }
-
-           if (ch != EOF &&  conftoken_ungetc(ch) == EOF) {
-               if (ferror(conf_conf)) {
-                   conf_parserror("Pushback of '%c' failed: %s",
-                                  ch, strerror(ferror(conf_conf)));
-               } else {
-                   conf_parserror("Pushback of '%c' failed: EOF", ch);
-               }
-           }
-       } else switch(ch) {
-       case '"':                       /* string */
-           buf = tkbuf;
-           token_overflow = 0;
-           inquote = 1;
-           *buf++ = (char)ch;
-           while (inquote && ((ch = conftoken_getc()) != EOF)) {
-               if (ch == '\n') {
-                   if (!escape)
-                       break;
-                   escape = 0;
-                   buf--; /* Consume escape in buffer */
-               } else if (ch == '\\') {
-                   escape = 1;
-               } else {
-                   if (ch == '"') {
-                       if (!escape)
-                           inquote = 0;
-                   }
-                   escape = 0;
-               }
-
-               if(buf >= &tkbuf[sizeof(tkbuf) - 1]) {
-                   if (!token_overflow) {
-                       conf_parserror("string too long: %.20s...", tkbuf);
-                   }
-                   token_overflow = 1;
-                   break;
-               }
-               *buf++ = (char)ch;
-           }
-           *buf = '\0';
-
-           /*
-            * A little manuver to leave a fully unquoted, unallocated  string
-            * in tokenval.v.s
-            */
-           tmps = unquote_string(tkbuf);
-           strncpy(tkbuf, tmps, sizeof(tkbuf));
-           amfree(tmps);
-           tokenval.v.s = tkbuf;
-
-           tok = (token_overflow) ? CONF_UNKNOWN :
-                       (exp == CONF_IDENT) ? CONF_IDENT : CONF_STRING;
-           break;
-
-       case '-':
-           ch = conftoken_getc();
-           if (isdigit(ch)) {
-               sign = -1;
-               goto negative_number;
-           }
-           else {
-               if (ch != EOF && conftoken_ungetc(ch) == EOF) {
-                   if (ferror(conf_conf)) {
-                       conf_parserror("Pushback of '%c' failed: %s",
-                                      ch, strerror(ferror(conf_conf)));
-                   } else {
-                       conf_parserror("Pushback of '%c' failed: EOF", ch);
-                   }
-               }
-               tok = CONF_UNKNOWN;
-           }
-           break;
-
-       case ',':
-           tok = CONF_COMMA;
-           break;
-
-       case '{':
-           tok = CONF_LBRACE;
-           break;
-
-       case '}':
-           tok = CONF_RBRACE;
-           break;
-
-       case '\n':
-           tok = CONF_NL;
-           break;
-
-       case EOF:
-           tok = CONF_END;
-           break;
-
-       default:
-           tok = CONF_UNKNOWN;
-           break;
-       }
-    }
-
-    if (exp != CONF_ANY && tok != exp) {
-       char *str;
-       keytab_t *kwp;
-
-       switch(exp) {
-       case CONF_LBRACE:
-           str = "\"{\"";
-           break;
-
-       case CONF_RBRACE:
-           str = "\"}\"";
-           break;
-
-       case CONF_COMMA:
-           str = "\",\"";
-           break;
-
-       case CONF_NL:
-           str = "end of line";
-           break;
-
-       case CONF_END:
-           str = "end of file";
-           break;
-
-       case CONF_INT:
-           str = "an integer";
-           break;
-
-       case CONF_REAL:
-           str = "a real number";
-           break;
-
-       case CONF_STRING:
-           str = "a quoted string";
-           break;
-
-       case CONF_IDENT:
-           str = "an identifier";
-           break;
-
-       default:
-           for(kwp = keytable; kwp->keyword != NULL; kwp++) {
-               if (exp == kwp->token)
-                   break;
-           }
-           if (kwp->keyword == NULL)
-               str = "token not";
-           else
-               str = kwp->keyword;
-           break;
-       }
-       conf_parserror("%s is expected", str);
-       tok = exp;
-       if (tok == CONF_INT)
-           tokenval.v.i = 0;
-       else
-           tokenval.v.s = "";
+        /* compare families to give a total order */
+        if (ss1->ss_family < ss2->ss_family)
+            return -1;
+        else
+            return 1;
     }
 }
 
 
-void
-read_string(
-    t_conf_var *np,
-    val_t *val)
-{
-    np = np;
-    ckseen(&val->seen);
-    get_conftoken(CONF_STRING);
-    val->v.s = newstralloc(val->v.s, tokenval.v.s);
-}
-
-void
-read_ident(
-    t_conf_var *np,
-    val_t *val)
-{
-    np = np;
-    ckseen(&val->seen);
-    get_conftoken(CONF_IDENT);
-    val->v.s = newstralloc(val->v.s, tokenval.v.s);
-}
-
-void
-read_int(
-    t_conf_var *np,
-    val_t *val)
-{
-    np = np;
-    ckseen(&val->seen);
-    val->v.i = get_int();
-}
-
-void
-read_long(
-    t_conf_var *np,
-    val_t *val)
-{
-    np = np;
-    ckseen(&val->seen);
-    val->v.l = get_long();
-}
-
-void
-read_size(
-    t_conf_var *np,
-    val_t *val)
-{
-    np = np;
-    ckseen(&val->seen);
-    val->v.size = get_size();
-}
-
-void
-read_am64(
-    t_conf_var *np,
-    val_t *val)
-{
-    np = np;
-    ckseen(&val->seen);
-    val->v.am64 = get_am64_t();
-}
-
-void
-read_bool(
-    t_conf_var *np,
-    val_t *val)
-{
-    np = np;
-    ckseen(&val->seen);
-    val->v.i = get_bool();
-}
-
-void
-read_real(
-    t_conf_var *np,
-    val_t *val)
-{
-    np = np;
-    ckseen(&val->seen);
-    get_conftoken(CONF_REAL);
-    val->v.r = tokenval.v.r;
-}
-
-void
-read_time(
-    t_conf_var *np,
-    val_t *val)
-{
-    np = np;
-    ckseen(&val->seen);
-    val->v.t = get_time();
-}
-
-void
-copy_val_t(
-    val_t *valdst,
-    val_t *valsrc)
-{
-    if(valsrc->seen) {
-       valdst->type = valsrc->type;
-       valdst->seen = valsrc->seen;
-       switch(valsrc->type) {
-       case CONFTYPE_INT:
-       case CONFTYPE_BOOL:
-       case CONFTYPE_COMPRESS:
-       case CONFTYPE_ENCRYPT:
-       case CONFTYPE_HOLDING:
-       case CONFTYPE_ESTIMATE:
-       case CONFTYPE_STRATEGY:
-       case CONFTYPE_TAPERALGO:
-       case CONFTYPE_PRIORITY:
-           valdst->v.i = valsrc->v.i;
-           break;
-
-       case CONFTYPE_LONG:
-           valdst->v.l = valsrc->v.l;
-           break;
-
-       case CONFTYPE_SIZE:
-           valdst->v.size = valsrc->v.size;
-           break;
-
-       case CONFTYPE_AM64:
-           valdst->v.am64 = valsrc->v.am64;
-           break;
-
-       case CONFTYPE_REAL:
-           valdst->v.r = valsrc->v.r;
-           break;
-
-       case CONFTYPE_RATE:
-           valdst->v.rate[0] = valsrc->v.rate[0];
-           valdst->v.rate[1] = valsrc->v.rate[1];
-           break;
-
-       case CONFTYPE_IDENT:
-       case CONFTYPE_STRING:
-           valdst->v.s = stralloc(valsrc->v.s);
-           break;
-
-       case CONFTYPE_TIME:
-           valdst->v.t = valsrc->v.t;
-           break;
-
-       case CONFTYPE_SL:
-           valdst->v.sl = duplicate_sl(valsrc->v.sl);
-           break;
-
-       case CONFTYPE_EXINCLUDE:
-           valdst->v.exinclude.optional = valsrc->v.exinclude.optional;
-           valdst->v.exinclude.sl_list = duplicate_sl(valsrc->v.exinclude.sl_list);
-           valdst->v.exinclude.sl_file = duplicate_sl(valsrc->v.exinclude.sl_file);
-           break;
-       }
-    }
-}
-
-void
-free_val_t(
-    val_t *val)
-{
-    switch(val->type) {
-       case CONFTYPE_INT:
-       case CONFTYPE_BOOL:
-       case CONFTYPE_COMPRESS:
-       case CONFTYPE_ENCRYPT:
-       case CONFTYPE_HOLDING:
-       case CONFTYPE_ESTIMATE:
-       case CONFTYPE_STRATEGY:
-       case CONFTYPE_SIZE:
-       case CONFTYPE_TAPERALGO:
-       case CONFTYPE_PRIORITY:
-       case CONFTYPE_LONG:
-       case CONFTYPE_AM64:
-       case CONFTYPE_REAL:
-       case CONFTYPE_RATE:
-           break;
-
-       case CONFTYPE_IDENT:
-       case CONFTYPE_STRING:
-           amfree(val->v.s);
-           break;
-
-       case CONFTYPE_TIME:
-           break;
-
-       case CONFTYPE_SL:
-           free_sl(val->v.sl);
-           break;
-
-       case CONFTYPE_EXINCLUDE:
-           free_sl(val->v.exinclude.sl_list);
-           free_sl(val->v.exinclude.sl_file);
-           break;
-    }
-    val->seen = 0;
-}
-
-char *
-taperalgo2str(
-    int taperalgo)
-{
-    if(taperalgo == ALGO_FIRST) return "FIRST";
-    if(taperalgo == ALGO_FIRSTFIT) return "FIRSTFIT";
-    if(taperalgo == ALGO_LARGEST) return "LARGEST";
-    if(taperalgo == ALGO_LARGESTFIT) return "LARGESTFIT";
-    if(taperalgo == ALGO_SMALLEST) return "SMALLEST";
-    if(taperalgo == ALGO_LAST) return "LAST";
-    return "UNKNOWN";
-}
-
-static char buffer_conf_print[1025];
-
-char *
-conf_print(
-    val_t *val,
-    int    str_need_quote)
-{
-    buffer_conf_print[0] = '\0';
-    switch(val->type) {
-    case CONFTYPE_INT:
-       snprintf(buffer_conf_print, SIZEOF(buffer_conf_print), "%d", val->v.i);
-       break;
-
-    case CONFTYPE_LONG:
-       snprintf(buffer_conf_print, SIZEOF(buffer_conf_print), "%ld", val->v.l);
-       break;
-
-    case CONFTYPE_SIZE:
-       snprintf(buffer_conf_print, SIZEOF(buffer_conf_print), SSIZE_T_FMT,
-               (SSIZE_T_FMT_TYPE)val->v.size);
-       break;
-
-    case CONFTYPE_AM64:
-       snprintf(buffer_conf_print, SIZEOF(buffer_conf_print), OFF_T_FMT ,
-                (OFF_T_FMT_TYPE)val->v.am64);
-       break;
-
-    case CONFTYPE_REAL:
-       snprintf(buffer_conf_print, SIZEOF(buffer_conf_print), "%0.5f" , val->v.r);
-       break;
-
-    case CONFTYPE_RATE:
-       snprintf(buffer_conf_print, SIZEOF(buffer_conf_print), "%0.5f %0.5f" , val->v.rate[0], val->v.rate[1]);
-       break;
-
-    case CONFTYPE_IDENT:
-       if(val->v.s) {
-           strncpy(buffer_conf_print, val->v.s, SIZEOF(buffer_conf_print));
-           buffer_conf_print[SIZEOF(buffer_conf_print) - 1] = '\0';
-       } else
-           buffer_conf_print[0] = '\0';
-       break;
-
-    case CONFTYPE_STRING:
-       if(str_need_quote) {
-           buffer_conf_print[0] = '"';
-           if(val->v.s) {
-               strncpy(&buffer_conf_print[1], val->v.s,
-                       SIZEOF(buffer_conf_print) - 1);
-               buffer_conf_print[SIZEOF(buffer_conf_print) - 2] = '\0';
-               buffer_conf_print[strlen(buffer_conf_print)] = '"';
-           } else {
-               buffer_conf_print[1] = '"';
-               buffer_conf_print[2] = '\0';
-           }
-       } else {
-           if(val->v.s) {
-               strncpy(&buffer_conf_print[0], val->v.s,
-                       SIZEOF(buffer_conf_print));
-               buffer_conf_print[SIZEOF(buffer_conf_print) - 1] = '\0';
-           } else {
-               buffer_conf_print[0] = '\0';
-           }
-       }
-       break;
-
-    case CONFTYPE_TIME:
-       snprintf(buffer_conf_print, SIZEOF(buffer_conf_print),
-                "%2d%02d", (int)val->v.t/100, (int)val->v.t % 100);
-       break;
-
-    case CONFTYPE_SL:
-       buffer_conf_print[0] = '\0';
-       break;
-
-    case CONFTYPE_EXINCLUDE:
-       strcpy(buffer_conf_print, "ERROR: use print_conf_exinclude");
-       break;
-
-    case CONFTYPE_BOOL:
-       if(val->v.i)
-           strncpy(buffer_conf_print, "yes", SIZEOF(buffer_conf_print));
-       else
-           strncpy(buffer_conf_print, "no", SIZEOF(buffer_conf_print));
-       break;
-
-    case CONFTYPE_STRATEGY:
-       switch(val->v.i) {
-       case DS_SKIP:
-           strncpy(buffer_conf_print, "SKIP", SIZEOF(buffer_conf_print));
-           break;
-
-       case DS_STANDARD:
-           strncpy(buffer_conf_print, "STANDARD", SIZEOF(buffer_conf_print));
-           break;
-
-       case DS_NOFULL:
-           strncpy(buffer_conf_print, "NOFULL", SIZEOF(buffer_conf_print));
-           break;
-
-       case DS_NOINC:
-           strncpy(buffer_conf_print, "NOINC", SIZEOF(buffer_conf_print));
-           break;
-
-       case DS_HANOI:
-           strncpy(buffer_conf_print, "HANOI", SIZEOF(buffer_conf_print));
-           break;
-
-       case DS_INCRONLY:
-           strncpy(buffer_conf_print, "INCRONLY", SIZEOF(buffer_conf_print));
-           break;
-       }
-       break;
-
-    case CONFTYPE_COMPRESS:
-       switch(val->v.i) {
-       case COMP_NONE:
-           strncpy(buffer_conf_print, "NONE", SIZEOF(buffer_conf_print));
-           break;
-
-       case COMP_FAST:
-           strncpy(buffer_conf_print, "CLIENT FAST", SIZEOF(buffer_conf_print));
-           break;
-
-       case COMP_BEST:
-           strncpy(buffer_conf_print, "CLIENT BEST", SIZEOF(buffer_conf_print));
-           break;
-
-       case COMP_CUST:
-           strncpy(buffer_conf_print, "CLIENT CUSTOM", SIZEOF(buffer_conf_print));
-           break;
-
-       case COMP_SERV_FAST:
-           strncpy(buffer_conf_print, "SERVER FAST", SIZEOF(buffer_conf_print));
-           break;
-
-       case COMP_SERV_BEST:
-           strncpy(buffer_conf_print, "SERVER FAST", SIZEOF(buffer_conf_print));
-           break;
-
-       case COMP_SERV_CUST:
-           strncpy(buffer_conf_print, "SERVER CUSTOM", SIZEOF(buffer_conf_print));
-           break;
-       }
-       break;
-
-    case CONFTYPE_ESTIMATE:
-       switch(val->v.i) {
-       case ES_CLIENT:
-           strncpy(buffer_conf_print, "CLIENT", SIZEOF(buffer_conf_print));
-           break;
-
-       case ES_SERVER:
-           strncpy(buffer_conf_print, "SERVER", SIZEOF(buffer_conf_print));
-           break;
-
-       case ES_CALCSIZE:
-           strncpy(buffer_conf_print, "CALCSIZE", SIZEOF(buffer_conf_print));
-           break;
-       }
-       break;
-
-     case CONFTYPE_ENCRYPT:
-       switch(val->v.i) {
-       case ENCRYPT_NONE:
-           strncpy(buffer_conf_print, "NONE", SIZEOF(buffer_conf_print));
-           break;
-
-       case ENCRYPT_CUST:
-           strncpy(buffer_conf_print, "CLIENT", SIZEOF(buffer_conf_print));
-           break;
-
-       case ENCRYPT_SERV_CUST:
-           strncpy(buffer_conf_print, "SERVER", SIZEOF(buffer_conf_print));
-           break;
-       }
-       break;
-
-     case CONFTYPE_HOLDING:
-       switch(val->v.i) {
-       case HOLD_NEVER:
-           strncpy(buffer_conf_print, "NEVER", SIZEOF(buffer_conf_print));
-           break;
-
-       case HOLD_AUTO:
-           strncpy(buffer_conf_print, "AUTO", SIZEOF(buffer_conf_print));
-           break;
-
-       case HOLD_REQUIRED:
-           strncpy(buffer_conf_print, "REQUIRED", SIZEOF(buffer_conf_print));
-           break;
-       }
-       break;
-
-     case CONFTYPE_TAPERALGO:
-       strncpy(buffer_conf_print, taperalgo2str(val->v.i), SIZEOF(buffer_conf_print));
-       break;
-
-     case CONFTYPE_PRIORITY:
-       switch(val->v.i) {
-       case 0:
-           strncpy(buffer_conf_print, "LOW", SIZEOF(buffer_conf_print));
-           break;
-
-       case 1:
-           strncpy(buffer_conf_print, "MEDIUM", SIZEOF(buffer_conf_print));
-           break;
-
-       case 2:
-           strncpy(buffer_conf_print, "HIGH", SIZEOF(buffer_conf_print));
-           break;
-       }
-       break;
-    }
-    buffer_conf_print[SIZEOF(buffer_conf_print) - 1] = '\0';
-    return buffer_conf_print;
-}
-
-char *
-conf_print_exinclude(
-    val_t *val,
-    int    str_need_quote,
-    int    file)
-{
-    int    pos;
-    sl_t  *sl;
-    sle_t *excl;
-
-    (void)str_need_quote;
-    buffer_conf_print[0] = '\0';
-    if (val->type != CONFTYPE_EXINCLUDE) {
-       strcpy(buffer_conf_print, "ERROR: conf_print_exinclude called for type != CONFTYPE_EXINCLUDE");
-       return buffer_conf_print;
-    }
-
-    if (file == 0) {
-       sl = val->v.exinclude.sl_list;
-       strncpy(buffer_conf_print, "LIST ", SIZEOF(buffer_conf_print));
-       pos = 5;
-    } else {
-       sl = val->v.exinclude.sl_file;
-       strncpy(buffer_conf_print, "FILE ", SIZEOF(buffer_conf_print));
-       pos = 5;
-    }
-
-    if(val->v.exinclude.optional == 1) {
-       strncpy(&buffer_conf_print[pos], "OPTIONAL ", SIZEOF(buffer_conf_print)-pos);
-       pos += 9;
-    }
-
-    if( sl != NULL) {
-       for(excl = sl->first; excl != NULL; excl = excl->next) {
-           if (pos + 3 + strlen(excl->name) < SIZEOF(buffer_conf_print)) {
-               buffer_conf_print[pos++] = ' ';
-               buffer_conf_print[pos++] = '"';
-               strcpy(&buffer_conf_print[pos], excl->name);
-               pos += strlen(excl->name);
-               buffer_conf_print[pos++] = '"';
-           }
-       }
-    }
-
-    buffer_conf_print[SIZEOF(buffer_conf_print) - 1] = '\0';
-    return buffer_conf_print;
-}
-
-void
-conf_init_string(
-    val_t *val,
-    char  *s)
-{
-    val->seen = 0;
-    val->type = CONFTYPE_STRING;
-    if(s)
-       val->v.s = stralloc(s);
-    else
-       val->v.s = NULL;
-}
-
-void
-conf_init_ident(
-    val_t *val,
-    char  *s)
-{
-    val->seen = 0;
-    val->type = CONFTYPE_IDENT;
-    if(s)
-       val->v.s = stralloc(s);
-    else
-       val->v.s = NULL;
-}
-
-void
-conf_init_int(
-    val_t *val,
-    int    i)
-{
-    val->seen = 0;
-    val->type = CONFTYPE_INT;
-    val->v.i = i;
-}
-
-void
-conf_init_bool(
-    val_t *val,
-    int    i)
-{
-    val->seen = 0;
-    val->type = CONFTYPE_BOOL;
-    val->v.i = i;
-}
-
-void
-conf_init_strategy(
-    val_t *val,
-    int    i)
-{
-    val->seen = 0;
-    val->type = CONFTYPE_STRATEGY;
-    val->v.i = i;
-}
-
-void
-conf_init_estimate(
-    val_t *val,
-    int    i)
-{
-    val->seen = 0;
-    val->type = CONFTYPE_ESTIMATE;
-    val->v.i = i;
-}
-
-void
-conf_init_taperalgo(
-    val_t *val,
-    int    i)
-{
-    val->seen = 0;
-    val->type = CONFTYPE_TAPERALGO;
-    val->v.i = i;
-}
-
-void
-conf_init_priority(
-    val_t *val,
-    int    i)
-{
-    val->seen = 0;
-    val->type = CONFTYPE_PRIORITY;
-    val->v.i = i;
-}
-
-void
-conf_init_compress(
-    val_t *val,
-    comp_t    i)
-{
-    val->seen = 0;
-    val->type = CONFTYPE_COMPRESS;
-    val->v.i = (int)i;
-}
-
-void
-conf_init_encrypt(
-    val_t *val,
-    encrypt_t    i)
-{
-    val->seen = 0;
-    val->type = CONFTYPE_ENCRYPT;
-    val->v.i = (int)i;
-}
-
-void
-conf_init_holding(
-    val_t              *val,
-    dump_holdingdisk_t  i)
-{
-    val->seen = 0;
-    val->type = CONFTYPE_HOLDING;
-    val->v.i = (int)i;
-}
-
-void
-conf_init_long(
-    val_t *val,
-    long   l)
-{
-    val->seen = 0;
-    val->type = CONFTYPE_LONG;
-    val->v.l = l;
-}
-
-void
-conf_init_size(
-    val_t *val,
-    ssize_t   sz)
-{
-    val->seen = 0;
-    val->type = CONFTYPE_SIZE;
-    val->v.size = sz;
-}
-
-void
-conf_init_am64(
-    val_t *val,
-    off_t   l)
-{
-    val->seen = 0;
-    val->type = CONFTYPE_AM64;
-    val->v.am64 = l;
-}
-
-void
-conf_init_real(
-    val_t  *val,
-    double r)
-{
-    val->seen = 0;
-    val->type = CONFTYPE_REAL;
-    val->v.r = r;
-}
-
-void
-conf_init_rate(
-    val_t  *val,
-    double r1,
-    double r2)
-{
-    val->seen = 0;
-    val->type = CONFTYPE_RATE;
-    val->v.rate[0] = r1;
-    val->v.rate[1] = r2;
-}
-
-void
-conf_init_time(
-    val_t *val,
-    time_t   t)
-{
-    val->seen = 0;
-    val->type = CONFTYPE_TIME;
-    val->v.t = t;
-}
-
-void
-conf_init_sl(
-    val_t *val,
-    sl_t  *sl)
-{
-    val->seen = 0;
-    val->type = CONFTYPE_AM64;
-    val->v.sl = sl;
-}
-
-void
-conf_init_exinclude(
-    val_t *val)
-{
-    val->seen = 0;
-    val->type = CONFTYPE_EXINCLUDE;
-    val->v.exinclude.optional = 0;
-    val->v.exinclude.sl_list = NULL;
-    val->v.exinclude.sl_file = NULL;
-}
-
-void
-conf_set_string(
-    val_t *val,
-    char *s)
-{
-    val->seen = -1;
-    val->type = CONFTYPE_STRING;
-    amfree(val->v.s);
-    val->v.s = stralloc(s);
-}
-
-void
-conf_set_int(
-    val_t *val,
-    int    i)
-{
-    val->seen = -1;
-    val->type = CONFTYPE_INT;
-    val->v.i = i;
-}
-
-void
-conf_set_bool(
-    val_t *val,
-    int    i)
-{
-    val->seen = -1;
-    val->type = CONFTYPE_BOOL;
-    val->v.i = i;
-}
-
-void
-conf_set_compress(
-    val_t *val,
-    comp_t    i)
-{
-    val->seen = -1;
-    val->type = CONFTYPE_COMPRESS;
-    val->v.i = (int)i;
-}
-
-void
-conf_set_encrypt(
-    val_t *val,
-    encrypt_t    i)
-{
-    val->seen = -1;
-    val->type = CONFTYPE_COMPRESS;
-    val->v.i = (int)i;
-}
-
-void
-conf_set_holding(
-    val_t              *val,
-    dump_holdingdisk_t  i)
-{
-    val->seen = -1;
-    val->type = CONFTYPE_HOLDING;
-    val->v.i = (int)i;
-}
-
-void
-conf_set_strategy(
-    val_t *val,
-    int    i)
-{
-    val->seen = -1;
-    val->type = CONFTYPE_STRATEGY;
-    val->v.i = i;
-}
-
-
-int
-get_conftype_int(
-    val_t *val)
-{
-    if (val->type != CONFTYPE_INT) {
-       error("get_conftype_int: val.type is not CONFTYPE_INT");
-       /*NOTREACHED*/
-    }
-    return val->v.i;
-}
-
-long
-get_conftype_long(
-    val_t *val)
-{
-    if (val->type != CONFTYPE_LONG) {
-       error("get_conftype_long: val.type is not CONFTYPE_LONG");
-       /*NOTREACHED*/
-    }
-    return val->v.l;
-}
-
-off_t
-get_conftype_am64(
-    val_t *val)
-{
-    if (val->type != CONFTYPE_AM64) {
-       error("get_conftype_am64: val.type is not CONFTYPE_AM64");
-       /*NOTREACHED*/
-    }
-    return val->v.am64;
-}
-
-double
-get_conftype_real(
-    val_t *val)
-{
-    if (val->type != CONFTYPE_REAL) {
-       error("get_conftype_real: val.type is not CONFTYPE_REAL");
-       /*NOTREACHED*/
-    }
-    return val->v.r;
-}
-
-char *
-get_conftype_string(
-    val_t *val)
-{
-    if (val->type != CONFTYPE_STRING) {
-       error("get_conftype_string: val.type is not CONFTYPE_STRING");
-       /*NOTREACHED*/
-    }
-    return val->v.s;
-}
-
-char *
-get_conftype_ident(
-    val_t *val)
-{
-    if (val->type != CONFTYPE_IDENT) {
-       error("get_conftype_ident: val.type is not CONFTYPE_IDENT");
-       /*NOTREACHED*/
-    }
-    return val->v.s;
-}
-
-time_t
-get_conftype_time(
-    val_t *val)
-{
-    if (val->type != CONFTYPE_TIME) {
-       error("get_conftype_time: val.type is not CONFTYPE_TIME");
-       /*NOTREACHED*/
-    }
-    return val->v.t;
-}
-
-ssize_t
-get_conftype_size(
-    val_t *val)
-{
-    if (val->type != CONFTYPE_SIZE) {
-       error("get_conftype_size: val.type is not CONFTYPE_SIZE");
-       /*NOTREACHED*/
-    }
-    return val->v.size;
-}
-
-sl_t *
-get_conftype_sl(
-    val_t *val)
-{
-    if (val->type != CONFTYPE_SL) {
-       error("get_conftype_size: val.type is not CONFTYPE_SL");
-       /*NOTREACHED*/
-    }
-    return val->v.sl;
-}
-
-int
-get_conftype_bool(
-    val_t *val)
-{
-    if (val->type != CONFTYPE_BOOL) {
-       error("get_conftype_bool: val.type is not CONFTYPE_BOOL");
-       /*NOTREACHED*/
-    }
-    return val->v.i;
-}
-
-int
-get_conftype_hold(
-    val_t *val)
-{
-    if (val->type != CONFTYPE_HOLDING) {
-       error("get_conftype_hold: val.type is not CONFTYPE_HOLDING");
-       /*NOTREACHED*/
-    }
-    return val->v.i;
-}
-
-int
-get_conftype_compress(
-    val_t *val)
-{
-    if (val->type != CONFTYPE_COMPRESS) {
-       error("get_conftype_compress: val.type is not CONFTYPE_COMPRESS");
-       /*NOTREACHED*/
-    }
-    return val->v.i;
-}
-
-int
-get_conftype_encrypt(
-    val_t *val)
-{
-    if (val->type != CONFTYPE_ENCRYPT) {
-       error("get_conftype_encrypt: val.type is not CONFTYPE_ENCRYPT");
-       /*NOTREACHED*/
-    }
-    return val->v.i;
-}
-
-int
-get_conftype_estimate(
-    val_t *val)
-{
-    if (val->type != CONFTYPE_ESTIMATE) {
-       error("get_conftype_extimate: val.type is not CONFTYPE_ESTIMATE");
-       /*NOTREACHED*/
-    }
-    return val->v.i;
-}
-
-int
-get_conftype_strategy(
-    val_t *val)
-{
-    if (val->type != CONFTYPE_STRATEGY) {
-       error("get_conftype_strategy: val.type is not CONFTYPE_STRATEGY");
-       /*NOTREACHED*/
-    }
-    return val->v.i;
-}
-
-int
-get_conftype_taperalgo(
-    val_t *val)
-{
-    if (val->type != CONFTYPE_TAPERALGO) {
-       error("get_conftype_taperalgo: val.type is not CONFTYPE_TAPERALGO");
-       /*NOTREACHED*/
-    }
-    return val->v.i;
-}
-
-int
-get_conftype_priority(
-    val_t *val)
-{
-    if (val->type != CONFTYPE_PRIORITY) {
-       error("get_conftype_priority: val.type is not CONFTYPE_PRIORITY");
-       /*NOTREACHED*/
-    }
-    return val->v.i;
-}
-
-exinclude_t
-get_conftype_exinclude(
-    val_t *val)
-{
-    if (val->type != CONFTYPE_EXINCLUDE) {
-       error("get_conftype_exinclude: val.type is not CONFTYPE_EXINCLUDE");
-       /*NOTREACHED*/
-    }
-    return val->v.exinclude;
-}
-
-
-void
-dump_sockaddr(
-       struct sockaddr_in *    sa)
-{
-       dbprintf(("%s: (sockaddr_in *)%p = { %d, %d, %s }\n",
-               debug_prefix_time(NULL), sa, sa->sin_family,
-               (int)ntohs(sa->sin_port),
-               inet_ntoa(sa->sin_addr)));
-}
-
-void
-read_block(
-    command_option_t *command_options,
-    t_conf_var    *read_var,
-    keytab_t *keytab,
-    val_t    *valarray,
-    char     *prefix,
-    char     *errormsg,
-    int       read_brace,
-    void      (*copy_function)(void))
-{
-    t_conf_var *np;
-    int    saved_conf_line_num;
-    int    done;
-
-    if(read_brace) {
-       get_conftoken(CONF_LBRACE);
-       get_conftoken(CONF_NL);
-    }
-
-    done = 0;
-    do {
-       conf_line_num += 1;
-       get_conftoken(CONF_ANY);
-       switch(tok) {
-       case CONF_RBRACE:
-           done = 1;
-           break;
-       case CONF_NL:   /* empty line */
-           break;
-       case CONF_END:  /* end of file */
-           done = 1;
-           break;
-        case CONF_IDENT:
-        case CONF_STRING:
-           if(copy_function) 
-               copy_function();
-           else
-               conf_parserror("ident not expected");
-           break;
-       default:
-           {
-               for(np = read_var; np->token != CONF_UNKNOWN; np++)
-                   if(np->token == tok) break;
-
-               if(np->token == CONF_UNKNOWN)
-                   conf_parserror(errormsg);
-               else {
-                   np->read_function(np, &valarray[np->parm]);
-                   if(np->validate)
-                       np->validate(np, &valarray[np->parm]);
-               }
-           }
-       }
-       if(tok != CONF_NL && tok != CONF_END && tok != CONF_RBRACE)
-           get_conftoken(CONF_NL);
-    } while(!done);
-
-    /* overwrite with command line option */
-    saved_conf_line_num = conf_line_num;
-    command_overwrite(command_options, read_var, keytab, valarray, prefix);
-    conf_line_num = saved_conf_line_num;
-}
-
-void
-command_overwrite(
-    command_option_t *command_options,
-    t_conf_var    *overwrite_var,
-    keytab_t *keytab,
-    val_t    *valarray,
-    char     *prefix)
-{
-    t_conf_var      *np;
-    keytab_t        *kt;
-    char            *myprefix;
-    command_option_t *command_option;
-    int                      duplicate;
-
-    if(!command_options) return;
-
-    for(np = overwrite_var; np->token != CONF_UNKNOWN; np++) {
-       for(kt = keytab; kt->token != CONF_UNKNOWN; kt++)
-           if(kt->token == np->token) break;
-
-       if(kt->token == CONF_UNKNOWN) {
-           error("read_conf: invalid token");
-           /* NOTREACHED */
-       }
-
-       for(command_option = command_options; command_option->name != NULL;
-                                                           command_option++) {
-           myprefix = stralloc2(prefix, kt->keyword);
-           if(strcasecmp(myprefix, command_option->name) == 0) {
-               duplicate = 0;
-               if (command_option->used == 0 &&
-                   valarray[np->parm].seen == -2) {
-                   duplicate = 1;
-               }
-               command_option->used = 1;
-               valarray[np->parm].seen = -2;
-               if(np->type == CONFTYPE_STRING &&
-                  command_option->value[0] != '"') {
-                   conf_line = vstralloc("\"", command_option->value, "\"",
-                                         NULL);
-               }
-               else {
-                   conf_line = stralloc(command_option->value);
-               }
-               conf_char = conf_line;
-               token_pushed = 0;
-               conf_line_num = -2;
-               np->read_function(np, &valarray[np->parm]);
-               amfree(conf_line);
-               conf_line = conf_char = NULL;
-
-               if (np->validate)
-                   np->validate(np, &valarray[np->parm]);
-               if (duplicate == 1) {
-                   fprintf(stderr,"Duplicate %s option, using %s\n",
-                           command_option->name, command_option->value);
-               }
-           }
-           amfree(myprefix);
-       }
-    }
-}
-
-void
-free_new_argv(
-    int new_argc,
-    char **new_argv)
-{
-    int i;
-    for(i=0; i<new_argc; i++)
-       amfree(new_argv[i]);
-    amfree(new_argv);
-}
-
-
 int copy_file(
     char  *dst,
     char  *src,
@@ -2716,7 +762,7 @@ int copy_file(
        save_errno = errno;
        quoted = quote_string(src);
        *errmsg = vstralloc("Can't open file ", quoted, " for reading: %s",
-                           strerror(save_errno));
+                           strerror(save_errno), NULL);
        amfree(quoted);
        return -1;
     }
@@ -2725,7 +771,7 @@ int copy_file(
        save_errno = errno;
        quoted = quote_string(dst);
        *errmsg = vstralloc("Can't open file ", quoted, " for writting: %s",
-                           strerror(save_errno));
+                           strerror(save_errno), NULL);
        amfree(quoted);
        close(infd);
        return -1;
@@ -2736,7 +782,7 @@ int copy_file(
            save_errno = errno;
            quoted = quote_string(dst);
            *errmsg = vstralloc("Error writing to \"", quoted, "\":",
-                               strerror(save_errno));
+                               strerror(save_errno), NULL);
            amfree(quoted);
            close(infd);
            close(outfd);
@@ -2748,7 +794,7 @@ int copy_file(
        save_errno = errno;
        quoted = quote_string(src);
        *errmsg = vstralloc("Error reading from \"", quoted, "\":",
-                           strerror(save_errno));
+                           strerror(save_errno), NULL);
        amfree(quoted);
        close(infd);
        close(outfd);
index 2ce672b21089fcdf2a582efd1b204fd980dac009..f09c87baccf2682b6c3f001e26fc44ca2fd954cf 100644 (file)
@@ -24,7 +24,7 @@
  * file named AUTHORS, in the root directory of this distribution.
  */
 /*
- * $Id: util.h,v 1.17.2.5 2007/01/10 16:18:46 martinea Exp $
+ * $Id: util.h,v 1.17 2006/07/26 15:17:36 martinea Exp $
  */
 #ifndef UTIL_H
 #define        UTIL_H
 #include "amanda.h"
 #include "sl.h"
 
-/* */
-typedef enum {
-    CONFTYPE_INT,
-    CONFTYPE_LONG,
-    CONFTYPE_AM64,
-    CONFTYPE_REAL,
-    CONFTYPE_STRING,
-    CONFTYPE_IDENT,
-    CONFTYPE_TIME,     /* hhmm */
-    CONFTYPE_SIZE,
-    CONFTYPE_SL,
-    CONFTYPE_BOOL,
-    CONFTYPE_COMPRESS,
-    CONFTYPE_ENCRYPT,
-    CONFTYPE_HOLDING,
-    CONFTYPE_ESTIMATE,
-    CONFTYPE_STRATEGY,
-    CONFTYPE_TAPERALGO,
-    CONFTYPE_PRIORITY,
-    CONFTYPE_RATE,
-    CONFTYPE_EXINCLUDE
-} conftype_t;
-
-/* Compression types */
-typedef enum {
-    COMP_NONE,          /* No compression */
-    COMP_FAST,          /* Fast compression on client */
-    COMP_BEST,          /* Best compression on client */
-    COMP_CUST,          /* Custom compression on client */
-    COMP_SERV_FAST,     /* Fast compression on server */
-    COMP_SERV_BEST,     /* Best compression on server */
-    COMP_SERV_CUST      /* Custom compression on server */
-} comp_t;
-
-/* Encryption types */
-typedef enum {
-    ENCRYPT_NONE,               /* No encryption */
-    ENCRYPT_CUST,               /* Custom encryption on client */
-    ENCRYPT_SERV_CUST           /* Custom encryption on server */
-} encrypt_t;
-
-/* holdingdisk types */
-typedef enum {
-    HOLD_NEVER,                        /* Always direct to tape  */
-    HOLD_AUTO,                 /* If possible            */
-    HOLD_REQUIRED              /* Always to holding disk */
-} dump_holdingdisk_t;
-
-/* Dump strategies */
-#define DS_SKIP                0       /* Don't do any dumps at all */
-#define DS_STANDARD    1       /* Standard (0 1 1 1 1 2 2 2 ...) */
-#define DS_NOFULL      2       /* No full's (1 1 1 ...) */
-#define DS_NOINC       3       /* No inc's (0 0 0 ...) */
-#define DS_4           4       /* ? (0 1 2 3 4 5 6 7 8 9 10 11 ...) */
-#define DS_5           5       /* ? (0 1 1 1 1 1 1 1 1 1 1 1 ...) */
-#define DS_HANOI       6       /* Tower of Hanoi (? ? ? ? ? ...) */
-#define DS_INCRONLY    7       /* Forced fulls (0 1 1 2 2 FORCE0 1 1 ...) */
-
-/* Estimate strategies */
-#define ES_CLIENT      0       /* client estimate */
-#define ES_SERVER      1       /* server estimate */
-#define ES_CALCSIZE    2       /* calcsize estimate */
-
-#define ALGO_FIRST     0
-#define ALGO_FIRSTFIT  1
-#define ALGO_LARGEST   2
-#define ALGO_LARGESTFIT        3
-#define ALGO_SMALLEST  4
-#define ALGO_LAST      5
-
-#define BSTRNCMP(a,b)  strncmp(a, b, strlen(b)) 
-                                                 
-typedef enum {
-    CONF_UNKNOWN,              CONF_ANY,               CONF_COMMA,
-    CONF_LBRACE,               CONF_RBRACE,            CONF_NL,
-    CONF_END,                  CONF_IDENT,             CONF_INT,
-    CONF_LONG,                 CONF_AM64,              CONF_BOOL,
-    CONF_REAL,                 CONF_STRING,            CONF_TIME,
-    CONF_SIZE,
-
-    /* config parameters */
-    CONF_INCLUDEFILE,          CONF_ORG,               CONF_MAILTO,
-    CONF_DUMPUSER,             CONF_TAPECYCLE,         CONF_TAPEDEV,
-    CONF_CHNGRDEV,             CONF_CHNGRFILE,         CONF_LABELSTR,
-    CONF_BUMPPERCENT,          CONF_BUMPSIZE,          CONF_BUMPDAYS,
-    CONF_BUMPMULT,             CONF_ETIMEOUT,          CONF_DTIMEOUT,
-    CONF_CTIMEOUT,             CONF_TAPEBUFS,          CONF_TAPELIST,
-    CONF_DISKFILE,             CONF_INFOFILE,          CONF_LOGDIR,
-    CONF_LOGFILE,              CONF_DISKDIR,           CONF_DISKSIZE,
-    CONF_INDEXDIR,             CONF_NETUSAGE,          CONF_INPARALLEL,
-    CONF_DUMPORDER,            CONF_TIMEOUT,           CONF_TPCHANGER,
-    CONF_RUNTAPES,             CONF_DEFINE,            CONF_DUMPTYPE,
-    CONF_TAPETYPE,             CONF_INTERFACE,         CONF_PRINTER,
-    CONF_AUTOFLUSH,            CONF_RESERVE,           CONF_MAXDUMPSIZE,
-    CONF_COLUMNSPEC,           CONF_AMRECOVER_DO_FSF,  CONF_AMRECOVER_CHECK_LABEL,
-    CONF_AMRECOVER_CHANGER,    CONF_LABEL_NEW_TAPES,   CONF_USETIMESTAMPS,
-
-    CONF_TAPERALGO,            CONF_FIRST,             CONF_FIRSTFIT,
-    CONF_LARGEST,              CONF_LARGESTFIT,        CONF_SMALLEST,
-    CONF_LAST,                 CONF_DISPLAYUNIT,
-
-    /* kerberos 5 */
-    CONF_KRB5KEYTAB,           CONF_KRB5PRINCIPAL,
-
-    /* holding disk */
-    CONF_COMMENT,              CONF_DIRECTORY,         CONF_USE,
-    CONF_CHUNKSIZE,
-
-    /* dump type */
-    /*COMMENT,*/               CONF_PROGRAM,           CONF_DUMPCYCLE,
-    CONF_RUNSPERCYCLE,         CONF_MAXCYCLE,          CONF_MAXDUMPS,
-    CONF_OPTIONS,              CONF_PRIORITY,          CONF_FREQUENCY,
-    CONF_INDEX,                        CONF_MAXPROMOTEDAY,     CONF_STARTTIME,
-    CONF_COMPRESS,             CONF_ENCRYPT,           CONF_AUTH,
-    CONF_STRATEGY,             CONF_ESTIMATE,          CONF_SKIP_INCR,
-    CONF_SKIP_FULL,            CONF_RECORD,            CONF_HOLDING,
-    CONF_EXCLUDE,              CONF_INCLUDE,           CONF_KENCRYPT,
-    CONF_IGNORE,               CONF_COMPRATE,          CONF_TAPE_SPLITSIZE,
-    CONF_SPLIT_DISKBUFFER,     CONF_FALLBACK_SPLITSIZE,CONF_SRVCOMPPROG,
-    CONF_CLNTCOMPPROG,         CONF_SRV_ENCRYPT,       CONF_CLNT_ENCRYPT,
-    CONF_SRV_DECRYPT_OPT,      CONF_CLNT_DECRYPT_OPT,  CONF_AMANDAD_PATH,
-    CONF_CLIENT_USERNAME,
-
-    /* tape type */
-    /*COMMENT,*/               CONF_BLOCKSIZE,         CONF_FILE_PAD,
-    CONF_LBL_TEMPL,            CONF_FILEMARK,          CONF_LENGTH,
-    CONF_SPEED,
-
-    /* client conf */
-    CONF_CONF,                 CONF_INDEX_SERVER,      CONF_TAPE_SERVER,
-    CONF_SSH_KEYS,             CONF_GNUTAR_LIST_DIR,   CONF_AMANDATES,
-
-    /* network interface */
-    /* COMMENT, */             /* USE, */
-
-    /* dump options (obsolete) */
-    CONF_EXCLUDE_FILE,         CONF_EXCLUDE_LIST,
-
-    /* compress, estimate, encryption */
-    CONF_NONE,                 CONF_FAST,              CONF_BEST,
-    CONF_SERVER,               CONF_CLIENT,            CONF_CALCSIZE,
-    CONF_CUSTOM,
-
-    /* holdingdisk */
-    CONF_NEVER,                        CONF_AUTO,              CONF_REQUIRED,
-
-    /* priority */
-    CONF_LOW,                  CONF_MEDIUM,            CONF_HIGH,
-
-    /* dump strategy */
-    CONF_SKIP,                 CONF_STANDARD,          CONF_NOFULL,
-    CONF_NOINC,                        CONF_HANOI,             CONF_INCRONLY,
-
-    /* exclude list */
-    CONF_LIST,                 CONF_EFILE,             CONF_APPEND,
-    CONF_OPTIONAL,
-
-    /* numbers */
-    CONF_AMINFINITY,           CONF_MULT1,             CONF_MULT7,
-    CONF_MULT1K,               CONF_MULT1M,            CONF_MULT1G,
-
-    /* boolean */
-    CONF_ATRUE,                        CONF_AFALSE,
-
-    CONF_RAWTAPEDEV
-} tok_t;
-
 #define BIGINT  INT_MAX
 
-/* internal types and variables */
-
-typedef struct {        /* token table entry */
-    char *keyword;
-    tok_t token;
-} keytab_t;
-
-extern keytab_t *keytable;
-
-typedef struct {
-    char *name;
-    char *value;
-    int   used;
-} command_option_t;
-
-typedef struct exinclude_s {
-    sl_t *sl_list;
-    sl_t *sl_file;
-    int  optional;
-} exinclude_t;
-
-typedef struct val_s {
-    union {
-       int             i;
-       long            l;
-       off_t           am64;
-       double          r;
-       char            *s;
-       sl_t            *sl;
-       ssize_t         size;
-       time_t          t;
-       float           rate[2];
-       exinclude_t     exinclude;
-    } v;
-    int seen;
-    conftype_t type;
-} val_t;
-
-typedef struct s_conf_var {
-    tok_t      token;
-    conftype_t type;
-    void       (*read_function) (struct s_conf_var *, val_t*);
-    int                parm;
-    void       (*validate) (struct s_conf_var *, val_t *);
-} t_conf_var;
-
-extern int     allow_overwrites;
-extern int     token_pushed;
-
-extern tok_t   tok, pushed_tok;
-extern val_t   tokenval;
-
-extern int     conf_line_num, got_parserror;
-extern FILE    *conf_conf;
-extern char    *conf_confname;
-extern char    *conf_line;
-extern char    *conf_char;
-
-/* predeclare local functions */
-
-t_conf_var  *get_np(t_conf_var *get_var, int parm);
-void   get_simple(val_t *var, tok_t type);
-int    get_int(void);
-long   get_long(void);
-time_t get_time(void);
-ssize_t        get_size(void);
-off_t  get_am64_t(void);
-int    get_bool(void);
-void   ckseen(int *seen);
-void   conf_parserror(const char *format, ...)
-               __attribute__ ((format (printf, 1, 2)));
-tok_t  lookup_keyword(char *str);
-void   unget_conftoken(void);
-void   get_conftoken(tok_t exp);
-
-void read_string(t_conf_var *, val_t *);
-void read_ident(t_conf_var *, val_t *);
-void read_int(t_conf_var *, val_t *);
-void read_long(t_conf_var *, val_t *);
-void read_size(t_conf_var *, val_t *);
-void read_am64(t_conf_var *, val_t *);
-void read_bool(t_conf_var *, val_t *);
-void read_real(t_conf_var *, val_t *);
-void read_time(t_conf_var *, val_t *);
-void copy_val_t(val_t *, val_t *);
-void free_val_t(val_t *);
-char *conf_print(val_t *, int);
-char *conf_print_exinclude(val_t *, int, int);
-void conf_init_string(val_t *, char *);
-void conf_init_ident(val_t *, char *);
-void conf_init_int(val_t *, int);
-void conf_init_bool(val_t *, int);
-void conf_init_strategy(val_t *, int);
-void conf_init_estimate(val_t *, int);
-void conf_init_taperalgo(val_t *, int);
-void conf_init_priority(val_t *, int);
-void conf_init_strategy(val_t *, int);
-void conf_init_compress(val_t *, comp_t);
-void conf_init_encrypt(val_t *, encrypt_t);
-void conf_init_holding(val_t *, dump_holdingdisk_t);
-void conf_init_long(val_t *, long);
-void conf_init_size(val_t *, ssize_t);
-void conf_init_am64(val_t *, off_t);
-void conf_init_real(val_t *, double);
-void conf_init_rate(val_t *, double, double);
-void conf_init_time(val_t *, time_t);
-void conf_init_sl(val_t *, sl_t *);
-void conf_init_exinclude(val_t *);
-void conf_set_string(val_t *, char *);
-void conf_set_int(val_t *, int);
-void conf_set_bool(val_t *, int);
-void conf_set_compress(val_t *, comp_t);
-void conf_set_encrypt(val_t *, encrypt_t);
-void conf_set_holding(val_t *, dump_holdingdisk_t);
-void conf_set_strategy(val_t *, int);
-int          get_conftype_int      (val_t *);
-long         get_conftype_long     (val_t *);
-off_t        get_conftype_am64     (val_t *);
-double       get_conftype_real     (val_t *);
-char        *get_conftype_string   (val_t *);
-char        *get_conftype_ident    (val_t *);
-time_t       get_conftype_time     (val_t *);
-ssize_t      get_conftype_size     (val_t *);
-sl_t        *get_conftype_sl       (val_t *);
-int          get_conftype_bool     (val_t *);
-int          get_conftype_hold     (val_t *);
-int          get_conftype_compress (val_t *);
-int          get_conftype_encrypt  (val_t *);
-int          get_conftype_estimate (val_t *);
-int          get_conftype_strategy (val_t *);
-int          get_conftype_taperalgo(val_t *);
-int          get_conftype_priority (val_t *);
-float       *get_conftype_rate     (val_t *);
-exinclude_t  get_conftype_exinclude(val_t *);
-
-void read_block(command_option_t *command_options, t_conf_var *read_var,
-               keytab_t *keytab, val_t *valarray, char *prefix, char *errormsg,
-               int read_brace, void (*copy_function)(void));
-void command_overwrite(command_option_t *command_options, t_conf_var *overwrite_var,
-                      keytab_t *keytab, val_t *valarray, char *prefix);
+#define BSTRNCMP(a,b)  strncmp(a, b, strlen(b))
 
+/* internal types and variables */
 
 
 ssize_t        fullread(int, void *, size_t);
 ssize_t        fullwrite(int, const void *, size_t);
 
-int    connect_portrange(struct sockaddr_in *, in_port_t, in_port_t, char *,
-                         struct sockaddr_in *, int);
-int    bind_portrange(int, struct sockaddr_in *, in_port_t, in_port_t,
+int    connect_portrange(struct sockaddr_storage *, in_port_t, in_port_t, char *,
+                         struct sockaddr_storage *, int);
+int    bind_portrange(int, struct sockaddr_storage *, in_port_t, in_port_t,
                       char *);
 
 char * construct_datestamp(time_t *t);
@@ -362,7 +57,15 @@ int needs_quotes(const char * str);
 char * sanitize_string(const char *str);
 char * strquotedstr(void);
 ssize_t        hexdump(const char *buffer, size_t bytes);
-void   dump_sockaddr(struct sockaddr_in *      sa);
+void   dump_sockaddr(struct sockaddr_storage * sa);
+char *  str_sockaddr(struct sockaddr_storage *sa);
+/* Compare two sockaddr_storage objects, optionally comparing
+ * only the address (and thus ignoring port, flow info, etc.).
+ * @returns: -1, 0, or 1 for <, ==, >, respectively
+ */
+int     cmp_sockaddr(struct sockaddr_storage *ss1,
+                    struct sockaddr_storage *ss2,
+             int addr_only);
 int     copy_file(char *dst, char *src, char **errmsg);
 
 /*
@@ -374,5 +77,4 @@ int validate_mailto(const char *mailto);
 
 char *taperalgo2str(int taperalgo);
 
-void free_new_argv(int new_argc, char **new_argv);
 #endif /* UTIL_H */
index b86565a2a1d54e3100d0996aaa2e6e8fc290e5ed..4d6b86234e0f65ef7842874832d69d4385c2783b 100644 (file)
@@ -1,10 +1,10 @@
 /* version.c - generated by genversion.c - DO NOT EDIT! */
 const char * const version_info[] = {
-  "build: VERSION=\"Amanda-2.5.1p3\"\n",
-  "       BUILT_DATE=\"Wed Feb 7 10:30:00 EST 2007\"\n",
-  "       BUILT_MACH=\"Linux modemcable161.224-131-66.mc.videotron.ca 2.6.18-1.2257.fc5 #1 SMP Fri Dec 15 16:07:14 EST 2006 x86_64 x86_64 x86_64 GNU/Linux\"\n",
+  "build: VERSION=\"Amanda-2.5.2p1\"\n",
+  "       BUILT_DATE=\"Wed Jun 6 19:23:48 EDT 2007\"\n",
+  "       BUILT_MACH=\"Linux kdc.localdomain 2.6.20-1.2952.fc6 #1 SMP Wed May 16 18:18:22 EDT 2007 x86_64 x86_64 x86_64 GNU/Linux\"\n",
   "       CC=\"gcc\"\n",
-  "       CONFIGURE_COMMAND=\"'./configure' '--prefix=/home/martinea/linux' '--with-configdir=/home/martinea/etc/amanda' '--with-gnutar-listdir=/var/gnutar-lists' '--with-bsd-security' '--with-ssh-security' '--with-rsh-security' '--with-krb4-security' '--without-krb5-security' '--with-user=martinea' '--with-group=martinea' '--mandir=/home/martinea/man'\"\n",
+  "       CONFIGURE_COMMAND=\"'./configure' '--prefix=/home/martinea/linux' '--with-configdir=/home/martinea/etc/amanda' '--with-gnutar-listdir=/var/gnutar-lists' '--with-bsd-security' '--with-bsdudp-security' '--with-bsdtcp-security' '--with-ssh-security' '--with-rsh-security' '--without-krb4-security' '--with-krb5-security' '--with-user=martinea' '--with-group=martinea' '--enable-manpage-build' '--mandir=/home/martinea/man'\"\n",
   "paths: bindir=\"/home/martinea/linux/bin\"\n",
   "       sbindir=\"/home/martinea/linux/sbin\"\n",
   "       libexecdir=\"/home/martinea/linux/libexec\"\n",
@@ -18,11 +18,11 @@ const char * const version_info[] = {
   "       COMPRESS_PATH=\"/usr/bin/gzip\"\n",
   "       UNCOMPRESS_PATH=\"/usr/bin/gzip\" LPRCMD=\"/usr/bin/lpr\"\n",
   "       MAILER=\"/usr/bin/Mail\" listed_incr_dir=\"/var/gnutar-lists\"\n",
-  "defs:  DEFAULT_SERVER=\"modemcable161.224-131-66.mc.videotron.ca\"\n",
+  "defs:  DEFAULT_SERVER=\"kdc.localdomain\"\n",
   "       DEFAULT_CONFIG=\"DailySet1\"\n",
-  "       DEFAULT_TAPE_SERVER=\"modemcable161.224-131-66.mc.videotron.ca\"\n",
-  "       HAVE_MMAP HAVE_SYSVSHM LOCKING=POSIX_FCNTL SETPGRP_VOID\n",
-  "       DEBUG_CODE AMANDA_DEBUG_DAYS=4 BSD_SECURITY RSH_SECURITY\n",
+  "       DEFAULT_TAPE_SERVER=\"kdc.localdomain\" HAVE_MMAP NEED_STRSTR\n",
+  "       HAVE_SYSVSHM LOCKING=POSIX_FCNTL SETPGRP_VOID DEBUG_CODE\n",
+  "       AMANDA_DEBUG_DAYS=4 BSD_SECURITY KRB5_SECURITY RSH_SECURITY\n",
   "       USE_AMANDAHOSTS CLIENT_LOGIN=\"martinea\" FORCE_USERID\n",
   "       HAVE_GZIP COMPRESS_SUFFIX=\".gz\" COMPRESS_FAST_OPT=\"--fast\"\n",
   "       COMPRESS_BEST_OPT=\"--best\" UNCOMPRESS_OPT=\"-dc\"\n",
index c120d2e2ed68911aca5b1649dcf366d314427372..0e51292017803165327f8c01d915a11310b1e6f2 100644 (file)
 
 const int   VERSION_MAJOR   = 2;
 const int   VERSION_MINOR   = 5;
-const int   VERSION_PATCH   = 1;
-const char *const VERSION_COMMENT = "p3";
+const int   VERSION_PATCH   = 2;
+const char *const VERSION_COMMENT = "p1";
 
 const char *
 versionsuffix(void)
 {
 #ifdef USE_VERSION_SUFFIXES
-    return "-2.5.1p3";
+    return "-2.5.2p1";
 #else
     return "";
 #endif
@@ -49,5 +49,5 @@ versionsuffix(void)
 const char *
 version(void)
 {
-    return "2.5.1p3";
+    return "2.5.2p1";
 }
diff --git a/common-src/waitpid.c b/common-src/waitpid.c
deleted file mode 100644 (file)
index ee694d4..0000000
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
-Copyright (c) 1990, 1991, 1992  X Consortium
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
-AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-Except as contained in this notice, the name of the X Consortium shall not be
-used in advertising or otherwise to promote the sale, use or other dealings
-in this Software without prior written authorization from the X Consortium.
-
- *
- * Copyright 1990, 1991, 1992 by UniSoft Group Limited.
- * 
- * 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 UniSoft not be
- * used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission.  UniSoft
- * makes no representations about the suitability of this software for any
- * purpose.  It is provided "as is" without express or implied warranty.
- *
- * $XConsortium: waitpid.c,v 1.3 94/04/17 20:59:56 rws Exp $
- */
-
-/* modified for Amanda team:
- * replaced all occurrences of "int" for status variables with "amwait_t"
- * compile only if wait4() is not available; if it is, waitpid() is
- * #defined to use wait4 instead.  */
-#include "config.h"
-
-#ifdef HAVE_WAIT4
-/* some compilers do not't like empty C sources */
-static void foo() {};
-
-#else
-
-#if 1
-#include "amanda.h"
-#else
-/* these are all included in amanda.h */
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <errno.h>
-#endif
-
-#ifdef DEBUG
-#   include <stdio.h>
-#   define     DBP(fmt,arg)    (fprintf(stderr, "waitpid(%d): ", currpid), \
-                                fprintf(stderr, fmt, arg), fflush(stderr))
-#else
-#   define     DBP(fmt,arg)
-#endif
-
-#define MAXTAB 20
-
-static struct {
-       pid_t pid;
-       amwait_t /*int*/ status;
-} savtab[MAXTAB];
-static int     ntab = 0;
-static pid_t   currpid = 0;
-
-pid_t
-waitpid(pid, stat_loc, options)
-pid_t pid;
-amwait_t /*int*/ *stat_loc;
-int options;
-{
-       int rval, i;
-       amwait_t /*int*/ local_loc;
-
-       /* Clear the table for each new process */
-       if (getpid() != currpid)
-       {
-               ntab = 0;
-               currpid = getpid();
-               DBP("clearing table\n", 0);
-       }
-
-       DBP("waiting for pid %d\n", pid);
-
-       if (options & ~(WNOHANG|WUNTRACED))
-       {
-               errno = EINVAL;
-               return -1;
-       }
-
-       if (pid == -1)
-       {
-               /* see if any saved */
-               for (i=0; i<ntab; i++)
-                       if (savtab[i].pid != 0)
-                       {
-                               pid = savtab[i].pid;
-                               if (stat_loc)
-                                       *stat_loc = savtab[i].status;
-                               savtab[i].pid = 0;
-                               DBP("got %d from table\n", pid);
-                               return pid;
-                       }
-
-               DBP("return wait3(...)\n", 0);
-               return wait3(stat_loc, options, (int *)0);
-       }
-
-       if (pid <= 0)
-       {
-               /* can't do this functionality (without reading /dev/kmem!) */
-               errno = EINVAL;
-               return -1;
-       }
-
-       /* see if already saved */
-       for (i=0; i<ntab; i++)
-               if (savtab[i].pid == pid)
-               {
-                       if (stat_loc)
-                               *stat_loc = savtab[i].status;
-                       savtab[i].pid = 0;
-                       DBP("found %d in table\n", pid);
-                       return pid;
-               }
-
-       rval = wait3(&local_loc, options, (int *)0);
-       DBP("wait3() returned %d\n", rval);
-       while (rval != pid && rval != -1 && rval != 0)
-       {
-               /* save for later */
-               for (i=0; i<ntab; i++)
-                       if (savtab[i].pid == 0)
-                       {
-                               savtab[i].pid = rval;
-                               savtab[i].status = local_loc;
-                               DBP("saved %d in free slot\n", rval);
-                               break;
-                       }
-               if (i == ntab)
-               {
-                       if (ntab < MAXTAB)
-                       {
-                               savtab[ntab].pid = rval;
-                               savtab[ntab].status = local_loc;
-                               ++ntab;
-                               DBP("saved %d in new slot\n", rval);
-                       }
-                       else
-                               DBP("no free slot for %d\n", rval);
-               }
-               rval = wait3(&local_loc, options, (int *)0);
-               DBP("wait3() returned %d\n", rval);
-       }
-
-       if(stat_loc)
-               *stat_loc = local_loc;
-
-       return rval;
-}
-#endif
diff --git a/common-src/writev.c b/common-src/writev.c
deleted file mode 100644 (file)
index 2d5317b..0000000
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Amanda, The Advanced Maryland Automatic Network Disk Archiver
- * Copyright (c) 1991-1998 University of Maryland at College Park
- * All Rights Reserved.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of U.M. not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission.  U.M. makes no representations about the
- * suitability of this software for any purpose.  It is provided "as is"
- * without express or implied warranty.
- *
- * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Authors: the Amanda Development Team.  Its members are listed in a
- * file named AUTHORS, in the root directory of this distribution.
- */
-/*
- * $Id: writev.c,v 1.2 1999/03/04 22:40:08 kashmir Exp $
- *
- * emulation of writev that simply copies all iovecs into a contiguous
- * buffer and writes that out in one write.
- */
-
-#include "amanda.h"
-#ifndef HAVE_WRITEV
-
-ssize_t
-writev(fd, iov, iovcnt)
-    int fd;
-    const struct iovec *iov;
-    int iovcnt;
-{
-    size_t bufsize;
-    int i;
-    ssize_t ret;
-    char *buf, *writeptr;
-
-    /*
-     * Get the sum of the iovecs, and allocate a suitably sized buffer
-     */
-    for (bufsize = 0, i = 0; i < iovcnt; i++)
-       bufsize += iov[i].iov_len;
-    buf = alloc(bufsize);
-
-    /*
-     * Copy each iovec back to back into the buffer
-     */
-    for (writeptr = buf, i = 0; i < iovcnt; i++) {
-       memcpy(writeptr, iov[i].iov_base, iov[i].iov_len);
-       writeptr += iov[i].iov_len;
-    }
-
-    /*
-     * Write the buffer, free it, and return write's result
-     */
-    ret = write(fd, buf, bufsize);
-    amfree(buf);
-    return (ret);
-}
-#endif /* HAVE_WRITEV */
index e58f070848d012521e1957cf851984bc92e36564..bf61cb087810b39db48b65475b56e2baea1714dd 100644 (file)
@@ -3,6 +3,7 @@
 EXTRA_DIST =   acinclude.m4i   \
                config.guess    \
                config.sub      \
+               gnulib.m4i      \
                install-sh      \
                libtool.m4i     \
                ltmain.sh       \
index d9780d62d14b11e3a643e2fec0321d8b20dbec20..bf8205d4339e22ce42cca7be8cd2f965ca62337b 100644 (file)
@@ -38,10 +38,45 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = config
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
-       $(srcdir)/config.h.in config.guess config.sub depcomp \
-       install-sh ltmain.sh missing mkinstalldirs
+       $(srcdir)/config.h.in config.guess config.rpath config.sub \
+       depcomp install-sh ltmain.sh missing mkinstalldirs
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+       $(top_srcdir)/config/gnulib/absolute-header.m4 \
+       $(top_srcdir)/config/gnulib/alloca.m4 \
+       $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/eoverflow.m4 \
+       $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/getaddrinfo.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-cache.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-common.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-comp.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-tool.m4 \
+       $(top_srcdir)/config/gnulib/inet_ntop.m4 \
+       $(top_srcdir)/config/gnulib/intmax_t.m4 \
+       $(top_srcdir)/config/gnulib/inttypes_h.m4 \
+       $(top_srcdir)/config/gnulib/lib-ld.m4 \
+       $(top_srcdir)/config/gnulib/lib-link.m4 \
+       $(top_srcdir)/config/gnulib/lib-prefix.m4 \
+       $(top_srcdir)/config/gnulib/lock.m4 \
+       $(top_srcdir)/config/gnulib/longdouble.m4 \
+       $(top_srcdir)/config/gnulib/longlong.m4 \
+       $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
+       $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \
+       $(top_srcdir)/config/gnulib/size_max.m4 \
+       $(top_srcdir)/config/gnulib/snprintf.m4 \
+       $(top_srcdir)/config/gnulib/socklen.m4 \
+       $(top_srcdir)/config/gnulib/sockpfaf.m4 \
+       $(top_srcdir)/config/gnulib/stdbool.m4 \
+       $(top_srcdir)/config/gnulib/stdint_h.m4 \
+       $(top_srcdir)/config/gnulib/strdup.m4 \
+       $(top_srcdir)/config/gnulib/string_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
+       $(top_srcdir)/config/gnulib/vasnprintf.m4 \
+       $(top_srcdir)/config/gnulib/visibility.m4 \
+       $(top_srcdir)/config/gnulib/wchar_t.m4 \
+       $(top_srcdir)/config/gnulib/wint_t.m4 \
+       $(top_srcdir)/config/gnulib/xsize.m4 \
        $(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
@@ -51,8 +86,10 @@ CONFIG_CLEAN_FILES =
 SOURCES =
 DIST_SOURCES =
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ABSOLUTE_STRING_H = @ABSOLUTE_STRING_H@
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
+ALLOCA_H = @ALLOCA_H@
 AMANDA_DBGDIR = @AMANDA_DBGDIR@
 AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@
 AMANDA_TMPDIR = @AMANDA_TMPDIR@
@@ -67,18 +104,17 @@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@
 AMTAR = @AMTAR@
 AM_CFLAGS = @AM_CFLAGS@
 AR = @AR@
+ARPA_INET_H = @ARPA_INET_H@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
-AWK_VAR_ASSIGNMENT_OPT = @AWK_VAR_ASSIGNMENT_OPT@
 BINARY_OWNER = @BINARY_OWNER@
-BUILD_MAN_PAGES_FALSE = @BUILD_MAN_PAGES_FALSE@
-BUILD_MAN_PAGES_TRUE = @BUILD_MAN_PAGES_TRUE@
 CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
+CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
 CHIO = @CHIO@
 CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
@@ -111,18 +147,40 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
+ENABLE_MANPAGE_BUILD_FALSE = @ENABLE_MANPAGE_BUILD_FALSE@
+ENABLE_MANPAGE_BUILD_TRUE = @ENABLE_MANPAGE_BUILD_TRUE@
+EOVERFLOW = @EOVERFLOW@
+EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@
 EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
+GCC_COMPILER_FALSE = @GCC_COMPILER_FALSE@
+GCC_COMPILER_TRUE = @GCC_COMPILER_TRUE@
 GETCONF = @GETCONF@
+GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@
+GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
 GNUTAR_LISTED_INCREMENTAL_DIRX = @GNUTAR_LISTED_INCREMENTAL_DIRX@
 GREP = @GREP@
 GZIP = @GZIP@
-HAVE_XSLTPROC_FALSE = @HAVE_XSLTPROC_FALSE@
-HAVE_XSLTPROC_TRUE = @HAVE_XSLTPROC_TRUE@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRNDUP = @HAVE_STRNDUP@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE__BOOL = @HAVE__BOOL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -131,22 +189,31 @@ LDFLAGS = @LDFLAGS@
 LEX = @LEX@
 LEXLIB = @LEXLIB@
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
+LIBPTH = @LIBPTH@
+LIBPTH_PREFIX = @LIBPTH_PREFIX@
 LIBS = @LIBS@
+LIBTHREAD = @LIBTHREAD@
 LIBTOOL = @LIBTOOL@
 LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LL_FMT = @LL_FMT@
 LL_RFMT = @LL_RFMT@
 LN_S = @LN_S@
 LTALLOCA = @LTALLOCA@
+LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
 LTLIBOBJS = @LTLIBOBJS@
+LTLIBPTH = @LTLIBPTH@
+LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
 MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@
 MCUTIL = @MCUTIL@
+MKDIR_P = @MKDIR_P@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
+NETINET_IN_H = @NETINET_IN_H@
 OBJEXT = @OBJEXT@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -160,6 +227,9 @@ PERL = @PERL@
 PRINT = @PRINT@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
+REPLACE_STRCASECMP = @REPLACE_STRCASECMP@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRSTR = @REPLACE_STRSTR@
 RESTORE = @RESTORE@
 SAMBA_CLIENT = @SAMBA_CLIENT@
 SERVICE_SUFFIX = @SERVICE_SUFFIX@
@@ -168,7 +238,10 @@ SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 SNAPSHOT_STAMP = @SNAPSHOT_STAMP@
 SORT = @SORT@
+SSH = @SSH@
+STDBOOL_H = @STDBOOL_H@
 STRIP = @STRIP@
+SYS_SOCKET_H = @SYS_SOCKET_H@
 USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@
 VDUMP = @VDUMP@
 VERSION = @VERSION@
@@ -207,6 +280,7 @@ WANT_TAPE_TRUE = @WANT_TAPE_TRUE@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
 XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
 YACC = @YACC@
 ac_c = @ac_c@
 ac_ct_AR = @ac_ct_AR@
@@ -233,6 +307,8 @@ build_os = @build_os@
 build_vendor = @build_vendor@
 datadir = @datadir@
 exec_prefix = @exec_prefix@
+gl_LIBOBJS = @gl_LIBOBJS@
+gl_LTLIBOBJS = @gl_LTLIBOBJS@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -260,6 +336,7 @@ target_vendor = @target_vendor@
 EXTRA_DIST = acinclude.m4i     \
                config.guess    \
                config.sub      \
+               gnulib.m4i      \
                install-sh      \
                libtool.m4i     \
                ltmain.sh       \
index ae6ea72e34105e8a7e1a56a3817909e09ac7c2b3..e8e9029cad0a878478635157d977beeb29bd6ec0 100644 (file)
@@ -191,47 +191,6 @@ main() {
     ]
 )
 
-dnl Find out how {awk,gawk,nawk,mawk} likes to assign variables, if it
-dnl can do so at all.
-AC_DEFUN([AMANDA_PROG_AWK_VAR],
-    [
-       AC_REQUIRE([AC_PROG_AWK])
-       AC_CACHE_CHECK(
-           [for $AWK command line variable assignment],
-           amanda_cv_awk_var_assignment,
-           [
-               echo 'BEGIN{print i; exit}' > conftest.awk
-               result=`$AWK -f conftest.awk i=xx | wc -c`
-               if test "$result" -le 1; then
-                   result=`$AWK -f conftest.awk -v i=xx | wc -c`
-                   if test "$result" -le 1; then
-                       amanda_cv_awk_var_assignment=no
-                   else
-                       amanda_cv_awk_var_assignment="yes with -v"
-                   fi
-               else
-                   amanda_cv_awk_var_assignment="yes"
-               fi
-               rm -fr conftest.awk
-           ]
-       )
-       AWK_VAR_ASSIGNMENT_OPT=
-       case "$amanda_cv_awk_var_assignment" in
-           no)
-               HAVE_AWK_WITH_VAR=no
-               ;;
-           yes)
-               HAVE_AWK_WITH_VAR=yes
-               ;;
-           "yes with -v")
-               HAVE_AWK_WITH_VAR=yes
-               AWK_VAR_ASSIGNMENT_OPT=-v
-               ;;
-       esac
-       AC_SUBST(AWK_VAR_ASSIGNMENT_OPT)
-    ]
-)      
-
 dnl Check for the one or two argument version of gettimeofday.
 AC_DEFUN([AMANDA_FUNC_GETTIMEOFDAY_ARGS],
     [
@@ -271,29 +230,6 @@ AC_DEFUN([AMANDA_FUNC_GETTIMEOFDAY_ARGS],
 
 
 
-dnl Check if the compiler understands volatile.
-AC_DEFUN([AMANDA_C_VOLATILE],
-    [
-       AC_CACHE_CHECK(
-           [for working volatile],
-           amanda_cv_c_volatile,
-           [
-               AC_TRY_COMPILE(,
-                   [
-                       volatile int aaa = 0;
-                   ],
-                   amanda_cv_c_volatile=yes,
-                   amanda_cv_c_volatile=no
-               )
-           ]
-       )
-       if test $amanda_cv_c_volatile = no; then
-           AC_DEFINE(volatile, [],[Define to empty if the compiler does not support volatile. ])
-       fi
-    ]
-)
-
-
 dnl Check for if pid_t is a long, int, or short.
 AC_DEFUN([AMANDA_TYPE_PID_T],
     [
@@ -1145,3 +1081,176 @@ ac_cv_type_int_fast32_t="$ac_cv_type_int_fast32_t"
 ac_cv_type_intmax_t="$ac_cv_type_intmax_t"
 ])
 ])
+
+# AC_PROG_XSLTPROC
+# -----------------------------------------------------------------
+# Find an xsltproc executable.
+#
+# Input:
+#  $1 is the default $XSLTPROC_FLAGS, which will be overridden if the
+#  user specifies --with-xsltproc-flags.
+# Output:
+#  $XSLTPROC contains the path to xsltproc, or is empty if none was
+#  found or the user specified --without-xsltproc. $XSLTPROC_FLAGS 
+#  contains the flags to use with xsltproc.
+
+AC_DEFUN([AC_PROG_XSLTPROC],
+[
+XSLTPROC_FLAGS="$1"
+AC_SUBST(XSLTPROC_FLAGS)
+
+# The (lack of) whitespace and overquoting here are all necessary for
+# proper formatting.
+AC_ARG_WITH(xsltproc,
+AS_HELP_STRING([--with-xsltproc[[[[[=PATH]]]]]],
+               [Use the xsltproc binary in in PATH.]),
+    [ ac_with_xsltproc=$withval; ],
+    [ ac_with_xsltproc=maybe; ])
+
+AC_ARG_WITH(xsltproc-flags,
+AS_HELP_STRING([  --with-xsltproc-flags=FLAGS],
+               [Flags to pass to xsltproc (default $1)]),
+    [ if test "x$withval" == "xno"; then
+       XSLTPROC_FLAGS=''
+    else
+       if test "x$withval" != "xyes"; then
+           XSLTPROC_FLAGS="$withval"
+       fi
+    fi
+       ])
+
+# search for xsltproc if it wasn't specified
+if test "$ac_with_xsltproc" = "yes" -o "$ac_with_xsltproc" = "maybe"; then
+    AC_PATH_PROGS(XSLTPROC,xsltproc,,$LOCSYSPATH)
+else
+    if test "$ac_with_xsltproc" != "no"; then
+        if test -x "$ac_with_xsltproc"; then
+            XSLTPROC="$ac_with_xsltproc";
+        else
+            AC_MSG_WARN([Specified xsltproc of $ac_with_xsltproc isn't])
+            AC_MSG_WARN([executable; searching for an alternative.])
+            AC_PATH_PROGS(XSLTPROC,xsltproc,,$LOCSYSPATH)
+        fi
+    fi
+fi
+])
+
+# AC_CHECK_DOCBOOK_XSLT
+# -----------------------------------------------------------------
+# Check for access to docbook stylesheets of a particular revision.
+# This macro can be used for multiple versions within the same script.
+#
+# Input:
+#  $1 is the version of docbook to search for; default 'current'
+# Output:
+#  $HAVE_DOCBOOK_XSLT_VERS will be set to 'yes' or 'no' depending
+#  on the results of the test, where VERS is $1, with '_' substituted
+#  for '.'  $HAVE_DOCBOOK_XSLT will also be set to the same value.
+AC_DEFUN([AC_CHECK_DOCBOOK_XSLT],
+[
+    AC_REQUIRE([AC_PROG_XSLTPROC])
+
+    dnl define a temporary variable for the version, so this macro can be
+    dnl used with multiple versions
+    define([_VERS], $1)
+    ifelse(_VERS, [], [define([_VERS], [current])])
+    define([ac_cv_docbook_xslt_VERS], patsubst([ac_cv_docbook_xslt_]_VERS, [\.], [_]))
+    define([HAVE_DOCBOOK_XSLT_VERS], patsubst([HAVE_DOCBOOK_XSLT_]_VERS, [\.], [_]))
+
+    AC_CACHE_CHECK([for Docbook XSLT version ]_VERS, [ac_cv_docbook_xslt_VERS],
+    [
+       ac_cv_docbook_xslt_VERS=no
+       if test -n "$XSLTPROC"; then
+           echo "Trying '$XSLTPROC $XSLTPROC_FLAGS http://docbook.sourceforge.net/release/xsl/_VERS/xhtml/docbook.xsl'" >&AS_MESSAGE_LOG_FD
+           $XSLTPROC $XSLTPROC_FLAGS http://docbook.sourceforge.net/release/xsl/_VERS/xhtml/docbook.xsl >&AS_MESSAGE_LOG_FD 2>&1
+
+           if test "$?" = 0; then
+               ac_cv_docbook_xslt_VERS=yes
+           fi
+       fi
+    ])
+
+    HAVE_DOCBOOK_XSLT_VERS="$ac_cv_docbook_xslt_VERS"
+    HAVE_DOCBOOK_XSLT=HAVE_DOCBOOK_XSLT_VERS
+    undefine([_VERS])
+])
+
+# AC_CHECK_DOCBOOK_DTD
+# -----------------------------------------------------------------
+# Check for access to docbook DTD of a particular revision.
+# This macro can be used for multiple versions within the same script.
+#
+# Input:
+#  $1 is the version of docbook to search for; default 'current'
+# Output:
+#  $HAVE_DOCBOOK_DTD_VERS will be set to 'yes' or 'no' depending
+#  on the results of the test, where VERS is $1, with '_' substituted
+#  for '.'  $HAVE_DOCBOOK_DTD will also be set to the same value.
+AC_DEFUN([AC_CHECK_DOCBOOK_DTD],
+[
+    AC_REQUIRE([AC_PROG_XSLTPROC])
+
+    dnl define a temporary variable for the version, so this macro can be
+    dnl used with multiple versions
+    define([_VERS], $1)
+    ifelse(_VERS, [], [define([_VERS], [current])])
+    define([ac_cv_docbook_dtd_VERS], patsubst([ac_cv_docbook_dtd_]_VERS, [\.], [_]))
+    define([HAVE_DOCBOOK_DTD_VERS], patsubst([HAVE_DOCBOOK_DTD_]_VERS, [\.], [_]))
+
+    AC_CACHE_CHECK([for Docbook DTD version ]_VERS, [ac_cv_docbook_dtd_VERS],
+    [
+       ac_cv_docbook_dtd_VERS=no
+       if test -n "$XSLTPROC"; then
+           MY_XSLTPROC_FLAGS=`echo "" $XSLTPROC_FLAGS|sed -e s/--novalid//g`
+           cat <<EOF >conftest.xml
+<?xml version="1.0" encoding='ISO-8859-1'?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V[]_VERS//EN" "http://www.oasis-open.org/docbook/xml/_VERS/docbookx.dtd">
+<book id="empty">
+</book>
+EOF
+           echo "Trying '$XSLTPROC $MY_XSLTPROC_FLAGS conftest.xml'" >&AS_MESSAGE_LOG_FD
+           $XSLTPROC $MY_XSLTPROC_FLAGS conftest.xml >conftest.out 2>&1
+           if test "$?" = 0; then
+               # failing to load the DTD is just a warning, so check for it in the output.
+               if grep 'warning: failed to load external entity' conftest_out >/dev/null 2>&1; then
+                   : # no good..
+               else
+                   ac_cv_docbook_dtd_VERS=yes
+               fi
+           fi
+           cat conftest.out >&AS_MESSAGE_LOG_FD
+
+           rm -f conftest.xml conftest.out
+       fi
+    ])
+
+    HAVE_DOCBOOK_DTD_VERS="$ac_cv_docbook_dtd_VERS"
+    HAVE_DOCBOOK_DTD=HAVE_DOCBOOK_DTD_VERS
+    undefine([_VERS])
+])
+dnl
+dnl Checks to see if there's a sockaddr_storage structure
+dnl
+dnl usage:
+dnl
+dnl    AC_SOCKADDR_STORAGE
+dnl
+dnl results:
+dnl
+dnl    HAVE_SOCKADDR_STORAGE (defined)
+dnl
+AC_DEFUN([AC_SOCKADDR_STORAGE],
+    [AC_MSG_CHECKING(if sockaddr_storage struct exists)
+    AC_CACHE_VAL(ac_cv_has_sockaddr_storage,
+       AC_TRY_COMPILE([
+#      include <sys/types.h>
+#      include <sys/socket.h>],
+       [u_int i = sizeof (struct sockaddr_storage)],
+       ac_cv_has_sockaddr_storage=yes,
+       ac_cv_has_sockaddr_storage=no))
+    AC_MSG_RESULT($ac_cv_has_sockaddr_storage)
+    if test $ac_cv_has_sockaddr_storage = yes ; then
+           AC_DEFINE(HAVE_SOCKADDR_STORAGE,1,[if struct sockaddr_storage exists])
+    fi])
+
+
index 04a7ba9fe8a17da89b3d8a03f3606cbe62b3c37d..0f029207f687965f613b82bada86730f311f8f90 100644 (file)
@@ -1,5 +1,8 @@
 /* config/config.h.in.  Generated from configure.in by autoheader.  */
 
+/* Define this to an absolute name of <string.h>. */
+#undef ABSOLUTE_STRING_H
+
 /* Define on AIX. */
 #undef AIX_BACKUP
 
 /* Define this if this system's dump exits with 1 as a success code. */
 #undef DUMP_RETURNS_1
 
+/* Define as good substitute value for EOVERFLOW. */
+#undef EOVERFLOW
+
 /* Define to force to another user on client machines. */
 #undef FORCE_USERID
 
 /* Define to 1 if you have the <db.h> header file. */
 #undef HAVE_DB_H
 
+/* Define to 1 if you have the declaration of `freeaddrinfo', and to 0 if you
+   don't. */
+#undef HAVE_DECL_FREEADDRINFO
+
+/* Define to 1 if you have the declaration of `gai_strerror', and to 0 if you
+   don't. */
+#undef HAVE_DECL_GAI_STRERROR
+
+/* Define to 1 if you have the declaration of `getaddrinfo', and to 0 if you
+   don't. */
+#undef HAVE_DECL_GETADDRINFO
+
+/* Define to 1 if you have the declaration of `getnameinfo', and to 0 if you
+   don't. */
+#undef HAVE_DECL_GETNAMEINFO
+
+/* Define to 1 if you have the declaration of `inet_ntop', and to 0 if you
+   don't. */
+#undef HAVE_DECL_INET_NTOP
+
+/* Define to 1 if you have the declaration of `snprintf', and to 0 if you
+   don't. */
+#undef HAVE_DECL_SNPRINTF
+
+/* Define to 1 if you have the declaration of `strdup', and to 0 if you don't.
+   */
+#undef HAVE_DECL_STRDUP
+
 /* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
    */
 #undef HAVE_DIRENT_H
 /* Define if fwrite is declared. */
 #undef HAVE_FWRITE_DECL
 
-/* Define to 1 if you have the `getcwd' function. */
-#undef HAVE_GETCWD
+/* Define to 1 if you have the `gai_strerror' function. */
+#undef HAVE_GAI_STRERROR
+
+/* Define to 1 if you have the `getaddrinfo' function. */
+#undef HAVE_GETADDRINFO
 
 /* Define to 1 if you have the `getfsent' function. */
 #undef HAVE_GETFSENT
 
+/* Define to 1 if you have the `gethostbyname' function. */
+#undef HAVE_GETHOSTBYNAME
+
 /* Define to 1 if you have the `gethostname' function. */
 #undef HAVE_GETHOSTNAME
 
 /* Define to enable HPUX chio based changer support. */
 #undef HAVE_HPUX_SCSI_CHIO
 
+/* Define to 1 if you have the `inet_ntop' function. */
+#undef HAVE_INET_NTOP
+
 /* Define to 1 if you have the `initgroups' function. */
 #undef HAVE_INITGROUPS
 
 /* Define if initgroups is declared. */
 #undef HAVE_INITGROUPS_DECL
 
+/* Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>. */
+#undef HAVE_INTMAX_T
+
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
+/* Define if <inttypes.h> exists, doesn't clash with <sys/types.h>, and
+   declares uintmax_t. */
+#undef HAVE_INTTYPES_H_WITH_UINTMAX
+
 /* Define to 1 if you have the `ioctl' function. */
 #undef HAVE_IOCTL
 
 /* Define if ioctl is declared. */
 #undef HAVE_IOCTL_DECL
 
+/* Define to 1 if <sys/socket.h> defines AF_INET. */
+#undef HAVE_IPV4
+
+/* Define to 1 if <sys/socket.h> defines AF_INET6. */
+#undef HAVE_IPV6
+
 /* Define to enable IRIX tape-changer support */
 #undef HAVE_IRIX_LIKE_SCSI
 
 /* Define if listen is declared. */
 #undef HAVE_LISTEN_DECL
 
+/* Define if you have the 'long double' type. */
+#undef HAVE_LONG_DOUBLE
+
+/* Define if you have the 'long long' type. */
+#undef HAVE_LONG_LONG
+
+/* Define to 1 if the system has the type `long long int'. */
+#undef HAVE_LONG_LONG_INT
+
 /* Define to 1 if you have the `lstat' function. */
 #undef HAVE_LSTAT
 
 /* Define to 1 if you have the <netdb.h> header file. */
 #undef HAVE_NETDB_H
 
+/* Define to 1 if you have the <netinet/in.h> header file. */
+#undef HAVE_NETINET_IN_H
+
 /* Define to 1 if you have the <netinet/in_systm.h> header file. */
 #undef HAVE_NETINET_IN_SYSTM_H
 
 /* Define if printf is declared. */
 #undef HAVE_PRINTF_DECL
 
+/* Define if the <pthread.h> defines PTHREAD_MUTEX_RECURSIVE. */
+#undef HAVE_PTHREAD_MUTEX_RECURSIVE
+
+/* Define if the POSIX multithreading library has read/write locks. */
+#undef HAVE_PTHREAD_RWLOCK
+
+/* Define to 1 if the system has the type `ptrdiff_t'. */
+#undef HAVE_PTRDIFF_T
+
 /* Define to 1 if you have the `putenv' function. */
 #undef HAVE_PUTENV
 
 /* Define if snprintf is declared. */
 #undef HAVE_SNPRINTF_DECL
 
+/* if struct sockaddr_storage exists */
+#undef HAVE_SOCKADDR_STORAGE
+
 /* Define to 1 if you have the `socket' function. */
 #undef HAVE_SOCKET
 
 /* Define to 1 if you have the <stdarg.h> header file. */
 #undef HAVE_STDARG_H
 
+/* Define to 1 if stdbool.h conforms to C99. */
+#undef HAVE_STDBOOL_H
+
 /* Define to 1 if you have the <stdint.h> header file. */
 #undef HAVE_STDINT_H
 
+/* Define if <stdint.h> exists, doesn't clash with <sys/types.h>, and declares
+   uintmax_t. */
+#undef HAVE_STDINT_H_WITH_UINTMAX
+
 /* Define to 1 if you have the <stdlib.h> header file. */
 #undef HAVE_STDLIB_H
 
 /* Define if strcasecmp is declared. */
 #undef HAVE_STRCASECMP_DECL
 
+/* Define to 1 if you have the `strdup' function. */
+#undef HAVE_STRDUP
+
 /* Define to 1 if you have the `strerror' function. */
 #undef HAVE_STRERROR
 
 /* Define if strncasecmp is declared. */
 #undef HAVE_STRNCASECMP_DECL
 
-/* Define to 1 if you have the `strstr' function. */
-#undef HAVE_STRSTR
-
 /* Define to 1 if you have the `strtol' function. */
 #undef HAVE_STRTOL
 
 /* Define if strtol is declared. */
 #undef HAVE_STRTOL_DECL
 
+/* Define to 1 if the system has the type `struct addrinfo'. */
+#undef HAVE_STRUCT_ADDRINFO
+
 /* Define if the database header declares struct datum. */
 #undef HAVE_STRUCT_DATUM
 
 /* Define to 1 if you have the <sys/shm.h> header file. */
 #undef HAVE_SYS_SHM_H
 
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#undef HAVE_SYS_SOCKET_H
+
 /* Define to 1 if you have the <sys/statfs.h> header file. */
 #undef HAVE_SYS_STATFS_H
 
 /* Define if the compiler support unsigned long constants. */
 #undef HAVE_UNSIGNED_LONG_CONSTANTS
 
+/* Define to 1 if you have the `vasnprintf' function. */
+#undef HAVE_VASNPRINTF
+
 /* Define to 1 if you have the `vfprintf' function. */
 #undef HAVE_VFPRINTF
 
 /* Define if vfprintf is declared. */
 #undef HAVE_VFPRINTF_DECL
 
+/* Define to 1 or 0, depending whether the compiler supports simple visibility
+   declarations. */
+#undef HAVE_VISIBILITY
+
 /* Define to 1 if you have the `vprintf' function. */
 #undef HAVE_VPRINTF
 
 /* Define to 1 if you have the <vtblc.h> header file. */
 #undef HAVE_VTBLC_H
 
-/* Define to 1 if you have the `waitpid' function. */
-#undef HAVE_WAITPID
-
 /* Define to 1 if you have the <wait.h> header file. */
 #undef HAVE_WAIT_H
 
+/* Define if you have the 'wchar_t' type. */
+#undef HAVE_WCHAR_T
+
+/* Define to 1 if you have the `wcslen' function. */
+#undef HAVE_WCSLEN
+
+/* Define to 1 if you have the <winsock2.h> header file. */
+#undef HAVE_WINSOCK2_H
+
+/* Define if you have the 'wint_t' type. */
+#undef HAVE_WINT_T
+
 /* Define to 1 if you have the `writev' function. */
 #undef HAVE_WRITEV
 
 /* Define if writev is declared. */
 #undef HAVE_WRITEV_DECL
 
-/* xslt is available to generate man pages */
-#undef HAVE_XSLTPROC
+/* Define to 1 if you have the <ws2tcpip.h> header file. */
+#undef HAVE_WS2TCPIP_H
+
+/* Define to 1 if the system has the type `_Bool'. */
+#undef HAVE__BOOL
 
 /* Define if limits.h defines _POSIX2_RE_DUP_MAX. */
 #undef HAVE__POSIX2_RE_DUP_MAX
 /* Define to the version of this package. */
 #undef PACKAGE_VERSION
 
+/* Define if the pthread_in_use() detection is hard. */
+#undef PTHREAD_IN_USE_DETECTION_HARD
+
 /* Define as the prefix for raw disk devices, commonly /dev/r or /dev/rdsk/ */
 #undef RDEV_PREFIX
 
 /* The size of a `void*', as computed by sizeof. */
 #undef SIZEOF_VOIDP
 
+/* Define as the maximum value of type 'size_t', if the system doesn't define
+   it. */
+#undef SIZE_MAX
+
 /* Define to the exact path to the sort program. */
 #undef SORT_PATH
 
+/* Path to the SSH binary */
+#undef SSH
+
+/* Arguments to ssh */
+#undef SSH_OPTIONS
+
 /* Define if SSH transport should be enabled. */
 #undef SSH_SECURITY
 
 /* Define to use Posix fcntl for file locking. */
 #undef USE_POSIX_FCNTL
 
+/* Define if the POSIX multithreading library can be used. */
+#undef USE_POSIX_THREADS
+
+/* Define if references to the POSIX multithreading library should be made
+   weak. */
+#undef USE_POSIX_THREADS_WEAK
+
+/* Define if the GNU Pth multithreading library can be used. */
+#undef USE_PTH_THREADS
+
+/* Define if references to the GNU Pth multithreading library should be made
+   weak. */
+#undef USE_PTH_THREADS_WEAK
+
 /* Define to set SO_REUSEADDR on network connections. */
 #undef USE_REUSEADDR
 
 /* Define to invoke rundump (setuid-root) instead of DUMP program directly. */
 #undef USE_RUNDUMP
 
+/* Define if the old Solaris multithreading library can be used. */
+#undef USE_SOLARIS_THREADS
+
+/* Define if references to the old Solaris multithreading library should be
+   made weak. */
+#undef USE_SOLARIS_THREADS_WEAK
+
 /* Define to have programs use version suffixes when calling other programs.
    */
 #undef USE_VERSION_SUFFIXES
 
+/* Define if the Win32 multithreading API can be used. */
+#undef USE_WIN32_THREADS
+
 /* Define on UnixWare. */
 #undef UWARE_TAPEIO
 
    first (like Motorola and SPARC, unlike Intel and VAX). */
 #undef WORDS_BIGENDIAN
 
+/* Define if IPv6 is working. */
+#undef WORKING_IPV6
+
 /* Define on XENIX/ISC. */
 #undef XENIX_TAPEIO
 
    `char[]'. */
 #undef YYTEXT_POINTER
 
+/* Define to 1 if on AIX 3.
+   System headers sometimes define this.
+   We just want to avoid a redefinition error message.  */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif
+
 /* Number of bits in a file offset, on hosts where this is settable. */
 #undef _FILE_OFFSET_BITS
 
+/* Enable GNU extensions on systems that have them.  */
+#ifndef _GNU_SOURCE
+# undef _GNU_SOURCE
+#endif
+
 /* Define for large files, on AIX-style hosts. */
 #undef _LARGE_FILES
 
+/* Define to 1 if on MINIX. */
+#undef _MINIX
+
+/* Define to 2 if the system does not provide POSIX.1 features except with
+   this defined. */
+#undef _POSIX_1_SOURCE
+
+/* Define to 1 if you need to in order for `stat' and other things to work. */
+#undef _POSIX_SOURCE
+
+/* Enable extensions on Solaris.  */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
+#endif
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
+
 /* Directory in which user binaries should be installed. */
 #undef bindir
 
 /* Define to `int' if <sys/types.h> doesn't define. */
 #undef gid_t
 
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+   calls it, or to nothing if 'inline' is not supported under any name.  */
+#ifndef __cplusplus
+#undef inline
+#endif
+
+/* Define to long or long long if <stdint.h> and <inttypes.h> don't define. */
+#undef intmax_t
+
 /* Directory in which internal binaries should be installed. */
 #undef libexecdir
 
 /* Define to `int' if <sys/types.h> does not define. */
 #undef pid_t
 
+/* Define to equivalent of C99 restrict keyword, or to nothing if this is not
+   supported. Do not define if restrict is supported directly. */
+#undef restrict
+
 /* Define if sa_family_t is not a standard system type */
 #undef sa_family_t
 
 
 /* Define to `int' if <sys/types.h> doesn't define. */
 #undef uid_t
-
-/* Define to empty if the compiler does not support volatile. */
-#undef volatile
diff --git a/config/config.rpath b/config/config.rpath
new file mode 100644 (file)
index 0000000..e082db6
--- /dev/null
@@ -0,0 +1,660 @@
+#! /bin/sh
+# Output a system dependent set of variables, describing how to set the
+# run time search path of shared libraries in an executable.
+#
+#   Copyright 1996-2006 Free Software Foundation, Inc.
+#   Taken from GNU libtool, 2001
+#   Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+#   This file is free software; the Free Software Foundation gives
+#   unlimited permission to copy and/or distribute it, with or without
+#   modifications, as long as this notice is preserved.
+#
+# The first argument passed to this file is the canonical host specification,
+#    CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or
+#    CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld
+# should be set by the caller.
+#
+# The set of defined variables is at the end of this script.
+
+# Known limitations:
+# - On IRIX 6.5 with CC="cc", the run time search patch must not be longer
+#   than 256 bytes, otherwise the compiler driver will dump core. The only
+#   known workaround is to choose shorter directory names for the build
+#   directory and/or the installation directory.
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+shrext=.so
+
+host="$1"
+host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+# Code taken from libtool.m4's _LT_CC_BASENAME.
+
+for cc_temp in $CC""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'`
+
+# Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC.
+
+wl=
+if test "$GCC" = yes; then
+  wl='-Wl,'
+else
+  case "$host_os" in
+    aix*)
+      wl='-Wl,'
+      ;;
+    darwin*)
+      case $cc_basename in
+        xlc*)
+          wl='-Wl,'
+          ;;
+      esac
+      ;;
+    mingw* | pw32* | os2*)
+      ;;
+    hpux9* | hpux10* | hpux11*)
+      wl='-Wl,'
+      ;;
+    irix5* | irix6* | nonstopux*)
+      wl='-Wl,'
+      ;;
+    newsos6)
+      ;;
+    linux*)
+      case $cc_basename in
+        icc* | ecc*)
+          wl='-Wl,'
+          ;;
+        pgcc | pgf77 | pgf90)
+          wl='-Wl,'
+          ;;
+        ccc*)
+          wl='-Wl,'
+          ;;
+        como)
+          wl='-lopt='
+          ;;
+        *)
+          case `$CC -V 2>&1 | sed 5q` in
+            *Sun\ C*)
+              wl='-Wl,'
+              ;;
+          esac
+          ;;
+      esac
+      ;;
+    osf3* | osf4* | osf5*)
+      wl='-Wl,'
+      ;;
+    sco3.2v5*)
+      ;;
+    solaris*)
+      wl='-Wl,'
+      ;;
+    sunos4*)
+      wl='-Qoption ld '
+      ;;
+    sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+      wl='-Wl,'
+      ;;
+    sysv4*MP*)
+      ;;
+    unicos*)
+      wl='-Wl,'
+      ;;
+    uts4*)
+      ;;
+  esac
+fi
+
+# Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS.
+
+hardcode_libdir_flag_spec=
+hardcode_libdir_separator=
+hardcode_direct=no
+hardcode_minus_L=no
+
+case "$host_os" in
+  cygwin* | mingw* | pw32*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test "$GCC" != yes; then
+      with_gnu_ld=no
+    fi
+    ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+esac
+
+ld_shlibs=yes
+if test "$with_gnu_ld" = yes; then
+  # Set some defaults for GNU ld with shared library support. These
+  # are reset later if shared libraries are not supported. Putting them
+  # here allows them to be overridden if necessary.
+  # Unlike libtool, we use -rpath here, not --rpath, since the documented
+  # option of GNU ld is called -rpath, not --rpath.
+  hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+  case "$host_os" in
+    aix3* | aix4* | aix5*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+        ld_shlibs=no
+      fi
+      ;;
+    amigaos*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+      # that the semantics of dynamic libraries on AmigaOS, at least up
+      # to version 4, is to share data among multiple programs linked
+      # with the same dynamic library.  Since this doesn't match the
+      # behavior of shared libraries on other platforms, we cannot use
+      # them.
+      ld_shlibs=no
+      ;;
+    beos*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+        :
+      else
+        ld_shlibs=no
+      fi
+      ;;
+    cygwin* | mingw* | pw32*)
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      hardcode_libdir_flag_spec='-L$libdir'
+      if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+        :
+      else
+        ld_shlibs=no
+      fi
+      ;;
+    interix3*)
+      hardcode_direct=no
+      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+      ;;
+    linux*)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+        :
+      else
+        ld_shlibs=no
+      fi
+      ;;
+    netbsd*)
+      ;;
+    solaris*)
+      if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+        ld_shlibs=no
+      elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+        :
+      else
+        ld_shlibs=no
+      fi
+      ;;
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+          ld_shlibs=no
+          ;;
+        *)
+          if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+            hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`'
+          else
+            ld_shlibs=no
+          fi
+          ;;
+      esac
+      ;;
+    sunos4*)
+      hardcode_direct=yes
+      ;;
+    *)
+      if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+        :
+      else
+        ld_shlibs=no
+      fi
+      ;;
+  esac
+  if test "$ld_shlibs" = no; then
+    hardcode_libdir_flag_spec=
+  fi
+else
+  case "$host_os" in
+    aix3*)
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      hardcode_minus_L=yes
+      if test "$GCC" = yes; then
+        # Neither direct hardcoding nor static linking is supported with a
+        # broken collect2.
+        hardcode_direct=unsupported
+      fi
+      ;;
+    aix4* | aix5*)
+      if test "$host_cpu" = ia64; then
+        # On IA64, the linker does run time linking by default, so we don't
+        # have to do anything special.
+        aix_use_runtimelinking=no
+      else
+        aix_use_runtimelinking=no
+        # Test if we are trying to use run time linking or normal
+        # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+        # need to do runtime linking.
+        case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+          for ld_flag in $LDFLAGS; do
+            if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+              aix_use_runtimelinking=yes
+              break
+            fi
+          done
+          ;;
+        esac
+      fi
+      hardcode_direct=yes
+      hardcode_libdir_separator=':'
+      if test "$GCC" = yes; then
+        case $host_os in aix4.[012]|aix4.[012].*)
+          collect2name=`${CC} -print-prog-name=collect2`
+          if test -f "$collect2name" && \
+            strings "$collect2name" | grep resolve_lib_name >/dev/null
+          then
+            # We have reworked collect2
+            hardcode_direct=yes
+          else
+            # We have old collect2
+            hardcode_direct=unsupported
+            hardcode_minus_L=yes
+            hardcode_libdir_flag_spec='-L$libdir'
+            hardcode_libdir_separator=
+          fi
+          ;;
+        esac
+      fi
+      # Begin _LT_AC_SYS_LIBPATH_AIX.
+      echo 'int main () { return 0; }' > conftest.c
+      ${CC} ${LDFLAGS} conftest.c -o conftest
+      aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+      if test -z "$aix_libpath"; then
+        aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0  *\(.*\)$/\1/; p; }
+}'`
+      fi
+      if test -z "$aix_libpath"; then
+        aix_libpath="/usr/lib:/lib"
+      fi
+      rm -f conftest.c conftest
+      # End _LT_AC_SYS_LIBPATH_AIX.
+      if test "$aix_use_runtimelinking" = yes; then
+        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+      else
+        if test "$host_cpu" = ia64; then
+          hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+        else
+          hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+        fi
+      fi
+      ;;
+    amigaos*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      # see comment about different semantics on the GNU ld section
+      ld_shlibs=no
+      ;;
+    bsdi[45]*)
+      ;;
+    cygwin* | mingw* | pw32*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      hardcode_libdir_flag_spec=' '
+      libext=lib
+      ;;
+    darwin* | rhapsody*)
+      hardcode_direct=no
+      if test "$GCC" = yes ; then
+        :
+      else
+        case $cc_basename in
+          xlc*)
+            ;;
+          *)
+            ld_shlibs=no
+            ;;
+        esac
+      fi
+      ;;
+    dgux*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      ;;
+    freebsd1*)
+      ld_shlibs=no
+      ;;
+    freebsd2.2*)
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      ;;
+    freebsd2*)
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      ;;
+    freebsd* | kfreebsd*-gnu | dragonfly*)
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      ;;
+    hpux9*)
+      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator=:
+      hardcode_direct=yes
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L=yes
+      ;;
+    hpux10*)
+      if test "$with_gnu_ld" = no; then
+        hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+        hardcode_libdir_separator=:
+        hardcode_direct=yes
+        # hardcode_minus_L: Not really in the search PATH,
+        # but as the default location of the library.
+        hardcode_minus_L=yes
+      fi
+      ;;
+    hpux11*)
+      if test "$with_gnu_ld" = no; then
+        hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+        hardcode_libdir_separator=:
+        case $host_cpu in
+          hppa*64*|ia64*)
+            hardcode_direct=no
+            ;;
+          *)
+            hardcode_direct=yes
+            # hardcode_minus_L: Not really in the search PATH,
+            # but as the default location of the library.
+            hardcode_minus_L=yes
+            ;;
+        esac
+      fi
+      ;;
+    irix5* | irix6* | nonstopux*)
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      ;;
+    netbsd*)
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      ;;
+    newsos6)
+      hardcode_direct=yes
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      ;;
+    openbsd*)
+      hardcode_direct=yes
+      if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+        hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+      else
+        case "$host_os" in
+          openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+            hardcode_libdir_flag_spec='-R$libdir'
+            ;;
+          *)
+            hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+            ;;
+        esac
+      fi
+      ;;
+    os2*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      ;;
+    osf3*)
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      ;;
+    osf4* | osf5*)
+      if test "$GCC" = yes; then
+        hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      else
+        # Both cc and cxx compiler support -rpath directly
+        hardcode_libdir_flag_spec='-rpath $libdir'
+      fi
+      hardcode_libdir_separator=:
+      ;;
+    solaris*)
+      hardcode_libdir_flag_spec='-R$libdir'
+      ;;
+    sunos4*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      ;;
+    sysv4)
+      case $host_vendor in
+        sni)
+          hardcode_direct=yes # is this really true???
+          ;;
+        siemens)
+          hardcode_direct=no
+          ;;
+        motorola)
+          hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+          ;;
+      esac
+      ;;
+    sysv4.3*)
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+        ld_shlibs=yes
+      fi
+      ;;
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*)
+      ;;
+    sysv5* | sco3.2v5* | sco5v6*)
+      hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`'
+      hardcode_libdir_separator=':'
+      ;;
+    uts4*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      ;;
+    *)
+      ld_shlibs=no
+      ;;
+  esac
+fi
+
+# Check dynamic linker characteristics
+# Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER.
+# Unlike libtool.m4, here we don't care about _all_ names of the library, but
+# only about the one the linker finds when passed -lNAME. This is the last
+# element of library_names_spec in libtool.m4, or possibly two of them if the
+# linker has special search rules.
+library_names_spec=      # the last element of library_names_spec in libtool.m4
+libname_spec='lib$name'
+case "$host_os" in
+  aix3*)
+    library_names_spec='$libname.a'
+    ;;
+  aix4* | aix5*)
+    library_names_spec='$libname$shrext'
+    ;;
+  amigaos*)
+    library_names_spec='$libname.a'
+    ;;
+  beos*)
+    library_names_spec='$libname$shrext'
+    ;;
+  bsdi[45]*)
+    library_names_spec='$libname$shrext'
+    ;;
+  cygwin* | mingw* | pw32*)
+    shrext=.dll
+    library_names_spec='$libname.dll.a $libname.lib'
+    ;;
+  darwin* | rhapsody*)
+    shrext=.dylib
+    library_names_spec='$libname$shrext'
+    ;;
+  dgux*)
+    library_names_spec='$libname$shrext'
+    ;;
+  freebsd1*)
+    ;;
+  kfreebsd*-gnu)
+    library_names_spec='$libname$shrext'
+    ;;
+  freebsd* | dragonfly*)
+    case "$host_os" in
+      freebsd[123]*)
+        library_names_spec='$libname$shrext$versuffix' ;;
+      *)
+        library_names_spec='$libname$shrext' ;;
+    esac
+    ;;
+  gnu*)
+    library_names_spec='$libname$shrext'
+    ;;
+  hpux9* | hpux10* | hpux11*)
+    case $host_cpu in
+      ia64*)
+        shrext=.so
+        ;;
+      hppa*64*)
+        shrext=.sl
+        ;;
+      *)
+        shrext=.sl
+        ;;
+    esac
+    library_names_spec='$libname$shrext'
+    ;;
+  interix3*)
+    library_names_spec='$libname$shrext'
+    ;;
+  irix5* | irix6* | nonstopux*)
+    library_names_spec='$libname$shrext'
+    case "$host_os" in
+      irix5* | nonstopux*)
+        libsuff= shlibsuff=
+        ;;
+      *)
+        case $LD in
+          *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;;
+          *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;;
+          *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;;
+          *) libsuff= shlibsuff= ;;
+        esac
+        ;;
+    esac
+    ;;
+  linux*oldld* | linux*aout* | linux*coff*)
+    ;;
+  linux*)
+    library_names_spec='$libname$shrext'
+    ;;
+  knetbsd*-gnu)
+    library_names_spec='$libname$shrext'
+    ;;
+  netbsd*)
+    library_names_spec='$libname$shrext'
+    ;;
+  newsos6)
+    library_names_spec='$libname$shrext'
+    ;;
+  nto-qnx*)
+    library_names_spec='$libname$shrext'
+    ;;
+  openbsd*)
+    library_names_spec='$libname$shrext$versuffix'
+    ;;
+  os2*)
+    libname_spec='$name'
+    shrext=.dll
+    library_names_spec='$libname.a'
+    ;;
+  osf3* | osf4* | osf5*)
+    library_names_spec='$libname$shrext'
+    ;;
+  solaris*)
+    library_names_spec='$libname$shrext'
+    ;;
+  sunos4*)
+    library_names_spec='$libname$shrext$versuffix'
+    ;;
+  sysv4 | sysv4.3*)
+    library_names_spec='$libname$shrext'
+    ;;
+  sysv4*MP*)
+    library_names_spec='$libname$shrext'
+    ;;
+  sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+    library_names_spec='$libname$shrext'
+    ;;
+  uts4*)
+    library_names_spec='$libname$shrext'
+    ;;
+esac
+
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"`
+shlibext=`echo "$shrext" | sed -e 's,^\.,,'`
+escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"`
+
+LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <<EOF
+
+# How to pass a linker flag through the compiler.
+wl="$escaped_wl"
+
+# Static library suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally "so").
+shlibext="$shlibext"
+
+# Format of library name prefix.
+libname_spec="$escaped_libname_spec"
+
+# Library names that the linker finds when passed -lNAME.
+library_names_spec="$escaped_library_names_spec"
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec="$escaped_hardcode_libdir_flag_spec"
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator="$hardcode_libdir_separator"
+
+# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct="$hardcode_direct"
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L="$hardcode_minus_L"
+
+EOF
diff --git a/config/gnulib.m4i b/config/gnulib.m4i
new file mode 100644 (file)
index 0000000..b211f5f
--- /dev/null
@@ -0,0 +1,35 @@
+m4_include([config/gnulib/absolute-header.m4])
+m4_include([config/gnulib/alloca.m4])
+m4_include([config/gnulib/arpa_inet_h.m4])
+m4_include([config/gnulib/eoverflow.m4])
+m4_include([config/gnulib/extensions.m4])
+m4_include([config/gnulib/getaddrinfo.m4])
+m4_include([config/gnulib/gnulib-cache.m4])
+m4_include([config/gnulib/gnulib-common.m4])
+m4_include([config/gnulib/gnulib-comp.m4])
+m4_include([config/gnulib/gnulib-tool.m4])
+m4_include([config/gnulib/inet_ntop.m4])
+m4_include([config/gnulib/intmax_t.m4])
+m4_include([config/gnulib/inttypes_h.m4])
+m4_include([config/gnulib/lib-ld.m4])
+m4_include([config/gnulib/lib-link.m4])
+m4_include([config/gnulib/lib-prefix.m4])
+m4_include([config/gnulib/lock.m4])
+m4_include([config/gnulib/longdouble.m4])
+m4_include([config/gnulib/longlong.m4])
+m4_include([config/gnulib/netinet_in_h.m4])
+m4_include([config/gnulib/onceonly_2_57.m4])
+m4_include([config/gnulib/size_max.m4])
+m4_include([config/gnulib/snprintf.m4])
+m4_include([config/gnulib/socklen.m4])
+m4_include([config/gnulib/sockpfaf.m4])
+m4_include([config/gnulib/stdbool.m4])
+m4_include([config/gnulib/stdint_h.m4])
+m4_include([config/gnulib/strdup.m4])
+m4_include([config/gnulib/string_h.m4])
+m4_include([config/gnulib/sys_socket_h.m4])
+m4_include([config/gnulib/vasnprintf.m4])
+m4_include([config/gnulib/visibility.m4])
+m4_include([config/gnulib/wchar_t.m4])
+m4_include([config/gnulib/wint_t.m4])
+m4_include([config/gnulib/xsize.m4])
diff --git a/config/gnulib/absolute-header.m4 b/config/gnulib/absolute-header.m4
new file mode 100644 (file)
index 0000000..c649df0
--- /dev/null
@@ -0,0 +1,44 @@
+# absolute-header.m4 serial 6
+dnl Copyright (C) 2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Derek Price.
+
+# gl_ABSOLUTE_HEADER(HEADER1 HEADER2 ...)
+# ---------------------------------------
+# Find the absolute name of a header file, assuming the header exists.
+# If the header were sys/inttypes.h, this macro would define
+# ABSOLUTE_SYS_INTTYPES_H to the `""' quoted absolute name of sys/inttypes.h
+# in config.h
+# (e.g. `#define ABSOLUTE_SYS_INTTYPES_H "///usr/include/sys/inttypes.h"').
+# The three "///" are to pacify Sun C 5.8, which otherwise would say
+# "warning: #include of /usr/include/... may be non-portable".
+# Use `""', not `<>', so that the /// cannot be confused with a C99 comment.
+AC_DEFUN([gl_ABSOLUTE_HEADER],
+[AC_LANG_PREPROC_REQUIRE()dnl
+AC_FOREACH([gl_HEADER_NAME], [$1],
+  [AS_VAR_PUSHDEF([gl_absolute_header],
+                  [gl_cv_absolute_]m4_quote(m4_defn([gl_HEADER_NAME])))dnl
+  AC_CACHE_CHECK([absolute name of <]m4_quote(m4_defn([gl_HEADER_NAME]))[>],
+    m4_quote(m4_defn([gl_absolute_header])),
+    [AS_VAR_PUSHDEF([ac_header_exists],
+                    [ac_cv_header_]m4_quote(m4_defn([gl_HEADER_NAME])))dnl
+    AC_CHECK_HEADERS_ONCE(m4_quote(m4_defn([gl_HEADER_NAME])))dnl
+    if test AS_VAR_GET(ac_header_exists) = yes; then
+      AC_LANG_CONFTEST([AC_LANG_SOURCE([[#include <]]m4_dquote(m4_defn([gl_HEADER_NAME]))[[>]])])
+dnl eval is necessary to expand ac_cpp.
+dnl Ultrix and Pyramid sh refuse to redirect output of eval, so use subshell.
+      AS_VAR_SET(gl_absolute_header,
+[`(eval "$ac_cpp conftest.$ac_ext") 2>&AS_MESSAGE_LOG_FD |
+sed -n '\#/]m4_quote(m4_defn([gl_HEADER_NAME]))[#{s#.*"\(.*/]m4_quote(m4_defn([gl_HEADER_NAME]))[\)".*#\1#;s#^/[^/]#//&#;p;q;}'`])
+    fi
+    AS_VAR_POPDEF([ac_header_exists])dnl
+    ])dnl
+  AC_DEFINE_UNQUOTED(AS_TR_CPP([ABSOLUTE_]m4_quote(m4_defn([gl_HEADER_NAME]))),
+                     ["AS_VAR_GET(gl_absolute_header)"],
+                     [Define this to an absolute name of <]m4_quote(m4_defn([gl_HEADER_NAME]))[>.])
+  AS_VAR_POPDEF([gl_absolute_header])dnl
+])dnl
+])# gl_ABSOLUTE_HEADER
diff --git a/config/gnulib/alloca.m4 b/config/gnulib/alloca.m4
new file mode 100644 (file)
index 0000000..eb62e0e
--- /dev/null
@@ -0,0 +1,50 @@
+# alloca.m4 serial 7
+dnl Copyright (C) 2002-2004, 2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_ALLOCA],
+[
+  dnl Work around a bug of AC_EGREP_CPP in autoconf-2.57.
+  AC_REQUIRE([AC_PROG_CPP])
+  AC_REQUIRE([AC_PROG_EGREP])
+
+  AC_REQUIRE([AC_FUNC_ALLOCA])
+  if test $ac_cv_func_alloca_works = no; then
+    gl_PREREQ_ALLOCA
+  fi
+
+  # Define an additional variable used in the Makefile substitution.
+  if test $ac_cv_working_alloca_h = yes; then
+    AC_CACHE_CHECK([for alloca as a compiler built-in], [gl_cv_rpl_alloca], [
+      AC_EGREP_CPP([Need own alloca], [
+#if defined __GNUC__ || defined _AIX || defined _MSC_VER
+        Need own alloca
+#endif
+        ], [gl_cv_rpl_alloca=yes], [gl_cv_rpl_alloca=no])
+    ])
+    if test $gl_cv_rpl_alloca = yes; then
+      dnl OK, alloca can be implemented through a compiler built-in.
+      AC_DEFINE([HAVE_ALLOCA], 1,
+        [Define to 1 if you have 'alloca' after including <alloca.h>,
+         a header that may be supplied by this distribution.])
+      ALLOCA_H=alloca.h
+    else
+      dnl alloca exists as a library function, i.e. it is slow and probably
+      dnl a memory leak. Don't define HAVE_ALLOCA in this case.
+      ALLOCA_H=
+    fi
+  else
+    ALLOCA_H=alloca.h
+  fi
+  AC_SUBST([ALLOCA_H])
+
+  AC_DEFINE(HAVE_ALLOCA_H, 1,
+    [Define HAVE_ALLOCA_H for backward compatibility with older code
+     that includes <alloca.h> only if HAVE_ALLOCA_H is defined.])
+])
+
+# Prerequisites of lib/alloca.c.
+# STACK_DIRECTION is already handled by AC_FUNC_ALLOCA.
+AC_DEFUN([gl_PREREQ_ALLOCA], [:])
diff --git a/config/gnulib/arpa_inet_h.m4 b/config/gnulib/arpa_inet_h.m4
new file mode 100644 (file)
index 0000000..d01d098
--- /dev/null
@@ -0,0 +1,18 @@
+# arpa_inet_h.m4 serial 1
+dnl Copyright (C) 2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Written by Simon Josefsson
+
+AC_DEFUN([gl_HEADER_ARPA_INET],
+[
+  AC_CHECK_HEADERS_ONCE([arpa/inet.h])
+  if test $ac_cv_header_arpa_inet_h = yes; then
+    ARPA_INET_H=''
+  else
+    ARPA_INET_H='arpa/inet.h'
+  fi
+  AC_SUBST(ARPA_INET_H)
+])
diff --git a/config/gnulib/eoverflow.m4 b/config/gnulib/eoverflow.m4
new file mode 100644 (file)
index 0000000..3bffd10
--- /dev/null
@@ -0,0 +1,70 @@
+# eoverflow.m4 serial 2
+dnl Copyright (C) 2004, 2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+# The EOVERFLOW errno value ought to be defined in <errno.h>, according to
+# POSIX.  But some systems (like AIX 3) don't define it, and some systems
+# (like OSF/1) define it when _XOPEN_SOURCE_EXTENDED is defined.
+
+# Define EOVERFLOW as a C macro and as a substituted macro in such a way that
+# 1. on all systems, after inclusion of <errno.h>, EOVERFLOW is usable,
+# 2. on systems where EOVERFLOW is defined elsewhere, we use the same numeric
+#    value.
+
+AC_DEFUN([gl_EOVERFLOW],
+[
+  AC_REQUIRE([AC_PROG_CC])dnl
+
+  AC_CACHE_CHECK([for EOVERFLOW], ac_cv_decl_EOVERFLOW, [
+    AC_EGREP_CPP(yes,[
+#include <errno.h>
+#ifdef EOVERFLOW
+yes
+#endif
+      ], have_eoverflow=1)
+    if test -n "$have_eoverflow"; then
+      dnl EOVERFLOW exists in <errno.h>. Don't need to define EOVERFLOW ourselves.
+      ac_cv_decl_EOVERFLOW=yes
+    else
+      AC_EGREP_CPP(yes,[
+#define _XOPEN_SOURCE_EXTENDED 1
+#include <errno.h>
+#ifdef EOVERFLOW
+yes
+#endif
+        ], have_eoverflow=1)
+      if test -n "$have_eoverflow"; then
+        dnl EOVERFLOW exists but is hidden.
+        dnl Define it to the same value.
+        AC_COMPUTE_INT([ac_cv_decl_EOVERFLOW], [EOVERFLOW], [
+#define _XOPEN_SOURCE_EXTENDED 1
+#include <errno.h>
+/* The following two lines are a workaround against an autoconf-2.52 bug.  */
+#include <stdio.h>
+#include <stdlib.h>
+])
+      else
+        dnl EOVERFLOW isn't defined by the system. Define EOVERFLOW ourselves, but
+        dnl don't define it as EINVAL, because snprintf() callers want to
+        dnl distinguish EINVAL and EOVERFLOW.
+        ac_cv_decl_EOVERFLOW=E2BIG
+      fi
+    fi
+  ])
+  if test "$ac_cv_decl_EOVERFLOW" != yes; then
+    AC_DEFINE_UNQUOTED([EOVERFLOW], [$ac_cv_decl_EOVERFLOW],
+                       [Define as good substitute value for EOVERFLOW.])
+    EOVERFLOW="$ac_cv_decl_EOVERFLOW"
+    AC_SUBST(EOVERFLOW)
+  fi
+])
+
+dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in.
+dnl Remove this when we can assume autoconf >= 2.61.
+m4_ifdef([AC_COMPUTE_INT], [], [
+  AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])])
+])
diff --git a/config/gnulib/extensions.m4 b/config/gnulib/extensions.m4
new file mode 100644 (file)
index 0000000..143a9e5
--- /dev/null
@@ -0,0 +1,58 @@
+# serial 4  -*- Autoconf -*-
+# Enable extensions on systems that normally disable them.
+
+# Copyright (C) 2003, 2006 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from CVS
+# Autoconf.  Perhaps we can remove this once we can assume Autoconf
+# 2.61 or later everywhere, but since CVS Autoconf mutates rapidly
+# enough in this area it's likely we'll need to redefine
+# AC_USE_SYSTEM_EXTENSIONS for quite some time.
+
+# AC_USE_SYSTEM_EXTENSIONS
+# ------------------------
+# Enable extensions on systems that normally disable them,
+# typically due to standards-conformance issues.
+AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
+[
+  AC_BEFORE([$0], [AC_COMPILE_IFELSE])
+  AC_BEFORE([$0], [AC_RUN_IFELSE])
+
+  AC_REQUIRE([AC_GNU_SOURCE])
+  AC_REQUIRE([AC_AIX])
+  AC_REQUIRE([AC_MINIX])
+
+  AH_VERBATIM([__EXTENSIONS__],
+[/* Enable extensions on Solaris.  */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
+#endif
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif])
+  AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
+    [ac_cv_safe_to_define___extensions__],
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM([
+#        define __EXTENSIONS__ 1
+         AC_INCLUDES_DEFAULT])],
+       [ac_cv_safe_to_define___extensions__=yes],
+       [ac_cv_safe_to_define___extensions__=no])])
+  test $ac_cv_safe_to_define___extensions__ = yes &&
+    AC_DEFINE([__EXTENSIONS__])
+  AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
+  AC_DEFINE([_TANDEM_SOURCE])
+])
+
+# gl_USE_SYSTEM_EXTENSIONS
+# ------------------------
+# Enable extensions on systems that normally disable them,
+# typically due to standards-conformance issues.
+AC_DEFUN([gl_USE_SYSTEM_EXTENSIONS],
+  [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])])
diff --git a/config/gnulib/getaddrinfo.m4 b/config/gnulib/getaddrinfo.m4
new file mode 100644 (file)
index 0000000..db285d9
--- /dev/null
@@ -0,0 +1,88 @@
+# getaddrinfo.m4 serial 11
+dnl Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_GETADDRINFO],
+[
+  AC_MSG_NOTICE([checking how to do getaddrinfo, freeaddrinfo and getnameinfo])
+
+  AC_SEARCH_LIBS(getaddrinfo, [nsl socket])
+  AC_CHECK_FUNCS(getaddrinfo,, [
+    AC_CACHE_CHECK(for getaddrinfo in ws2tcpip.h and -lws2_32,
+                  gl_cv_w32_getaddrinfo, [
+      gl_cv_w32_getaddrinfo=no
+      am_save_LIBS="$LIBS"
+      LIBS="$LIBS -lws2_32"
+      AC_TRY_LINK([
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+], [getaddrinfo(0, 0, 0, 0);], gl_cv_w32_getaddrinfo=yes)
+    LIBS="$am_save_LIBS"])
+    if test "$gl_cv_w32_getaddrinfo" = "yes"; then
+      LIBS="$LIBS -lws2_32"
+    else
+      AC_LIBOBJ(getaddrinfo)
+    fi
+    ])
+
+  AC_REPLACE_FUNCS(gai_strerror)
+  gl_PREREQ_GETADDRINFO
+])
+
+# Prerequisites of lib/getaddrinfo.h and lib/getaddrinfo.c.
+AC_DEFUN([gl_PREREQ_GETADDRINFO], [
+  AC_SEARCH_LIBS(gethostbyname, [inet nsl])
+  AC_SEARCH_LIBS(getservbyname, [inet nsl socket xnet])
+  AC_CHECK_FUNCS(gethostbyname,, [
+    AC_CACHE_CHECK(for gethostbyname in winsock2.h and -lws2_32,
+                  gl_cv_w32_gethostbyname, [
+      gl_cv_w32_gethostbyname=no
+      am_save_LIBS="$LIBS"
+      LIBS="$LIBS -lws2_32"
+      AC_TRY_LINK([
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+], [gethostbyname(0);], gl_cv_w32_gethostbyname=yes)
+    LIBS="$am_save_LIBS"])
+    if test "$gl_cv_w32_gethostbyname" = "yes"; then
+      LIBS="$LIBS -lws2_32"
+    fi
+    ])
+  AC_REQUIRE([AC_C_RESTRICT])
+  AC_REQUIRE([gl_SOCKET_FAMILIES])
+  AC_REQUIRE([gl_HEADER_SYS_SOCKET])
+  AC_REQUIRE([AC_C_INLINE])
+  AC_REQUIRE([AC_GNU_SOURCE])
+  AC_CHECK_HEADERS_ONCE(netinet/in.h netdb.h)
+  AC_CHECK_DECLS([getaddrinfo, freeaddrinfo, gai_strerror, getnameinfo],,,[
+  /* sys/types.h is not needed according to POSIX, but the
+     sys/socket.h in i386-unknown-freebsd4.10 and
+     powerpc-apple-darwin5.5 required it. */
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+])
+  AC_CHECK_TYPES([struct addrinfo],,,[
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+])
+])
diff --git a/config/gnulib/gnulib-cache.m4 b/config/gnulib/gnulib-cache.m4
new file mode 100644 (file)
index 0000000..717621b
--- /dev/null
@@ -0,0 +1,31 @@
+# Copyright (C) 2004-2007 Free Software Foundation, Inc.
+#
+# This file is free software, distributed under the terms of the GNU
+# General Public License.  As a special exception to the GNU General
+# Public License, this file may be distributed as part of a program
+# that contains a configuration script generated by Autoconf, under
+# the same distribution terms as the rest of that program.
+#
+# Generated by gnulib-tool.
+#
+# This file represents the specification of how gnulib-tool is used.
+# It acts as a cache: It is written and read by gnulib-tool.
+# In projects using CVS, this file is meant to be stored in CVS,
+# like the configure.ac and various Makefile.am files.
+
+
+# Specification in the form of a command-line invocation:
+#   gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib --m4-base=config/gnulib --doc-base=doc --aux-dir=config --libtool --macro-prefix=gl getaddrinfo lock visibility
+
+# Specification in the form of a few gnulib-tool.m4 macro invocations:
+gl_LOCAL_DIR([])
+gl_MODULES([getaddrinfo lock visibility])
+gl_AVOID([])
+gl_SOURCE_BASE([gnulib])
+gl_M4_BASE([config/gnulib])
+gl_DOC_BASE([doc])
+gl_TESTS_BASE([tests])
+gl_LIB([libgnu])
+gl_MAKEFILE_NAME([])
+gl_LIBTOOL
+gl_MACRO_PREFIX([gl])
diff --git a/config/gnulib/gnulib-common.m4 b/config/gnulib/gnulib-common.m4
new file mode 100644 (file)
index 0000000..5398010
--- /dev/null
@@ -0,0 +1,22 @@
+# gnulib-common.m4 serial 2
+dnl Copyright (C) 2007 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# gl_MODULE_INDICATOR([modulename])
+# defines a C macro indicating the presence of the given module.
+AC_DEFUN([gl_MODULE_INDICATOR],
+[
+  AC_DEFINE([GNULIB_]translit([$1],[abcdefghijklmnopqrstuvwxyz./-],[ABCDEFGHIJKLMNOPQRSTUVWXYZ___]), [1],
+    [Define to 1 when using the gnulib module ]$1[.])
+])
+
+# AC_PROG_MKDIR_P
+# is a backport of autoconf-2.60's AC_PROG_MKDIR_P.
+# Remove this macro when we can assume autoconf >= 2.60.
+m4_ifdef([AC_PROG_MKDIR_P], [], [
+  AC_DEFUN([AC_PROG_MKDIR_P],
+    [AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
+     MKDIR_P='$(mkdir_p)'
+     AC_SUBST([MKDIR_P])])])
diff --git a/config/gnulib/gnulib-comp.m4 b/config/gnulib/gnulib-comp.m4
new file mode 100644 (file)
index 0000000..f26cf17
--- /dev/null
@@ -0,0 +1,155 @@
+# DO NOT EDIT! GENERATED AUTOMATICALLY!
+# Copyright (C) 2004-2007 Free Software Foundation, Inc.
+#
+# This file is free software, distributed under the terms of the GNU
+# General Public License.  As a special exception to the GNU General
+# Public License, this file may be distributed as part of a program
+# that contains a configuration script generated by Autoconf, under
+# the same distribution terms as the rest of that program.
+#
+# Generated by gnulib-tool.
+#
+# This file represents the compiled summary of the specification in
+# gnulib-cache.m4. It lists the computed macro invocations that need
+# to be invoked from configure.ac.
+# In projects using CVS, this file can be treated like other built files.
+
+
+# This macro should be invoked from ./configure.in, in the section
+# "Checks for programs", right after AC_PROG_CC, and certainly before
+# any checks for libraries, header files, types and library functions.
+AC_DEFUN([gl_EARLY],
+[
+  m4_pattern_forbid([^gl_[A-Z]])dnl the gnulib macro namespace
+  m4_pattern_allow([^gl_ES$])dnl a valid locale name
+  m4_pattern_allow([^gl_LIBOBJS$])dnl a variable
+  m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable
+  AC_REQUIRE([AC_PROG_RANLIB])
+  AC_REQUIRE([AC_GNU_SOURCE])
+  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+  AC_REQUIRE([gl_LOCK_EARLY])
+])
+
+# This macro should be invoked from ./configure.in, in the section
+# "Check for header files, types and library functions".
+AC_DEFUN([gl_INIT],
+[
+  m4_pushdef([AC_LIBOBJ], m4_defn([gl_LIBOBJ]))
+  m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gl_REPLACE_FUNCS]))
+  m4_pushdef([AC_LIBSOURCES], m4_defn([gl_LIBSOURCES]))
+  AM_CONDITIONAL([GL_COND_LIBTOOL], [true])
+  gl_cond_libtool=true
+  gl_source_base='gnulib'
+  gl_FUNC_ALLOCA
+  gl_HEADER_ARPA_INET
+  dnl gl_USE_SYSTEM_EXTENSIONS must be added quite early to configure.ac.
+  gl_GETADDRINFO
+  gl_INET_NTOP
+  gl_LOCK
+  gl_HEADER_NETINET_IN
+  gl_SIZE_MAX
+  gl_FUNC_SNPRINTF
+  gl_TYPE_SOCKLEN_T
+  AM_STDBOOL_H
+  gl_FUNC_STRDUP
+  gl_HEADER_STRING_H
+  gl_HEADER_SYS_SOCKET
+  AC_PROG_MKDIR_P
+  gl_FUNC_VASNPRINTF
+  gl_VISIBILITY
+  gl_XSIZE
+  m4_popdef([AC_LIBSOURCES])
+  m4_popdef([AC_REPLACE_FUNCS])
+  m4_popdef([AC_LIBOBJ])
+  AC_CONFIG_COMMANDS_PRE([
+    gl_libobjs=
+    gl_ltlibobjs=
+    if test -n "$gl_LIBOBJS"; then
+      # Remove the extension.
+      sed_drop_objext='s/\.o$//;s/\.obj$//'
+      for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed "$sed_drop_objext" | sort | uniq`; do
+        gl_libobjs="$gl_libobjs $i.$ac_objext"
+        gl_ltlibobjs="$gl_ltlibobjs $i.lo"
+      done
+    fi
+    AC_SUBST([gl_LIBOBJS], [$gl_libobjs])
+    AC_SUBST([gl_LTLIBOBJS], [$gl_ltlibobjs])
+  ])
+])
+
+# Like AC_LIBOBJ, except that the module name goes
+# into gl_LIBOBJS instead of into LIBOBJS.
+AC_DEFUN([gl_LIBOBJ],
+  [gl_LIBOBJS="$gl_LIBOBJS $1.$ac_objext"])
+
+# Like AC_REPLACE_FUNCS, except that the module name goes
+# into gl_LIBOBJS instead of into LIBOBJS.
+AC_DEFUN([gl_REPLACE_FUNCS],
+  [AC_CHECK_FUNCS([$1], , [gl_LIBOBJ($ac_func)])])
+
+# Like AC_LIBSOURCES, except that it does nothing.
+# We rely on EXTRA_lib..._SOURCES instead.
+AC_DEFUN([gl_LIBSOURCES],
+  [])
+
+# This macro records the list of files which have been installed by
+# gnulib-tool and may be removed by future gnulib-tool invocations.
+AC_DEFUN([gl_FILE_LIST], [
+  build-aux/config.rpath
+  lib/alloca_.h
+  lib/asnprintf.c
+  lib/gai_strerror.c
+  lib/getaddrinfo.c
+  lib/getaddrinfo.h
+  lib/gettext.h
+  lib/inet_ntop.c
+  lib/inet_ntop.h
+  lib/lock.c
+  lib/lock.h
+  lib/printf-args.c
+  lib/printf-args.h
+  lib/printf-parse.c
+  lib/printf-parse.h
+  lib/size_max.h
+  lib/snprintf.c
+  lib/snprintf.h
+  lib/socket_.h
+  lib/stdbool_.h
+  lib/strdup.c
+  lib/string_.h
+  lib/vasnprintf.c
+  lib/vasnprintf.h
+  lib/xsize.h
+  m4/absolute-header.m4
+  m4/alloca.m4
+  m4/arpa_inet_h.m4
+  m4/eoverflow.m4
+  m4/extensions.m4
+  m4/getaddrinfo.m4
+  m4/gnulib-common.m4
+  m4/inet_ntop.m4
+  m4/intmax_t.m4
+  m4/inttypes_h.m4
+  m4/lib-ld.m4
+  m4/lib-link.m4
+  m4/lib-prefix.m4
+  m4/lock.m4
+  m4/longdouble.m4
+  m4/longlong.m4
+  m4/netinet_in_h.m4
+  m4/onceonly_2_57.m4
+  m4/size_max.m4
+  m4/snprintf.m4
+  m4/socklen.m4
+  m4/sockpfaf.m4
+  m4/stdbool.m4
+  m4/stdint_h.m4
+  m4/strdup.m4
+  m4/string_h.m4
+  m4/sys_socket_h.m4
+  m4/vasnprintf.m4
+  m4/visibility.m4
+  m4/wchar_t.m4
+  m4/wint_t.m4
+  m4/xsize.m4
+])
diff --git a/config/gnulib/gnulib-tool.m4 b/config/gnulib/gnulib-tool.m4
new file mode 100644 (file)
index 0000000..ef59320
--- /dev/null
@@ -0,0 +1,33 @@
+# gnulib-tool.m4 serial 1
+dnl Copyright (C) 2004-2005 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl The following macros need not be invoked explicitly.
+dnl Invoking them does nothing except to declare default arguments
+dnl for "gnulib-tool --import".
+
+dnl Usage: gl_MODULES([module1 module2 ...])
+AC_DEFUN([gl_MODULES], [])
+
+dnl Usage: gl_AVOID([module1 module2 ...])
+AC_DEFUN([gl_AVOID], [])
+
+dnl Usage: gl_SOURCE_BASE([DIR])
+AC_DEFUN([gl_SOURCE_BASE], [])
+
+dnl Usage: gl_M4_BASE([DIR])
+AC_DEFUN([gl_M4_BASE], [])
+
+dnl Usage: gl_LIB([LIBNAME])
+AC_DEFUN([gl_LIB], [])
+
+dnl Usage: gl_LGPL
+AC_DEFUN([gl_LGPL], [])
+
+dnl Usage: gl_LIBTOOL
+AC_DEFUN([gl_LIBTOOL], [])
+
+dnl Usage: gl_MACRO_PREFIX([PREFIX])
+AC_DEFUN([gl_MACRO_PREFIX], [])
diff --git a/config/gnulib/inet_ntop.m4 b/config/gnulib/inet_ntop.m4
new file mode 100644 (file)
index 0000000..bb02d22
--- /dev/null
@@ -0,0 +1,19 @@
+# inet_ntop.m4 serial 3
+dnl Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_INET_NTOP],
+[
+  AC_REPLACE_FUNCS(inet_ntop)
+  gl_PREREQ_INET_NTOP
+])
+
+# Prerequisites of lib/inet_ntop.h and lib/inet_ntop.c.
+AC_DEFUN([gl_PREREQ_INET_NTOP], [
+  AC_CHECK_HEADERS_ONCE([netinet/in.h arpa/inet.h])
+  AC_CHECK_DECLS([inet_ntop],,,[#include <arpa/inet.h>])
+  AC_REQUIRE([gl_SOCKET_FAMILIES])
+  AC_REQUIRE([AC_C_RESTRICT])
+])
diff --git a/config/gnulib/intmax_t.m4 b/config/gnulib/intmax_t.m4
new file mode 100644 (file)
index 0000000..17c7b0a
--- /dev/null
@@ -0,0 +1,61 @@
+# intmax_t.m4 serial 5
+dnl Copyright (C) 1997-2004, 2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Paul Eggert.
+
+AC_PREREQ(2.13)
+
+# Define intmax_t to 'long' or 'long long'
+# if it is not already defined in <stdint.h> or <inttypes.h>.
+
+AC_DEFUN([gl_AC_TYPE_INTMAX_T],
+[
+  dnl For simplicity, we assume that a header file defines 'intmax_t' if and
+  dnl only if it defines 'uintmax_t'.
+  AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
+  AC_REQUIRE([gl_AC_HEADER_STDINT_H])
+  if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then
+    AC_REQUIRE([gl_AC_TYPE_LONG_LONG])
+    test $ac_cv_type_long_long = yes \
+      && ac_type='long long' \
+      || ac_type='long'
+    AC_DEFINE_UNQUOTED(intmax_t, $ac_type,
+     [Define to long or long long if <inttypes.h> and <stdint.h> don't define.])
+  else
+    AC_DEFINE(HAVE_INTMAX_T, 1,
+      [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
+  fi
+])
+
+dnl An alternative would be to explicitly test for 'intmax_t'.
+
+AC_DEFUN([gt_AC_TYPE_INTMAX_T],
+[
+  AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
+  AC_REQUIRE([gl_AC_HEADER_STDINT_H])
+  AC_CACHE_CHECK(for intmax_t, gt_cv_c_intmax_t,
+    [AC_TRY_COMPILE([
+#include <stddef.h>
+#include <stdlib.h>
+#if HAVE_STDINT_H_WITH_UINTMAX
+#include <stdint.h>
+#endif
+#if HAVE_INTTYPES_H_WITH_UINTMAX
+#include <inttypes.h>
+#endif
+], [intmax_t x = -1; return !x;], gt_cv_c_intmax_t=yes, gt_cv_c_intmax_t=no)])
+  if test $gt_cv_c_intmax_t = yes; then
+    AC_DEFINE(HAVE_INTMAX_T, 1,
+      [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
+  else
+    AC_REQUIRE([gl_AC_TYPE_LONG_LONG])
+    test $ac_cv_type_long_long = yes \
+      && ac_type='long long' \
+      || ac_type='long'
+    AC_DEFINE_UNQUOTED(intmax_t, $ac_type,
+     [Define to long or long long if <stdint.h> and <inttypes.h> don't define.])
+  fi
+])
diff --git a/config/gnulib/inttypes_h.m4 b/config/gnulib/inttypes_h.m4
new file mode 100644 (file)
index 0000000..edc8ecb
--- /dev/null
@@ -0,0 +1,26 @@
+# inttypes_h.m4 serial 7
+dnl Copyright (C) 1997-2004, 2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Paul Eggert.
+
+# Define HAVE_INTTYPES_H_WITH_UINTMAX if <inttypes.h> exists,
+# doesn't clash with <sys/types.h>, and declares uintmax_t.
+
+AC_DEFUN([gl_AC_HEADER_INTTYPES_H],
+[
+  AC_CACHE_CHECK([for inttypes.h], gl_cv_header_inttypes_h,
+  [AC_TRY_COMPILE(
+    [#include <sys/types.h>
+#include <inttypes.h>],
+    [uintmax_t i = (uintmax_t) -1; return !i;],
+    gl_cv_header_inttypes_h=yes,
+    gl_cv_header_inttypes_h=no)])
+  if test $gl_cv_header_inttypes_h = yes; then
+    AC_DEFINE_UNQUOTED(HAVE_INTTYPES_H_WITH_UINTMAX, 1,
+      [Define if <inttypes.h> exists, doesn't clash with <sys/types.h>,
+       and declares uintmax_t. ])
+  fi
+])
diff --git a/config/gnulib/lib-ld.m4 b/config/gnulib/lib-ld.m4
new file mode 100644 (file)
index 0000000..96c4e2c
--- /dev/null
@@ -0,0 +1,110 @@
+# lib-ld.m4 serial 3 (gettext-0.13)
+dnl Copyright (C) 1996-2003 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Subroutines of libtool.m4,
+dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision
+dnl with libtool.m4.
+
+dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no.
+AC_DEFUN([AC_LIB_PROG_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  acl_cv_prog_gnu_ld=yes ;;
+*)
+  acl_cv_prog_gnu_ld=no ;;
+esac])
+with_gnu_ld=$acl_cv_prog_gnu_ld
+])
+
+dnl From libtool-1.4. Sets the variable LD.
+AC_DEFUN([AC_LIB_PROG_LD],
+[AC_ARG_WITH(gnu-ld,
+[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
+test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  AC_MSG_CHECKING([for ld used by GCC])
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [[\\/]* | [A-Za-z]:[\\/]*)]
+      [re_direlt='/[^/][^/]*/\.\./']
+      # Canonicalize the path of ld
+      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+       ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  AC_MSG_CHECKING([for GNU ld])
+else
+  AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(acl_cv_path_LD,
+[if test -z "$LD"; then
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+  for ac_dir in $PATH; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      acl_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some GNU ld's only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
+      *GNU* | *'with BFD'*)
+       test "$with_gnu_ld" != no && break ;;
+      *)
+       test "$with_gnu_ld" != yes && break ;;
+      esac
+    fi
+  done
+  IFS="$ac_save_ifs"
+else
+  acl_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$acl_cv_path_LD"
+if test -n "$LD"; then
+  AC_MSG_RESULT($LD)
+else
+  AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+AC_LIB_PROG_LD_GNU
+])
diff --git a/config/gnulib/lib-link.m4 b/config/gnulib/lib-link.m4
new file mode 100644 (file)
index 0000000..f157d98
--- /dev/null
@@ -0,0 +1,709 @@
+# lib-link.m4 serial 13 (gettext-0.16.2)
+dnl Copyright (C) 2001-2007 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+AC_PREREQ(2.54)
+
+dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
+dnl the libraries corresponding to explicit and implicit dependencies.
+dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and
+dnl augments the CPPFLAGS variable.
+dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
+dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
+AC_DEFUN([AC_LIB_LINKFLAGS],
+[
+  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+  AC_REQUIRE([AC_LIB_RPATH])
+  define([Name],[translit([$1],[./-], [___])])
+  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
+                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+  AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [
+    AC_LIB_LINKFLAGS_BODY([$1], [$2])
+    ac_cv_lib[]Name[]_libs="$LIB[]NAME"
+    ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME"
+    ac_cv_lib[]Name[]_cppflags="$INC[]NAME"
+    ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX"
+  ])
+  LIB[]NAME="$ac_cv_lib[]Name[]_libs"
+  LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs"
+  INC[]NAME="$ac_cv_lib[]Name[]_cppflags"
+  LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix"
+  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
+  AC_SUBST([LIB]NAME)
+  AC_SUBST([LTLIB]NAME)
+  AC_SUBST([LIB]NAME[_PREFIX])
+  dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the
+  dnl results of this search when this library appears as a dependency.
+  HAVE_LIB[]NAME=yes
+  undefine([Name])
+  undefine([NAME])
+])
+
+dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode)
+dnl searches for libname and the libraries corresponding to explicit and
+dnl implicit dependencies, together with the specified include files and
+dnl the ability to compile and link the specified testcode. If found, it
+dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and
+dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and
+dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs
+dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty.
+dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname
+dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
+AC_DEFUN([AC_LIB_HAVE_LINKFLAGS],
+[
+  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+  AC_REQUIRE([AC_LIB_RPATH])
+  define([Name],[translit([$1],[./-], [___])])
+  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
+                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+
+  dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME
+  dnl accordingly.
+  AC_LIB_LINKFLAGS_BODY([$1], [$2])
+
+  dnl Add $INC[]NAME to CPPFLAGS before performing the following checks,
+  dnl because if the user has installed lib[]Name and not disabled its use
+  dnl via --without-lib[]Name-prefix, he wants to use it.
+  ac_save_CPPFLAGS="$CPPFLAGS"
+  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME)
+
+  AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [
+    ac_save_LIBS="$LIBS"
+    LIBS="$LIBS $LIB[]NAME"
+    AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no])
+    LIBS="$ac_save_LIBS"
+  ])
+  if test "$ac_cv_lib[]Name" = yes; then
+    HAVE_LIB[]NAME=yes
+    AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.])
+    AC_MSG_CHECKING([how to link with lib[]$1])
+    AC_MSG_RESULT([$LIB[]NAME])
+  else
+    HAVE_LIB[]NAME=no
+    dnl If $LIB[]NAME didn't lead to a usable library, we don't need
+    dnl $INC[]NAME either.
+    CPPFLAGS="$ac_save_CPPFLAGS"
+    LIB[]NAME=
+    LTLIB[]NAME=
+    LIB[]NAME[]_PREFIX=
+  fi
+  AC_SUBST([HAVE_LIB]NAME)
+  AC_SUBST([LIB]NAME)
+  AC_SUBST([LTLIB]NAME)
+  AC_SUBST([LIB]NAME[_PREFIX])
+  undefine([Name])
+  undefine([NAME])
+])
+
+dnl Determine the platform dependent parameters needed to use rpath:
+dnl   acl_libext,
+dnl   acl_shlibext,
+dnl   acl_hardcode_libdir_flag_spec,
+dnl   acl_hardcode_libdir_separator,
+dnl   acl_hardcode_direct,
+dnl   acl_hardcode_minus_L.
+AC_DEFUN([AC_LIB_RPATH],
+[
+  dnl Tell automake >= 1.10 to complain if config.rpath is missing.
+  m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
+  AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
+  AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
+  AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
+  AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir
+  AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [
+    CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
+    ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
+    . ./conftest.sh
+    rm -f ./conftest.sh
+    acl_cv_rpath=done
+  ])
+  wl="$acl_cv_wl"
+  acl_libext="$acl_cv_libext"
+  acl_shlibext="$acl_cv_shlibext"
+  acl_libname_spec="$acl_cv_libname_spec"
+  acl_library_names_spec="$acl_cv_library_names_spec"
+  acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
+  acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
+  acl_hardcode_direct="$acl_cv_hardcode_direct"
+  acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
+  dnl Determine whether the user wants rpath handling at all.
+  AC_ARG_ENABLE(rpath,
+    [  --disable-rpath         do not hardcode runtime library paths],
+    :, enable_rpath=yes)
+])
+
+dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and
+dnl the libraries corresponding to explicit and implicit dependencies.
+dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables.
+dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found
+dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem.
+AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
+[
+  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
+  define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-],
+                               [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])])
+  dnl Autoconf >= 2.61 supports dots in --with options.
+  define([N_A_M_E],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit([$1],[.],[_])],[$1])])
+  dnl By default, look in $includedir and $libdir.
+  use_additional=yes
+  AC_LIB_WITH_FINAL_PREFIX([
+    eval additional_includedir=\"$includedir\"
+    eval additional_libdir=\"$libdir\"
+  ])
+  AC_LIB_ARG_WITH([lib]N_A_M_E[-prefix],
+[  --with-lib]N_A_M_E[-prefix[=DIR]  search for lib$1 in DIR/include and DIR/lib
+  --without-lib]N_A_M_E[-prefix     don't search for lib$1 in includedir and libdir],
+[
+    if test "X$withval" = "Xno"; then
+      use_additional=no
+    else
+      if test "X$withval" = "X"; then
+        AC_LIB_WITH_FINAL_PREFIX([
+          eval additional_includedir=\"$includedir\"
+          eval additional_libdir=\"$libdir\"
+        ])
+      else
+        additional_includedir="$withval/include"
+        additional_libdir="$withval/$acl_libdirstem"
+      fi
+    fi
+])
+  dnl Search the library and its dependencies in $additional_libdir and
+  dnl $LDFLAGS. Using breadth-first-seach.
+  LIB[]NAME=
+  LTLIB[]NAME=
+  INC[]NAME=
+  LIB[]NAME[]_PREFIX=
+  rpathdirs=
+  ltrpathdirs=
+  names_already_handled=
+  names_next_round='$1 $2'
+  while test -n "$names_next_round"; do
+    names_this_round="$names_next_round"
+    names_next_round=
+    for name in $names_this_round; do
+      already_handled=
+      for n in $names_already_handled; do
+        if test "$n" = "$name"; then
+          already_handled=yes
+          break
+        fi
+      done
+      if test -z "$already_handled"; then
+        names_already_handled="$names_already_handled $name"
+        dnl See if it was already located by an earlier AC_LIB_LINKFLAGS
+        dnl or AC_LIB_HAVE_LINKFLAGS call.
+        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
+        eval value=\"\$HAVE_LIB$uppername\"
+        if test -n "$value"; then
+          if test "$value" = yes; then
+            eval value=\"\$LIB$uppername\"
+            test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value"
+            eval value=\"\$LTLIB$uppername\"
+            test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value"
+          else
+            dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined
+            dnl that this library doesn't exist. So just drop it.
+            :
+          fi
+        else
+          dnl Search the library lib$name in $additional_libdir and $LDFLAGS
+          dnl and the already constructed $LIBNAME/$LTLIBNAME.
+          found_dir=
+          found_la=
+          found_so=
+          found_a=
+          eval libname=\"$acl_libname_spec\"    # typically: libname=lib$name
+          if test -n "$acl_shlibext"; then
+            shrext=".$acl_shlibext"             # typically: shrext=.so
+          else
+            shrext=
+          fi
+          if test $use_additional = yes; then
+            dir="$additional_libdir"
+            dnl The same code as in the loop below:
+            dnl First look for a shared library.
+            if test -n "$acl_shlibext"; then
+              if test -f "$dir/$libname$shrext"; then
+                found_dir="$dir"
+                found_so="$dir/$libname$shrext"
+              else
+                if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+                  ver=`(cd "$dir" && \
+                        for f in "$libname$shrext".*; do echo "$f"; done \
+                        | sed -e "s,^$libname$shrext\\\\.,," \
+                        | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+                        | sed 1q ) 2>/dev/null`
+                  if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
+                    found_dir="$dir"
+                    found_so="$dir/$libname$shrext.$ver"
+                  fi
+                else
+                  eval library_names=\"$acl_library_names_spec\"
+                  for f in $library_names; do
+                    if test -f "$dir/$f"; then
+                      found_dir="$dir"
+                      found_so="$dir/$f"
+                      break
+                    fi
+                  done
+                fi
+              fi
+            fi
+            dnl Then look for a static library.
+            if test "X$found_dir" = "X"; then
+              if test -f "$dir/$libname.$acl_libext"; then
+                found_dir="$dir"
+                found_a="$dir/$libname.$acl_libext"
+              fi
+            fi
+            if test "X$found_dir" != "X"; then
+              if test -f "$dir/$libname.la"; then
+                found_la="$dir/$libname.la"
+              fi
+            fi
+          fi
+          if test "X$found_dir" = "X"; then
+            for x in $LDFLAGS $LTLIB[]NAME; do
+              AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+              case "$x" in
+                -L*)
+                  dir=`echo "X$x" | sed -e 's/^X-L//'`
+                  dnl First look for a shared library.
+                  if test -n "$acl_shlibext"; then
+                    if test -f "$dir/$libname$shrext"; then
+                      found_dir="$dir"
+                      found_so="$dir/$libname$shrext"
+                    else
+                      if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+                        ver=`(cd "$dir" && \
+                              for f in "$libname$shrext".*; do echo "$f"; done \
+                              | sed -e "s,^$libname$shrext\\\\.,," \
+                              | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+                              | sed 1q ) 2>/dev/null`
+                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
+                          found_dir="$dir"
+                          found_so="$dir/$libname$shrext.$ver"
+                        fi
+                      else
+                        eval library_names=\"$acl_library_names_spec\"
+                        for f in $library_names; do
+                          if test -f "$dir/$f"; then
+                            found_dir="$dir"
+                            found_so="$dir/$f"
+                            break
+                          fi
+                        done
+                      fi
+                    fi
+                  fi
+                  dnl Then look for a static library.
+                  if test "X$found_dir" = "X"; then
+                    if test -f "$dir/$libname.$acl_libext"; then
+                      found_dir="$dir"
+                      found_a="$dir/$libname.$acl_libext"
+                    fi
+                  fi
+                  if test "X$found_dir" != "X"; then
+                    if test -f "$dir/$libname.la"; then
+                      found_la="$dir/$libname.la"
+                    fi
+                  fi
+                  ;;
+              esac
+              if test "X$found_dir" != "X"; then
+                break
+              fi
+            done
+          fi
+          if test "X$found_dir" != "X"; then
+            dnl Found the library.
+            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name"
+            if test "X$found_so" != "X"; then
+              dnl Linking with a shared library. We attempt to hardcode its
+              dnl directory into the executable's runpath, unless it's the
+              dnl standard /usr/lib.
+              if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then
+                dnl No hardcoding is needed.
+                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+              else
+                dnl Use an explicit option to hardcode DIR into the resulting
+                dnl binary.
+                dnl Potentially add DIR to ltrpathdirs.
+                dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
+                haveit=
+                for x in $ltrpathdirs; do
+                  if test "X$x" = "X$found_dir"; then
+                    haveit=yes
+                    break
+                  fi
+                done
+                if test -z "$haveit"; then
+                  ltrpathdirs="$ltrpathdirs $found_dir"
+                fi
+                dnl The hardcoding into $LIBNAME is system dependent.
+                if test "$acl_hardcode_direct" = yes; then
+                  dnl Using DIR/libNAME.so during linking hardcodes DIR into the
+                  dnl resulting binary.
+                  LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+                else
+                  if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
+                    dnl Use an explicit option to hardcode DIR into the resulting
+                    dnl binary.
+                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+                    dnl Potentially add DIR to rpathdirs.
+                    dnl The rpathdirs will be appended to $LIBNAME at the end.
+                    haveit=
+                    for x in $rpathdirs; do
+                      if test "X$x" = "X$found_dir"; then
+                        haveit=yes
+                        break
+                      fi
+                    done
+                    if test -z "$haveit"; then
+                      rpathdirs="$rpathdirs $found_dir"
+                    fi
+                  else
+                    dnl Rely on "-L$found_dir".
+                    dnl But don't add it if it's already contained in the LDFLAGS
+                    dnl or the already constructed $LIBNAME
+                    haveit=
+                    for x in $LDFLAGS $LIB[]NAME; do
+                      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+                      if test "X$x" = "X-L$found_dir"; then
+                        haveit=yes
+                        break
+                      fi
+                    done
+                    if test -z "$haveit"; then
+                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir"
+                    fi
+                    if test "$acl_hardcode_minus_L" != no; then
+                      dnl FIXME: Not sure whether we should use
+                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
+                      dnl here.
+                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
+                    else
+                      dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH
+                      dnl here, because this doesn't fit in flags passed to the
+                      dnl compiler. So give up. No hardcoding. This affects only
+                      dnl very old systems.
+                      dnl FIXME: Not sure whether we should use
+                      dnl "-L$found_dir -l$name" or "-L$found_dir $found_so"
+                      dnl here.
+                      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
+                    fi
+                  fi
+                fi
+              fi
+            else
+              if test "X$found_a" != "X"; then
+                dnl Linking with a static library.
+                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a"
+              else
+                dnl We shouldn't come here, but anyway it's good to have a
+                dnl fallback.
+                LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name"
+              fi
+            fi
+            dnl Assume the include files are nearby.
+            additional_includedir=
+            case "$found_dir" in
+              */$acl_libdirstem | */$acl_libdirstem/)
+                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
+                LIB[]NAME[]_PREFIX="$basedir"
+                additional_includedir="$basedir/include"
+                ;;
+            esac
+            if test "X$additional_includedir" != "X"; then
+              dnl Potentially add $additional_includedir to $INCNAME.
+              dnl But don't add it
+              dnl   1. if it's the standard /usr/include,
+              dnl   2. if it's /usr/local/include and we are using GCC on Linux,
+              dnl   3. if it's already present in $CPPFLAGS or the already
+              dnl      constructed $INCNAME,
+              dnl   4. if it doesn't exist as a directory.
+              if test "X$additional_includedir" != "X/usr/include"; then
+                haveit=
+                if test "X$additional_includedir" = "X/usr/local/include"; then
+                  if test -n "$GCC"; then
+                    case $host_os in
+                      linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+                    esac
+                  fi
+                fi
+                if test -z "$haveit"; then
+                  for x in $CPPFLAGS $INC[]NAME; do
+                    AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+                    if test "X$x" = "X-I$additional_includedir"; then
+                      haveit=yes
+                      break
+                    fi
+                  done
+                  if test -z "$haveit"; then
+                    if test -d "$additional_includedir"; then
+                      dnl Really add $additional_includedir to $INCNAME.
+                      INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir"
+                    fi
+                  fi
+                fi
+              fi
+            fi
+            dnl Look for dependencies.
+            if test -n "$found_la"; then
+              dnl Read the .la file. It defines the variables
+              dnl dlname, library_names, old_library, dependency_libs, current,
+              dnl age, revision, installed, dlopen, dlpreopen, libdir.
+              save_libdir="$libdir"
+              case "$found_la" in
+                */* | *\\*) . "$found_la" ;;
+                *) . "./$found_la" ;;
+              esac
+              libdir="$save_libdir"
+              dnl We use only dependency_libs.
+              for dep in $dependency_libs; do
+                case "$dep" in
+                  -L*)
+                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
+                    dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
+                    dnl But don't add it
+                    dnl   1. if it's the standard /usr/lib,
+                    dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
+                    dnl   3. if it's already present in $LDFLAGS or the already
+                    dnl      constructed $LIBNAME,
+                    dnl   4. if it doesn't exist as a directory.
+                    if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
+                      haveit=
+                      if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
+                        if test -n "$GCC"; then
+                          case $host_os in
+                            linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+                          esac
+                        fi
+                      fi
+                      if test -z "$haveit"; then
+                        haveit=
+                        for x in $LDFLAGS $LIB[]NAME; do
+                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+                          if test "X$x" = "X-L$additional_libdir"; then
+                            haveit=yes
+                            break
+                          fi
+                        done
+                        if test -z "$haveit"; then
+                          if test -d "$additional_libdir"; then
+                            dnl Really add $additional_libdir to $LIBNAME.
+                            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
+                          fi
+                        fi
+                        haveit=
+                        for x in $LDFLAGS $LTLIB[]NAME; do
+                          AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+                          if test "X$x" = "X-L$additional_libdir"; then
+                            haveit=yes
+                            break
+                          fi
+                        done
+                        if test -z "$haveit"; then
+                          if test -d "$additional_libdir"; then
+                            dnl Really add $additional_libdir to $LTLIBNAME.
+                            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
+                          fi
+                        fi
+                      fi
+                    fi
+                    ;;
+                  -R*)
+                    dir=`echo "X$dep" | sed -e 's/^X-R//'`
+                    if test "$enable_rpath" != no; then
+                      dnl Potentially add DIR to rpathdirs.
+                      dnl The rpathdirs will be appended to $LIBNAME at the end.
+                      haveit=
+                      for x in $rpathdirs; do
+                        if test "X$x" = "X$dir"; then
+                          haveit=yes
+                          break
+                        fi
+                      done
+                      if test -z "$haveit"; then
+                        rpathdirs="$rpathdirs $dir"
+                      fi
+                      dnl Potentially add DIR to ltrpathdirs.
+                      dnl The ltrpathdirs will be appended to $LTLIBNAME at the end.
+                      haveit=
+                      for x in $ltrpathdirs; do
+                        if test "X$x" = "X$dir"; then
+                          haveit=yes
+                          break
+                        fi
+                      done
+                      if test -z "$haveit"; then
+                        ltrpathdirs="$ltrpathdirs $dir"
+                      fi
+                    fi
+                    ;;
+                  -l*)
+                    dnl Handle this in the next round.
+                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
+                    ;;
+                  *.la)
+                    dnl Handle this in the next round. Throw away the .la's
+                    dnl directory; it is already contained in a preceding -L
+                    dnl option.
+                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
+                    ;;
+                  *)
+                    dnl Most likely an immediate library name.
+                    LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep"
+                    LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep"
+                    ;;
+                esac
+              done
+            fi
+          else
+            dnl Didn't find the library; assume it is in the system directories
+            dnl known to the linker and runtime loader. (All the system
+            dnl directories known to the linker should also be known to the
+            dnl runtime loader, otherwise the system is severely misconfigured.)
+            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name"
+            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name"
+          fi
+        fi
+      fi
+    done
+  done
+  if test "X$rpathdirs" != "X"; then
+    if test -n "$acl_hardcode_libdir_separator"; then
+      dnl Weird platform: only the last -rpath option counts, the user must
+      dnl pass all path elements in one option. We can arrange that for a
+      dnl single library, but not when more than one $LIBNAMEs are used.
+      alldirs=
+      for found_dir in $rpathdirs; do
+        alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
+      done
+      dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl.
+      acl_save_libdir="$libdir"
+      libdir="$alldirs"
+      eval flag=\"$acl_hardcode_libdir_flag_spec\"
+      libdir="$acl_save_libdir"
+      LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
+    else
+      dnl The -rpath options are cumulative.
+      for found_dir in $rpathdirs; do
+        acl_save_libdir="$libdir"
+        libdir="$found_dir"
+        eval flag=\"$acl_hardcode_libdir_flag_spec\"
+        libdir="$acl_save_libdir"
+        LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag"
+      done
+    fi
+  fi
+  if test "X$ltrpathdirs" != "X"; then
+    dnl When using libtool, the option that works for both libraries and
+    dnl executables is -R. The -R options are cumulative.
+    for found_dir in $ltrpathdirs; do
+      LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
+    done
+  fi
+])
+
+dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR,
+dnl unless already present in VAR.
+dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes
+dnl contains two or three consecutive elements that belong together.
+AC_DEFUN([AC_LIB_APPENDTOVAR],
+[
+  for element in [$2]; do
+    haveit=
+    for x in $[$1]; do
+      AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+      if test "X$x" = "X$element"; then
+        haveit=yes
+        break
+      fi
+    done
+    if test -z "$haveit"; then
+      [$1]="${[$1]}${[$1]:+ }$element"
+    fi
+  done
+])
+
+dnl For those cases where a variable contains several -L and -l options
+dnl referring to unknown libraries and directories, this macro determines the
+dnl necessary additional linker options for the runtime path.
+dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL])
+dnl sets LDADDVAR to linker options needed together with LIBSVALUE.
+dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed,
+dnl otherwise linking without libtool is assumed.
+AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
+[
+  AC_REQUIRE([AC_LIB_RPATH])
+  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
+  $1=
+  if test "$enable_rpath" != no; then
+    if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
+      dnl Use an explicit option to hardcode directories into the resulting
+      dnl binary.
+      rpathdirs=
+      next=
+      for opt in $2; do
+        if test -n "$next"; then
+          dir="$next"
+          dnl No need to hardcode the standard /usr/lib.
+          if test "X$dir" != "X/usr/$acl_libdirstem"; then
+            rpathdirs="$rpathdirs $dir"
+          fi
+          next=
+        else
+          case $opt in
+            -L) next=yes ;;
+            -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
+                 dnl No need to hardcode the standard /usr/lib.
+                 if test "X$dir" != "X/usr/$acl_libdirstem"; then
+                   rpathdirs="$rpathdirs $dir"
+                 fi
+                 next= ;;
+            *) next= ;;
+          esac
+        fi
+      done
+      if test "X$rpathdirs" != "X"; then
+        if test -n ""$3""; then
+          dnl libtool is used for linking. Use -R options.
+          for dir in $rpathdirs; do
+            $1="${$1}${$1:+ }-R$dir"
+          done
+        else
+          dnl The linker is used for linking directly.
+          if test -n "$acl_hardcode_libdir_separator"; then
+            dnl Weird platform: only the last -rpath option counts, the user
+            dnl must pass all path elements in one option.
+            alldirs=
+            for dir in $rpathdirs; do
+              alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir"
+            done
+            acl_save_libdir="$libdir"
+            libdir="$alldirs"
+            eval flag=\"$acl_hardcode_libdir_flag_spec\"
+            libdir="$acl_save_libdir"
+            $1="$flag"
+          else
+            dnl The -rpath options are cumulative.
+            for dir in $rpathdirs; do
+              acl_save_libdir="$libdir"
+              libdir="$dir"
+              eval flag=\"$acl_hardcode_libdir_flag_spec\"
+              libdir="$acl_save_libdir"
+              $1="${$1}${$1:+ }$flag"
+            done
+          fi
+        fi
+      fi
+    fi
+  fi
+  AC_SUBST([$1])
+])
diff --git a/config/gnulib/lib-prefix.m4 b/config/gnulib/lib-prefix.m4
new file mode 100644 (file)
index 0000000..a8684e1
--- /dev/null
@@ -0,0 +1,185 @@
+# lib-prefix.m4 serial 5 (gettext-0.15)
+dnl Copyright (C) 2001-2005 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
+dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
+dnl require excessive bracketing.
+ifdef([AC_HELP_STRING],
+[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
+[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
+
+dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
+dnl to access previously installed libraries. The basic assumption is that
+dnl a user will want packages to use other packages he previously installed
+dnl with the same --prefix option.
+dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate
+dnl libraries, but is otherwise very convenient.
+AC_DEFUN([AC_LIB_PREFIX],
+[
+  AC_BEFORE([$0], [AC_LIB_LINKFLAGS])
+  AC_REQUIRE([AC_PROG_CC])
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  AC_REQUIRE([AC_LIB_PREPARE_MULTILIB])
+  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+  dnl By default, look in $includedir and $libdir.
+  use_additional=yes
+  AC_LIB_WITH_FINAL_PREFIX([
+    eval additional_includedir=\"$includedir\"
+    eval additional_libdir=\"$libdir\"
+  ])
+  AC_LIB_ARG_WITH([lib-prefix],
+[  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
+  --without-lib-prefix    don't search for libraries in includedir and libdir],
+[
+    if test "X$withval" = "Xno"; then
+      use_additional=no
+    else
+      if test "X$withval" = "X"; then
+        AC_LIB_WITH_FINAL_PREFIX([
+          eval additional_includedir=\"$includedir\"
+          eval additional_libdir=\"$libdir\"
+        ])
+      else
+        additional_includedir="$withval/include"
+        additional_libdir="$withval/$acl_libdirstem"
+      fi
+    fi
+])
+  if test $use_additional = yes; then
+    dnl Potentially add $additional_includedir to $CPPFLAGS.
+    dnl But don't add it
+    dnl   1. if it's the standard /usr/include,
+    dnl   2. if it's already present in $CPPFLAGS,
+    dnl   3. if it's /usr/local/include and we are using GCC on Linux,
+    dnl   4. if it doesn't exist as a directory.
+    if test "X$additional_includedir" != "X/usr/include"; then
+      haveit=
+      for x in $CPPFLAGS; do
+        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+        if test "X$x" = "X-I$additional_includedir"; then
+          haveit=yes
+          break
+        fi
+      done
+      if test -z "$haveit"; then
+        if test "X$additional_includedir" = "X/usr/local/include"; then
+          if test -n "$GCC"; then
+            case $host_os in
+              linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+            esac
+          fi
+        fi
+        if test -z "$haveit"; then
+          if test -d "$additional_includedir"; then
+            dnl Really add $additional_includedir to $CPPFLAGS.
+            CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir"
+          fi
+        fi
+      fi
+    fi
+    dnl Potentially add $additional_libdir to $LDFLAGS.
+    dnl But don't add it
+    dnl   1. if it's the standard /usr/lib,
+    dnl   2. if it's already present in $LDFLAGS,
+    dnl   3. if it's /usr/local/lib and we are using GCC on Linux,
+    dnl   4. if it doesn't exist as a directory.
+    if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
+      haveit=
+      for x in $LDFLAGS; do
+        AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
+        if test "X$x" = "X-L$additional_libdir"; then
+          haveit=yes
+          break
+        fi
+      done
+      if test -z "$haveit"; then
+        if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
+          if test -n "$GCC"; then
+            case $host_os in
+              linux*) haveit=yes;;
+            esac
+          fi
+        fi
+        if test -z "$haveit"; then
+          if test -d "$additional_libdir"; then
+            dnl Really add $additional_libdir to $LDFLAGS.
+            LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir"
+          fi
+        fi
+      fi
+    fi
+  fi
+])
+
+dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix,
+dnl acl_final_exec_prefix, containing the values to which $prefix and
+dnl $exec_prefix will expand at the end of the configure script.
+AC_DEFUN([AC_LIB_PREPARE_PREFIX],
+[
+  dnl Unfortunately, prefix and exec_prefix get only finally determined
+  dnl at the end of configure.
+  if test "X$prefix" = "XNONE"; then
+    acl_final_prefix="$ac_default_prefix"
+  else
+    acl_final_prefix="$prefix"
+  fi
+  if test "X$exec_prefix" = "XNONE"; then
+    acl_final_exec_prefix='${prefix}'
+  else
+    acl_final_exec_prefix="$exec_prefix"
+  fi
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
+  prefix="$acl_save_prefix"
+])
+
+dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the
+dnl variables prefix and exec_prefix bound to the values they will have
+dnl at the end of the configure script.
+AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
+[
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  $1
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+])
+
+dnl AC_LIB_PREPARE_MULTILIB creates a variable acl_libdirstem, containing
+dnl the basename of the libdir, either "lib" or "lib64".
+AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
+[
+  dnl There is no formal standard regarding lib and lib64. The current
+  dnl practice is that on a system supporting 32-bit and 64-bit instruction
+  dnl sets or ABIs, 64-bit libraries go under $prefix/lib64 and 32-bit
+  dnl libraries go under $prefix/lib. We determine the compiler's default
+  dnl mode by looking at the compiler's library search path. If at least
+  dnl of its elements ends in /lib64 or points to a directory whose absolute
+  dnl pathname ends in /lib64, we assume a 64-bit ABI. Otherwise we use the
+  dnl default, namely "lib".
+  acl_libdirstem=lib
+  searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
+  if test -n "$searchpath"; then
+    acl_save_IFS="${IFS=       }"; IFS=":"
+    for searchdir in $searchpath; do
+      if test -d "$searchdir"; then
+        case "$searchdir" in
+          */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
+          *) searchdir=`cd "$searchdir" && pwd`
+             case "$searchdir" in
+               */lib64 ) acl_libdirstem=lib64 ;;
+             esac ;;
+        esac
+      fi
+    done
+    IFS="$acl_save_IFS"
+  fi
+])
diff --git a/config/gnulib/lock.m4 b/config/gnulib/lock.m4
new file mode 100644 (file)
index 0000000..0224f2f
--- /dev/null
@@ -0,0 +1,311 @@
+# lock.m4 serial 6 (gettext-0.16)
+dnl Copyright (C) 2005-2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+dnl Tests for a multithreading library to be used.
+dnl Defines at most one of the macros USE_POSIX_THREADS, USE_SOLARIS_THREADS,
+dnl USE_PTH_THREADS, USE_WIN32_THREADS
+dnl Sets the variables LIBTHREAD and LTLIBTHREAD to the linker options for use
+dnl in a Makefile (LIBTHREAD for use without libtool, LTLIBTHREAD for use with
+dnl libtool).
+dnl Sets the variables LIBMULTITHREAD and LTLIBMULTITHREAD similarly, for
+dnl programs that really need multithread functionality. The difference
+dnl between LIBTHREAD and LIBMULTITHREAD is that on platforms supporting weak
+dnl symbols, typically LIBTHREAD="" whereas LIBMULTITHREAD="-lpthread".
+dnl Adds to CPPFLAGS the flag -D_REENTRANT or -D_THREAD_SAFE if needed for
+dnl multithread-safe programs.
+
+AC_DEFUN([gl_LOCK_EARLY],
+[
+  AC_REQUIRE([gl_LOCK_EARLY_BODY])
+])
+
+dnl The guts of gl_LOCK_EARLY. Needs to be expanded only once.
+
+AC_DEFUN([gl_LOCK_EARLY_BODY],
+[
+  dnl Ordering constraints: This macro modifies CPPFLAGS in a way that
+  dnl influences the result of the autoconf tests that test for *_unlocked
+  dnl declarations, on AIX 5 at least. Therefore it must come early.
+  AC_BEFORE([$0], [gl_FUNC_GLIBC_UNLOCKED_IO])dnl
+  AC_BEFORE([$0], [gl_ARGP])dnl
+
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  AC_REQUIRE([AC_GNU_SOURCE]) dnl needed for pthread_rwlock_t on glibc systems
+  dnl Check for multithreading.
+  AC_ARG_ENABLE(threads,
+AC_HELP_STRING([--enable-threads={posix|solaris|pth|win32}], [specify multithreading API])
+AC_HELP_STRING([--disable-threads], [build without multithread safety]),
+    [gl_use_threads=$enableval],
+    [case "$host_os" in
+       dnl Disable multithreading by default on OSF/1, because it interferes
+       dnl with fork()/exec(): When msgexec is linked with -lpthread, its child
+       dnl process gets an endless segmentation fault inside execvp().
+       osf*) gl_use_threads=no ;;
+       *)    gl_use_threads=yes ;;
+     esac
+    ])
+  if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
+    # For using <pthread.h>:
+    case "$host_os" in
+      osf*)
+        # On OSF/1, the compiler needs the flag -D_REENTRANT so that it
+        # groks <pthread.h>. cc also understands the flag -pthread, but
+        # we don't use it because 1. gcc-2.95 doesn't understand -pthread,
+        # 2. putting a flag into CPPFLAGS that has an effect on the linker
+        # causes the AC_TRY_LINK test below to succeed unexpectedly,
+        # leading to wrong values of LIBTHREAD and LTLIBTHREAD.
+        CPPFLAGS="$CPPFLAGS -D_REENTRANT"
+        ;;
+    esac
+    # Some systems optimize for single-threaded programs by default, and
+    # need special flags to disable these optimizations. For example, the
+    # definition of 'errno' in <errno.h>.
+    case "$host_os" in
+      aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;;
+      solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;;
+    esac
+  fi
+])
+
+dnl The guts of gl_LOCK. Needs to be expanded only once.
+
+AC_DEFUN([gl_LOCK_BODY],
+[
+  AC_REQUIRE([gl_LOCK_EARLY_BODY])
+  gl_threads_api=none
+  LIBTHREAD=
+  LTLIBTHREAD=
+  LIBMULTITHREAD=
+  LTLIBMULTITHREAD=
+  if test "$gl_use_threads" != no; then
+    dnl Check whether the compiler and linker support weak declarations.
+    AC_MSG_CHECKING([whether imported symbols can be declared weak])
+    gl_have_weak=no
+    AC_TRY_LINK([extern void xyzzy ();
+#pragma weak xyzzy], [xyzzy();], [gl_have_weak=yes])
+    AC_MSG_RESULT([$gl_have_weak])
+    if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
+      # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
+      # it groks <pthread.h>. It's added above, in gl_LOCK_EARLY_BODY.
+      AC_CHECK_HEADER(pthread.h, gl_have_pthread_h=yes, gl_have_pthread_h=no)
+      if test "$gl_have_pthread_h" = yes; then
+        # Other possible tests:
+        #   -lpthreads (FSU threads, PCthreads)
+        #   -lgthreads
+        gl_have_pthread=
+        # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
+        # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
+        # the second one only in libpthread, and lock.c needs it.
+        AC_TRY_LINK([#include <pthread.h>],
+          [pthread_mutex_lock((pthread_mutex_t*)0);
+           pthread_mutexattr_init((pthread_mutexattr_t*)0);],
+          [gl_have_pthread=yes])
+        # Test for libpthread by looking for pthread_kill. (Not pthread_self,
+        # since it is defined as a macro on OSF/1.)
+        if test -n "$gl_have_pthread"; then
+          # The program links fine without libpthread. But it may actually
+          # need to link with libpthread in order to create multiple threads.
+          AC_CHECK_LIB(pthread, pthread_kill,
+            [LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread
+             # On Solaris and HP-UX, most pthread functions exist also in libc.
+             # Therefore pthread_in_use() needs to actually try to create a
+             # thread: pthread_create from libc will fail, whereas
+             # pthread_create will actually create a thread.
+             case "$host_os" in
+               solaris* | hpux*)
+                 AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], 1,
+                   [Define if the pthread_in_use() detection is hard.])
+             esac
+            ])
+        else
+          # Some library is needed. Try libpthread and libc_r.
+          AC_CHECK_LIB(pthread, pthread_kill,
+            [gl_have_pthread=yes
+             LIBTHREAD=-lpthread LTLIBTHREAD=-lpthread
+             LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread])
+          if test -z "$gl_have_pthread"; then
+            # For FreeBSD 4.
+            AC_CHECK_LIB(c_r, pthread_kill,
+              [gl_have_pthread=yes
+               LIBTHREAD=-lc_r LTLIBTHREAD=-lc_r
+               LIBMULTITHREAD=-lc_r LTLIBMULTITHREAD=-lc_r])
+          fi
+        fi
+        if test -n "$gl_have_pthread"; then
+          gl_threads_api=posix
+          AC_DEFINE([USE_POSIX_THREADS], 1,
+            [Define if the POSIX multithreading library can be used.])
+          if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
+            if test $gl_have_weak = yes; then
+              AC_DEFINE([USE_POSIX_THREADS_WEAK], 1,
+                [Define if references to the POSIX multithreading library should be made weak.])
+              LIBTHREAD=
+              LTLIBTHREAD=
+            fi
+          fi
+          # OSF/1 4.0 and MacOS X 10.1 lack the pthread_rwlock_t type and the
+          # pthread_rwlock_* functions.
+          AC_CHECK_TYPE([pthread_rwlock_t],
+            [AC_DEFINE([HAVE_PTHREAD_RWLOCK], 1,
+               [Define if the POSIX multithreading library has read/write locks.])],
+            [],
+            [#include <pthread.h>])
+          # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro.
+          AC_TRY_COMPILE([#include <pthread.h>],
+            [#if __FreeBSD__ == 4
+error "No, in FreeBSD 4.0 recursive mutexes actually don't work."
+#else
+int x = (int)PTHREAD_MUTEX_RECURSIVE;
+return !x;
+#endif],
+            [AC_DEFINE([HAVE_PTHREAD_MUTEX_RECURSIVE], 1,
+               [Define if the <pthread.h> defines PTHREAD_MUTEX_RECURSIVE.])])
+        fi
+      fi
+    fi
+    if test -z "$gl_have_pthread"; then
+      if test "$gl_use_threads" = yes || test "$gl_use_threads" = solaris; then
+        gl_have_solaristhread=
+        gl_save_LIBS="$LIBS"
+        LIBS="$LIBS -lthread"
+        AC_TRY_LINK([#include <thread.h>
+#include <synch.h>],
+          [thr_self();],
+          [gl_have_solaristhread=yes])
+        LIBS="$gl_save_LIBS"
+        if test -n "$gl_have_solaristhread"; then
+          gl_threads_api=solaris
+          LIBTHREAD=-lthread
+          LTLIBTHREAD=-lthread
+          LIBMULTITHREAD="$LIBTHREAD"
+          LTLIBMULTITHREAD="$LTLIBTHREAD"
+          AC_DEFINE([USE_SOLARIS_THREADS], 1,
+            [Define if the old Solaris multithreading library can be used.])
+          if test $gl_have_weak = yes; then
+            AC_DEFINE([USE_SOLARIS_THREADS_WEAK], 1,
+              [Define if references to the old Solaris multithreading library should be made weak.])
+            LIBTHREAD=
+            LTLIBTHREAD=
+          fi
+        fi
+      fi
+    fi
+    if test "$gl_use_threads" = pth; then
+      gl_save_CPPFLAGS="$CPPFLAGS"
+      AC_LIB_LINKFLAGS(pth)
+      gl_have_pth=
+      gl_save_LIBS="$LIBS"
+      LIBS="$LIBS -lpth"
+      AC_TRY_LINK([#include <pth.h>], [pth_self();], gl_have_pth=yes)
+      LIBS="$gl_save_LIBS"
+      if test -n "$gl_have_pth"; then
+        gl_threads_api=pth
+        LIBTHREAD="$LIBPTH"
+        LTLIBTHREAD="$LTLIBPTH"
+        LIBMULTITHREAD="$LIBTHREAD"
+        LTLIBMULTITHREAD="$LTLIBTHREAD"
+        AC_DEFINE([USE_PTH_THREADS], 1,
+          [Define if the GNU Pth multithreading library can be used.])
+        if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
+          if test $gl_have_weak = yes; then
+            AC_DEFINE([USE_PTH_THREADS_WEAK], 1,
+              [Define if references to the GNU Pth multithreading library should be made weak.])
+            LIBTHREAD=
+            LTLIBTHREAD=
+          fi
+        fi
+      else
+        CPPFLAGS="$gl_save_CPPFLAGS"
+      fi
+    fi
+    if test -z "$gl_have_pthread"; then
+      if test "$gl_use_threads" = yes || test "$gl_use_threads" = win32; then
+        if { case "$host_os" in
+               mingw*) true;;
+               *) false;;
+             esac
+           }; then
+          gl_threads_api=win32
+          AC_DEFINE([USE_WIN32_THREADS], 1,
+            [Define if the Win32 multithreading API can be used.])
+        fi
+      fi
+    fi
+  fi
+  AC_MSG_CHECKING([for multithread API to use])
+  AC_MSG_RESULT([$gl_threads_api])
+  AC_SUBST(LIBTHREAD)
+  AC_SUBST(LTLIBTHREAD)
+  AC_SUBST(LIBMULTITHREAD)
+  AC_SUBST(LTLIBMULTITHREAD)
+])
+
+AC_DEFUN([gl_LOCK],
+[
+  AC_REQUIRE([gl_LOCK_EARLY])
+  AC_REQUIRE([gl_LOCK_BODY])
+  gl_PREREQ_LOCK
+])
+
+# Prerequisites of lib/lock.c.
+AC_DEFUN([gl_PREREQ_LOCK], [
+  AC_REQUIRE([AC_C_INLINE])
+])
+
+dnl Survey of platforms:
+dnl
+dnl Platform          Available   Compiler    Supports   test-lock
+dnl                   flavours    option      weak       result
+dnl ---------------   ---------   ---------   --------   ---------
+dnl Linux 2.4/glibc   posix       -lpthread       Y      OK
+dnl
+dnl GNU Hurd/glibc    posix
+dnl
+dnl FreeBSD 5.3       posix       -lc_r           Y
+dnl                   posix       -lkse ?         Y
+dnl                   posix       -lpthread ?     Y
+dnl                   posix       -lthr           Y
+dnl
+dnl FreeBSD 5.2       posix       -lc_r           Y
+dnl                   posix       -lkse           Y
+dnl                   posix       -lthr           Y
+dnl
+dnl FreeBSD 4.0,4.10  posix       -lc_r           Y      OK
+dnl
+dnl NetBSD 1.6        --
+dnl
+dnl OpenBSD 3.4       posix       -lpthread       Y      OK
+dnl
+dnl MacOS X 10.[123]  posix       -lpthread       Y      OK
+dnl
+dnl Solaris 7,8,9     posix       -lpthread       Y      Sol 7,8: 0.0; Sol 9: OK
+dnl                   solaris     -lthread        Y      Sol 7,8: 0.0; Sol 9: OK
+dnl
+dnl HP-UX 11          posix       -lpthread       N (cc) OK
+dnl                                               Y (gcc)
+dnl
+dnl IRIX 6.5          posix       -lpthread       Y      0.5
+dnl
+dnl AIX 4.3,5.1       posix       -lpthread       N      AIX 4: 0.5; AIX 5: OK
+dnl
+dnl OSF/1 4.0,5.1     posix       -pthread (cc)   N      OK
+dnl                               -lpthread (gcc) Y
+dnl
+dnl Cygwin            posix       -lpthread       Y      OK
+dnl
+dnl Any of the above  pth         -lpth                  0.0
+dnl
+dnl Mingw             win32                       N      OK
+dnl
+dnl BeOS 5            --
+dnl
+dnl The test-lock result shows what happens if in test-lock.c EXPLICIT_YIELD is
+dnl turned off:
+dnl   OK if all three tests terminate OK,
+dnl   0.5 if the first test terminates OK but the second one loops endlessly,
+dnl   0.0 if the first test already loops endlessly.
diff --git a/config/gnulib/longdouble.m4 b/config/gnulib/longdouble.m4
new file mode 100644 (file)
index 0000000..25590f4
--- /dev/null
@@ -0,0 +1,31 @@
+# longdouble.m4 serial 2 (gettext-0.15)
+dnl Copyright (C) 2002-2003, 2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+dnl Test whether the compiler supports the 'long double' type.
+dnl Prerequisite: AC_PROG_CC
+
+dnl This file is only needed in autoconf <= 2.59.  Newer versions of autoconf
+dnl have a macro AC_TYPE_LONG_DOUBLE with identical semantics.
+
+AC_DEFUN([gt_TYPE_LONGDOUBLE],
+[
+  AC_CACHE_CHECK([for long double], gt_cv_c_long_double,
+    [if test "$GCC" = yes; then
+       gt_cv_c_long_double=yes
+     else
+       AC_TRY_COMPILE([
+         /* The Stardent Vistra knows sizeof(long double), but does not support it.  */
+         long double foo = 0.0;
+         /* On Ultrix 4.3 cc, long double is 4 and double is 8.  */
+         int array [2*(sizeof(long double) >= sizeof(double)) - 1];
+         ], ,
+         gt_cv_c_long_double=yes, gt_cv_c_long_double=no)
+     fi])
+  if test $gt_cv_c_long_double = yes; then
+    AC_DEFINE(HAVE_LONG_DOUBLE, 1, [Define if you have the 'long double' type.])
+  fi
+])
diff --git a/config/gnulib/longlong.m4 b/config/gnulib/longlong.m4
new file mode 100644 (file)
index 0000000..1f9e862
--- /dev/null
@@ -0,0 +1,72 @@
+# longlong.m4 serial 10
+dnl Copyright (C) 1999-2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Paul Eggert.
+
+# Define HAVE_LONG_LONG_INT if 'long long int' works.
+# This fixes a bug in Autoconf 2.60, but can be removed once we
+# assume 2.61 everywhere.
+
+# Note: If the type 'long long int' exists but is only 32 bits large
+# (as on some very old compilers), HAVE_LONG_LONG_INT will not be
+# defined. In this case you can treat 'long long int' like 'long int'.
+
+AC_DEFUN([AC_TYPE_LONG_LONG_INT],
+[
+  AC_CACHE_CHECK([for long long int], [ac_cv_type_long_long_int],
+    [AC_LINK_IFELSE(
+       [AC_LANG_PROGRAM(
+         [[long long int ll = 9223372036854775807ll;
+           long long int nll = -9223372036854775807LL;
+           typedef int a[((-9223372036854775807LL < 0
+                           && 0 < 9223372036854775807ll)
+                          ? 1 : -1)];
+           int i = 63;]],
+         [[long long int llmax = 9223372036854775807ll;
+           return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
+                   | (llmax / ll) | (llmax % ll));]])],
+       [dnl This catches a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004.
+       dnl If cross compiling, assume the bug isn't important, since
+       dnl nobody cross compiles for this platform as far as we know.
+        AC_RUN_IFELSE(
+         [AC_LANG_PROGRAM(
+            [[@%:@include <limits.h>
+              @%:@ifndef LLONG_MAX
+              @%:@ define HALF \
+                       (1LL << (sizeof (long long int) * CHAR_BIT - 2))
+              @%:@ define LLONG_MAX (HALF - 1 + HALF)
+              @%:@endif]],
+            [[long long int n = 1;
+              int i;
+              for (i = 0; ; i++)
+                {
+                  long long int m = n << i;
+                  if (m >> i != n)
+                    return 1;
+                  if (LLONG_MAX / 2 < m)
+                    break;
+                }
+              return 0;]])],
+         [ac_cv_type_long_long_int=yes],
+         [ac_cv_type_long_long_int=no],
+         [ac_cv_type_long_long_int=yes])],
+       [ac_cv_type_long_long_int=no])])
+  if test $ac_cv_type_long_long_int = yes; then
+    AC_DEFINE([HAVE_LONG_LONG_INT], 1,
+      [Define to 1 if the system has the type `long long int'.])
+  fi
+])
+
+# This macro is obsolescent and should go away soon.
+AC_DEFUN([gl_AC_TYPE_LONG_LONG],
+[
+  AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
+  ac_cv_type_long_long=$ac_cv_type_long_long_int
+  if test $ac_cv_type_long_long = yes; then
+    AC_DEFINE(HAVE_LONG_LONG, 1,
+      [Define if you have the 'long long' type.])
+  fi
+])
diff --git a/config/gnulib/netinet_in_h.m4 b/config/gnulib/netinet_in_h.m4
new file mode 100644 (file)
index 0000000..d73531a
--- /dev/null
@@ -0,0 +1,18 @@
+# netinet_in_h.m4 serial 1
+dnl Copyright (C) 2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Written by Simon Josefsson
+
+AC_DEFUN([gl_HEADER_NETINET_IN],
+[
+  AC_CHECK_HEADERS_ONCE([netinet/in.h])
+  if test $ac_cv_header_netinet_in_h = yes; then
+    NETINET_IN_H=''
+  else
+    NETINET_IN_H='netinet/in.h'
+  fi
+  AC_SUBST(NETINET_IN_H)
+])
diff --git a/config/gnulib/onceonly_2_57.m4 b/config/gnulib/onceonly_2_57.m4
new file mode 100644 (file)
index 0000000..15884b3
--- /dev/null
@@ -0,0 +1,86 @@
+# onceonly_2_57.m4 serial 4
+dnl Copyright (C) 2002-2003, 2005-2006 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+dnl This file defines some "once only" variants of standard autoconf macros.
+dnl   AC_CHECK_HEADERS_ONCE          like  AC_CHECK_HEADERS
+dnl   AC_CHECK_FUNCS_ONCE            like  AC_CHECK_FUNCS
+dnl   AC_CHECK_DECLS_ONCE            like  AC_CHECK_DECLS
+dnl   AC_REQUIRE([AC_FUNC_STRCOLL])  like  AC_FUNC_STRCOLL
+dnl The advantage is that the check for each of the headers/functions/decls
+dnl will be put only once into the 'configure' file. It keeps the size of
+dnl the 'configure' file down, and avoids redundant output when 'configure'
+dnl is run.
+dnl The drawback is that the checks cannot be conditionalized. If you write
+dnl   if some_condition; then gl_CHECK_HEADERS(stdlib.h); fi
+dnl inside an AC_DEFUNed function, the gl_CHECK_HEADERS macro call expands to
+dnl empty, and the check will be inserted before the body of the AC_DEFUNed
+dnl function.
+
+dnl This is like onceonly.m4, except that it uses diversions to named sections
+dnl DEFAULTS and INIT_PREPARE in order to check all requested headers at once,
+dnl thus reducing the size of 'configure'. Works with autoconf-2.57. The
+dnl size reduction is ca. 9%.
+
+dnl Autoconf version 2.57 or newer is recommended.
+AC_PREREQ(2.57)
+
+# AC_CHECK_HEADERS_ONCE(HEADER1 HEADER2 ...) is a once-only variant of
+# AC_CHECK_HEADERS(HEADER1 HEADER2 ...).
+AC_DEFUN([AC_CHECK_HEADERS_ONCE], [
+  :
+  AC_FOREACH([gl_HEADER_NAME], [$1], [
+    AC_DEFUN([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME,
+                                                 [./-], [___])), [
+      m4_divert_text([INIT_PREPARE],
+        [gl_header_list="$gl_header_list gl_HEADER_NAME"])
+      gl_HEADERS_EXPANSION
+      AH_TEMPLATE(AS_TR_CPP([HAVE_]m4_defn([gl_HEADER_NAME])),
+        [Define to 1 if you have the <]m4_defn([gl_HEADER_NAME])[> header file.])
+    ])
+    AC_REQUIRE([gl_CHECK_HEADER_]m4_quote(translit(gl_HEADER_NAME,
+                                                   [./-], [___])))
+  ])
+])
+m4_define([gl_HEADERS_EXPANSION], [
+  m4_divert_text([DEFAULTS], [gl_header_list=])
+  AC_CHECK_HEADERS([$gl_header_list])
+  m4_define([gl_HEADERS_EXPANSION], [])
+])
+
+# AC_CHECK_FUNCS_ONCE(FUNC1 FUNC2 ...) is a once-only variant of
+# AC_CHECK_FUNCS(FUNC1 FUNC2 ...).
+AC_DEFUN([AC_CHECK_FUNCS_ONCE], [
+  :
+  AC_FOREACH([gl_FUNC_NAME], [$1], [
+    AC_DEFUN([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]), [
+      m4_divert_text([INIT_PREPARE],
+        [gl_func_list="$gl_func_list gl_FUNC_NAME"])
+      gl_FUNCS_EXPANSION
+      AH_TEMPLATE(AS_TR_CPP([HAVE_]m4_defn([gl_FUNC_NAME])),
+        [Define to 1 if you have the `]m4_defn([gl_FUNC_NAME])[' function.])
+    ])
+    AC_REQUIRE([gl_CHECK_FUNC_]m4_defn([gl_FUNC_NAME]))
+  ])
+])
+m4_define([gl_FUNCS_EXPANSION], [
+  m4_divert_text([DEFAULTS], [gl_func_list=])
+  AC_CHECK_FUNCS([$gl_func_list])
+  m4_define([gl_FUNCS_EXPANSION], [])
+])
+
+# AC_CHECK_DECLS_ONCE(DECL1 DECL2 ...) is a once-only variant of
+# AC_CHECK_DECLS(DECL1, DECL2, ...).
+AC_DEFUN([AC_CHECK_DECLS_ONCE], [
+  :
+  AC_FOREACH([gl_DECL_NAME], [$1], [
+    AC_DEFUN([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME]), [
+      AC_CHECK_DECLS(m4_defn([gl_DECL_NAME]))
+    ])
+    AC_REQUIRE([gl_CHECK_DECL_]m4_defn([gl_DECL_NAME]))
+  ])
+])
diff --git a/config/gnulib/size_max.m4 b/config/gnulib/size_max.m4
new file mode 100644 (file)
index 0000000..6cb4868
--- /dev/null
@@ -0,0 +1,68 @@
+# size_max.m4 serial 6
+dnl Copyright (C) 2003, 2005-2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+AC_DEFUN([gl_SIZE_MAX],
+[
+  AC_CHECK_HEADERS(stdint.h)
+  dnl First test whether the system already has SIZE_MAX.
+  AC_MSG_CHECKING([for SIZE_MAX])
+  AC_CACHE_VAL([gl_cv_size_max], [
+    gl_cv_size_max=
+    AC_EGREP_CPP([Found it], [
+#include <limits.h>
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#ifdef SIZE_MAX
+Found it
+#endif
+], gl_cv_size_max=yes)
+    if test -z "$gl_cv_size_max"; then
+      dnl Define it ourselves. Here we assume that the type 'size_t' is not wider
+      dnl than the type 'unsigned long'. Try hard to find a definition that can
+      dnl be used in a preprocessor #if, i.e. doesn't contain a cast.
+      AC_COMPUTE_INT([size_t_bits_minus_1], [sizeof (size_t) * CHAR_BIT - 1],
+        [#include <stddef.h>
+#include <limits.h>], size_t_bits_minus_1=)
+      AC_COMPUTE_INT([fits_in_uint], [sizeof (size_t) <= sizeof (unsigned int)],
+        [#include <stddef.h>], fits_in_uint=)
+      if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then
+        if test $fits_in_uint = 1; then
+          dnl Even though SIZE_MAX fits in an unsigned int, it must be of type
+          dnl 'unsigned long' if the type 'size_t' is the same as 'unsigned long'.
+          AC_TRY_COMPILE([#include <stddef.h>
+            extern size_t foo;
+            extern unsigned long foo;
+            ], [], fits_in_uint=0)
+        fi
+        dnl We cannot use 'expr' to simplify this expression, because 'expr'
+        dnl works only with 'long' integers in the host environment, while we
+        dnl might be cross-compiling from a 32-bit platform to a 64-bit platform.
+        if test $fits_in_uint = 1; then
+          gl_cv_size_max="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)"
+        else
+          gl_cv_size_max="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)"
+        fi
+      else
+        dnl Shouldn't happen, but who knows...
+        gl_cv_size_max='((size_t)~(size_t)0)'
+      fi
+    fi
+  ])
+  AC_MSG_RESULT([$gl_cv_size_max])
+  if test "$gl_cv_size_max" != yes; then
+    AC_DEFINE_UNQUOTED([SIZE_MAX], [$gl_cv_size_max],
+      [Define as the maximum value of type 'size_t', if the system doesn't define it.])
+  fi
+])
+
+dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in.
+dnl Remove this when we can assume autoconf >= 2.61.
+m4_ifdef([AC_COMPUTE_INT], [], [
+  AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])])
+])
diff --git a/config/gnulib/snprintf.m4 b/config/gnulib/snprintf.m4
new file mode 100644 (file)
index 0000000..432e037
--- /dev/null
@@ -0,0 +1,15 @@
+# snprintf.m4 serial 2
+dnl Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_SNPRINTF],
+[
+  AC_REPLACE_FUNCS(snprintf)
+  AC_CHECK_DECLS_ONCE(snprintf)
+  gl_PREREQ_SNPRINTF
+])
+
+# Prerequisites of lib/snprintf.c.
+AC_DEFUN([gl_PREREQ_SNPRINTF], [:])
diff --git a/config/gnulib/socklen.m4 b/config/gnulib/socklen.m4
new file mode 100644 (file)
index 0000000..5e3765a
--- /dev/null
@@ -0,0 +1,52 @@
+# socklen.m4 serial 4
+dnl Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Albert Chin, Windows fixes from Simon Josefsson.
+
+dnl Check for socklen_t: historically on BSD it is an int, and in
+dnl POSIX 1g it is a type of its own, but some platforms use different
+dnl types for the argument to getsockopt, getpeername, etc.  So we
+dnl have to test to find something that will work.
+
+dnl On mingw32, socklen_t is in ws2tcpip.h ('int'), so we try to find
+dnl it there first.  That file is included by gnulib's socket_.h, which
+dnl all users of this module should include.  Cygwin must not include
+dnl ws2tcpip.h.
+AC_DEFUN([gl_TYPE_SOCKLEN_T],
+  [AC_REQUIRE([gl_HEADER_SYS_SOCKET])dnl
+   AC_CHECK_TYPE([socklen_t], ,
+     [AC_MSG_CHECKING([for socklen_t equivalent])
+      AC_CACHE_VAL([gl_cv_gl_cv_socklen_t_equiv],
+       [# Systems have either "struct sockaddr *" or
+        # "void *" as the second argument to getpeername
+        gl_cv_socklen_t_equiv=
+        for arg2 in "struct sockaddr" void; do
+          for t in int size_t "unsigned int" "long int" "unsigned long int"; do
+            AC_TRY_COMPILE(
+              [#include <sys/types.h>
+               #include <sys/socket.h>
+
+               int getpeername (int, $arg2 *, $t *);],
+              [$t len;
+               getpeername (0, 0, &len);],
+              [gl_cv_socklen_t_equiv="$t"])
+            test "$gl_cv_socklen_t_equiv" != "" && break
+          done
+          test "$gl_cv_socklen_t_equiv" != "" && break
+        done
+      ])
+      if test "$gl_cv_socklen_t_equiv" = ""; then
+       AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])
+      fi
+      AC_MSG_RESULT([$gl_cv_socklen_t_equiv])
+      AC_DEFINE_UNQUOTED([socklen_t], [$gl_cv_socklen_t_equiv],
+       [type to use in place of socklen_t if not defined])],
+     [#include <sys/types.h>
+      #if HAVE_SYS_SOCKET_H
+      # include <sys/socket.h>
+      #elif HAVE_WS2TCPIP_H
+      # include <ws2tcpip.h>
+      #endif])])
diff --git a/config/gnulib/sockpfaf.m4 b/config/gnulib/sockpfaf.m4
new file mode 100644 (file)
index 0000000..25d9755
--- /dev/null
@@ -0,0 +1,58 @@
+# sockpfaf.m4 serial 5
+dnl Copyright (C) 2004, 2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Test for some common socket protocol families (PF_INET, PF_INET6, ...)
+dnl and some common address families (AF_INET, AF_INET6, ...).
+dnl This test assumes that a system supports an address family if and only if
+dnl it supports the corresponding protocol family.
+
+dnl From Bruno Haible.
+
+AC_DEFUN([gl_SOCKET_FAMILIES],
+[
+  AC_REQUIRE([gl_HEADER_SYS_SOCKET])
+  AC_CHECK_HEADERS_ONCE([netinet/in.h])
+
+  AC_MSG_CHECKING(for IPv4 sockets)
+  AC_CACHE_VAL(gl_cv_socket_ipv4,
+    [AC_TRY_COMPILE([#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif],
+[int x = AF_INET; struct in_addr y; struct sockaddr_in z;
+ if (&x && &y && &z) return 0;],
+       gl_cv_socket_ipv4=yes, gl_cv_socket_ipv4=no)])
+  AC_MSG_RESULT($gl_cv_socket_ipv4)
+  if test $gl_cv_socket_ipv4 = yes; then
+    AC_DEFINE(HAVE_IPV4, 1, [Define to 1 if <sys/socket.h> defines AF_INET.])
+  fi
+
+  AC_MSG_CHECKING(for IPv6 sockets)
+  AC_CACHE_VAL(gl_cv_socket_ipv6,
+    [AC_TRY_COMPILE([#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif],
+[int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z;
+ if (&x && &y && &z) return 0;],
+       gl_cv_socket_ipv6=yes, gl_cv_socket_ipv6=no)])
+  AC_MSG_RESULT($gl_cv_socket_ipv6)
+  if test $gl_cv_socket_ipv6 = yes; then
+    AC_DEFINE(HAVE_IPV6, 1, [Define to 1 if <sys/socket.h> defines AF_INET6.])
+  fi
+])
diff --git a/config/gnulib/stdbool.m4 b/config/gnulib/stdbool.m4
new file mode 100644 (file)
index 0000000..2204ecd
--- /dev/null
@@ -0,0 +1,115 @@
+# Check for stdbool.h that conforms to C99.
+
+dnl Copyright (C) 2002-2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# Prepare for substituting <stdbool.h> if it is not supported.
+
+AC_DEFUN([AM_STDBOOL_H],
+[
+  AC_REQUIRE([AC_HEADER_STDBOOL])
+
+  # Define two additional variables used in the Makefile substitution.
+
+  if test "$ac_cv_header_stdbool_h" = yes; then
+    STDBOOL_H=''
+  else
+    STDBOOL_H='stdbool.h'
+  fi
+  AC_SUBST([STDBOOL_H])
+
+  if test "$ac_cv_type__Bool" = yes; then
+    HAVE__BOOL=1
+  else
+    HAVE__BOOL=0
+  fi
+  AC_SUBST([HAVE__BOOL])
+])
+
+# AM_STDBOOL_H will be renamed to gl_STDBOOL_H in the future.
+AC_DEFUN([gl_STDBOOL_H], [AM_STDBOOL_H])
+
+# This macro is only needed in autoconf <= 2.59.  Newer versions of autoconf
+# have this macro built-in.
+
+AC_DEFUN([AC_HEADER_STDBOOL],
+  [AC_CACHE_CHECK([for stdbool.h that conforms to C99],
+     [ac_cv_header_stdbool_h],
+     [AC_TRY_COMPILE(
+       [
+         #include <stdbool.h>
+         #ifndef bool
+          "error: bool is not defined"
+         #endif
+         #ifndef false
+          "error: false is not defined"
+         #endif
+         #if false
+          "error: false is not 0"
+         #endif
+         #ifndef true
+          "error: true is not defined"
+         #endif
+         #if true != 1
+          "error: true is not 1"
+         #endif
+         #ifndef __bool_true_false_are_defined
+          "error: __bool_true_false_are_defined is not defined"
+         #endif
+
+         struct s { _Bool s: 1; _Bool t; } s;
+
+         char a[true == 1 ? 1 : -1];
+         char b[false == 0 ? 1 : -1];
+         char c[__bool_true_false_are_defined == 1 ? 1 : -1];
+         char d[(bool) 0.5 == true ? 1 : -1];
+         bool e = &s;
+         char f[(_Bool) 0.0 == false ? 1 : -1];
+         char g[true];
+         char h[sizeof (_Bool)];
+         char i[sizeof s.t];
+         enum { j = false, k = true, l = false * true, m = true * 256 };
+         _Bool n[m];
+         char o[sizeof n == m * sizeof n[0] ? 1 : -1];
+         char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
+         #if defined __xlc__ || defined __GNUC__
+          /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0
+             reported by James Lemley on 2005-10-05; see
+             http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
+             This test is not quite right, since xlc is allowed to
+             reject this program, as the initializer for xlcbug is
+             not one of the forms that C requires support for.
+             However, doing the test right would require a run-time
+             test, and that would make cross-compilation harder.
+             Let us hope that IBM fixes the xlc bug, and also adds
+             support for this kind of constant expression.  In the
+             meantime, this test will reject xlc, which is OK, since
+             our stdbool.h substitute should suffice.  We also test
+             this with GCC, where it should work, to detect more
+             quickly whether someone messes up the test in the
+             future.  */
+          char digs[] = "0123456789";
+          int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1);
+         #endif
+         /* Catch a bug in an HP-UX C compiler.  See
+            http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
+            http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
+          */
+         _Bool q = true;
+         _Bool *pq = &q;
+       ],
+       [
+         *pq |= q;
+         *pq |= ! q;
+         /* Refer to every declared value, to avoid compiler optimizations.  */
+         return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
+                 + !m + !n + !o + !p + !q + !pq);
+       ],
+       [ac_cv_header_stdbool_h=yes],
+       [ac_cv_header_stdbool_h=no])])
+   AC_CHECK_TYPES([_Bool])
+   if test $ac_cv_header_stdbool_h = yes; then
+     AC_DEFINE(HAVE_STDBOOL_H, 1, [Define to 1 if stdbool.h conforms to C99.])
+   fi])
diff --git a/config/gnulib/stdint_h.m4 b/config/gnulib/stdint_h.m4
new file mode 100644 (file)
index 0000000..db9a8ac
--- /dev/null
@@ -0,0 +1,26 @@
+# stdint_h.m4 serial 6
+dnl Copyright (C) 1997-2004, 2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Paul Eggert.
+
+# Define HAVE_STDINT_H_WITH_UINTMAX if <stdint.h> exists,
+# doesn't clash with <sys/types.h>, and declares uintmax_t.
+
+AC_DEFUN([gl_AC_HEADER_STDINT_H],
+[
+  AC_CACHE_CHECK([for stdint.h], gl_cv_header_stdint_h,
+  [AC_TRY_COMPILE(
+    [#include <sys/types.h>
+#include <stdint.h>],
+    [uintmax_t i = (uintmax_t) -1; return !i;],
+    gl_cv_header_stdint_h=yes,
+    gl_cv_header_stdint_h=no)])
+  if test $gl_cv_header_stdint_h = yes; then
+    AC_DEFINE_UNQUOTED(HAVE_STDINT_H_WITH_UINTMAX, 1,
+      [Define if <stdint.h> exists, doesn't clash with <sys/types.h>,
+       and declares uintmax_t. ])
+  fi
+])
diff --git a/config/gnulib/strdup.m4 b/config/gnulib/strdup.m4
new file mode 100644 (file)
index 0000000..8796e9e
--- /dev/null
@@ -0,0 +1,22 @@
+# strdup.m4 serial 9
+
+dnl Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software
+dnl Foundation, Inc.
+
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_STRDUP],
+[
+  AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
+  AC_REPLACE_FUNCS(strdup)
+  AC_CHECK_DECLS_ONCE(strdup)
+  if test $ac_cv_have_decl_strdup = no; then
+    HAVE_DECL_STRDUP=0
+  fi
+  gl_PREREQ_STRDUP
+])
+
+# Prerequisites of lib/strdup.c.
+AC_DEFUN([gl_PREREQ_STRDUP], [:])
diff --git a/config/gnulib/string_h.m4 b/config/gnulib/string_h.m4
new file mode 100644 (file)
index 0000000..84db7a5
--- /dev/null
@@ -0,0 +1,46 @@
+# Configure a GNU-like replacement for <string.h>.
+
+# Copyright (C) 2007 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# Written by Paul Eggert.
+
+AC_DEFUN([gl_HEADER_STRING_H],
+[
+  dnl Use AC_REQUIRE here, so that the default behavior below is expanded
+  dnl once only, before all statements that occur in other macros.
+  AC_REQUIRE([gl_HEADER_STRING_H_BODY])
+])
+
+AC_DEFUN([gl_HEADER_STRING_H_BODY],
+[
+  AC_REQUIRE([AC_C_RESTRICT])
+  AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
+  gl_ABSOLUTE_HEADER([string.h])
+  ABSOLUTE_STRING_H=\"$gl_cv_absolute_string_h\"
+  AC_SUBST([ABSOLUTE_STRING_H])
+])
+
+AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
+[
+  dnl Assume proper GNU behavior unless another module says otherwise.
+  HAVE_DECL_MEMMEM=1;          AC_SUBST([HAVE_DECL_MEMMEM])
+  HAVE_MEMPCPY=1;              AC_SUBST([HAVE_MEMPCPY])
+  HAVE_DECL_MEMRCHR=1;         AC_SUBST([HAVE_DECL_MEMRCHR])
+  HAVE_STPCPY=1;               AC_SUBST([HAVE_STPCPY])
+  HAVE_STPNCPY=1;              AC_SUBST([HAVE_STPNCPY])
+  HAVE_DECL_STRNCASECMP=1;     AC_SUBST([HAVE_DECL_STRNCASECMP])
+  HAVE_STRCHRNUL=1;            AC_SUBST([HAVE_STRCHRNUL])
+  HAVE_DECL_STRDUP=1;          AC_SUBST([HAVE_DECL_STRDUP])
+  HAVE_STRNDUP=1;              AC_SUBST([HAVE_STRNDUP])
+  HAVE_DECL_STRNDUP=1;         AC_SUBST([HAVE_DECL_STRNDUP])
+  HAVE_DECL_STRNLEN=1;         AC_SUBST([HAVE_DECL_STRNLEN])
+  HAVE_STRPBRK=1;              AC_SUBST([HAVE_STRPBRK])
+  HAVE_STRSEP=1;               AC_SUBST([HAVE_STRSEP])
+  HAVE_DECL_STRTOK_R=1;                AC_SUBST([HAVE_DECL_STRTOK_R])
+  REPLACE_STRCASECMP=0;                AC_SUBST([REPLACE_STRCASECMP])
+  REPLACE_STRSTR=0;            AC_SUBST([REPLACE_STRSTR])
+  REPLACE_STRCASESTR=0;                AC_SUBST([REPLACE_STRCASESTR])
+])
diff --git a/config/gnulib/sys_socket_h.m4 b/config/gnulib/sys_socket_h.m4
new file mode 100644 (file)
index 0000000..d3e45b4
--- /dev/null
@@ -0,0 +1,23 @@
+# sys_socket_h.m4 serial 2
+dnl Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Simon Josefsson.
+
+AC_DEFUN([gl_HEADER_SYS_SOCKET],
+[
+  AC_CHECK_HEADERS_ONCE([sys/socket.h])
+  if test $ac_cv_header_sys_socket_h = yes; then
+    SYS_SOCKET_H=''
+  else
+    dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make
+    dnl the check for those headers unconditional; yet cygwin reports
+    dnl that the headers are present but cannot be compiled (since on
+    dnl cygwin, all socket information should come from sys/socket.h).
+    AC_CHECK_HEADERS([winsock2.h ws2tcpip.h])
+    SYS_SOCKET_H='sys/socket.h'
+  fi
+  AC_SUBST(SYS_SOCKET_H)
+])
diff --git a/config/gnulib/vasnprintf.m4 b/config/gnulib/vasnprintf.m4
new file mode 100644 (file)
index 0000000..72c9a13
--- /dev/null
@@ -0,0 +1,57 @@
+# vasnprintf.m4 serial 7
+dnl Copyright (C) 2002-2004, 2006 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_VASNPRINTF],
+[
+  AC_REQUIRE([gl_EOVERFLOW])
+  AC_REPLACE_FUNCS(vasnprintf)
+  if test $ac_cv_func_vasnprintf = no; then
+    AC_LIBOBJ(printf-args)
+    AC_LIBOBJ(printf-parse)
+    AC_LIBOBJ(asnprintf)
+    gl_PREREQ_PRINTF_ARGS
+    gl_PREREQ_PRINTF_PARSE
+    gl_PREREQ_VASNPRINTF
+    gl_PREREQ_ASNPRINTF
+  fi
+])
+
+# Prequisites of lib/printf-args.h, lib/printf-args.c.
+AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
+[
+  AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
+  AC_REQUIRE([gt_TYPE_LONGDOUBLE])
+  AC_REQUIRE([gt_TYPE_WCHAR_T])
+  AC_REQUIRE([gt_TYPE_WINT_T])
+])
+
+# Prequisites of lib/printf-parse.h, lib/printf-parse.c.
+AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
+[
+  AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
+  AC_REQUIRE([gt_TYPE_LONGDOUBLE])
+  AC_REQUIRE([gt_TYPE_WCHAR_T])
+  AC_REQUIRE([gt_TYPE_WINT_T])
+  AC_REQUIRE([AC_TYPE_SIZE_T])
+  AC_CHECK_TYPES(ptrdiff_t)
+  AC_REQUIRE([gt_AC_TYPE_INTMAX_T])
+])
+
+# Prerequisites of lib/vasnprintf.c.
+AC_DEFUN([gl_PREREQ_VASNPRINTF],
+[
+  AC_REQUIRE([AC_FUNC_ALLOCA])
+  AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
+  AC_REQUIRE([gt_TYPE_LONGDOUBLE])
+  AC_REQUIRE([gt_TYPE_WCHAR_T])
+  AC_REQUIRE([gt_TYPE_WINT_T])
+  AC_CHECK_FUNCS(snprintf wcslen)
+])
+
+# Prerequisites of lib/asnprintf.c.
+AC_DEFUN([gl_PREREQ_ASNPRINTF],
+[
+])
diff --git a/config/gnulib/visibility.m4 b/config/gnulib/visibility.m4
new file mode 100644 (file)
index 0000000..2ff6330
--- /dev/null
@@ -0,0 +1,52 @@
+# visibility.m4 serial 1 (gettext-0.15)
+dnl Copyright (C) 2005 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+dnl Tests whether the compiler supports the command-line option
+dnl -fvisibility=hidden and the function and variable attributes
+dnl __attribute__((__visibility__("hidden"))) and
+dnl __attribute__((__visibility__("default"))).
+dnl Does *not* test for __visibility__("protected") - which has tricky
+dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on
+dnl MacOS X.
+dnl Does *not* test for __visibility__("internal") - which has processor
+dnl dependent semantics.
+dnl Does *not* test for #pragma GCC visibility push(hidden) - which is
+dnl "really only recommended for legacy code".
+dnl Set the variable CFLAG_VISIBILITY.
+dnl Defines and sets the variable HAVE_VISIBILITY.
+
+AC_DEFUN([gl_VISIBILITY],
+[
+  AC_REQUIRE([AC_PROG_CC])
+  CFLAG_VISIBILITY=
+  HAVE_VISIBILITY=0
+  if test -n "$GCC"; then
+    AC_MSG_CHECKING([for simple visibility declarations])
+    AC_CACHE_VAL(gl_cv_cc_visibility, [
+      gl_save_CFLAGS="$CFLAGS"
+      CFLAGS="$CFLAGS -fvisibility=hidden"
+      AC_TRY_COMPILE(
+        [extern __attribute__((__visibility__("hidden"))) int hiddenvar;
+         extern __attribute__((__visibility__("default"))) int exportedvar;
+         extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
+         extern __attribute__((__visibility__("default"))) int exportedfunc (void);],
+        [],
+        gl_cv_cc_visibility=yes,
+        gl_cv_cc_visibility=no)
+      CFLAGS="$gl_save_CFLAGS"])
+    AC_MSG_RESULT([$gl_cv_cc_visibility])
+    if test $gl_cv_cc_visibility = yes; then
+      CFLAG_VISIBILITY="-fvisibility=hidden"
+      HAVE_VISIBILITY=1
+    fi
+  fi
+  AC_SUBST([CFLAG_VISIBILITY])
+  AC_SUBST([HAVE_VISIBILITY])
+  AC_DEFINE_UNQUOTED([HAVE_VISIBILITY], [$HAVE_VISIBILITY],
+    [Define to 1 or 0, depending whether the compiler supports simple visibility declarations.])
+])
diff --git a/config/gnulib/wchar_t.m4 b/config/gnulib/wchar_t.m4
new file mode 100644 (file)
index 0000000..cde2129
--- /dev/null
@@ -0,0 +1,20 @@
+# wchar_t.m4 serial 1 (gettext-0.12)
+dnl Copyright (C) 2002-2003 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+dnl Test whether <stddef.h> has the 'wchar_t' type.
+dnl Prerequisite: AC_PROG_CC
+
+AC_DEFUN([gt_TYPE_WCHAR_T],
+[
+  AC_CACHE_CHECK([for wchar_t], gt_cv_c_wchar_t,
+    [AC_TRY_COMPILE([#include <stddef.h>
+       wchar_t foo = (wchar_t)'\0';], ,
+       gt_cv_c_wchar_t=yes, gt_cv_c_wchar_t=no)])
+  if test $gt_cv_c_wchar_t = yes; then
+    AC_DEFINE(HAVE_WCHAR_T, 1, [Define if you have the 'wchar_t' type.])
+  fi
+])
diff --git a/config/gnulib/wint_t.m4 b/config/gnulib/wint_t.m4
new file mode 100644 (file)
index 0000000..3706c04
--- /dev/null
@@ -0,0 +1,28 @@
+# wint_t.m4 serial 2 (gettext-0.12)
+dnl Copyright (C) 2003, 2007 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+dnl Test whether <wchar.h> has the 'wint_t' type.
+dnl Prerequisite: AC_PROG_CC
+
+AC_DEFUN([gt_TYPE_WINT_T],
+[
+  AC_CACHE_CHECK([for wint_t], gt_cv_c_wint_t,
+    [AC_TRY_COMPILE([
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
+   before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+       wint_t foo = (wchar_t)'\0';], ,
+       gt_cv_c_wint_t=yes, gt_cv_c_wint_t=no)])
+  if test $gt_cv_c_wint_t = yes; then
+    AC_DEFINE(HAVE_WINT_T, 1, [Define if you have the 'wint_t' type.])
+  fi
+])
diff --git a/config/gnulib/xsize.m4 b/config/gnulib/xsize.m4
new file mode 100644 (file)
index 0000000..85bb721
--- /dev/null
@@ -0,0 +1,13 @@
+# xsize.m4 serial 3
+dnl Copyright (C) 2003-2004 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_XSIZE],
+[
+  dnl Prerequisites of lib/xsize.h.
+  AC_REQUIRE([gl_SIZE_MAX])
+  AC_REQUIRE([AC_C_INLINE])
+  AC_CHECK_HEADERS(stdint.h)
+])
index 323dcaad2a005c8e017634773c23ca6d2b5afb7b..08704fb549cc4f611ddd6e3e673bdefd295e1a2f 100755 (executable)
--- a/configure
+++ b/configure
@@ -463,7 +463,8 @@ ac_includes_default="\
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CONFIGURE_COMMAND INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar SNAPSHOT_STAMP VERSION_MAJOR VERSION_MINOR VERSION_PATCH VERSION_COMMENT VERSION_SUFFIX CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE GREP EGREP AMLINT AMLINTFLAGS DUMPER_DIR CONFIG_DIR USE_VERSION_SUFFIXES CLIENT_SCRIPTS_OPT DEFAULT_SERVER CLIENT_LOGIN SETUID_GROUP BINARY_OWNER DEFAULT_CONFIG DEFAULT_TAPE_SERVER DEFAULT_TAPE_DEVICE DEFAULT_RAW_TAPE_DEVICE DEFAULT_CHANGER_DEVICE GNUTAR_LISTED_INCREMENTAL_DIRX GNUTAR_LISTED_INCREMENTAL_DIR MAXTAPEBLOCKSIZE AMANDA_TMPDIR AMANDA_DBGDIR AMANDA_DEBUG_DAYS SERVICE_SUFFIX MT_FILE_FLAG CPP AR AWK_VAR_ASSIGNMENT_OPT YACC CAT COMPRESS DD GETCONF GNUPLOT GNUTAR SAMBA_CLIENT GZIP SORT MAILER MT CHIO CHS MTX MCUTIL PRINT PCAT PERL DUMP RESTORE XFSDUMP XFSRESTORE VXDUMP VXRESTORE VDUMP VRESTORE AMPLOT_COMPRESS AMPLOT_CAT_GZIP AMPLOT_CAT_COMPRESS AMPLOT_CAT_PACK LL_FMT LL_RFMT LN_S ECHO ac_ct_AR RANLIB ac_ct_RANLIB CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL LIBTOOL_DEPS LEX LEXLIB LEX_OUTPUT_ROOT READLINE_LIBS DB_EXT ALLOCA LIBOBJS ac_n ac_c WANT_CLIENT_TRUE WANT_CLIENT_FALSE WANT_SAMBA_TRUE WANT_SAMBA_FALSE WANT_RESTORE_TRUE WANT_RESTORE_FALSE WANT_SERVER_TRUE WANT_SERVER_FALSE WANT_RECOVER_TRUE WANT_RECOVER_FALSE WANT_TAPE_TRUE WANT_TAPE_FALSE WANT_AMPLOT_TRUE WANT_AMPLOT_FALSE WANT_CHG_SCSI_TRUE WANT_CHG_SCSI_FALSE WANT_CHIO_SCSI_TRUE WANT_CHIO_SCSI_FALSE WANT_RUNTIME_PSEUDO_RELOC_TRUE WANT_RUNTIME_PSEUDO_RELOC_FALSE WANT_SETUID_CLIENT_TRUE WANT_SETUID_CLIENT_FALSE WANT_SSH_SECURITY_TRUE WANT_SSH_SECURITY_FALSE LTLIBOBJS LTALLOCA DOC_BUILD_DATE BUILD_MAN_PAGES_TRUE BUILD_MAN_PAGES_FALSE XSLTPROC HAVE_XSLTPROC_TRUE HAVE_XSLTPROC_FALSE AM_CFLAGS'
+gl_header_list=
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CONFIGURE_COMMAND INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar SNAPSHOT_STAMP VERSION_MAJOR VERSION_MINOR VERSION_PATCH VERSION_COMMENT VERSION_SUFFIX CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE RANLIB ac_ct_RANLIB CPP EGREP GL_COND_LIBTOOL_TRUE GL_COND_LIBTOOL_FALSE ALLOCA ALLOCA_H ARPA_INET_H SYS_SOCKET_H LIBPTH LTLIBPTH LIBPTH_PREFIX LIBTHREAD LTLIBTHREAD LIBMULTITHREAD LTLIBMULTITHREAD NETINET_IN_H STDBOOL_H HAVE__BOOL HAVE_DECL_MEMMEM HAVE_MEMPCPY HAVE_DECL_MEMRCHR HAVE_STPCPY HAVE_STPNCPY HAVE_DECL_STRNCASECMP HAVE_STRCHRNUL HAVE_DECL_STRDUP HAVE_STRNDUP HAVE_DECL_STRNDUP HAVE_DECL_STRNLEN HAVE_STRPBRK HAVE_STRSEP HAVE_DECL_STRTOK_R REPLACE_STRCASECMP REPLACE_STRSTR REPLACE_STRCASESTR ABSOLUTE_STRING_H MKDIR_P EOVERFLOW CFLAG_VISIBILITY HAVE_VISIBILITY GREP AMLINT AMLINTFLAGS DUMPER_DIR CONFIG_DIR USE_VERSION_SUFFIXES CLIENT_SCRIPTS_OPT DEFAULT_SERVER CLIENT_LOGIN SETUID_GROUP BINARY_OWNER DEFAULT_CONFIG DEFAULT_TAPE_SERVER DEFAULT_TAPE_DEVICE EXAMPLE_TAPEDEV DEFAULT_RAW_TAPE_DEVICE DEFAULT_CHANGER_DEVICE GNUTAR_LISTED_INCREMENTAL_DIRX GNUTAR_LISTED_INCREMENTAL_DIR SSH MAXTAPEBLOCKSIZE AMANDA_TMPDIR AMANDA_DBGDIR AMANDA_DEBUG_DAYS SERVICE_SUFFIX MT_FILE_FLAG AR YACC CAT COMPRESS DD GETCONF GNUPLOT GNUTAR SAMBA_CLIENT GZIP SORT MAILER MT CHIO CHS MTX MCUTIL PRINT PCAT PERL DUMP RESTORE XFSDUMP XFSRESTORE VXDUMP VXRESTORE VDUMP VRESTORE AMPLOT_COMPRESS AMPLOT_CAT_GZIP AMPLOT_CAT_COMPRESS AMPLOT_CAT_PACK LL_FMT LL_RFMT LN_S ECHO ac_ct_AR CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL LIBTOOL_DEPS LEX LEXLIB LEX_OUTPUT_ROOT READLINE_LIBS DB_EXT ac_n ac_c WANT_CLIENT_TRUE WANT_CLIENT_FALSE WANT_SAMBA_TRUE WANT_SAMBA_FALSE WANT_RESTORE_TRUE WANT_RESTORE_FALSE WANT_SERVER_TRUE WANT_SERVER_FALSE WANT_RECOVER_TRUE WANT_RECOVER_FALSE WANT_TAPE_TRUE WANT_TAPE_FALSE WANT_AMPLOT_TRUE WANT_AMPLOT_FALSE WANT_CHG_SCSI_TRUE WANT_CHG_SCSI_FALSE WANT_CHIO_SCSI_TRUE WANT_CHIO_SCSI_FALSE WANT_RUNTIME_PSEUDO_RELOC_TRUE WANT_RUNTIME_PSEUDO_RELOC_FALSE WANT_SETUID_CLIENT_TRUE WANT_SETUID_CLIENT_FALSE WANT_SSH_SECURITY_TRUE WANT_SSH_SECURITY_FALSE LTLIBOBJS LTALLOCA DOC_BUILD_DATE XSLTPROC_FLAGS XSLTPROC ENABLE_MANPAGE_BUILD_TRUE ENABLE_MANPAGE_BUILD_FALSE GCC_COMPILER_TRUE GCC_COMPILER_FALSE AM_CFLAGS LIBOBJS gl_LIBOBJS gl_LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -1026,6 +1027,10 @@ Optional Features:
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
   --disable-dependency-tracking  speeds up one-time build
   --enable-dependency-tracking   do not reject slow dependency extractors
+  --enable-threads={posix|solaris|pth|win32}
+                          specify multithreading API
+  --disable-threads       build without multithread safety
+  --disable-rpath         do not hardcode runtime library paths
   --disable-largefile     omit support for large files
   --enable-shared[=PKGS]
                           build shared libraries [default=yes]
@@ -1034,11 +1039,16 @@ Optional Features:
   --enable-fast-install[=PKGS]
                           optimize for fast installation [default=yes]
   --disable-libtool-lock  avoid locking (might break parallel builds)
+  --enable-manpage-build  Build the manpages from their XML source (shipped
+                          manpages are usually sufficient)
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
   --with-cflags=CFLAGS   arguments to the c compiler (-Wall, -g, etc)
+  --with-gnu-ld           assume the C compiler uses GNU ld default=no
+  --with-libpth-prefix[=DIR]  search for libpth in DIR/include and DIR/lib
+  --without-libpth-prefix     don't search for libpth in includedir and libdir
   --with-includes=DIR    site header files for readline, etc in DIR
   --with-libraries=DIR   site library directories for readline, etc in DIR
   --with-dumperdir=DIR   where we install the dumpers [EPREFIX/dumper]
@@ -1082,6 +1092,9 @@ Optional Packages:
   --with-krb4-security=DIR   Location of Kerberos software [/usr/kerberos /usr/cygnus /usr /opt/kerberos]
   --with-rsh-security use rsh as a transport
   --with-ssh-security use ssh as a transport
+  --with-ssh-options=[OPTIONS]
+                          Use these ssh options for ssh security; the default
+                          should work
   --with-bsdtcp-security use tcp as a transport
   --with-bsdudp-security use udp as a transport
     --with-server-principal=ARG    server host principal  ["amanda"]
@@ -1104,13 +1117,17 @@ Optional Packages:
   --with[out]-debugging[=/debug/dir] [do not] record runtime debugging information in specified directory [--with-tmpdir]
   --with-debug-days=NN    number of days to keep debugging files [default=4]
   --with-testing[=suffix] use alternate service names
+  --with-gnuplot=PATH     use gnuplot executable at PATH in amplot
   --with-dump-honor-nodump  if dump supports -h, use it for level0s too
   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
   --with-pic              try to use only PIC/non-PIC objects [default=use
                           both]
   --with-tags[=TAGS]
                           include additional configurations [automatic]
-  --without-built-manpages Do not build manpages from XML source.
+  --with-xsltproc[=PATH]
+                          Use the xsltproc binary in in PATH.
+    --with-xsltproc-flags=FLAGS
+                          Flags to pass to xsltproc (default --nonet)
 
 Some influential environment variables:
   CC          C compiler command
@@ -1547,6 +1564,11 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
+gl_header_list="$gl_header_list arpa/inet.h"
+gl_header_list="$gl_header_list sys/socket.h"
+gl_header_list="$gl_header_list netinet/in.h"
+gl_header_list="$gl_header_list netdb.h"
+gl_header_list="$gl_header_list string.h"
 
 
 
@@ -1967,7 +1989,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE=amanda
- VERSION=2.5.1p3
+ VERSION=2.5.2p1
 
 
 cat >>confdefs.h <<_ACEOF
@@ -3264,268 +3286,388 @@ else
 fi
 
 
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
 
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
 
-# Check whether --enable-largefile or --disable-largefile was given.
-if test "${enable_largefile+set}" = set; then
-  enableval="$enable_largefile"
+  test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
 
-fi;
-if test "$enable_largefile" != no; then
+  RANLIB=$ac_ct_RANLIB
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
 
-  echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5
-echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
-if test "${ac_cv_sys_largefile_CC+set}" = set; then
+
+cat >>confdefs.h <<\_ACEOF
+#define _GNU_SOURCE 1
+_ACEOF
+
+
+
+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
+echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if test "${ac_cv_prog_CPP+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_cv_sys_largefile_CC=no
-     if test "$GCC" != yes; then
-       ac_save_CC=$CC
-       while :; do
-        # IRIX 6.2 and later do not support large files by default,
-        # so use the C compiler's -n32 option if that helps.
-        cat >conftest.$ac_ext <<_ACEOF
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
-    We can't simply define LARGE_OFF_T to be 9223372036854775807,
-    since some C++ compilers masquerading as C compilers
-    incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
-  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
-                      && LARGE_OFF_T % 2147483647 == 1)
-                     ? 1 : -1];
-int
-main ()
-{
-
-  ;
-  return 0;
-}
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
 _ACEOF
-        rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  break
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  :
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+  # Broken: fails on valid input.
+continue
 fi
-rm -f conftest.err conftest.$ac_objext
-        CC="$CC -n32"
-        rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether non-existent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_sys_largefile_CC=' -n32'; break
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+  # Passes both tests.
+ac_preproc_ok=:
+break
 fi
-rm -f conftest.err conftest.$ac_objext
-        break
-       done
-       CC=$ac_save_CC
-       rm -f conftest.$ac_ext
-    fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
 fi
-echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5
-echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
-  if test "$ac_cv_sys_largefile_CC" != no; then
-    CC=$CC$ac_cv_sys_largefile_CC
-  fi
 
-  echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5
-echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
-if test "${ac_cv_sys_file_offset_bits+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
 else
-  while :; do
-  ac_cv_sys_file_offset_bits=no
+  ac_cv_prog_CPP=$CPP
+fi
+echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
-    We can't simply define LARGE_OFF_T to be 9223372036854775807,
-    since some C++ compilers masquerading as C compilers
-    incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
-  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
-                      && LARGE_OFF_T % 2147483647 == 1)
-                     ? 1 : -1];
-int
-main ()
-{
-
-  ;
-  return 0;
-}
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  break
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  :
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+  # Broken: fails on valid input.
+continue
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether non-existent headers
+  # can be detected and how.
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#define _FILE_OFFSET_BITS 64
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
-    We can't simply define LARGE_OFF_T to be 9223372036854775807,
-    since some C++ compilers masquerading as C compilers
-    incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
-  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
-                      && LARGE_OFF_T % 2147483647 == 1)
-                     ? 1 : -1];
-int
-main ()
-{
-
-  ;
-  return 0;
-}
+#include <ac_nonexistent.h>
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
   cat conftest.err >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_sys_file_offset_bits=64; break
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  # Broken: success on invalid input.
+continue
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+  # Passes both tests.
+ac_preproc_ok=:
+break
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  break
+rm -f conftest.err conftest.$ac_ext
+
 done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
 fi
-echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5
-echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
-if test "$ac_cv_sys_file_offset_bits" != no; then
 
-cat >>confdefs.h <<_ACEOF
-#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
+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
+
+
+echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6
+if test "${ac_cv_prog_egrep+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+    then ac_cv_prog_egrep='grep -E'
+    else ac_cv_prog_egrep='egrep'
+    fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
+echo "${ECHO_T}$ac_cv_prog_egrep" >&6
+ EGREP=$ac_cv_prog_egrep
+
+
+
+echo "$as_me:$LINENO: checking for AIX" >&5
+echo $ECHO_N "checking for AIX... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef _AIX
+  yes
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "yes" >/dev/null 2>&1; then
+  echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+cat >>confdefs.h <<\_ACEOF
+#define _ALL_SOURCE 1
 _ACEOF
 
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 rm -f conftest*
-  echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5
-echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
-if test "${ac_cv_sys_large_files+set}" = set; then
+
+
+echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  while :; do
-  ac_cv_sys_large_files=no
   cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
-    We can't simply define LARGE_OFF_T to be 9223372036854775807,
-    since some C++ compilers masquerading as C compilers
-    incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
-  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
-                      && LARGE_OFF_T % 2147483647 == 1)
-                     ? 1 : -1];
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
 int
 main ()
 {
@@ -3556,1264 +3698,1360 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  break
+  ac_cv_header_stdc=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
+ac_cv_header_stdc=no
 fi
 rm -f 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.  */
-#define _LARGE_FILES 1
-#include <sys/types.h>
- /* Check that off_t can represent 2**63 - 1 correctly.
-    We can't simply define LARGE_OFF_T to be 9223372036854775807,
-    since some C++ compilers masquerading as C compilers
-    incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
-  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
-                      && LARGE_OFF_T % 2147483647 == 1)
-                     ? 1 : -1];
-int
-main ()
-{
+#include <string.h>
 
-  ;
-  return 0;
-}
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_sys_large_files=1; break
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then
+  :
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
+  ac_cv_header_stdc=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-  break
-done
+rm -f conftest*
+
 fi
-echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5
-echo "${ECHO_T}$ac_cv_sys_large_files" >&6
-if test "$ac_cv_sys_large_files" != no; then
 
-cat >>confdefs.h <<_ACEOF
-#define _LARGE_FILES $ac_cv_sys_large_files
+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>
+#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
 
-for ac_prog in grep
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_GREP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+       || toupper (i) != TOUPPER (i))
+      exit(2);
+  exit (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
 else
-  case $GREP in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_GREP="$GREP" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $LOCSYSPATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_GREP="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-  ;;
-esac
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
-GREP=$ac_cv_path_GREP
-
-if test -n "$GREP"; then
-  echo "$as_me:$LINENO: result: $GREP" >&5
-echo "${ECHO_T}$GREP" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
 fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
+if test $ac_cv_header_stdc = yes; then
 
-  test -n "$GREP" && break
-done
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
 
-if test -z "$GREP"; then
-    GREP=grep
 fi
 
-cat >>confdefs.h <<_ACEOF
-#define GREP "$GREP"
-_ACEOF
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
 
-for ac_prog in egrep
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+                 inttypes.h stdint.h unistd.h
 do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_EGREP+set}" = set; then
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case $EGREP in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_EGREP="$EGREP" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $LOCSYSPATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_EGREP="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
 
-  ;;
-esac
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_Header=no"
 fi
-EGREP=$ac_cv_path_EGREP
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
 
-if test -n "$EGREP"; then
-  echo "$as_me:$LINENO: result: $EGREP" >&5
-echo "${ECHO_T}$EGREP" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
 fi
 
-  test -n "$EGREP" && break
 done
 
 
-for ac_prog in lint
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_AMLINT+set}" = set; then
+if test "${ac_cv_header_minix_config_h+set}" = set; then
+  echo "$as_me:$LINENO: checking for minix/config.h" >&5
+echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6
+if test "${ac_cv_header_minix_config_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  case $AMLINT in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_AMLINT="$AMLINT" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-as_dummy="/opt/SUNWspro/bin:$SYSLOCPATH"
-for as_dir in $as_dummy
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_AMLINT="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-  ;;
-esac
 fi
-AMLINT=$ac_cv_path_AMLINT
-
-if test -n "$AMLINT"; then
-  echo "$as_me:$LINENO: result: $AMLINT" >&5
-echo "${ECHO_T}$AMLINT" >&6
+echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5
+echo "${ECHO_T}$ac_cv_header_minix_config_h" >&6
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking minix/config.h usability" >&5
+echo $ECHO_N "checking minix/config.h usability... $ECHO_C" >&6
+cat >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 <minix/config.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-  test -n "$AMLINT" && break
-done
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
 
-if test ! -z "$AMLINT"; then
-  $AMLINT -flags | $GREP -- '-errfmt=' 2>&1 > /dev/null
-  if test $? -eq 0; then
-    AMLINTFLAGS="-n -s -u -m -x"
-    AMLINTFLAGS="$AMLINTFLAGS -errchk=%all"
-    AMLINTFLAGS="$AMLINTFLAGS -errfmt=macro"
-    AMLINTFLAGS="$AMLINTFLAGS -errhdr=no%/usr/include"
-    AMLINTFLAGS="$AMLINTFLAGS -errhdr=%user"
-    AMLINTFLAGS="$AMLINTFLAGS -errsecurity=extended"
-    AMLINTFLAGS="$AMLINTFLAGS -errtags=yes"
-    AMLINTFLAGS="$AMLINTFLAGS -Ncheck=%all"
-    AMLINTFLAGS="$AMLINTFLAGS -Nlevel=2"
-    AMLINTFLAGS="$AMLINTFLAGS -erroff=E_ASGN_NEVER_USED"
-    AMLINTFLAGS="$AMLINTFLAGS,E_ASGN_RESET"
-    AMLINTFLAGS="$AMLINTFLAGS,E_CAST_INT_CONST_TO_SMALL_INT"
-    AMLINTFLAGS="$AMLINTFLAGS,E_CAST_INT_TO_SMALL_INT"
-    AMLINTFLAGS="$AMLINTFLAGS,E_CAST_UINT_TO_SIGNED_INT"
-    AMLINTFLAGS="$AMLINTFLAGS,E_CONSTANT_CONDITION"
-    AMLINTFLAGS="$AMLINTFLAGS,E_ENUM_UNUSE"
-    AMLINTFLAGS="$AMLINTFLAGS,E_EXPR_NULL_EFFECT"
-    AMLINTFLAGS="$AMLINTFLAGS,E_FUNC_RET_ALWAYS_IGNOR"
-    AMLINTFLAGS="$AMLINTFLAGS,E_FUNC_RET_MAYBE_IGNORED"
-    AMLINTFLAGS="$AMLINTFLAGS,E_H_C_CHECK0"
-    AMLINTFLAGS="$AMLINTFLAGS,E_H_C_CHECK1"
-    AMLINTFLAGS="$AMLINTFLAGS,E_H_C_CHECK2"
-    AMLINTFLAGS="$AMLINTFLAGS,E_INCL_MNUSD"
-    AMLINTFLAGS="$AMLINTFLAGS,E_INCL_NUSD"
-    AMLINTFLAGS="$AMLINTFLAGS,E_MCR_NODIFF"
-    AMLINTFLAGS="$AMLINTFLAGS,E_NAME_MULTIPLY_DEF"
-    AMLINTFLAGS="$AMLINTFLAGS,E_P_REF_NULL_PSBL"
-    AMLINTFLAGS="$AMLINTFLAGS,E_P_REF_SUSP"
-    AMLINTFLAGS="$AMLINTFLAGS,E_PTRDIFF_OVERFLOW"
-    AMLINTFLAGS="$AMLINTFLAGS,E_P_USE_NULL_PSBL"
-    AMLINTFLAGS="$AMLINTFLAGS,E_P_USE_SUSP"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_ACCESS_WARN"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_CHDIR_WARN"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_CHMOD_WARN"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_CREAT_WITHOUT_EXCL"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_EXEC_PATH"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_EXEC_WARN"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_FOPEN_MODE"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_GETENV_WARN"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_MKDIR_WARN"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_PRINTF_VAR_FMT"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_RAND_WARN"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_SCANF_VAR_FMT"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_SELECT_WARN"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_SHELL_WARN"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_STRNCPY_WARN"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_UMASK_WARN"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_USE_AFTER_STAT"
-    AMLINTFLAGS="$AMLINTFLAGS,E_SIGN_EXTENSION_PSBL"
-    AMLINTFLAGS="$AMLINTFLAGS,E_TYPEDEF_UNUSE"
-    AMLINTFLAGS="$AMLINTFLAGS,E_UNCAL_F"
+# Is the header present?
+echo "$as_me:$LINENO: checking minix/config.h presence" >&5
+echo $ECHO_N "checking minix/config.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <minix/config.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
   else
-    AMLINTFLAGS=""
+    ac_cpp_err=
   fi
 else
-  for ac_prog in splint
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_AMLINT+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
 else
-  case $AMLINT in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_AMLINT="$AMLINT" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $SYSLOCPATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_AMLINT="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-  ;;
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: minix/config.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: minix/config.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: minix/config.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: minix/config.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: minix/config.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: minix/config.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: minix/config.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: minix/config.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: minix/config.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: minix/config.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: minix/config.h: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
 esac
+echo "$as_me:$LINENO: checking for minix/config.h" >&5
+echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6
+if test "${ac_cv_header_minix_config_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_header_minix_config_h=$ac_header_preproc
 fi
-AMLINT=$ac_cv_path_AMLINT
+echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5
+echo "${ECHO_T}$ac_cv_header_minix_config_h" >&6
 
-if test -n "$AMLINT"; then
-  echo "$as_me:$LINENO: result: $AMLINT" >&5
-echo "${ECHO_T}$AMLINT" >&6
+fi
+if test $ac_cv_header_minix_config_h = yes; then
+  MINIX=yes
 else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  MINIX=
 fi
 
-  test -n "$AMLINT" && break
-done
 
-  if test ! -z "$AMLINT"; then
-    AMLINT="splint"
-  fi
-  AMLINTFLAGS='+show-scan +unixlib -weak -globs +usedef +usereleased +impouts -paramimptemp -varuse -warnposix -redef -preproc -fixedformalarray -retval -unrecog -usevarargs -formatcode'
-fi
+if test "$MINIX" = yes; then
 
+cat >>confdefs.h <<\_ACEOF
+#define _POSIX_SOURCE 1
+_ACEOF
 
 
-# Check whether --with-includes or --without-includes was given.
-if test "${with_includes+set}" = set; then
-  withval="$with_includes"
+cat >>confdefs.h <<\_ACEOF
+#define _POSIX_1_SOURCE 2
+_ACEOF
 
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-includes option." >&5
-echo "$as_me: error: *** You must supply an argument to the --with-includes option." >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       esac
-       INCLUDE_DIRS="$withval"
 
-fi;
+cat >>confdefs.h <<\_ACEOF
+#define _MINIX 1
+_ACEOF
 
-if test "$INCLUDE_DIRS"; then
-       for dir in $INCLUDE_DIRS; do
-           if test -d "$dir"; then
-               AMANDA_CPPFLAGS="$AMANDA_CPPFLAGS -I$dir"
-           else
-               { echo "$as_me:$LINENO: WARNING: *** Include directory $dir does not exist." >&5
-echo "$as_me: WARNING: *** Include directory $dir does not exist." >&2;}
-           fi
-       done
 fi
 
 
-# Check whether --with-libraries or --without-libraries was given.
-if test "${with_libraries+set}" = set; then
-  withval="$with_libraries"
 
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-libraries option." >&5
-echo "$as_me: error: *** You must supply an argument to the --with-libraries option." >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       esac
-       LIBRARY_DIRS="$withval"
 
-fi;
 
-if test "$LIBRARY_DIRS"; then
-       for dir in $LIBRARY_DIRS; do
-           if test -d "$dir"; then
-               case "$target" in
-                 *-solaris2*,*-netbsd*)
-                       AMANDA_LDFLAGS="$AMANDA_LDFLAGS -R$dir"
-                       ;;
-               esac
-               AMANDA_LDFLAGS="$AMANDA_LDFLAGS -L$dir"
-           else
-               { echo "$as_me:$LINENO: WARNING: *** Library directory $dir does not exist." >&5
-echo "$as_me: WARNING: *** Library directory $dir does not exist." >&2;}
-           fi
-       done
-fi
 
 
 
-# Check whether --with-dumperdir or --without-dumperdir was given.
-if test "${with_dumperdir+set}" = set; then
-  withval="$with_dumperdir"
 
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-dumperdir option." >&5
-echo "$as_me: error: *** You must supply an argument to the --with-dumperdir option." >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       esac
-       DUMPER_DIR="$withval"
 
+
+  echo "$as_me:$LINENO: checking whether it is safe to define __EXTENSIONS__" >&5
+echo $ECHO_N "checking whether it is safe to define __EXTENSIONS__... $ECHO_C" >&6
+if test "${ac_cv_safe_to_define___extensions__+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
 
-        test "x$prefix" = xNONE && prefix=$ac_default_prefix
-        test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
-        DUMPER_DIR=$exec_prefix/dumper
+#        define __EXTENSIONS__ 1
+         $ac_includes_default
+int
+main ()
+{
 
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_safe_to_define___extensions__=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-fi;
-DUMPER_DIR=`(
-    test "x$prefix" = xNONE && prefix=$ac_default_prefix
-    test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
-    eval echo "$DUMPER_DIR"
-)`
+ac_cv_safe_to_define___extensions__=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_safe_to_define___extensions__" >&5
+echo "${ECHO_T}$ac_cv_safe_to_define___extensions__" >&6
+  test $ac_cv_safe_to_define___extensions__ = yes &&
+    cat >>confdefs.h <<\_ACEOF
+#define __EXTENSIONS__ 1
+_ACEOF
 
-cat >>confdefs.h <<_ACEOF
-#define DUMPER_DIR "$DUMPER_DIR"
+  cat >>confdefs.h <<\_ACEOF
+#define _POSIX_PTHREAD_SEMANTICS 1
 _ACEOF
 
+  cat >>confdefs.h <<\_ACEOF
+#define _TANDEM_SOURCE 1
+_ACEOF
 
 
 
-# Check whether --with-configdir or --without-configdir was given.
-if test "${with_configdir+set}" = set; then
-  withval="$with_configdir"
 
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-configdir option." >&5
-echo "$as_me: error: *** You must supply an argument to the --with-configdir option." >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       *) CONFIG_DIR="$withval"
-         ;;
-       esac
 
+
+       # Check whether --enable-threads or --disable-threads was given.
+if test "${enable_threads+set}" = set; then
+  enableval="$enable_threads"
+  gl_use_threads=$enableval
 else
-  : ${CONFIG_DIR="$sysconfdir/amanda"}
+  case "$host_os" in
+                            osf*) gl_use_threads=no ;;
+       *)    gl_use_threads=yes ;;
+     esac
 
 fi;
-CONFIG_DIR=`(
-    test "x$prefix" = xNONE && prefix=$ac_default_prefix
-    test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
-    eval echo "$CONFIG_DIR"
-)`
-
-cat >>confdefs.h <<_ACEOF
-#define CONFIG_DIR "$CONFIG_DIR"
-_ACEOF
-
-
-
+  if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
+    # For using <pthread.h>:
+    case "$host_os" in
+      osf*)
+        # On OSF/1, the compiler needs the flag -D_REENTRANT so that it
+        # groks <pthread.h>. cc also understands the flag -pthread, but
+        # we don't use it because 1. gcc-2.95 doesn't understand -pthread,
+        # 2. putting a flag into CPPFLAGS that has an effect on the linker
+        # causes the AC_TRY_LINK test below to succeed unexpectedly,
+        # leading to wrong values of LIBTHREAD and LTLIBTHREAD.
+        CPPFLAGS="$CPPFLAGS -D_REENTRANT"
+        ;;
+    esac
+    # Some systems optimize for single-threaded programs by default, and
+    # need special flags to disable these optimizations. For example, the
+    # definition of 'errno' in <errno.h>.
+    case "$host_os" in
+      aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;;
+      solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;;
+    esac
+  fi
 
-# Check whether --with-indexdir or --without-indexdir was given.
-if test "${with_indexdir+set}" = set; then
-  withval="$with_indexdir"
-     { { echo "$as_me:$LINENO: error: *** --with-indexdir is deprecated, use indexdir in amanda.conf instead." >&5
-echo "$as_me: error: *** --with-indexdir is deprecated, use indexdir in amanda.conf instead." >&2;}
-   { (exit 1); exit 1; }; }
 
-fi;
 
 
-# Check whether --with-dbdir or --without-dbdir was given.
-if test "${with_dbdir+set}" = set; then
-  withval="$with_dbdir"
-     { { echo "$as_me:$LINENO: error: *** --with-dbdir is deprecated, use infofile in amanda.conf instead." >&5
-echo "$as_me: error: *** --with-dbdir is deprecated, use infofile in amanda.conf instead." >&2;}
-   { (exit 1); exit 1; }; }
 
-fi;
 
 
-# Check whether --with-logdir or --without-logdir was given.
-if test "${with_logdir+set}" = set; then
-  withval="$with_logdir"
-     { { echo "$as_me:$LINENO: error: *** --with-logdir is deprecated, use logdir in amanda.conf instead." >&5
-echo "$as_me: error: *** --with-logdir is deprecated, use logdir in amanda.conf instead." >&2;}
-   { (exit 1); exit 1; }; }
 
-fi;
 
 
-# Check whether --with-suffixes or --without-suffixes was given.
-if test "${with_suffixes+set}" = set; then
-  withval="$with_suffixes"
-  USE_VERSION_SUFFIXES=$withval
+# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
+# for constant arguments.  Useless!
+echo "$as_me:$LINENO: checking for working alloca.h" >&5
+echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6
+if test "${ac_cv_working_alloca_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  : ${USE_VERSION_SUFFIXES=no}
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <alloca.h>
+int
+main ()
+{
+char *p = (char *) alloca (2 * sizeof (int));
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_working_alloca_h=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-fi;
-case "$USE_VERSION_SUFFIXES" in
-y | ye | yes)
+ac_cv_working_alloca_h=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5
+echo "${ECHO_T}$ac_cv_working_alloca_h" >&6
+if test $ac_cv_working_alloca_h = yes; then
 
 cat >>confdefs.h <<\_ACEOF
-#define USE_VERSION_SUFFIXES 1
+#define HAVE_ALLOCA_H 1
 _ACEOF
 
+fi
 
-    program_suffix="-$VERSION"
-    # This is from the output of configure.in.
-    if test "x$program_transform_name" = xs,x,x,; then
-       program_transform_name=
-    else
-       # Double any \ or $.  echo might interpret backslashes.
-       cat <<\EOF_SED > conftestsed
-s,\\,\\\\,g; s,\$,$$,g
-EOF_SED
-       program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
-       rm -f conftestsed
-    fi
-    test "x$program_prefix" != xNONE &&
-       program_transform_name="s,^,${program_prefix},; $program_transform_name"
-    # Use a double $ so make ignores it.
-    test "x$program_suffix" != xNONE &&
-       program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
-
-    # sed with no file args requires a program.
-    test "x$program_transform_name" = "" && program_transform_name="xs,x,x,"
-    # Remove empty command
-    cat <<\EOF_SED > conftestsed
-s,\;\;,\;,g; s,\; \$,,g; s,\;$,,g
-EOF_SED
-    program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
-    rm -f conftestsed
-  ;;
-n | no) USE_VERSION_SUFFIXES=no
-  ;;
-*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-suffixes option." >&5
-echo "$as_me: error: *** You must not supply an argument to --with-suffixes option." >&2;}
-   { (exit 1); exit 1; }; }
-  ;;
-esac
-
-
-case "$target" in
-    *-hp-*)
-       CLIENT_SCRIPTS_OPT=amhpfixdevs
-       ;;
-    *-sni-sysv4)
-       CLIENT_SCRIPTS_OPT=amsinixfixdevs
-       ;;
-    *)
-       CLIENT_SCRIPTS_OPT=
-       ;;
-esac
+echo "$as_me:$LINENO: checking for alloca" >&5
+echo $ECHO_N "checking for alloca... $ECHO_C" >&6
+if test "${ac_cv_func_alloca_works+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __GNUC__
+# define alloca __builtin_alloca
+#else
+# ifdef _MSC_VER
+#  include <malloc.h>
+#  define alloca _alloca
+# else
+#  if HAVE_ALLOCA_H
+#   include <alloca.h>
+#  else
+#   ifdef _AIX
+ #pragma alloca
+#   else
+#    ifndef alloca /* predefined by HP cc +Olibcalls */
+char *alloca ();
+#    endif
+#   endif
+#  endif
+# endif
+#endif
 
+int
+main ()
+{
+char *p = (char *) alloca (1);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_alloca_works=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+ac_cv_func_alloca_works=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5
+echo "${ECHO_T}$ac_cv_func_alloca_works" >&6
 
+if test $ac_cv_func_alloca_works = yes; then
 
-# Check whether --with-client-only or --without-client-only was given.
-if test "${with_client_only+set}" = set; then
-  withval="$with_client_only"
-     { { echo "$as_me:$LINENO: error: *** --with-client-only is deprecated, use --without-server instead." >&5
-echo "$as_me: error: *** --with-client-only is deprecated, use --without-server instead." >&2;}
-   { (exit 1); exit 1; }; }
+cat >>confdefs.h <<\_ACEOF
+#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.
 
-# Check whether --with-server-only or --without-server-only was given.
-if test "${with_server_only+set}" = set; then
-  withval="$with_server_only"
-     { { echo "$as_me:$LINENO: error: *** --with-server-only is deprecated, use --without-client instead." >&5
-echo "$as_me: error: *** --with-server-only is deprecated, use --without-client instead." >&2;}
-   { (exit 1); exit 1; }; }
+ALLOCA=alloca.$ac_objext
 
-fi;
+cat >>confdefs.h <<\_ACEOF
+#define C_ALLOCA 1
+_ACEOF
 
 
-# Check whether --with-client or --without-client was given.
-if test "${with_client+set}" = set; then
-  withval="$with_client"
+echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5
+echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6
+if test "${ac_cv_os_cray+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* 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
 
-       case "$withval" in
-       y | ye | yes) NO_CLIENT_MODE=false;;
-       n | no) NO_CLIENT_MODE=true;;
-       *)
-           { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-client option." >&5
-echo "$as_me: error: *** You must not supply an argument to --with-client option." >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       esac
+_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
+fi
+rm -f conftest*
 
+fi
+echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5
+echo "${ECHO_T}$ac_cv_os_cray" >&6
+if test $ac_cv_os_cray = yes; then
+  for ac_func in _getb67 GETB67 getb67; do
+    as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+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
 
-fi;
+/* 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
 
-# Check whether --with-server or --without-server was given.
-if test "${with_server+set}" = set; then
-  withval="$with_server"
+#undef $ac_func
 
-       case "$withval" in
-       y | ye | yes) NO_SERVER_MODE=false ;;
-       n | no) NO_SERVER_MODE=true;NO_RESTORE_MODE=true;;
-       *)
-           { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-server option.  Maybe you meant --with-index-server=$withval" >&5
-echo "$as_me: error: *** You must not supply an argument to --with-server option.  Maybe you meant --with-index-server=$withval" >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       esac
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
 
+int
+main ()
+{
+return f != $ac_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-fi;
-if test "x${NO_SERVER_MODE+set}" != xset ; then
-   NO_SERVER_MODE=false
+eval "$as_ac_var=no"
 fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
 
+cat >>confdefs.h <<_ACEOF
+#define CRAY_STACKSEG_END $ac_func
+_ACEOF
 
-# Check whether --with-restore or --without-restore was given.
-if test "${with_restore+set}" = set; then
-  withval="$with_restore"
-
-       case "$withval" in
-       y | ye | yes) NO_RESTORE_MODE=false;;
-       n | no) NO_RESTORE_MODE=true;;
-       *)
-           { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-restore option." >&5
-echo "$as_me: error: *** You must not supply an argument to --with-restore option." >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       esac
-
-
-fi;
-if test "x${NO_RESTORE_MODE+set}" != xset ; then
-   NO_RESTORE_MODE=${NO_SERVER_MODE-false}
+    break
 fi
 
-if ${NO_SERVER_MODE-false}; then
-   if ${NO_RESTORE_MODE-false}; then
-                        true
-   else
-      { { echo "$as_me:$LINENO: error: *** --without-server requires --without-restore" >&5
-echo "$as_me: error: *** --without-server requires --without-restore" >&2;}
-   { (exit 1); exit 1; }; }
-   fi
+  done
 fi
 
-
-# Check whether --with-amrecover or --without-amrecover was given.
-if test "${with_amrecover+set}" = set; then
-  withval="$with_amrecover"
-
-       case "$withval" in
-       y | ye | yes)
-           if ${NO_CLIENT_MODE-false}; then
-               { { echo "$as_me:$LINENO: error: *** --without-client and --with-amrecover are incompatible" >&5
-echo "$as_me: error: *** --without-client and --with-amrecover are incompatible" >&2;}
-   { (exit 1); exit 1; }; }
-           fi
-           NO_RECOVER_MODE=false;;
-       n | no) NO_RECOVER_MODE=true;;
-       *)
-           { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-amrecover option." >&5
-echo "$as_me: error: *** You must not supply an argument to --with-amrecover option." >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       esac
-
-
-fi;
-
-
-# Check whether --with-index-server or --without-index-server was given.
-if test "${with_index_server+set}" = set; then
-  withval="$with_index_server"
-
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-index-server option." >&5
-echo "$as_me: error: *** You must supply an argument to the --with-index-server option." >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       *) DEFAULT_SERVER="$withval"
-         ;;
-       esac
-
+echo "$as_me:$LINENO: checking stack direction for C alloca" >&5
+echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6
+if test "${ac_cv_c_stack_direction+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  : ${DEFAULT_SERVER=`uname -n`}
-
-fi;
-
-cat >>confdefs.h <<_ACEOF
-#define DEFAULT_SERVER "$DEFAULT_SERVER"
-_ACEOF
-
-
-
-
-# Check whether --with-force-uid or --without-force-uid was given.
-if test "${with_force_uid+set}" = set; then
-  withval="$with_force_uid"
-  FORCE_USERID="$withval"
+  if test "$cross_compiling" = yes; then
+  ac_cv_c_stack_direction=0
 else
-  : ${FORCE_USERID=yes}
-
-fi;
-case "$FORCE_USERID" in
-y | ye | yes)
-cat >>confdefs.h <<\_ACEOF
-#define FORCE_USERID 1
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
 _ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+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;
+}
 
-  ;;
-n | no) :
-  ;;
-*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-force-uid option." >&5
-echo "$as_me: error: *** You must not supply an argument to --with-force-uid option." >&2;}
-   { (exit 1); exit 1; }; }
-esac
-
-
-# Check whether --with-user or --without-user was given.
-if test "${with_user+set}" = set; then
-  withval="$with_user"
-
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-user option." >&5
-echo "$as_me: error: *** You must supply an argument to the --with-user option." >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       *) CLIENT_LOGIN="$withval"
-         ;;
-       esac
-
+int
+main ()
+{
+  exit (find_stack_direction () < 0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_c_stack_direction=1
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-fi;
-if test "x${CLIENT_LOGIN+set}" != xset; then
-    { { echo "$as_me:$LINENO: error: *** --with-user=USER is missing" >&5
-echo "$as_me: error: *** --with-user=USER is missing" >&2;}
-   { (exit 1); exit 1; }; }
+( exit $ac_status )
+ac_cv_c_stack_direction=-1
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5
+echo "${ECHO_T}$ac_cv_c_stack_direction" >&6
 
 cat >>confdefs.h <<_ACEOF
-#define CLIENT_LOGIN "$CLIENT_LOGIN"
+#define STACK_DIRECTION $ac_cv_c_stack_direction
 _ACEOF
 
 
-
-
-# Check whether --with-group or --without-group was given.
-if test "${with_group+set}" = set; then
-  withval="$with_group"
-
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-group option." >&5
-echo "$as_me: error: *** You must supply an argument to the --with-group option." >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       *) SETUID_GROUP="$withval"
-         ;;
-       esac
-
-
-fi;
-if test "x${SETUID_GROUP+set}" != xset; then
-    { { echo "$as_me:$LINENO: error: *** --with-group=GROUP is missing" >&5
-echo "$as_me: error: *** --with-group=GROUP is missing" >&2;}
-   { (exit 1); exit 1; }; }
 fi
 
 
 
-# Check whether --with-owner or --without-owner was given.
-if test "${with_owner+set}" = set; then
-  withval="$with_owner"
 
-        case "$withval" in
-        "" | y | ye | yes | n | no)
-            { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-owner option." >&5
-echo "$as_me: error: *** You must supply an argument to the --with-owner option." >&2;}
-   { (exit 1); exit 1; }; }
-          ;;
-        *) BINARY_OWNER="$withval"
-          ;;
-        esac
 
 
-fi;
-if test "x${BINARY_OWNER+set}" != xset ; then
-   BINARY_OWNER=$CLIENT_LOGIN
+for ac_header in $gl_header_list
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-
-cat >>confdefs.h <<_ACEOF
-#define BINARY_OWNER "$BINARY_OWNER"
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
 _ACEOF
-
-
-
-
-# Check whether --with-rundump or --without-rundump was given.
-if test "${with_rundump+set}" = set; then
-  withval="$with_rundump"
-
-    case "$withval" in
-       n | no | y | ye | yes) FORCE_USE_RUNDUMP="$withval";;
-       *) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-rundump option." >&5
-echo "$as_me: error: *** You must not supply an argument to --with-rundump option." >&2;}
-   { (exit 1); exit 1; }; };;
-    esac
-
-
-fi;
-
-
-# Check whether --with-config or --without-config was given.
-if test "${with_config+set}" = set; then
-  withval="$with_config"
-
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-config option." >&5
-echo "$as_me: error: *** You must supply an argument to the --with-config option." >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       *) DEFAULT_CONFIG="$withval"
-         ;;
-       esac
-
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
 else
-  : ${DEFAULT_CONFIG=DailySet1}
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-fi;
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
 
-cat >>confdefs.h <<_ACEOF
-#define DEFAULT_CONFIG "$DEFAULT_CONFIG"
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
 _ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
 
-
-
-# Check whether --with-tape-server or --without-tape-server was given.
-if test "${with_tape_server+set}" = set; then
-  withval="$with_tape_server"
-
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-tape-server option." >&5
-echo "$as_me: error: *** You must supply an argument to the --with-tape-server option." >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       *) DEFAULT_TAPE_SERVER="$withval"
-         ;;
-       esac
-
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  : ${DEFAULT_TAPE_SERVER=$DEFAULT_SERVER}
-
-fi;
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
 
-cat >>confdefs.h <<_ACEOF
-#define DEFAULT_TAPE_SERVER "$DEFAULT_TAPE_SERVER"
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
 _ACEOF
 
+fi
 
+done
 
 
-# Check whether --with-tape-device or --without-tape-device was given.
-if test "${with_tape_device+set}" = set; then
-  withval="$with_tape_device"
-
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-tape-device option." >&5
-echo "$as_me: error: *** You must supply an argument to the --with-tape-device option." >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       *) DEFAULT_TAPE_DEVICE="$withval"
-         ;;
-       esac
 
 
-fi;
 
-if test ! -z "$DEFAULT_TAPE_DEVICE"; then
 
-cat >>confdefs.h <<_ACEOF
-#define DEFAULT_TAPE_DEVICE "$DEFAULT_TAPE_DEVICE"
+echo "$as_me:$LINENO: checking for C/C++ restrict keyword" >&5
+echo $ECHO_N "checking for C/C++ restrict keyword... $ECHO_C" >&6
+if test "${ac_cv_c_restrict+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_c_restrict=no
+   # Try the official restrict keyword, then gcc's __restrict, and
+   # the less common variants.
+   for ac_kw in restrict __restrict __restrict__ _Restrict; do
+     cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
 _ACEOF
-
-
-fi
-
-
-# Check whether --with-ftape-raw-device or --without-ftape-raw-device was given.
-if test "${with_ftape_raw_device+set}" = set; then
-  withval="$with_ftape_raw_device"
-
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-ftape-rawdevice option." >&5
-echo "$as_me: error: *** You must supply an argument to the --with-ftape-rawdevice option." >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       *) DEFAULT_RAW_TAPE_DEVICE="$withval"
-         ;;
-       esac
-
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+float * $ac_kw x;
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_c_restrict=$ac_kw; break
 else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-       if test -z "$DEFAULT_RAW_TAPE_DEVICE"; then
-           echo "$as_me:$LINENO: checking for raw ftape device" >&5
-echo $ECHO_N "checking for raw ftape device... $ECHO_C" >&6
-                   raw_tape_dev=/dev/null
-                               for num in 3 2 1 0 ; do
-                   td=/dev/rawft${num}
-                   if test -r $td; then
-                       raw_tape_dev=$td
-                   fi
-               done
-           DEFAULT_RAW_TAPE_DEVICE=$raw_tape_dev
-           echo "$as_me:$LINENO: result: $DEFAULT_RAW_TAPE_DEVICE" >&5
-echo "${ECHO_T}$DEFAULT_RAW_TAPE_DEVICE" >&6
-       fi
-
-
-fi;
-
-if test -z "$DEFAULT_RAW_TAPE_DEVICE"; then
-    DEFAULT_RAW_TAPE_DEVICE=/dev/null
 fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+   done
 
-
-cat >>confdefs.h <<_ACEOF
-#define DEFAULT_RAW_TAPE_DEVICE "$DEFAULT_RAW_TAPE_DEVICE"
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_restrict" >&5
+echo "${ECHO_T}$ac_cv_c_restrict" >&6
+ case $ac_cv_c_restrict in
+   restrict) ;;
+   no)
+cat >>confdefs.h <<\_ACEOF
+#define restrict
+_ACEOF
+ ;;
+   *)  cat >>confdefs.h <<_ACEOF
+#define restrict $ac_cv_c_restrict
 _ACEOF
+ ;;
+ esac
 
 
 
 
-# Check whether --with-rew-tape or --without-rew-tape was given.
-if test "${with_rew_tape+set}" = set; then
-  withval="$with_rew_tape"
-     { { echo "$as_me:$LINENO: error: *** --with-rew-tape is deprecated, use --with-tape-device instead." >&5
-echo "$as_me: error: *** --with-rew-tape is deprecated, use --with-tape-device instead." >&2;}
-   { (exit 1); exit 1; }; }
 
-fi;
 
 
-# Check whether --with-norew-tape or --without-norew-tape was given.
-if test "${with_norew_tape+set}" = set; then
-  withval="$with_norew_tape"
-     { { echo "$as_me:$LINENO: error: *** --with-norew-tape is deprecated, use --with-tape-device instead." >&5
-echo "$as_me: error: *** --with-norew-tape is deprecated, use --with-tape-device instead." >&2;}
-   { (exit 1); exit 1; }; }
 
-fi;
 
+  :
 
-# Check whether --with-changer-device or --without-changer-device was given.
-if test "${with_changer_device+set}" = set; then
-  withval="$with_changer_device"
 
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-changer-device option." >&5
-echo "$as_me: error: *** You must supply an argument to the --with-changer-device option." >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       *) DEFAULT_CHANGER_DEVICE="$withval"
-         ;;
-       esac
 
-else
 
-       if test -z "$DEFAULT_CHANGER_DEVICE" &&
-          test -f /dev/ch0; then
-           DEFAULT_CHANGER_DEVICE=/dev/ch0
-       fi
 
+  if test $ac_cv_header_sys_socket_h = yes; then
+    SYS_SOCKET_H=''
+  else
 
-fi;
 
-if test -z "$DEFAULT_CHANGER_DEVICE"; then
-    DEFAULT_CHANGER_DEVICE=/dev/null
+for ac_header in winsock2.h ws2tcpip.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-
-
-cat >>confdefs.h <<_ACEOF
-#define DEFAULT_CHANGER_DEVICE "$DEFAULT_CHANGER_DEVICE"
-_ACEOF
-
-
-
-
-# Check whether --with-fqdn or --without-fqdn was given.
-if test "${with_fqdn+set}" = set; then
-  withval="$with_fqdn"
-  USE_FQDN=$withval
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
 else
-  : ${USE_FQDN=no}
-
-fi;
-case "$USE_FQDN" in
-n | no) : ;;
-y |  ye | yes)
-cat >>confdefs.h <<\_ACEOF
-#define USE_FQDN 1
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
 _ACEOF
-
-  ;;
-*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-fqdn option." >&5
-echo "$as_me: error: *** You must not supply an argument to --with-fqdn option." >&2;}
-   { (exit 1); exit 1; }; }
-  ;;
-esac
-
-
-# Check whether --with-broken-fsf or --without-broken-fsf was given.
-if test "${with_broken_fsf+set}" = set; then
-  withval="$with_broken_fsf"
-  HAVE_BROKEN_FSF=$withval
-else
-  : ${HAVE_BROKEN_FSF=no}
-
-fi;
-case "$HAVE_BROKEN_FSF" in
-n | no) : ;;
-y |  ye | yes)
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_BROKEN_FSF 1
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
 _ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-  ;;
-*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-broken-fsf option." >&5
-echo "$as_me: error: *** You must not supply an argument to --with-broken-fsf option." >&2;}
-   { (exit 1); exit 1; }; }
-  ;;
-esac
-
-
-# Check whether --with-reuseports or --without-reuseports was given.
-if test "${with_reuseports+set}" = set; then
-  withval="$with_reuseports"
-   case "$withval" in
-        y | ye | yes)
-          REUSEADDR=no;;
-        n | no)
-          REUSEADDR=yes;;
-        *)
-          REUSEADDR=no;;
-      esac
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
 
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
 else
-   REUSEADDR=yes;
-fi;
-case "$REUSEADDR" in
-n | no) :
-    ;;
-y |  ye | yes)
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-cat >>confdefs.h <<\_ACEOF
-#define USE_REUSEADDR 1
-_ACEOF
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
 
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
     ;;
-*)
-    { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-reuseports option." >&5
-echo "$as_me: error: *** You must not supply an argument to --with-reuseports option." >&2;}
-   { (exit 1); exit 1; }; }
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
     ;;
 esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
 
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
 
-# Check whether --with-gnutar or --without-gnutar was given.
-if test "${with_gnutar+set}" = set; then
-  withval="$with_gnutar"
-
-       case "$withval" in
-           /*) GNUTAR="$withval";;
-           y|ye|yes) :;;
-           n|no) GNUTAR=;;
-           *)  { { echo "$as_me:$LINENO: error: *** You must supply a full pathname to --with-gnutar" >&5
-echo "$as_me: error: *** You must supply a full pathname to --with-gnutar" >&2;}
-   { (exit 1); exit 1; }; };;
-       esac
-
-
-fi;
-
-
-# Check whether --with-smbclient or --without-smbclient was given.
-if test "${with_smbclient+set}" = set; then
-  withval="$with_smbclient"
-
-       case "$withval" in
-           /*) SAMBA_CLIENT="$withval";;
-           y|ye|yes) :;;
-           n|no) SAMBA_CLIENT=;;
-           *)  { { echo "$as_me:$LINENO: error: *** You must supply a full pathname to --with-smbclient" >&5
-echo "$as_me: error: *** You must supply a full pathname to --with-smbclient" >&2;}
-   { (exit 1); exit 1; }; };;
-       esac
-
-
-fi;
+fi
 
+done
 
-# Check whether --with-samba-user or --without-samba-user was given.
-if test "${with_samba_user+set}" = set; then
-  withval="$with_samba_user"
-      { { echo "$as_me:$LINENO: error: *** The samba-user option was deprecated, the username go in the amandapass" >&5
-echo "$as_me: error: *** The samba-user option was deprecated, the username go in the amandapass" >&2;}
-   { (exit 1); exit 1; }; }
+    SYS_SOCKET_H='sys/socket.h'
+  fi
 
 
-fi;
 
 
-# Check whether --with-gnutar-listdir or --without-gnutar-listdir was given.
-if test "${with_gnutar_listdir+set}" = set; then
-  withval="$with_gnutar_listdir"
 
-       case "$withval" in
-           n | no)             unset GNUTAR_LISTDIR ;;
-           y | ye | yes)       : ${GNUTAR_LISTDIR=$localstatedir/amanda/gnutar-lists} ;;
-           /*)                 GNUTAR_LISTDIR="$withval" ;;
-           *)                  { { echo "$as_me:$LINENO: error: *** You must supply a full pathname to --with-gnutar-listdir" >&5
-echo "$as_me: error: *** You must supply a full pathname to --with-gnutar-listdir" >&2;}
-   { (exit 1); exit 1; }; }
-       esac
 
-else
-  : ${GNUTAR_LISTDIR="$localstatedir/amanda/gnutar-lists"}
 
-fi;
-if test "$GNUTAR_LISTDIR"; then
-    GNUTAR_LISTDIR=`(
-        test "x$prefix" = xNONE && prefix=$ac_default_prefix
-        eval echo "$GNUTAR_LISTDIR"
-    )`
 
-cat >>confdefs.h <<_ACEOF
-#define GNUTAR_LISTED_INCREMENTAL_DIR "$GNUTAR_LISTDIR"
-_ACEOF
 
-    GNUTAR_LISTED_INCREMENTAL_DIRX=$GNUTAR_LISTDIR
-else
-    GNUTAR_LISTED_INCREMENTAL_DIRX=
-fi
 
 
+  :
 
-# Check whether --with-gnutar-listed-incremental or --without-gnutar-listed-incremental was given.
-if test "${with_gnutar_listed_incremental+set}" = set; then
-  withval="$with_gnutar_listed_incremental"
-      { { echo "$as_me:$LINENO: error: *** The gnutar-listed-incremental option was deprecated, use gnutar-listdir instead" >&5
-echo "$as_me: error: *** The gnutar-listed-incremental option was deprecated, use gnutar-listdir instead" >&2;}
-   { (exit 1); exit 1; }; }
 
 
-fi;
-GNUTAR_LISTED_INCREMENTAL_DIR=$GNUTAR_LISTDIR
 
 
 
-# Check whether --with-bsd-security or --without-bsd-security was given.
-if test "${with_bsd_security+set}" = set; then
-  withval="$with_bsd_security"
-  BSD_SECURITY=$withval
+  echo "$as_me:$LINENO: checking for IPv4 sockets" >&5
+echo $ECHO_N "checking for IPv4 sockets... $ECHO_C" >&6
+  if test "${gl_cv_socket_ipv4+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  : ${BSD_SECURITY=yes}
-
-fi;
-case "$BSD_SECURITY" in
-n | no) : ;;
-y |  ye | yes)
-cat >>confdefs.h <<\_ACEOF
-#define BSD_SECURITY 1
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
 _ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+int
+main ()
+{
+int x = AF_INET; struct in_addr y; struct sockaddr_in z;
+ if (&x && &y && &z) return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  gl_cv_socket_ipv4=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-  ;;
-*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-bsd-security option." >&5
-echo "$as_me: error: *** You must not supply an argument to --with-bsd-security option." >&2;}
-   { (exit 1); exit 1; }; }
-  ;;
-esac
-
+gl_cv_socket_ipv4=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
 
-# Check whether --with-amandahosts or --without-amandahosts was given.
-if test "${with_amandahosts+set}" = set; then
-  withval="$with_amandahosts"
-  USE_AMANDAHOSTS=$withval
-else
-  : ${USE_AMANDAHOSTS=yes}
+  echo "$as_me:$LINENO: result: $gl_cv_socket_ipv4" >&5
+echo "${ECHO_T}$gl_cv_socket_ipv4" >&6
+  if test $gl_cv_socket_ipv4 = yes; then
 
-fi;
-case "$USE_AMANDAHOSTS" in
-n | no) : ;;
-y |  ye | yes) :
-  case "$BSD_SECURITY" in
-  y | ye | yes)
 cat >>confdefs.h <<\_ACEOF
-#define USE_AMANDAHOSTS 1
+#define HAVE_IPV4 1
 _ACEOF
 
-    ;;
-  esac
-  ;;
-*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-amandahosts option." >&5
-echo "$as_me: error: *** You must not supply an argument to --with-amandahosts option." >&2;}
-   { (exit 1); exit 1; }; }
-  ;;
-esac
-
-
-
-# Check whether --with-dbmalloc or --without-dbmalloc was given.
-if test "${with_dbmalloc+set}" = set; then
-  withval="$with_dbmalloc"
-  DBMALLOC="$withval"
-else
-  : ${DBMALLOC=no}
-
-fi;
-
-case "$DBMALLOC" in
-n | no)
-    DBMALLOCCFLAGS=""
-    DBMALLOCLIBS=""
-    ;;
-*)
+  fi
 
-echo "$as_me:$LINENO: checking for malloc in -ldbmalloc" >&5
-echo $ECHO_N "checking for malloc in -ldbmalloc... $ECHO_C" >&6
-if test "${ac_cv_lib_dbmalloc_malloc+set}" = set; then
+  echo "$as_me:$LINENO: checking for IPv6 sockets" >&5
+echo $ECHO_N "checking for IPv6 sockets... $ECHO_C" >&6
+  if test "${gl_cv_socket_ipv6+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-ldbmalloc  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
 #endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char malloc ();
 int
 main ()
 {
-malloc ();
+int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z;
+ if (&x && &y && &z) return 0;
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -4827,529 +5065,316 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_dbmalloc_malloc=yes
+  gl_cv_socket_ipv6=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_dbmalloc_malloc=no
+gl_cv_socket_ipv6=no
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_dbmalloc_malloc" >&5
-echo "${ECHO_T}$ac_cv_lib_dbmalloc_malloc" >&6
-if test $ac_cv_lib_dbmalloc_malloc = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBDBMALLOC 1
+
+  echo "$as_me:$LINENO: result: $gl_cv_socket_ipv6" >&5
+echo "${ECHO_T}$gl_cv_socket_ipv6" >&6
+  if test $gl_cv_socket_ipv6 = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_IPV6 1
 _ACEOF
 
-  LIBS="-ldbmalloc $LIBS"
+  fi
+
+echo "$as_me:$LINENO: checking for inline" >&5
+echo $ECHO_N "checking for inline... $ECHO_C" >&6
+if test "${ac_cv_c_inline+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_c_inline=no
+for ac_kw in inline __inline__ __inline; do
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifndef __cplusplus
+typedef int foo_t;
+static $ac_kw foo_t static_foo () {return 0; }
+$ac_kw foo_t foo () {return 0; }
+#endif
+
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_c_inline=$ac_kw; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
 
 fi
+echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5
+echo "${ECHO_T}$ac_cv_c_inline" >&6
 
-    if test "x$ac_cv_lib_dbmalloc_malloc" != "xyes"; then
-      { echo "$as_me:$LINENO: WARNING: *** dbmalloc library not found - no malloc debugging support!" >&5
-echo "$as_me: WARNING: *** dbmalloc library not found - no malloc debugging support!" >&2;}
-      DBMALLOCCFLAGS=""
-      DBMALLOCLIBS=""
-    else
-      DBMALLOCCFLAGS="-I$DBMALLOC -DUSE_DBMALLOC"
-      DBMALLOCLIBS="-L$DBMALLOC -ldbmalloc"
-    fi
+
+case $ac_cv_c_inline in
+  inline | yes) ;;
+  *)
+    case $ac_cv_c_inline in
+      no) ac_val=;;
+      *) ac_val=$ac_cv_c_inline;;
+    esac
+    cat >>confdefs.h <<_ACEOF
+#ifndef __cplusplus
+#define inline $ac_val
+#endif
+_ACEOF
     ;;
 esac
 
 
-# Check whether --with-ipv6 or --without-ipv6 was given.
-if test "${with_ipv6+set}" = set; then
-  withval="$with_ipv6"
 
-       case "$withval" in
-       y | ye | yes) amanda_ipv6=true;;
-       n | no) amanda_ipv6=false;;
-       *)
-           { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-ipv6 option." >&5
-echo "$as_me: error: *** You must not supply an argument to --with-ipv6 option." >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       esac
 
 
-fi;
 
 
-: ${KRB4_SPOTS="/usr/kerberos /usr/cygnus /usr /opt/kerberos"}
+
+      if test "X$prefix" = "XNONE"; then
+    acl_final_prefix="$ac_default_prefix"
+  else
+    acl_final_prefix="$prefix"
+  fi
+  if test "X$exec_prefix" = "XNONE"; then
+    acl_final_exec_prefix='${prefix}'
+  else
+    acl_final_exec_prefix="$exec_prefix"
+  fi
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
+  prefix="$acl_save_prefix"
 
 
-# Check whether --with-krb4-security or --without-krb4-security was given.
-if test "${with_krb4_security+set}" = set; then
-  withval="$with_krb4_security"
-  KRB4_SECURITY="$withval"
+# Check whether --with-gnu-ld or --without-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then
+  withval="$with_gnu_ld"
+  test "$withval" = no || with_gnu_ld=yes
 else
-  : ${KRB4_SECURITY=no}
-
+  with_gnu_ld=no
 fi;
-
-case "$KRB4_SECURITY" in
-n | no) KRB4_SECURITY=no ;;
-y | ye | yes) : ;;
-*) KRB4_SPOTS="$KRB4_SECURITY"
-   KRB4_SECURITY=yes
-   ;;
-esac
-
-echo "$as_me:$LINENO: checking for Kerberos and Amanda kerberos4 bits" >&5
-echo $ECHO_N "checking for Kerberos and Amanda kerberos4 bits... $ECHO_C" >&6
-if test "x${KRB4_SECURITY}" = xyes -a -f  ${srcdir-.}/common-src/krb4-security.c ; then
-    for dir in $KRB4_SPOTS; do
-       if test -f ${dir}/lib/libkrb.a -a -f ${dir}/lib/libdes.a ; then
-           #
-           # This is the original Kerberos 4.
-           #
-           echo "$as_me:$LINENO: result: found in $dir" >&5
-echo "${ECHO_T}found in $dir" >&6
-           KRB4_SECURITY=yes
-
-cat >>confdefs.h <<\_ACEOF
-#define KRB4_SECURITY 1
-_ACEOF
-
-           if test -d $dir/include/kerberosIV ; then
-               #
-               # This handles BSD/OS.
-               #
-               KRB4INCLUDES=-I$dir/include/kerberosIV
-           else
-               KRB4INCLUDES=-I$dir/include
-           fi
-           KRB4LDFLAGS=-L$dir/lib
-           KRB4LIBS="-lkrb -ldes"
-           if test -f ${dir}/lib/libcom_err.a; then
-               KRB4LIBS="$KRB4LIBS -lcom_err"
-           fi
-           break
-       elif test -f ${dir}/lib/libkrb4.a &&
-            test -f ${dir}/lib/libcrypto.a &&
-            test -f ${dir}/lib/libdes425.a ; then
-           #
-           # This is Kerberos 5 with Kerberos 4 back-support.
-           #
-           echo "$as_me:$LINENO: result: found in $dir" >&5
-echo "${ECHO_T}found in $dir" >&6
-           KRB4_SECURITY=yes
-
-cat >>confdefs.h <<\_ACEOF
-#define KRB4_SECURITY 1
-_ACEOF
-
-           KRB4INCLUDES="-I$dir/include -I$dir/include/kerberosIV"
-           KRB4LDFLAGS=-L$dir/lib
-           if test -f ${dir}/lib/libkrb5.a &&
-               test -f ${dir}/lib/libcom_err.a; then
-               KRB4LIBS="-lkrb4 -lkrb5 -lcrypto -ldes425 -lcom_err"
-           else
-               KRB4LIBS="-lkrb4 -lcrypto -ldes425"
-           fi
-           break
-       fi
-    done
-
-    if test "x$KRB4LDFLAGS" = "x" ; then
-       echo "$as_me:$LINENO: result: no libraries found" >&5
-echo "${ECHO_T}no libraries found" >&6
-    fi
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  echo "$as_me:$LINENO: checking for ld used by GCC" >&5
+echo $ECHO_N "checking for ld used by GCC... $ECHO_C" >&6
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [\\/]* | [A-Za-z]:[\\/]*)
+      re_direlt='/[^/][^/]*/\.\./'
+      # Canonicalize the path of ld
+      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+       ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  echo "$as_me:$LINENO: checking for GNU ld" >&5
+echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6
 else
-    echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+  echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6
 fi
-
-
-# Check whether --with-rsh-security or --without-rsh-security was given.
-if test "${with_rsh_security+set}" = set; then
-  withval="$with_rsh_security"
-  RSH_SECURITY=$withval
+if test "${acl_cv_path_LD+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  : ${RSH_SECURITY=yes}
-
-fi;
-case "$RSH_SECURITY" in
-n | no) : ;;
-y |  ye | yes)
-cat >>confdefs.h <<\_ACEOF
-#define RSH_SECURITY 1
-_ACEOF
-
-  ;;
-*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument the to --with-rsh-security option." >&5
-echo "$as_me: error: *** You must not supply an argument the to --with-rsh-security option." >&2;}
-   { (exit 1); exit 1; }; }
-  ;;
-esac
-
-
-# Check whether --with-ssh-security or --without-ssh-security was given.
-if test "${with_ssh_security+set}" = set; then
-  withval="$with_ssh_security"
-  SSH_SECURITY=$withval
+  if test -z "$LD"; then
+  IFS="${IFS=  }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+  for ac_dir in $PATH; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      acl_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some GNU ld's only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in
+      *GNU* | *'with BFD'*)
+       test "$with_gnu_ld" != no && break ;;
+      *)
+       test "$with_gnu_ld" != yes && break ;;
+      esac
+    fi
+  done
+  IFS="$ac_save_ifs"
 else
-  : ${SSH_SECURITY=no}
-
-fi;
-case "$SSH_SECURITY" in
-n | no) : ;;
-y |  ye | yes)
-cat >>confdefs.h <<\_ACEOF
-#define SSH_SECURITY 1
-_ACEOF
-
-              SSH_SECURITY_SET=true
-  ;;
-*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument the to --with-ssh-security option." >&5
-echo "$as_me: error: *** You must not supply an argument the to --with-ssh-security option." >&2;}
-   { (exit 1); exit 1; }; }
-  ;;
-esac
-
+  acl_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
 
-# Check whether --with-bsdtcp-security or --without-bsdtcp-security was given.
-if test "${with_bsdtcp_security+set}" = set; then
-  withval="$with_bsdtcp_security"
-  BSDTCP_SECURITY=$withval
+LD="$acl_cv_path_LD"
+if test -n "$LD"; then
+  echo "$as_me:$LINENO: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6
 else
-  : ${BSDTCP_SECURITY=yes}
-
-fi;
-case "$BSDTCP_SECURITY" in
-n | no) : ;;
-y |  ye | yes)
-cat >>confdefs.h <<\_ACEOF
-#define BSDTCP_SECURITY 1
-_ACEOF
-
-              BSDTCP_SECURITY_SET=true
-  ;;
-*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument the to --with-bsdtcp-security option." >&5
-echo "$as_me: error: *** You must not supply an argument the to --with-bsdtcp-security option." >&2;}
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
    { (exit 1); exit 1; }; }
-  ;;
-esac
-
-
-# Check whether --with-bsdudp-security or --without-bsdudp-security was given.
-if test "${with_bsdudp_security+set}" = set; then
-  withval="$with_bsdudp_security"
-  BSDUDP_SECURITY=$withval
+echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6
+if test "${acl_cv_prog_gnu_ld+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  : ${BSDUDP_SECURITY=yes}
-
-fi;
-case "$BSDUDP_SECURITY" in
-n | no) : ;;
-y |  ye | yes)
-cat >>confdefs.h <<\_ACEOF
-#define BSDUDP_SECURITY 1
-_ACEOF
-
-              BSDUDP_SECURITY_SET=true
-  ;;
-*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument the to --with-bsdudp-security option." >&5
-echo "$as_me: error: *** You must not supply an argument the to --with-bsdudp-security option." >&2;}
-   { (exit 1); exit 1; }; }
-  ;;
+  # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  acl_cv_prog_gnu_ld=yes ;;
+*)
+  acl_cv_prog_gnu_ld=no ;;
 esac
-
-
-# Check whether --with-server-principal or --without-server-principal was given.
-if test "${with_server_principal+set}" = set; then
-  withval="$with_server_principal"
-
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-server-principal option." >&5
-echo "$as_me: error: *** You must supply an argument to the --with-server-principal option." >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       *)
-           SERVER_HOST_PRINCIPLE="$withval"
-         ;;
-       esac
-
-else
-  : ${SERVER_HOST_PRINCIPLE="amanda"}
-
-fi;
-
-cat >>confdefs.h <<_ACEOF
-#define SERVER_HOST_PRINCIPLE "$SERVER_HOST_PRINCIPLE"
-_ACEOF
-
-
-
-# Check whether --with-server-instance or --without-server-instance was given.
-if test "${with_server_instance+set}" = set; then
-  withval="$with_server_instance"
-
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-server-instance option." >&5
-echo "$as_me: error: *** You must supply an argument to the --with-server-instance option." >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       *) SERVER_HOST_INSTANCE="$withval"
-         ;;
-       esac
-
-else
-  : ${SERVER_HOST_INSTANCE="amanda"}
-
-fi;
-
-cat >>confdefs.h <<_ACEOF
-#define SERVER_HOST_INSTANCE "$SERVER_HOST_INSTANCE"
-_ACEOF
-
-
-
-# Check whether --with-server-keyfile or --without-server-keyfile was given.
-if test "${with_server_keyfile+set}" = set; then
-  withval="$with_server_keyfile"
-
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-server-keyfile option." >&5
-echo "$as_me: error: *** You must supply an argument to the --with-server-keyfile option." >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       *) SERVER_HOST_KEY_FILE="$withval"
-         ;;
-       esac
-
-else
-  : ${SERVER_HOST_KEY_FILE="/.amanda"}
-
-fi;
-
-cat >>confdefs.h <<_ACEOF
-#define SERVER_HOST_KEY_FILE "$SERVER_HOST_KEY_FILE"
-_ACEOF
-
-
-
-# Check whether --with-client-principal or --without-client-principal was given.
-if test "${with_client_principal+set}" = set; then
-  withval="$with_client_principal"
-
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-client-principal option." >&5
-echo "$as_me: error: *** You must supply an argument to the --with-client-principal option." >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       *) CLIENT_HOST_PRINCIPLE="$withval"
-         ;;
-       esac
-
-else
-  : ${CLIENT_HOST_PRINCIPLE="rcmd"}
-
-fi;
-
-cat >>confdefs.h <<_ACEOF
-#define CLIENT_HOST_PRINCIPLE "$CLIENT_HOST_PRINCIPLE"
-_ACEOF
-
-
-
-# Check whether --with-client-instance or --without-client-instance was given.
-if test "${with_client_instance+set}" = set; then
-  withval="$with_client_instance"
-
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-client-instance option." >&5
-echo "$as_me: error: *** You must supply an argument to the --with-client-instance option." >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       *) CLIENT_HOST_INSTANCE="$withval"
-         ;;
-       esac
-
-else
-  : ${CLIENT_HOST_INSTANCE=HOSTNAME_INSTANCE}
-
-fi;
-
-cat >>confdefs.h <<_ACEOF
-#define CLIENT_HOST_INSTANCE $CLIENT_HOST_INSTANCE
-_ACEOF
-
-
-
-# Check whether --with-client-keyfile or --without-client-keyfile was given.
-if test "${with_client_keyfile+set}" = set; then
-  withval="$with_client_keyfile"
-
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-client-keyfile option." >&5
-echo "$as_me: error: *** You must supply an argument to the --with-client-keyfile option." >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       *) CLIENT_HOST_KEY_FILE="$withval"
-         ;;
-       esac
-
-else
-  : ${CLIENT_HOST_KEY_FILE=KEYFILE}
-
-fi;
-
-# Assume it's either KEYFILE (defined in krb.h), or a string filename...
-if test "x$CLIENT_HOST_KEY_FILE" != "xKEYFILE"; then
-  CLIENT_HOST_KEY_FILE="\"$CLIENT_HOST_KEY_FILE\""
 fi
+echo "$as_me:$LINENO: result: $acl_cv_prog_gnu_ld" >&5
+echo "${ECHO_T}$acl_cv_prog_gnu_ld" >&6
+with_gnu_ld=$acl_cv_prog_gnu_ld
 
 
-cat >>confdefs.h <<_ACEOF
-#define CLIENT_HOST_KEY_FILE $CLIENT_HOST_KEY_FILE
-_ACEOF
-
-
-
-# Check whether --with-ticket-lifetime or --without-ticket-lifetime was given.
-if test "${with_ticket_lifetime+set}" = set; then
-  withval="$with_ticket_lifetime"
 
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-ticket-lifetime option." >&5
-echo "$as_me: error: *** You must supply an argument to the --with-ticket-lifetime option." >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       *) TICKET_LIFETIME="$withval"
-         ;;
-       esac
 
+                                                echo "$as_me:$LINENO: checking for shared library run path origin" >&5
+echo $ECHO_N "checking for shared library run path origin... $ECHO_C" >&6
+if test "${acl_cv_rpath+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  : ${TICKET_LIFETIME=128}
-
-fi;
-
-cat >>confdefs.h <<_ACEOF
-#define TICKET_LIFETIME $TICKET_LIFETIME
-_ACEOF
-
 
+    CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
+    ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
+    . ./conftest.sh
+    rm -f ./conftest.sh
+    acl_cv_rpath=done
 
-: ${KRB5_SPOTS="/usr/kerberos /usr/cygnus /usr /opt/kerberos"}
-
-
-# Check whether --with-krb5-security or --without-krb5-security was given.
-if test "${with_krb5_security+set}" = set; then
-  withval="$with_krb5_security"
-  KRB5_SECURITY="$withval"
+fi
+echo "$as_me:$LINENO: result: $acl_cv_rpath" >&5
+echo "${ECHO_T}$acl_cv_rpath" >&6
+  wl="$acl_cv_wl"
+  acl_libext="$acl_cv_libext"
+  acl_shlibext="$acl_cv_shlibext"
+  acl_libname_spec="$acl_cv_libname_spec"
+  acl_library_names_spec="$acl_cv_library_names_spec"
+  acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
+  acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
+  acl_hardcode_direct="$acl_cv_hardcode_direct"
+  acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
+    # Check whether --enable-rpath or --disable-rpath was given.
+if test "${enable_rpath+set}" = set; then
+  enableval="$enable_rpath"
+  :
 else
-  : ${KRB5_SECURITY=no}
-
+  enable_rpath=yes
 fi;
 
-case "$KRB5_SECURITY" in
-n | no) KRB5_SECURITY=no
-        KRB5_SPOTS=""
-       ;;
-y | ye | yes) : ;;
-*) KRB5_SPOTS="$KRB5_SECURITY"
-   KRB5_SECURITY=yes
-   ;;
-esac
-
-# if found, force the static versions of these libs (.a) by linking directly
-# with the .a files.  I don't know how to get -R dependancies checked
-# in autoconf at this time. -kashmir
-echo "$as_me:$LINENO: checking for Kerberos V" >&5
-echo $ECHO_N "checking for Kerberos V... $ECHO_C" >&6
-KRB5_DIR_FOUND=""
-KRB5_CFLAGS=""
-for dir in $KRB5_SPOTS; do
-  for lib in lib lib64; do
-    k5libdir=${dir}/${lib}
-    if test -f ${k5libdir}/libkrb5.a -a -f ${k5libdir}/libgssapi_krb5.a -a -f ${k5libdir}/libcom_err.a; then
-       if test -f ${k5libdir}/libk5crypto.a; then
-           K5CRYPTO=${k5libdir}/libk5crypto.a
-       elif test -f ${k5libdir}/libcrypto.a; then
-           K5CRYPTO=${k5libdir}/libcrypto.a
-       else
-           K5CRYPTO=""
-       fi
-       if test -f ${k5libdir}/libkrb5support.a; then
-           K5SUPPORT=${k5libdir}/libkrb5support.a
-       else
-           K5SUPPORT=""
-       fi
-       KRB5_DIR_FOUND=$dir
-       KRB5LIBS="${k5libdir}/libgssapi_krb5.a ${k5libdir}/libkrb5.a $K5CRYPTO $K5SUPPORT ${k5libdir}/libcom_err.a"
-       KRB5CFLAGS=""
-       break
-    elif test -f ${k5libdir}/libkrb5.a -a -f ${k5libdir}/libasn1.a -a -f ${k5libdir}/libgssapi.a; then
-       KRB5_DIR_FOUND=$dir
-       KRB5LIBS="${k5libdir}/libgssapi.a ${k5libdir}/libkrb5.a ${k5libdir}/libasn1.a"
-       KRB5_CFLAGS="-DKRB5_HEIMDAL_INCLUDES"
-       break
-    fi
-  done
-done
 
-if test "$KRB5_DIR_FOUND"; then
-       echo "$as_me:$LINENO: result: found in $KRB5_DIR_FOUND" >&5
-echo "${ECHO_T}found in $KRB5_DIR_FOUND" >&6
-       KRB5_SECURITY=yes
+                  acl_libdirstem=lib
+  searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
+  if test -n "$searchpath"; then
+    acl_save_IFS="${IFS=       }"; IFS=":"
+    for searchdir in $searchpath; do
+      if test -d "$searchdir"; then
+        case "$searchdir" in
+          */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
+          *) searchdir=`cd "$searchdir" && pwd`
+             case "$searchdir" in
+               */lib64 ) acl_libdirstem=lib64 ;;
+             esac ;;
+        esac
+      fi
+    done
+    IFS="$acl_save_IFS"
+  fi
 
-cat >>confdefs.h <<\_ACEOF
-#define KRB5_SECURITY 1
-_ACEOF
 
-       #
-       # some OS's, such as NetBSD, stick krb5 includes out of the way...
-       # should probably just use autoconf to look for various include
-       # options and set them, but don't quite want to do that until I've
-       # dug into it a bit more.
-       #
-       if test -d "$KRB5_DIR_FOUND/krb5" ; then
-               KRB5INCLUDES="-I$KRB5_DIR_FOUND/include/krb5"
-       else
-               KRB5INCLUDES="-I$KRB5_DIR_FOUND/include"
-       fi
-       if test "$KRB5_CFLAGS" ; then
-               KRB5INCLUDES="$KRB5INCLUDES $KRB5_CFLAGS"
-       fi
 
-echo "$as_me:$LINENO: checking for main in -lkrb5support" >&5
-echo $ECHO_N "checking for main in -lkrb5support... $ECHO_C" >&6
-if test "${ac_cv_lib_krb5support_main+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lkrb5support  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
+  gl_threads_api=none
+  LIBTHREAD=
+  LTLIBTHREAD=
+  LIBMULTITHREAD=
+  LTLIBMULTITHREAD=
+  if test "$gl_use_threads" != no; then
+        echo "$as_me:$LINENO: checking whether imported symbols can be declared weak" >&5
+echo $ECHO_N "checking whether imported symbols can be declared weak... $ECHO_C" >&6
+    gl_have_weak=no
+    cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-
-
+extern void xyzzy ();
+#pragma weak xyzzy
 int
 main ()
 {
-main ();
+xyzzy();
   ;
   return 0;
 }
@@ -5376,30 +5401,8536 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_krb5support_main=yes
+  gl_have_weak=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_krb5support_main=no
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+    echo "$as_me:$LINENO: result: $gl_have_weak" >&5
+echo "${ECHO_T}$gl_have_weak" >&6
+    if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
+      # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
+      # it groks <pthread.h>. It's added above, in gl_LOCK_EARLY_BODY.
+      if test "${ac_cv_header_pthread_h+set}" = set; then
+  echo "$as_me:$LINENO: checking for pthread.h" >&5
+echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
+if test "${ac_cv_header_pthread_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_krb5support_main" >&5
-echo "${ECHO_T}$ac_cv_lib_krb5support_main" >&6
-if test $ac_cv_lib_krb5support_main = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBKRB5SUPPORT 1
+echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5
+echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking pthread.h usability" >&5
+echo $ECHO_N "checking pthread.h usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
 _ACEOF
-
-  LIBS="-lkrb5support $LIBS"
-
-fi
-
-       KRB5LDFLAGS=-L$k5libdir
-       break
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <pthread.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking pthread.h presence" >&5
+echo $ECHO_N "checking pthread.h presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <pthread.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: pthread.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: pthread.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: pthread.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: pthread.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: pthread.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: pthread.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: pthread.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: pthread.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: pthread.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: pthread.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: pthread.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: pthread.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: pthread.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: pthread.h: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for pthread.h" >&5
+echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6
+if test "${ac_cv_header_pthread_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_header_pthread_h=$ac_header_preproc
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_pthread_h" >&5
+echo "${ECHO_T}$ac_cv_header_pthread_h" >&6
+
+fi
+if test $ac_cv_header_pthread_h = yes; then
+  gl_have_pthread_h=yes
+else
+  gl_have_pthread_h=no
+fi
+
+
+      if test "$gl_have_pthread_h" = yes; then
+        # Other possible tests:
+        #   -lpthreads (FSU threads, PCthreads)
+        #   -lgthreads
+        gl_have_pthread=
+        # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
+        # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
+        # the second one only in libpthread, and lock.c needs it.
+        cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <pthread.h>
+int
+main ()
+{
+pthread_mutex_lock((pthread_mutex_t*)0);
+           pthread_mutexattr_init((pthread_mutexattr_t*)0);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  gl_have_pthread=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+        # Test for libpthread by looking for pthread_kill. (Not pthread_self,
+        # since it is defined as a macro on OSF/1.)
+        if test -n "$gl_have_pthread"; then
+          # The program links fine without libpthread. But it may actually
+          # need to link with libpthread in order to create multiple threads.
+          echo "$as_me:$LINENO: checking for pthread_kill in -lpthread" >&5
+echo $ECHO_N "checking for pthread_kill in -lpthread... $ECHO_C" >&6
+if test "${ac_cv_lib_pthread_pthread_kill+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char pthread_kill ();
+int
+main ()
+{
+pthread_kill ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_pthread_pthread_kill=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_pthread_pthread_kill=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_kill" >&5
+echo "${ECHO_T}$ac_cv_lib_pthread_pthread_kill" >&6
+if test $ac_cv_lib_pthread_pthread_kill = yes; then
+  LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread
+             # On Solaris and HP-UX, most pthread functions exist also in libc.
+             # Therefore pthread_in_use() needs to actually try to create a
+             # thread: pthread_create from libc will fail, whereas
+             # pthread_create will actually create a thread.
+             case "$host_os" in
+               solaris* | hpux*)
+
+cat >>confdefs.h <<\_ACEOF
+#define PTHREAD_IN_USE_DETECTION_HARD 1
+_ACEOF
+
+             esac
+
+fi
+
+        else
+          # Some library is needed. Try libpthread and libc_r.
+          echo "$as_me:$LINENO: checking for pthread_kill in -lpthread" >&5
+echo $ECHO_N "checking for pthread_kill in -lpthread... $ECHO_C" >&6
+if test "${ac_cv_lib_pthread_pthread_kill+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char pthread_kill ();
+int
+main ()
+{
+pthread_kill ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_pthread_pthread_kill=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_pthread_pthread_kill=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_kill" >&5
+echo "${ECHO_T}$ac_cv_lib_pthread_pthread_kill" >&6
+if test $ac_cv_lib_pthread_pthread_kill = yes; then
+  gl_have_pthread=yes
+             LIBTHREAD=-lpthread LTLIBTHREAD=-lpthread
+             LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread
+fi
+
+          if test -z "$gl_have_pthread"; then
+            # For FreeBSD 4.
+            echo "$as_me:$LINENO: checking for pthread_kill in -lc_r" >&5
+echo $ECHO_N "checking for pthread_kill in -lc_r... $ECHO_C" >&6
+if test "${ac_cv_lib_c_r_pthread_kill+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lc_r  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char pthread_kill ();
+int
+main ()
+{
+pthread_kill ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_c_r_pthread_kill=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_c_r_pthread_kill=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_c_r_pthread_kill" >&5
+echo "${ECHO_T}$ac_cv_lib_c_r_pthread_kill" >&6
+if test $ac_cv_lib_c_r_pthread_kill = yes; then
+  gl_have_pthread=yes
+               LIBTHREAD=-lc_r LTLIBTHREAD=-lc_r
+               LIBMULTITHREAD=-lc_r LTLIBMULTITHREAD=-lc_r
+fi
+
+          fi
+        fi
+        if test -n "$gl_have_pthread"; then
+          gl_threads_api=posix
+
+cat >>confdefs.h <<\_ACEOF
+#define USE_POSIX_THREADS 1
+_ACEOF
+
+          if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
+            if test $gl_have_weak = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define USE_POSIX_THREADS_WEAK 1
+_ACEOF
+
+              LIBTHREAD=
+              LTLIBTHREAD=
+            fi
+          fi
+          # OSF/1 4.0 and MacOS X 10.1 lack the pthread_rwlock_t type and the
+          # pthread_rwlock_* functions.
+          echo "$as_me:$LINENO: checking for pthread_rwlock_t" >&5
+echo $ECHO_N "checking for pthread_rwlock_t... $ECHO_C" >&6
+if test "${ac_cv_type_pthread_rwlock_t+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <pthread.h>
+
+int
+main ()
+{
+if ((pthread_rwlock_t *) 0)
+  return 0;
+if (sizeof (pthread_rwlock_t))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_type_pthread_rwlock_t=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_pthread_rwlock_t=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_pthread_rwlock_t" >&5
+echo "${ECHO_T}$ac_cv_type_pthread_rwlock_t" >&6
+if test $ac_cv_type_pthread_rwlock_t = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_PTHREAD_RWLOCK 1
+_ACEOF
+
+fi
+
+          # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro.
+          cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <pthread.h>
+int
+main ()
+{
+#if __FreeBSD__ == 4
+error "No, in FreeBSD 4.0 recursive mutexes actually don't work."
+#else
+int x = (int)PTHREAD_MUTEX_RECURSIVE;
+return !x;
+#endif
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_PTHREAD_MUTEX_RECURSIVE 1
+_ACEOF
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+        fi
+      fi
+    fi
+    if test -z "$gl_have_pthread"; then
+      if test "$gl_use_threads" = yes || test "$gl_use_threads" = solaris; then
+        gl_have_solaristhread=
+        gl_save_LIBS="$LIBS"
+        LIBS="$LIBS -lthread"
+        cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <thread.h>
+#include <synch.h>
+int
+main ()
+{
+thr_self();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  gl_have_solaristhread=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+        LIBS="$gl_save_LIBS"
+        if test -n "$gl_have_solaristhread"; then
+          gl_threads_api=solaris
+          LIBTHREAD=-lthread
+          LTLIBTHREAD=-lthread
+          LIBMULTITHREAD="$LIBTHREAD"
+          LTLIBMULTITHREAD="$LTLIBTHREAD"
+
+cat >>confdefs.h <<\_ACEOF
+#define USE_SOLARIS_THREADS 1
+_ACEOF
+
+          if test $gl_have_weak = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define USE_SOLARIS_THREADS_WEAK 1
+_ACEOF
+
+            LIBTHREAD=
+            LTLIBTHREAD=
+          fi
+        fi
+      fi
+    fi
+    if test "$gl_use_threads" = pth; then
+      gl_save_CPPFLAGS="$CPPFLAGS"
+
+
+
+
+
+  echo "$as_me:$LINENO: checking how to link with libpth" >&5
+echo $ECHO_N "checking how to link with libpth... $ECHO_C" >&6
+if test "${ac_cv_libpth_libs+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+
+
+
+
+    use_additional=yes
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+
+    eval additional_includedir=\"$includedir\"
+    eval additional_libdir=\"$libdir\"
+
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+
+# Check whether --with-libpth-prefix or --without-libpth-prefix was given.
+if test "${with_libpth_prefix+set}" = set; then
+  withval="$with_libpth_prefix"
+
+    if test "X$withval" = "Xno"; then
+      use_additional=no
+    else
+      if test "X$withval" = "X"; then
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+
+          eval additional_includedir=\"$includedir\"
+          eval additional_libdir=\"$libdir\"
+
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+      else
+        additional_includedir="$withval/include"
+        additional_libdir="$withval/$acl_libdirstem"
+      fi
+    fi
+
+fi;
+      LIBPTH=
+  LTLIBPTH=
+  INCPTH=
+  LIBPTH_PREFIX=
+  rpathdirs=
+  ltrpathdirs=
+  names_already_handled=
+  names_next_round='pth '
+  while test -n "$names_next_round"; do
+    names_this_round="$names_next_round"
+    names_next_round=
+    for name in $names_this_round; do
+      already_handled=
+      for n in $names_already_handled; do
+        if test "$n" = "$name"; then
+          already_handled=yes
+          break
+        fi
+      done
+      if test -z "$already_handled"; then
+        names_already_handled="$names_already_handled $name"
+                        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'`
+        eval value=\"\$HAVE_LIB$uppername\"
+        if test -n "$value"; then
+          if test "$value" = yes; then
+            eval value=\"\$LIB$uppername\"
+            test -z "$value" || LIBPTH="${LIBPTH}${LIBPTH:+ }$value"
+            eval value=\"\$LTLIB$uppername\"
+            test -z "$value" || LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }$value"
+          else
+                                    :
+          fi
+        else
+                              found_dir=
+          found_la=
+          found_so=
+          found_a=
+          eval libname=\"$acl_libname_spec\"    # typically: libname=lib$name
+          if test -n "$acl_shlibext"; then
+            shrext=".$acl_shlibext"             # typically: shrext=.so
+          else
+            shrext=
+          fi
+          if test $use_additional = yes; then
+            dir="$additional_libdir"
+                                    if test -n "$acl_shlibext"; then
+              if test -f "$dir/$libname$shrext"; then
+                found_dir="$dir"
+                found_so="$dir/$libname$shrext"
+              else
+                if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+                  ver=`(cd "$dir" && \
+                        for f in "$libname$shrext".*; do echo "$f"; done \
+                        | sed -e "s,^$libname$shrext\\\\.,," \
+                        | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+                        | sed 1q ) 2>/dev/null`
+                  if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
+                    found_dir="$dir"
+                    found_so="$dir/$libname$shrext.$ver"
+                  fi
+                else
+                  eval library_names=\"$acl_library_names_spec\"
+                  for f in $library_names; do
+                    if test -f "$dir/$f"; then
+                      found_dir="$dir"
+                      found_so="$dir/$f"
+                      break
+                    fi
+                  done
+                fi
+              fi
+            fi
+                        if test "X$found_dir" = "X"; then
+              if test -f "$dir/$libname.$acl_libext"; then
+                found_dir="$dir"
+                found_a="$dir/$libname.$acl_libext"
+              fi
+            fi
+            if test "X$found_dir" != "X"; then
+              if test -f "$dir/$libname.la"; then
+                found_la="$dir/$libname.la"
+              fi
+            fi
+          fi
+          if test "X$found_dir" = "X"; then
+            for x in $LDFLAGS $LTLIBPTH; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+              case "$x" in
+                -L*)
+                  dir=`echo "X$x" | sed -e 's/^X-L//'`
+                                    if test -n "$acl_shlibext"; then
+                    if test -f "$dir/$libname$shrext"; then
+                      found_dir="$dir"
+                      found_so="$dir/$libname$shrext"
+                    else
+                      if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+                        ver=`(cd "$dir" && \
+                              for f in "$libname$shrext".*; do echo "$f"; done \
+                              | sed -e "s,^$libname$shrext\\\\.,," \
+                              | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+                              | sed 1q ) 2>/dev/null`
+                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
+                          found_dir="$dir"
+                          found_so="$dir/$libname$shrext.$ver"
+                        fi
+                      else
+                        eval library_names=\"$acl_library_names_spec\"
+                        for f in $library_names; do
+                          if test -f "$dir/$f"; then
+                            found_dir="$dir"
+                            found_so="$dir/$f"
+                            break
+                          fi
+                        done
+                      fi
+                    fi
+                  fi
+                                    if test "X$found_dir" = "X"; then
+                    if test -f "$dir/$libname.$acl_libext"; then
+                      found_dir="$dir"
+                      found_a="$dir/$libname.$acl_libext"
+                    fi
+                  fi
+                  if test "X$found_dir" != "X"; then
+                    if test -f "$dir/$libname.la"; then
+                      found_la="$dir/$libname.la"
+                    fi
+                  fi
+                  ;;
+              esac
+              if test "X$found_dir" != "X"; then
+                break
+              fi
+            done
+          fi
+          if test "X$found_dir" != "X"; then
+                        LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }-L$found_dir -l$name"
+            if test "X$found_so" != "X"; then
+                                                        if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then
+                                LIBPTH="${LIBPTH}${LIBPTH:+ }$found_so"
+              else
+                                                                                haveit=
+                for x in $ltrpathdirs; do
+                  if test "X$x" = "X$found_dir"; then
+                    haveit=yes
+                    break
+                  fi
+                done
+                if test -z "$haveit"; then
+                  ltrpathdirs="$ltrpathdirs $found_dir"
+                fi
+                                if test "$acl_hardcode_direct" = yes; then
+                                                      LIBPTH="${LIBPTH}${LIBPTH:+ }$found_so"
+                else
+                  if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
+                                                            LIBPTH="${LIBPTH}${LIBPTH:+ }$found_so"
+                                                            haveit=
+                    for x in $rpathdirs; do
+                      if test "X$x" = "X$found_dir"; then
+                        haveit=yes
+                        break
+                      fi
+                    done
+                    if test -z "$haveit"; then
+                      rpathdirs="$rpathdirs $found_dir"
+                    fi
+                  else
+                                                                                haveit=
+                    for x in $LDFLAGS $LIBPTH; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+                      if test "X$x" = "X-L$found_dir"; then
+                        haveit=yes
+                        break
+                      fi
+                    done
+                    if test -z "$haveit"; then
+                      LIBPTH="${LIBPTH}${LIBPTH:+ }-L$found_dir"
+                    fi
+                    if test "$acl_hardcode_minus_L" != no; then
+                                                                                        LIBPTH="${LIBPTH}${LIBPTH:+ }$found_so"
+                    else
+                                                                                                                                                                                LIBPTH="${LIBPTH}${LIBPTH:+ }-l$name"
+                    fi
+                  fi
+                fi
+              fi
+            else
+              if test "X$found_a" != "X"; then
+                                LIBPTH="${LIBPTH}${LIBPTH:+ }$found_a"
+              else
+                                                LIBPTH="${LIBPTH}${LIBPTH:+ }-L$found_dir -l$name"
+              fi
+            fi
+                        additional_includedir=
+            case "$found_dir" in
+              */$acl_libdirstem | */$acl_libdirstem/)
+                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
+                LIBPTH_PREFIX="$basedir"
+                additional_includedir="$basedir/include"
+                ;;
+            esac
+            if test "X$additional_includedir" != "X"; then
+                                                                                                                if test "X$additional_includedir" != "X/usr/include"; then
+                haveit=
+                if test "X$additional_includedir" = "X/usr/local/include"; then
+                  if test -n "$GCC"; then
+                    case $host_os in
+                      linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+                    esac
+                  fi
+                fi
+                if test -z "$haveit"; then
+                  for x in $CPPFLAGS $INCPTH; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+                    if test "X$x" = "X-I$additional_includedir"; then
+                      haveit=yes
+                      break
+                    fi
+                  done
+                  if test -z "$haveit"; then
+                    if test -d "$additional_includedir"; then
+                                            INCPTH="${INCPTH}${INCPTH:+ }-I$additional_includedir"
+                    fi
+                  fi
+                fi
+              fi
+            fi
+                        if test -n "$found_la"; then
+                                                        save_libdir="$libdir"
+              case "$found_la" in
+                */* | *\\*) . "$found_la" ;;
+                *) . "./$found_la" ;;
+              esac
+              libdir="$save_libdir"
+                            for dep in $dependency_libs; do
+                case "$dep" in
+                  -L*)
+                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
+                                                                                                                                                                if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then
+                      haveit=
+                      if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then
+                        if test -n "$GCC"; then
+                          case $host_os in
+                            linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+                          esac
+                        fi
+                      fi
+                      if test -z "$haveit"; then
+                        haveit=
+                        for x in $LDFLAGS $LIBPTH; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+                          if test "X$x" = "X-L$additional_libdir"; then
+                            haveit=yes
+                            break
+                          fi
+                        done
+                        if test -z "$haveit"; then
+                          if test -d "$additional_libdir"; then
+                                                        LIBPTH="${LIBPTH}${LIBPTH:+ }-L$additional_libdir"
+                          fi
+                        fi
+                        haveit=
+                        for x in $LDFLAGS $LTLIBPTH; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+                          if test "X$x" = "X-L$additional_libdir"; then
+                            haveit=yes
+                            break
+                          fi
+                        done
+                        if test -z "$haveit"; then
+                          if test -d "$additional_libdir"; then
+                                                        LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }-L$additional_libdir"
+                          fi
+                        fi
+                      fi
+                    fi
+                    ;;
+                  -R*)
+                    dir=`echo "X$dep" | sed -e 's/^X-R//'`
+                    if test "$enable_rpath" != no; then
+                                                                  haveit=
+                      for x in $rpathdirs; do
+                        if test "X$x" = "X$dir"; then
+                          haveit=yes
+                          break
+                        fi
+                      done
+                      if test -z "$haveit"; then
+                        rpathdirs="$rpathdirs $dir"
+                      fi
+                                                                  haveit=
+                      for x in $ltrpathdirs; do
+                        if test "X$x" = "X$dir"; then
+                          haveit=yes
+                          break
+                        fi
+                      done
+                      if test -z "$haveit"; then
+                        ltrpathdirs="$ltrpathdirs $dir"
+                      fi
+                    fi
+                    ;;
+                  -l*)
+                                        names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
+                    ;;
+                  *.la)
+                                                                                names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
+                    ;;
+                  *)
+                                        LIBPTH="${LIBPTH}${LIBPTH:+ }$dep"
+                    LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }$dep"
+                    ;;
+                esac
+              done
+            fi
+          else
+                                                            LIBPTH="${LIBPTH}${LIBPTH:+ }-l$name"
+            LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }-l$name"
+          fi
+        fi
+      fi
+    done
+  done
+  if test "X$rpathdirs" != "X"; then
+    if test -n "$acl_hardcode_libdir_separator"; then
+                        alldirs=
+      for found_dir in $rpathdirs; do
+        alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
+      done
+            acl_save_libdir="$libdir"
+      libdir="$alldirs"
+      eval flag=\"$acl_hardcode_libdir_flag_spec\"
+      libdir="$acl_save_libdir"
+      LIBPTH="${LIBPTH}${LIBPTH:+ }$flag"
+    else
+            for found_dir in $rpathdirs; do
+        acl_save_libdir="$libdir"
+        libdir="$found_dir"
+        eval flag=\"$acl_hardcode_libdir_flag_spec\"
+        libdir="$acl_save_libdir"
+        LIBPTH="${LIBPTH}${LIBPTH:+ }$flag"
+      done
+    fi
+  fi
+  if test "X$ltrpathdirs" != "X"; then
+            for found_dir in $ltrpathdirs; do
+      LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }-R$found_dir"
+    done
+  fi
+
+    ac_cv_libpth_libs="$LIBPTH"
+    ac_cv_libpth_ltlibs="$LTLIBPTH"
+    ac_cv_libpth_cppflags="$INCPTH"
+    ac_cv_libpth_prefix="$LIBPTH_PREFIX"
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_libpth_libs" >&5
+echo "${ECHO_T}$ac_cv_libpth_libs" >&6
+  LIBPTH="$ac_cv_libpth_libs"
+  LTLIBPTH="$ac_cv_libpth_ltlibs"
+  INCPTH="$ac_cv_libpth_cppflags"
+  LIBPTH_PREFIX="$ac_cv_libpth_prefix"
+
+  for element in $INCPTH; do
+    haveit=
+    for x in $CPPFLAGS; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+      if test "X$x" = "X$element"; then
+        haveit=yes
+        break
+      fi
+    done
+    if test -z "$haveit"; then
+      CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element"
+    fi
+  done
+
+
+
+
+      HAVE_LIBPTH=yes
+
+
+
+      gl_have_pth=
+      gl_save_LIBS="$LIBS"
+      LIBS="$LIBS -lpth"
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <pth.h>
+int
+main ()
+{
+pth_self();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  gl_have_pth=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+      LIBS="$gl_save_LIBS"
+      if test -n "$gl_have_pth"; then
+        gl_threads_api=pth
+        LIBTHREAD="$LIBPTH"
+        LTLIBTHREAD="$LTLIBPTH"
+        LIBMULTITHREAD="$LIBTHREAD"
+        LTLIBMULTITHREAD="$LTLIBTHREAD"
+
+cat >>confdefs.h <<\_ACEOF
+#define USE_PTH_THREADS 1
+_ACEOF
+
+        if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
+          if test $gl_have_weak = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define USE_PTH_THREADS_WEAK 1
+_ACEOF
+
+            LIBTHREAD=
+            LTLIBTHREAD=
+          fi
+        fi
+      else
+        CPPFLAGS="$gl_save_CPPFLAGS"
+      fi
+    fi
+    if test -z "$gl_have_pthread"; then
+      if test "$gl_use_threads" = yes || test "$gl_use_threads" = win32; then
+        if { case "$host_os" in
+               mingw*) true;;
+               *) false;;
+             esac
+           }; then
+          gl_threads_api=win32
+
+cat >>confdefs.h <<\_ACEOF
+#define USE_WIN32_THREADS 1
+_ACEOF
+
+        fi
+      fi
+    fi
+  fi
+  echo "$as_me:$LINENO: checking for multithread API to use" >&5
+echo $ECHO_N "checking for multithread API to use... $ECHO_C" >&6
+  echo "$as_me:$LINENO: result: $gl_threads_api" >&5
+echo "${ECHO_T}$gl_threads_api" >&6
+
+
+
+
+
+
+      echo "$as_me:$LINENO: checking whether snprintf is declared" >&5
+echo $ECHO_N "checking whether snprintf is declared... $ECHO_C" >&6
+if test "${ac_cv_have_decl_snprintf+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+#ifndef snprintf
+  char *p = (char *) snprintf;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_have_decl_snprintf=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_have_decl_snprintf=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_have_decl_snprintf" >&5
+echo "${ECHO_T}$ac_cv_have_decl_snprintf" >&6
+if test $ac_cv_have_decl_snprintf = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_SNPRINTF 1
+_ACEOF
+
+
+else
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_SNPRINTF 0
+_ACEOF
+
+
+fi
+
+
+
+echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5
+echo $ECHO_N "checking for stdbool.h that conforms to C99... $ECHO_C" >&6
+if test "${ac_cv_header_stdbool_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+         #include <stdbool.h>
+         #ifndef bool
+          "error: bool is not defined"
+         #endif
+         #ifndef false
+          "error: false is not defined"
+         #endif
+         #if false
+          "error: false is not 0"
+         #endif
+         #ifndef true
+          "error: true is not defined"
+         #endif
+         #if true != 1
+          "error: true is not 1"
+         #endif
+         #ifndef __bool_true_false_are_defined
+          "error: __bool_true_false_are_defined is not defined"
+         #endif
+
+         struct s { _Bool s: 1; _Bool t; } s;
+
+         char a[true == 1 ? 1 : -1];
+         char b[false == 0 ? 1 : -1];
+         char c[__bool_true_false_are_defined == 1 ? 1 : -1];
+         char d[(bool) 0.5 == true ? 1 : -1];
+         bool e = &s;
+         char f[(_Bool) 0.0 == false ? 1 : -1];
+         char g[true];
+         char h[sizeof (_Bool)];
+         char i[sizeof s.t];
+         enum { j = false, k = true, l = false * true, m = true * 256 };
+         _Bool n[m];
+         char o[sizeof n == m * sizeof n[0] ? 1 : -1];
+         char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
+         #if defined __xlc__ || defined __GNUC__
+          /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0
+             reported by James Lemley on 2005-10-05; see
+             http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
+             This test is not quite right, since xlc is allowed to
+             reject this program, as the initializer for xlcbug is
+             not one of the forms that C requires support for.
+             However, doing the test right would require a run-time
+             test, and that would make cross-compilation harder.
+             Let us hope that IBM fixes the xlc bug, and also adds
+             support for this kind of constant expression.  In the
+             meantime, this test will reject xlc, which is OK, since
+             our stdbool.h substitute should suffice.  We also test
+             this with GCC, where it should work, to detect more
+             quickly whether someone messes up the test in the
+             future.  */
+          char digs[] = "0123456789";
+          int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1);
+         #endif
+         /* Catch a bug in an HP-UX C compiler.  See
+            http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
+            http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
+          */
+         _Bool q = true;
+         _Bool *pq = &q;
+
+int
+main ()
+{
+
+         *pq |= q;
+         *pq |= ! q;
+         /* Refer to every declared value, to avoid compiler optimizations.  */
+         return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
+                 + !m + !n + !o + !p + !q + !pq);
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_header_stdbool_h=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_stdbool_h=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5
+echo "${ECHO_T}$ac_cv_header_stdbool_h" >&6
+   echo "$as_me:$LINENO: checking for _Bool" >&5
+echo $ECHO_N "checking for _Bool... $ECHO_C" >&6
+if test "${ac_cv_type__Bool+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+if ((_Bool *) 0)
+  return 0;
+if (sizeof (_Bool))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_type__Bool=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type__Bool=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5
+echo "${ECHO_T}$ac_cv_type__Bool" >&6
+if test $ac_cv_type__Bool = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE__BOOL 1
+_ACEOF
+
+
+fi
+
+   if test $ac_cv_header_stdbool_h = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_STDBOOL_H 1
+_ACEOF
+
+   fi
+
+    HAVE_DECL_MEMMEM=1;
+  HAVE_MEMPCPY=1;
+  HAVE_DECL_MEMRCHR=1;
+  HAVE_STPCPY=1;
+  HAVE_STPNCPY=1;
+  HAVE_DECL_STRNCASECMP=1;
+  HAVE_STRCHRNUL=1;
+  HAVE_DECL_STRDUP=1;
+  HAVE_STRNDUP=1;
+  HAVE_DECL_STRNDUP=1;
+  HAVE_DECL_STRNLEN=1;
+  HAVE_STRPBRK=1;
+  HAVE_STRSEP=1;
+  HAVE_DECL_STRTOK_R=1;
+  REPLACE_STRCASECMP=0;
+  REPLACE_STRSTR=0;
+  REPLACE_STRCASESTR=0;
+
+
+      echo "$as_me:$LINENO: checking whether strdup is declared" >&5
+echo $ECHO_N "checking whether strdup is declared... $ECHO_C" >&6
+if test "${ac_cv_have_decl_strdup+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+#ifndef strdup
+  char *p = (char *) strdup;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_have_decl_strdup=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_have_decl_strdup=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_have_decl_strdup" >&5
+echo "${ECHO_T}$ac_cv_have_decl_strdup" >&6
+if test $ac_cv_have_decl_strdup = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRDUP 1
+_ACEOF
+
+
+else
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_STRDUP 0
+_ACEOF
+
+
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+    echo "$as_me:$LINENO: checking absolute name of <string.h>" >&5
+echo $ECHO_N "checking absolute name of <string.h>... $ECHO_C" >&6
+if test "${gl_cv_absolute_string_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+  :
+
+
+
+
+    if test $ac_cv_header_string_h = yes; then
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <string.h>
+_ACEOF
+      gl_cv_absolute_string_h=`(eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+sed -n '\#/string.h#{s#.*"\(.*/string.h\)".*#\1#;s#^/[^/]#//&#;p;q;}'`
+    fi
+
+fi
+echo "$as_me:$LINENO: result: $gl_cv_absolute_string_h" >&5
+echo "${ECHO_T}$gl_cv_absolute_string_h" >&6
+cat >>confdefs.h <<_ACEOF
+#define ABSOLUTE_STRING_H "$gl_cv_absolute_string_h"
+_ACEOF
+
+
+  ABSOLUTE_STRING_H=\"$gl_cv_absolute_string_h\"
+
+
+
+
+  echo "$as_me:$LINENO: checking for EOVERFLOW" >&5
+echo $ECHO_N "checking for EOVERFLOW... $ECHO_C" >&6
+if test "${ac_cv_decl_EOVERFLOW+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#include <errno.h>
+#ifdef EOVERFLOW
+yes
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "yes" >/dev/null 2>&1; then
+  have_eoverflow=1
+fi
+rm -f conftest*
+
+    if test -n "$have_eoverflow"; then
+            ac_cv_decl_EOVERFLOW=yes
+    else
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#define _XOPEN_SOURCE_EXTENDED 1
+#include <errno.h>
+#ifdef EOVERFLOW
+yes
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "yes" >/dev/null 2>&1; then
+  have_eoverflow=1
+fi
+rm -f conftest*
+
+      if test -n "$have_eoverflow"; then
+                        if test "$cross_compiling" = yes; then
+  # Depending upon the size, compute the lo and hi bounds.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#define _XOPEN_SOURCE_EXTENDED 1
+#include <errno.h>
+/* The following two lines are a workaround against an autoconf-2.52 bug.  */
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main ()
+{
+static int test_array [1 - 2 * !((EOVERFLOW) >= 0)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_lo=0 ac_mid=0
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#define _XOPEN_SOURCE_EXTENDED 1
+#include <errno.h>
+/* The following two lines are a workaround against an autoconf-2.52 bug.  */
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main ()
+{
+static int test_array [1 - 2 * !((EOVERFLOW) <= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_hi=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_lo=`expr $ac_mid + 1`
+                   if test $ac_lo -le $ac_mid; then
+                     ac_lo= ac_hi=
+                     break
+                   fi
+                   ac_mid=`expr 2 '*' $ac_mid + 1`
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#define _XOPEN_SOURCE_EXTENDED 1
+#include <errno.h>
+/* The following two lines are a workaround against an autoconf-2.52 bug.  */
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main ()
+{
+static int test_array [1 - 2 * !((EOVERFLOW) < 0)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_hi=-1 ac_mid=-1
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#define _XOPEN_SOURCE_EXTENDED 1
+#include <errno.h>
+/* The following two lines are a workaround against an autoconf-2.52 bug.  */
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main ()
+{
+static int test_array [1 - 2 * !((EOVERFLOW) >= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_lo=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_hi=`expr '(' $ac_mid ')' - 1`
+                      if test $ac_mid -le $ac_hi; then
+                        ac_lo= ac_hi=
+                        break
+                      fi
+                      ac_mid=`expr 2 '*' $ac_mid`
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_lo= ac_hi=
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#define _XOPEN_SOURCE_EXTENDED 1
+#include <errno.h>
+/* The following two lines are a workaround against an autoconf-2.52 bug.  */
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+main ()
+{
+static int test_array [1 - 2 * !((EOVERFLOW) <= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_hi=$ac_mid
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_lo=`expr '(' $ac_mid ')' + 1`
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) ac_cv_decl_EOVERFLOW=$ac_lo;;
+'')  ;;
+esac
+else
+  if test "$cross_compiling" = yes; then
+  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#define _XOPEN_SOURCE_EXTENDED 1
+#include <errno.h>
+/* The following two lines are a workaround against an autoconf-2.52 bug.  */
+#include <stdio.h>
+#include <stdlib.h>
+
+long longval () { return EOVERFLOW; }
+unsigned long ulongval () { return EOVERFLOW; }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+  FILE *f = fopen ("conftest.val", "w");
+  if (! f)
+    exit (1);
+  if ((EOVERFLOW) < 0)
+    {
+      long i = longval ();
+      if (i != (EOVERFLOW))
+       exit (1);
+      fprintf (f, "%ld\n", i);
+    }
+  else
+    {
+      unsigned long i = ulongval ();
+      if (i != (EOVERFLOW))
+       exit (1);
+      fprintf (f, "%lu\n", i);
+    }
+  exit (ferror (f) || fclose (f) != 0);
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_decl_EOVERFLOW=`cat conftest.val`
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+rm -f conftest.val
+      else
+                                ac_cv_decl_EOVERFLOW=E2BIG
+      fi
+    fi
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_decl_EOVERFLOW" >&5
+echo "${ECHO_T}$ac_cv_decl_EOVERFLOW" >&6
+  if test "$ac_cv_decl_EOVERFLOW" != yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define EOVERFLOW $ac_cv_decl_EOVERFLOW
+_ACEOF
+
+    EOVERFLOW="$ac_cv_decl_EOVERFLOW"
+
+  fi
+
+
+  echo "$as_me:$LINENO: checking for long long int" >&5
+echo $ECHO_N "checking for long long int... $ECHO_C" >&6
+if test "${ac_cv_type_long_long_int+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+long long int ll = 9223372036854775807ll;
+           long long int nll = -9223372036854775807LL;
+           typedef int a[((-9223372036854775807LL < 0
+                           && 0 < 9223372036854775807ll)
+                          ? 1 : -1)];
+           int i = 63;
+int
+main ()
+{
+long long int llmax = 9223372036854775807ll;
+           return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i)
+                   | (llmax / ll) | (llmax % ll));
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+                       if test "$cross_compiling" = yes; then
+  ac_cv_type_long_long_int=yes
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <limits.h>
+              #ifndef LLONG_MAX
+              # define HALF \
+                       (1LL << (sizeof (long long int) * CHAR_BIT - 2))
+              # define LLONG_MAX (HALF - 1 + HALF)
+              #endif
+int
+main ()
+{
+long long int n = 1;
+              int i;
+              for (i = 0; ; i++)
+                {
+                  long long int m = n << i;
+                  if (m >> i != n)
+                    return 1;
+                  if (LLONG_MAX / 2 < m)
+                    break;
+                }
+              return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_type_long_long_int=yes
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_type_long_long_int=no
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_long_long_int=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_long_long_int" >&5
+echo "${ECHO_T}$ac_cv_type_long_long_int" >&6
+  if test $ac_cv_type_long_long_int = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LONG_LONG_INT 1
+_ACEOF
+
+  fi
+
+
+  echo "$as_me:$LINENO: checking for long double" >&5
+echo $ECHO_N "checking for long double... $ECHO_C" >&6
+if test "${gt_cv_c_long_double+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "$GCC" = yes; then
+       gt_cv_c_long_double=yes
+     else
+       cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+         /* The Stardent Vistra knows sizeof(long double), but does not support it.  */
+         long double foo = 0.0;
+         /* On Ultrix 4.3 cc, long double is 4 and double is 8.  */
+         int array [2*(sizeof(long double) >= sizeof(double)) - 1];
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  gt_cv_c_long_double=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+gt_cv_c_long_double=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+     fi
+fi
+echo "$as_me:$LINENO: result: $gt_cv_c_long_double" >&5
+echo "${ECHO_T}$gt_cv_c_long_double" >&6
+  if test $gt_cv_c_long_double = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LONG_DOUBLE 1
+_ACEOF
+
+  fi
+
+
+  echo "$as_me:$LINENO: checking for wchar_t" >&5
+echo $ECHO_N "checking for wchar_t... $ECHO_C" >&6
+if test "${gt_cv_c_wchar_t+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stddef.h>
+       wchar_t foo = (wchar_t)'\0';
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  gt_cv_c_wchar_t=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+gt_cv_c_wchar_t=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $gt_cv_c_wchar_t" >&5
+echo "${ECHO_T}$gt_cv_c_wchar_t" >&6
+  if test $gt_cv_c_wchar_t = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_WCHAR_T 1
+_ACEOF
+
+  fi
+
+
+  echo "$as_me:$LINENO: checking for wint_t" >&5
+echo $ECHO_N "checking for wint_t... $ECHO_C" >&6
+if test "${gt_cv_c_wint_t+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+   <wchar.h>.
+   BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be included
+   before <wchar.h>.  */
+#include <stddef.h>
+#include <stdio.h>
+#include <time.h>
+#include <wchar.h>
+       wint_t foo = (wchar_t)'\0';
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  gt_cv_c_wint_t=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+gt_cv_c_wint_t=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $gt_cv_c_wint_t" >&5
+echo "${ECHO_T}$gt_cv_c_wint_t" >&6
+  if test $gt_cv_c_wint_t = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_WINT_T 1
+_ACEOF
+
+  fi
+
+echo "$as_me:$LINENO: checking for size_t" >&5
+echo $ECHO_N "checking for size_t... $ECHO_C" >&6
+if test "${ac_cv_type_size_t+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+if ((size_t *) 0)
+  return 0;
+if (sizeof (size_t))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_type_size_t=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_size_t=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
+echo "${ECHO_T}$ac_cv_type_size_t" >&6
+if test $ac_cv_type_size_t = yes; then
+  :
+else
+
+cat >>confdefs.h <<_ACEOF
+#define size_t unsigned
+_ACEOF
+
+fi
+
+
+  echo "$as_me:$LINENO: checking for inttypes.h" >&5
+echo $ECHO_N "checking for inttypes.h... $ECHO_C" >&6
+if test "${gl_cv_header_inttypes_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+#include <inttypes.h>
+int
+main ()
+{
+uintmax_t i = (uintmax_t) -1; return !i;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  gl_cv_header_inttypes_h=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+gl_cv_header_inttypes_h=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $gl_cv_header_inttypes_h" >&5
+echo "${ECHO_T}$gl_cv_header_inttypes_h" >&6
+  if test $gl_cv_header_inttypes_h = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_INTTYPES_H_WITH_UINTMAX 1
+_ACEOF
+
+  fi
+
+
+  echo "$as_me:$LINENO: checking for stdint.h" >&5
+echo $ECHO_N "checking for stdint.h... $ECHO_C" >&6
+if test "${gl_cv_header_stdint_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+#include <stdint.h>
+int
+main ()
+{
+uintmax_t i = (uintmax_t) -1; return !i;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  gl_cv_header_stdint_h=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+gl_cv_header_stdint_h=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $gl_cv_header_stdint_h" >&5
+echo "${ECHO_T}$gl_cv_header_stdint_h" >&6
+  if test $gl_cv_header_stdint_h = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STDINT_H_WITH_UINTMAX 1
+_ACEOF
+
+  fi
+
+
+
+  ac_cv_type_long_long=$ac_cv_type_long_long_int
+  if test $ac_cv_type_long_long = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LONG_LONG 1
+_ACEOF
+
+  fi
+
+
+
+
+  echo "$as_me:$LINENO: checking for intmax_t" >&5
+echo $ECHO_N "checking for intmax_t... $ECHO_C" >&6
+if test "${gt_cv_c_intmax_t+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#include <stddef.h>
+#include <stdlib.h>
+#if HAVE_STDINT_H_WITH_UINTMAX
+#include <stdint.h>
+#endif
+#if HAVE_INTTYPES_H_WITH_UINTMAX
+#include <inttypes.h>
+#endif
+
+int
+main ()
+{
+intmax_t x = -1; return !x;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  gt_cv_c_intmax_t=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+gt_cv_c_intmax_t=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $gt_cv_c_intmax_t" >&5
+echo "${ECHO_T}$gt_cv_c_intmax_t" >&6
+  if test $gt_cv_c_intmax_t = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_INTMAX_T 1
+_ACEOF
+
+  else
+
+    test $ac_cv_type_long_long = yes \
+      && ac_type='long long' \
+      || ac_type='long'
+
+cat >>confdefs.h <<_ACEOF
+#define intmax_t $ac_type
+_ACEOF
+
+  fi
+
+
+
+
+
+
+
+if true; then
+  GL_COND_LIBTOOL_TRUE=
+  GL_COND_LIBTOOL_FALSE='#'
+else
+  GL_COND_LIBTOOL_TRUE='#'
+  GL_COND_LIBTOOL_FALSE=
+fi
+
+  gl_cond_libtool=true
+  gl_source_base='gnulib'
+
+
+
+
+
+  if test $ac_cv_func_alloca_works = no; then
+    :
+  fi
+
+  # Define an additional variable used in the Makefile substitution.
+  if test $ac_cv_working_alloca_h = yes; then
+    echo "$as_me:$LINENO: checking for alloca as a compiler built-in" >&5
+echo $ECHO_N "checking for alloca as a compiler built-in... $ECHO_C" >&6
+if test "${gl_cv_rpl_alloca+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#if defined __GNUC__ || defined _AIX || defined _MSC_VER
+        Need own alloca
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "Need own alloca" >/dev/null 2>&1; then
+  gl_cv_rpl_alloca=yes
+else
+  gl_cv_rpl_alloca=no
+fi
+rm -f conftest*
+
+
+fi
+echo "$as_me:$LINENO: result: $gl_cv_rpl_alloca" >&5
+echo "${ECHO_T}$gl_cv_rpl_alloca" >&6
+    if test $gl_cv_rpl_alloca = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_ALLOCA 1
+_ACEOF
+
+      ALLOCA_H=alloca.h
+    else
+                  ALLOCA_H=
+    fi
+  else
+    ALLOCA_H=alloca.h
+  fi
+
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_ALLOCA_H 1
+_ACEOF
+
+
+
+
+  :
+
+
+
+
+
+  if test $ac_cv_header_arpa_inet_h = yes; then
+    ARPA_INET_H=''
+  else
+    ARPA_INET_H='arpa/inet.h'
+  fi
+
+
+
+  { echo "$as_me:$LINENO: checking how to do getaddrinfo, freeaddrinfo and getnameinfo" >&5
+echo "$as_me: checking how to do getaddrinfo, freeaddrinfo and getnameinfo" >&6;}
+
+  echo "$as_me:$LINENO: checking for library containing getaddrinfo" >&5
+echo $ECHO_N "checking for library containing getaddrinfo... $ECHO_C" >&6
+if test "${ac_cv_search_getaddrinfo+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+ac_cv_search_getaddrinfo=no
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char getaddrinfo ();
+int
+main ()
+{
+getaddrinfo ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_search_getaddrinfo="none required"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test "$ac_cv_search_getaddrinfo" = no; then
+  for ac_lib in nsl socket; do
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char getaddrinfo ();
+int
+main ()
+{
+getaddrinfo ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_search_getaddrinfo="-l$ac_lib"
+break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+  done
+fi
+LIBS=$ac_func_search_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_search_getaddrinfo" >&5
+echo "${ECHO_T}$ac_cv_search_getaddrinfo" >&6
+if test "$ac_cv_search_getaddrinfo" != no; then
+  test "$ac_cv_search_getaddrinfo" = "none required" || LIBS="$ac_cv_search_getaddrinfo $LIBS"
+
+fi
+
+
+for ac_func in getaddrinfo
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+else
+
+    echo "$as_me:$LINENO: checking for getaddrinfo in ws2tcpip.h and -lws2_32" >&5
+echo $ECHO_N "checking for getaddrinfo in ws2tcpip.h and -lws2_32... $ECHO_C" >&6
+if test "${gl_cv_w32_getaddrinfo+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+      gl_cv_w32_getaddrinfo=no
+      am_save_LIBS="$LIBS"
+      LIBS="$LIBS -lws2_32"
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+
+int
+main ()
+{
+getaddrinfo(0, 0, 0, 0);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  gl_cv_w32_getaddrinfo=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+    LIBS="$am_save_LIBS"
+fi
+echo "$as_me:$LINENO: result: $gl_cv_w32_getaddrinfo" >&5
+echo "${ECHO_T}$gl_cv_w32_getaddrinfo" >&6
+    if test "$gl_cv_w32_getaddrinfo" = "yes"; then
+      LIBS="$LIBS -lws2_32"
+    else
+      gl_LIBOBJS="$gl_LIBOBJS getaddrinfo.$ac_objext"
+    fi
+
+fi
+done
+
+
+
+for ac_func in gai_strerror
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+else
+  gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext"
+fi
+done
+
+
+  echo "$as_me:$LINENO: checking for library containing gethostbyname" >&5
+echo $ECHO_N "checking for library containing gethostbyname... $ECHO_C" >&6
+if test "${ac_cv_search_gethostbyname+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+ac_cv_search_gethostbyname=no
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char gethostbyname ();
+int
+main ()
+{
+gethostbyname ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_search_gethostbyname="none required"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test "$ac_cv_search_gethostbyname" = no; then
+  for ac_lib in inet nsl; do
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char gethostbyname ();
+int
+main ()
+{
+gethostbyname ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_search_gethostbyname="-l$ac_lib"
+break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+  done
+fi
+LIBS=$ac_func_search_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_search_gethostbyname" >&5
+echo "${ECHO_T}$ac_cv_search_gethostbyname" >&6
+if test "$ac_cv_search_gethostbyname" != no; then
+  test "$ac_cv_search_gethostbyname" = "none required" || LIBS="$ac_cv_search_gethostbyname $LIBS"
+
+fi
+
+  echo "$as_me:$LINENO: checking for library containing getservbyname" >&5
+echo $ECHO_N "checking for library containing getservbyname... $ECHO_C" >&6
+if test "${ac_cv_search_getservbyname+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+ac_cv_search_getservbyname=no
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char getservbyname ();
+int
+main ()
+{
+getservbyname ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_search_getservbyname="none required"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+if test "$ac_cv_search_getservbyname" = no; then
+  for ac_lib in inet nsl socket xnet; do
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char getservbyname ();
+int
+main ()
+{
+getservbyname ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_search_getservbyname="-l$ac_lib"
+break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+  done
+fi
+LIBS=$ac_func_search_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_search_getservbyname" >&5
+echo "${ECHO_T}$ac_cv_search_getservbyname" >&6
+if test "$ac_cv_search_getservbyname" != no; then
+  test "$ac_cv_search_getservbyname" = "none required" || LIBS="$ac_cv_search_getservbyname $LIBS"
+
+fi
+
+
+for ac_func in gethostbyname
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+else
+
+    echo "$as_me:$LINENO: checking for gethostbyname in winsock2.h and -lws2_32" >&5
+echo $ECHO_N "checking for gethostbyname in winsock2.h and -lws2_32... $ECHO_C" >&6
+if test "${gl_cv_w32_gethostbyname+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+      gl_cv_w32_gethostbyname=no
+      am_save_LIBS="$LIBS"
+      LIBS="$LIBS -lws2_32"
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+
+int
+main ()
+{
+gethostbyname(0);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  gl_cv_w32_gethostbyname=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+    LIBS="$am_save_LIBS"
+fi
+echo "$as_me:$LINENO: result: $gl_cv_w32_gethostbyname" >&5
+echo "${ECHO_T}$gl_cv_w32_gethostbyname" >&6
+    if test "$gl_cv_w32_gethostbyname" = "yes"; then
+      LIBS="$LIBS -lws2_32"
+    fi
+
+fi
+done
+
+
+
+
+
+
+
+  :
+
+
+
+
+
+
+
+
+  echo "$as_me:$LINENO: checking whether getaddrinfo is declared" >&5
+echo $ECHO_N "checking whether getaddrinfo is declared... $ECHO_C" >&6
+if test "${ac_cv_have_decl_getaddrinfo+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+  /* sys/types.h is not needed according to POSIX, but the
+     sys/socket.h in i386-unknown-freebsd4.10 and
+     powerpc-apple-darwin5.5 required it. */
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+
+
+int
+main ()
+{
+#ifndef getaddrinfo
+  char *p = (char *) getaddrinfo;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_have_decl_getaddrinfo=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_have_decl_getaddrinfo=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_have_decl_getaddrinfo" >&5
+echo "${ECHO_T}$ac_cv_have_decl_getaddrinfo" >&6
+if test $ac_cv_have_decl_getaddrinfo = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_GETADDRINFO 1
+_ACEOF
+
+
+else
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_GETADDRINFO 0
+_ACEOF
+
+
+fi
+echo "$as_me:$LINENO: checking whether freeaddrinfo is declared" >&5
+echo $ECHO_N "checking whether freeaddrinfo is declared... $ECHO_C" >&6
+if test "${ac_cv_have_decl_freeaddrinfo+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+  /* sys/types.h is not needed according to POSIX, but the
+     sys/socket.h in i386-unknown-freebsd4.10 and
+     powerpc-apple-darwin5.5 required it. */
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+
+
+int
+main ()
+{
+#ifndef freeaddrinfo
+  char *p = (char *) freeaddrinfo;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_have_decl_freeaddrinfo=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_have_decl_freeaddrinfo=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_have_decl_freeaddrinfo" >&5
+echo "${ECHO_T}$ac_cv_have_decl_freeaddrinfo" >&6
+if test $ac_cv_have_decl_freeaddrinfo = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_FREEADDRINFO 1
+_ACEOF
+
+
+else
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_FREEADDRINFO 0
+_ACEOF
+
+
+fi
+echo "$as_me:$LINENO: checking whether gai_strerror is declared" >&5
+echo $ECHO_N "checking whether gai_strerror is declared... $ECHO_C" >&6
+if test "${ac_cv_have_decl_gai_strerror+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+  /* sys/types.h is not needed according to POSIX, but the
+     sys/socket.h in i386-unknown-freebsd4.10 and
+     powerpc-apple-darwin5.5 required it. */
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+
+
+int
+main ()
+{
+#ifndef gai_strerror
+  char *p = (char *) gai_strerror;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_have_decl_gai_strerror=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_have_decl_gai_strerror=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_have_decl_gai_strerror" >&5
+echo "${ECHO_T}$ac_cv_have_decl_gai_strerror" >&6
+if test $ac_cv_have_decl_gai_strerror = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_GAI_STRERROR 1
+_ACEOF
+
+
+else
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_GAI_STRERROR 0
+_ACEOF
+
+
+fi
+echo "$as_me:$LINENO: checking whether getnameinfo is declared" >&5
+echo $ECHO_N "checking whether getnameinfo is declared... $ECHO_C" >&6
+if test "${ac_cv_have_decl_getnameinfo+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+  /* sys/types.h is not needed according to POSIX, but the
+     sys/socket.h in i386-unknown-freebsd4.10 and
+     powerpc-apple-darwin5.5 required it. */
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+
+
+int
+main ()
+{
+#ifndef getnameinfo
+  char *p = (char *) getnameinfo;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_have_decl_getnameinfo=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_have_decl_getnameinfo=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_have_decl_getnameinfo" >&5
+echo "${ECHO_T}$ac_cv_have_decl_getnameinfo" >&6
+if test $ac_cv_have_decl_getnameinfo = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_GETNAMEINFO 1
+_ACEOF
+
+
+else
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_GETNAMEINFO 0
+_ACEOF
+
+
+fi
+
+
+  echo "$as_me:$LINENO: checking for struct addrinfo" >&5
+echo $ECHO_N "checking for struct addrinfo... $ECHO_C" >&6
+if test "${ac_cv_type_struct_addrinfo+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETDB_H
+#include <netdb.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+
+
+int
+main ()
+{
+if ((struct addrinfo *) 0)
+  return 0;
+if (sizeof (struct addrinfo))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_type_struct_addrinfo=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_struct_addrinfo=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_struct_addrinfo" >&5
+echo "${ECHO_T}$ac_cv_type_struct_addrinfo" >&6
+if test $ac_cv_type_struct_addrinfo = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_ADDRINFO 1
+_ACEOF
+
+
+fi
+
+
+
+
+
+for ac_func in inet_ntop
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+else
+  gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext"
+fi
+done
+
+
+
+  :
+
+
+
+
+
+
+
+
+  echo "$as_me:$LINENO: checking whether inet_ntop is declared" >&5
+echo $ECHO_N "checking whether inet_ntop is declared... $ECHO_C" >&6
+if test "${ac_cv_have_decl_inet_ntop+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <arpa/inet.h>
+
+int
+main ()
+{
+#ifndef inet_ntop
+  char *p = (char *) inet_ntop;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_have_decl_inet_ntop=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_have_decl_inet_ntop=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_have_decl_inet_ntop" >&5
+echo "${ECHO_T}$ac_cv_have_decl_inet_ntop" >&6
+if test $ac_cv_have_decl_inet_ntop = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_INET_NTOP 1
+_ACEOF
+
+
+else
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_INET_NTOP 0
+_ACEOF
+
+
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  :
+
+
+
+
+
+  if test $ac_cv_header_netinet_in_h = yes; then
+    NETINET_IN_H=''
+  else
+    NETINET_IN_H='netinet/in.h'
+  fi
+
+
+
+
+for ac_header in stdint.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+    echo "$as_me:$LINENO: checking for SIZE_MAX" >&5
+echo $ECHO_N "checking for SIZE_MAX... $ECHO_C" >&6
+  if test "${gl_cv_size_max+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+    gl_cv_size_max=
+    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>
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#ifdef SIZE_MAX
+Found it
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "Found it" >/dev/null 2>&1; then
+  gl_cv_size_max=yes
+fi
+rm -f conftest*
+
+    if test -z "$gl_cv_size_max"; then
+                        if test "$cross_compiling" = yes; then
+  # Depending upon the size, compute the lo and hi bounds.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stddef.h>
+#include <limits.h>
+int
+main ()
+{
+static int test_array [1 - 2 * !((sizeof (size_t) * CHAR_BIT - 1) >= 0)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_lo=0 ac_mid=0
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stddef.h>
+#include <limits.h>
+int
+main ()
+{
+static int test_array [1 - 2 * !((sizeof (size_t) * CHAR_BIT - 1) <= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_hi=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_lo=`expr $ac_mid + 1`
+                   if test $ac_lo -le $ac_mid; then
+                     ac_lo= ac_hi=
+                     break
+                   fi
+                   ac_mid=`expr 2 '*' $ac_mid + 1`
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stddef.h>
+#include <limits.h>
+int
+main ()
+{
+static int test_array [1 - 2 * !((sizeof (size_t) * CHAR_BIT - 1) < 0)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_hi=-1 ac_mid=-1
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stddef.h>
+#include <limits.h>
+int
+main ()
+{
+static int test_array [1 - 2 * !((sizeof (size_t) * CHAR_BIT - 1) >= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_lo=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_hi=`expr '(' $ac_mid ')' - 1`
+                      if test $ac_mid -le $ac_hi; then
+                        ac_lo= ac_hi=
+                        break
+                      fi
+                      ac_mid=`expr 2 '*' $ac_mid`
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_lo= ac_hi=
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stddef.h>
+#include <limits.h>
+int
+main ()
+{
+static int test_array [1 - 2 * !((sizeof (size_t) * CHAR_BIT - 1) <= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_hi=$ac_mid
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_lo=`expr '(' $ac_mid ')' + 1`
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) size_t_bits_minus_1=$ac_lo;;
+'') size_t_bits_minus_1= ;;
+esac
+else
+  if test "$cross_compiling" = yes; then
+  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stddef.h>
+#include <limits.h>
+long longval () { return sizeof (size_t) * CHAR_BIT - 1; }
+unsigned long ulongval () { return sizeof (size_t) * CHAR_BIT - 1; }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+  FILE *f = fopen ("conftest.val", "w");
+  if (! f)
+    exit (1);
+  if ((sizeof (size_t) * CHAR_BIT - 1) < 0)
+    {
+      long i = longval ();
+      if (i != (sizeof (size_t) * CHAR_BIT - 1))
+       exit (1);
+      fprintf (f, "%ld\n", i);
+    }
+  else
+    {
+      unsigned long i = ulongval ();
+      if (i != (sizeof (size_t) * CHAR_BIT - 1))
+       exit (1);
+      fprintf (f, "%lu\n", i);
+    }
+  exit (ferror (f) || fclose (f) != 0);
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  size_t_bits_minus_1=`cat conftest.val`
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+size_t_bits_minus_1=
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+rm -f conftest.val
+      if test "$cross_compiling" = yes; then
+  # Depending upon the size, compute the lo and hi bounds.
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stddef.h>
+int
+main ()
+{
+static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) >= 0)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_lo=0 ac_mid=0
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stddef.h>
+int
+main ()
+{
+static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) <= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_hi=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_lo=`expr $ac_mid + 1`
+                   if test $ac_lo -le $ac_mid; then
+                     ac_lo= ac_hi=
+                     break
+                   fi
+                   ac_mid=`expr 2 '*' $ac_mid + 1`
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stddef.h>
+int
+main ()
+{
+static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) < 0)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_hi=-1 ac_mid=-1
+  while :; do
+    cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stddef.h>
+int
+main ()
+{
+static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) >= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_lo=$ac_mid; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_hi=`expr '(' $ac_mid ')' - 1`
+                      if test $ac_mid -le $ac_hi; then
+                        ac_lo= ac_hi=
+                        break
+                      fi
+                      ac_mid=`expr 2 '*' $ac_mid`
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_lo= ac_hi=
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+# Binary search between lo and hi bounds.
+while test "x$ac_lo" != "x$ac_hi"; do
+  ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo`
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stddef.h>
+int
+main ()
+{
+static int test_array [1 - 2 * !((sizeof (size_t) <= sizeof (unsigned int)) <= $ac_mid)];
+test_array [0] = 0
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_hi=$ac_mid
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_lo=`expr '(' $ac_mid ')' + 1`
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+case $ac_lo in
+?*) fits_in_uint=$ac_lo;;
+'') fits_in_uint= ;;
+esac
+else
+  if test "$cross_compiling" = yes; then
+  { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run test program while cross compiling
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stddef.h>
+long longval () { return sizeof (size_t) <= sizeof (unsigned int); }
+unsigned long ulongval () { return sizeof (size_t) <= sizeof (unsigned int); }
+#include <stdio.h>
+#include <stdlib.h>
+int
+main ()
+{
+
+  FILE *f = fopen ("conftest.val", "w");
+  if (! f)
+    exit (1);
+  if ((sizeof (size_t) <= sizeof (unsigned int)) < 0)
+    {
+      long i = longval ();
+      if (i != (sizeof (size_t) <= sizeof (unsigned int)))
+       exit (1);
+      fprintf (f, "%ld\n", i);
+    }
+  else
+    {
+      unsigned long i = ulongval ();
+      if (i != (sizeof (size_t) <= sizeof (unsigned int)))
+       exit (1);
+      fprintf (f, "%lu\n", i);
+    }
+  exit (ferror (f) || fclose (f) != 0);
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  fits_in_uint=`cat conftest.val`
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+fits_in_uint=
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+rm -f conftest.val
+      if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then
+        if test $fits_in_uint = 1; then
+                              cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stddef.h>
+            extern size_t foo;
+            extern unsigned long foo;
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  fits_in_uint=0
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+        fi
+                                if test $fits_in_uint = 1; then
+          gl_cv_size_max="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)"
+        else
+          gl_cv_size_max="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)"
+        fi
+      else
+                gl_cv_size_max='((size_t)~(size_t)0)'
+      fi
+    fi
+
+fi
+
+  echo "$as_me:$LINENO: result: $gl_cv_size_max" >&5
+echo "${ECHO_T}$gl_cv_size_max" >&6
+  if test "$gl_cv_size_max" != yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define SIZE_MAX $gl_cv_size_max
+_ACEOF
+
+  fi
+
+
+
+for ac_func in snprintf
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+else
+  gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext"
+fi
+done
+
+
+  :
+
+
+
+
+
+  :
+
+     echo "$as_me:$LINENO: checking for socklen_t" >&5
+echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6
+if test "${ac_cv_type_socklen_t+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+      #if HAVE_SYS_SOCKET_H
+      # include <sys/socket.h>
+      #elif HAVE_WS2TCPIP_H
+      # include <ws2tcpip.h>
+      #endif
+
+int
+main ()
+{
+if ((socklen_t *) 0)
+  return 0;
+if (sizeof (socklen_t))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_type_socklen_t=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_socklen_t=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5
+echo "${ECHO_T}$ac_cv_type_socklen_t" >&6
+if test $ac_cv_type_socklen_t = yes; then
+  :
+else
+  echo "$as_me:$LINENO: checking for socklen_t equivalent" >&5
+echo $ECHO_N "checking for socklen_t equivalent... $ECHO_C" >&6
+      if test "${gl_cv_gl_cv_socklen_t_equiv+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # Systems have either "struct sockaddr *" or
+        # "void *" as the second argument to getpeername
+        gl_cv_socklen_t_equiv=
+        for arg2 in "struct sockaddr" void; do
+          for t in int size_t "unsigned int" "long int" "unsigned long int"; do
+            cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+               #include <sys/socket.h>
+
+               int getpeername (int, $arg2 *, $t *);
+int
+main ()
+{
+$t len;
+               getpeername (0, 0, &len);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  gl_cv_socklen_t_equiv="$t"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+            test "$gl_cv_socklen_t_equiv" != "" && break
+          done
+          test "$gl_cv_socklen_t_equiv" != "" && break
+        done
+
+fi
+
+      if test "$gl_cv_socklen_t_equiv" = ""; then
+       { { echo "$as_me:$LINENO: error: Cannot find a type to use in place of socklen_t" >&5
+echo "$as_me: error: Cannot find a type to use in place of socklen_t" >&2;}
+   { (exit 1); exit 1; }; }
+      fi
+      echo "$as_me:$LINENO: result: $gl_cv_socklen_t_equiv" >&5
+echo "${ECHO_T}$gl_cv_socklen_t_equiv" >&6
+
+cat >>confdefs.h <<_ACEOF
+#define socklen_t $gl_cv_socklen_t_equiv
+_ACEOF
+
+fi
+
+
+
+
+  # Define two additional variables used in the Makefile substitution.
+
+  if test "$ac_cv_header_stdbool_h" = yes; then
+    STDBOOL_H=''
+  else
+    STDBOOL_H='stdbool.h'
+  fi
+
+
+  if test "$ac_cv_type__Bool" = yes; then
+    HAVE__BOOL=1
+  else
+    HAVE__BOOL=0
+  fi
+
+
+
+
+
+for ac_func in strdup
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+else
+  gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext"
+fi
+done
+
+
+  :
+
+
+
+
+
+  if test $ac_cv_have_decl_strdup = no; then
+    HAVE_DECL_STRDUP=0
+  fi
+  :
+
+
+
+
+
+
+  :
+
+
+
+
+
+  if test $ac_cv_header_sys_socket_h = yes; then
+    SYS_SOCKET_H=''
+  else
+
+
+for ac_header in winsock2.h ws2tcpip.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+    SYS_SOCKET_H='sys/socket.h'
+  fi
+
+
+       MKDIR_P='$(mkdir_p)'
+
+
+
+
+for ac_func in vasnprintf
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+else
+  gl_LIBOBJS="$gl_LIBOBJS $ac_func.$ac_objext"
+fi
+done
+
+  if test $ac_cv_func_vasnprintf = no; then
+    gl_LIBOBJS="$gl_LIBOBJS printf-args.$ac_objext"
+    gl_LIBOBJS="$gl_LIBOBJS printf-parse.$ac_objext"
+    gl_LIBOBJS="$gl_LIBOBJS asnprintf.$ac_objext"
+
+
+
+
+
+
+
+
+
+
+
+
+  echo "$as_me:$LINENO: checking for ptrdiff_t" >&5
+echo $ECHO_N "checking for ptrdiff_t... $ECHO_C" >&6
+if test "${ac_cv_type_ptrdiff_t+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main ()
+{
+if ((ptrdiff_t *) 0)
+  return 0;
+if (sizeof (ptrdiff_t))
+  return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_type_ptrdiff_t=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_ptrdiff_t=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_ptrdiff_t" >&5
+echo "${ECHO_T}$ac_cv_type_ptrdiff_t" >&6
+if test $ac_cv_type_ptrdiff_t = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_PTRDIFF_T 1
+_ACEOF
+
+
+fi
+
+
+
+
+
+
+
+
+
+
+
+for ac_func in snprintf wcslen
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+
+
+  fi
+
+
+
+  CFLAG_VISIBILITY=
+  HAVE_VISIBILITY=0
+  if test -n "$GCC"; then
+    echo "$as_me:$LINENO: checking for simple visibility declarations" >&5
+echo $ECHO_N "checking for simple visibility declarations... $ECHO_C" >&6
+    if test "${gl_cv_cc_visibility+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+      gl_save_CFLAGS="$CFLAGS"
+      CFLAGS="$CFLAGS -fvisibility=hidden"
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+extern __attribute__((__visibility__("hidden"))) int hiddenvar;
+         extern __attribute__((__visibility__("default"))) int exportedvar;
+         extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
+         extern __attribute__((__visibility__("default"))) int exportedfunc (void);
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  gl_cv_cc_visibility=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+gl_cv_cc_visibility=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+      CFLAGS="$gl_save_CFLAGS"
+fi
+
+    echo "$as_me:$LINENO: result: $gl_cv_cc_visibility" >&5
+echo "${ECHO_T}$gl_cv_cc_visibility" >&6
+    if test $gl_cv_cc_visibility = yes; then
+      CFLAG_VISIBILITY="-fvisibility=hidden"
+      HAVE_VISIBILITY=1
+    fi
+  fi
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_VISIBILITY $HAVE_VISIBILITY
+_ACEOF
+
+
+
+
+
+
+for ac_header in stdint.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+
+
+
+
+# Check whether --enable-largefile or --disable-largefile was given.
+if test "${enable_largefile+set}" = set; then
+  enableval="$enable_largefile"
+
+fi;
+if test "$enable_largefile" != no; then
+
+  echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5
+echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6
+if test "${ac_cv_sys_largefile_CC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_sys_largefile_CC=no
+     if test "$GCC" != yes; then
+       ac_save_CC=$CC
+       while :; do
+        # IRIX 6.2 and later do not support large files by default,
+        # so use the C compiler's -n32 option if that helps.
+        cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+                      && LARGE_OFF_T % 2147483647 == 1)
+                     ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+        rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext
+        CC="$CC -n32"
+        rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_sys_largefile_CC=' -n32'; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext
+        break
+       done
+       CC=$ac_save_CC
+       rm -f conftest.$ac_ext
+    fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5
+echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6
+  if test "$ac_cv_sys_largefile_CC" != no; then
+    CC=$CC$ac_cv_sys_largefile_CC
+  fi
+
+  echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5
+echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6
+if test "${ac_cv_sys_file_offset_bits+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  while :; do
+  ac_cv_sys_file_offset_bits=no
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+                      && LARGE_OFF_T % 2147483647 == 1)
+                     ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#define _FILE_OFFSET_BITS 64
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+                      && LARGE_OFF_T % 2147483647 == 1)
+                     ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_sys_file_offset_bits=64; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  break
+done
+fi
+echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5
+echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6
+if test "$ac_cv_sys_file_offset_bits" != no; then
+
+cat >>confdefs.h <<_ACEOF
+#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
+_ACEOF
+
+fi
+rm -f conftest*
+  echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5
+echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6
+if test "${ac_cv_sys_large_files+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  while :; do
+  ac_cv_sys_large_files=no
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+                      && LARGE_OFF_T % 2147483647 == 1)
+                     ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#define _LARGE_FILES 1
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+                      && LARGE_OFF_T % 2147483647 == 1)
+                     ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_sys_large_files=1; break
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+  break
+done
+fi
+echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5
+echo "${ECHO_T}$ac_cv_sys_large_files" >&6
+if test "$ac_cv_sys_large_files" != no; then
+
+cat >>confdefs.h <<_ACEOF
+#define _LARGE_FILES $ac_cv_sys_large_files
+_ACEOF
+
+fi
+rm -f conftest*
+fi
+
+
+for ac_prog in grep
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_GREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $GREP in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_GREP="$GREP" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $LOCSYSPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_GREP="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  ;;
+esac
+fi
+GREP=$ac_cv_path_GREP
+
+if test -n "$GREP"; then
+  echo "$as_me:$LINENO: result: $GREP" >&5
+echo "${ECHO_T}$GREP" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$GREP" && break
+done
+
+if test -z "$GREP"; then
+    GREP=grep
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define GREP "$GREP"
+_ACEOF
+
+for ac_prog in egrep
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_EGREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $EGREP in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_EGREP="$EGREP" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $LOCSYSPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_EGREP="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  ;;
+esac
+fi
+EGREP=$ac_cv_path_EGREP
+
+if test -n "$EGREP"; then
+  echo "$as_me:$LINENO: result: $EGREP" >&5
+echo "${ECHO_T}$EGREP" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$EGREP" && break
+done
+
+
+for ac_prog in lint
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_AMLINT+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $AMLINT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_AMLINT="$AMLINT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_dummy="/opt/SUNWspro/bin:$SYSLOCPATH"
+for as_dir in $as_dummy
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_AMLINT="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  ;;
+esac
+fi
+AMLINT=$ac_cv_path_AMLINT
+
+if test -n "$AMLINT"; then
+  echo "$as_me:$LINENO: result: $AMLINT" >&5
+echo "${ECHO_T}$AMLINT" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$AMLINT" && break
+done
+
+if test ! -z "$AMLINT"; then
+  $AMLINT -flags | $GREP -- '-errfmt=' 2>&1 > /dev/null
+  if test $? -eq 0; then
+    AMLINTFLAGS="-n -s -u -m -x"
+    AMLINTFLAGS="$AMLINTFLAGS -errchk=%all"
+    AMLINTFLAGS="$AMLINTFLAGS -errfmt=macro"
+    AMLINTFLAGS="$AMLINTFLAGS -errhdr=no%/usr/include"
+    AMLINTFLAGS="$AMLINTFLAGS -errhdr=%user"
+    AMLINTFLAGS="$AMLINTFLAGS -errsecurity=extended"
+    AMLINTFLAGS="$AMLINTFLAGS -errtags=yes"
+    AMLINTFLAGS="$AMLINTFLAGS -Ncheck=%all"
+    AMLINTFLAGS="$AMLINTFLAGS -Nlevel=2"
+    AMLINTFLAGS="$AMLINTFLAGS -erroff=E_ASGN_NEVER_USED"
+    AMLINTFLAGS="$AMLINTFLAGS,E_ASGN_RESET"
+    AMLINTFLAGS="$AMLINTFLAGS,E_CAST_INT_CONST_TO_SMALL_INT"
+    AMLINTFLAGS="$AMLINTFLAGS,E_CAST_INT_TO_SMALL_INT"
+    AMLINTFLAGS="$AMLINTFLAGS,E_CAST_UINT_TO_SIGNED_INT"
+    AMLINTFLAGS="$AMLINTFLAGS,E_CONSTANT_CONDITION"
+    AMLINTFLAGS="$AMLINTFLAGS,E_ENUM_UNUSE"
+    AMLINTFLAGS="$AMLINTFLAGS,E_EXPR_NULL_EFFECT"
+    AMLINTFLAGS="$AMLINTFLAGS,E_FUNC_RET_ALWAYS_IGNOR"
+    AMLINTFLAGS="$AMLINTFLAGS,E_FUNC_RET_MAYBE_IGNORED"
+    AMLINTFLAGS="$AMLINTFLAGS,E_H_C_CHECK0"
+    AMLINTFLAGS="$AMLINTFLAGS,E_H_C_CHECK1"
+    AMLINTFLAGS="$AMLINTFLAGS,E_H_C_CHECK2"
+    AMLINTFLAGS="$AMLINTFLAGS,E_INCL_MNUSD"
+    AMLINTFLAGS="$AMLINTFLAGS,E_INCL_NUSD"
+    AMLINTFLAGS="$AMLINTFLAGS,E_MCR_NODIFF"
+    AMLINTFLAGS="$AMLINTFLAGS,E_NAME_MULTIPLY_DEF"
+    AMLINTFLAGS="$AMLINTFLAGS,E_P_REF_NULL_PSBL"
+    AMLINTFLAGS="$AMLINTFLAGS,E_P_REF_SUSP"
+    AMLINTFLAGS="$AMLINTFLAGS,E_PTRDIFF_OVERFLOW"
+    AMLINTFLAGS="$AMLINTFLAGS,E_P_USE_NULL_PSBL"
+    AMLINTFLAGS="$AMLINTFLAGS,E_P_USE_SUSP"
+    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_ACCESS_WARN"
+    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_CHDIR_WARN"
+    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_CHMOD_WARN"
+    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_CREAT_WITHOUT_EXCL"
+    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_EXEC_PATH"
+    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_EXEC_WARN"
+    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_FOPEN_MODE"
+    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_GETENV_WARN"
+    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_MKDIR_WARN"
+    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_PRINTF_VAR_FMT"
+    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_RAND_WARN"
+    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_SCANF_VAR_FMT"
+    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_SELECT_WARN"
+    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_SHELL_WARN"
+    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_STRNCPY_WARN"
+    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_UMASK_WARN"
+    AMLINTFLAGS="$AMLINTFLAGS,E_SEC_USE_AFTER_STAT"
+    AMLINTFLAGS="$AMLINTFLAGS,E_SIGN_EXTENSION_PSBL"
+    AMLINTFLAGS="$AMLINTFLAGS,E_TYPEDEF_UNUSE"
+    AMLINTFLAGS="$AMLINTFLAGS,E_UNCAL_F"
+  else
+    AMLINTFLAGS=""
+  fi
+else
+  for ac_prog in splint
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_AMLINT+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $AMLINT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_AMLINT="$AMLINT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $SYSLOCPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_AMLINT="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  ;;
+esac
+fi
+AMLINT=$ac_cv_path_AMLINT
+
+if test -n "$AMLINT"; then
+  echo "$as_me:$LINENO: result: $AMLINT" >&5
+echo "${ECHO_T}$AMLINT" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$AMLINT" && break
+done
+
+  if test ! -z "$AMLINT"; then
+    AMLINT="splint"
+  fi
+  AMLINTFLAGS='+show-scan +unixlib -weak -globs +usedef +usereleased +impouts -paramimptemp -varuse -warnposix -redef -preproc -fixedformalarray -retval -unrecog -usevarargs -formatcode'
+fi
+
+
+
+# Check whether --with-includes or --without-includes was given.
+if test "${with_includes+set}" = set; then
+  withval="$with_includes"
+
+       case "$withval" in
+       "" | y | ye | yes | n | no)
+           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-includes option." >&5
+echo "$as_me: error: *** You must supply an argument to the --with-includes option." >&2;}
+   { (exit 1); exit 1; }; }
+         ;;
+       esac
+       INCLUDE_DIRS="$withval"
+
+fi;
+
+if test "$INCLUDE_DIRS"; then
+       for dir in $INCLUDE_DIRS; do
+           if test -d "$dir"; then
+               AMANDA_CPPFLAGS="$AMANDA_CPPFLAGS -I$dir"
+           else
+               { echo "$as_me:$LINENO: WARNING: *** Include directory $dir does not exist." >&5
+echo "$as_me: WARNING: *** Include directory $dir does not exist." >&2;}
+           fi
+       done
+fi
+
+
+# Check whether --with-libraries or --without-libraries was given.
+if test "${with_libraries+set}" = set; then
+  withval="$with_libraries"
+
+       case "$withval" in
+       "" | y | ye | yes | n | no)
+           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-libraries option." >&5
+echo "$as_me: error: *** You must supply an argument to the --with-libraries option." >&2;}
+   { (exit 1); exit 1; }; }
+         ;;
+       esac
+       LIBRARY_DIRS="$withval"
+
+fi;
+
+if test "$LIBRARY_DIRS"; then
+       for dir in $LIBRARY_DIRS; do
+           if test -d "$dir"; then
+               case "$target" in
+                 *-solaris2*,*-netbsd*)
+                       AMANDA_LDFLAGS="$AMANDA_LDFLAGS -R$dir"
+                       ;;
+               esac
+               AMANDA_LDFLAGS="$AMANDA_LDFLAGS -L$dir"
+           else
+               { echo "$as_me:$LINENO: WARNING: *** Library directory $dir does not exist." >&5
+echo "$as_me: WARNING: *** Library directory $dir does not exist." >&2;}
+           fi
+       done
+fi
+
+
+
+# Check whether --with-dumperdir or --without-dumperdir was given.
+if test "${with_dumperdir+set}" = set; then
+  withval="$with_dumperdir"
+
+       case "$withval" in
+       "" | y | ye | yes | n | no)
+           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-dumperdir option." >&5
+echo "$as_me: error: *** You must supply an argument to the --with-dumperdir option." >&2;}
+   { (exit 1); exit 1; }; }
+         ;;
+       esac
+       DUMPER_DIR="$withval"
+
+else
+
+        test "x$prefix" = xNONE && prefix=$ac_default_prefix
+        test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
+        DUMPER_DIR=$exec_prefix/dumper
+
+
+fi;
+DUMPER_DIR=`(
+    test "x$prefix" = xNONE && prefix=$ac_default_prefix
+    test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
+    eval echo "$DUMPER_DIR"
+)`
+
+cat >>confdefs.h <<_ACEOF
+#define DUMPER_DIR "$DUMPER_DIR"
+_ACEOF
+
+
+
+
+# Check whether --with-configdir or --without-configdir was given.
+if test "${with_configdir+set}" = set; then
+  withval="$with_configdir"
+
+       case "$withval" in
+       "" | y | ye | yes | n | no)
+           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-configdir option." >&5
+echo "$as_me: error: *** You must supply an argument to the --with-configdir option." >&2;}
+   { (exit 1); exit 1; }; }
+         ;;
+       *) CONFIG_DIR="$withval"
+         ;;
+       esac
+
+else
+  : ${CONFIG_DIR="$sysconfdir/amanda"}
+
+fi;
+CONFIG_DIR=`(
+    test "x$prefix" = xNONE && prefix=$ac_default_prefix
+    test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
+    eval echo "$CONFIG_DIR"
+)`
+
+cat >>confdefs.h <<_ACEOF
+#define CONFIG_DIR "$CONFIG_DIR"
+_ACEOF
+
+
+
+
+# Check whether --with-indexdir or --without-indexdir was given.
+if test "${with_indexdir+set}" = set; then
+  withval="$with_indexdir"
+     { { echo "$as_me:$LINENO: error: *** --with-indexdir is deprecated, use indexdir in amanda.conf instead." >&5
+echo "$as_me: error: *** --with-indexdir is deprecated, use indexdir in amanda.conf instead." >&2;}
+   { (exit 1); exit 1; }; }
+
+fi;
+
+
+# Check whether --with-dbdir or --without-dbdir was given.
+if test "${with_dbdir+set}" = set; then
+  withval="$with_dbdir"
+     { { echo "$as_me:$LINENO: error: *** --with-dbdir is deprecated, use infofile in amanda.conf instead." >&5
+echo "$as_me: error: *** --with-dbdir is deprecated, use infofile in amanda.conf instead." >&2;}
+   { (exit 1); exit 1; }; }
+
+fi;
+
+
+# Check whether --with-logdir or --without-logdir was given.
+if test "${with_logdir+set}" = set; then
+  withval="$with_logdir"
+     { { echo "$as_me:$LINENO: error: *** --with-logdir is deprecated, use logdir in amanda.conf instead." >&5
+echo "$as_me: error: *** --with-logdir is deprecated, use logdir in amanda.conf instead." >&2;}
+   { (exit 1); exit 1; }; }
+
+fi;
+
+
+# Check whether --with-suffixes or --without-suffixes was given.
+if test "${with_suffixes+set}" = set; then
+  withval="$with_suffixes"
+  USE_VERSION_SUFFIXES=$withval
+else
+  : ${USE_VERSION_SUFFIXES=no}
+
+fi;
+case "$USE_VERSION_SUFFIXES" in
+y | ye | yes)
+
+cat >>confdefs.h <<\_ACEOF
+#define USE_VERSION_SUFFIXES 1
+_ACEOF
+
+
+    program_suffix="-$VERSION"
+    # This is from the output of configure.in.
+    if test "x$program_transform_name" = xs,x,x,; then
+       program_transform_name=
+    else
+       # Double any \ or $.  echo might interpret backslashes.
+       cat <<\EOF_SED > conftestsed
+s,\\,\\\\,g; s,\$,$$,g
+EOF_SED
+       program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
+       rm -f conftestsed
+    fi
+    test "x$program_prefix" != xNONE &&
+       program_transform_name="s,^,${program_prefix},; $program_transform_name"
+    # Use a double $ so make ignores it.
+    test "x$program_suffix" != xNONE &&
+       program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
+
+    # sed with no file args requires a program.
+    test "x$program_transform_name" = "" && program_transform_name="xs,x,x,"
+    # Remove empty command
+    cat <<\EOF_SED > conftestsed
+s,\;\;,\;,g; s,\; \$,,g; s,\;$,,g
+EOF_SED
+    program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
+    rm -f conftestsed
+  ;;
+n | no) USE_VERSION_SUFFIXES=no
+  ;;
+*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-suffixes option." >&5
+echo "$as_me: error: *** You must not supply an argument to --with-suffixes option." >&2;}
+   { (exit 1); exit 1; }; }
+  ;;
+esac
+
+
+case "$target" in
+    *-hp-*)
+       CLIENT_SCRIPTS_OPT=amhpfixdevs
+       ;;
+    *-sni-sysv4)
+       CLIENT_SCRIPTS_OPT=amsinixfixdevs
+       ;;
+    *)
+       CLIENT_SCRIPTS_OPT=
+       ;;
+esac
+
+
+
+
+# Check whether --with-client-only or --without-client-only was given.
+if test "${with_client_only+set}" = set; then
+  withval="$with_client_only"
+     { { echo "$as_me:$LINENO: error: *** --with-client-only is deprecated, use --without-server instead." >&5
+echo "$as_me: error: *** --with-client-only is deprecated, use --without-server instead." >&2;}
+   { (exit 1); exit 1; }; }
+
+fi;
+
+# Check whether --with-server-only or --without-server-only was given.
+if test "${with_server_only+set}" = set; then
+  withval="$with_server_only"
+     { { echo "$as_me:$LINENO: error: *** --with-server-only is deprecated, use --without-client instead." >&5
+echo "$as_me: error: *** --with-server-only is deprecated, use --without-client instead." >&2;}
+   { (exit 1); exit 1; }; }
+
+fi;
+
+
+# Check whether --with-client or --without-client was given.
+if test "${with_client+set}" = set; then
+  withval="$with_client"
+
+       case "$withval" in
+       y | ye | yes) NO_CLIENT_MODE=false;;
+       n | no) NO_CLIENT_MODE=true;;
+       *)
+           { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-client option." >&5
+echo "$as_me: error: *** You must not supply an argument to --with-client option." >&2;}
+   { (exit 1); exit 1; }; }
+         ;;
+       esac
+
+
+fi;
+
+
+# Check whether --with-server or --without-server was given.
+if test "${with_server+set}" = set; then
+  withval="$with_server"
+
+       case "$withval" in
+       y | ye | yes) NO_SERVER_MODE=false ;;
+       n | no) NO_SERVER_MODE=true;NO_RESTORE_MODE=true;;
+       *)
+           { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-server option.  Maybe you meant --with-index-server=$withval" >&5
+echo "$as_me: error: *** You must not supply an argument to --with-server option.  Maybe you meant --with-index-server=$withval" >&2;}
+   { (exit 1); exit 1; }; }
+         ;;
+       esac
+
+
+fi;
+if test "x${NO_SERVER_MODE+set}" != xset ; then
+   NO_SERVER_MODE=false
+fi
+
+
+# Check whether --with-restore or --without-restore was given.
+if test "${with_restore+set}" = set; then
+  withval="$with_restore"
+
+       case "$withval" in
+       y | ye | yes) NO_RESTORE_MODE=false;;
+       n | no) NO_RESTORE_MODE=true;;
+       *)
+           { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-restore option." >&5
+echo "$as_me: error: *** You must not supply an argument to --with-restore option." >&2;}
+   { (exit 1); exit 1; }; }
+         ;;
+       esac
+
+
+fi;
+if test "x${NO_RESTORE_MODE+set}" != xset ; then
+   NO_RESTORE_MODE=${NO_SERVER_MODE-false}
+fi
+
+if ${NO_SERVER_MODE-false}; then
+   if ${NO_RESTORE_MODE-false}; then
+                        true
+   else
+      { { echo "$as_me:$LINENO: error: *** --without-server requires --without-restore" >&5
+echo "$as_me: error: *** --without-server requires --without-restore" >&2;}
+   { (exit 1); exit 1; }; }
+   fi
+fi
+
+
+# Check whether --with-amrecover or --without-amrecover was given.
+if test "${with_amrecover+set}" = set; then
+  withval="$with_amrecover"
+
+       case "$withval" in
+       y | ye | yes)
+           if ${NO_CLIENT_MODE-false}; then
+               { { echo "$as_me:$LINENO: error: *** --without-client and --with-amrecover are incompatible" >&5
+echo "$as_me: error: *** --without-client and --with-amrecover are incompatible" >&2;}
+   { (exit 1); exit 1; }; }
+           fi
+           NO_RECOVER_MODE=false;;
+       n | no) NO_RECOVER_MODE=true;;
+       *)
+           { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-amrecover option." >&5
+echo "$as_me: error: *** You must not supply an argument to --with-amrecover option." >&2;}
+   { (exit 1); exit 1; }; }
+         ;;
+       esac
+
+
+fi;
+
+
+# Check whether --with-index-server or --without-index-server was given.
+if test "${with_index_server+set}" = set; then
+  withval="$with_index_server"
+
+       case "$withval" in
+       "" | y | ye | yes | n | no)
+           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-index-server option." >&5
+echo "$as_me: error: *** You must supply an argument to the --with-index-server option." >&2;}
+   { (exit 1); exit 1; }; }
+         ;;
+       *) DEFAULT_SERVER="$withval"
+         ;;
+       esac
+
+else
+  : ${DEFAULT_SERVER=`uname -n`}
+
+fi;
+
+cat >>confdefs.h <<_ACEOF
+#define DEFAULT_SERVER "$DEFAULT_SERVER"
+_ACEOF
+
+
+
+
+# Check whether --with-force-uid or --without-force-uid was given.
+if test "${with_force_uid+set}" = set; then
+  withval="$with_force_uid"
+  FORCE_USERID="$withval"
+else
+  : ${FORCE_USERID=yes}
+
+fi;
+case "$FORCE_USERID" in
+y | ye | yes)
+cat >>confdefs.h <<\_ACEOF
+#define FORCE_USERID 1
+_ACEOF
+
+  ;;
+n | no) :
+  ;;
+*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-force-uid option." >&5
+echo "$as_me: error: *** You must not supply an argument to --with-force-uid option." >&2;}
+   { (exit 1); exit 1; }; }
+esac
+
+
+# Check whether --with-user or --without-user was given.
+if test "${with_user+set}" = set; then
+  withval="$with_user"
+
+       case "$withval" in
+       "" | y | ye | yes | n | no)
+           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-user option." >&5
+echo "$as_me: error: *** You must supply an argument to the --with-user option." >&2;}
+   { (exit 1); exit 1; }; }
+         ;;
+       *) CLIENT_LOGIN="$withval"
+         ;;
+       esac
+
+
+fi;
+if test "x${CLIENT_LOGIN+set}" != xset; then
+    { { echo "$as_me:$LINENO: error: *** --with-user=USER is missing" >&5
+echo "$as_me: error: *** --with-user=USER is missing" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define CLIENT_LOGIN "$CLIENT_LOGIN"
+_ACEOF
+
+
+
+
+# Check whether --with-group or --without-group was given.
+if test "${with_group+set}" = set; then
+  withval="$with_group"
+
+       case "$withval" in
+       "" | y | ye | yes | n | no)
+           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-group option." >&5
+echo "$as_me: error: *** You must supply an argument to the --with-group option." >&2;}
+   { (exit 1); exit 1; }; }
+         ;;
+       *) SETUID_GROUP="$withval"
+         ;;
+       esac
+
+
+fi;
+if test "x${SETUID_GROUP+set}" != xset; then
+    { { echo "$as_me:$LINENO: error: *** --with-group=GROUP is missing" >&5
+echo "$as_me: error: *** --with-group=GROUP is missing" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+
+# Check whether --with-owner or --without-owner was given.
+if test "${with_owner+set}" = set; then
+  withval="$with_owner"
+
+        case "$withval" in
+        "" | y | ye | yes | n | no)
+            { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-owner option." >&5
+echo "$as_me: error: *** You must supply an argument to the --with-owner option." >&2;}
+   { (exit 1); exit 1; }; }
+          ;;
+        *) BINARY_OWNER="$withval"
+          ;;
+        esac
+
+
+fi;
+if test "x${BINARY_OWNER+set}" != xset ; then
+   BINARY_OWNER=$CLIENT_LOGIN
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define BINARY_OWNER "$BINARY_OWNER"
+_ACEOF
+
+
+
+
+# Check whether --with-rundump or --without-rundump was given.
+if test "${with_rundump+set}" = set; then
+  withval="$with_rundump"
+
+    case "$withval" in
+       n | no | y | ye | yes) FORCE_USE_RUNDUMP="$withval";;
+       *) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-rundump option." >&5
+echo "$as_me: error: *** You must not supply an argument to --with-rundump option." >&2;}
+   { (exit 1); exit 1; }; };;
+    esac
+
+
+fi;
+
+
+# Check whether --with-config or --without-config was given.
+if test "${with_config+set}" = set; then
+  withval="$with_config"
+
+       case "$withval" in
+       "" | y | ye | yes | n | no)
+           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-config option." >&5
+echo "$as_me: error: *** You must supply an argument to the --with-config option." >&2;}
+   { (exit 1); exit 1; }; }
+         ;;
+       *) DEFAULT_CONFIG="$withval"
+         ;;
+       esac
+
+else
+  : ${DEFAULT_CONFIG=DailySet1}
+
+fi;
+
+cat >>confdefs.h <<_ACEOF
+#define DEFAULT_CONFIG "$DEFAULT_CONFIG"
+_ACEOF
+
+
+
+
+# Check whether --with-tape-server or --without-tape-server was given.
+if test "${with_tape_server+set}" = set; then
+  withval="$with_tape_server"
+
+       case "$withval" in
+       "" | y | ye | yes | n | no)
+           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-tape-server option." >&5
+echo "$as_me: error: *** You must supply an argument to the --with-tape-server option." >&2;}
+   { (exit 1); exit 1; }; }
+         ;;
+       *) DEFAULT_TAPE_SERVER="$withval"
+         ;;
+       esac
+
+else
+  : ${DEFAULT_TAPE_SERVER=$DEFAULT_SERVER}
+
+fi;
+
+cat >>confdefs.h <<_ACEOF
+#define DEFAULT_TAPE_SERVER "$DEFAULT_TAPE_SERVER"
+_ACEOF
+
+
+
+
+# Check whether --with-tape-device or --without-tape-device was given.
+if test "${with_tape_device+set}" = set; then
+  withval="$with_tape_device"
+
+       case "$withval" in
+       "" | y | ye | yes | n | no)
+           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-tape-device option." >&5
+echo "$as_me: error: *** You must supply an argument to the --with-tape-device option." >&2;}
+   { (exit 1); exit 1; }; }
+         ;;
+       *) DEFAULT_TAPE_DEVICE="$withval"
+         ;;
+       esac
+
+
+fi;
+
+if test ! -z "$DEFAULT_TAPE_DEVICE"; then
+
+cat >>confdefs.h <<_ACEOF
+#define DEFAULT_TAPE_DEVICE "$DEFAULT_TAPE_DEVICE"
+_ACEOF
+
+
+    EXAMPLE_TAPEDEV=$DEFAULT_TAPE_DEVICE
+else
+    EXAMPLE_TAPEDEV="/dev/null"
+fi
+
+
+
+# Check whether --with-ftape-raw-device or --without-ftape-raw-device was given.
+if test "${with_ftape_raw_device+set}" = set; then
+  withval="$with_ftape_raw_device"
+
+       case "$withval" in
+       "" | y | ye | yes | n | no)
+           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-ftape-rawdevice option." >&5
+echo "$as_me: error: *** You must supply an argument to the --with-ftape-rawdevice option." >&2;}
+   { (exit 1); exit 1; }; }
+         ;;
+       *) DEFAULT_RAW_TAPE_DEVICE="$withval"
+         ;;
+       esac
+
+else
+
+       if test -z "$DEFAULT_RAW_TAPE_DEVICE"; then
+           echo "$as_me:$LINENO: checking for raw ftape device" >&5
+echo $ECHO_N "checking for raw ftape device... $ECHO_C" >&6
+                   raw_tape_dev=/dev/null
+                               for num in 3 2 1 0 ; do
+                   td=/dev/rawft${num}
+                   if test -r $td; then
+                       raw_tape_dev=$td
+                   fi
+               done
+           DEFAULT_RAW_TAPE_DEVICE=$raw_tape_dev
+           echo "$as_me:$LINENO: result: $DEFAULT_RAW_TAPE_DEVICE" >&5
+echo "${ECHO_T}$DEFAULT_RAW_TAPE_DEVICE" >&6
+       fi
+
+
+fi;
+
+if test -z "$DEFAULT_RAW_TAPE_DEVICE"; then
+    DEFAULT_RAW_TAPE_DEVICE=/dev/null
+fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define DEFAULT_RAW_TAPE_DEVICE "$DEFAULT_RAW_TAPE_DEVICE"
+_ACEOF
+
+
+
+
+# Check whether --with-rew-tape or --without-rew-tape was given.
+if test "${with_rew_tape+set}" = set; then
+  withval="$with_rew_tape"
+     { { echo "$as_me:$LINENO: error: *** --with-rew-tape is deprecated, use --with-tape-device instead." >&5
+echo "$as_me: error: *** --with-rew-tape is deprecated, use --with-tape-device instead." >&2;}
+   { (exit 1); exit 1; }; }
+
+fi;
+
+
+# Check whether --with-norew-tape or --without-norew-tape was given.
+if test "${with_norew_tape+set}" = set; then
+  withval="$with_norew_tape"
+     { { echo "$as_me:$LINENO: error: *** --with-norew-tape is deprecated, use --with-tape-device instead." >&5
+echo "$as_me: error: *** --with-norew-tape is deprecated, use --with-tape-device instead." >&2;}
+   { (exit 1); exit 1; }; }
+
+fi;
+
+
+# Check whether --with-changer-device or --without-changer-device was given.
+if test "${with_changer_device+set}" = set; then
+  withval="$with_changer_device"
+
+       case "$withval" in
+       "" | y | ye | yes | n | no)
+           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-changer-device option." >&5
+echo "$as_me: error: *** You must supply an argument to the --with-changer-device option." >&2;}
+   { (exit 1); exit 1; }; }
+         ;;
+       *) DEFAULT_CHANGER_DEVICE="$withval"
+         ;;
+       esac
+
+else
+
+       if test -z "$DEFAULT_CHANGER_DEVICE" &&
+          test -f /dev/ch0; then
+           DEFAULT_CHANGER_DEVICE=/dev/ch0
+       fi
+
+
+fi;
+
+if test -z "$DEFAULT_CHANGER_DEVICE"; then
+    DEFAULT_CHANGER_DEVICE=/dev/null
+fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define DEFAULT_CHANGER_DEVICE "$DEFAULT_CHANGER_DEVICE"
+_ACEOF
+
+
+
+
+# Check whether --with-fqdn or --without-fqdn was given.
+if test "${with_fqdn+set}" = set; then
+  withval="$with_fqdn"
+  USE_FQDN=$withval
+else
+  : ${USE_FQDN=no}
+
+fi;
+case "$USE_FQDN" in
+n | no) : ;;
+y |  ye | yes)
+cat >>confdefs.h <<\_ACEOF
+#define USE_FQDN 1
+_ACEOF
+
+  ;;
+*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-fqdn option." >&5
+echo "$as_me: error: *** You must not supply an argument to --with-fqdn option." >&2;}
+   { (exit 1); exit 1; }; }
+  ;;
+esac
+
+
+# Check whether --with-broken-fsf or --without-broken-fsf was given.
+if test "${with_broken_fsf+set}" = set; then
+  withval="$with_broken_fsf"
+  HAVE_BROKEN_FSF=$withval
+else
+  : ${HAVE_BROKEN_FSF=no}
+
+fi;
+case "$HAVE_BROKEN_FSF" in
+n | no) : ;;
+y |  ye | yes)
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_BROKEN_FSF 1
+_ACEOF
+
+  ;;
+*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-broken-fsf option." >&5
+echo "$as_me: error: *** You must not supply an argument to --with-broken-fsf option." >&2;}
+   { (exit 1); exit 1; }; }
+  ;;
+esac
+
+
+# Check whether --with-reuseports or --without-reuseports was given.
+if test "${with_reuseports+set}" = set; then
+  withval="$with_reuseports"
+   case "$withval" in
+        y | ye | yes)
+          REUSEADDR=no;;
+        n | no)
+          REUSEADDR=yes;;
+        *)
+          REUSEADDR=no;;
+      esac
+
+else
+   REUSEADDR=yes;
+fi;
+case "$REUSEADDR" in
+n | no) :
+    ;;
+y |  ye | yes)
+
+cat >>confdefs.h <<\_ACEOF
+#define USE_REUSEADDR 1
+_ACEOF
+
+    ;;
+*)
+    { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-reuseports option." >&5
+echo "$as_me: error: *** You must not supply an argument to --with-reuseports option." >&2;}
+   { (exit 1); exit 1; }; }
+    ;;
+esac
+
+
+# Check whether --with-gnutar or --without-gnutar was given.
+if test "${with_gnutar+set}" = set; then
+  withval="$with_gnutar"
+
+       case "$withval" in
+           /*) GNUTAR="$withval";;
+           y|ye|yes) :;;
+           n|no) GNUTAR=;;
+           *)  { { echo "$as_me:$LINENO: error: *** You must supply a full pathname to --with-gnutar" >&5
+echo "$as_me: error: *** You must supply a full pathname to --with-gnutar" >&2;}
+   { (exit 1); exit 1; }; };;
+       esac
+
+
+fi;
+
+
+# Check whether --with-smbclient or --without-smbclient was given.
+if test "${with_smbclient+set}" = set; then
+  withval="$with_smbclient"
+
+       case "$withval" in
+           /*) SAMBA_CLIENT="$withval";;
+           y|ye|yes) :;;
+           n|no) SAMBA_CLIENT=;;
+           *)  { { echo "$as_me:$LINENO: error: *** You must supply a full pathname to --with-smbclient" >&5
+echo "$as_me: error: *** You must supply a full pathname to --with-smbclient" >&2;}
+   { (exit 1); exit 1; }; };;
+       esac
+
+
+fi;
+
+
+# Check whether --with-samba-user or --without-samba-user was given.
+if test "${with_samba_user+set}" = set; then
+  withval="$with_samba_user"
+      { { echo "$as_me:$LINENO: error: *** The samba-user option was deprecated, the username go in the amandapass" >&5
+echo "$as_me: error: *** The samba-user option was deprecated, the username go in the amandapass" >&2;}
+   { (exit 1); exit 1; }; }
+
+
+fi;
+
+
+# Check whether --with-gnutar-listdir or --without-gnutar-listdir was given.
+if test "${with_gnutar_listdir+set}" = set; then
+  withval="$with_gnutar_listdir"
+
+       case "$withval" in
+           n | no)             unset GNUTAR_LISTDIR ;;
+           y | ye | yes)       : ${GNUTAR_LISTDIR=$localstatedir/amanda/gnutar-lists} ;;
+           /*)                 GNUTAR_LISTDIR="$withval" ;;
+           *)                  { { echo "$as_me:$LINENO: error: *** You must supply a full pathname to --with-gnutar-listdir" >&5
+echo "$as_me: error: *** You must supply a full pathname to --with-gnutar-listdir" >&2;}
+   { (exit 1); exit 1; }; }
+       esac
+
+else
+  : ${GNUTAR_LISTDIR="$localstatedir/amanda/gnutar-lists"}
+
+fi;
+if test "$GNUTAR_LISTDIR"; then
+    GNUTAR_LISTDIR=`(
+        test "x$prefix" = xNONE && prefix=$ac_default_prefix
+        eval echo "$GNUTAR_LISTDIR"
+    )`
+
+cat >>confdefs.h <<_ACEOF
+#define GNUTAR_LISTED_INCREMENTAL_DIR "$GNUTAR_LISTDIR"
+_ACEOF
+
+    GNUTAR_LISTED_INCREMENTAL_DIRX=$GNUTAR_LISTDIR
+else
+    GNUTAR_LISTED_INCREMENTAL_DIRX=
+fi
+
+
+
+# Check whether --with-gnutar-listed-incremental or --without-gnutar-listed-incremental was given.
+if test "${with_gnutar_listed_incremental+set}" = set; then
+  withval="$with_gnutar_listed_incremental"
+      { { echo "$as_me:$LINENO: error: *** The gnutar-listed-incremental option was deprecated, use gnutar-listdir instead" >&5
+echo "$as_me: error: *** The gnutar-listed-incremental option was deprecated, use gnutar-listdir instead" >&2;}
+   { (exit 1); exit 1; }; }
+
+
+fi;
+GNUTAR_LISTED_INCREMENTAL_DIR=$GNUTAR_LISTDIR
+
+
+
+# Check whether --with-bsd-security or --without-bsd-security was given.
+if test "${with_bsd_security+set}" = set; then
+  withval="$with_bsd_security"
+  BSD_SECURITY=$withval
+else
+  : ${BSD_SECURITY=yes}
+
+fi;
+case "$BSD_SECURITY" in
+n | no) : ;;
+y |  ye | yes)
+cat >>confdefs.h <<\_ACEOF
+#define BSD_SECURITY 1
+_ACEOF
+
+  ;;
+*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-bsd-security option." >&5
+echo "$as_me: error: *** You must not supply an argument to --with-bsd-security option." >&2;}
+   { (exit 1); exit 1; }; }
+  ;;
+esac
+
+
+# Check whether --with-amandahosts or --without-amandahosts was given.
+if test "${with_amandahosts+set}" = set; then
+  withval="$with_amandahosts"
+  USE_AMANDAHOSTS=$withval
+else
+  : ${USE_AMANDAHOSTS=yes}
+
+fi;
+case "$USE_AMANDAHOSTS" in
+n | no) : ;;
+y |  ye | yes) :
+  case "$BSD_SECURITY" in
+  y | ye | yes)
+cat >>confdefs.h <<\_ACEOF
+#define USE_AMANDAHOSTS 1
+_ACEOF
+
+    ;;
+  esac
+  ;;
+*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-amandahosts option." >&5
+echo "$as_me: error: *** You must not supply an argument to --with-amandahosts option." >&2;}
+   { (exit 1); exit 1; }; }
+  ;;
+esac
+
+
+
+# Check whether --with-dbmalloc or --without-dbmalloc was given.
+if test "${with_dbmalloc+set}" = set; then
+  withval="$with_dbmalloc"
+  DBMALLOC="$withval"
+else
+  : ${DBMALLOC=no}
+
+fi;
+
+case "$DBMALLOC" in
+n | no)
+    DBMALLOCCFLAGS=""
+    DBMALLOCLIBS=""
+    ;;
+*)
+
+echo "$as_me:$LINENO: checking for malloc in -ldbmalloc" >&5
+echo $ECHO_N "checking for malloc in -ldbmalloc... $ECHO_C" >&6
+if test "${ac_cv_lib_dbmalloc_malloc+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldbmalloc  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char malloc ();
+int
+main ()
+{
+malloc ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_dbmalloc_malloc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dbmalloc_malloc=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dbmalloc_malloc" >&5
+echo "${ECHO_T}$ac_cv_lib_dbmalloc_malloc" >&6
+if test $ac_cv_lib_dbmalloc_malloc = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBDBMALLOC 1
+_ACEOF
+
+  LIBS="-ldbmalloc $LIBS"
+
+fi
+
+    if test "x$ac_cv_lib_dbmalloc_malloc" != "xyes"; then
+      { echo "$as_me:$LINENO: WARNING: *** dbmalloc library not found - no malloc debugging support!" >&5
+echo "$as_me: WARNING: *** dbmalloc library not found - no malloc debugging support!" >&2;}
+      DBMALLOCCFLAGS=""
+      DBMALLOCLIBS=""
+    else
+      DBMALLOCCFLAGS="-I$DBMALLOC -DUSE_DBMALLOC"
+      DBMALLOCLIBS="-L$DBMALLOC -ldbmalloc"
+    fi
+    ;;
+esac
+
+
+# Check whether --with-ipv6 or --without-ipv6 was given.
+if test "${with_ipv6+set}" = set; then
+  withval="$with_ipv6"
+
+       case "$withval" in
+       y | ye | yes) amanda_ipv6=true;;
+       n | no) amanda_ipv6=false;;
+       *)
+           { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-ipv6 option." >&5
+echo "$as_me: error: *** You must not supply an argument to --with-ipv6 option." >&2;}
+   { (exit 1); exit 1; }; }
+         ;;
+       esac
+
+
+fi;
+
+
+: ${KRB4_SPOTS="/usr/kerberos /usr/cygnus /usr /opt/kerberos"}
+
+
+# Check whether --with-krb4-security or --without-krb4-security was given.
+if test "${with_krb4_security+set}" = set; then
+  withval="$with_krb4_security"
+  KRB4_SECURITY="$withval"
+else
+  : ${KRB4_SECURITY=no}
+
+fi;
+
+case "$KRB4_SECURITY" in
+n | no) KRB4_SECURITY=no ;;
+y | ye | yes) : ;;
+*) KRB4_SPOTS="$KRB4_SECURITY"
+   KRB4_SECURITY=yes
+   ;;
+esac
+
+echo "$as_me:$LINENO: checking for Kerberos and Amanda kerberos4 bits" >&5
+echo $ECHO_N "checking for Kerberos and Amanda kerberos4 bits... $ECHO_C" >&6
+if test "x${KRB4_SECURITY}" = xyes -a -f  ${srcdir-.}/common-src/krb4-security.c ; then
+    for dir in $KRB4_SPOTS; do
+       if test -f ${dir}/lib/libkrb.a -a -f ${dir}/lib/libdes.a ; then
+           #
+           # This is the original Kerberos 4.
+           #
+           echo "$as_me:$LINENO: result: found in $dir" >&5
+echo "${ECHO_T}found in $dir" >&6
+           KRB4_SECURITY=yes
+
+cat >>confdefs.h <<\_ACEOF
+#define KRB4_SECURITY 1
+_ACEOF
+
+           if test -d $dir/include/kerberosIV ; then
+               #
+               # This handles BSD/OS.
+               #
+               KRB4INCLUDES=-I$dir/include/kerberosIV
+           else
+               KRB4INCLUDES=-I$dir/include
+           fi
+           KRB4LDFLAGS=-L$dir/lib
+           KRB4LIBS="-lkrb -ldes"
+           if test -f ${dir}/lib/libcom_err.a; then
+               KRB4LIBS="$KRB4LIBS -lcom_err"
+           fi
+           break
+       elif test -f ${dir}/lib/libkrb4.a &&
+            test -f ${dir}/lib/libcrypto.a &&
+            test -f ${dir}/lib/libdes425.a ; then
+           #
+           # This is Kerberos 5 with Kerberos 4 back-support.
+           #
+           echo "$as_me:$LINENO: result: found in $dir" >&5
+echo "${ECHO_T}found in $dir" >&6
+           KRB4_SECURITY=yes
+
+cat >>confdefs.h <<\_ACEOF
+#define KRB4_SECURITY 1
+_ACEOF
+
+           KRB4INCLUDES="-I$dir/include -I$dir/include/kerberosIV"
+           KRB4LDFLAGS=-L$dir/lib
+           if test -f ${dir}/lib/libkrb5.a &&
+               test -f ${dir}/lib/libcom_err.a; then
+               KRB4LIBS="-lkrb4 -lkrb5 -lcrypto -ldes425 -lcom_err"
+           else
+               KRB4LIBS="-lkrb4 -lcrypto -ldes425"
+           fi
+           break
+       fi
+    done
+
+    if test "x$KRB4LDFLAGS" = "x" ; then
+       echo "$as_me:$LINENO: result: no libraries found" >&5
+echo "${ECHO_T}no libraries found" >&6
+    fi
+else
+    echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+
+# Check whether --with-rsh-security or --without-rsh-security was given.
+if test "${with_rsh_security+set}" = set; then
+  withval="$with_rsh_security"
+  RSH_SECURITY=$withval
+else
+  : ${RSH_SECURITY=yes}
+
+fi;
+case "$RSH_SECURITY" in
+n | no) : ;;
+y |  ye | yes)
+cat >>confdefs.h <<\_ACEOF
+#define RSH_SECURITY 1
+_ACEOF
+
+  ;;
+*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument the to --with-rsh-security option." >&5
+echo "$as_me: error: *** You must not supply an argument the to --with-rsh-security option." >&2;}
+   { (exit 1); exit 1; }; }
+  ;;
+esac
+
+
+# Check whether --with-ssh-security or --without-ssh-security was given.
+if test "${with_ssh_security+set}" = set; then
+  withval="$with_ssh_security"
+  SSH_SECURITY=$withval
+else
+  : ${SSH_SECURITY=no}
+
+fi;
+case "$SSH_SECURITY" in
+n | no) : ;;
+y |  ye | yes)
+cat >>confdefs.h <<\_ACEOF
+#define SSH_SECURITY 1
+_ACEOF
+
+              SSH_SECURITY_SET=true
+  ;;
+*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-ssh-security." >&5
+echo "$as_me: error: *** You must not supply an argument to --with-ssh-security." >&2;}
+   { (exit 1); exit 1; }; }
+  ;;
+esac
+
+# find SSH and check for SSH options if we're using SSH security
+if test x"$SSH_SECURITY" = "xyes"; then
+    for ac_prog in ssh
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_SSH+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $SSH in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_SSH="$SSH" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $LOCSYSPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_SSH="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  ;;
+esac
+fi
+SSH=$ac_cv_path_SSH
+
+if test -n "$SSH"; then
+  echo "$as_me:$LINENO: result: $SSH" >&5
+echo "${ECHO_T}$SSH" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$SSH" && break
+done
+
+
+cat >>confdefs.h <<_ACEOF
+#define SSH "$SSH"
+_ACEOF
+
+
+
+# Check whether --with-ssh-options or --without-ssh-options was given.
+if test "${with_ssh_options+set}" = set; then
+  withval="$with_ssh_options"
+   SSH_OPTIONS="$withval"
+else
+   SSH_OPTIONS=''
+
+fi;
+
+    case "$SSH_OPTIONS" in
+       y | ye | yes | n | no)
+           { { echo "$as_me:$LINENO: error: *** You must supply an argument to --with-ssh-options." >&5
+echo "$as_me: error: *** You must supply an argument to --with-ssh-options." >&2;}
+   { (exit 1); exit 1; }; };;
+       *) : ;;
+    esac
+
+    echo "$as_me:$LINENO: checking SSH options" >&5
+echo $ECHO_N "checking SSH options... $ECHO_C" >&6
+    # if we didn't get SSH options from the user, figure them out for ourselves
+    if test -z "$SSH_OPTIONS"; then
+       # TODO - quote these (or break them up in ssh-security??)
+       case `$SSH -V 2>&1` in
+           OpenSSH*) SSH_OPTIONS='-x -o BatchMode=yes -o PreferredAuthentications=publickey';;
+           *) SSH_OPTIONS='-x -o BatchMode=yes'
+       esac
+    fi
+
+    # now convert that to a comma-separated list of C strings
+    eval "set dummy ${SSH_OPTIONS}"; shift
+    SSH_OPTIONS=''
+    for i in "${@}"; do SSH_OPTIONS="${SSH_OPTIONS}${SSH_OPTIONS:+, }\"${i/\"/\\\"}\""; done
+    echo "$as_me:$LINENO: result: $SSH_OPTIONS" >&5
+echo "${ECHO_T}$SSH_OPTIONS" >&6
+
+
+cat >>confdefs.h <<_ACEOF
+#define SSH_OPTIONS $SSH_OPTIONS
+_ACEOF
+
+fi
+
+
+# Check whether --with-bsdtcp-security or --without-bsdtcp-security was given.
+if test "${with_bsdtcp_security+set}" = set; then
+  withval="$with_bsdtcp_security"
+  BSDTCP_SECURITY=$withval
+else
+  : ${BSDTCP_SECURITY=yes}
+
+fi;
+case "$BSDTCP_SECURITY" in
+n | no) : ;;
+y |  ye | yes)
+cat >>confdefs.h <<\_ACEOF
+#define BSDTCP_SECURITY 1
+_ACEOF
+
+              BSDTCP_SECURITY_SET=true
+  ;;
+*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument the to --with-bsdtcp-security option." >&5
+echo "$as_me: error: *** You must not supply an argument the to --with-bsdtcp-security option." >&2;}
+   { (exit 1); exit 1; }; }
+  ;;
+esac
+
+
+# Check whether --with-bsdudp-security or --without-bsdudp-security was given.
+if test "${with_bsdudp_security+set}" = set; then
+  withval="$with_bsdudp_security"
+  BSDUDP_SECURITY=$withval
+else
+  : ${BSDUDP_SECURITY=yes}
+
+fi;
+case "$BSDUDP_SECURITY" in
+n | no) : ;;
+y |  ye | yes)
+cat >>confdefs.h <<\_ACEOF
+#define BSDUDP_SECURITY 1
+_ACEOF
+
+              BSDUDP_SECURITY_SET=true
+  ;;
+*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument the to --with-bsdudp-security option." >&5
+echo "$as_me: error: *** You must not supply an argument the to --with-bsdudp-security option." >&2;}
+   { (exit 1); exit 1; }; }
+  ;;
+esac
+
+
+# Check whether --with-server-principal or --without-server-principal was given.
+if test "${with_server_principal+set}" = set; then
+  withval="$with_server_principal"
+
+       case "$withval" in
+       "" | y | ye | yes | n | no)
+           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-server-principal option." >&5
+echo "$as_me: error: *** You must supply an argument to the --with-server-principal option." >&2;}
+   { (exit 1); exit 1; }; }
+         ;;
+       *)
+           SERVER_HOST_PRINCIPLE="$withval"
+         ;;
+       esac
+
+else
+  : ${SERVER_HOST_PRINCIPLE="amanda"}
+
+fi;
+
+cat >>confdefs.h <<_ACEOF
+#define SERVER_HOST_PRINCIPLE "$SERVER_HOST_PRINCIPLE"
+_ACEOF
+
+
+
+# Check whether --with-server-instance or --without-server-instance was given.
+if test "${with_server_instance+set}" = set; then
+  withval="$with_server_instance"
+
+       case "$withval" in
+       "" | y | ye | yes | n | no)
+           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-server-instance option." >&5
+echo "$as_me: error: *** You must supply an argument to the --with-server-instance option." >&2;}
+   { (exit 1); exit 1; }; }
+         ;;
+       *) SERVER_HOST_INSTANCE="$withval"
+         ;;
+       esac
+
+else
+  : ${SERVER_HOST_INSTANCE="amanda"}
+
+fi;
+
+cat >>confdefs.h <<_ACEOF
+#define SERVER_HOST_INSTANCE "$SERVER_HOST_INSTANCE"
+_ACEOF
+
+
+
+# Check whether --with-server-keyfile or --without-server-keyfile was given.
+if test "${with_server_keyfile+set}" = set; then
+  withval="$with_server_keyfile"
+
+       case "$withval" in
+       "" | y | ye | yes | n | no)
+           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-server-keyfile option." >&5
+echo "$as_me: error: *** You must supply an argument to the --with-server-keyfile option." >&2;}
+   { (exit 1); exit 1; }; }
+         ;;
+       *) SERVER_HOST_KEY_FILE="$withval"
+         ;;
+       esac
+
+else
+  : ${SERVER_HOST_KEY_FILE="/.amanda"}
+
+fi;
+
+cat >>confdefs.h <<_ACEOF
+#define SERVER_HOST_KEY_FILE "$SERVER_HOST_KEY_FILE"
+_ACEOF
+
+
+
+# Check whether --with-client-principal or --without-client-principal was given.
+if test "${with_client_principal+set}" = set; then
+  withval="$with_client_principal"
+
+       case "$withval" in
+       "" | y | ye | yes | n | no)
+           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-client-principal option." >&5
+echo "$as_me: error: *** You must supply an argument to the --with-client-principal option." >&2;}
+   { (exit 1); exit 1; }; }
+         ;;
+       *) CLIENT_HOST_PRINCIPLE="$withval"
+         ;;
+       esac
+
+else
+  : ${CLIENT_HOST_PRINCIPLE="rcmd"}
+
+fi;
+
+cat >>confdefs.h <<_ACEOF
+#define CLIENT_HOST_PRINCIPLE "$CLIENT_HOST_PRINCIPLE"
+_ACEOF
+
+
+
+# Check whether --with-client-instance or --without-client-instance was given.
+if test "${with_client_instance+set}" = set; then
+  withval="$with_client_instance"
+
+       case "$withval" in
+       "" | y | ye | yes | n | no)
+           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-client-instance option." >&5
+echo "$as_me: error: *** You must supply an argument to the --with-client-instance option." >&2;}
+   { (exit 1); exit 1; }; }
+         ;;
+       *) CLIENT_HOST_INSTANCE="$withval"
+         ;;
+       esac
+
+else
+  : ${CLIENT_HOST_INSTANCE=HOSTNAME_INSTANCE}
+
+fi;
+
+cat >>confdefs.h <<_ACEOF
+#define CLIENT_HOST_INSTANCE $CLIENT_HOST_INSTANCE
+_ACEOF
+
+
+
+# Check whether --with-client-keyfile or --without-client-keyfile was given.
+if test "${with_client_keyfile+set}" = set; then
+  withval="$with_client_keyfile"
+
+       case "$withval" in
+       "" | y | ye | yes | n | no)
+           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-client-keyfile option." >&5
+echo "$as_me: error: *** You must supply an argument to the --with-client-keyfile option." >&2;}
+   { (exit 1); exit 1; }; }
+         ;;
+       *) CLIENT_HOST_KEY_FILE="$withval"
+         ;;
+       esac
+
+else
+  : ${CLIENT_HOST_KEY_FILE=KEYFILE}
+
+fi;
+
+# Assume it's either KEYFILE (defined in krb.h), or a string filename...
+if test "x$CLIENT_HOST_KEY_FILE" != "xKEYFILE"; then
+  CLIENT_HOST_KEY_FILE="\"$CLIENT_HOST_KEY_FILE\""
+fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define CLIENT_HOST_KEY_FILE $CLIENT_HOST_KEY_FILE
+_ACEOF
+
+
+
+# Check whether --with-ticket-lifetime or --without-ticket-lifetime was given.
+if test "${with_ticket_lifetime+set}" = set; then
+  withval="$with_ticket_lifetime"
+
+       case "$withval" in
+       "" | y | ye | yes | n | no)
+           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-ticket-lifetime option." >&5
+echo "$as_me: error: *** You must supply an argument to the --with-ticket-lifetime option." >&2;}
+   { (exit 1); exit 1; }; }
+         ;;
+       *) TICKET_LIFETIME="$withval"
+         ;;
+       esac
+
+else
+  : ${TICKET_LIFETIME=128}
+
+fi;
+
+cat >>confdefs.h <<_ACEOF
+#define TICKET_LIFETIME $TICKET_LIFETIME
+_ACEOF
+
+
+
+: ${KRB5_SPOTS="/usr/kerberos /usr/cygnus /usr /opt/kerberos"}
+
+
+# Check whether --with-krb5-security or --without-krb5-security was given.
+if test "${with_krb5_security+set}" = set; then
+  withval="$with_krb5_security"
+  KRB5_SECURITY="$withval"
+else
+  : ${KRB5_SECURITY=no}
+
+fi;
+
+case "$KRB5_SECURITY" in
+n | no) KRB5_SECURITY=no
+        KRB5_SPOTS=""
+       ;;
+y | ye | yes) : ;;
+*) KRB5_SPOTS="$KRB5_SECURITY"
+   KRB5_SECURITY=yes
+   ;;
+esac
+
+# if found, force the static versions of these libs (.a) by linking directly
+# with the .a files.  I don't know how to get -R dependancies checked
+# in autoconf at this time. -kashmir
+echo "$as_me:$LINENO: checking for Kerberos V" >&5
+echo $ECHO_N "checking for Kerberos V... $ECHO_C" >&6
+KRB5_DIR_FOUND=""
+KRB5_CFLAGS=""
+for dir in $KRB5_SPOTS; do
+  for lib in lib lib64; do
+    k5libdir=${dir}/${lib}
+    if test -f ${k5libdir}/libkrb5.a -a -f ${k5libdir}/libgssapi_krb5.a -a -f ${k5libdir}/libcom_err.a; then
+       if test -f ${k5libdir}/libk5crypto.a; then
+           K5CRYPTO=-lk5crypto
+       elif test -f ${k5libdir}/libcrypto.a; then
+           K5CRYPTO=-lcrypto
+       else
+           K5CRYPTO=""
+       fi
+       if test -f ${k5libdir}/libkrb5support.a; then
+           K5SUPPORT=-lkrb5support
+       else
+           K5SUPPORT=""
+       fi
+       KRB5_DIR_FOUND=$dir
+       KRB5LIBS="-lgssapi_krb5 -lkrb5 $K5CRYPTO $K5SUPPORT -lcom_err"
+       KRB5CFLAGS=""
+       break
+    elif test -f ${k5libdir}/libkrb5.a -a -f ${k5libdir}/libasn1.a -a -f ${k5libdir}/libgssapi.a; then
+       KRB5_DIR_FOUND=$dir
+       KRB5LIBS="-lgssapi.a -lkrb5.a -lasn1.a"
+       KRB5_CFLAGS="-DKRB5_HEIMDAL_INCLUDES"
+       break
+    fi
+  done
+done
+
+if test "$KRB5_DIR_FOUND"; then
+       echo "$as_me:$LINENO: result: found in $KRB5_DIR_FOUND" >&5
+echo "${ECHO_T}found in $KRB5_DIR_FOUND" >&6
+       KRB5_SECURITY=yes
+
+cat >>confdefs.h <<\_ACEOF
+#define KRB5_SECURITY 1
+_ACEOF
+
+       #
+       # some OS's, such as NetBSD, stick krb5 includes out of the way...
+       # should probably just use autoconf to look for various include
+       # options and set them, but don't quite want to do that until I've
+       # dug into it a bit more.
+       #
+       if test -d "$KRB5_DIR_FOUND/krb5" ; then
+               KRB5INCLUDES="-I$KRB5_DIR_FOUND/include/krb5"
+       else
+               KRB5INCLUDES="-I$KRB5_DIR_FOUND/include"
+       fi
+       if test "$KRB5_CFLAGS" ; then
+               KRB5INCLUDES="$KRB5INCLUDES $KRB5_CFLAGS"
+       fi
+
+echo "$as_me:$LINENO: checking for main in -lkrb5support" >&5
+echo $ECHO_N "checking for main in -lkrb5support... $ECHO_C" >&6
+if test "${ac_cv_lib_krb5support_main+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lkrb5support  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+
+int
+main ()
+{
+main ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_krb5support_main=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_krb5support_main=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_krb5support_main" >&5
+echo "${ECHO_T}$ac_cv_lib_krb5support_main" >&6
+if test $ac_cv_lib_krb5support_main = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBKRB5SUPPORT 1
+_ACEOF
+
+  LIBS="-lkrb5support $LIBS"
+
+fi
+
+       KRB5LDFLAGS=-L$k5libdir
+       break
 fi
 
 if test "x$KRB5LDFLAGS" = "x" ; then
@@ -5527,954 +14058,468 @@ if test "${with_maxtapeblocksize+set}" = set; then
 
        MAXTAPEBLOCKSIZE="$withval"
 
-else
-  : ${MAXTAPEBLOCKSIZE=32}
-
-fi;
-
-
-cat >>confdefs.h <<_ACEOF
-#define MAX_TAPE_BLOCK_KB ($MAXTAPEBLOCKSIZE)
-_ACEOF
-
-
-
-
-# Check whether --with-db or --without-db was given.
-if test "${with_db+set}" = set; then
-  withval="$with_db"
-
-       case "$withval" in
-       "" | y | ye | yes | n | no)
-           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-db option." >&5
-echo "$as_me: error: *** You must supply an argument to the --with-db option." >&2;}
-   { (exit 1); exit 1; }; }
-         ;;
-       *) DB_STYLE="$withval"
-         ;;
-       esac
-
-
-fi;
-if test "$DB_STYLE"; then
-    case "$DB_STYLE" in
-       db | dbm | gdbm | ndbm | text)  ;;
-       *)
-           { { echo "$as_me:$LINENO: error: *** Unknown argument $DB_STYLE given to --with-db.  Choose from db, dbm, gdbm, ndbm, text." >&5
-echo "$as_me: error: *** Unknown argument $DB_STYLE given to --with-db.  Choose from db, dbm, gdbm, ndbm, text." >&2;}
-   { (exit 1); exit 1; }; }
-           DB_STYLE=
-           ;;
-    esac
-fi
-
-
-# Check whether --with-mmap or --without-mmap was given.
-if test "${with_mmap+set}" = set; then
-  withval="$with_mmap"
-  FORCE_MMAP=$withval
-else
-  : ${FORCE_MMAP=no}
-
-fi;
-case "$FORCE_MMAP" in
-y | ye | yes | n | no) : ;;
-*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-mmap." >&5
-echo "$as_me: error: *** You must not supply an argument to --with-mmap." >&2;}
-   { (exit 1); exit 1; }; }
-  ;;
-esac
-
-
-# Check whether --with-buffered-dump or --without-buffered-dump was given.
-if test "${with_buffered_dump+set}" = set; then
-  withval="$with_buffered_dump"
-  DUMPER_SOCKET_BUFFERING=$withval
-else
-  : ${DUMPER_SOCKET_BUFFERING=no}
-
-fi;
-case "$DUMPER_SOCKET_BUFFERING" in
-n | no) :
-  ;;
-y | ye | yes)
-cat >>confdefs.h <<\_ACEOF
-#define DUMPER_SOCKET_BUFFERING 1
-_ACEOF
-
-  ;;
-*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-buffered-dump." >&5
-echo "$as_me: error: *** You must not supply an argument to --with-buffered-dump." >&2;}
-   { (exit 1); exit 1; }; }
-  ;;
-esac
-
-
-# Check whether --with-assertions or --without-assertions was given.
-if test "${with_assertions+set}" = set; then
-  withval="$with_assertions"
-  ASSERTIONS="$withval"
-else
-  : ${ASSERTIONS=no}
-
-fi;
-case "$ASSERTIONS" in
-n | no) : ;;
-y |  ye | yes)
-cat >>confdefs.h <<\_ACEOF
-#define ASSERTIONS 1
-_ACEOF
-
-  ;;
-*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-assertions option." >&5
-echo "$as_me: error: *** You must not supply an argument to --with-assertions option." >&2;}
-   { (exit 1); exit 1; }; }
-  ;;
-esac
-
-
-# Check whether --with-tmpdir or --without-tmpdir was given.
-if test "${with_tmpdir+set}" = set; then
-  withval="$with_tmpdir"
-  tmpdir="$withval"
-else
-  : ${tmpdir=yes}
-
-fi;
-tmpdir=`(
-    test "x$prefix" = xNONE && prefix=$ac_default_prefix
-    test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
-    eval echo "$tmpdir"
-)`
-case "$tmpdir" in
-n | no) { { echo "$as_me:$LINENO: error: *** --without-tmpdir is not allowed." >&5
-echo "$as_me: error: *** --without-tmpdir is not allowed." >&2;}
-   { (exit 1); exit 1; }; };;
-y |  ye | yes)
-       AMANDA_TMPDIR="/tmp/amanda";;
-/*)
-       AMANDA_TMPDIR="$tmpdir";;
-*) { { echo "$as_me:$LINENO: error: *** You must supply a full pathname to --with-tmpdir option." >&5
-echo "$as_me: error: *** You must supply a full pathname to --with-tmpdir option." >&2;}
-   { (exit 1); exit 1; }; };;
-esac
-
-cat >>confdefs.h <<_ACEOF
-#define AMANDA_TMPDIR "$AMANDA_TMPDIR"
-_ACEOF
-
-
-
-
-# Check whether --with-debugging or --without-debugging was given.
-if test "${with_debugging+set}" = set; then
-  withval="$with_debugging"
-  debugging="$withval"
-else
-  : ${debugging=yes}
-
-fi;
-debugging=`(
-    test "x$prefix" = xNONE && prefix=$ac_default_prefix
-    test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
-    eval echo "$debugging"
-)`
-case "$debugging" in
-n | no) AMANDA_DBGDIR="";;
-y |  ye | yes) AMANDA_DBGDIR="$AMANDA_TMPDIR";;
-/*) AMANDA_DBGDIR="$debugging";;
-*) { { echo "$as_me:$LINENO: error: *** You must supply a full pathname to --with-debugging option." >&5
-echo "$as_me: error: *** You must supply a full pathname to --with-debugging option." >&2;}
-   { (exit 1); exit 1; }; }
-  ;;
-esac
-case "$AMANDA_DBGDIR" in
-"") :;;
-*)
-cat >>confdefs.h <<\_ACEOF
-#define DEBUG_CODE 1
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define AMANDA_DBGDIR "$AMANDA_DBGDIR"
-_ACEOF
-
-   ;;
-esac
-
-
-# Check whether --with-debug_days or --without-debug_days was given.
-if test "${with_debug_days+set}" = set; then
-  withval="$with_debug_days"
-  debug_days="$withval"
-else
-  : ${debug_days=4}
-
-fi;
-case "$debug_days" in
-n | no) AMANDA_DEBUG_DAYS=0 ;;
-y |  ye | yes) AMANDA_DEBUG_DAYS=4 ;;
-[0-9] | [0-9][0-9] | [0-9][0-9][0-9]) AMANDA_DEBUG_DAYS="$debug_days" ;;
-*) { { echo "$as_me:$LINENO: error: *** --with-debug-days value not numeric or out of range." >&5
-echo "$as_me: error: *** --with-debug-days value not numeric or out of range." >&2;}
-   { (exit 1); exit 1; }; }
-  ;;
-esac
-
-cat >>confdefs.h <<_ACEOF
-#define AMANDA_DEBUG_DAYS $AMANDA_DEBUG_DAYS
-_ACEOF
-
-
-
-
-# Check whether --with-testing or --without-testing was given.
-if test "${with_testing+set}" = set; then
-  withval="$with_testing"
-  TESTING="$withval"
-else
-  : ${TESTING=no}
-
-fi;
-case "$TESTING" in
-n | no) SERVICE_SUFFIX="";;
-y |  ye | yes) SERVICE_SUFFIX="-test";;
-*) SERVICE_SUFFIX="-$TESTING";;
-esac
-AMANDA_SERVICE_NAME="amanda$SERVICE_SUFFIX"
-KAMANDA_SERVICE_NAME="kamanda$SERVICE_SUFFIX"
-
-
-cat >>confdefs.h <<_ACEOF
-#define SERVICE_SUFFIX "$SERVICE_SUFFIX"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define AMANDA_SERVICE_NAME "$AMANDA_SERVICE_NAME"
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define KAMANDA_SERVICE_NAME "$KAMANDA_SERVICE_NAME"
-_ACEOF
-
-
-(
-    test "x$prefix" = xNONE && prefix=$ac_default_prefix
-    test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
-
-    tmp=`eval echo "$bindir"`
-
-cat >>confdefs.h <<_ACEOF
-#define bindir "$tmp"
-_ACEOF
-
-
-    tmp=`eval echo "$sbindir"`
-
-cat >>confdefs.h <<_ACEOF
-#define sbindir "$tmp"
-_ACEOF
-
-
-    tmp=`eval echo "$libexecdir"`
-
-cat >>confdefs.h <<_ACEOF
-#define libexecdir "$tmp"
-_ACEOF
-
-
-    tmp=`eval echo $mandir`
-
-cat >>confdefs.h <<_ACEOF
-#define mandir "$tmp"
-_ACEOF
-
-)
-
-DUMP_PROGRAMS="ufsdump dump backup"
-GETCONF_LFS="LFS"
-
-dump_returns_1=
-xenix_tapeio=
-case "$target" in
-    *-dec-osf*)
-
-cat >>confdefs.h <<\_ACEOF
-#define STATFS_OSF1 1
-_ACEOF
-
-                       ;;
-    *-dg-*)
-                       DUMP_PROGRAMS="dump "$DUMP_PROGRAMS
-                       : ${USE_RUNDUMP=yes}
-                       dump_returns_1=yes
-                       ;;
-    *-netbsd*)
-                       ;;
-    *-freebsd*)
-                       ;;
-    *-openbsd*)
-                       ;;
-    *-hp-*)
-                       MT_FILE_FLAG="-t"
-                       GETCONF_LFS="XBS5_ILP32_OFFBIG"
-                       case "$CC" in
-                           *gcc*)
-                               AMANDA_CPPFLAGS="-D__STDC_EXT__ $AMANDA_CPPFLAGS"
-                               ;;
-                           *cc*)
-                               AMANDA_CFLAGS="-Ae $AMANDA_CFLAGS"
-                               ;;
-                       esac
-                       ;;
-  *-ibm-aix*)
-                       GETCONF_LFS="XBS5_ILP32_OFFBIG"
-                       DUMP_PROGRAMS="backup "$DUMP_PROGRAMS
-
-cat >>confdefs.h <<\_ACEOF
-#define AIX_TAPEIO 1
-_ACEOF
-
-
-cat >>confdefs.h <<\_ACEOF
-#define AIX_BACKUP 1
-_ACEOF
-
-                       ;;
-  m88k-motorola-sysv4)
-                       ;;
-  *-nextstep3)
-                       ;;
-  *-pc-bsdi*)
-                       ;;
-  *-pc-linux-*)
-                       ;;
-  *-redhat-linux-*)
-                       ;;
-  x86_64-*-linux-*)
-                       ;;
-  alpha*-*-linux-*)
-                       ;;
-  sparc*-*-linux-*)
-                       ;;
-  powerpc-*-linux-*)
-                       ;;
-  *-sgi-irix3*)
-                                               CC=gcc
-                       ;;
-  *-sgi-irix4*)
-                       ;;
-  *-sgi-irix5*)
-                       ;;
-  *-sgi-irix6*)
-                       ;;
-  *-solaris2*)
-                       ;;
-  *-sun-sunos4.1*)
-                       ;;
-  *-ultrix*)
-                       : ${USE_RUNDUMP=yes}
-
-cat >>confdefs.h <<\_ACEOF
-#define STATFS_ULTRIX 1
-_ACEOF
-
-                       dump_returns_1=yes
-                       ;;
-  *-sysv4.2uw2*)
-
-cat >>confdefs.h <<\_ACEOF
-#define UWARE_TAPEIO 1
-_ACEOF
-
-                       ;;
-  *-sco3.2v4*)
-                       DEV_PREFIX=/dev/
-                       RDEV_PREFIX=/dev/
-                       ;;
-  *-sco3.2v5*)
-                       xenix_tapeio=yes
-
-cat >>confdefs.h <<\_ACEOF
-#define STATFS_SCO_OS5 1
-_ACEOF
-
-                       ;;
-  i386-pc-isc4*)
-                       xenix_tapeio=yes
-                       ;;
-  *-sni-sysv4)
-                       ;;
-  *-pc-cygwin)
-
-cat >>confdefs.h <<\_ACEOF
-#define IGNORE_TAR_ERRORS 1
-_ACEOF
+else
+  : ${MAXTAPEBLOCKSIZE=32}
 
-                       # Cygwin needs PATH to find cygwin1.dll
+fi;
 
-cat >>confdefs.h <<\_ACEOF
-#define NEED_PATH_ENV 1
+
+cat >>confdefs.h <<_ACEOF
+#define MAX_TAPE_BLOCK_KB ($MAXTAPEBLOCKSIZE)
 _ACEOF
 
 
-cat >>confdefs.h <<\_ACEOF
-#define IGNORE_UID_CHECK 1
-_ACEOF
 
 
-cat >>confdefs.h <<\_ACEOF
-#define IGNORE_FSTAB 1
-_ACEOF
+# Check whether --with-db or --without-db was given.
+if test "${with_db+set}" = set; then
+  withval="$with_db"
 
+       case "$withval" in
+       "" | y | ye | yes | n | no)
+           { { echo "$as_me:$LINENO: error: *** You must supply an argument to the --with-db option." >&5
+echo "$as_me: error: *** You must supply an argument to the --with-db option." >&2;}
+   { (exit 1); exit 1; }; }
+         ;;
+       *) DB_STYLE="$withval"
+         ;;
+       esac
 
-cat >>confdefs.h <<\_ACEOF
-#define DONT_SUID_ROOT 1
-_ACEOF
 
-                       NEED_SETUID_CLIENT=false
-                       NEED_RUNTIME_PSEUDO_RELOC=true
-                       BROKEN_IPV6=true
-                       ;;
-  *)
-                       cat <<END
+fi;
+if test "$DB_STYLE"; then
+    case "$DB_STYLE" in
+       db | dbm | gdbm | ndbm | text)  ;;
+       *)
+           { { echo "$as_me:$LINENO: error: *** Unknown argument $DB_STYLE given to --with-db.  Choose from db, dbm, gdbm, ndbm, text." >&5
+echo "$as_me: error: *** Unknown argument $DB_STYLE given to --with-db.  Choose from db, dbm, gdbm, ndbm, text." >&2;}
+   { (exit 1); exit 1; }; }
+           DB_STYLE=
+           ;;
+    esac
+fi
 
-*****
-This machine, target type $target, is not known
-to be fully supported by this configure script.  If the
-installation of Amanda on this system succeeds or needed
-any patches, please email amanda-hackers@amanda.org with
-the patches or an indication of the sucess or failure of
-the Amanda installation on your system.
-*****
 
-END
-               ;;
+# Check whether --with-mmap or --without-mmap was given.
+if test "${with_mmap+set}" = set; then
+  withval="$with_mmap"
+  FORCE_MMAP=$withval
+else
+  : ${FORCE_MMAP=no}
+
+fi;
+case "$FORCE_MMAP" in
+y | ye | yes | n | no) : ;;
+*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-mmap." >&5
+echo "$as_me: error: *** You must not supply an argument to --with-mmap." >&2;}
+   { (exit 1); exit 1; }; }
+  ;;
 esac
 
-if test -n "$dump_returns_1"; then
 
+# Check whether --with-buffered-dump or --without-buffered-dump was given.
+if test "${with_buffered_dump+set}" = set; then
+  withval="$with_buffered_dump"
+  DUMPER_SOCKET_BUFFERING=$withval
+else
+  : ${DUMPER_SOCKET_BUFFERING=no}
+
+fi;
+case "$DUMPER_SOCKET_BUFFERING" in
+n | no) :
+  ;;
+y | ye | yes)
 cat >>confdefs.h <<\_ACEOF
-#define DUMP_RETURNS_1 1
+#define DUMPER_SOCKET_BUFFERING 1
 _ACEOF
 
-fi
+  ;;
+*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-buffered-dump." >&5
+echo "$as_me: error: *** You must not supply an argument to --with-buffered-dump." >&2;}
+   { (exit 1); exit 1; }; }
+  ;;
+esac
 
-if test -n "$xenix_tapeio"; then
 
+# Check whether --with-assertions or --without-assertions was given.
+if test "${with_assertions+set}" = set; then
+  withval="$with_assertions"
+  ASSERTIONS="$withval"
+else
+  : ${ASSERTIONS=no}
+
+fi;
+case "$ASSERTIONS" in
+n | no) : ;;
+y |  ye | yes)
 cat >>confdefs.h <<\_ACEOF
-#define XENIX_TAPEIO 1
+#define ASSERTIONS 1
 _ACEOF
 
-fi
-
-AMANDA_CFLAGS="$AMANDA_CFLAGS $KRB4INCLUDES $KRB5INCLUDES $DBMALLOCCFLAGS"
-AMANDA_CPPFLAGS="$AMANDA_CPPFLAGS $KRB4INCLUDES $KRB5INCLUDES $DBMALLOCINCLUDES"
-AMANDA_LDFLAGS="$AMANDA_LDFLAGS $KRB4LDFLAGS $KRB5LDFLAGS"
-AMANDA_LIBS="$KRB4LIBS $KRB5LIBS $DBMALLOCLIBS $AMANDA_LIBS"
-CFLAGS="$CFLAGS $AMANDA_CFLAGS"
-CPPFLAGS="$CPPFLAGS $AMANDA_CPPFLAGS"
-LDFLAGS="$LDFLAGS $AMANDA_LDFLAGS"
-LIBS="$AMANDA_LIBS $LIBS"
+  ;;
+*) { { echo "$as_me:$LINENO: error: *** You must not supply an argument to --with-assertions option." >&5
+echo "$as_me: error: *** You must not supply an argument to --with-assertions option." >&2;}
+   { (exit 1); exit 1; }; }
+  ;;
+esac
 
 
-: ${MT_FILE_FLAG="-f"}
+# Check whether --with-tmpdir or --without-tmpdir was given.
+if test "${with_tmpdir+set}" = set; then
+  withval="$with_tmpdir"
+  tmpdir="$withval"
+else
+  : ${tmpdir=yes}
 
+fi;
+tmpdir=`(
+    test "x$prefix" = xNONE && prefix=$ac_default_prefix
+    test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
+    eval echo "$tmpdir"
+)`
+case "$tmpdir" in
+n | no) { { echo "$as_me:$LINENO: error: *** --without-tmpdir is not allowed." >&5
+echo "$as_me: error: *** --without-tmpdir is not allowed." >&2;}
+   { (exit 1); exit 1; }; };;
+y |  ye | yes)
+       AMANDA_TMPDIR="/tmp/amanda";;
+/*)
+       AMANDA_TMPDIR="$tmpdir";;
+*) { { echo "$as_me:$LINENO: error: *** You must supply a full pathname to --with-tmpdir option." >&5
+echo "$as_me: error: *** You must supply a full pathname to --with-tmpdir option." >&2;}
+   { (exit 1); exit 1; }; };;
+esac
 
 cat >>confdefs.h <<_ACEOF
-#define MT_FILE_FLAG "$MT_FILE_FLAG"
+#define AMANDA_TMPDIR "$AMANDA_TMPDIR"
 _ACEOF
 
 
-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
-echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
-echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
-  CPP=
-fi
-if test -z "$CPP"; then
-  if test "${ac_cv_prog_CPP+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
+
+
+# Check whether --with-debugging or --without-debugging was given.
+if test "${with_debugging+set}" = set; then
+  withval="$with_debugging"
+  debugging="$withval"
 else
-      # Double quotes because CPP needs to be expanded
-    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
-    do
-      ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
-  # Use a header file that comes with gcc, so configuring glibc
-  # with a fresh cross-compiler works.
-  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-  # <limits.h> exists even on freestanding compilers.
-  # On the NeXT, cc -E runs the code through the compiler's parser,
-  # not just through cpp. "Syntax error" is here to catch this case.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+  : ${debugging=yes}
+
+fi;
+debugging=`(
+    test "x$prefix" = xNONE && prefix=$ac_default_prefix
+    test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
+    eval echo "$debugging"
+)`
+case "$debugging" in
+n | no) AMANDA_DBGDIR="";;
+y |  ye | yes) AMANDA_DBGDIR="$AMANDA_TMPDIR";;
+/*) AMANDA_DBGDIR="$debugging";;
+*) { { echo "$as_me:$LINENO: error: *** You must supply a full pathname to --with-debugging option." >&5
+echo "$as_me: error: *** You must supply a full pathname to --with-debugging option." >&2;}
+   { (exit 1); exit 1; }; }
+  ;;
+esac
+case "$AMANDA_DBGDIR" in
+"") :;;
+*)
+cat >>confdefs.h <<\_ACEOF
+#define DEBUG_CODE 1
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-                    Syntax error
+
+
+cat >>confdefs.h <<_ACEOF
+#define AMANDA_DBGDIR "$AMANDA_DBGDIR"
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
-  :
+
+   ;;
+esac
+
+
+# Check whether --with-debug_days or --without-debug_days was given.
+if test "${with_debug_days+set}" = set; then
+  withval="$with_debug_days"
+  debug_days="$withval"
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  : ${debug_days=4}
 
-  # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.$ac_ext
+fi;
+case "$debug_days" in
+n | no) AMANDA_DEBUG_DAYS=0 ;;
+y |  ye | yes) AMANDA_DEBUG_DAYS=4 ;;
+[0-9] | [0-9][0-9] | [0-9][0-9][0-9]) AMANDA_DEBUG_DAYS="$debug_days" ;;
+*) { { echo "$as_me:$LINENO: error: *** --with-debug-days value not numeric or out of range." >&5
+echo "$as_me: error: *** --with-debug-days value not numeric or out of range." >&2;}
+   { (exit 1); exit 1; }; }
+  ;;
+esac
 
-  # OK, works on sane cases.  Now check whether non-existent headers
-  # can be detected and how.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <ac_nonexistent.h>
+cat >>confdefs.h <<_ACEOF
+#define AMANDA_DEBUG_DAYS $AMANDA_DEBUG_DAYS
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
-  # Broken: success on invalid input.
-continue
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-  # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.$ac_ext
 
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
-  break
-fi
 
-    done
-    ac_cv_prog_CPP=$CPP
 
-fi
-  CPP=$ac_cv_prog_CPP
-else
-  ac_cv_prog_CPP=$CPP
-fi
-echo "$as_me:$LINENO: result: $CPP" >&5
-echo "${ECHO_T}$CPP" >&6
-ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
-do
-  # Use a header file that comes with gcc, so configuring glibc
-  # with a fresh cross-compiler works.
-  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-  # <limits.h> exists even on freestanding compilers.
-  # On the NeXT, cc -E runs the code through the compiler's parser,
-  # not just through cpp. "Syntax error" is here to catch this case.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-                    Syntax error
-_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
-  :
+# Check whether --with-testing or --without-testing was given.
+if test "${with_testing+set}" = set; then
+  withval="$with_testing"
+  TESTING="$withval"
 else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  : ${TESTING=no}
 
-  # Broken: fails on valid input.
-continue
-fi
-rm -f conftest.err conftest.$ac_ext
+fi;
+case "$TESTING" in
+n | no) SERVICE_SUFFIX="";;
+y |  ye | yes) SERVICE_SUFFIX="-test";;
+*) SERVICE_SUFFIX="-$TESTING";;
+esac
+AMANDA_SERVICE_NAME="amanda$SERVICE_SUFFIX"
+KAMANDA_SERVICE_NAME="kamanda$SERVICE_SUFFIX"
 
-  # OK, works on sane cases.  Now check whether non-existent headers
-  # can be detected and how.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <ac_nonexistent.h>
+
+cat >>confdefs.h <<_ACEOF
+#define SERVICE_SUFFIX "$SERVICE_SUFFIX"
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
-  # Broken: success on invalid input.
-continue
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-  # Passes both tests.
-ac_preproc_ok=:
-break
-fi
-rm -f conftest.err conftest.$ac_ext
 
-done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then
-  :
-else
-  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&5
-echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details." >&2;}
-   { (exit 1); exit 1; }; }
-fi
+cat >>confdefs.h <<_ACEOF
+#define AMANDA_SERVICE_NAME "$AMANDA_SERVICE_NAME"
+_ACEOF
 
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
+cat >>confdefs.h <<_ACEOF
+#define KAMANDA_SERVICE_NAME "$KAMANDA_SERVICE_NAME"
+_ACEOF
 
-echo "$as_me:$LINENO: checking for egrep" >&5
-echo $ECHO_N "checking for egrep... $ECHO_C" >&6
-if test "${ac_cv_prog_egrep+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if echo a | (grep -E '(a|b)') >/dev/null 2>&1
-    then ac_cv_prog_egrep='grep -E'
-    else ac_cv_prog_egrep='egrep'
-    fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
-echo "${ECHO_T}$ac_cv_prog_egrep" >&6
- EGREP=$ac_cv_prog_egrep
 
+(
+    test "x$prefix" = xNONE && prefix=$ac_default_prefix
+    test "x$exec_prefix" = xNONE && exec_prefix=${prefix}
 
-echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
-if test "${ac_cv_header_stdc+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+    tmp=`eval echo "$bindir"`
+
+cat >>confdefs.h <<_ACEOF
+#define bindir "$tmp"
 _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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_header_stdc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+    tmp=`eval echo "$sbindir"`
 
-ac_cv_header_stdc=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+cat >>confdefs.h <<_ACEOF
+#define sbindir "$tmp"
+_ACEOF
 
-if test $ac_cv_header_stdc = yes; then
-  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+
+    tmp=`eval echo "$libexecdir"`
+
+cat >>confdefs.h <<_ACEOF
+#define libexecdir "$tmp"
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <string.h>
 
+
+    tmp=`eval echo $mandir`
+
+cat >>confdefs.h <<_ACEOF
+#define mandir "$tmp"
 _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.  */
+DUMP_PROGRAMS="ufsdump dump backup"
+GETCONF_LFS="LFS"
+
+dump_returns_1=
+xenix_tapeio=
+case "$target" in
+    *-dec-osf*)
+
+cat >>confdefs.h <<\_ACEOF
+#define STATFS_OSF1 1
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <stdlib.h>
 
+                       ;;
+    *-dg-*)
+                       DUMP_PROGRAMS="dump "$DUMP_PROGRAMS
+                       : ${USE_RUNDUMP=yes}
+                       dump_returns_1=yes
+                       ;;
+    *-netbsd*)
+                       ;;
+    *-freebsd*)
+                       ;;
+    *-openbsd*)
+                       ;;
+    *-hp-*)
+                       MT_FILE_FLAG="-t"
+                       GETCONF_LFS="XBS5_ILP32_OFFBIG"
+                       case "$CC" in
+                           *gcc*)
+                               AMANDA_CPPFLAGS="-D__STDC_EXT__ $AMANDA_CPPFLAGS"
+                               ;;
+                           *cc*)
+                               AMANDA_CFLAGS="-Ae $AMANDA_CFLAGS"
+                               ;;
+                       esac
+                       ;;
+  *-ibm-aix*)
+                       GETCONF_LFS="XBS5_ILP32_OFFBIG"
+                       DUMP_PROGRAMS="backup "$DUMP_PROGRAMS
+
+cat >>confdefs.h <<\_ACEOF
+#define AIX_TAPEIO 1
 _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.  */
+cat >>confdefs.h <<\_ACEOF
+#define AIX_BACKUP 1
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <ctype.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
-                  (('a' <= (c) && (c) <= 'i') \
-                    || ('j' <= (c) && (c) <= 'r') \
-                    || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
 
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
-  int i;
-  for (i = 0; i < 256; i++)
-    if (XOR (islower (i), ISLOWER (i))
-       || toupper (i) != TOUPPER (i))
-      exit(2);
-  exit (0);
-}
+                       ;;
+  m88k-motorola-sysv4)
+                       ;;
+  *-nextstep3)
+                       ;;
+  *-pc-bsdi*)
+                       ;;
+  *-pc-linux-*)
+                       ;;
+  *-redhat-linux-*)
+                       ;;
+  *-suse-linux-*)
+                       ;;
+  x86_64-*-linux-*)
+                       ;;
+  alpha*-*-linux-*)
+                       ;;
+  sparc*-*-linux-*)
+                       ;;
+  powerpc-*-linux-*)
+                       ;;
+  *-sgi-irix3*)
+                                               CC=gcc
+                       ;;
+  *-sgi-irix4*)
+                       ;;
+  *-sgi-irix5*)
+                       ;;
+  *-sgi-irix6*)
+                       ;;
+  *-solaris2*)
+                       ;;
+  *-sun-sunos4.1*)
+                       ;;
+  *-ultrix*)
+                       : ${USE_RUNDUMP=yes}
+
+cat >>confdefs.h <<\_ACEOF
+#define STATFS_ULTRIX 1
 _ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  :
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-( exit $ac_status )
-ac_cv_header_stdc=no
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6
-if test $ac_cv_header_stdc = yes; then
+                       dump_returns_1=yes
+                       ;;
+  *-sysv4.2uw2*)
 
 cat >>confdefs.h <<\_ACEOF
-#define STDC_HEADERS 1
+#define UWARE_TAPEIO 1
 _ACEOF
 
-fi
+                       ;;
+  *-sco3.2v4*)
+                       DEV_PREFIX=/dev/
+                       RDEV_PREFIX=/dev/
+                       ;;
+  *-sco3.2v5*)
+                       xenix_tapeio=yes
 
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+cat >>confdefs.h <<\_ACEOF
+#define STATFS_SCO_OS5 1
+_ACEOF
+
+                       ;;
+  i386-pc-isc4*)
+                       xenix_tapeio=yes
+                       ;;
+  *-sni-sysv4)
+                       ;;
+  *-pc-cygwin)
 
+cat >>confdefs.h <<\_ACEOF
+#define IGNORE_TAR_ERRORS 1
+_ACEOF
 
+                       # Cygwin needs PATH to find cygwin1.dll
 
+cat >>confdefs.h <<\_ACEOF
+#define NEED_PATH_ENV 1
+_ACEOF
 
 
+cat >>confdefs.h <<\_ACEOF
+#define IGNORE_UID_CHECK 1
+_ACEOF
 
 
+cat >>confdefs.h <<\_ACEOF
+#define IGNORE_FSTAB 1
+_ACEOF
 
 
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
-                 inttypes.h stdint.h unistd.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+cat >>confdefs.h <<\_ACEOF
+#define DONT_SUID_ROOT 1
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
 
-#include <$ac_header>
+                       NEED_SETUID_CLIENT=false
+                       NEED_RUNTIME_PSEUDO_RELOC=true
+                       BROKEN_IPV6=true
+                       ;;
+  *)
+                       cat <<END
+
+*****
+This machine, target type $target, is not known
+to be fully supported by this configure script.  If the
+installation of Amanda on this system succeeds or needed
+any patches, please email amanda-hackers@amanda.org with
+the patches or an indication of the sucess or failure of
+the Amanda installation on your system.
+*****
+
+END
+               ;;
+esac
+
+if test -n "$dump_returns_1"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define DUMP_RETURNS_1 1
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_Header=yes"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_Header=no"
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+
+if test -n "$xenix_tapeio"; then
+
+cat >>confdefs.h <<\_ACEOF
+#define XENIX_TAPEIO 1
 _ACEOF
 
 fi
 
-done
+AMANDA_CFLAGS="$AMANDA_CFLAGS $KRB4INCLUDES $KRB5INCLUDES $DBMALLOCCFLAGS"
+AMANDA_CPPFLAGS="$AMANDA_CPPFLAGS $KRB4INCLUDES $KRB5INCLUDES $DBMALLOCINCLUDES"
+AMANDA_LDFLAGS="$AMANDA_LDFLAGS $KRB4LDFLAGS $KRB5LDFLAGS"
+AMANDA_LIBS="$KRB4LIBS $KRB5LIBS $DBMALLOCLIBS $AMANDA_LIBS"
+CFLAGS="$CFLAGS $AMANDA_CFLAGS"
+CPPFLAGS="$CPPFLAGS $AMANDA_CPPFLAGS"
+LDFLAGS="$LDFLAGS $AMANDA_LDFLAGS"
+LIBS="$AMANDA_LIBS $LIBS"
+
+
+: ${MT_FILE_FLAG="-f"}
+
+
+cat >>confdefs.h <<_ACEOF
+#define MT_FILE_FLAG "$MT_FILE_FLAG"
+_ACEOF
 
 
 # ------ AX CREATE STDINT H -------------------------------------
@@ -9423,54 +17468,6 @@ fi
   test -n "$AWK" && break
 done
 
-
-
-       echo "$as_me:$LINENO: checking for $AWK command line variable assignment" >&5
-echo $ECHO_N "checking for $AWK command line variable assignment... $ECHO_C" >&6
-if test "${amanda_cv_awk_var_assignment+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-               echo 'BEGIN{print i; exit}' > conftest.awk
-               result=`$AWK -f conftest.awk i=xx | wc -c`
-               if test "$result" -le 1; then
-                   result=`$AWK -f conftest.awk -v i=xx | wc -c`
-                   if test "$result" -le 1; then
-                       amanda_cv_awk_var_assignment=no
-                   else
-                       amanda_cv_awk_var_assignment="yes with -v"
-                   fi
-               else
-                   amanda_cv_awk_var_assignment="yes"
-               fi
-               rm -fr conftest.awk
-
-
-fi
-echo "$as_me:$LINENO: result: $amanda_cv_awk_var_assignment" >&5
-echo "${ECHO_T}$amanda_cv_awk_var_assignment" >&6
-       AWK_VAR_ASSIGNMENT_OPT=
-       case "$amanda_cv_awk_var_assignment" in
-           no)
-               HAVE_AWK_WITH_VAR=no
-               ;;
-           yes)
-               HAVE_AWK_WITH_VAR=yes
-               ;;
-           "yes with -v")
-               HAVE_AWK_WITH_VAR=yes
-               AWK_VAR_ASSIGNMENT_OPT=-v
-               ;;
-       esac
-
-
-
-if test "x$amanda_cv_awk_var_assignment" = xno; then
-    NO_AMPLOT_MODE=true
-    { echo "$as_me:$LINENO: WARNING: *** Your $awk cannot do command line variable assignment.  Amplot will not be installed." >&5
-echo "$as_me: WARNING: *** Your $awk cannot do command line variable assignment.  Amplot will not be installed." >&2;}
-fi
-
 for ac_prog in 'bison -y' byacc
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
@@ -9692,7 +17689,70 @@ fi
 done
 
 
-for ac_prog in gnuplot
+
+# Check whether --with-gnuplot or --without-gnuplot was given.
+if test "${with_gnuplot+set}" = set; then
+  withval="$with_gnuplot"
+   ac_with_gnuplot=$withval;
+else
+   ac_with_gnuplot=maybe;
+fi;
+
+if test "$ac_with_gnuplot" = "yes" -o "$ac_with_gnuplot" = "maybe"; then
+    for ac_prog in gnuplot
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_GNUPLOT+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $GNUPLOT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_GNUPLOT="$GNUPLOT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $LOCSYSPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_GNUPLOT="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  ;;
+esac
+fi
+GNUPLOT=$ac_cv_path_GNUPLOT
+
+if test -n "$GNUPLOT"; then
+  echo "$as_me:$LINENO: result: $GNUPLOT" >&5
+echo "${ECHO_T}$GNUPLOT" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  test -n "$GNUPLOT" && break
+done
+
+else
+    if test "$ac_with_gnuplot" != "no"; then
+        if test -x "$ac_with_gnuplot"; then
+            GNUPLOT="$ac_with_gnuplot";
+        else
+            { echo "$as_me:$LINENO: WARNING: Specified gnuplot of $ac_with_gnuplot isn't" >&5
+echo "$as_me: WARNING: Specified gnuplot of $ac_with_gnuplot isn't" >&2;}
+            { echo "$as_me:$LINENO: WARNING: executable, searching for an alternative." >&5
+echo "$as_me: WARNING: executable, searching for an alternative." >&2;}
+           for ac_prog in gnuplot
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
   test -n "$GNUPLOT" && break
 done
 
-if test -z "$GNUPLOT"; then
-    NO_AMPLOT_MODE=true
-    { echo "$as_me:$LINENO: WARNING: *** You do not have gnuplot.  Amplot will not be installed." >&5
-echo "$as_me: WARNING: *** You do not have gnuplot.  Amplot will not be installed." >&2;}
+        fi
+    fi
 fi
 
+
 for ac_prog in gtar gnutar tar
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
   test -n "$DUMP" && break
 done
 
+if test -n "$DUMP"; then
+  if test "`basename $DUMP`" = "backup"; then
+    backup_gnutar=`$DUMP --version | $GREP "GNU tar"`
+    if test $? -eq 0; then
+      DUMP=
+    fi
+  fi
+fi
 for ac_prog in ufsrestore restore
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 
 
 
+echo "$as_me:$LINENO: checking if sockaddr_storage struct exists" >&5
+echo $ECHO_N "checking if sockaddr_storage struct exists... $ECHO_C" >&6
+    if test "${ac_cv_has_sockaddr_storage+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+#      include <sys/types.h>
+#      include <sys/socket.h>
+int
+main ()
+{
+u_int i = sizeof (struct sockaddr_storage)
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_has_sockaddr_storage=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_has_sockaddr_storage=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+    echo "$as_me:$LINENO: result: $ac_cv_has_sockaddr_storage" >&5
+echo "${ECHO_T}$ac_cv_has_sockaddr_storage" >&6
+    if test $ac_cv_has_sockaddr_storage = yes ; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_SOCKADDR_STORAGE 1
+_ACEOF
+
+    fi
+
 # Determine the printf format characters to use when printing
 # values of type long long. This will normally be "ll", but where
 # the compiler treats "long long" as a alias for "long" and printf
@@ -15065,7 +23196,7 @@ ia64-*-hpux*)
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 15068 "configure"' > conftest.$ac_ext
+  echo '#line 23199 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -16171,7 +24302,7 @@ fi
 
 
 # Provide some information about the compiler.
-echo "$as_me:16174:" \
+echo "$as_me:24305:" \
      "checking for Fortran 77 compiler version" >&5
 ac_compiler=`set X $ac_compile; echo $2`
 { (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
@@ -17273,11 +25404,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:17276: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:25407: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:17280: \$? = $ac_status" >&5
+   echo "$as_me:25411: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -17535,11 +25666,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:17538: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:25669: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:17542: \$? = $ac_status" >&5
+   echo "$as_me:25673: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -17597,11 +25728,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:17600: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:25731: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:17604: \$? = $ac_status" >&5
+   echo "$as_me:25735: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -19845,7 +27976,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 19848 "configure"
+#line 27979 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -19943,7 +28074,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 19946 "configure"
+#line 28077 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -22202,11 +30333,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:22205: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:30336: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:22209: \$? = $ac_status" >&5
+   echo "$as_me:30340: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -22264,11 +30395,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:22267: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:30398: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:22271: \$? = $ac_status" >&5
+   echo "$as_me:30402: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -23641,7 +31772,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 23644 "configure"
+#line 31775 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -23739,7 +31870,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 23742 "configure"
+#line 31873 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -24624,11 +32755,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:24627: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:32758: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:24631: \$? = $ac_status" >&5
+   echo "$as_me:32762: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -24686,11 +32817,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:24689: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:32820: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:24693: \$? = $ac_status" >&5
+   echo "$as_me:32824: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -26820,11 +34951,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:26823: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:34954: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:26827: \$? = $ac_status" >&5
+   echo "$as_me:34958: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -27082,11 +35213,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:27085: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:35216: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:27089: \$? = $ac_status" >&5
+   echo "$as_me:35220: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -27144,11 +35275,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:27147: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:35278: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:27151: \$? = $ac_status" >&5
+   echo "$as_me:35282: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -29392,7 +37523,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 29395 "configure"
+#line 37526 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -29490,7 +37621,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 29493 "configure"
+#line 37624 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -30700,75 +38831,6 @@ _ACEOF
 fi
 
 
-       echo "$as_me:$LINENO: checking for working volatile" >&5
-echo $ECHO_N "checking for working volatile... $ECHO_C" >&6
-if test "${amanda_cv_c_volatile+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-               cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-int
-main ()
-{
-
-                       volatile int aaa = 0;
-
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  amanda_cv_c_volatile=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-amanda_cv_c_volatile=no
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-
-
-fi
-echo "$as_me:$LINENO: result: $amanda_cv_c_volatile" >&5
-echo "${ECHO_T}$amanda_cv_c_volatile" >&6
-       if test $amanda_cv_c_volatile = no; then
-
-cat >>confdefs.h <<\_ACEOF
-#define volatile
-_ACEOF
-
-       fi
-
-
-
        echo "$as_me:$LINENO: checking for working unsigned long constants" >&5
 echo $ECHO_N "checking for working unsigned long constants... $ECHO_C" >&6
 if test "${amanda_cv_c_unsigned_long_constants+set}" = set; then
 done
 
 
-ice_have_bind=no
-
-for ac_func in bind
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != $ac_func;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
- ice_have_bind=yes
-fi
-done
-
-if test "${ice_have_bind}" = yes; then
-echo "$as_me:$LINENO: checking for bind declaration in sys/types.h sys/socket.h" >&5
-echo $ECHO_N "checking for bind declaration in sys/types.h sys/socket.h... $ECHO_C" >&6
-if test "${ice_cv_have_bind_decl+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-ice_cv_have_bind_decl=no
-ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
-ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in sys/types.h sys/socket.h; do
-# Check for ordinary declaration
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}bind[  ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_bind_decl=yes
-fi
-rm -f conftest*
-
-if test "$ice_cv_have_bind_decl" = yes; then
-       break
-fi
-# Check for "fixed" declaration like "getpid _PARAMS((int))"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}bind[  ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_bind_decl=yes
-fi
-rm -f conftest*
-
-if test "$ice_cv_have_bind_decl" = yes; then
-       break
-fi
-done
-
-fi
-
-echo "$as_me:$LINENO: result: $ice_cv_have_bind_decl" >&5
-echo "${ECHO_T}$ice_cv_have_bind_decl" >&6
-if test "$ice_cv_have_bind_decl" = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_BIND_DECL 1
-_ACEOF
-
-fi
-fi
-
-
-ice_have_bcopy=no
-
-for ac_func in bcopy
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != $ac_func;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
- ice_have_bcopy=yes
-fi
-done
-
-if test "${ice_have_bcopy}" = yes; then
-echo "$as_me:$LINENO: checking for bcopy declaration in string.h strings.h stdlib.h" >&5
-echo $ECHO_N "checking for bcopy declaration in string.h strings.h stdlib.h... $ECHO_C" >&6
-if test "${ice_cv_have_bcopy_decl+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-ice_cv_have_bcopy_decl=no
-ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
-ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in string.h strings.h stdlib.h; do
-# Check for ordinary declaration
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}bcopy[         ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_bcopy_decl=yes
-fi
-rm -f conftest*
-
-if test "$ice_cv_have_bcopy_decl" = yes; then
-       break
-fi
-# Check for "fixed" declaration like "getpid _PARAMS((int))"
-cat >conftest.$ac_ext <<_ACEOF
-/* 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}bcopy[         ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_bcopy_decl=yes
-fi
-rm -f conftest*
-
-if test "$ice_cv_have_bcopy_decl" = yes; then
-       break
-fi
-done
-
-fi
-
-echo "$as_me:$LINENO: result: $ice_cv_have_bcopy_decl" >&5
-echo "${ECHO_T}$ice_cv_have_bcopy_decl" >&6
-if test "$ice_cv_have_bcopy_decl" = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_BCOPY_DECL 1
-_ACEOF
-
-fi
-fi
-
-
-ice_have_bzero=no
+ice_have_bind=no
 
-for ac_func in bzero
+for ac_func in bind
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -38457,21 +46183,21 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_bzero=yes
+ ice_have_bind=yes
 fi
 done
 
-if test "${ice_have_bzero}" = yes; then
-echo "$as_me:$LINENO: checking for bzero declaration in string.h strings.h stdlib.h" >&5
-echo $ECHO_N "checking for bzero declaration in string.h strings.h stdlib.h... $ECHO_C" >&6
-if test "${ice_cv_have_bzero_decl+set}" = set; then
+if test "${ice_have_bind}" = yes; then
+echo "$as_me:$LINENO: checking for bind declaration in sys/types.h sys/socket.h" >&5
+echo $ECHO_N "checking for bind declaration in sys/types.h sys/socket.h... $ECHO_C" >&6
+if test "${ice_cv_have_bind_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_bzero_decl=no
+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 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.  */
@@ -38483,12 +46209,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}bzero[         ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_bzero_decl=yes
+  $EGREP "${ice_re_word}bind[  ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_bind_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_bzero_decl" = yes; then
+if test "$ice_cv_have_bind_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -38502,94 +46228,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}bzero[         ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_bzero_decl=yes
+  $EGREP "${ice_re_word}bind[  ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_bind_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_bzero_decl" = yes; then
+if test "$ice_cv_have_bind_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_bzero_decl" >&5
-echo "${ECHO_T}$ice_cv_have_bzero_decl" >&6
-if test "$ice_cv_have_bzero_decl" = yes; then
+echo "$as_me:$LINENO: result: $ice_cv_have_bind_decl" >&5
+echo "${ECHO_T}$ice_cv_have_bind_decl" >&6
+if test "$ice_cv_have_bind_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_BZERO_DECL 1
-_ACEOF
-
-fi
-fi
-
-echo "$as_me:$LINENO: checking whether closedir returns void" >&5
-echo $ECHO_N "checking whether closedir returns void... $ECHO_C" >&6
-if test "${ac_cv_func_closedir_void+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test "$cross_compiling" = yes; then
-  ac_cv_func_closedir_void=yes
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header_dirent>
-#ifndef __cplusplus
-int closedir ();
-#endif
-
-int
-main ()
-{
-exit (closedir (opendir (".")) != 0);
-  ;
-  return 0;
-}
+#define HAVE_BIND_DECL 1
 _ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_closedir_void=no
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-( exit $ac_status )
-ac_cv_func_closedir_void=yes
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_closedir_void" >&5
-echo "${ECHO_T}$ac_cv_func_closedir_void" >&6
-if test $ac_cv_func_closedir_void = yes; then
 
-cat >>confdefs.h <<\_ACEOF
-#define CLOSEDIR_VOID 1
-_ACEOF
-
-fi
 
+ice_have_bcopy=no
 
-ice_have_closelog=no
-
-for ac_func in closelog
+for ac_func in bcopy
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -38686,21 +46351,21 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_closelog=yes
+ ice_have_bcopy=yes
 fi
 done
 
-if test "${ice_have_closelog}" = yes; then
-echo "$as_me:$LINENO: checking for closelog declaration in syslog.h" >&5
-echo $ECHO_N "checking for closelog declaration in syslog.h... $ECHO_C" >&6
-if test "${ice_cv_have_closelog_decl+set}" = set; then
+if test "${ice_have_bcopy}" = yes; then
+echo "$as_me:$LINENO: checking for bcopy declaration in string.h strings.h stdlib.h" >&5
+echo $ECHO_N "checking for bcopy declaration in string.h strings.h stdlib.h... $ECHO_C" >&6
+if test "${ice_cv_have_bcopy_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_closelog_decl=no
+ice_cv_have_bcopy_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in syslog.h; do
+for header in string.h strings.h stdlib.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -38712,12 +46377,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _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
+  $EGREP "${ice_re_word}bcopy[         ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_bcopy_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_closelog_decl" = yes; then
+if test "$ice_cv_have_bcopy_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -38731,33 +46396,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _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
+  $EGREP "${ice_re_word}bcopy[         ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_bcopy_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_closelog_decl" = yes; then
+if test "$ice_cv_have_bcopy_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_closelog_decl" >&5
-echo "${ECHO_T}$ice_cv_have_closelog_decl" >&6
-if test "$ice_cv_have_closelog_decl" = yes; then
+echo "$as_me:$LINENO: result: $ice_cv_have_bcopy_decl" >&5
+echo "${ECHO_T}$ice_cv_have_bcopy_decl" >&6
+if test "$ice_cv_have_bcopy_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_CLOSELOG_DECL 1
+#define HAVE_BCOPY_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_connect=no
+ice_have_bzero=no
 
-for ac_func in connect
+for ac_func in bzero
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -38854,21 +46519,21 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_connect=yes
+ ice_have_bzero=yes
 fi
 done
 
-if test "${ice_have_connect}" = yes; then
-echo "$as_me:$LINENO: checking for connect declaration in sys/types.h sys/socket.h" >&5
-echo $ECHO_N "checking for connect declaration in sys/types.h sys/socket.h... $ECHO_C" >&6
-if test "${ice_cv_have_connect_decl+set}" = set; then
+if test "${ice_have_bzero}" = yes; then
+echo "$as_me:$LINENO: checking for bzero declaration in string.h strings.h stdlib.h" >&5
+echo $ECHO_N "checking for bzero declaration in string.h strings.h stdlib.h... $ECHO_C" >&6
+if test "${ice_cv_have_bzero_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_connect_decl=no
+ice_cv_have_bzero_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in sys/types.h sys/socket.h; do
+for header in string.h strings.h stdlib.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -38880,12 +46545,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}connect[       ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_connect_decl=yes
+  $EGREP "${ice_re_word}bzero[         ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_bzero_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_connect_decl" = yes; then
+if test "$ice_cv_have_bzero_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -38899,33 +46564,94 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}connect[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_connect_decl=yes
+  $EGREP "${ice_re_word}bzero[         ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_bzero_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_connect_decl" = yes; then
+if test "$ice_cv_have_bzero_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_connect_decl" >&5
-echo "${ECHO_T}$ice_cv_have_connect_decl" >&6
-if test "$ice_cv_have_connect_decl" = yes; then
+echo "$as_me:$LINENO: result: $ice_cv_have_bzero_decl" >&5
+echo "${ECHO_T}$ice_cv_have_bzero_decl" >&6
+if test "$ice_cv_have_bzero_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_CONNECT_DECL 1
+#define HAVE_BZERO_DECL 1
 _ACEOF
 
 fi
 fi
 
+echo "$as_me:$LINENO: checking whether closedir returns void" >&5
+echo $ECHO_N "checking whether closedir returns void... $ECHO_C" >&6
+if test "${ac_cv_func_closedir_void+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "$cross_compiling" = yes; then
+  ac_cv_func_closedir_void=yes
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header_dirent>
+#ifndef __cplusplus
+int closedir ();
+#endif
 
-ice_have_dbm_open=no
+int
+main ()
+{
+exit (closedir (opendir (".")) != 0);
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_closedir_void=no
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-for ac_func in dbm_open
+( exit $ac_status )
+ac_cv_func_closedir_void=yes
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_closedir_void" >&5
+echo "${ECHO_T}$ac_cv_func_closedir_void" >&6
+if test $ac_cv_func_closedir_void = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define CLOSEDIR_VOID 1
+_ACEOF
+
+fi
+
+
+ice_have_closelog=no
+
+for ac_func in closelog
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -39022,21 +46748,21 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_dbm_open=yes
+ ice_have_closelog=yes
 fi
 done
 
-if test "${ice_have_dbm_open}" = yes; then
-echo "$as_me:$LINENO: checking for dbm_open declaration in ${DB_HEADER-no/db/header/file}" >&5
-echo $ECHO_N "checking for dbm_open declaration in ${DB_HEADER-no/db/header/file}... $ECHO_C" >&6
-if test "${ice_cv_have_dbm_open_decl+set}" = set; then
+if test "${ice_have_closelog}" = yes; then
+echo "$as_me:$LINENO: checking for closelog declaration in syslog.h" >&5
+echo $ECHO_N "checking for closelog declaration in syslog.h... $ECHO_C" >&6
+if test "${ice_cv_have_closelog_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_dbm_open_decl=no
+ice_cv_have_closelog_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in ${DB_HEADER-no/db/header/file}; do
+for header in syslog.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -39048,12 +46774,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}dbm_open[      ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_dbm_open_decl=yes
+  $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_dbm_open_decl" = yes; then
+if test "$ice_cv_have_closelog_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -39067,135 +46793,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}dbm_open[      ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_dbm_open_decl=yes
+  $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_dbm_open_decl" = yes; then
+if test "$ice_cv_have_closelog_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_dbm_open_decl" >&5
-echo "${ECHO_T}$ice_cv_have_dbm_open_decl" >&6
-if test "$ice_cv_have_dbm_open_decl" = yes; then
+echo "$as_me:$LINENO: result: $ice_cv_have_closelog_decl" >&5
+echo "${ECHO_T}$ice_cv_have_closelog_decl" >&6
+if test "$ice_cv_have_closelog_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_DBM_OPEN_DECL 1
-_ACEOF
-
-fi
-fi
-
-
-for ac_func in endmntent
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != $ac_func;
-  ;
-  return 0;
-}
+#define HAVE_CLOSELOG_DECL 1
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
 fi
-done
 
 
-ice_have_fclose=no
+ice_have_connect=no
 
-for ac_func in fclose
+for ac_func in connect
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -39292,21 +46916,21 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_fclose=yes
+ ice_have_connect=yes
 fi
 done
 
-if test "${ice_have_fclose}" = yes; then
-echo "$as_me:$LINENO: checking for fclose declaration in stdio.h" >&5
-echo $ECHO_N "checking for fclose declaration in stdio.h... $ECHO_C" >&6
-if test "${ice_cv_have_fclose_decl+set}" = set; then
+if test "${ice_have_connect}" = yes; then
+echo "$as_me:$LINENO: checking for connect declaration in sys/types.h sys/socket.h" >&5
+echo $ECHO_N "checking for connect declaration in sys/types.h sys/socket.h... $ECHO_C" >&6
+if test "${ice_cv_have_connect_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_fclose_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 stdio.h; do
+for header in sys/types.h sys/socket.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -39318,12 +46942,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}fclose[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_fclose_decl=yes
+  $EGREP "${ice_re_word}connect[       ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_connect_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_fclose_decl" = yes; then
+if test "$ice_cv_have_connect_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -39337,33 +46961,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}fclose[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_fclose_decl=yes
+  $EGREP "${ice_re_word}connect[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_connect_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_fclose_decl" = yes; then
+if test "$ice_cv_have_connect_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_fclose_decl" >&5
-echo "${ECHO_T}$ice_cv_have_fclose_decl" >&6
-if test "$ice_cv_have_fclose_decl" = yes; then
+echo "$as_me:$LINENO: result: $ice_cv_have_connect_decl" >&5
+echo "${ECHO_T}$ice_cv_have_connect_decl" >&6
+if test "$ice_cv_have_connect_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_FCLOSE_DECL 1
+#define HAVE_CONNECT_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_fflush=no
+ice_have_dbm_open=no
 
-for ac_func in fflush
+for ac_func in dbm_open
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -39460,21 +47084,21 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_fflush=yes
+ ice_have_dbm_open=yes
 fi
 done
 
-if test "${ice_have_fflush}" = yes; then
-echo "$as_me:$LINENO: checking for fflush declaration in stdio.h" >&5
-echo $ECHO_N "checking for fflush declaration in stdio.h... $ECHO_C" >&6
-if test "${ice_cv_have_fflush_decl+set}" = set; then
+if test "${ice_have_dbm_open}" = yes; then
+echo "$as_me:$LINENO: checking for dbm_open declaration in ${DB_HEADER-no/db/header/file}" >&5
+echo $ECHO_N "checking for dbm_open declaration in ${DB_HEADER-no/db/header/file}... $ECHO_C" >&6
+if test "${ice_cv_have_dbm_open_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_fflush_decl=no
+ice_cv_have_dbm_open_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in stdio.h; do
+for header in ${DB_HEADER-no/db/header/file}; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -39486,12 +47110,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}fflush[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_fflush_decl=yes
+  $EGREP "${ice_re_word}dbm_open[      ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_dbm_open_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_fflush_decl" = yes; then
+if test "$ice_cv_have_dbm_open_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -39505,33 +47129,31 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}fflush[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_fflush_decl=yes
+  $EGREP "${ice_re_word}dbm_open[      ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_dbm_open_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_fflush_decl" = yes; then
+if test "$ice_cv_have_dbm_open_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_fflush_decl" >&5
-echo "${ECHO_T}$ice_cv_have_fflush_decl" >&6
-if test "$ice_cv_have_fflush_decl" = yes; then
+echo "$as_me:$LINENO: result: $ice_cv_have_dbm_open_decl" >&5
+echo "${ECHO_T}$ice_cv_have_dbm_open_decl" >&6
+if test "$ice_cv_have_dbm_open_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_FFLUSH_DECL 1
+#define HAVE_DBM_OPEN_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_flock=no
-
-for ac_func in flock
+for ac_func in endmntent
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -39628,78 +47250,14 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_flock=yes
-fi
-done
-
-if test "${ice_have_flock}" = yes; then
-echo "$as_me:$LINENO: checking for flock declaration in sys/file.h" >&5
-echo $ECHO_N "checking for flock declaration in sys/file.h... $ECHO_C" >&6
-if test "${ice_cv_have_flock_decl+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-ice_cv_have_flock_decl=no
-ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
-ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in sys/file.h; do
-# Check for ordinary declaration
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}flock[         ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_flock_decl=yes
-fi
-rm -f conftest*
-
-if test "$ice_cv_have_flock_decl" = yes; then
-       break
-fi
-# Check for "fixed" declaration like "getpid _PARAMS((int))"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}flock[         ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_flock_decl=yes
-fi
-rm -f conftest*
 
-if test "$ice_cv_have_flock_decl" = yes; then
-       break
 fi
 done
 
-fi
-
-echo "$as_me:$LINENO: result: $ice_cv_have_flock_decl" >&5
-echo "${ECHO_T}$ice_cv_have_flock_decl" >&6
-if test "$ice_cv_have_flock_decl" = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_FLOCK_DECL 1
-_ACEOF
-
-fi
-fi
-
 
-ice_have_fprintf=no
+ice_have_fclose=no
 
-for ac_func in fprintf
+for ac_func in fclose
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -39796,18 +47354,18 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_fprintf=yes
+ ice_have_fclose=yes
 fi
 done
 
-if test "${ice_have_fprintf}" = yes; then
-echo "$as_me:$LINENO: checking for fprintf declaration in stdio.h" >&5
-echo $ECHO_N "checking for fprintf declaration in stdio.h... $ECHO_C" >&6
-if test "${ice_cv_have_fprintf_decl+set}" = set; then
+if test "${ice_have_fclose}" = yes; then
+echo "$as_me:$LINENO: checking for fclose declaration in stdio.h" >&5
+echo $ECHO_N "checking for fclose declaration in stdio.h... $ECHO_C" >&6
+if test "${ice_cv_have_fclose_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_fprintf_decl=no
+ice_cv_have_fclose_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
 for header in stdio.h; do
@@ -39822,12 +47380,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}fprintf[       ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_fprintf_decl=yes
+  $EGREP "${ice_re_word}fclose[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_fclose_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_fprintf_decl" = yes; then
+if test "$ice_cv_have_fclose_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -39841,33 +47399,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}fprintf[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_fprintf_decl=yes
+  $EGREP "${ice_re_word}fclose[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_fclose_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_fprintf_decl" = yes; then
+if test "$ice_cv_have_fclose_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_fprintf_decl" >&5
-echo "${ECHO_T}$ice_cv_have_fprintf_decl" >&6
-if test "$ice_cv_have_fprintf_decl" = yes; then
+echo "$as_me:$LINENO: result: $ice_cv_have_fclose_decl" >&5
+echo "${ECHO_T}$ice_cv_have_fclose_decl" >&6
+if test "$ice_cv_have_fclose_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_FPRINTF_DECL 1
+#define HAVE_FCLOSE_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_fputc=no
+ice_have_fflush=no
 
-for ac_func in fputc
+for ac_func in fflush
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -39964,18 +47522,18 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_fputc=yes
+ ice_have_fflush=yes
 fi
 done
 
-if test "${ice_have_fputc}" = yes; then
-echo "$as_me:$LINENO: checking for fputc declaration in stdio.h" >&5
-echo $ECHO_N "checking for fputc declaration in stdio.h... $ECHO_C" >&6
-if test "${ice_cv_have_fputc_decl+set}" = set; then
+if test "${ice_have_fflush}" = yes; then
+echo "$as_me:$LINENO: checking for fflush declaration in stdio.h" >&5
+echo $ECHO_N "checking for fflush declaration in stdio.h... $ECHO_C" >&6
+if test "${ice_cv_have_fflush_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_fputc_decl=no
+ice_cv_have_fflush_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
 for header in stdio.h; do
@@ -39990,12 +47548,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}fputc[         ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_fputc_decl=yes
+  $EGREP "${ice_re_word}fflush[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_fflush_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_fputc_decl" = yes; then
+if test "$ice_cv_have_fflush_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -40009,33 +47567,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}fputc[         ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_fputc_decl=yes
+  $EGREP "${ice_re_word}fflush[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_fflush_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_fputc_decl" = yes; then
+if test "$ice_cv_have_fflush_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_fputc_decl" >&5
-echo "${ECHO_T}$ice_cv_have_fputc_decl" >&6
-if test "$ice_cv_have_fputc_decl" = yes; then
+echo "$as_me:$LINENO: result: $ice_cv_have_fflush_decl" >&5
+echo "${ECHO_T}$ice_cv_have_fflush_decl" >&6
+if test "$ice_cv_have_fflush_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_FPUTC_DECL 1
+#define HAVE_FFLUSH_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_fputs=no
+ice_have_flock=no
 
-for ac_func in fputs
+for ac_func in flock
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -40132,21 +47690,21 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_fputs=yes
+ ice_have_flock=yes
 fi
 done
 
-if test "${ice_have_fputs}" = yes; then
-echo "$as_me:$LINENO: checking for fputs declaration in stdio.h" >&5
-echo $ECHO_N "checking for fputs declaration in stdio.h... $ECHO_C" >&6
-if test "${ice_cv_have_fputs_decl+set}" = set; then
+if test "${ice_have_flock}" = yes; then
+echo "$as_me:$LINENO: checking for flock declaration in sys/file.h" >&5
+echo $ECHO_N "checking for flock declaration in sys/file.h... $ECHO_C" >&6
+if test "${ice_cv_have_flock_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_fputs_decl=no
+ice_cv_have_flock_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in stdio.h; do
+for header in sys/file.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -40158,12 +47716,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}fputs[         ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_fputs_decl=yes
+  $EGREP "${ice_re_word}flock[         ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_flock_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_fputs_decl" = yes; then
+if test "$ice_cv_have_flock_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -40177,33 +47735,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}fputs[         ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_fputs_decl=yes
+  $EGREP "${ice_re_word}flock[         ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_flock_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_fputs_decl" = yes; then
+if test "$ice_cv_have_flock_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_fputs_decl" >&5
-echo "${ECHO_T}$ice_cv_have_fputs_decl" >&6
-if test "$ice_cv_have_fputs_decl" = yes; then
+echo "$as_me:$LINENO: result: $ice_cv_have_flock_decl" >&5
+echo "${ECHO_T}$ice_cv_have_flock_decl" >&6
+if test "$ice_cv_have_flock_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_FPUTS_DECL 1
+#define HAVE_FLOCK_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_fread=no
+ice_have_fprintf=no
 
-for ac_func in fread
+for ac_func in fprintf
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -40300,21 +47858,21 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_fread=yes
+ ice_have_fprintf=yes
 fi
 done
 
-if test "${ice_have_fread}" = yes; then
-echo "$as_me:$LINENO: checking for fread declaration in stdio.h stdlib.h" >&5
-echo $ECHO_N "checking for fread declaration in stdio.h stdlib.h... $ECHO_C" >&6
-if test "${ice_cv_have_fread_decl+set}" = set; then
+if test "${ice_have_fprintf}" = yes; then
+echo "$as_me:$LINENO: checking for fprintf declaration in stdio.h" >&5
+echo $ECHO_N "checking for fprintf declaration in stdio.h... $ECHO_C" >&6
+if test "${ice_cv_have_fprintf_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_fread_decl=no
+ice_cv_have_fprintf_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in stdio.h stdlib.h; do
+for header in stdio.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -40326,12 +47884,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}fread[         ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_fread_decl=yes
+  $EGREP "${ice_re_word}fprintf[       ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_fprintf_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_fread_decl" = yes; then
+if test "$ice_cv_have_fprintf_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -40345,33 +47903,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}fread[         ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_fread_decl=yes
+  $EGREP "${ice_re_word}fprintf[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_fprintf_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_fread_decl" = yes; then
+if test "$ice_cv_have_fprintf_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_fread_decl" >&5
-echo "${ECHO_T}$ice_cv_have_fread_decl" >&6
-if test "$ice_cv_have_fread_decl" = yes; then
+echo "$as_me:$LINENO: result: $ice_cv_have_fprintf_decl" >&5
+echo "${ECHO_T}$ice_cv_have_fprintf_decl" >&6
+if test "$ice_cv_have_fprintf_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_FREAD_DECL 1
+#define HAVE_FPRINTF_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_fseek=no
+ice_have_fputc=no
 
-for ac_func in fseek
+for ac_func in fputc
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -40468,18 +48026,18 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_fseek=yes
+ ice_have_fputc=yes
 fi
 done
 
-if test "${ice_have_fseek}" = yes; then
-echo "$as_me:$LINENO: checking for fseek declaration in stdio.h" >&5
-echo $ECHO_N "checking for fseek declaration in stdio.h... $ECHO_C" >&6
-if test "${ice_cv_have_fseek_decl+set}" = set; then
+if test "${ice_have_fputc}" = yes; then
+echo "$as_me:$LINENO: checking for fputc declaration in stdio.h" >&5
+echo $ECHO_N "checking for fputc declaration in stdio.h... $ECHO_C" >&6
+if test "${ice_cv_have_fputc_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_fseek_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 stdio.h; do
@@ -40494,12 +48052,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}fseek[         ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_fseek_decl=yes
+  $EGREP "${ice_re_word}fputc[         ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_fputc_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_fseek_decl" = yes; then
+if test "$ice_cv_have_fputc_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -40513,33 +48071,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}fseek[         ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_fseek_decl=yes
+  $EGREP "${ice_re_word}fputc[         ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_fputc_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_fseek_decl" = yes; then
+if test "$ice_cv_have_fputc_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_fseek_decl" >&5
-echo "${ECHO_T}$ice_cv_have_fseek_decl" >&6
-if test "$ice_cv_have_fseek_decl" = yes; then
+echo "$as_me:$LINENO: result: $ice_cv_have_fputc_decl" >&5
+echo "${ECHO_T}$ice_cv_have_fputc_decl" >&6
+if test "$ice_cv_have_fputc_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_FSEEK_DECL 1
+#define HAVE_FPUTC_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_fwrite=no
+ice_have_fputs=no
 
-for ac_func in fwrite
+for ac_func in fputs
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -40636,21 +48194,21 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_fwrite=yes
+ ice_have_fputs=yes
 fi
 done
 
-if test "${ice_have_fwrite}" = yes; then
-echo "$as_me:$LINENO: checking for fwrite declaration in stdio.h stdlib.h" >&5
-echo $ECHO_N "checking for fwrite declaration in stdio.h stdlib.h... $ECHO_C" >&6
-if test "${ice_cv_have_fwrite_decl+set}" = set; then
+if test "${ice_have_fputs}" = yes; then
+echo "$as_me:$LINENO: checking for fputs declaration in stdio.h" >&5
+echo $ECHO_N "checking for fputs declaration in stdio.h... $ECHO_C" >&6
+if test "${ice_cv_have_fputs_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_fwrite_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 stdio.h stdlib.h; do
+for header in stdio.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -40662,12 +48220,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}fwrite[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_fwrite_decl=yes
+  $EGREP "${ice_re_word}fputs[         ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_fputs_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_fwrite_decl" = yes; then
+if test "$ice_cv_have_fputs_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -40681,143 +48239,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}fwrite[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_fwrite_decl=yes
+  $EGREP "${ice_re_word}fputs[         ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_fputs_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_fwrite_decl" = yes; then
+if test "$ice_cv_have_fputs_decl" = yes; then
        break
 fi
 done
 
-fi
-
-echo "$as_me:$LINENO: result: $ice_cv_have_fwrite_decl" >&5
-echo "${ECHO_T}$ice_cv_have_fwrite_decl" >&6
-if test "$ice_cv_have_fwrite_decl" = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_FWRITE_DECL 1
-_ACEOF
-
-fi
-fi
-
-
-for ac_func in getcwd
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != $ac_func;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
+fi
 
-else
-  case $LIBOBJS in
-    "$ac_func.$ac_objext"   | \
-  *" $ac_func.$ac_objext"   | \
-    "$ac_func.$ac_objext "* | \
-  *" $ac_func.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;;
-esac
+echo "$as_me:$LINENO: result: $ice_cv_have_fputs_decl" >&5
+echo "${ECHO_T}$ice_cv_have_fputs_decl" >&6
+if test "$ice_cv_have_fputs_decl" = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_FPUTS_DECL 1
+_ACEOF
 
 fi
-done
+fi
 
 
+ice_have_fread=no
 
-for ac_func in getfsent
+for ac_func in fread
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -40914,14 +48362,78 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
+ ice_have_fread=yes
+fi
+done
+
+if test "${ice_have_fread}" = yes; then
+echo "$as_me:$LINENO: checking for fread declaration in stdio.h stdlib.h" >&5
+echo $ECHO_N "checking for fread declaration in stdio.h stdlib.h... $ECHO_C" >&6
+if test "${ice_cv_have_fread_decl+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ice_cv_have_fread_decl=no
+ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
+ice_re_word='(^|[^a-zA-Z0-9_])'
+for header in stdio.h stdlib.h; do
+# Check for ordinary declaration
+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}fread[         ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_fread_decl=yes
+fi
+rm -f conftest*
+
+if test "$ice_cv_have_fread_decl" = yes; then
+       break
+fi
+# 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}fread[         ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_fread_decl=yes
+fi
+rm -f conftest*
 
+if test "$ice_cv_have_fread_decl" = yes; then
+       break
 fi
 done
 
+fi
 
-ice_have_gethostname=no
+echo "$as_me:$LINENO: result: $ice_cv_have_fread_decl" >&5
+echo "${ECHO_T}$ice_cv_have_fread_decl" >&6
+if test "$ice_cv_have_fread_decl" = yes; then
 
-for ac_func in gethostname
+cat >>confdefs.h <<_ACEOF
+#define HAVE_FREAD_DECL 1
+_ACEOF
+
+fi
+fi
+
+
+ice_have_fseek=no
+
+for ac_func in fseek
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -41018,21 +48530,21 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_gethostname=yes
+ ice_have_fseek=yes
 fi
 done
 
-if test "${ice_have_gethostname}" = yes; then
-echo "$as_me:$LINENO: checking for gethostname declaration in unistd.h" >&5
-echo $ECHO_N "checking for gethostname declaration in unistd.h... $ECHO_C" >&6
-if test "${ice_cv_have_gethostname_decl+set}" = set; then
+if test "${ice_have_fseek}" = yes; then
+echo "$as_me:$LINENO: checking for fseek declaration in stdio.h" >&5
+echo $ECHO_N "checking for fseek declaration in stdio.h... $ECHO_C" >&6
+if test "${ice_cv_have_fseek_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_gethostname_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 unistd.h; do
+for header in stdio.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -41044,12 +48556,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}gethostname[   ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_gethostname_decl=yes
+  $EGREP "${ice_re_word}fseek[         ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_fseek_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_gethostname_decl" = yes; then
+if test "$ice_cv_have_fseek_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -41063,55 +48575,87 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}gethostname[   ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_gethostname_decl=yes
+  $EGREP "${ice_re_word}fseek[         ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_fseek_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_gethostname_decl" = yes; then
+if test "$ice_cv_have_fseek_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_gethostname_decl" >&5
-echo "${ECHO_T}$ice_cv_have_gethostname_decl" >&6
-if test "$ice_cv_have_gethostname_decl" = yes; then
+echo "$as_me:$LINENO: result: $ice_cv_have_fseek_decl" >&5
+echo "${ECHO_T}$ice_cv_have_fseek_decl" >&6
+if test "$ice_cv_have_fseek_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_GETHOSTNAME_DECL 1
+#define HAVE_FSEEK_DECL 1
 _ACEOF
 
 fi
 fi
 
-# getmntent is in -lsun on Irix 4, -lseq on Dynix/PTX, -lgen on Unixware.
-echo "$as_me:$LINENO: checking for getmntent in -lsun" >&5
-echo $ECHO_N "checking for getmntent in -lsun... $ECHO_C" >&6
-if test "${ac_cv_lib_sun_getmntent+set}" = set; then
+
+ice_have_fwrite=no
+
+for ac_func in fwrite
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&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 gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
+{
 #endif
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
-char getmntent ();
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
 int
 main ()
 {
-getmntent ();
+return f != $ac_func;
   ;
   return 0;
 }
@@ -41138,163 +48682,92 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_sun_getmntent=yes
+  eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_lib_sun_getmntent=no
+eval "$as_ac_var=no"
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_sun_getmntent" >&5
-echo "${ECHO_T}$ac_cv_lib_sun_getmntent" >&6
-if test $ac_cv_lib_sun_getmntent = yes; then
-  LIBS="-lsun $LIBS"
-else
-  echo "$as_me:$LINENO: checking for getmntent in -lseq" >&5
-echo $ECHO_N "checking for getmntent in -lseq... $ECHO_C" >&6
-if test "${ac_cv_lib_seq_getmntent+set}" = set; then
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+ ice_have_fwrite=yes
+fi
+done
+
+if test "${ice_have_fwrite}" = yes; then
+echo "$as_me:$LINENO: checking for fwrite declaration in stdio.h stdlib.h" >&5
+echo $ECHO_N "checking for fwrite declaration in stdio.h stdlib.h... $ECHO_C" >&6
+if test "${ice_cv_have_fwrite_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lseq  $LIBS"
+
+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>
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char getmntent ();
-int
-main ()
-{
-getmntent ();
-  ;
-  return 0;
-}
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_seq_getmntent=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_seq_getmntent=no
+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.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+rm -f conftest*
+
+if test "$ice_cv_have_fwrite_decl" = yes; then
+       break
 fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_seq_getmntent" >&5
-echo "${ECHO_T}$ac_cv_lib_seq_getmntent" >&6
-if test $ac_cv_lib_seq_getmntent = yes; then
-  LIBS="-lseq $LIBS"
-else
-  echo "$as_me:$LINENO: checking for getmntent in -lgen" >&5
-echo $ECHO_N "checking for getmntent in -lgen... $ECHO_C" >&6
-if test "${ac_cv_lib_gen_getmntent+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lgen  $LIBS"
+# 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>
 
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char getmntent ();
-int
-main ()
-{
-getmntent ();
-  ;
-  return 0;
-}
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_gen_getmntent=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_gen_getmntent=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
+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
-echo "$as_me:$LINENO: result: $ac_cv_lib_gen_getmntent" >&5
-echo "${ECHO_T}$ac_cv_lib_gen_getmntent" >&6
-if test $ac_cv_lib_gen_getmntent = yes; then
-  LIBS="-lgen $LIBS"
+rm -f conftest*
+
+if test "$ice_cv_have_fwrite_decl" = yes; then
+       break
 fi
+done
 
 fi
 
+echo "$as_me:$LINENO: result: $ice_cv_have_fwrite_decl" >&5
+echo "${ECHO_T}$ice_cv_have_fwrite_decl" >&6
+if test "$ice_cv_have_fwrite_decl" = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_FWRITE_DECL 1
+_ACEOF
+
+fi
 fi
 
 
-for ac_func in getmntent
+for ac_func in getfsent
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
 done
 
 
+ice_have_gethostname=no
 
-ice_have_getopt=no
-
-for ac_func in getopt
+for ac_func in gethostname
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -41496,21 +48968,21 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_getopt=yes
+ ice_have_gethostname=yes
 fi
 done
 
-if test "${ice_have_getopt}" = yes; then
-echo "$as_me:$LINENO: checking for getopt declaration in stdlib.h unistd.h libc.h" >&5
-echo $ECHO_N "checking for getopt declaration in stdlib.h unistd.h libc.h... $ECHO_C" >&6
-if test "${ice_cv_have_getopt_decl+set}" = set; then
+if test "${ice_have_gethostname}" = yes; then
+echo "$as_me:$LINENO: checking for gethostname declaration in unistd.h" >&5
+echo $ECHO_N "checking for gethostname declaration in unistd.h... $ECHO_C" >&6
+if test "${ice_cv_have_gethostname_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_getopt_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 stdlib.h unistd.h libc.h; do
+for header in unistd.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -41522,12 +48994,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}getopt[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_getopt_decl=yes
+  $EGREP "${ice_re_word}gethostname[   ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_gethostname_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_getopt_decl" = yes; then
+if test "$ice_cv_have_gethostname_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -41541,87 +49013,55 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}getopt[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_getopt_decl=yes
+  $EGREP "${ice_re_word}gethostname[   ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_gethostname_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_getopt_decl" = yes; then
+if test "$ice_cv_have_gethostname_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_getopt_decl" >&5
-echo "${ECHO_T}$ice_cv_have_getopt_decl" >&6
-if test "$ice_cv_have_getopt_decl" = yes; then
+echo "$as_me:$LINENO: result: $ice_cv_have_gethostname_decl" >&5
+echo "${ECHO_T}$ice_cv_have_gethostname_decl" >&6
+if test "$ice_cv_have_gethostname_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_GETOPT_DECL 1
+#define HAVE_GETHOSTNAME_DECL 1
 _ACEOF
 
 fi
 fi
 
-
-ice_have_getpeername=no
-
-for ac_func in getpeername
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+# getmntent is in -lsun on Irix 4, -lseq on Dynix/PTX, -lgen on Unixware.
+echo "$as_me:$LINENO: checking for getmntent in -lsun" >&5
+echo $ECHO_N "checking for getmntent in -lsun... $ECHO_C" >&6
+if test "${ac_cv_lib_sun_getmntent+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsun  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
 
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
-{
 #endif
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
+char getmntent ();
 int
 main ()
 {
-return f != $ac_func;
+getmntent ();
   ;
   return 0;
 }
@@ -41643,151 +49083,52 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
         { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
- ice_have_getpeername=yes
-fi
-done
-
-if test "${ice_have_getpeername}" = yes; then
-echo "$as_me:$LINENO: checking for getpeername declaration in sys/types.h sys/socket.h" >&5
-echo $ECHO_N "checking for getpeername declaration in sys/types.h sys/socket.h... $ECHO_C" >&6
-if test "${ice_cv_have_getpeername_decl+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-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 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}getpeername[   ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_getpeername_decl=yes
-fi
-rm -f conftest*
-
-if test "$ice_cv_have_getpeername_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}getpeername[   ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_getpeername_decl=yes
-fi
-rm -f conftest*
-
-if test "$ice_cv_have_getpeername_decl" = yes; then
-       break
-fi
-done
-
-fi
-
-echo "$as_me:$LINENO: result: $ice_cv_have_getpeername_decl" >&5
-echo "${ECHO_T}$ice_cv_have_getpeername_decl" >&6
-if test "$ice_cv_have_getpeername_decl" = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_GETPEERNAME_DECL 1
-_ACEOF
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_lib_sun_getmntent=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+ac_cv_lib_sun_getmntent=no
 fi
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-
-
-for ac_func in getpgrp
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: result: $ac_cv_lib_sun_getmntent" >&5
+echo "${ECHO_T}$ac_cv_lib_sun_getmntent" >&6
+if test $ac_cv_lib_sun_getmntent = yes; then
+  LIBS="-lsun $LIBS"
+else
+  echo "$as_me:$LINENO: checking for getmntent in -lseq" >&5
+echo $ECHO_N "checking for getmntent in -lseq... $ECHO_C" >&6
+if test "${ac_cv_lib_seq_getmntent+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lseq  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
 
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
-{
 #endif
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
+char getmntent ();
 int
 main ()
 {
-return f != $ac_func;
+getmntent ();
   ;
   return 0;
 }
@@ -41814,50 +49155,54 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  ac_cv_lib_seq_getmntent=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+ac_cv_lib_seq_getmntent=no
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-echo "$as_me:$LINENO: checking whether getpgrp requires zero arguments" >&5
-echo $ECHO_N "checking whether getpgrp requires zero arguments... $ECHO_C" >&6
-if test "${ac_cv_func_getpgrp_void+set}" = set; then
+echo "$as_me:$LINENO: result: $ac_cv_lib_seq_getmntent" >&5
+echo "${ECHO_T}$ac_cv_lib_seq_getmntent" >&6
+if test $ac_cv_lib_seq_getmntent = yes; then
+  LIBS="-lseq $LIBS"
+else
+  echo "$as_me:$LINENO: checking for getmntent in -lgen" >&5
+echo $ECHO_N "checking for getmntent in -lgen... $ECHO_C" >&6
+if test "${ac_cv_lib_gen_getmntent+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  # Use it with a single arg.
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lgen  $LIBS"
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-$ac_includes_default
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char getmntent ();
 int
 main ()
 {
-getpgrp (0);
+getmntent ();
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -41871,36 +49216,35 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
+        { ac_try='test -s conftest$ac_exeext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_func_getpgrp_void=no
+  ac_cv_lib_gen_getmntent=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_func_getpgrp_void=yes
+ac_cv_lib_gen_getmntent=no
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_gen_getmntent" >&5
+echo "${ECHO_T}$ac_cv_lib_gen_getmntent" >&6
+if test $ac_cv_lib_gen_getmntent = yes; then
+  LIBS="-lgen $LIBS"
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_getpgrp_void" >&5
-echo "${ECHO_T}$ac_cv_func_getpgrp_void" >&6
-if test $ac_cv_func_getpgrp_void = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define GETPGRP_VOID 1
-_ACEOF
 
 fi
 
+fi
 
-ice_have_getsockname=no
 
-for ac_func in getsockname
+for ac_func in getmntent
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -41997,78 +49341,15 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_getsockname=yes
-fi
-done
-
-if test "${ice_have_getsockname}" = yes; then
-echo "$as_me:$LINENO: checking for getsockname declaration in sys/types.h sys/socket.h" >&5
-echo $ECHO_N "checking for getsockname declaration in sys/types.h sys/socket.h... $ECHO_C" >&6
-if test "${ice_cv_have_getsockname_decl+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-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
-# 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}getsockname[   ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_getsockname_decl=yes
-fi
-rm -f conftest*
-
-if test "$ice_cv_have_getsockname_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}getsockname[   ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_getsockname_decl=yes
-fi
-rm -f conftest*
 
-if test "$ice_cv_have_getsockname_decl" = yes; then
-       break
 fi
 done
 
-fi
-
-echo "$as_me:$LINENO: result: $ice_cv_have_getsockname_decl" >&5
-echo "${ECHO_T}$ice_cv_have_getsockname_decl" >&6
-if test "$ice_cv_have_getsockname_decl" = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_GETSOCKNAME_DECL 1
-_ACEOF
-
-fi
-fi
 
 
-ice_have_getsockopt=no
+ice_have_getopt=no
 
-for ac_func in getsockopt
+for ac_func in getopt
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -42165,21 +49446,21 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_getsockopt=yes
+ ice_have_getopt=yes
 fi
 done
 
-if test "${ice_have_getsockopt}" = yes; then
-echo "$as_me:$LINENO: checking for getsockopt declaration in sys/types.h sys/socket.h" >&5
-echo $ECHO_N "checking for getsockopt declaration in sys/types.h sys/socket.h... $ECHO_C" >&6
-if test "${ice_cv_have_getsockopt_decl+set}" = set; then
+if test "${ice_have_getopt}" = yes; then
+echo "$as_me:$LINENO: checking for getopt declaration in stdlib.h unistd.h libc.h" >&5
+echo $ECHO_N "checking for getopt declaration in stdlib.h unistd.h libc.h... $ECHO_C" >&6
+if test "${ice_cv_have_getopt_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_getsockopt_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 sys/types.h sys/socket.h; do
+for header in stdlib.h unistd.h libc.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -42191,12 +49472,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}getsockopt[    ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_getsockopt_decl=yes
+  $EGREP "${ice_re_word}getopt[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_getopt_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_getsockopt_decl" = yes; then
+if test "$ice_cv_have_getopt_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -42210,33 +49491,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}getsockopt[    ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_getsockopt_decl=yes
+  $EGREP "${ice_re_word}getopt[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_getopt_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_getsockopt_decl" = yes; then
+if test "$ice_cv_have_getopt_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_getsockopt_decl" >&5
-echo "${ECHO_T}$ice_cv_have_getsockopt_decl" >&6
-if test "$ice_cv_have_getsockopt_decl" = yes; then
+echo "$as_me:$LINENO: result: $ice_cv_have_getopt_decl" >&5
+echo "${ECHO_T}$ice_cv_have_getopt_decl" >&6
+if test "$ice_cv_have_getopt_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_GETSOCKOPT_DECL 1
+#define HAVE_GETOPT_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_gettimeofday=no
+ice_have_getpeername=no
 
-for ac_func in gettimeofday
+for ac_func in getpeername
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -42333,21 +49614,21 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_gettimeofday=yes
+ ice_have_getpeername=yes
 fi
 done
 
-if test "${ice_have_gettimeofday}" = yes; then
-echo "$as_me:$LINENO: checking for gettimeofday declaration in time.h sys/time.h" >&5
-echo $ECHO_N "checking for gettimeofday declaration in time.h sys/time.h... $ECHO_C" >&6
-if test "${ice_cv_have_gettimeofday_decl+set}" = set; then
+if test "${ice_have_getpeername}" = yes; then
+echo "$as_me:$LINENO: checking for getpeername declaration in sys/types.h sys/socket.h" >&5
+echo $ECHO_N "checking for getpeername declaration in sys/types.h sys/socket.h... $ECHO_C" >&6
+if test "${ice_cv_have_getpeername_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_gettimeofday_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 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.  */
@@ -42359,12 +49640,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}gettimeofday[  ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_gettimeofday_decl=yes
+  $EGREP "${ice_re_word}getpeername[   ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_getpeername_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_gettimeofday_decl" = yes; then
+if test "$ice_cv_have_getpeername_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -42378,116 +49659,31 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}gettimeofday[  ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_gettimeofday_decl=yes
+  $EGREP "${ice_re_word}getpeername[   ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_getpeername_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_gettimeofday_decl" = yes; then
+if test "$ice_cv_have_getpeername_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_gettimeofday_decl" >&5
-echo "${ECHO_T}$ice_cv_have_gettimeofday_decl" >&6
-if test "$ice_cv_have_gettimeofday_decl" = yes; then
+echo "$as_me:$LINENO: result: $ice_cv_have_getpeername_decl" >&5
+echo "${ECHO_T}$ice_cv_have_getpeername_decl" >&6
+if test "$ice_cv_have_getpeername_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_GETTIMEOFDAY_DECL 1
-_ACEOF
-
-fi
-fi
-
-
-
-       echo "$as_me:$LINENO: checking for gettimeofday number of arguments" >&5
-echo $ECHO_N "checking for gettimeofday number of arguments... $ECHO_C" >&6
-if test "${amanda_cv_gettimeofday_args+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-               cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-#ifdef 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
-
-int
-main ()
-{
-
-                       struct timeval val;
-                       struct timezone zone;
-                       gettimeofday(&val, &zone);
-
-  ;
-  return 0;
-}
+#define HAVE_GETPEERNAME_DECL 1
 _ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  amanda_cv_gettimeofday_args=2
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-amanda_cv_gettimeofday_args=1
 
 fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-
-
 fi
-echo "$as_me:$LINENO: result: $amanda_cv_gettimeofday_args" >&5
-echo "${ECHO_T}$amanda_cv_gettimeofday_args" >&6
-       if test "$amanda_cv_gettimeofday_args" = 2; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_TWO_ARG_GETTIMEOFDAY 1
-_ACEOF
-
-       fi
 
 
-
-
-
-for ac_func in getvfsent initgroups isascii
+for ac_func in getpgrp
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -42588,71 +49784,30 @@ _ACEOF
 fi
 done
 
-
-ice_have_initgroups=no
-
-for ac_func in initgroups
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking whether getpgrp requires zero arguments" >&5
+echo $ECHO_N "checking whether getpgrp requires zero arguments... $ECHO_C" >&6
+if test "${ac_cv_func_getpgrp_void+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+  # 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.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
+$ac_includes_default
 int
 main ()
 {
-return f != $ac_func;
+getpgrp (0);
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -42666,100 +49821,36 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  ac_cv_func_getpgrp_void=no
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
- ice_have_initgroups=yes
-fi
-done
-
-if test "${ice_have_initgroups}" = yes; then
-echo "$as_me:$LINENO: checking for initgroups declaration in grp.h sys/types.h unistd.h libc.h" >&5
-echo $ECHO_N "checking for initgroups declaration in grp.h sys/types.h unistd.h libc.h... $ECHO_C" >&6
-if test "${ice_cv_have_initgroups_decl+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-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 grp.h sys/types.h unistd.h libc.h; do
-# Check for ordinary declaration
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}initgroups[    ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_initgroups_decl=yes
-fi
-rm -f conftest*
-
-if test "$ice_cv_have_initgroups_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}initgroups[    ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_initgroups_decl=yes
-fi
-rm -f conftest*
-
-if test "$ice_cv_have_initgroups_decl" = yes; then
-       break
+ac_cv_func_getpgrp_void=yes
 fi
-done
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 
 fi
+echo "$as_me:$LINENO: result: $ac_cv_func_getpgrp_void" >&5
+echo "${ECHO_T}$ac_cv_func_getpgrp_void" >&6
+if test $ac_cv_func_getpgrp_void = yes; then
 
-echo "$as_me:$LINENO: result: $ice_cv_have_initgroups_decl" >&5
-echo "${ECHO_T}$ice_cv_have_initgroups_decl" >&6
-if test "$ice_cv_have_initgroups_decl" = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_INITGROUPS_DECL 1
+cat >>confdefs.h <<\_ACEOF
+#define GETPGRP_VOID 1
 _ACEOF
 
 fi
-fi
 
 
-ice_have_ioctl=no
+ice_have_getsockname=no
 
-for ac_func in ioctl
+for ac_func in getsockname
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -42856,21 +49947,21 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_ioctl=yes
+ ice_have_getsockname=yes
 fi
 done
 
-if test "${ice_have_ioctl}" = yes; then
-echo "$as_me:$LINENO: checking for ioctl declaration in sys/ioctl.h unistd.h libc.h" >&5
-echo $ECHO_N "checking for ioctl declaration in sys/ioctl.h unistd.h libc.h... $ECHO_C" >&6
-if test "${ice_cv_have_ioctl_decl+set}" = set; then
+if test "${ice_have_getsockname}" = yes; then
+echo "$as_me:$LINENO: checking for getsockname declaration in sys/types.h sys/socket.h" >&5
+echo $ECHO_N "checking for getsockname declaration in sys/types.h sys/socket.h... $ECHO_C" >&6
+if test "${ice_cv_have_getsockname_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_ioctl_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/ioctl.h unistd.h libc.h; do
+for header in sys/types.h sys/socket.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -42882,12 +49973,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}ioctl[         ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_ioctl_decl=yes
+  $EGREP "${ice_re_word}getsockname[   ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_getsockname_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_ioctl_decl" = yes; then
+if test "$ice_cv_have_getsockname_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -42901,33 +49992,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}ioctl[         ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_ioctl_decl=yes
+  $EGREP "${ice_re_word}getsockname[   ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_getsockname_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_ioctl_decl" = yes; then
+if test "$ice_cv_have_getsockname_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_ioctl_decl" >&5
-echo "${ECHO_T}$ice_cv_have_ioctl_decl" >&6
-if test "$ice_cv_have_ioctl_decl" = yes; then
+echo "$as_me:$LINENO: result: $ice_cv_have_getsockname_decl" >&5
+echo "${ECHO_T}$ice_cv_have_getsockname_decl" >&6
+if test "$ice_cv_have_getsockname_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_IOCTL_DECL 1
+#define HAVE_GETSOCKNAME_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_isnormal=no
+ice_have_getsockopt=no
 
-for ac_func in isnormal
+for ac_func in getsockopt
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -43024,21 +50115,21 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_isnormal=yes
+ ice_have_getsockopt=yes
 fi
 done
 
-if test "${ice_have_isnormal}" = yes; then
-echo "$as_me:$LINENO: checking for isnormal declaration in math.h" >&5
-echo $ECHO_N "checking for isnormal declaration in math.h... $ECHO_C" >&6
-if test "${ice_cv_have_isnormal_decl+set}" = set; then
+if test "${ice_have_getsockopt}" = yes; then
+echo "$as_me:$LINENO: checking for getsockopt declaration in sys/types.h sys/socket.h" >&5
+echo $ECHO_N "checking for getsockopt declaration in sys/types.h sys/socket.h... $ECHO_C" >&6
+if test "${ice_cv_have_getsockopt_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_isnormal_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 math.h; do
+for header in sys/types.h sys/socket.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -43050,12 +50141,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}isnormal[      ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_isnormal_decl=yes
+  $EGREP "${ice_re_word}getsockopt[    ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_getsockopt_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_isnormal_decl" = yes; then
+if test "$ice_cv_have_getsockopt_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -43069,33 +50160,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}isnormal[      ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_isnormal_decl=yes
+  $EGREP "${ice_re_word}getsockopt[    ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_getsockopt_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_isnormal_decl" = yes; then
+if test "$ice_cv_have_getsockopt_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_isnormal_decl" >&5
-echo "${ECHO_T}$ice_cv_have_isnormal_decl" >&6
-if test "$ice_cv_have_isnormal_decl" = yes; then
+echo "$as_me:$LINENO: result: $ice_cv_have_getsockopt_decl" >&5
+echo "${ECHO_T}$ice_cv_have_getsockopt_decl" >&6
+if test "$ice_cv_have_getsockopt_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_ISNORMAL_DECL 1
+#define HAVE_GETSOCKOPT_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_listen=no
+ice_have_gettimeofday=no
 
-for ac_func in listen
+for ac_func in gettimeofday
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -43192,21 +50283,21 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_listen=yes
+ ice_have_gettimeofday=yes
 fi
 done
 
-if test "${ice_have_listen}" = yes; then
-echo "$as_me:$LINENO: checking for listen declaration in sys/types.h sys/socket.h" >&5
-echo $ECHO_N "checking for listen declaration in sys/types.h sys/socket.h... $ECHO_C" >&6
-if test "${ice_cv_have_listen_decl+set}" = set; then
+if test "${ice_have_gettimeofday}" = yes; then
+echo "$as_me:$LINENO: checking for gettimeofday declaration in time.h sys/time.h" >&5
+echo $ECHO_N "checking for gettimeofday declaration in time.h sys/time.h... $ECHO_C" >&6
+if test "${ice_cv_have_gettimeofday_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_listen_decl=no
+ice_cv_have_gettimeofday_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.  */
@@ -43218,12 +50309,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}listen[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_listen_decl=yes
+  $EGREP "${ice_re_word}gettimeofday[  ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_gettimeofday_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_listen_decl" = yes; then
+if test "$ice_cv_have_gettimeofday_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -43237,94 +50328,70 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}listen[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_listen_decl=yes
+  $EGREP "${ice_re_word}gettimeofday[  ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_gettimeofday_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_listen_decl" = yes; then
+if test "$ice_cv_have_gettimeofday_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_listen_decl" >&5
-echo "${ECHO_T}$ice_cv_have_listen_decl" >&6
-if test "$ice_cv_have_listen_decl" = yes; then
+echo "$as_me:$LINENO: result: $ice_cv_have_gettimeofday_decl" >&5
+echo "${ECHO_T}$ice_cv_have_gettimeofday_decl" >&6
+if test "$ice_cv_have_gettimeofday_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_LISTEN_DECL 1
+#define HAVE_GETTIMEOFDAY_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_lstat=no
 
-for ac_func in lstat
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+       echo "$as_me:$LINENO: checking for gettimeofday number of arguments" >&5
+echo $ECHO_N "checking for gettimeofday number of arguments... $ECHO_C" >&6
+if test "${amanda_cv_gettimeofday_args+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+
+               cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
 
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
+#ifdef TIME_WITH_SYS_TIME
+#  include <sys/time.h>
+#  include <time.h>
 #else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
+#  ifdef HAVE_SYS_TIME_H
+#    include <sys/time.h>
+#  else
+#    include <time.h>
+#  endif
 #endif
 
 int
 main ()
 {
-return f != $ac_func;
+
+                       struct timeval val;
+                       struct timezone zone;
+                       gettimeofday(&val, &zone);
+
   ;
   return 0;
 }
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
   ac_status=$?
   grep -v '^ *+' conftest.er1 >conftest.err
   rm -f conftest.er1
@@ -43338,100 +50405,39 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
+        { ac_try='test -s conftest.$ac_objext'
   { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  amanda_cv_gettimeofday_args=2
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
- ice_have_lstat=yes
-fi
-done
-
-if test "${ice_have_lstat}" = yes; then
-echo "$as_me:$LINENO: checking for lstat declaration in sys/types.h sys/stat.h" >&5
-echo $ECHO_N "checking for lstat declaration in sys/types.h sys/stat.h... $ECHO_C" >&6
-if test "${ice_cv_have_lstat_decl+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-ice_cv_have_lstat_decl=no
-ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
-ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in sys/types.h sys/stat.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}lstat[         ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_lstat_decl=yes
-fi
-rm -f conftest*
+amanda_cv_gettimeofday_args=1
 
-if test "$ice_cv_have_lstat_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>
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
 
-_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
-fi
-rm -f conftest*
 
-if test "$ice_cv_have_lstat_decl" = yes; then
-       break
 fi
-done
+echo "$as_me:$LINENO: result: $amanda_cv_gettimeofday_args" >&5
+echo "${ECHO_T}$amanda_cv_gettimeofday_args" >&6
+       if test "$amanda_cv_gettimeofday_args" = 2; then
 
-fi
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_TWO_ARG_GETTIMEOFDAY 1
+_ACEOF
 
-echo "$as_me:$LINENO: result: $ice_cv_have_lstat_decl" >&5
-echo "${ECHO_T}$ice_cv_have_lstat_decl" >&6
-if test "$ice_cv_have_lstat_decl" = yes; then
+       fi
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_LSTAT_DECL 1
-_ACEOF
 
-fi
-fi
 
 
-ice_have_malloc=no
 
-for ac_func in malloc
+for ac_func in getvfsent initgroups isascii
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -43528,76 +50534,14 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_malloc=yes
-fi
-done
-
-if test "${ice_have_malloc}" = yes; then
-echo "$as_me:$LINENO: checking for malloc declaration in stdlib.h" >&5
-echo $ECHO_N "checking for malloc declaration in stdlib.h... $ECHO_C" >&6
-if test "${ice_cv_have_malloc_decl+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
 
-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 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}malloc[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_malloc_decl=yes
-fi
-rm -f conftest*
-
-if test "$ice_cv_have_malloc_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}malloc[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_malloc_decl=yes
-fi
-rm -f conftest*
-
-if test "$ice_cv_have_malloc_decl" = yes; then
-       break
 fi
 done
 
-fi
-
-echo "$as_me:$LINENO: result: $ice_cv_have_malloc_decl" >&5
-echo "${ECHO_T}$ice_cv_have_malloc_decl" >&6
-if test "$ice_cv_have_malloc_decl" = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_MALLOC_DECL 1
-_ACEOF
-
-fi
-fi
 
+ice_have_initgroups=no
 
-for ac_func in memmove
+for ac_func in initgroups
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -43694,24 +50638,78 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
+ ice_have_initgroups=yes
+fi
+done
 
+if test "${ice_have_initgroups}" = yes; then
+echo "$as_me:$LINENO: checking for initgroups declaration in grp.h sys/types.h unistd.h libc.h" >&5
+echo $ECHO_N "checking for initgroups declaration in grp.h sys/types.h unistd.h libc.h... $ECHO_C" >&6
+if test "${ice_cv_have_initgroups_decl+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case $LIBOBJS in
-    "$ac_func.$ac_objext"   | \
-  *" $ac_func.$ac_objext"   | \
-    "$ac_func.$ac_objext "* | \
-  *" $ac_func.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;;
-esac
 
+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 grp.h sys/types.h unistd.h libc.h; do
+# Check for ordinary declaration
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$header>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}initgroups[    ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_initgroups_decl=yes
+fi
+rm -f conftest*
+
+if test "$ice_cv_have_initgroups_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}initgroups[    ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_initgroups_decl=yes
+fi
+rm -f conftest*
+
+if test "$ice_cv_have_initgroups_decl" = yes; then
+       break
 fi
 done
 
+fi
+
+echo "$as_me:$LINENO: result: $ice_cv_have_initgroups_decl" >&5
+echo "${ECHO_T}$ice_cv_have_initgroups_decl" >&6
+if test "$ice_cv_have_initgroups_decl" = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_INITGROUPS_DECL 1
+_ACEOF
 
+fi
+fi
 
-ice_have_memmove=no
 
-for ac_func in memmove
+ice_have_ioctl=no
+
+for ac_func in ioctl
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -43808,21 +50806,21 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_memmove=yes
+ ice_have_ioctl=yes
 fi
 done
 
-if test "${ice_have_memmove}" = yes; then
-echo "$as_me:$LINENO: checking for memmove declaration in string.h strings.h" >&5
-echo $ECHO_N "checking for memmove declaration in string.h strings.h... $ECHO_C" >&6
-if test "${ice_cv_have_memmove_decl+set}" = set; then
+if test "${ice_have_ioctl}" = yes; then
+echo "$as_me:$LINENO: checking for ioctl declaration in sys/ioctl.h unistd.h libc.h" >&5
+echo $ECHO_N "checking for ioctl declaration in sys/ioctl.h unistd.h libc.h... $ECHO_C" >&6
+if test "${ice_cv_have_ioctl_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_memmove_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 string.h strings.h; do
+for header in sys/ioctl.h unistd.h libc.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -43834,12 +50832,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}memmove[       ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_memmove_decl=yes
+  $EGREP "${ice_re_word}ioctl[         ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_ioctl_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_memmove_decl" = yes; then
+if test "$ice_cv_have_ioctl_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -43853,33 +50851,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}memmove[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_memmove_decl=yes
+  $EGREP "${ice_re_word}ioctl[         ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_ioctl_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_memmove_decl" = yes; then
+if test "$ice_cv_have_ioctl_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_memmove_decl" >&5
-echo "${ECHO_T}$ice_cv_have_memmove_decl" >&6
-if test "$ice_cv_have_memmove_decl" = yes; then
+echo "$as_me:$LINENO: result: $ice_cv_have_ioctl_decl" >&5
+echo "${ECHO_T}$ice_cv_have_ioctl_decl" >&6
+if test "$ice_cv_have_ioctl_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_MEMMOVE_DECL 1
+#define HAVE_IOCTL_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_memset=no
+ice_have_isnormal=no
 
-for ac_func in memset
+for ac_func in isnormal
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -43976,21 +50974,21 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_memset=yes
+ ice_have_isnormal=yes
 fi
 done
 
-if test "${ice_have_memset}" = yes; then
-echo "$as_me:$LINENO: checking for memset declaration in string.h strings.h" >&5
-echo $ECHO_N "checking for memset declaration in string.h strings.h... $ECHO_C" >&6
-if test "${ice_cv_have_memset_decl+set}" = set; then
+if test "${ice_have_isnormal}" = yes; then
+echo "$as_me:$LINENO: checking for isnormal declaration in math.h" >&5
+echo $ECHO_N "checking for isnormal declaration in math.h... $ECHO_C" >&6
+if test "${ice_cv_have_isnormal_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_memset_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 string.h strings.h; do
+for header in math.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -44002,12 +51000,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}memset[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_memset_decl=yes
+  $EGREP "${ice_re_word}isnormal[      ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_isnormal_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_memset_decl" = yes; then
+if test "$ice_cv_have_isnormal_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -44021,31 +51019,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}memset[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_memset_decl=yes
+  $EGREP "${ice_re_word}isnormal[      ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_isnormal_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_memset_decl" = yes; then
+if test "$ice_cv_have_isnormal_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_memset_decl" >&5
-echo "${ECHO_T}$ice_cv_have_memset_decl" >&6
-if test "$ice_cv_have_memset_decl" = yes; then
+echo "$as_me:$LINENO: result: $ice_cv_have_isnormal_decl" >&5
+echo "${ECHO_T}$ice_cv_have_isnormal_decl" >&6
+if test "$ice_cv_have_isnormal_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_MEMSET_DECL 1
+#define HAVE_ISNORMAL_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-for ac_func in mkdir
+ice_have_listen=no
+
+for ac_func in listen
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -44142,14 +51142,78 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
+ ice_have_listen=yes
+fi
+done
+
+if test "${ice_have_listen}" = yes; then
+echo "$as_me:$LINENO: checking for listen declaration in sys/types.h sys/socket.h" >&5
+echo $ECHO_N "checking for listen declaration in sys/types.h sys/socket.h... $ECHO_C" >&6
+if test "${ice_cv_have_listen_decl+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+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 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}listen[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_listen_decl=yes
+fi
+rm -f conftest*
+
+if test "$ice_cv_have_listen_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}listen[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_listen_decl=yes
+fi
+rm -f conftest*
 
+if test "$ice_cv_have_listen_decl" = yes; then
+       break
 fi
 done
 
+fi
 
-ice_have_mkstemp=no
+echo "$as_me:$LINENO: result: $ice_cv_have_listen_decl" >&5
+echo "${ECHO_T}$ice_cv_have_listen_decl" >&6
+if test "$ice_cv_have_listen_decl" = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_LISTEN_DECL 1
+_ACEOF
+
+fi
+fi
+
+
+ice_have_lstat=no
 
-for ac_func in mkstemp
+for ac_func in lstat
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -44246,21 +51310,21 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_mkstemp=yes
+ ice_have_lstat=yes
 fi
 done
 
-if test "${ice_have_mkstemp}" = yes; then
-echo "$as_me:$LINENO: checking for mkstemp declaration in stdlib.h" >&5
-echo $ECHO_N "checking for mkstemp declaration in stdlib.h... $ECHO_C" >&6
-if test "${ice_cv_have_mkstemp_decl+set}" = set; then
+if test "${ice_have_lstat}" = yes; then
+echo "$as_me:$LINENO: checking for lstat declaration in sys/types.h sys/stat.h" >&5
+echo $ECHO_N "checking for lstat declaration in sys/types.h sys/stat.h... $ECHO_C" >&6
+if test "${ice_cv_have_lstat_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_mkstemp_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 stdlib.h; do
+for header in sys/types.h sys/stat.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -44272,12 +51336,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}mkstemp[       ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_mkstemp_decl=yes
+  $EGREP "${ice_re_word}lstat[         ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_lstat_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_mkstemp_decl" = yes; then
+if test "$ice_cv_have_lstat_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -44291,33 +51355,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}mkstemp[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_mkstemp_decl=yes
+  $EGREP "${ice_re_word}lstat[         ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_lstat_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_mkstemp_decl" = yes; then
+if test "$ice_cv_have_lstat_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_mkstemp_decl" >&5
-echo "${ECHO_T}$ice_cv_have_mkstemp_decl" >&6
-if test "$ice_cv_have_mkstemp_decl" = yes; then
+echo "$as_me:$LINENO: result: $ice_cv_have_lstat_decl" >&5
+echo "${ECHO_T}$ice_cv_have_lstat_decl" >&6
+if test "$ice_cv_have_lstat_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_MKSTEMP_DECL 1
+#define HAVE_LSTAT_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_mktemp=no
+ice_have_malloc=no
 
-for ac_func in mktemp
+for ac_func in malloc
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -44414,18 +51478,18 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_mktemp=yes
+ ice_have_malloc=yes
 fi
 done
 
-if test "${ice_have_mktemp}" = yes; then
-echo "$as_me:$LINENO: checking for mktemp declaration in stdlib.h" >&5
-echo $ECHO_N "checking for mktemp declaration in stdlib.h... $ECHO_C" >&6
-if test "${ice_cv_have_mktemp_decl+set}" = set; then
+if test "${ice_have_malloc}" = yes; then
+echo "$as_me:$LINENO: checking for malloc declaration in stdlib.h" >&5
+echo $ECHO_N "checking for malloc declaration in stdlib.h... $ECHO_C" >&6
+if test "${ice_cv_have_malloc_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_mktemp_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 stdlib.h; do
@@ -44440,12 +51504,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}mktemp[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_mktemp_decl=yes
+  $EGREP "${ice_re_word}malloc[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_malloc_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_mktemp_decl" = yes; then
+if test "$ice_cv_have_malloc_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -44459,31 +51523,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}mktemp[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_mktemp_decl=yes
+  $EGREP "${ice_re_word}malloc[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_malloc_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_mktemp_decl" = yes; then
+if test "$ice_cv_have_malloc_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_mktemp_decl" >&5
-echo "${ECHO_T}$ice_cv_have_mktemp_decl" >&6
-if test "$ice_cv_have_mktemp_decl" = yes; then
+echo "$as_me:$LINENO: result: $ice_cv_have_malloc_decl" >&5
+echo "${ECHO_T}$ice_cv_have_malloc_decl" >&6
+if test "$ice_cv_have_malloc_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_MKTEMP_DECL 1
+#define HAVE_MALLOC_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-for ac_func in mktime
+ice_have_memmove=no
+
+for ac_func in memmove
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -44580,24 +51646,78 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
+ ice_have_memmove=yes
+fi
+done
 
+if test "${ice_have_memmove}" = yes; then
+echo "$as_me:$LINENO: checking for memmove declaration in string.h strings.h" >&5
+echo $ECHO_N "checking for memmove declaration in string.h strings.h... $ECHO_C" >&6
+if test "${ice_cv_have_memmove_decl+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case $LIBOBJS in
-    "$ac_func.$ac_objext"   | \
-  *" $ac_func.$ac_objext"   | \
-    "$ac_func.$ac_objext "* | \
-  *" $ac_func.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;;
-esac
 
+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 string.h strings.h; do
+# Check for ordinary declaration
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$header>
+
+_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
+fi
+rm -f conftest*
+
+if test "$ice_cv_have_memmove_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}memmove[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_memmove_decl=yes
+fi
+rm -f conftest*
+
+if test "$ice_cv_have_memmove_decl" = yes; then
+       break
 fi
 done
 
+fi
+
+echo "$as_me:$LINENO: result: $ice_cv_have_memmove_decl" >&5
+echo "${ECHO_T}$ice_cv_have_memmove_decl" >&6
+if test "$ice_cv_have_memmove_decl" = yes; then
 
+cat >>confdefs.h <<_ACEOF
+#define HAVE_MEMMOVE_DECL 1
+_ACEOF
 
-ice_have_mktime=no
+fi
+fi
 
-for ac_func in mktime
+
+ice_have_memset=no
+
+for ac_func in memset
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -44694,21 +51814,21 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_mktime=yes
+ ice_have_memset=yes
 fi
 done
 
-if test "${ice_have_mktime}" = yes; then
-echo "$as_me:$LINENO: checking for mktime declaration in time.h sys/time.h" >&5
-echo $ECHO_N "checking for mktime declaration in time.h sys/time.h... $ECHO_C" >&6
-if test "${ice_cv_have_mktime_decl+set}" = set; then
+if test "${ice_have_memset}" = yes; then
+echo "$as_me:$LINENO: checking for memset declaration in string.h strings.h" >&5
+echo $ECHO_N "checking for memset declaration in string.h strings.h... $ECHO_C" >&6
+if test "${ice_cv_have_memset_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_mktime_decl=no
+ice_cv_have_memset_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in time.h sys/time.h; do
+for header in string.h strings.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -44720,12 +51840,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}mktime[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_mktime_decl=yes
+  $EGREP "${ice_re_word}memset[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_memset_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_mktime_decl" = yes; then
+if test "$ice_cv_have_memset_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -44739,182 +51859,31 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}mktime[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_mktime_decl=yes
+  $EGREP "${ice_re_word}memset[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_memset_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_mktime_decl" = yes; then
+if test "$ice_cv_have_memset_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_mktime_decl" >&5
-echo "${ECHO_T}$ice_cv_have_mktime_decl" >&6
-if test "$ice_cv_have_mktime_decl" = yes; then
+echo "$as_me:$LINENO: result: $ice_cv_have_memset_decl" >&5
+echo "${ECHO_T}$ice_cv_have_memset_decl" >&6
+if test "$ice_cv_have_memset_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_MKTIME_DECL 1
-_ACEOF
-
-fi
-fi
-
-
-
-for ac_header in stdlib.h unistd.h
-do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
-else
-  # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-#include <$ac_header>
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_header_compiler=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_header_compiler=no
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$ac_header>
+#define HAVE_MEMSET_DECL 1
 _ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
-  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } >/dev/null; then
-  if test -s conftest.err; then
-    ac_cpp_err=$ac_c_preproc_warn_flag
-    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
-  else
-    ac_cpp_err=
-  fi
-else
-  ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
-  ac_header_preproc=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-  ac_header_preproc=no
-fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
-  yes:no: )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
-    ac_header_preproc=yes
-    ;;
-  no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-    (
-      cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists.  ##
-## ------------------------------------------ ##
-_ASBOX
-    ) |
-      sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
 
 fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
 fi
 
-done
-
 
-for ac_func in getpagesize
+for ac_func in mkdir
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -45002,196 +51971,23 @@ sed 's/^/| /' conftest.$ac_ext >&5
 
 eval "$as_ac_var=no"
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
-echo "$as_me:$LINENO: checking for working mmap" >&5
-echo $ECHO_N "checking for working mmap... $ECHO_C" >&6
-if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  if test "$cross_compiling" = yes; then
-  ac_cv_func_mmap_fixed_mapped=no
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-$ac_includes_default
-/* malloc might have been renamed as rpl_malloc. */
-#undef malloc
-
-/* Thanks to Mike Haertel and Jim Avera for this test.
-   Here is a matrix of mmap possibilities:
-       mmap private not fixed
-       mmap private fixed at somewhere currently unmapped
-       mmap private fixed at somewhere already mapped
-       mmap shared not fixed
-       mmap shared fixed at somewhere currently unmapped
-       mmap shared fixed at somewhere already mapped
-   For private mappings, we should verify that changes cannot be read()
-   back from the file, nor mmap's back from the file at a different
-   address.  (There have been systems where private was not correctly
-   implemented like the infamous i386 svr4.0, and systems where the
-   VM page cache was not coherent with the file system buffer cache
-   like early versions of FreeBSD and possibly contemporary NetBSD.)
-   For shared mappings, we should conversely verify that changes get
-   propagated back to all the places they're supposed to be.
-
-   Grep wants private fixed already mapped.
-   The main things grep needs to know about mmap are:
-   * does it exist and is it safe to write into the mmap'd area
-   * how to use it (BSD variants)  */
-
-#include <fcntl.h>
-#include <sys/mman.h>
-
-#if !STDC_HEADERS && !HAVE_STDLIB_H
-char *malloc ();
-#endif
-
-/* This mess was copied from the GNU getpagesize.h.  */
-#if !HAVE_GETPAGESIZE
-/* Assume that all systems that can run configure have sys/param.h.  */
-# if !HAVE_SYS_PARAM_H
-#  define HAVE_SYS_PARAM_H 1
-# endif
-
-# ifdef _SC_PAGESIZE
-#  define getpagesize() sysconf(_SC_PAGESIZE)
-# else /* no _SC_PAGESIZE */
-#  if HAVE_SYS_PARAM_H
-#   include <sys/param.h>
-#   ifdef EXEC_PAGESIZE
-#    define getpagesize() EXEC_PAGESIZE
-#   else /* no EXEC_PAGESIZE */
-#    ifdef NBPG
-#     define getpagesize() NBPG * CLSIZE
-#     ifndef CLSIZE
-#      define CLSIZE 1
-#     endif /* no CLSIZE */
-#    else /* no NBPG */
-#     ifdef NBPC
-#      define getpagesize() NBPC
-#     else /* no NBPC */
-#      ifdef PAGESIZE
-#       define getpagesize() PAGESIZE
-#      endif /* PAGESIZE */
-#     endif /* no NBPC */
-#    endif /* no NBPG */
-#   endif /* no EXEC_PAGESIZE */
-#  else /* no HAVE_SYS_PARAM_H */
-#   define getpagesize() 8192  /* punt totally */
-#  endif /* no HAVE_SYS_PARAM_H */
-# endif /* no _SC_PAGESIZE */
-
-#endif /* no HAVE_GETPAGESIZE */
-
-int
-main ()
-{
-  char *data, *data2, *data3;
-  int i, pagesize;
-  int fd;
-
-  pagesize = getpagesize ();
-
-  /* First, make a file with some known garbage in it. */
-  data = (char *) malloc (pagesize);
-  if (!data)
-    exit (1);
-  for (i = 0; i < pagesize; ++i)
-    *(data + i) = rand ();
-  umask (0);
-  fd = creat ("conftest.mmap", 0600);
-  if (fd < 0)
-    exit (1);
-  if (write (fd, data, pagesize) != pagesize)
-    exit (1);
-  close (fd);
-
-  /* Next, try to mmap the file at a fixed address which already has
-     something else allocated at it.  If we can, also make sure that
-     we see the same garbage.  */
-  fd = open ("conftest.mmap", O_RDWR);
-  if (fd < 0)
-    exit (1);
-  data2 = (char *) malloc (2 * pagesize);
-  if (!data2)
-    exit (1);
-  data2 += (pagesize - ((long) data2 & (pagesize - 1))) & (pagesize - 1);
-  if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE,
-                    MAP_PRIVATE | MAP_FIXED, fd, 0L))
-    exit (1);
-  for (i = 0; i < pagesize; ++i)
-    if (*(data + i) != *(data2 + i))
-      exit (1);
-
-  /* Finally, make sure that changes to the mapped area do not
-     percolate back to the file as seen by read().  (This is a bug on
-     some variants of i386 svr4.0.)  */
-  for (i = 0; i < pagesize; ++i)
-    *(data2 + i) = *(data2 + i) + 1;
-  data3 = (char *) malloc (pagesize);
-  if (!data3)
-    exit (1);
-  if (read (fd, data3, pagesize) != pagesize)
-    exit (1);
-  for (i = 0; i < pagesize; ++i)
-    if (*(data + i) != *(data3 + i))
-      exit (1);
-  close (fd);
-  exit (0);
-}
-_ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_mmap_fixed_mapped=yes
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-( exit $ac_status )
-ac_cv_func_mmap_fixed_mapped=no
-fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
-fi
-fi
-echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5
-echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6
-if test $ac_cv_func_mmap_fixed_mapped = yes; then
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_MMAP 1
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
 fi
-rm -f conftest.mmap
+done
 
 
-for ac_func in on_exit
+ice_have_mkstemp=no
+
+for ac_func in mkstemp
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -45288,14 +52084,78 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
+ ice_have_mkstemp=yes
+fi
+done
+
+if test "${ice_have_mkstemp}" = yes; then
+echo "$as_me:$LINENO: checking for mkstemp declaration in stdlib.h" >&5
+echo $ECHO_N "checking for mkstemp declaration in stdlib.h... $ECHO_C" >&6
+if test "${ice_cv_have_mkstemp_decl+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ice_cv_have_mkstemp_decl=no
+ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
+ice_re_word='(^|[^a-zA-Z0-9_])'
+for header in stdlib.h; do
+# Check for ordinary declaration
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$header>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}mkstemp[       ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_mkstemp_decl=yes
+fi
+rm -f conftest*
+
+if test "$ice_cv_have_mkstemp_decl" = yes; then
+       break
+fi
+# Check for "fixed" declaration like "getpid _PARAMS((int))"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$header>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}mkstemp[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_mkstemp_decl=yes
+fi
+rm -f conftest*
 
+if test "$ice_cv_have_mkstemp_decl" = yes; then
+       break
 fi
 done
 
+fi
 
-ice_have_openlog=no
+echo "$as_me:$LINENO: result: $ice_cv_have_mkstemp_decl" >&5
+echo "${ECHO_T}$ice_cv_have_mkstemp_decl" >&6
+if test "$ice_cv_have_mkstemp_decl" = yes; then
 
-for ac_func in openlog
+cat >>confdefs.h <<_ACEOF
+#define HAVE_MKSTEMP_DECL 1
+_ACEOF
+
+fi
+fi
+
+
+ice_have_mktemp=no
+
+for ac_func in mktemp
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -45392,21 +52252,21 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_openlog=yes
+ ice_have_mktemp=yes
 fi
 done
 
-if test "${ice_have_openlog}" = yes; then
-echo "$as_me:$LINENO: checking for openlog declaration in syslog.h" >&5
-echo $ECHO_N "checking for openlog declaration in syslog.h... $ECHO_C" >&6
-if test "${ice_cv_have_openlog_decl+set}" = set; then
+if test "${ice_have_mktemp}" = yes; then
+echo "$as_me:$LINENO: checking for mktemp declaration in stdlib.h" >&5
+echo $ECHO_N "checking for mktemp declaration in stdlib.h... $ECHO_C" >&6
+if test "${ice_cv_have_mktemp_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_openlog_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 syslog.h; do
+for header in stdlib.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -45418,12 +52278,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}openlog[       ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_openlog_decl=yes
+  $EGREP "${ice_re_word}mktemp[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_mktemp_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_openlog_decl" = yes; then
+if test "$ice_cv_have_mktemp_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -45437,33 +52297,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}openlog[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_openlog_decl=yes
+  $EGREP "${ice_re_word}mktemp[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_mktemp_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_openlog_decl" = yes; then
+if test "$ice_cv_have_mktemp_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_openlog_decl" >&5
-echo "${ECHO_T}$ice_cv_have_openlog_decl" >&6
-if test "$ice_cv_have_openlog_decl" = yes; then
+echo "$as_me:$LINENO: result: $ice_cv_have_mktemp_decl" >&5
+echo "${ECHO_T}$ice_cv_have_mktemp_decl" >&6
+if test "$ice_cv_have_mktemp_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_OPENLOG_DECL 1
+#define HAVE_MKTEMP_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_pclose=no
+ice_have_mktime=no
 
-for ac_func in pclose
+for ac_func in mktime
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -45560,21 +52420,21 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_pclose=yes
+ ice_have_mktime=yes
 fi
 done
 
-if test "${ice_have_pclose}" = yes; then
-echo "$as_me:$LINENO: checking for pclose declaration in stdio.h" >&5
-echo $ECHO_N "checking for pclose declaration in stdio.h... $ECHO_C" >&6
-if test "${ice_cv_have_pclose_decl+set}" = set; then
+if test "${ice_have_mktime}" = yes; then
+echo "$as_me:$LINENO: checking for mktime declaration in time.h sys/time.h" >&5
+echo $ECHO_N "checking for mktime declaration in time.h sys/time.h... $ECHO_C" >&6
+if test "${ice_cv_have_mktime_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_pclose_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 stdio.h; do
+for header in time.h sys/time.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -45586,12 +52446,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}pclose[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_pclose_decl=yes
+  $EGREP "${ice_re_word}mktime[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_mktime_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_pclose_decl" = yes; then
+if test "$ice_cv_have_mktime_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -45605,33 +52465,182 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}pclose[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_pclose_decl=yes
+  $EGREP "${ice_re_word}mktime[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_mktime_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_pclose_decl" = yes; then
+if test "$ice_cv_have_mktime_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_pclose_decl" >&5
-echo "${ECHO_T}$ice_cv_have_pclose_decl" >&6
-if test "$ice_cv_have_pclose_decl" = yes; then
+echo "$as_me:$LINENO: result: $ice_cv_have_mktime_decl" >&5
+echo "${ECHO_T}$ice_cv_have_mktime_decl" >&6
+if test "$ice_cv_have_mktime_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_PCLOSE_DECL 1
+#define HAVE_MKTIME_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_perror=no
 
-for ac_func in perror
+for ac_header in stdlib.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+  # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+  (eval $ac_compile) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest.$ac_objext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+  (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null; then
+  if test -s conftest.err; then
+    ac_cpp_err=$ac_c_preproc_warn_flag
+    ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+  else
+    ac_cpp_err=
+  fi
+else
+  ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    (
+      cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists.  ##
+## ------------------------------------------ ##
+_ASBOX
+    ) |
+      sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_func in getpagesize
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -45728,78 +52737,187 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_perror=yes
+
 fi
 done
 
-if test "${ice_have_perror}" = yes; then
-echo "$as_me:$LINENO: checking for perror declaration in stdio.h" >&5
-echo $ECHO_N "checking for perror declaration in stdio.h... $ECHO_C" >&6
-if test "${ice_cv_have_perror_decl+set}" = set; then
+echo "$as_me:$LINENO: checking for working mmap" >&5
+echo $ECHO_N "checking for working mmap... $ECHO_C" >&6
+if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-
-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 stdio.h; do
-# Check for ordinary declaration
-cat >conftest.$ac_ext <<_ACEOF
+  if test "$cross_compiling" = yes; then
+  ac_cv_func_mmap_fixed_mapped=no
+else
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <$header>
+$ac_includes_default
+/* malloc might have been renamed as rpl_malloc. */
+#undef malloc
 
-_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
-fi
-rm -f conftest*
+/* Thanks to Mike Haertel and Jim Avera for this test.
+   Here is a matrix of mmap possibilities:
+       mmap private not fixed
+       mmap private fixed at somewhere currently unmapped
+       mmap private fixed at somewhere already mapped
+       mmap shared not fixed
+       mmap shared fixed at somewhere currently unmapped
+       mmap shared fixed at somewhere already mapped
+   For private mappings, we should verify that changes cannot be read()
+   back from the file, nor mmap's back from the file at a different
+   address.  (There have been systems where private was not correctly
+   implemented like the infamous i386 svr4.0, and systems where the
+   VM page cache was not coherent with the file system buffer cache
+   like early versions of FreeBSD and possibly contemporary NetBSD.)
+   For shared mappings, we should conversely verify that changes get
+   propagated back to all the places they're supposed to be.
 
-if test "$ice_cv_have_perror_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>
+   Grep wants private fixed already mapped.
+   The main things grep needs to know about mmap are:
+   * does it exist and is it safe to write into the mmap'd area
+   * how to use it (BSD variants)  */
 
-_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
-fi
-rm -f conftest*
+#include <fcntl.h>
+#include <sys/mman.h>
 
-if test "$ice_cv_have_perror_decl" = yes; then
-       break
-fi
-done
+#if !STDC_HEADERS && !HAVE_STDLIB_H
+char *malloc ();
+#endif
 
-fi
+/* This mess was copied from the GNU getpagesize.h.  */
+#if !HAVE_GETPAGESIZE
+/* Assume that all systems that can run configure have sys/param.h.  */
+# if !HAVE_SYS_PARAM_H
+#  define HAVE_SYS_PARAM_H 1
+# endif
 
-echo "$as_me:$LINENO: result: $ice_cv_have_perror_decl" >&5
-echo "${ECHO_T}$ice_cv_have_perror_decl" >&6
-if test "$ice_cv_have_perror_decl" = yes; then
+# ifdef _SC_PAGESIZE
+#  define getpagesize() sysconf(_SC_PAGESIZE)
+# else /* no _SC_PAGESIZE */
+#  if HAVE_SYS_PARAM_H
+#   include <sys/param.h>
+#   ifdef EXEC_PAGESIZE
+#    define getpagesize() EXEC_PAGESIZE
+#   else /* no EXEC_PAGESIZE */
+#    ifdef NBPG
+#     define getpagesize() NBPG * CLSIZE
+#     ifndef CLSIZE
+#      define CLSIZE 1
+#     endif /* no CLSIZE */
+#    else /* no NBPG */
+#     ifdef NBPC
+#      define getpagesize() NBPC
+#     else /* no NBPC */
+#      ifdef PAGESIZE
+#       define getpagesize() PAGESIZE
+#      endif /* PAGESIZE */
+#     endif /* no NBPC */
+#    endif /* no NBPG */
+#   endif /* no EXEC_PAGESIZE */
+#  else /* no HAVE_SYS_PARAM_H */
+#   define getpagesize() 8192  /* punt totally */
+#  endif /* no HAVE_SYS_PARAM_H */
+# endif /* no _SC_PAGESIZE */
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_PERROR_DECL 1
+#endif /* no HAVE_GETPAGESIZE */
+
+int
+main ()
+{
+  char *data, *data2, *data3;
+  int i, pagesize;
+  int fd;
+
+  pagesize = getpagesize ();
+
+  /* First, make a file with some known garbage in it. */
+  data = (char *) malloc (pagesize);
+  if (!data)
+    exit (1);
+  for (i = 0; i < pagesize; ++i)
+    *(data + i) = rand ();
+  umask (0);
+  fd = creat ("conftest.mmap", 0600);
+  if (fd < 0)
+    exit (1);
+  if (write (fd, data, pagesize) != pagesize)
+    exit (1);
+  close (fd);
+
+  /* Next, try to mmap the file at a fixed address which already has
+     something else allocated at it.  If we can, also make sure that
+     we see the same garbage.  */
+  fd = open ("conftest.mmap", O_RDWR);
+  if (fd < 0)
+    exit (1);
+  data2 = (char *) malloc (2 * pagesize);
+  if (!data2)
+    exit (1);
+  data2 += (pagesize - ((long) data2 & (pagesize - 1))) & (pagesize - 1);
+  if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE,
+                    MAP_PRIVATE | MAP_FIXED, fd, 0L))
+    exit (1);
+  for (i = 0; i < pagesize; ++i)
+    if (*(data + i) != *(data2 + i))
+      exit (1);
+
+  /* Finally, make sure that changes to the mapped area do not
+     percolate back to the file as seen by read().  (This is a bug on
+     some variants of i386 svr4.0.)  */
+  for (i = 0; i < pagesize; ++i)
+    *(data2 + i) = *(data2 + i) + 1;
+  data3 = (char *) malloc (pagesize);
+  if (!data3)
+    exit (1);
+  if (read (fd, data3, pagesize) != pagesize)
+    exit (1);
+  for (i = 0; i < pagesize; ++i)
+    if (*(data + i) != *(data3 + i))
+      exit (1);
+  close (fd);
+  exit (0);
+}
 _ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_mmap_fixed_mapped=yes
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+( exit $ac_status )
+ac_cv_func_mmap_fixed_mapped=no
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
 fi
+echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5
+echo "${ECHO_T}$ac_cv_func_mmap_fixed_mapped" >&6
+if test $ac_cv_func_mmap_fixed_mapped = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_MMAP 1
+_ACEOF
 
+fi
+rm -f conftest.mmap
 
-ice_have_printf=no
 
-for ac_func in printf
+for ac_func in on_exit
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -45896,76 +53014,14 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_printf=yes
-fi
-done
-
-if test "${ice_have_printf}" = yes; then
-echo "$as_me:$LINENO: checking for printf declaration in stdio.h" >&5
-echo $ECHO_N "checking for printf declaration in stdio.h... $ECHO_C" >&6
-if test "${ice_cv_have_printf_decl+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-ice_cv_have_printf_decl=no
-ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
-ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in stdio.h; do
-# Check for ordinary declaration
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}printf[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_printf_decl=yes
-fi
-rm -f conftest*
 
-if test "$ice_cv_have_printf_decl" = yes; then
-       break
-fi
-# Check for "fixed" declaration like "getpid _PARAMS((int))"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}printf[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_printf_decl=yes
-fi
-rm -f conftest*
-
-if test "$ice_cv_have_printf_decl" = yes; then
-       break
 fi
 done
 
-fi
-
-echo "$as_me:$LINENO: result: $ice_cv_have_printf_decl" >&5
-echo "${ECHO_T}$ice_cv_have_printf_decl" >&6
-if test "$ice_cv_have_printf_decl" = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_PRINTF_DECL 1
-_ACEOF
-
-fi
-fi
 
+ice_have_openlog=no
 
-for ac_func in putenv
+for ac_func in openlog
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -46062,14 +53118,78 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
+ ice_have_openlog=yes
+fi
+done
 
+if test "${ice_have_openlog}" = yes; then
+echo "$as_me:$LINENO: checking for openlog declaration in syslog.h" >&5
+echo $ECHO_N "checking for openlog declaration in syslog.h... $ECHO_C" >&6
+if test "${ice_cv_have_openlog_decl+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+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 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}openlog[       ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_openlog_decl=yes
+fi
+rm -f conftest*
+
+if test "$ice_cv_have_openlog_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}openlog[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_openlog_decl=yes
+fi
+rm -f conftest*
+
+if test "$ice_cv_have_openlog_decl" = yes; then
+       break
 fi
 done
 
+fi
+
+echo "$as_me:$LINENO: result: $ice_cv_have_openlog_decl" >&5
+echo "${ECHO_T}$ice_cv_have_openlog_decl" >&6
+if test "$ice_cv_have_openlog_decl" = yes; then
 
-ice_have_puts=no
+cat >>confdefs.h <<_ACEOF
+#define HAVE_OPENLOG_DECL 1
+_ACEOF
 
-for ac_func in puts
+fi
+fi
+
+
+ice_have_pclose=no
+
+for ac_func in pclose
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -46166,18 +53286,18 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_puts=yes
+ ice_have_pclose=yes
 fi
 done
 
-if test "${ice_have_puts}" = yes; then
-echo "$as_me:$LINENO: checking for puts declaration in stdio.h" >&5
-echo $ECHO_N "checking for puts declaration in stdio.h... $ECHO_C" >&6
-if test "${ice_cv_have_puts_decl+set}" = set; then
+if test "${ice_have_pclose}" = yes; then
+echo "$as_me:$LINENO: checking for pclose declaration in stdio.h" >&5
+echo $ECHO_N "checking for pclose declaration in stdio.h... $ECHO_C" >&6
+if test "${ice_cv_have_pclose_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_puts_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 stdio.h; do
@@ -46192,12 +53312,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}puts[  ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_puts_decl=yes
+  $EGREP "${ice_re_word}pclose[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_pclose_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_puts_decl" = yes; then
+if test "$ice_cv_have_pclose_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -46211,33 +53331,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}puts[  ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_puts_decl=yes
+  $EGREP "${ice_re_word}pclose[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_pclose_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_puts_decl" = yes; then
+if test "$ice_cv_have_pclose_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_puts_decl" >&5
-echo "${ECHO_T}$ice_cv_have_puts_decl" >&6
-if test "$ice_cv_have_puts_decl" = yes; then
+echo "$as_me:$LINENO: result: $ice_cv_have_pclose_decl" >&5
+echo "${ECHO_T}$ice_cv_have_pclose_decl" >&6
+if test "$ice_cv_have_pclose_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_PUTS_DECL 1
+#define HAVE_PCLOSE_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_realloc=no
+ice_have_perror=no
 
-for ac_func in realloc
+for ac_func in perror
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -46334,21 +53454,21 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_realloc=yes
+ ice_have_perror=yes
 fi
 done
 
-if test "${ice_have_realloc}" = yes; then
-echo "$as_me:$LINENO: checking for realloc declaration in stdlib.h" >&5
-echo $ECHO_N "checking for realloc declaration in stdlib.h... $ECHO_C" >&6
-if test "${ice_cv_have_realloc_decl+set}" = set; then
+if test "${ice_have_perror}" = yes; then
+echo "$as_me:$LINENO: checking for perror declaration in stdio.h" >&5
+echo $ECHO_N "checking for perror declaration in stdio.h... $ECHO_C" >&6
+if test "${ice_cv_have_perror_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_realloc_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 stdlib.h; do
+for header in stdio.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -46360,12 +53480,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}realloc[       ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_realloc_decl=yes
+  $EGREP "${ice_re_word}perror[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_perror_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_realloc_decl" = yes; then
+if test "$ice_cv_have_perror_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -46379,33 +53499,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}realloc[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_realloc_decl=yes
+  $EGREP "${ice_re_word}perror[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_perror_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_realloc_decl" = yes; then
+if test "$ice_cv_have_perror_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_realloc_decl" >&5
-echo "${ECHO_T}$ice_cv_have_realloc_decl" >&6
-if test "$ice_cv_have_realloc_decl" = yes; then
+echo "$as_me:$LINENO: result: $ice_cv_have_perror_decl" >&5
+echo "${ECHO_T}$ice_cv_have_perror_decl" >&6
+if test "$ice_cv_have_perror_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_REALLOC_DECL 1
+#define HAVE_PERROR_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_recvfrom=no
+ice_have_printf=no
 
-for ac_func in recvfrom
+for ac_func in printf
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -46502,21 +53622,21 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_recvfrom=yes
+ ice_have_printf=yes
 fi
 done
 
-if test "${ice_have_recvfrom}" = yes; then
-echo "$as_me:$LINENO: checking for recvfrom declaration in sys/types.h sys/socket.h" >&5
-echo $ECHO_N "checking for recvfrom declaration in sys/types.h sys/socket.h... $ECHO_C" >&6
-if test "${ice_cv_have_recvfrom_decl+set}" = set; then
+if test "${ice_have_printf}" = yes; then
+echo "$as_me:$LINENO: checking for printf declaration in stdio.h" >&5
+echo $ECHO_N "checking for printf declaration in stdio.h... $ECHO_C" >&6
+if test "${ice_cv_have_printf_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_recvfrom_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/types.h sys/socket.h; do
+for header in stdio.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -46528,12 +53648,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}recvfrom[      ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_recvfrom_decl=yes
+  $EGREP "${ice_re_word}printf[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_printf_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_recvfrom_decl" = yes; then
+if test "$ice_cv_have_printf_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -46547,33 +53667,31 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}recvfrom[      ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_recvfrom_decl=yes
+  $EGREP "${ice_re_word}printf[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_printf_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_recvfrom_decl" = yes; then
+if test "$ice_cv_have_printf_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_recvfrom_decl" >&5
-echo "${ECHO_T}$ice_cv_have_recvfrom_decl" >&6
-if test "$ice_cv_have_recvfrom_decl" = yes; then
+echo "$as_me:$LINENO: result: $ice_cv_have_printf_decl" >&5
+echo "${ECHO_T}$ice_cv_have_printf_decl" >&6
+if test "$ice_cv_have_printf_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_RECVFROM_DECL 1
+#define HAVE_PRINTF_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_remove=no
-
-for ac_func in remove
+for ac_func in putenv
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -46670,78 +53788,14 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_remove=yes
-fi
-done
-
-if test "${ice_have_remove}" = yes; then
-echo "$as_me:$LINENO: checking for remove declaration in stdio.h" >&5
-echo $ECHO_N "checking for remove declaration in stdio.h... $ECHO_C" >&6
-if test "${ice_cv_have_remove_decl+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&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
-
-echo "$as_me:$LINENO: result: $ice_cv_have_remove_decl" >&5
-echo "${ECHO_T}$ice_cv_have_remove_decl" >&6
-if test "$ice_cv_have_remove_decl" = yes; then
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_REMOVE_DECL 1
-_ACEOF
-
-fi
-fi
-
-
-ice_have_rename=no
+ice_have_puts=no
 
-for ac_func in rename
+for ac_func in puts
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -46838,18 +53892,18 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_rename=yes
+ ice_have_puts=yes
 fi
 done
 
-if test "${ice_have_rename}" = yes; then
-echo "$as_me:$LINENO: checking for rename declaration in stdio.h" >&5
-echo $ECHO_N "checking for rename declaration in stdio.h... $ECHO_C" >&6
-if test "${ice_cv_have_rename_decl+set}" = set; then
+if test "${ice_have_puts}" = yes; then
+echo "$as_me:$LINENO: checking for puts declaration in stdio.h" >&5
+echo $ECHO_N "checking for puts declaration in stdio.h... $ECHO_C" >&6
+if test "${ice_cv_have_puts_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_rename_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 stdio.h; do
@@ -46864,12 +53918,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}rename[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_rename_decl=yes
+  $EGREP "${ice_re_word}puts[  ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_puts_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_rename_decl" = yes; then
+if test "$ice_cv_have_puts_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -46883,33 +53937,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}rename[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_rename_decl=yes
+  $EGREP "${ice_re_word}puts[  ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_puts_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_rename_decl" = yes; then
+if test "$ice_cv_have_puts_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_rename_decl" >&5
-echo "${ECHO_T}$ice_cv_have_rename_decl" >&6
-if test "$ice_cv_have_rename_decl" = yes; then
+echo "$as_me:$LINENO: result: $ice_cv_have_puts_decl" >&5
+echo "${ECHO_T}$ice_cv_have_puts_decl" >&6
+if test "$ice_cv_have_puts_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_RENAME_DECL 1
+#define HAVE_PUTS_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_rewind=no
+ice_have_realloc=no
 
-for ac_func in rewind
+for ac_func in realloc
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -47006,21 +54060,21 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_rewind=yes
+ ice_have_realloc=yes
 fi
 done
 
-if test "${ice_have_rewind}" = yes; then
-echo "$as_me:$LINENO: checking for rewind declaration in stdio.h" >&5
-echo $ECHO_N "checking for rewind declaration in stdio.h... $ECHO_C" >&6
-if test "${ice_cv_have_rewind_decl+set}" = set; then
+if test "${ice_have_realloc}" = yes; then
+echo "$as_me:$LINENO: checking for realloc declaration in stdlib.h" >&5
+echo $ECHO_N "checking for realloc declaration in stdlib.h... $ECHO_C" >&6
+if test "${ice_cv_have_realloc_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_rewind_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 stdio.h; do
+for header in stdlib.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -47032,12 +54086,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}rewind[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_rewind_decl=yes
+  $EGREP "${ice_re_word}realloc[       ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_realloc_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_rewind_decl" = yes; then
+if test "$ice_cv_have_realloc_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -47051,31 +54105,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}rewind[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_rewind_decl=yes
+  $EGREP "${ice_re_word}realloc[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_realloc_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_rewind_decl" = yes; then
+if test "$ice_cv_have_realloc_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_rewind_decl" >&5
-echo "${ECHO_T}$ice_cv_have_rewind_decl" >&6
-if test "$ice_cv_have_rewind_decl" = yes; then
+echo "$as_me:$LINENO: result: $ice_cv_have_realloc_decl" >&5
+echo "${ECHO_T}$ice_cv_have_realloc_decl" >&6
+if test "$ice_cv_have_realloc_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_REWIND_DECL 1
+#define HAVE_REALLOC_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-for ac_func in rmdir
+ice_have_recvfrom=no
+
+for ac_func in recvfrom
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -47172,14 +54228,78 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
+ ice_have_recvfrom=yes
+fi
+done
+
+if test "${ice_have_recvfrom}" = yes; then
+echo "$as_me:$LINENO: checking for recvfrom declaration in sys/types.h sys/socket.h" >&5
+echo $ECHO_N "checking for recvfrom declaration in sys/types.h sys/socket.h... $ECHO_C" >&6
+if test "${ice_cv_have_recvfrom_decl+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+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 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}recvfrom[      ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_recvfrom_decl=yes
+fi
+rm -f conftest*
+
+if test "$ice_cv_have_recvfrom_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}recvfrom[      ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_recvfrom_decl=yes
+fi
+rm -f conftest*
 
+if test "$ice_cv_have_recvfrom_decl" = yes; then
+       break
 fi
 done
 
+fi
 
-ice_have_ruserok=no
+echo "$as_me:$LINENO: result: $ice_cv_have_recvfrom_decl" >&5
+echo "${ECHO_T}$ice_cv_have_recvfrom_decl" >&6
+if test "$ice_cv_have_recvfrom_decl" = yes; then
 
-for ac_func in ruserok
+cat >>confdefs.h <<_ACEOF
+#define HAVE_RECVFROM_DECL 1
+_ACEOF
+
+fi
+fi
+
+
+ice_have_remove=no
+
+for ac_func in remove
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -47276,21 +54396,21 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_ruserok=yes
+ ice_have_remove=yes
 fi
 done
 
-if test "${ice_have_ruserok}" = yes; then
-echo "$as_me:$LINENO: checking for ruserok declaration in netdb.h sys/socket.h libc.h unistd.h" >&5
-echo $ECHO_N "checking for ruserok declaration in netdb.h sys/socket.h libc.h unistd.h... $ECHO_C" >&6
-if test "${ice_cv_have_ruserok_decl+set}" = set; then
+if test "${ice_have_remove}" = yes; then
+echo "$as_me:$LINENO: checking for remove declaration in stdio.h" >&5
+echo $ECHO_N "checking for remove declaration in stdio.h... $ECHO_C" >&6
+if test "${ice_cv_have_remove_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_ruserok_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 netdb.h sys/socket.h libc.h unistd.h; do
+for header in stdio.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -47302,12 +54422,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}ruserok[       ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_ruserok_decl=yes
+  $EGREP "${ice_re_word}remove[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_remove_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_ruserok_decl" = yes; then
+if test "$ice_cv_have_remove_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -47321,33 +54441,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}ruserok[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_ruserok_decl=yes
+  $EGREP "${ice_re_word}remove[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_remove_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_ruserok_decl" = yes; then
+if test "$ice_cv_have_remove_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_ruserok_decl" >&5
-echo "${ECHO_T}$ice_cv_have_ruserok_decl" >&6
-if test "$ice_cv_have_ruserok_decl" = yes; then
+echo "$as_me:$LINENO: result: $ice_cv_have_remove_decl" >&5
+echo "${ECHO_T}$ice_cv_have_remove_decl" >&6
+if test "$ice_cv_have_remove_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_RUSEROK_DECL 1
+#define HAVE_REMOVE_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_select=no
+ice_have_rename=no
 
-for ac_func in select
+for ac_func in rename
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -47444,21 +54564,21 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_select=yes
+ ice_have_rename=yes
 fi
 done
 
-if test "${ice_have_select}" = yes; then
-echo "$as_me:$LINENO: checking for select declaration in sys/types.h sys/socket.h sys/select.h time.h sys/time.h" >&5
-echo $ECHO_N "checking for select declaration in sys/types.h sys/socket.h sys/select.h time.h sys/time.h... $ECHO_C" >&6
-if test "${ice_cv_have_select_decl+set}" = set; then
+if test "${ice_have_rename}" = yes; then
+echo "$as_me:$LINENO: checking for rename declaration in stdio.h" >&5
+echo $ECHO_N "checking for rename declaration in stdio.h... $ECHO_C" >&6
+if test "${ice_cv_have_rename_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_select_decl=no
+ice_cv_have_rename_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in sys/types.h sys/socket.h sys/select.h time.h sys/time.h; do
+for header in stdio.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -47470,12 +54590,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}select[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_select_decl=yes
+  $EGREP "${ice_re_word}rename[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_rename_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_select_decl" = yes; then
+if test "$ice_cv_have_rename_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -47489,104 +54609,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}select[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_select_decl=yes
+  $EGREP "${ice_re_word}rename[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_rename_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_select_decl" = yes; then
+if test "$ice_cv_have_rename_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_select_decl" >&5
-echo "${ECHO_T}$ice_cv_have_select_decl" >&6
-if test "$ice_cv_have_select_decl" = yes; then
+echo "$as_me:$LINENO: result: $ice_cv_have_rename_decl" >&5
+echo "${ECHO_T}$ice_cv_have_rename_decl" >&6
+if test "$ice_cv_have_rename_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SELECT_DECL 1
+#define HAVE_RENAME_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-       echo "$as_me:$LINENO: checking for select() argument type" >&5
-echo $ECHO_N "checking for select() argument type... $ECHO_C" >&6
-if test "${amanda_cv_select_arg_type+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-               rm -f conftest.c
-               cat <<EOF >conftest.$ac_ext
-#include "confdefs.h"
-#ifdef HAVE_SYS_TIME_H
-# include <sys/time.h>
-#endif
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_SELECT_H
-#  include <sys/select.h>
-#endif
-#ifdef HAVE_SYS_SOCKET_H
-#  include <sys/socket.h>
-#endif
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
-int main()
-{
-#ifdef FD_SET_POINTER
-       (void)select(0, (fd_set *) 0, (fd_set *) 0, (fd_set *) 0, 0);
-#else
-       (void)select(0, (int *) 0, (int *) 0, (int *) 0, 0);
-#endif
-       return 0;
-}
-EOF
-
-                                                                                                                               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
-echo "$as_me:$LINENO: result: $amanda_cv_select_arg_type" >&5
-echo "${ECHO_T}$amanda_cv_select_arg_type" >&6
-
-cat >>confdefs.h <<_ACEOF
-#define SELECT_ARG_TYPE $amanda_cv_select_arg_type
-_ACEOF
-
-
-
-
-ice_have_sendto=no
+ice_have_rewind=no
 
-for ac_func in sendto
+for ac_func in rewind
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -47683,21 +54732,21 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_sendto=yes
+ ice_have_rewind=yes
 fi
 done
 
-if test "${ice_have_sendto}" = yes; then
-echo "$as_me:$LINENO: checking for sendto declaration in sys/types.h sys/socket.h" >&5
-echo $ECHO_N "checking for sendto declaration in sys/types.h sys/socket.h... $ECHO_C" >&6
-if test "${ice_cv_have_sendto_decl+set}" = set; then
+if test "${ice_have_rewind}" = yes; then
+echo "$as_me:$LINENO: checking for rewind declaration in stdio.h" >&5
+echo $ECHO_N "checking for rewind declaration in stdio.h... $ECHO_C" >&6
+if test "${ice_cv_have_rewind_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_sendto_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 sys/types.h sys/socket.h; do
+for header in stdio.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -47709,12 +54758,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}sendto[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_sendto_decl=yes
+  $EGREP "${ice_re_word}rewind[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_rewind_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_sendto_decl" = yes; then
+if test "$ice_cv_have_rewind_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -47728,33 +54777,31 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}sendto[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_sendto_decl=yes
+  $EGREP "${ice_re_word}rewind[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_rewind_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_sendto_decl" = yes; then
+if test "$ice_cv_have_rewind_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_sendto_decl" >&5
-echo "${ECHO_T}$ice_cv_have_sendto_decl" >&6
-if test "$ice_cv_have_sendto_decl" = yes; then
+echo "$as_me:$LINENO: result: $ice_cv_have_rewind_decl" >&5
+echo "${ECHO_T}$ice_cv_have_rewind_decl" >&6
+if test "$ice_cv_have_rewind_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SENDTO_DECL 1
+#define HAVE_REWIND_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_setegid=no
-
-for ac_func in setegid
+for ac_func in rmdir
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -47851,78 +54898,14 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_setegid=yes
-fi
-done
-
-if test "${ice_have_setegid}" = yes; then
-echo "$as_me:$LINENO: checking for setegid declaration in unistd.h" >&5
-echo $ECHO_N "checking for setegid declaration in unistd.h... $ECHO_C" >&6
-if test "${ice_cv_have_setegid_decl+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-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 unistd.h; do
-# Check for ordinary declaration
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}setegid[       ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_setegid_decl=yes
-fi
-rm -f conftest*
-
-if test "$ice_cv_have_setegid_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}setegid[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_setegid_decl=yes
-fi
-rm -f conftest*
-
-if test "$ice_cv_have_setegid_decl" = yes; then
-       break
 fi
 done
 
-fi
-
-echo "$as_me:$LINENO: result: $ice_cv_have_setegid_decl" >&5
-echo "${ECHO_T}$ice_cv_have_setegid_decl" >&6
-if test "$ice_cv_have_setegid_decl" = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_SETEGID_DECL 1
-_ACEOF
-
-fi
-fi
-
 
-ice_have_seteuid=no
+ice_have_ruserok=no
 
-for ac_func in seteuid
+for ac_func in ruserok
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -48019,21 +55002,21 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_seteuid=yes
+ ice_have_ruserok=yes
 fi
 done
 
-if test "${ice_have_seteuid}" = yes; then
-echo "$as_me:$LINENO: checking for seteuid declaration in unistd.h" >&5
-echo $ECHO_N "checking for seteuid declaration in unistd.h... $ECHO_C" >&6
-if test "${ice_cv_have_seteuid_decl+set}" = set; then
+if test "${ice_have_ruserok}" = yes; then
+echo "$as_me:$LINENO: checking for ruserok declaration in netdb.h sys/socket.h libc.h unistd.h" >&5
+echo $ECHO_N "checking for ruserok declaration in netdb.h sys/socket.h libc.h unistd.h... $ECHO_C" >&6
+if test "${ice_cv_have_ruserok_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_seteuid_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 unistd.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.  */
@@ -48045,12 +55028,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}seteuid[       ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_seteuid_decl=yes
+  $EGREP "${ice_re_word}ruserok[       ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_ruserok_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_seteuid_decl" = yes; then
+if test "$ice_cv_have_ruserok_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -48064,31 +55047,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}seteuid[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_seteuid_decl=yes
+  $EGREP "${ice_re_word}ruserok[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_ruserok_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_seteuid_decl" = yes; then
+if test "$ice_cv_have_ruserok_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_seteuid_decl" >&5
-echo "${ECHO_T}$ice_cv_have_seteuid_decl" >&6
-if test "$ice_cv_have_seteuid_decl" = yes; then
+echo "$as_me:$LINENO: result: $ice_cv_have_ruserok_decl" >&5
+echo "${ECHO_T}$ice_cv_have_ruserok_decl" >&6
+if test "$ice_cv_have_ruserok_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SETEUID_DECL 1
+#define HAVE_RUSEROK_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-for ac_func in setmntent
+ice_have_select=no
+
+for ac_func in select
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -48185,12 +55170,149 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
+ ice_have_select=yes
+fi
+done
+
+if test "${ice_have_select}" = yes; then
+echo "$as_me:$LINENO: checking for select declaration in sys/types.h sys/socket.h sys/select.h time.h sys/time.h" >&5
+echo $ECHO_N "checking for select declaration in sys/types.h sys/socket.h sys/select.h time.h sys/time.h... $ECHO_C" >&6
+if test "${ice_cv_have_select_decl+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+ice_cv_have_select_decl=no
+ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
+ice_re_word='(^|[^a-zA-Z0-9_])'
+for header in sys/types.h sys/socket.h sys/select.h 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}select[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_select_decl=yes
+fi
+rm -f conftest*
+
+if test "$ice_cv_have_select_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}select[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_select_decl=yes
+fi
+rm -f conftest*
 
+if test "$ice_cv_have_select_decl" = yes; then
+       break
 fi
 done
 
+fi
 
-for ac_func in shquote
+echo "$as_me:$LINENO: result: $ice_cv_have_select_decl" >&5
+echo "${ECHO_T}$ice_cv_have_select_decl" >&6
+if test "$ice_cv_have_select_decl" = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_SELECT_DECL 1
+_ACEOF
+
+fi
+fi
+
+
+       echo "$as_me:$LINENO: checking for select() argument type" >&5
+echo $ECHO_N "checking for select() argument type... $ECHO_C" >&6
+if test "${amanda_cv_select_arg_type+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+               rm -f conftest.c
+               cat <<EOF >conftest.$ac_ext
+#include "confdefs.h"
+#ifdef HAVE_SYS_TIME_H
+# include <sys/time.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_SELECT_H
+#  include <sys/select.h>
+#endif
+#ifdef HAVE_SYS_SOCKET_H
+#  include <sys/socket.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+int main()
+{
+#ifdef FD_SET_POINTER
+       (void)select(0, (fd_set *) 0, (fd_set *) 0, (fd_set *) 0, 0);
+#else
+       (void)select(0, (int *) 0, (int *) 0, (int *) 0, 0);
+#endif
+       return 0;
+}
+EOF
+
+                                                                                                                               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
+echo "$as_me:$LINENO: result: $amanda_cv_select_arg_type" >&5
+echo "${ECHO_T}$amanda_cv_select_arg_type" >&6
+
+cat >>confdefs.h <<_ACEOF
+#define SELECT_ARG_TYPE $amanda_cv_select_arg_type
+_ACEOF
+
+
+
+
+ice_have_sendto=no
+
+for ac_func in sendto
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -48287,15 +55409,78 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
+ ice_have_sendto=yes
+fi
+done
+
+if test "${ice_have_sendto}" = yes; then
+echo "$as_me:$LINENO: checking for sendto declaration in sys/types.h sys/socket.h" >&5
+echo $ECHO_N "checking for sendto declaration in sys/types.h sys/socket.h... $ECHO_C" >&6
+if test "${ice_cv_have_sendto_decl+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&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
 
+echo "$as_me:$LINENO: result: $ice_cv_have_sendto_decl" >&5
+echo "${ECHO_T}$ice_cv_have_sendto_decl" >&6
+if test "$ice_cv_have_sendto_decl" = yes; then
 
-ice_have_setresgid=no
+cat >>confdefs.h <<_ACEOF
+#define HAVE_SENDTO_DECL 1
+_ACEOF
 
-for ac_func in setresgid
+fi
+fi
+
+
+ice_have_setegid=no
+
+for ac_func in setegid
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -48392,18 +55577,18 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_setresgid=yes
+ ice_have_setegid=yes
 fi
 done
 
-if test "${ice_have_setresgid}" = yes; then
-echo "$as_me:$LINENO: checking for setresgid declaration in unistd.h" >&5
-echo $ECHO_N "checking for setresgid declaration in unistd.h... $ECHO_C" >&6
-if test "${ice_cv_have_setresgid_decl+set}" = set; then
+if test "${ice_have_setegid}" = yes; then
+echo "$as_me:$LINENO: checking for setegid declaration in unistd.h" >&5
+echo $ECHO_N "checking for setegid declaration in unistd.h... $ECHO_C" >&6
+if test "${ice_cv_have_setegid_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_setresgid_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 unistd.h; do
@@ -48418,12 +55603,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}setresgid[     ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_setresgid_decl=yes
+  $EGREP "${ice_re_word}setegid[       ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_setegid_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_setresgid_decl" = yes; then
+if test "$ice_cv_have_setegid_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -48437,33 +55622,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}setresgid[     ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_setresgid_decl=yes
+  $EGREP "${ice_re_word}setegid[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_setegid_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_setresgid_decl" = yes; then
+if test "$ice_cv_have_setegid_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_setresgid_decl" >&5
-echo "${ECHO_T}$ice_cv_have_setresgid_decl" >&6
-if test "$ice_cv_have_setresgid_decl" = yes; then
+echo "$as_me:$LINENO: result: $ice_cv_have_setegid_decl" >&5
+echo "${ECHO_T}$ice_cv_have_setegid_decl" >&6
+if test "$ice_cv_have_setegid_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SETRESGID_DECL 1
+#define HAVE_SETEGID_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_setresuid=no
+ice_have_seteuid=no
 
-for ac_func in setresuid
+for ac_func in seteuid
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -48560,18 +55745,18 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_setresuid=yes
+ ice_have_seteuid=yes
 fi
 done
 
-if test "${ice_have_setresuid}" = yes; then
-echo "$as_me:$LINENO: checking for setresuid declaration in unistd.h" >&5
-echo $ECHO_N "checking for setresuid declaration in unistd.h... $ECHO_C" >&6
-if test "${ice_cv_have_setresuid_decl+set}" = set; then
+if test "${ice_have_seteuid}" = yes; then
+echo "$as_me:$LINENO: checking for seteuid declaration in unistd.h" >&5
+echo $ECHO_N "checking for seteuid declaration in unistd.h... $ECHO_C" >&6
+if test "${ice_cv_have_seteuid_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_setresuid_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 unistd.h; do
@@ -48586,12 +55771,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}setresuid[     ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_setresuid_decl=yes
+  $EGREP "${ice_re_word}seteuid[       ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_seteuid_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_setresuid_decl" = yes; then
+if test "$ice_cv_have_seteuid_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -48605,33 +55790,36 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}setresuid[     ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_setresuid_decl=yes
+  $EGREP "${ice_re_word}seteuid[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_seteuid_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_setresuid_decl" = yes; then
+if test "$ice_cv_have_seteuid_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_setresuid_decl" >&5
-echo "${ECHO_T}$ice_cv_have_setresuid_decl" >&6
-if test "$ice_cv_have_setresuid_decl" = yes; then
+echo "$as_me:$LINENO: result: $ice_cv_have_seteuid_decl" >&5
+echo "${ECHO_T}$ice_cv_have_seteuid_decl" >&6
+if test "$ice_cv_have_seteuid_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SETRESUID_DECL 1
+#define HAVE_SETEUID_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-echo "$as_me:$LINENO: checking for setpgid" >&5
-echo $ECHO_N "checking for setpgid... $ECHO_C" >&6
-if test "${ac_cv_func_setpgid+set}" = set; then
+for ac_func in setmntent
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -48640,12 +55828,12 @@ _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.
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define setpgid innocuous_setpgid
+#define $ac_func innocuous_$ac_func
 
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char setpgid (); 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.  */
 
@@ -48655,7 +55843,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 # include <assert.h>
 #endif
 
-#undef setpgid
+#undef $ac_func
 
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
@@ -48664,14 +55852,14 @@ extern "C"
 #endif
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
-char setpgid ();
+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_setpgid) || defined (__stub___setpgid)
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
-char (*f) () = setpgid;
+char (*f) () = $ac_func;
 #endif
 #ifdef __cplusplus
 }
@@ -48680,7 +55868,7 @@ char (*f) () = setpgid;
 int
 main ()
 {
-return f != setpgid;
+return f != $ac_func;
   ;
   return 0;
 }
@@ -48707,29 +55895,28 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_func_setpgid=yes
+  eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_func_setpgid=no
+eval "$as_ac_var=no"
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_setpgid" >&5
-echo "${ECHO_T}$ac_cv_func_setpgid" >&6
-if test $ac_cv_func_setpgid = yes; then
-
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SETPGID 1
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
+fi
+done
 
-ice_have_setpgid=no
 
-for ac_func in setpgid
+for ac_func in shquote
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -48826,80 +56013,20 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_setpgid=yes
-fi
-done
 
-if test "${ice_have_setpgid}" = yes; then
-echo "$as_me:$LINENO: checking for setpgid declaration in sys/types.h unistd.h" >&5
-echo $ECHO_N "checking for setpgid declaration in sys/types.h unistd.h... $ECHO_C" >&6
-if test "${ice_cv_have_setpgid_decl+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-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 sys/types.h unistd.h; do
-# Check for ordinary declaration
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}setpgid[       ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_setpgid_decl=yes
-fi
-rm -f conftest*
-
-if test "$ice_cv_have_setpgid_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}setpgid[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_setpgid_decl=yes
-fi
-rm -f conftest*
-
-if test "$ice_cv_have_setpgid_decl" = yes; then
-       break
 fi
 done
 
-fi
-
-echo "$as_me:$LINENO: result: $ice_cv_have_setpgid_decl" >&5
-echo "${ECHO_T}$ice_cv_have_setpgid_decl" >&6
-if test "$ice_cv_have_setpgid_decl" = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_SETPGID_DECL 1
-_ACEOF
-
-fi
-fi
 
 
-fi
+ice_have_setresgid=no
 
-echo "$as_me:$LINENO: checking for setpgrp" >&5
-echo $ECHO_N "checking for setpgrp... $ECHO_C" >&6
-if test "${ac_cv_func_setpgrp+set}" = set; then
+for ac_func in setresgid
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -48908,12 +56035,12 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define setpgrp to an innocuous variant, in case <limits.h> declares setpgrp.
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define setpgrp innocuous_setpgrp
+#define $ac_func innocuous_$ac_func
 
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char setpgrp (); below.
+    which can conflict with char $ac_func (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
 
@@ -48923,7 +56050,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 # include <assert.h>
 #endif
 
-#undef setpgrp
+#undef $ac_func
 
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
@@ -48932,14 +56059,14 @@ extern "C"
 #endif
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
-char setpgrp ();
+char $ac_func ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_setpgrp) || defined (__stub___setpgrp)
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
 choke me
 #else
-char (*f) () = setpgrp;
+char (*f) () = $ac_func;
 #endif
 #ifdef __cplusplus
 }
@@ -48948,7 +56075,7 @@ char (*f) () = setpgrp;
 int
 main ()
 {
-return f != setpgrp;
+return f != $ac_func;
   ;
   return 0;
 }
@@ -48975,89 +56102,94 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_func_setpgrp=yes
+  eval "$as_ac_var=yes"
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-ac_cv_func_setpgrp=no
+eval "$as_ac_var=no"
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_setpgrp" >&5
-echo "${ECHO_T}$ac_cv_func_setpgrp" >&6
-if test $ac_cv_func_setpgrp = yes; then
-  echo "$as_me:$LINENO: checking whether setpgrp takes no argument" >&5
-echo $ECHO_N "checking whether setpgrp takes no argument... $ECHO_C" >&6
-if test "${ac_cv_func_setpgrp_void+set}" = set; then
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+ ice_have_setresgid=yes
+fi
+done
+
+if test "${ice_have_setresgid}" = yes; then
+echo "$as_me:$LINENO: checking for setresgid declaration in unistd.h" >&5
+echo $ECHO_N "checking for setresgid declaration in unistd.h... $ECHO_C" >&6
+if test "${ice_cv_have_setresgid_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  if test "$cross_compiling" = yes; then
-  { { echo "$as_me:$LINENO: error: cannot check setpgrp when cross compiling" >&5
-echo "$as_me: error: cannot check setpgrp when cross compiling" >&2;}
-   { (exit 1); exit 1; }; }
-else
-  cat >conftest.$ac_ext <<_ACEOF
+
+ice_cv_have_setresgid_decl=no
+ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
+ice_re_word='(^|[^a-zA-Z0-9_])'
+for header in unistd.h; do
+# Check for ordinary declaration
+cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
+#include <$header>
 
-int
-main ()
-{
-/* If this system has a BSD-style setpgrp which takes arguments,
-  setpgrp(1, 1) will fail with ESRCH and return -1, in that case
-  exit successfully. */
-  exit (setpgrp (1,1) == -1 ? 0 : 1);
-  ;
-  return 0;
-}
 _ACEOF
-rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_func_setpgrp_void=no
-else
-  echo "$as_me: program exited with status $ac_status" >&5
-echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}setresgid[     ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_setresgid_decl=yes
+fi
+rm -f conftest*
 
-( exit $ac_status )
-ac_cv_func_setpgrp_void=yes
+if test "$ice_cv_have_setresgid_decl" = yes; then
+       break
 fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+# Check for "fixed" declaration like "getpid _PARAMS((int))"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$header>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}setresgid[     ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_setresgid_decl=yes
 fi
+rm -f conftest*
+
+if test "$ice_cv_have_setresgid_decl" = yes; then
+       break
 fi
-echo "$as_me:$LINENO: result: $ac_cv_func_setpgrp_void" >&5
-echo "${ECHO_T}$ac_cv_func_setpgrp_void" >&6
-if test $ac_cv_func_setpgrp_void = yes; then
+done
 
-cat >>confdefs.h <<\_ACEOF
-#define SETPGRP_VOID 1
+fi
+
+echo "$as_me:$LINENO: result: $ice_cv_have_setresgid_decl" >&5
+echo "${ECHO_T}$ice_cv_have_setresgid_decl" >&6
+if test "$ice_cv_have_setresgid_decl" = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_SETRESGID_DECL 1
 _ACEOF
 
 fi
-
 fi
 
 
-ice_have_setpgrp=no
+ice_have_setresuid=no
 
-for ac_func in setpgrp
+for ac_func in setresuid
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -49154,21 +56286,21 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_setpgrp=yes
+ ice_have_setresuid=yes
 fi
 done
 
-if test "${ice_have_setpgrp}" = yes; then
-echo "$as_me:$LINENO: checking for setpgrp declaration in sys/types.h unistd.h libc.h" >&5
-echo $ECHO_N "checking for setpgrp declaration in sys/types.h unistd.h libc.h... $ECHO_C" >&6
-if test "${ice_cv_have_setpgrp_decl+set}" = set; then
+if test "${ice_have_setresuid}" = yes; then
+echo "$as_me:$LINENO: checking for setresuid declaration in unistd.h" >&5
+echo $ECHO_N "checking for setresuid declaration in unistd.h... $ECHO_C" >&6
+if test "${ice_cv_have_setresuid_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_setpgrp_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 sys/types.h unistd.h libc.h; do
+for header in unistd.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -49180,12 +56312,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}setpgrp[       ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_setpgrp_decl=yes
+  $EGREP "${ice_re_word}setresuid[     ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_setresuid_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_setpgrp_decl" = yes; then
+if test "$ice_cv_have_setresuid_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -49199,34 +56331,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}setpgrp[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_setpgrp_decl=yes
+  $EGREP "${ice_re_word}setresuid[     ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_setresuid_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_setpgrp_decl" = yes; then
+if test "$ice_cv_have_setresuid_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_setpgrp_decl" >&5
-echo "${ECHO_T}$ice_cv_have_setpgrp_decl" >&6
-if test "$ice_cv_have_setpgrp_decl" = yes; then
+echo "$as_me:$LINENO: result: $ice_cv_have_setresuid_decl" >&5
+echo "${ECHO_T}$ice_cv_have_setresuid_decl" >&6
+if test "$ice_cv_have_setresuid_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SETPGRP_DECL 1
+#define HAVE_SETRESUID_DECL 1
 _ACEOF
 
 fi
 fi
 
 
+ice_have_snprintf=no
 
-ice_have_setsockopt=no
-
-for ac_func in setsockopt
+for ac_func in snprintf
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -49323,21 +56454,21 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_setsockopt=yes
+ ice_have_snprintf=yes
 fi
 done
 
-if test "${ice_have_setsockopt}" = yes; then
-echo "$as_me:$LINENO: checking for setsockopt declaration in sys/types.h sys/socket.h" >&5
-echo $ECHO_N "checking for setsockopt declaration in sys/types.h sys/socket.h... $ECHO_C" >&6
-if test "${ice_cv_have_setsockopt_decl+set}" = set; then
+if test "${ice_have_snprintf}" = yes; then
+echo "$as_me:$LINENO: checking for snprintf declaration in stdio.h" >&5
+echo $ECHO_N "checking for snprintf declaration in stdio.h... $ECHO_C" >&6
+if test "${ice_cv_have_snprintf_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_setsockopt_decl=no
+ice_cv_have_snprintf_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in sys/types.h sys/socket.h; do
+for header in stdio.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -49349,12 +56480,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}setsockopt[    ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_setsockopt_decl=yes
+  $EGREP "${ice_re_word}snprintf[      ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_snprintf_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_setsockopt_decl" = yes; then
+if test "$ice_cv_have_snprintf_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -49368,32 +56499,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}setsockopt[    ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_setsockopt_decl=yes
+  $EGREP "${ice_re_word}snprintf[      ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_snprintf_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_setsockopt_decl" = yes; then
+if test "$ice_cv_have_snprintf_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_setsockopt_decl" >&5
-echo "${ECHO_T}$ice_cv_have_setsockopt_decl" >&6
-if test "$ice_cv_have_setsockopt_decl" = yes; then
+echo "$as_me:$LINENO: result: $ice_cv_have_snprintf_decl" >&5
+echo "${ECHO_T}$ice_cv_have_snprintf_decl" >&6
+if test "$ice_cv_have_snprintf_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SETSOCKOPT_DECL 1
+#define HAVE_SNPRINTF_DECL 1
 _ACEOF
 
 fi
 fi
 
 
+ice_have_vsnprintf=no
 
-for ac_func in shmget
+for ac_func in vsnprintf
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -49490,79 +56622,176 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
+ ice_have_vsnprintf=yes
+fi
+done
 
-
-       echo "$as_me:$LINENO: checking for shmdt() argument type" >&5
-echo $ECHO_N "checking for shmdt() argument type... $ECHO_C" >&6
-if test "${amanda_cv_shmdt_arg_type+set}" = set; then
+if test "${ice_have_vsnprintf}" = yes; then
+echo "$as_me:$LINENO: checking for vsnprintf declaration in stdio.h" >&5
+echo $ECHO_N "checking for vsnprintf declaration in stdio.h... $ECHO_C" >&6
+if test "${ice_cv_have_vsnprintf_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-               if test "$ac_cv_func_shmget" = yes; then
-                   cat <<EOF >conftest.$ac_ext
-#include "confdefs.h"
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_IPC_H
-# include <sys/ipc.h>
-#endif
-#ifdef HAVE_SYS_SHM_H
-# include <sys/shm.h>
-#endif
+ice_cv_have_vsnprintf_decl=no
+ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
+ice_re_word='(^|[^a-zA-Z0-9_])'
+for header in stdio.h; do
+# 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>
 
-#ifdef __cplusplus
-extern "C" void *shmat(int, void *, int);
-#else
-void *shmat();
-#endif
+_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
+fi
+rm -f conftest*
 
-int main()
-{
-    int i;
-    return 0;
-}
-EOF
-                   ${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext >/dev/null 2>/dev/null
-                   if test $? = 0; then
-                       amanda_cv_shmdt_arg_type=void
-                   else
-                       amanda_cv_shmdt_arg_type=char
-                   fi
-                   rm -f conftest*
-               else
-                   amanda_cv_shmdt_arg_type=nothing
-               fi
+if test "$ice_cv_have_vsnprintf_decl" = yes; then
+       break
+fi
+# Check for "fixed" declaration like "getpid _PARAMS((int))"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$header>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}vsnprintf[     ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_vsnprintf_decl=yes
+fi
+rm -f conftest*
 
+if test "$ice_cv_have_vsnprintf_decl" = yes; then
+       break
+fi
+done
 
 fi
-echo "$as_me:$LINENO: result: $amanda_cv_shmdt_arg_type" >&5
-echo "${ECHO_T}$amanda_cv_shmdt_arg_type" >&6
+
+echo "$as_me:$LINENO: result: $ice_cv_have_vsnprintf_decl" >&5
+echo "${ECHO_T}$ice_cv_have_vsnprintf_decl" >&6
+if test "$ice_cv_have_vsnprintf_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define SHM_ARG_TYPE $amanda_cv_shmdt_arg_type
+#define HAVE_VSNPRINTF_DECL 1
 _ACEOF
 
+fi
+fi
 
 
-       case "$FORCE_MMAP" in
-       n | no)
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_SYSVSHM 1
+echo "$as_me:$LINENO: checking for setpgid" >&5
+echo $ECHO_N "checking for setpgid... $ECHO_C" >&6
+if test "${ac_cv_func_setpgid+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
 _ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define setpgid to an innocuous variant, in case <limits.h> declares setpgid.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define setpgid innocuous_setpgid
 
-         ;;
-       esac
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char setpgid (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
 
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef setpgid
+
+/* Override any gcc2 internal prototype to avoid an error.  */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+   builtin and then its argument prototype would still apply.  */
+char setpgid ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_setpgid) || defined (__stub___setpgid)
+choke me
+#else
+char (*f) () = setpgid;
+#endif
+#ifdef __cplusplus
+}
+#endif
 
+int
+main ()
+{
+return f != setpgid;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } &&
+        { ac_try='test -z "$ac_c_werror_flag"
+                        || test ! -s conftest.err'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; } &&
+        { ac_try='test -s conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_setpgid=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_setpgid=no
 fi
-done
+rm -f conftest.err conftest.$ac_objext \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_setpgid" >&5
+echo "${ECHO_T}$ac_cv_func_setpgid" >&6
+if test $ac_cv_func_setpgid = yes; then
 
 
-ice_have_shmat=no
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_SETPGID 1
+_ACEOF
 
-for ac_func in shmat
+
+ice_have_setpgid=no
+
+for ac_func in setpgid
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -49659,21 +56888,21 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_shmat=yes
+ ice_have_setpgid=yes
 fi
 done
 
-if test "${ice_have_shmat}" = yes; then
-echo "$as_me:$LINENO: checking for shmat declaration in sys/types.h sys/ipc.h sys/shm.h" >&5
-echo $ECHO_N "checking for shmat declaration in sys/types.h sys/ipc.h sys/shm.h... $ECHO_C" >&6
-if test "${ice_cv_have_shmat_decl+set}" = set; then
+if test "${ice_have_setpgid}" = yes; then
+echo "$as_me:$LINENO: checking for setpgid declaration in sys/types.h unistd.h" >&5
+echo $ECHO_N "checking for setpgid declaration in sys/types.h unistd.h... $ECHO_C" >&6
+if test "${ice_cv_have_setpgid_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_shmat_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 sys/types.h sys/ipc.h sys/shm.h; do
+for header in sys/types.h unistd.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -49685,12 +56914,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}shmat[         ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_shmat_decl=yes
+  $EGREP "${ice_re_word}setpgid[       ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_setpgid_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_shmat_decl" = yes; then
+if test "$ice_cv_have_setpgid_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -49704,38 +56933,35 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}shmat[         ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_shmat_decl=yes
+  $EGREP "${ice_re_word}setpgid[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_setpgid_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_shmat_decl" = yes; then
+if test "$ice_cv_have_setpgid_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_shmat_decl" >&5
-echo "${ECHO_T}$ice_cv_have_shmat_decl" >&6
-if test "$ice_cv_have_shmat_decl" = yes; then
+echo "$as_me:$LINENO: result: $ice_cv_have_setpgid_decl" >&5
+echo "${ECHO_T}$ice_cv_have_setpgid_decl" >&6
+if test "$ice_cv_have_setpgid_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SHMAT_DECL 1
+#define HAVE_SETPGID_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_shmctl=no
+fi
 
-for ac_func in shmctl
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+echo "$as_me:$LINENO: checking for setpgrp" >&5
+echo $ECHO_N "checking for setpgrp... $ECHO_C" >&6
+if test "${ac_cv_func_setpgrp+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
   cat >conftest.$ac_ext <<_ACEOF
@@ -49744,12 +56970,12 @@ _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+/* Define setpgrp to an innocuous variant, in case <limits.h> declares setpgrp.
    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
+#define setpgrp innocuous_setpgrp
 
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
+    which can conflict with char setpgrp (); below.
     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
     <limits.h> exists even on freestanding compilers.  */
 
@@ -49759,7 +56985,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 # include <assert.h>
 #endif
 
-#undef $ac_func
+#undef setpgrp
 
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
@@ -49768,14 +56994,14 @@ extern "C"
 #endif
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
-char $ac_func ();
+char setpgrp ();
 /* The GNU C library defines this for functions which it implements
     to always fail with ENOSYS.  Some functions are actually named
     something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+#if defined (__stub_setpgrp) || defined (__stub___setpgrp)
 choke me
 #else
-char (*f) () = $ac_func;
+char (*f) () = setpgrp;
 #endif
 #ifdef __cplusplus
 }
@@ -49784,7 +57010,7 @@ char (*f) () = $ac_func;
 int
 main ()
 {
-return f != $ac_func;
+return f != setpgrp;
   ;
   return 0;
 }
@@ -49811,94 +57037,89 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  ac_cv_func_setpgrp=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+ac_cv_func_setpgrp=no
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
- ice_have_shmctl=yes
-fi
-done
-
-if test "${ice_have_shmctl}" = yes; then
-echo "$as_me:$LINENO: checking for shmctl declaration in sys/types.h sys/ipc.h sys/shm.h" >&5
-echo $ECHO_N "checking for shmctl declaration in sys/types.h sys/ipc.h sys/shm.h... $ECHO_C" >&6
-if test "${ice_cv_have_shmctl_decl+set}" = set; then
+echo "$as_me:$LINENO: result: $ac_cv_func_setpgrp" >&5
+echo "${ECHO_T}$ac_cv_func_setpgrp" >&6
+if test $ac_cv_func_setpgrp = yes; then
+  echo "$as_me:$LINENO: checking whether setpgrp takes no argument" >&5
+echo $ECHO_N "checking whether setpgrp takes no argument... $ECHO_C" >&6
+if test "${ac_cv_func_setpgrp_void+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-
-ice_cv_have_shmctl_decl=no
-ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
-ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in sys/types.h sys/ipc.h sys/shm.h; do
-# Check for ordinary declaration
-cat >conftest.$ac_ext <<_ACEOF
+  if test "$cross_compiling" = yes; then
+  { { echo "$as_me:$LINENO: error: cannot check setpgrp when cross compiling" >&5
+echo "$as_me: error: cannot check setpgrp when cross compiling" >&2;}
+   { (exit 1); exit 1; }; }
+else
+  cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <$header>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}shmctl[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_shmctl_decl=yes
-fi
-rm -f conftest*
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
 
-if test "$ice_cv_have_shmctl_decl" = yes; then
-       break
-fi
-# Check for "fixed" declaration like "getpid _PARAMS((int))"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
+int
+main ()
+{
+/* If this system has a BSD-style setpgrp which takes arguments,
+  setpgrp(1, 1) will fail with ESRCH and return -1, in that case
+  exit successfully. */
+  exit (setpgrp (1,1) == -1 ? 0 : 1);
+  ;
+  return 0;
+}
 _ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  ac_cv_func_setpgrp_void=no
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}shmctl[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_shmctl_decl=yes
+( exit $ac_status )
+ac_cv_func_setpgrp_void=yes
 fi
-rm -f conftest*
-
-if test "$ice_cv_have_shmctl_decl" = yes; then
-       break
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
 fi
-done
-
 fi
+echo "$as_me:$LINENO: result: $ac_cv_func_setpgrp_void" >&5
+echo "${ECHO_T}$ac_cv_func_setpgrp_void" >&6
+if test $ac_cv_func_setpgrp_void = yes; then
 
-echo "$as_me:$LINENO: result: $ice_cv_have_shmctl_decl" >&5
-echo "${ECHO_T}$ice_cv_have_shmctl_decl" >&6
-if test "$ice_cv_have_shmctl_decl" = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_SHMCTL_DECL 1
+cat >>confdefs.h <<\_ACEOF
+#define SETPGRP_VOID 1
 _ACEOF
 
 fi
+
 fi
 
 
-ice_have_shmdt=no
+ice_have_setpgrp=no
 
-for ac_func in shmdt
+for ac_func in setpgrp
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -49995,21 +57216,21 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_shmdt=yes
+ ice_have_setpgrp=yes
 fi
 done
 
-if test "${ice_have_shmdt}" = yes; then
-echo "$as_me:$LINENO: checking for shmdt declaration in sys/types.h sys/ipc.h sys/shm.h" >&5
-echo $ECHO_N "checking for shmdt declaration in sys/types.h sys/ipc.h sys/shm.h... $ECHO_C" >&6
-if test "${ice_cv_have_shmdt_decl+set}" = set; then
+if test "${ice_have_setpgrp}" = yes; then
+echo "$as_me:$LINENO: checking for setpgrp declaration in sys/types.h unistd.h libc.h" >&5
+echo $ECHO_N "checking for setpgrp declaration in sys/types.h unistd.h libc.h... $ECHO_C" >&6
+if test "${ice_cv_have_setpgrp_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_shmdt_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 sys/types.h sys/ipc.h sys/shm.h; do
+for header in sys/types.h unistd.h libc.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -50021,12 +57242,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}shmdt[         ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_shmdt_decl=yes
+  $EGREP "${ice_re_word}setpgrp[       ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_setpgrp_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_shmdt_decl" = yes; then
+if test "$ice_cv_have_setpgrp_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -50040,33 +57261,34 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}shmdt[         ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_shmdt_decl=yes
+  $EGREP "${ice_re_word}setpgrp[       ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_setpgrp_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_shmdt_decl" = yes; then
+if test "$ice_cv_have_setpgrp_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_shmdt_decl" >&5
-echo "${ECHO_T}$ice_cv_have_shmdt_decl" >&6
-if test "$ice_cv_have_shmdt_decl" = yes; then
+echo "$as_me:$LINENO: result: $ice_cv_have_setpgrp_decl" >&5
+echo "${ECHO_T}$ice_cv_have_setpgrp_decl" >&6
+if test "$ice_cv_have_setpgrp_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SHMDT_DECL 1
+#define HAVE_SETPGRP_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_shmget=no
 
-for ac_func in shmget
+ice_have_setsockopt=no
+
+for ac_func in setsockopt
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -50163,21 +57385,21 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_shmget=yes
+ ice_have_setsockopt=yes
 fi
 done
 
-if test "${ice_have_shmget}" = yes; then
-echo "$as_me:$LINENO: checking for shmget declaration in sys/types.h sys/ipc.h sys/shm.h" >&5
-echo $ECHO_N "checking for shmget declaration in sys/types.h sys/ipc.h sys/shm.h... $ECHO_C" >&6
-if test "${ice_cv_have_shmget_decl+set}" = set; then
+if test "${ice_have_setsockopt}" = yes; then
+echo "$as_me:$LINENO: checking for setsockopt declaration in sys/types.h sys/socket.h" >&5
+echo $ECHO_N "checking for setsockopt declaration in sys/types.h sys/socket.h... $ECHO_C" >&6
+if test "${ice_cv_have_setsockopt_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_shmget_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/ipc.h sys/shm.h; do
+for header in sys/types.h sys/socket.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -50189,12 +57411,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}shmget[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_shmget_decl=yes
+  $EGREP "${ice_re_word}setsockopt[    ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_setsockopt_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_shmget_decl" = yes; then
+if test "$ice_cv_have_setsockopt_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -50208,55 +57430,32 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}shmget[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_shmget_decl=yes
+  $EGREP "${ice_re_word}setsockopt[    ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_setsockopt_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_shmget_decl" = yes; then
+if test "$ice_cv_have_setsockopt_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_shmget_decl" >&5
-echo "${ECHO_T}$ice_cv_have_shmget_decl" >&6
-if test "$ice_cv_have_shmget_decl" = yes; then
+echo "$as_me:$LINENO: result: $ice_cv_have_setsockopt_decl" >&5
+echo "${ECHO_T}$ice_cv_have_setsockopt_decl" >&6
+if test "$ice_cv_have_setsockopt_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SHMGET_DECL 1
+#define HAVE_SETSOCKOPT_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-if test "x$ac_cv_func_mmap_fixed_mapped" != xyes; then
-    case "$FORCE_MMAP" in
-    n | no)
-       if test "x$ac_cv_func_shmget" != xyes; then
-           { echo "$as_me:$LINENO: WARNING: *** Neither shmget() nor mmap() found!" >&5
-echo "$as_me: WARNING: *** Neither shmget() nor mmap() found!" >&2;}
-           { echo "$as_me:$LINENO: WARNING: *** This system will not support the Amanda server." >&5
-echo "$as_me: WARNING: *** This system will not support the Amanda server." >&2;}
-           NO_SERVER_MODE=true
-       fi
-      ;;
-    y | ye | yes)
-       { echo "$as_me:$LINENO: WARNING: *** --with-mmap used on a system with no mmap() support!" >&5
-echo "$as_me: WARNING: *** --with-mmap used on a system with no mmap() support!" >&2;}
-       { echo "$as_me:$LINENO: WARNING: *** This system will not support the Amanda server." >&5
-echo "$as_me: WARNING: *** This system will not support the Amanda server." >&2;}
-       NO_SERVER_MODE=true
-      ;;
-    esac
-fi
-
 
-ice_have_snprintf=no
-
-for ac_func in snprintf
+for ac_func in shmget
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -50353,78 +57552,79 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_snprintf=yes
-fi
-done
 
-if test "${ice_have_snprintf}" = yes; then
-echo "$as_me:$LINENO: checking for snprintf declaration in stdio.h" >&5
-echo $ECHO_N "checking for snprintf declaration in stdio.h... $ECHO_C" >&6
-if test "${ice_cv_have_snprintf_decl+set}" = set; then
+
+       echo "$as_me:$LINENO: checking for shmdt() argument type" >&5
+echo $ECHO_N "checking for shmdt() argument type... $ECHO_C" >&6
+if test "${amanda_cv_shmdt_arg_type+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-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
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
+               if test "$ac_cv_func_shmget" = yes; then
+                   cat <<EOF >conftest.$ac_ext
+#include "confdefs.h"
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_IPC_H
+# include <sys/ipc.h>
+#endif
+#ifdef HAVE_SYS_SHM_H
+# include <sys/shm.h>
+#endif
+
+#ifdef __cplusplus
+extern "C" void *shmat(int, void *, int);
+#else
+void *shmat();
+#endif
+
+int main()
+{
+    int i;
+    return 0;
+}
+EOF
+                   ${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext >/dev/null 2>/dev/null
+                   if test $? = 0; then
+                       amanda_cv_shmdt_arg_type=void
+                   else
+                       amanda_cv_shmdt_arg_type=char
+                   fi
+                   rm -f conftest*
+               else
+                   amanda_cv_shmdt_arg_type=nothing
+               fi
 
-_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
-fi
-rm -f conftest*
 
-if test "$ice_cv_have_snprintf_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>
+echo "$as_me:$LINENO: result: $amanda_cv_shmdt_arg_type" >&5
+echo "${ECHO_T}$amanda_cv_shmdt_arg_type" >&6
 
+cat >>confdefs.h <<_ACEOF
+#define SHM_ARG_TYPE $amanda_cv_shmdt_arg_type
 _ACEOF
-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
-fi
-rm -f conftest*
 
-if test "$ice_cv_have_snprintf_decl" = yes; then
-       break
-fi
-done
 
-fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_snprintf_decl" >&5
-echo "${ECHO_T}$ice_cv_have_snprintf_decl" >&6
-if test "$ice_cv_have_snprintf_decl" = yes; then
+       case "$FORCE_MMAP" in
+       n | no)
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_SNPRINTF_DECL 1
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_SYSVSHM 1
 _ACEOF
 
+         ;;
+       esac
+
+
 fi
-fi
+done
 
 
-ice_have_vsnprintf=no
+ice_have_shmat=no
 
-for ac_func in vsnprintf
+for ac_func in shmat
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -50521,21 +57721,21 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_vsnprintf=yes
+ ice_have_shmat=yes
 fi
 done
 
-if test "${ice_have_vsnprintf}" = yes; then
-echo "$as_me:$LINENO: checking for vsnprintf declaration in stdio.h" >&5
-echo $ECHO_N "checking for vsnprintf declaration in stdio.h... $ECHO_C" >&6
-if test "${ice_cv_have_vsnprintf_decl+set}" = set; then
+if test "${ice_have_shmat}" = yes; then
+echo "$as_me:$LINENO: checking for shmat declaration in sys/types.h sys/ipc.h sys/shm.h" >&5
+echo $ECHO_N "checking for shmat declaration in sys/types.h sys/ipc.h sys/shm.h... $ECHO_C" >&6
+if test "${ice_cv_have_shmat_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_vsnprintf_decl=no
+ice_cv_have_shmat_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in stdio.h; do
+for header in sys/types.h sys/ipc.h sys/shm.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -50547,12 +57747,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}vsnprintf[     ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_vsnprintf_decl=yes
+  $EGREP "${ice_re_word}shmat[         ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_shmat_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_vsnprintf_decl" = yes; then
+if test "$ice_cv_have_shmat_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -50566,42 +57766,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}vsnprintf[     ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_vsnprintf_decl=yes
+  $EGREP "${ice_re_word}shmat[         ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_shmat_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_vsnprintf_decl" = yes; then
+if test "$ice_cv_have_shmat_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_vsnprintf_decl" >&5
-echo "${ECHO_T}$ice_cv_have_vsnprintf_decl" >&6
-if test "$ice_cv_have_vsnprintf_decl" = yes; then
+echo "$as_me:$LINENO: result: $ice_cv_have_shmat_decl" >&5
+echo "${ECHO_T}$ice_cv_have_shmat_decl" >&6
+if test "$ice_cv_have_shmat_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_VSNPRINTF_DECL 1
+#define HAVE_SHMAT_DECL 1
 _ACEOF
 
 fi
 fi
 
-if test x"$ice_have_snprintf" != x"yes" ||
-   test x"$ice_have_vsnprintf" != x"yes"; then
-    case $LIBOBJS in
-    "snprintf.$ac_objext"   | \
-  *" snprintf.$ac_objext"   | \
-    "snprintf.$ac_objext "* | \
-  *" snprintf.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS snprintf.$ac_objext" ;;
-esac
 
-    if false; then :
+ice_have_shmctl=no
 
-for ac_func in snprintf
+for ac_func in shmctl
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -50698,27 +57889,78 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
+ ice_have_shmctl=yes
+fi
+done
 
+if test "${ice_have_shmctl}" = yes; then
+echo "$as_me:$LINENO: checking for shmctl declaration in sys/types.h sys/ipc.h sys/shm.h" >&5
+echo $ECHO_N "checking for shmctl declaration in sys/types.h sys/ipc.h sys/shm.h... $ECHO_C" >&6
+if test "${ice_cv_have_shmctl_decl+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case $LIBOBJS in
-    "$ac_func.$ac_objext"   | \
-  *" $ac_func.$ac_objext"   | \
-    "$ac_func.$ac_objext "* | \
-  *" $ac_func.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;;
-esac
 
+ice_cv_have_shmctl_decl=no
+ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
+ice_re_word='(^|[^a-zA-Z0-9_])'
+for header in sys/types.h sys/ipc.h sys/shm.h; do
+# Check for ordinary declaration
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$header>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}shmctl[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_shmctl_decl=yes
 fi
-done
+rm -f conftest*
+
+if test "$ice_cv_have_shmctl_decl" = yes; then
+       break
+fi
+# Check for "fixed" declaration like "getpid _PARAMS((int))"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$header>
 
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}shmctl[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_shmctl_decl=yes
+fi
+rm -f conftest*
 
-    fi
+if test "$ice_cv_have_shmctl_decl" = yes; then
+       break
 fi
+done
 
+fi
 
+echo "$as_me:$LINENO: result: $ice_cv_have_shmctl_decl" >&5
+echo "${ECHO_T}$ice_cv_have_shmctl_decl" >&6
+if test "$ice_cv_have_shmctl_decl" = yes; then
 
+cat >>confdefs.h <<_ACEOF
+#define HAVE_SHMCTL_DECL 1
+_ACEOF
 
-for ac_func in sigaction sigemptyset sigvec
+fi
+fi
+
+
+ice_have_shmdt=no
+
+for ac_func in shmdt
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -50815,14 +58057,78 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
+ ice_have_shmdt=yes
+fi
+done
+
+if test "${ice_have_shmdt}" = yes; then
+echo "$as_me:$LINENO: checking for shmdt declaration in sys/types.h sys/ipc.h sys/shm.h" >&5
+echo $ECHO_N "checking for shmdt declaration in sys/types.h sys/ipc.h sys/shm.h... $ECHO_C" >&6
+if test "${ice_cv_have_shmdt_decl+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
 
+ice_cv_have_shmdt_decl=no
+ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
+ice_re_word='(^|[^a-zA-Z0-9_])'
+for header in sys/types.h sys/ipc.h sys/shm.h; do
+# Check for ordinary declaration
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$header>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}shmdt[         ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_shmdt_decl=yes
+fi
+rm -f conftest*
+
+if test "$ice_cv_have_shmdt_decl" = yes; then
+       break
+fi
+# Check for "fixed" declaration like "getpid _PARAMS((int))"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$header>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}shmdt[         ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_shmdt_decl=yes
+fi
+rm -f conftest*
+
+if test "$ice_cv_have_shmdt_decl" = yes; then
+       break
 fi
 done
 
+fi
 
-ice_have_socket=no
+echo "$as_me:$LINENO: result: $ice_cv_have_shmdt_decl" >&5
+echo "${ECHO_T}$ice_cv_have_shmdt_decl" >&6
+if test "$ice_cv_have_shmdt_decl" = yes; then
 
-for ac_func in socket
+cat >>confdefs.h <<_ACEOF
+#define HAVE_SHMDT_DECL 1
+_ACEOF
+
+fi
+fi
+
+
+ice_have_shmget=no
+
+for ac_func in shmget
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -50919,21 +58225,21 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_socket=yes
+ ice_have_shmget=yes
 fi
 done
 
-if test "${ice_have_socket}" = yes; then
-echo "$as_me:$LINENO: checking for socket declaration in sys/types.h sys/socket.h" >&5
-echo $ECHO_N "checking for socket declaration in sys/types.h sys/socket.h... $ECHO_C" >&6
-if test "${ice_cv_have_socket_decl+set}" = set; then
+if test "${ice_have_shmget}" = yes; then
+echo "$as_me:$LINENO: checking for shmget declaration in sys/types.h sys/ipc.h sys/shm.h" >&5
+echo $ECHO_N "checking for shmget declaration in sys/types.h sys/ipc.h sys/shm.h... $ECHO_C" >&6
+if test "${ice_cv_have_shmget_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_socket_decl=no
+ice_cv_have_shmget_decl=no
 ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
 ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in sys/types.h sys/socket.h; do
+for header in sys/types.h sys/ipc.h sys/shm.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -50945,12 +58251,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}socket[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_socket_decl=yes
+  $EGREP "${ice_re_word}shmget[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_shmget_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_socket_decl" = yes; then
+if test "$ice_cv_have_shmget_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -50964,33 +58270,55 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}socket[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_socket_decl=yes
+  $EGREP "${ice_re_word}shmget[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_shmget_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_socket_decl" = yes; then
+if test "$ice_cv_have_shmget_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_socket_decl" >&5
-echo "${ECHO_T}$ice_cv_have_socket_decl" >&6
-if test "$ice_cv_have_socket_decl" = yes; then
+echo "$as_me:$LINENO: result: $ice_cv_have_shmget_decl" >&5
+echo "${ECHO_T}$ice_cv_have_shmget_decl" >&6
+if test "$ice_cv_have_shmget_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SOCKET_DECL 1
+#define HAVE_SHMGET_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-ice_have_socketpair=no
+if test "x$ac_cv_func_mmap_fixed_mapped" != xyes; then
+    case "$FORCE_MMAP" in
+    n | no)
+       if test "x$ac_cv_func_shmget" != xyes; then
+           { echo "$as_me:$LINENO: WARNING: *** Neither shmget() nor mmap() found!" >&5
+echo "$as_me: WARNING: *** Neither shmget() nor mmap() found!" >&2;}
+           { echo "$as_me:$LINENO: WARNING: *** This system will not support the Amanda server." >&5
+echo "$as_me: WARNING: *** This system will not support the Amanda server." >&2;}
+           NO_SERVER_MODE=true
+       fi
+      ;;
+    y | ye | yes)
+       { echo "$as_me:$LINENO: WARNING: *** --with-mmap used on a system with no mmap() support!" >&5
+echo "$as_me: WARNING: *** --with-mmap used on a system with no mmap() support!" >&2;}
+       { echo "$as_me:$LINENO: WARNING: *** This system will not support the Amanda server." >&5
+echo "$as_me: WARNING: *** This system will not support the Amanda server." >&2;}
+       NO_SERVER_MODE=true
+      ;;
+    esac
+fi
 
-for ac_func in socketpair
+
+
+
+for ac_func in sigaction sigemptyset sigvec
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -51087,78 +58415,14 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_socketpair=yes
-fi
-done
-
-if test "${ice_have_socketpair}" = yes; then
-echo "$as_me:$LINENO: checking for socketpair declaration in sys/types.h sys/socket.h" >&5
-echo $ECHO_N "checking for socketpair declaration in sys/types.h sys/socket.h... $ECHO_C" >&6
-if test "${ice_cv_have_socketpair_decl+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-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 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}socketpair[    ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_socketpair_decl=yes
-fi
-rm -f conftest*
 
-if test "$ice_cv_have_socketpair_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}socketpair[    ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_socketpair_decl=yes
-fi
-rm -f conftest*
-
-if test "$ice_cv_have_socketpair_decl" = yes; then
-       break
 fi
 done
 
-fi
-
-echo "$as_me:$LINENO: result: $ice_cv_have_socketpair_decl" >&5
-echo "${ECHO_T}$ice_cv_have_socketpair_decl" >&6
-if test "$ice_cv_have_socketpair_decl" = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_SOCKETPAIR_DECL 1
-_ACEOF
-
-fi
-fi
-
 
-ice_have_sscanf=no
+ice_have_socket=no
 
-for ac_func in sscanf
+for ac_func in socket
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -51255,21 +58519,21 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_sscanf=yes
+ ice_have_socket=yes
 fi
 done
 
-if test "${ice_have_sscanf}" = yes; then
-echo "$as_me:$LINENO: checking for sscanf declaration in stdio.h" >&5
-echo $ECHO_N "checking for sscanf declaration in stdio.h... $ECHO_C" >&6
-if test "${ice_cv_have_sscanf_decl+set}" = set; then
+if test "${ice_have_socket}" = yes; then
+echo "$as_me:$LINENO: checking for socket declaration in sys/types.h sys/socket.h" >&5
+echo $ECHO_N "checking for socket declaration in sys/types.h sys/socket.h... $ECHO_C" >&6
+if test "${ice_cv_have_socket_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_sscanf_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 stdio.h; do
+for header in sys/types.h sys/socket.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -51281,12 +58545,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}sscanf[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_sscanf_decl=yes
+  $EGREP "${ice_re_word}socket[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_socket_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_sscanf_decl" = yes; then
+if test "$ice_cv_have_socket_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -51300,32 +58564,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}sscanf[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_sscanf_decl=yes
+  $EGREP "${ice_re_word}socket[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_socket_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_sscanf_decl" = yes; then
+if test "$ice_cv_have_socket_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_sscanf_decl" >&5
-echo "${ECHO_T}$ice_cv_have_sscanf_decl" >&6
-if test "$ice_cv_have_sscanf_decl" = yes; then
+echo "$as_me:$LINENO: result: $ice_cv_have_socket_decl" >&5
+echo "${ECHO_T}$ice_cv_have_socket_decl" >&6
+if test "$ice_cv_have_socket_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_SSCANF_DECL 1
+#define HAVE_SOCKET_DECL 1
 _ACEOF
 
 fi
 fi
 
 
+ice_have_socketpair=no
 
-for ac_func in statfs statvfs
+for ac_func in socketpair
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -51422,126 +58687,78 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
-
+ ice_have_socketpair=yes
 fi
 done
 
-
-for ac_func in strerror
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+if test "${ice_have_socketpair}" = yes; then
+echo "$as_me:$LINENO: checking for socketpair declaration in sys/types.h sys/socket.h" >&5
+echo $ECHO_N "checking for socketpair declaration in sys/types.h sys/socket.h... $ECHO_C" >&6
+if test "${ice_cv_have_socketpair_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  cat >conftest.$ac_ext <<_ACEOF
+
+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 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.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
+#include <$header>
 
-int
-main ()
-{
-return f != $ac_func;
-  ;
-  return 0;
-}
 _ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-eval "$as_ac_var=no"
+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
 fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
+rm -f conftest*
+
+if test "$ice_cv_have_socketpair_decl" = yes; then
+       break
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+# 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>
 
-else
-  case $LIBOBJS in
-    "$ac_func.$ac_objext"   | \
-  *" $ac_func.$ac_objext"   | \
-    "$ac_func.$ac_objext "* | \
-  *" $ac_func.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;;
-esac
+_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
+fi
+rm -f conftest*
 
+if test "$ice_cv_have_socketpair_decl" = yes; then
+       break
 fi
 done
 
+fi
 
+echo "$as_me:$LINENO: result: $ice_cv_have_socketpair_decl" >&5
+echo "${ECHO_T}$ice_cv_have_socketpair_decl" >&6
+if test "$ice_cv_have_socketpair_decl" = yes; then
 
-ice_have_strerror=no
+cat >>confdefs.h <<_ACEOF
+#define HAVE_SOCKETPAIR_DECL 1
+_ACEOF
 
-for ac_func in strerror
+fi
+fi
+
+
+ice_have_sscanf=no
+
+for ac_func in sscanf
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -51638,21 +58855,21 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_strerror=yes
+ ice_have_sscanf=yes
 fi
 done
 
-if test "${ice_have_strerror}" = yes; then
-echo "$as_me:$LINENO: checking for strerror declaration in string.h strings.h" >&5
-echo $ECHO_N "checking for strerror declaration in string.h strings.h... $ECHO_C" >&6
-if test "${ice_cv_have_strerror_decl+set}" = set; then
+if test "${ice_have_sscanf}" = yes; then
+echo "$as_me:$LINENO: checking for sscanf declaration in stdio.h" >&5
+echo $ECHO_N "checking for sscanf declaration in stdio.h... $ECHO_C" >&6
+if test "${ice_cv_have_sscanf_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_strerror_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 string.h strings.h; do
+for header in stdio.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -51664,12 +58881,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}strerror[      ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_strerror_decl=yes
+  $EGREP "${ice_re_word}sscanf[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_sscanf_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_strerror_decl" = yes; then
+if test "$ice_cv_have_sscanf_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -51683,31 +58900,32 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}strerror[      ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_strerror_decl=yes
+  $EGREP "${ice_re_word}sscanf[        ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_sscanf_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_strerror_decl" = yes; then
+if test "$ice_cv_have_sscanf_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_strerror_decl" >&5
-echo "${ECHO_T}$ice_cv_have_strerror_decl" >&6
-if test "$ice_cv_have_strerror_decl" = yes; then
+echo "$as_me:$LINENO: result: $ice_cv_have_sscanf_decl" >&5
+echo "${ECHO_T}$ice_cv_have_sscanf_decl" >&6
+if test "$ice_cv_have_sscanf_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_STRERROR_DECL 1
+#define HAVE_SSCANF_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-for ac_func in strftime
+
+for ac_func in statfs statvfs
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -51805,85 +59023,13 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
 
-else
-  # strftime is in -lintl on SCO UNIX.
-echo "$as_me:$LINENO: checking for strftime in -lintl" >&5
-echo $ECHO_N "checking for strftime in -lintl... $ECHO_C" >&6
-if test "${ac_cv_lib_intl_strftime+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lintl  $LIBS"
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char strftime ();
-int
-main ()
-{
-strftime ();
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  ac_cv_lib_intl_strftime=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-ac_cv_lib_intl_strftime=no
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-echo "$as_me:$LINENO: result: $ac_cv_lib_intl_strftime" >&5
-echo "${ECHO_T}$ac_cv_lib_intl_strftime" >&6
-if test $ac_cv_lib_intl_strftime = yes; then
-  cat >>confdefs.h <<\_ACEOF
-#define HAVE_STRFTIME 1
-_ACEOF
-
-LIBS="-lintl $LIBS"
-fi
-
 fi
 done
 
 
-for ac_func in strftime
+ice_have_strerror=no
+
+for ac_func in strerror
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -51980,22 +59126,74 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
+ ice_have_strerror=yes
+fi
+done
 
+if test "${ice_have_strerror}" = yes; then
+echo "$as_me:$LINENO: checking for strerror declaration in string.h strings.h" >&5
+echo $ECHO_N "checking for strerror declaration in string.h strings.h... $ECHO_C" >&6
+if test "${ice_cv_have_strerror_decl+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case $LIBOBJS in
-    "$ac_func.$ac_objext"   | \
-  *" $ac_func.$ac_objext"   | \
-    "$ac_func.$ac_objext "* | \
-  *" $ac_func.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;;
-esac
 
+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 string.h strings.h; do
+# Check for ordinary declaration
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$header>
+
+_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
+fi
+rm -f conftest*
+
+if test "$ice_cv_have_strerror_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}strerror[      ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_strerror_decl=yes
+fi
+rm -f conftest*
+
+if test "$ice_cv_have_strerror_decl" = yes; then
+       break
 fi
 done
 
+fi
 
+echo "$as_me:$LINENO: result: $ice_cv_have_strerror_decl" >&5
+echo "${ECHO_T}$ice_cv_have_strerror_decl" >&6
+if test "$ice_cv_have_strerror_decl" = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRERROR_DECL 1
+_ACEOF
+
+fi
+fi
 
-ice_have_strftime=no
 
 for ac_func in strftime
 do
@@ -52094,130 +59292,34 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_strftime=yes
-fi
-done
 
-if test "${ice_have_strftime}" = yes; then
-echo "$as_me:$LINENO: checking for strftime declaration in time.h sys/time.h" >&5
-echo $ECHO_N "checking for strftime declaration in time.h sys/time.h... $ECHO_C" >&6
-if test "${ice_cv_have_strftime_decl+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-
-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 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}strftime[      ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_strftime_decl=yes
-fi
-rm -f conftest*
-
-if test "$ice_cv_have_strftime_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}strftime[      ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_strftime_decl=yes
-fi
-rm -f conftest*
-
-if test "$ice_cv_have_strftime_decl" = yes; then
-       break
-fi
-done
-
-fi
-
-echo "$as_me:$LINENO: result: $ice_cv_have_strftime_decl" >&5
-echo "${ECHO_T}$ice_cv_have_strftime_decl" >&6
-if test "$ice_cv_have_strftime_decl" = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRFTIME_DECL 1
-_ACEOF
-
-fi
-fi
-
-
-for ac_func in strncasecmp
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+  # strftime is in -lintl on SCO UNIX.
+echo "$as_me:$LINENO: checking for strftime in -lintl" >&5
+echo $ECHO_N "checking for strftime in -lintl... $ECHO_C" >&6
+if test "${ac_cv_lib_intl_strftime+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  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.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
 
 /* Override any gcc2 internal prototype to avoid an error.  */
 #ifdef __cplusplus
 extern "C"
-{
 #endif
 /* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
+char strftime ();
 int
 main ()
 {
-return f != $ac_func;
+strftime ();
   ;
   return 0;
 }
@@ -52244,40 +59346,34 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
+  ac_cv_lib_intl_strftime=yes
 else
   echo "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-eval "$as_ac_var=no"
+ac_cv_lib_intl_strftime=no
 fi
 rm -f conftest.err conftest.$ac_objext \
       conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+echo "$as_me:$LINENO: result: $ac_cv_lib_intl_strftime" >&5
+echo "${ECHO_T}$ac_cv_lib_intl_strftime" >&6
+if test $ac_cv_lib_intl_strftime = yes; then
+  cat >>confdefs.h <<\_ACEOF
+#define HAVE_STRFTIME 1
 _ACEOF
 
-else
-  case $LIBOBJS in
-    "$ac_func.$ac_objext"   | \
-  *" $ac_func.$ac_objext"   | \
-    "$ac_func.$ac_objext "* | \
-  *" $ac_func.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;;
-esac
+LIBS="-lintl $LIBS"
+fi
 
 fi
 done
 
 
+ice_have_strftime=no
 
-ice_have_strncasecmp=no
-
-for ac_func in strncasecmp
+for ac_func in strftime
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -52374,21 +59470,21 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_strncasecmp=yes
+ ice_have_strftime=yes
 fi
 done
 
-if test "${ice_have_strncasecmp}" = yes; then
-echo "$as_me:$LINENO: checking for strncasecmp declaration in string.h strings.h" >&5
-echo $ECHO_N "checking for strncasecmp declaration in string.h strings.h... $ECHO_C" >&6
-if test "${ice_cv_have_strncasecmp_decl+set}" = set; then
+if test "${ice_have_strftime}" = yes; then
+echo "$as_me:$LINENO: checking for strftime declaration in time.h sys/time.h" >&5
+echo $ECHO_N "checking for strftime declaration in time.h sys/time.h... $ECHO_C" >&6
+if test "${ice_cv_have_strftime_decl+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else
 
-ice_cv_have_strncasecmp_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 string.h strings.h; do
+for header in time.h sys/time.h; do
 # Check for ordinary declaration
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
@@ -52400,12 +59496,12 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}strncasecmp[   ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_strncasecmp_decl=yes
+  $EGREP "${ice_re_word}strftime[      ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_strftime_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_strncasecmp_decl" = yes; then
+if test "$ice_cv_have_strftime_decl" = yes; then
        break
 fi
 # Check for "fixed" declaration like "getpid _PARAMS((int))"
@@ -52419,31 +59515,33 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}strncasecmp[   ]*$ice_re_params\(\(" >/dev/null 2>&1; then
-  ice_cv_have_strncasecmp_decl=yes
+  $EGREP "${ice_re_word}strftime[      ]*$ice_re_params\(\(" >/dev/null 2>&1; then
+  ice_cv_have_strftime_decl=yes
 fi
 rm -f conftest*
 
-if test "$ice_cv_have_strncasecmp_decl" = yes; then
+if test "$ice_cv_have_strftime_decl" = yes; then
        break
 fi
 done
 
 fi
 
-echo "$as_me:$LINENO: result: $ice_cv_have_strncasecmp_decl" >&5
-echo "${ECHO_T}$ice_cv_have_strncasecmp_decl" >&6
-if test "$ice_cv_have_strncasecmp_decl" = yes; then
+echo "$as_me:$LINENO: result: $ice_cv_have_strftime_decl" >&5
+echo "${ECHO_T}$ice_cv_have_strftime_decl" >&6
+if test "$ice_cv_have_strftime_decl" = yes; then
 
 cat >>confdefs.h <<_ACEOF
-#define HAVE_STRNCASECMP_DECL 1
+#define HAVE_STRFTIME_DECL 1
 _ACEOF
 
 fi
 fi
 
 
-for ac_func in strstr
+ice_have_strncasecmp=no
+
+for ac_func in strncasecmp
 do
 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
 echo "$as_me:$LINENO: checking for $ac_func" >&5
@@ -52540,19 +59638,73 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
+ ice_have_strncasecmp=yes
+fi
+done
 
+if test "${ice_have_strncasecmp}" = yes; then
+echo "$as_me:$LINENO: checking for strncasecmp declaration in string.h strings.h" >&5
+echo $ECHO_N "checking for strncasecmp declaration in string.h strings.h... $ECHO_C" >&6
+if test "${ice_cv_have_strncasecmp_decl+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case $LIBOBJS in
-    "$ac_func.$ac_objext"   | \
-  *" $ac_func.$ac_objext"   | \
-    "$ac_func.$ac_objext "* | \
-  *" $ac_func.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;;
-esac
 
+ice_cv_have_strncasecmp_decl=no
+ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
+ice_re_word='(^|[^a-zA-Z0-9_])'
+for header in string.h strings.h; do
+# Check for ordinary declaration
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$header>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}strncasecmp[   ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_strncasecmp_decl=yes
+fi
+rm -f conftest*
+
+if test "$ice_cv_have_strncasecmp_decl" = yes; then
+       break
+fi
+# Check for "fixed" declaration like "getpid _PARAMS((int))"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$header>
+
+_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
+fi
+rm -f conftest*
+
+if test "$ice_cv_have_strncasecmp_decl" = yes; then
+       break
 fi
 done
 
+fi
+
+echo "$as_me:$LINENO: result: $ice_cv_have_strncasecmp_decl" >&5
+echo "${ECHO_T}$ice_cv_have_strncasecmp_decl" >&6
+if test "$ice_cv_have_strncasecmp_decl" = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRNCASECMP_DECL 1
+_ACEOF
+
+fi
+fi
 
 
 ice_have_syslog=no
 echo "$as_me:$LINENO: result: $ac_cv_func_wait4" >&5
 echo "${ECHO_T}$ac_cv_func_wait4" >&6
 
-
-for ac_func in waitpid
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != $ac_func;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-else
-  case $LIBOBJS in
-    "$ac_func.$ac_objext"   | \
-  *" $ac_func.$ac_objext"   | \
-    "$ac_func.$ac_objext "* | \
-  *" $ac_func.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;;
-esac
-
-fi
-done
-
-
-
-for ac_func in writev
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != $ac_func;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-else
-  case $LIBOBJS in
-    "$ac_func.$ac_objext"   | \
-  *" $ac_func.$ac_objext"   | \
-    "$ac_func.$ac_objext "* | \
-  *" $ac_func.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;;
-esac
-
-fi
-done
-
-
+#AC_REPLACE_FUNCS(writev)
 
 ice_have_writev=no
 
@@ -54682,185 +61611,73 @@ if test `eval echo '${'$as_ac_var'}'` = yes; then
   cat >>confdefs.h <<_ACEOF
 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
 _ACEOF
- ice_have_writev=yes
-fi
-done
-
-if test "${ice_have_writev}" = yes; then
-echo "$as_me:$LINENO: checking for writev declaration in unistd.h sys/uio.h" >&5
-echo $ECHO_N "checking for writev declaration in unistd.h sys/uio.h... $ECHO_C" >&6
-if test "${ice_cv_have_writev_decl+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-ice_cv_have_writev_decl=no
-ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
-ice_re_word='(^|[^a-zA-Z0-9_])'
-for header in unistd.h sys/uio.h; do
-# Check for ordinary declaration
-cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-#include <$header>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "${ice_re_word}writev[        ]*\(" >/dev/null 2>&1; then
-  ice_cv_have_writev_decl=yes
-fi
-rm -f conftest*
-
-if test "$ice_cv_have_writev_decl" = yes; then
-       break
-fi
-# 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}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
-
-echo "$as_me:$LINENO: result: $ice_cv_have_writev_decl" >&5
-echo "${ECHO_T}$ice_cv_have_writev_decl" >&6
-if test "$ice_cv_have_writev_decl" = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_WRITEV_DECL 1
-_ACEOF
-
-fi
-fi
-
-
-for ac_func in strcasecmp
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
-   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
-#define $ac_func innocuous_$ac_func
-
-/* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $ac_func (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-
-#undef $ac_func
-
-/* Override any gcc2 internal prototype to avoid an error.  */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* We use char because int might match the return type of a gcc2
-   builtin and then its argument prototype would still apply.  */
-char $ac_func ();
-/* The GNU C library defines this for functions which it implements
-    to always fail with ENOSYS.  Some functions are actually named
-    something starting with __ and the normal name is an alias.  */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
-choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != $ac_func;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
-  (eval $ac_link) 2>conftest.er1
-  ac_status=$?
-  grep -v '^ *+' conftest.er1 >conftest.err
-  rm -f conftest.er1
-  cat conftest.err >&5
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-        { ac_try='test -z "$ac_c_werror_flag"
-                        || test ! -s conftest.err'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; } &&
-        { ac_try='test -s conftest$ac_exeext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-  eval "$as_ac_var=yes"
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-eval "$as_ac_var=no"
-fi
-rm -f conftest.err conftest.$ac_objext \
-      conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
-  cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
+ ice_have_writev=yes
+fi
+done
 
+if test "${ice_have_writev}" = yes; then
+echo "$as_me:$LINENO: checking for writev declaration in unistd.h sys/uio.h" >&5
+echo $ECHO_N "checking for writev declaration in unistd.h sys/uio.h... $ECHO_C" >&6
+if test "${ice_cv_have_writev_decl+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  case $LIBOBJS in
-    "$ac_func.$ac_objext"   | \
-  *" $ac_func.$ac_objext"   | \
-    "$ac_func.$ac_objext "* | \
-  *" $ac_func.$ac_objext "* ) ;;
-  *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;;
-esac
 
+ice_cv_have_writev_decl=no
+ice_re_params='[a-zA-Z_][a-zA-Z0-9_]*'
+ice_re_word='(^|[^a-zA-Z0-9_])'
+for header in unistd.h sys/uio.h; do
+# Check for ordinary declaration
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$header>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "${ice_re_word}writev[        ]*\(" >/dev/null 2>&1; then
+  ice_cv_have_writev_decl=yes
+fi
+rm -f conftest*
+
+if test "$ice_cv_have_writev_decl" = yes; then
+       break
+fi
+# 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}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
+
+echo "$as_me:$LINENO: result: $ice_cv_have_writev_decl" >&5
+echo "${ECHO_T}$ice_cv_have_writev_decl" >&6
+if test "$ice_cv_have_writev_decl" = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_WRITEV_DECL 1
+_ACEOF
+
+fi
+fi
 
 
 ice_have_strcasecmp=no
@@ -55647,26 +62464,99 @@ LTALLOCA=`echo "$ALLOCA" | sed 's/\.'"${ac_objext}"'/\.lo/g'`
 DOC_BUILD_DATE=`date '+%d-%m-%Y'`
 
 
+# Check whether --enable-manpage-build or --disable-manpage-build was given.
+if test "${enable_manpage_build+set}" = set; then
+  enableval="$enable_manpage_build"
+   ENABLE_MANPAGE_BUILD=$enableval
+else
+   ENABLE_MANPAGE_BUILD=no
+fi;
+
+
+XSLTPROC_FLAGS="--nonet"
+
 
-# Check whether --with-built-manpages or --without-built-manpages was given.
-if test "${with_built_manpages+set}" = set; then
-  withval="$with_built_manpages"
-   BUILDMANPAGES=$withval;
+# The (lack of) whitespace and overquoting here are all necessary for
+# proper formatting.
+
+# Check whether --with-xsltproc or --without-xsltproc was given.
+if test "${with_xsltproc+set}" = set; then
+  withval="$with_xsltproc"
+   ac_with_xsltproc=$withval;
 else
-   BUILDMANPAGES=yes;
+   ac_with_xsltproc=maybe;
 fi;
 
 
-if test "x$BUILDMANPAGES" = "xyes"; then
-  BUILD_MAN_PAGES_TRUE=
-  BUILD_MAN_PAGES_FALSE='#'
+# Check whether --with-xsltproc-flags or --without-xsltproc-flags was given.
+if test "${with_xsltproc_flags+set}" = set; then
+  withval="$with_xsltproc_flags"
+   if test "x$withval" == "xno"; then
+       XSLTPROC_FLAGS=''
+    else
+       if test "x$withval" != "xyes"; then
+           XSLTPROC_FLAGS="$withval"
+       fi
+    fi
+
+fi;
+
+# search for xsltproc if it wasn't specified
+if test "$ac_with_xsltproc" = "yes" -o "$ac_with_xsltproc" = "maybe"; then
+    for ac_prog in xsltproc
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_XSLTPROC+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $XSLTPROC in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_XSLTPROC="$XSLTPROC" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $LOCSYSPATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_XSLTPROC="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  ;;
+esac
+fi
+XSLTPROC=$ac_cv_path_XSLTPROC
+
+if test -n "$XSLTPROC"; then
+  echo "$as_me:$LINENO: result: $XSLTPROC" >&5
+echo "${ECHO_T}$XSLTPROC" >&6
 else
-  BUILD_MAN_PAGES_TRUE='#'
-  BUILD_MAN_PAGES_FALSE=
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
 fi
 
+  test -n "$XSLTPROC" && break
+done
 
-for ac_prog in xsltproc
+else
+    if test "$ac_with_xsltproc" != "no"; then
+        if test -x "$ac_with_xsltproc"; then
+            XSLTPROC="$ac_with_xsltproc";
+        else
+            { echo "$as_me:$LINENO: WARNING: Specified xsltproc of $ac_with_xsltproc isn't" >&5
+echo "$as_me: WARNING: Specified xsltproc of $ac_with_xsltproc isn't" >&2;}
+            { echo "$as_me:$LINENO: WARNING: executable; searching for an alternative." >&5
+echo "$as_me: WARNING: executable; searching for an alternative." >&2;}
+            for ac_prog in xsltproc
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
   test -n "$XSLTPROC" && break
 done
 
-if test -z "$XSLTPROC"; then
-  USE_XSLTPROC=no
-  { echo "$as_me:$LINENO: WARNING: can't find xsltproc, xsltproc support is unavailable" >&5
-echo "$as_me: WARNING: can't find xsltproc, xsltproc support is unavailable" >&2;}
+        fi
+    fi
+fi
+
+
+
+
+
+
+
+
+
+    echo "$as_me:$LINENO: checking for Docbook XSLT version 1.72.0" >&5
+echo $ECHO_N "checking for Docbook XSLT version 1.72.0... $ECHO_C" >&6
+if test "${ac_cv_docbook_xslt_1_72_0+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+       ac_cv_docbook_xslt_1_72_0=no
+       if test -n "$XSLTPROC"; then
+           echo "Trying '$XSLTPROC $XSLTPROC_FLAGS http://docbook.sourceforge.net/release/xsl/1.72.0/xhtml/docbook.xsl'" >&5
+           $XSLTPROC $XSLTPROC_FLAGS http://docbook.sourceforge.net/release/xsl/1.72.0/xhtml/docbook.xsl >&5 2>&1
+
+           if test "$?" = 0; then
+               ac_cv_docbook_xslt_1_72_0=yes
+           fi
+       fi
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_docbook_xslt_1_72_0" >&5
+echo "${ECHO_T}$ac_cv_docbook_xslt_1_72_0" >&6
+
+    HAVE_DOCBOOK_XSLT_1_72_0="$ac_cv_docbook_xslt_1_72_0"
+    HAVE_DOCBOOK_XSLT=HAVE_DOCBOOK_XSLT_1_72_0
+
+
+
+
+
+
+
+
+
+
+    echo "$as_me:$LINENO: checking for Docbook DTD version 4.1.2" >&5
+echo $ECHO_N "checking for Docbook DTD version 4.1.2... $ECHO_C" >&6
+if test "${ac_cv_docbook_dtd_4_1_2+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
 else
-  USE_XSLTPROC=yes
+
+       ac_cv_docbook_dtd_4_1_2=no
+       if test -n "$XSLTPROC"; then
+           MY_XSLTPROC_FLAGS=`echo "" $XSLTPROC_FLAGS|sed -e s/--novalid//g`
+           cat <<EOF >conftest.xml
+<?xml version="1.0" encoding='ISO-8859-1'?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN" "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
+<book id="empty">
+</book>
+EOF
+           echo "Trying '$XSLTPROC $MY_XSLTPROC_FLAGS conftest.xml'" >&5
+           $XSLTPROC $MY_XSLTPROC_FLAGS conftest.xml >conftest.out 2>&1
+           if test "$?" = 0; then
+               # failing to load the DTD is just a warning, so check for it in the output.
+               if grep 'warning: failed to load external entity' conftest_out >/dev/null 2>&1; then
+                   : # no good..
+               else
+                   ac_cv_docbook_dtd_4_1_2=yes
+               fi
+           fi
+           cat conftest.out >&5
+
+           rm -f conftest.xml conftest.out
+       fi
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_docbook_dtd_4_1_2" >&5
+echo "${ECHO_T}$ac_cv_docbook_dtd_4_1_2" >&6
+
+    HAVE_DOCBOOK_DTD_4_1_2="$ac_cv_docbook_dtd_4_1_2"
+    HAVE_DOCBOOK_DTD=HAVE_DOCBOOK_DTD_4_1_2
+
+
+
+
+
+
+
+
+
+
+    echo "$as_me:$LINENO: checking for Docbook DTD version 4.2" >&5
+echo $ECHO_N "checking for Docbook DTD version 4.2... $ECHO_C" >&6
+if test "${ac_cv_docbook_dtd_4_2+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
+       ac_cv_docbook_dtd_4_2=no
+       if test -n "$XSLTPROC"; then
+           MY_XSLTPROC_FLAGS=`echo "" $XSLTPROC_FLAGS|sed -e s/--novalid//g`
+           cat <<EOF >conftest.xml
+<?xml version="1.0" encoding='ISO-8859-1'?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
+<book id="empty">
+</book>
+EOF
+           echo "Trying '$XSLTPROC $MY_XSLTPROC_FLAGS conftest.xml'" >&5
+           $XSLTPROC $MY_XSLTPROC_FLAGS conftest.xml >conftest.out 2>&1
+           if test "$?" = 0; then
+               # failing to load the DTD is just a warning, so check for it in the output.
+               if grep 'warning: failed to load external entity' conftest_out >/dev/null 2>&1; then
+                   : # no good..
+               else
+                   ac_cv_docbook_dtd_4_2=yes
+               fi
+           fi
+           cat conftest.out >&5
+
+           rm -f conftest.xml conftest.out
+       fi
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_docbook_dtd_4_2" >&5
+echo "${ECHO_T}$ac_cv_docbook_dtd_4_2" >&6
+
+    HAVE_DOCBOOK_DTD_4_2="$ac_cv_docbook_dtd_4_2"
+    HAVE_DOCBOOK_DTD=HAVE_DOCBOOK_DTD_4_2
+
+
+
+# and ensure that everything docbook-related is OK if we'll be using it
+if test "x$ENABLE_MANPAGE_BUILD" = "xyes"; then
+    if test -z "$XSLTPROC"; then
+       { { echo "$as_me:$LINENO: error: Cannot build manpages: 'xsltproc' was not found." >&5
+echo "$as_me: error: Cannot build manpages: 'xsltproc' was not found." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+
+    if test "x$HAVE_DOCBOOK_XSLT_1_72_0" = "xno"; then
+       { { echo "$as_me:$LINENO: error: Cannot build manpages: docbook version 1.72.0 was not found." >&5
+echo "$as_me: error: Cannot build manpages: docbook version 1.72.0 was not found." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+
+    if test "x$HAVE_DOCBOOK_DTD_4_1_2" = "xno" || test "x$HAVE_DOCBOOK_DTD_4_2" = "xno"; then
+       { echo "$as_me:$LINENO: WARNING: Docbook DTD versions 4.1.2 and 4.2 are required for manpage validation; disabling validation" >&5
+echo "$as_me: WARNING: Docbook DTD versions 4.1.2 and 4.2 are required for manpage validation; disabling validation" >&2;}
+       XSLTPROC_FLAGS="$XSLTPROC_FLAGS --novalid"
+    fi
+fi
+
+
+if test "x$ENABLE_MANPAGE_BUILD" = "xyes"; then
+  ENABLE_MANPAGE_BUILD_TRUE=
+  ENABLE_MANPAGE_BUILD_FALSE='#'
+else
+  ENABLE_MANPAGE_BUILD_TRUE='#'
+  ENABLE_MANPAGE_BUILD_FALSE=
+fi
+
+
+echo "$as_me:$LINENO: checking for working IPv6" >&5
+echo $ECHO_N "checking for working IPv6... $ECHO_C" >&6
+if test "${amanda_working_ipv6+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if test "$cross_compiling" = yes; then
+  amanda_working_ipv6=yes
+
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <errno.h>
+
+main()
+{
+   int aa;
+   aa = socket(AF_INET6, SOCK_STREAM, 0);
+   if (aa > 0) return 0;
+   return aa;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  amanda_working_ipv6=yes
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+amanda_working_ipv6=no
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+echo "$as_me:$LINENO: result: $amanda_working_ipv6" >&5
+echo "${ECHO_T}$amanda_working_ipv6" >&6
+
+if test "$BROKEN_IPV6" = true; then
+    amanda_working_ipv6=no;
+fi
+
+if test "$amanda_working_ipv6" = yes; then
+    if test "$amanda_ipv6" != false; then
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_XSLTPROC 1
+#define WORKING_IPV6 1
 _ACEOF
 
+    fi
+else
+    if test "$amanda_ipv6" = true; then
+        { { echo "$as_me:$LINENO: error: Asked for IPv6 but it is not working." >&5
+echo "$as_me: error: Asked for IPv6 but it is not working." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
 fi
 
 
-if test "x$USE_XSLTPROC" = "xyes"; then
-  HAVE_XSLTPROC_TRUE=
-  HAVE_XSLTPROC_FALSE='#'
+
+if test "x$CC" = "xgcc"; then
+  GCC_COMPILER_TRUE=
+  GCC_COMPILER_FALSE='#'
 else
-  HAVE_XSLTPROC_TRUE='#'
-  HAVE_XSLTPROC_FALSE=
+  GCC_COMPILER_TRUE='#'
+  GCC_COMPILER_FALSE=
 fi
 
 
@@ -55796,7 +62919,7 @@ if test "x$CC" = "xgcc"; then
 fi
 
 
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        ac_config_files="$ac_config_files amplot/amcat.awk amplot/amplot.sh amplot/Makefile amandad-src/Makefile changer-src/chg-manual.sh changer-src/chg-multi.sh changer-src/chg-mtx.sh changer-src/chg-chs.sh changer-src/chg-rth.pl changer-src/chg-chio.pl changer-src/chg-zd-mtx.sh changer-src/Makefile changer-src/chg-juke.sh changer-src/chg-rait.sh changer-src/chg-null.sh changer-src/chg-mcutil.sh changer-src/chg-disk.sh changer-src/chg-iomega.pl client-src/patch-system.sh client-src/Makefile dumper-src/gnutar.pl dumper-src/generic-dumper.pl dumper-src/Makefile common-src/versuff.c common-src/Makefile example/amanda.conf example/Makefile example/chg-mcutil.conf example/amanda-client.conf man/Makefile docs/Makefile recover-src/Makefile oldrecover-src/Makefile restore-src/Makefile server-src/amcheckdb.sh server-src/amcleanup.sh server-src/amdump.sh server-src/amfreetapes.sh server-src/amoverview.pl server-src/amrmtape.sh server-src/amtoc.pl server-src/amverify.sh server-src/Makefile server-src/amstatus.pl server-src/amverifyrun.sh server-src/amcrypt.sh server-src/amaespipe.sh server-src/amcrypt-ossl.sh server-src/amcrypt-ossl-asym.sh tape-src/Makefile config/Makefile Makefile"
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ac_config_files="$ac_config_files gnulib/Makefile amplot/amcat.awk amplot/amplot.sh amplot/Makefile amandad-src/Makefile changer-src/chg-manual.sh changer-src/chg-multi.sh changer-src/chg-mtx.sh changer-src/chg-chs.sh changer-src/chg-rth.pl changer-src/chg-chio.pl changer-src/chg-zd-mtx.sh changer-src/Makefile changer-src/chg-juke.sh changer-src/chg-rait.sh changer-src/chg-null.sh changer-src/chg-mcutil.sh changer-src/chg-disk.sh changer-src/chg-iomega.pl changer-src/chg-lib.sh client-src/patch-system.sh client-src/Makefile dumper-src/amgtar.pl dumper-src/generic-dumper.pl dumper-src/Makefile common-src/versuff.c common-src/Makefile example/amanda.conf example/Makefile example/chg-mcutil.conf example/amanda-client.conf man/Makefile docs/Makefile recover-src/Makefile oldrecover-src/Makefile restore-src/Makefile server-src/amcheckdb.sh server-src/amcleanup.sh server-src/amdump.sh server-src/amfreetapes.sh server-src/amoverview.pl server-src/amrmtape.sh server-src/amtoc.pl server-src/amverify.sh server-src/Makefile server-src/amstatus.pl server-src/amverifyrun.sh server-src/amcrypt.sh server-src/amaespipe.sh server-src/amcrypt-ossl.sh server-src/amcrypt-ossl-asym.sh tape-src/Makefile config/Makefile Makefile"
 
 
 cat >confcache <<\_ACEOF
@@ -55904,6 +63027,29 @@ echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
+if test -z "${GL_COND_LIBTOOL_TRUE}" && test -z "${GL_COND_LIBTOOL_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"GL_COND_LIBTOOL\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"GL_COND_LIBTOOL\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+    gl_libobjs=
+    gl_ltlibobjs=
+    if test -n "$gl_LIBOBJS"; then
+      # Remove the extension.
+      sed_drop_objext='s/\.o$//;s/\.obj$//'
+      for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed "$sed_drop_objext" | sort | uniq`; do
+        gl_libobjs="$gl_libobjs $i.$ac_objext"
+        gl_ltlibobjs="$gl_ltlibobjs $i.lo"
+      done
+    fi
+    gl_LIBOBJS=$gl_libobjs
+
+    gl_LTLIBOBJS=$gl_ltlibobjs
+
+
 if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
   { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
@@ -55995,17 +63141,17 @@ echo "$as_me: error: conditional \"WANT_SSH_SECURITY\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
-if test -z "${BUILD_MAN_PAGES_TRUE}" && test -z "${BUILD_MAN_PAGES_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"BUILD_MAN_PAGES\" was never defined.
+if test -z "${ENABLE_MANPAGE_BUILD_TRUE}" && test -z "${ENABLE_MANPAGE_BUILD_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"ENABLE_MANPAGE_BUILD\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"BUILD_MAN_PAGES\" was never defined.
+echo "$as_me: error: conditional \"ENABLE_MANPAGE_BUILD\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
-if test -z "${HAVE_XSLTPROC_TRUE}" && test -z "${HAVE_XSLTPROC_FALSE}"; then
-  { { echo "$as_me:$LINENO: error: conditional \"HAVE_XSLTPROC\" was never defined.
+if test -z "${GCC_COMPILER_TRUE}" && test -z "${GCC_COMPILER_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"GCC_COMPILER\" was never defined.
 Usually this means the macro was only invoked conditionally." >&5
-echo "$as_me: error: conditional \"HAVE_XSLTPROC\" was never defined.
+echo "$as_me: error: conditional \"GCC_COMPILER\" was never defined.
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
@@ -56471,6 +63617,7 @@ for ac_config_target in $ac_config_targets
 do
   case "$ac_config_target" in
   # Handling of arguments.
+  "gnulib/Makefile" ) CONFIG_FILES="$CONFIG_FILES gnulib/Makefile" ;;
   "amplot/amcat.awk" ) CONFIG_FILES="$CONFIG_FILES amplot/amcat.awk" ;;
   "amplot/amplot.sh" ) CONFIG_FILES="$CONFIG_FILES amplot/amplot.sh" ;;
   "amplot/Makefile" ) CONFIG_FILES="$CONFIG_FILES amplot/Makefile" ;;
   "changer-src/chg-mcutil.sh" ) CONFIG_FILES="$CONFIG_FILES changer-src/chg-mcutil.sh" ;;
   "changer-src/chg-disk.sh" ) CONFIG_FILES="$CONFIG_FILES changer-src/chg-disk.sh" ;;
   "changer-src/chg-iomega.pl" ) CONFIG_FILES="$CONFIG_FILES changer-src/chg-iomega.pl" ;;
+  "changer-src/chg-lib.sh" ) CONFIG_FILES="$CONFIG_FILES changer-src/chg-lib.sh" ;;
   "client-src/patch-system.sh" ) CONFIG_FILES="$CONFIG_FILES client-src/patch-system.sh" ;;
   "client-src/Makefile" ) CONFIG_FILES="$CONFIG_FILES client-src/Makefile" ;;
-  "dumper-src/gnutar.pl" ) CONFIG_FILES="$CONFIG_FILES dumper-src/gnutar.pl" ;;
+  "dumper-src/amgtar.pl" ) CONFIG_FILES="$CONFIG_FILES dumper-src/amgtar.pl" ;;
   "dumper-src/generic-dumper.pl" ) CONFIG_FILES="$CONFIG_FILES dumper-src/generic-dumper.pl" ;;
   "dumper-src/Makefile" ) CONFIG_FILES="$CONFIG_FILES dumper-src/Makefile" ;;
   "common-src/versuff.c" ) CONFIG_FILES="$CONFIG_FILES common-src/versuff.c" ;;
@@ -56668,8 +63816,49 @@ s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t
 s,@CCDEPMODE@,$CCDEPMODE,;t t
 s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t
 s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t
-s,@GREP@,$GREP,;t t
+s,@RANLIB@,$RANLIB,;t t
+s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
+s,@CPP@,$CPP,;t t
 s,@EGREP@,$EGREP,;t t
+s,@GL_COND_LIBTOOL_TRUE@,$GL_COND_LIBTOOL_TRUE,;t t
+s,@GL_COND_LIBTOOL_FALSE@,$GL_COND_LIBTOOL_FALSE,;t t
+s,@ALLOCA@,$ALLOCA,;t t
+s,@ALLOCA_H@,$ALLOCA_H,;t t
+s,@ARPA_INET_H@,$ARPA_INET_H,;t t
+s,@SYS_SOCKET_H@,$SYS_SOCKET_H,;t t
+s,@LIBPTH@,$LIBPTH,;t t
+s,@LTLIBPTH@,$LTLIBPTH,;t t
+s,@LIBPTH_PREFIX@,$LIBPTH_PREFIX,;t t
+s,@LIBTHREAD@,$LIBTHREAD,;t t
+s,@LTLIBTHREAD@,$LTLIBTHREAD,;t t
+s,@LIBMULTITHREAD@,$LIBMULTITHREAD,;t t
+s,@LTLIBMULTITHREAD@,$LTLIBMULTITHREAD,;t t
+s,@NETINET_IN_H@,$NETINET_IN_H,;t t
+s,@STDBOOL_H@,$STDBOOL_H,;t t
+s,@HAVE__BOOL@,$HAVE__BOOL,;t t
+s,@HAVE_DECL_MEMMEM@,$HAVE_DECL_MEMMEM,;t t
+s,@HAVE_MEMPCPY@,$HAVE_MEMPCPY,;t t
+s,@HAVE_DECL_MEMRCHR@,$HAVE_DECL_MEMRCHR,;t t
+s,@HAVE_STPCPY@,$HAVE_STPCPY,;t t
+s,@HAVE_STPNCPY@,$HAVE_STPNCPY,;t t
+s,@HAVE_DECL_STRNCASECMP@,$HAVE_DECL_STRNCASECMP,;t t
+s,@HAVE_STRCHRNUL@,$HAVE_STRCHRNUL,;t t
+s,@HAVE_DECL_STRDUP@,$HAVE_DECL_STRDUP,;t t
+s,@HAVE_STRNDUP@,$HAVE_STRNDUP,;t t
+s,@HAVE_DECL_STRNDUP@,$HAVE_DECL_STRNDUP,;t t
+s,@HAVE_DECL_STRNLEN@,$HAVE_DECL_STRNLEN,;t t
+s,@HAVE_STRPBRK@,$HAVE_STRPBRK,;t t
+s,@HAVE_STRSEP@,$HAVE_STRSEP,;t t
+s,@HAVE_DECL_STRTOK_R@,$HAVE_DECL_STRTOK_R,;t t
+s,@REPLACE_STRCASECMP@,$REPLACE_STRCASECMP,;t t
+s,@REPLACE_STRSTR@,$REPLACE_STRSTR,;t t
+s,@REPLACE_STRCASESTR@,$REPLACE_STRCASESTR,;t t
+s,@ABSOLUTE_STRING_H@,$ABSOLUTE_STRING_H,;t t
+s,@MKDIR_P@,$MKDIR_P,;t t
+s,@EOVERFLOW@,$EOVERFLOW,;t t
+s,@CFLAG_VISIBILITY@,$CFLAG_VISIBILITY,;t t
+s,@HAVE_VISIBILITY@,$HAVE_VISIBILITY,;t t
+s,@GREP@,$GREP,;t t
 s,@AMLINT@,$AMLINT,;t t
 s,@AMLINTFLAGS@,$AMLINTFLAGS,;t t
 s,@DUMPER_DIR@,$DUMPER_DIR,;t t
@@ -56683,19 +63872,19 @@ s,@BINARY_OWNER@,$BINARY_OWNER,;t t
 s,@DEFAULT_CONFIG@,$DEFAULT_CONFIG,;t t
 s,@DEFAULT_TAPE_SERVER@,$DEFAULT_TAPE_SERVER,;t t
 s,@DEFAULT_TAPE_DEVICE@,$DEFAULT_TAPE_DEVICE,;t t
+s,@EXAMPLE_TAPEDEV@,$EXAMPLE_TAPEDEV,;t t
 s,@DEFAULT_RAW_TAPE_DEVICE@,$DEFAULT_RAW_TAPE_DEVICE,;t t
 s,@DEFAULT_CHANGER_DEVICE@,$DEFAULT_CHANGER_DEVICE,;t t
 s,@GNUTAR_LISTED_INCREMENTAL_DIRX@,$GNUTAR_LISTED_INCREMENTAL_DIRX,;t t
 s,@GNUTAR_LISTED_INCREMENTAL_DIR@,$GNUTAR_LISTED_INCREMENTAL_DIR,;t t
+s,@SSH@,$SSH,;t t
 s,@MAXTAPEBLOCKSIZE@,$MAXTAPEBLOCKSIZE,;t t
 s,@AMANDA_TMPDIR@,$AMANDA_TMPDIR,;t t
 s,@AMANDA_DBGDIR@,$AMANDA_DBGDIR,;t t
 s,@AMANDA_DEBUG_DAYS@,$AMANDA_DEBUG_DAYS,;t t
 s,@SERVICE_SUFFIX@,$SERVICE_SUFFIX,;t t
 s,@MT_FILE_FLAG@,$MT_FILE_FLAG,;t t
-s,@CPP@,$CPP,;t t
 s,@AR@,$AR,;t t
-s,@AWK_VAR_ASSIGNMENT_OPT@,$AWK_VAR_ASSIGNMENT_OPT,;t t
 s,@YACC@,$YACC,;t t
 s,@CAT@,$CAT,;t t
 s,@COMPRESS@,$COMPRESS,;t t
@@ -56732,8 +63921,6 @@ s,@LL_RFMT@,$LL_RFMT,;t t
 s,@LN_S@,$LN_S,;t t
 s,@ECHO@,$ECHO,;t t
 s,@ac_ct_AR@,$ac_ct_AR,;t t
-s,@RANLIB@,$RANLIB,;t t
-s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
 s,@CXX@,$CXX,;t t
 s,@CXXFLAGS@,$CXXFLAGS,;t t
 s,@ac_ct_CXX@,$ac_ct_CXX,;t t
@@ -56751,8 +63938,6 @@ s,@LEXLIB@,$LEXLIB,;t t
 s,@LEX_OUTPUT_ROOT@,$LEX_OUTPUT_ROOT,;t t
 s,@READLINE_LIBS@,$READLINE_LIBS,;t t
 s,@DB_EXT@,$DB_EXT,;t t
-s,@ALLOCA@,$ALLOCA,;t t
-s,@LIBOBJS@,$LIBOBJS,;t t
 s,@ac_n@,$ac_n,;t t
 s,@ac_c@,$ac_c,;t t
 s,@WANT_CLIENT_TRUE@,$WANT_CLIENT_TRUE,;t t
@@ -56782,12 +63967,16 @@ s,@WANT_SSH_SECURITY_FALSE@,$WANT_SSH_SECURITY_FALSE,;t t
 s,@LTLIBOBJS@,$LTLIBOBJS,;t t
 s,@LTALLOCA@,$LTALLOCA,;t t
 s,@DOC_BUILD_DATE@,$DOC_BUILD_DATE,;t t
-s,@BUILD_MAN_PAGES_TRUE@,$BUILD_MAN_PAGES_TRUE,;t t
-s,@BUILD_MAN_PAGES_FALSE@,$BUILD_MAN_PAGES_FALSE,;t t
+s,@XSLTPROC_FLAGS@,$XSLTPROC_FLAGS,;t t
 s,@XSLTPROC@,$XSLTPROC,;t t
-s,@HAVE_XSLTPROC_TRUE@,$HAVE_XSLTPROC_TRUE,;t t
-s,@HAVE_XSLTPROC_FALSE@,$HAVE_XSLTPROC_FALSE,;t t
+s,@ENABLE_MANPAGE_BUILD_TRUE@,$ENABLE_MANPAGE_BUILD_TRUE,;t t
+s,@ENABLE_MANPAGE_BUILD_FALSE@,$ENABLE_MANPAGE_BUILD_FALSE,;t t
+s,@GCC_COMPILER_TRUE@,$GCC_COMPILER_TRUE,;t t
+s,@GCC_COMPILER_FALSE@,$GCC_COMPILER_FALSE,;t t
 s,@AM_CFLAGS@,$AM_CFLAGS,;t t
+s,@LIBOBJS@,$LIBOBJS,;t t
+s,@gl_LIBOBJS@,$gl_LIBOBJS,;t t
+s,@gl_LTLIBOBJS@,$gl_LTLIBOBJS,;t t
 CEOF
 
 _ACEOF
index 778ad2a87fa0611b3037baaab092cdf6baadca07..a15742a6a5ce97e1f904bac18fc4006ecf030ca3 100644 (file)
@@ -13,10 +13,10 @@ AC_DEFINE_UNQUOTED(CONFIGURE_COMMAND,"$CONFIGURE_COMMAND",
          [Saves the original ./configure command line arguments])
 AC_SUBST(CONFIGURE_COMMAND)
 
-AM_INIT_AUTOMAKE(amanda, 2.5.1p3)
+AM_INIT_AUTOMAKE(amanda, 2.5.2p1)
 AM_CONFIG_HEADER(config/config.h)
 
-AC_PREREQ(2.57)                dnl Minimum Autoconf version required.
+AC_PREREQ(2.59)                dnl Minimum Autoconf version required.
 
 if test -f "$srcdir/SNAPSHOT"; then
   cat < "$srcdir/SNAPSHOT"
@@ -85,6 +85,8 @@ AC_ARG_WITH(cflags,
 CFLAGS="-D_GNU_SOURCE $CFLAGS"
 
 AC_PROG_CC
+gl_EARLY
+gl_INIT
 AC_OBJEXT
 AC_EXEEXT
 AC_SYS_LARGEFILE
@@ -562,7 +564,11 @@ AC_ARG_WITH(tape-device,
 if test ! -z "$DEFAULT_TAPE_DEVICE"; then
     AC_DEFINE_UNQUOTED(DEFAULT_TAPE_DEVICE,"$DEFAULT_TAPE_DEVICE",[This is the default no-rewinding tape device. ])
     AC_SUBST(DEFAULT_TAPE_DEVICE)
+    EXAMPLE_TAPEDEV=$DEFAULT_TAPE_DEVICE
+else
+    EXAMPLE_TAPEDEV="/dev/null"
 fi
+AC_SUBST(EXAMPLE_TAPEDEV)
 
 AC_ARG_WITH(ftape-raw-device,
     [  --with-ftape-rawdevice=ARG raw device on tape server HOST's if using Linux ftape >=3.04d],
@@ -917,10 +923,47 @@ n | no) : ;;
 y |  ye | yes) AC_DEFINE(SSH_SECURITY,1,[Define if SSH transport should be enabled. ])
               SSH_SECURITY_SET=true
   ;;
-*) AC_MSG_ERROR([*** You must not supply an argument the to --with-ssh-security option.])
+*) AC_MSG_ERROR([*** You must not supply an argument to --with-ssh-security.])
   ;;
 esac
 
+# find SSH and check for SSH options if we're using SSH security
+if test x"$SSH_SECURITY" = "xyes"; then
+    AC_PATH_PROGS(SSH, ssh, , $LOCSYSPATH)
+    AC_DEFINE_UNQUOTED(SSH, "$SSH", [Path to the SSH binary])
+
+    AC_ARG_WITH(ssh-options,
+    AS_HELP_STRING([--with-ssh-options=@<:@OPTIONS@:>@],
+                  [Use these ssh options for ssh security; the default should work]),
+       [ SSH_OPTIONS="$withval" ],
+       [ SSH_OPTIONS='' ]
+    )
+
+    case "$SSH_OPTIONS" in
+       y | ye | yes | n | no)
+           AC_MSG_ERROR([*** You must supply an argument to --with-ssh-options.]);;
+       *) : ;;
+    esac
+
+    AC_MSG_CHECKING([SSH options])
+    # if we didn't get SSH options from the user, figure them out for ourselves
+    if test -z "$SSH_OPTIONS"; then
+       # TODO - quote these (or break them up in ssh-security??)
+       case `$SSH -V 2>&1` in
+           OpenSSH*) SSH_OPTIONS='-x -o BatchMode=yes -o PreferredAuthentications=publickey';;
+           *) SSH_OPTIONS='-x -o BatchMode=yes'
+       esac
+    fi
+
+    # now convert that to a comma-separated list of C strings
+    eval "set dummy ${SSH_OPTIONS}"; shift
+    SSH_OPTIONS=''
+    for i in "${@}"; do SSH_OPTIONS="${SSH_OPTIONS}${SSH_OPTIONS:+, }\"${i/\"/\\\"}\""; done
+    AC_MSG_RESULT($SSH_OPTIONS)
+
+    AC_DEFINE_UNQUOTED(SSH_OPTIONS, $SSH_OPTIONS, [Arguments to ssh])
+fi
+
 AC_ARG_WITH(bsdtcp-security,
     [  --with-bsdtcp-security use tcp as a transport],
     BSDTCP_SECURITY=$withval,
@@ -1094,24 +1137,24 @@ for dir in $KRB5_SPOTS; do
     k5libdir=${dir}/${lib}
     if test -f ${k5libdir}/libkrb5.a -a -f ${k5libdir}/libgssapi_krb5.a -a -f ${k5libdir}/libcom_err.a; then
        if test -f ${k5libdir}/libk5crypto.a; then
-           K5CRYPTO=${k5libdir}/libk5crypto.a
+           K5CRYPTO=-lk5crypto
        elif test -f ${k5libdir}/libcrypto.a; then
-           K5CRYPTO=${k5libdir}/libcrypto.a
+           K5CRYPTO=-lcrypto
        else
            K5CRYPTO=""
        fi
        if test -f ${k5libdir}/libkrb5support.a; then
-           K5SUPPORT=${k5libdir}/libkrb5support.a
+           K5SUPPORT=-lkrb5support
        else
            K5SUPPORT=""
        fi
        KRB5_DIR_FOUND=$dir
-       KRB5LIBS="${k5libdir}/libgssapi_krb5.a ${k5libdir}/libkrb5.a $K5CRYPTO $K5SUPPORT ${k5libdir}/libcom_err.a"
+       KRB5LIBS="-lgssapi_krb5 -lkrb5 $K5CRYPTO $K5SUPPORT -lcom_err"
        KRB5CFLAGS=""
        break
     elif test -f ${k5libdir}/libkrb5.a -a -f ${k5libdir}/libasn1.a -a -f ${k5libdir}/libgssapi.a; then
        KRB5_DIR_FOUND=$dir
-       KRB5LIBS="${k5libdir}/libgssapi.a ${k5libdir}/libkrb5.a ${k5libdir}/libasn1.a"
+       KRB5LIBS="-lgssapi.a -lkrb5.a -lasn1.a"
        KRB5_CFLAGS="-DKRB5_HEIMDAL_INCLUDES"
        break
     fi
@@ -1442,6 +1485,8 @@ case "$target" in
                        ;;
   *-redhat-linux-*)
                        ;;
+  *-suse-linux-*)
+                       ;;
   x86_64-*-linux-*)
                        ;;
   alpha*-*-linux-*)
@@ -1543,12 +1588,6 @@ dnl Check for programs.
 AC_PATH_PROGS(AR,ar,,$LOCSYSPATH)
 
 AC_PROG_AWK
-AMANDA_PROG_AWK_VAR
-if test "x$amanda_cv_awk_var_assignment" = xno; then
-    NO_AMPLOT_MODE=true
-    AC_MSG_WARN([*** Your $awk cannot do command line variable assignment.  Amplot will not be installed.])
-fi
-
 AC_PROG_YACC
 AC_PATH_PROGS(CAT,cat,,$LOCSYSPATH)
 if test -z "$CAT"; then
@@ -1558,11 +1597,26 @@ AC_PATH_PROGS(COMPRESS,compress,,$LOCSYSPATH)
 AC_PATH_PROGS(DD,dd,,$LOCSYSPATH)
 AC_PATH_PROGS(GETCONF,getconf,,$SYSPATH)
 
-AC_PATH_PROGS(GNUPLOT,gnuplot,,$LOCSYSPATH)
-if test -z "$GNUPLOT"; then
-    NO_AMPLOT_MODE=true
-    AC_MSG_WARN([*** You do not have gnuplot.  Amplot will not be installed.])
+AC_ARG_WITH(gnuplot,
+AS_HELP_STRING([--with-gnuplot=PATH],
+               [use gnuplot executable at PATH in amplot]),
+    [ ac_with_gnuplot=$withval; ],
+    [ ac_with_gnuplot=maybe; ])
+
+if test "$ac_with_gnuplot" = "yes" -o "$ac_with_gnuplot" = "maybe"; then
+    AC_PATH_PROGS(GNUPLOT,gnuplot,,$LOCSYSPATH)
+else
+    if test "$ac_with_gnuplot" != "no"; then
+        if test -x "$ac_with_gnuplot"; then
+            GNUPLOT="$ac_with_gnuplot";
+        else
+            AC_MSG_WARN([Specified gnuplot of $ac_with_gnuplot isn't])
+            AC_MSG_WARN([executable, searching for an alternative.])
+           AC_PATH_PROGS(GNUPLOT,gnuplot,,$LOCSYSPATH)
+        fi
+    fi
 fi
+AC_SUBST(GNUPLOT)
 
 AC_PATH_PROGS(GNUTAR,gtar gnutar tar,,$LOCSYSPATH)
 if test ! -z "$GNUTAR"; then
@@ -1691,6 +1745,14 @@ dnl AC_PATH_PROGS(MAKEINFO,makeinfo,,$LOCSYSPATH)
 dnl AC_PATH_PROGS(TEXI2DVI,texi2dvi,,$LOCSYSPATH)
 
 AC_PATH_PROGS(DUMP,$DUMP_PROGRAMS,,$SYSLOCPATH)
+if test -n "$DUMP"; then
+  if test "`basename $DUMP`" = "backup"; then
+    backup_gnutar=`$DUMP --version | $GREP "GNU tar"`
+    if test $? -eq 0; then
+      DUMP=
+    fi
+  fi
+fi
 AC_PATH_PROGS(RESTORE,ufsrestore restore,,$SYSLOCPATH)
 if test "$DUMP" -a "$RESTORE"; then
     AC_DEFINE_UNQUOTED(DUMP,"$DUMP",[Define the location of the ufsdump, backup, or dump program. ])
@@ -1827,6 +1889,8 @@ AC_SUBST(AMPLOT_CAT_GZIP)
 AC_SUBST(AMPLOT_CAT_COMPRESS)
 AC_SUBST(AMPLOT_CAT_PACK)
 
+AC_SOCKADDR_STORAGE
+
 # Determine the printf format characters to use when printing
 # values of type long long. This will normally be "ll", but where
 # the compiler treats "long long" as a alias for "long" and printf
@@ -1931,7 +1995,6 @@ AC_SUBST(LIBTOOL_DEPS)
 
 AC_PROG_GCC_TRADITIONAL
 AC_C_CONST
-AMANDA_C_VOLATILE
 AMANDA_C_UNSIGNED_LONG_CONSTANTS
 AC_TYPE_OFF_T
 AC_TYPE_PID_T
@@ -2735,7 +2798,6 @@ ICE_CHECK_DECL(fputs,stdio.h)
 ICE_CHECK_DECL(fread,stdio.h stdlib.h)
 ICE_CHECK_DECL(fseek,stdio.h)
 ICE_CHECK_DECL(fwrite,stdio.h stdlib.h)
-AC_REPLACE_FUNCS(getcwd)
 AC_CHECK_FUNCS(getfsent)
 ICE_CHECK_DECL(gethostname,unistd.h)
 AC_FUNC_GETMNTENT
@@ -2754,13 +2816,11 @@ ICE_CHECK_DECL(isnormal,math.h)
 ICE_CHECK_DECL(listen,sys/types.h sys/socket.h)
 ICE_CHECK_DECL(lstat,sys/types.h sys/stat.h)
 ICE_CHECK_DECL(malloc,stdlib.h)
-AC_REPLACE_FUNCS(memmove)
 ICE_CHECK_DECL(memmove,string.h strings.h)
 ICE_CHECK_DECL(memset,string.h strings.h)
 AC_CHECK_FUNCS(mkdir)
 ICE_CHECK_DECL(mkstemp,stdlib.h)
 ICE_CHECK_DECL(mktemp,stdlib.h)
-AC_REPLACE_FUNCS(mktime)
 ICE_CHECK_DECL(mktime,time.h sys/time.h)
 AC_FUNC_MMAP
 dnl atexit() is prefered, sunos (maybe others?) define on_exit
@@ -2788,6 +2848,8 @@ AC_CHECK_FUNCS(shquote)
 
 ICE_CHECK_DECL(setresgid,unistd.h)
 ICE_CHECK_DECL(setresuid,unistd.h)
+ICE_CHECK_DECL(snprintf,stdio.h)
+ICE_CHECK_DECL(vsnprintf,stdio.h)
 
 dnl arguments for setpgrp or not
 AC_CHECK_FUNC(setpgid, [
@@ -2831,32 +2893,15 @@ if test "x$ac_cv_func_mmap_fixed_mapped" != xyes; then
     esac
 fi
 
-dnl Some systems have snprintf but not vsnprintf.  If either snprintf or
-dnl vsnprintf are missing, then use the snprintf.c we provide.
-ICE_CHECK_DECL(snprintf,stdio.h)
-ICE_CHECK_DECL(vsnprintf,stdio.h)
-if test x"$ice_have_snprintf" != x"yes" ||
-   test x"$ice_have_vsnprintf" != x"yes"; then
-    AC_LIBOBJ([snprintf])
-    if false; then :
-       dnl so that automake includes snprintf.c in the distribution
-       AC_REPLACE_FUNCS(snprintf) 
-    fi
-fi
-
 AC_CHECK_FUNCS(sigaction sigemptyset sigvec)
 ICE_CHECK_DECL(socket,sys/types.h sys/socket.h)
 ICE_CHECK_DECL(socketpair,sys/types.h sys/socket.h)
 ICE_CHECK_DECL(sscanf,stdio.h)
 AC_CHECK_FUNCS(statfs statvfs)
-AC_REPLACE_FUNCS(strerror)
 ICE_CHECK_DECL(strerror,string.h strings.h)
 AC_FUNC_STRFTIME
-AC_REPLACE_FUNCS(strftime)
 ICE_CHECK_DECL(strftime,time.h sys/time.h)
-AC_REPLACE_FUNCS(strncasecmp)
 ICE_CHECK_DECL(strncasecmp,string.h strings.h)
-AC_REPLACE_FUNCS(strstr)
 ICE_CHECK_DECL(syslog,syslog.h)
 ICE_CHECK_DECL(system,stdlib.h)
 ICE_CHECK_DECL(time,time.h sys/time.h)
@@ -2868,10 +2913,8 @@ ICE_CHECK_DECL(vfprintf,stdio.h stdlib.h)
 ICE_CHECK_DECL(vprintf,stdio.h stdlib.h)
 ICE_CHECK_DECL(vsprintf,stdio.h stdlib.h)
 AC_CHECK_FUNC(wait4)
-AC_REPLACE_FUNCS(waitpid)
-AC_REPLACE_FUNCS(writev)
+#AC_REPLACE_FUNCS(writev)
 ICE_CHECK_DECL(writev, unistd.h sys/uio.h)
-AC_REPLACE_FUNCS(strcasecmp)
 ICE_CHECK_DECL(strcasecmp,string.h strings.h)
 
 AC_CHECK_FUNCS(fnmatch)
@@ -3107,21 +3150,78 @@ AC_SUBST(LTALLOCA)
 DOC_BUILD_DATE=`date '+%d-%m-%Y'`
 AC_SUBST(DOC_BUILD_DATE)
 
-AC_ARG_WITH(built-manpages,
-    [  --without-built-manpages Do not build manpages from XML source.],
-    [ BUILDMANPAGES=$withval; ],
-    [ BUILDMANPAGES=yes; ])
-AM_CONDITIONAL(BUILD_MAN_PAGES, test "x$BUILDMANPAGES" = "xyes")
+AC_ARG_ENABLE(manpage-build,
+AS_HELP_STRING([--enable-manpage-build],
+              [Build the manpages from their XML source (shipped manpages are usually sufficient)]),
+    [ ENABLE_MANPAGE_BUILD=$enableval ],
+    [ ENABLE_MANPAGE_BUILD=no ])
+
+AC_PROG_XSLTPROC([--nonet])
+AC_CHECK_DOCBOOK_XSLT([1.72.0])
+AC_CHECK_DOCBOOK_DTD([4.1.2])
+AC_CHECK_DOCBOOK_DTD([4.2])
+
+# and ensure that everything docbook-related is OK if we'll be using it
+if test "x$ENABLE_MANPAGE_BUILD" = "xyes"; then
+    if test -z "$XSLTPROC"; then
+       AC_MSG_ERROR([Cannot build manpages: 'xsltproc' was not found.])
+    fi
+
+    if test "x$HAVE_DOCBOOK_XSLT_1_72_0" = "xno"; then
+       AC_MSG_ERROR([Cannot build manpages: docbook version 1.72.0 was not found.])
+    fi
+
+    if test "x$HAVE_DOCBOOK_DTD_4_1_2" = "xno" || test "x$HAVE_DOCBOOK_DTD_4_2" = "xno"; then
+       AC_MSG_WARN([Docbook DTD versions 4.1.2 and 4.2 are required for manpage validation; disabling validation])
+       XSLTPROC_FLAGS="$XSLTPROC_FLAGS --novalid"
+    fi
+fi
+AM_CONDITIONAL(ENABLE_MANPAGE_BUILD, test "x$ENABLE_MANPAGE_BUILD" = "xyes")
 
-AC_PATH_PROGS(XSLTPROC,xsltproc,,$LOCSYSPATH)
-if test -z "$XSLTPROC"; then
-  USE_XSLTPROC=no
-  AC_MSG_WARN([can't find xsltproc, xsltproc support is unavailable])
+AC_CACHE_CHECK([for working IPv6],
+              amanda_working_ipv6,
+  [AC_TRY_RUN([#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <errno.h>
+
+main()
+{
+   int aa;
+   aa = socket(AF_INET6, SOCK_STREAM, 0);
+   if (aa > 0) return 0;
+   return aa;
+}],amanda_working_ipv6=yes,
+   amanda_working_ipv6=no,
+   amanda_working_ipv6=yes
+  )
+  ]
+)
+
+if test "$BROKEN_IPV6" = true; then
+    amanda_working_ipv6=no;
+fi
+
+if test "$amanda_working_ipv6" = yes; then
+    if test "$amanda_ipv6" != false; then
+       AC_DEFINE(WORKING_IPV6,1,[Define if IPv6 is working. ])
+    fi
 else
-  USE_XSLTPROC=yes
-  AC_DEFINE(HAVE_XSLTPROC,1,[xslt is available to generate man pages])
+    if test "$amanda_ipv6" = true; then
+        AC_MSG_ERROR([Asked for IPv6 but it is not working.])
+    fi
 fi
-AM_CONDITIONAL(HAVE_XSLTPROC, test "x$USE_XSLTPROC" = "xyes")
+
+AM_CONDITIONAL([GCC_COMPILER], [test "x$CC" = "xgcc"])
 
 #### Enforce amanda code cleanliness rules.
 #### Done here to allow configuration code to remain intact.
@@ -3187,6 +3287,8 @@ fi
 AC_SUBST(AM_CFLAGS)
 
 AC_CONFIG_FILES([\
+       gnulib/Makefile                                                 \
+                                                                       \
        amplot/amcat.awk                amplot/amplot.sh                \
        amplot/Makefile                                                 \
                                                                        \
@@ -3199,10 +3301,11 @@ AC_CONFIG_FILES([\
        changer-src/chg-juke.sh         changer-src/chg-rait.sh         \
        changer-src/chg-null.sh         changer-src/chg-mcutil.sh       \
        changer-src/chg-disk.sh         changer-src/chg-iomega.pl       \
+    changer-src/chg-lib.sh                                  \
                                                                        \
        client-src/patch-system.sh      client-src/Makefile             \
                                                                        \
-        dumper-src/gnutar.pl           dumper-src/generic-dumper.pl    \
+        dumper-src/amgtar.pl           dumper-src/generic-dumper.pl    \
        dumper-src/Makefile                                             \
                                                                        \
        common-src/versuff.c            common-src/Makefile             \
index ac505ffc79db487039b0f4942b839a92a422e633..d4bbf4189287556b8efbbb25febace886a38037f 100644 (file)
@@ -41,7 +41,6 @@ pkgdata_DATA = \
        howto-auth.txt \
        howto-cygwin.txt \
        howto-filedriver.txt \
-       howto-gpg.txt \
        howto-wrapper.txt \
        howtos.txt \
        index.txt \
index cd6e41e9fccd948491dee35cc5c7ba217b1d3051..a7846b18e450cc5508ce8252a4fe2da6c79f2f53 100644 (file)
@@ -41,6 +41,41 @@ subdir = docs
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+       $(top_srcdir)/config/gnulib/absolute-header.m4 \
+       $(top_srcdir)/config/gnulib/alloca.m4 \
+       $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/eoverflow.m4 \
+       $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/getaddrinfo.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-cache.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-common.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-comp.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-tool.m4 \
+       $(top_srcdir)/config/gnulib/inet_ntop.m4 \
+       $(top_srcdir)/config/gnulib/intmax_t.m4 \
+       $(top_srcdir)/config/gnulib/inttypes_h.m4 \
+       $(top_srcdir)/config/gnulib/lib-ld.m4 \
+       $(top_srcdir)/config/gnulib/lib-link.m4 \
+       $(top_srcdir)/config/gnulib/lib-prefix.m4 \
+       $(top_srcdir)/config/gnulib/lock.m4 \
+       $(top_srcdir)/config/gnulib/longdouble.m4 \
+       $(top_srcdir)/config/gnulib/longlong.m4 \
+       $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
+       $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \
+       $(top_srcdir)/config/gnulib/size_max.m4 \
+       $(top_srcdir)/config/gnulib/snprintf.m4 \
+       $(top_srcdir)/config/gnulib/socklen.m4 \
+       $(top_srcdir)/config/gnulib/sockpfaf.m4 \
+       $(top_srcdir)/config/gnulib/stdbool.m4 \
+       $(top_srcdir)/config/gnulib/stdint_h.m4 \
+       $(top_srcdir)/config/gnulib/strdup.m4 \
+       $(top_srcdir)/config/gnulib/string_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
+       $(top_srcdir)/config/gnulib/vasnprintf.m4 \
+       $(top_srcdir)/config/gnulib/visibility.m4 \
+       $(top_srcdir)/config/gnulib/wchar_t.m4 \
+       $(top_srcdir)/config/gnulib/wint_t.m4 \
+       $(top_srcdir)/config/gnulib/xsize.m4 \
        $(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
@@ -59,8 +94,10 @@ am__installdirs = "$(DESTDIR)$(pkgdatadir)"
 pkgdataDATA_INSTALL = $(INSTALL_DATA)
 DATA = $(pkgdata_DATA)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ABSOLUTE_STRING_H = @ABSOLUTE_STRING_H@
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
+ALLOCA_H = @ALLOCA_H@
 AMANDA_DBGDIR = @AMANDA_DBGDIR@
 AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@
 AMANDA_TMPDIR = @AMANDA_TMPDIR@
@@ -75,18 +112,17 @@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@
 AMTAR = @AMTAR@
 AM_CFLAGS = @AM_CFLAGS@
 AR = @AR@
+ARPA_INET_H = @ARPA_INET_H@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
-AWK_VAR_ASSIGNMENT_OPT = @AWK_VAR_ASSIGNMENT_OPT@
 BINARY_OWNER = @BINARY_OWNER@
-BUILD_MAN_PAGES_FALSE = @BUILD_MAN_PAGES_FALSE@
-BUILD_MAN_PAGES_TRUE = @BUILD_MAN_PAGES_TRUE@
 CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
+CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
 CHIO = @CHIO@
 CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
@@ -119,18 +155,40 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
+ENABLE_MANPAGE_BUILD_FALSE = @ENABLE_MANPAGE_BUILD_FALSE@
+ENABLE_MANPAGE_BUILD_TRUE = @ENABLE_MANPAGE_BUILD_TRUE@
+EOVERFLOW = @EOVERFLOW@
+EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@
 EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
+GCC_COMPILER_FALSE = @GCC_COMPILER_FALSE@
+GCC_COMPILER_TRUE = @GCC_COMPILER_TRUE@
 GETCONF = @GETCONF@
+GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@
+GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
 GNUTAR_LISTED_INCREMENTAL_DIRX = @GNUTAR_LISTED_INCREMENTAL_DIRX@
 GREP = @GREP@
 GZIP = @GZIP@
-HAVE_XSLTPROC_FALSE = @HAVE_XSLTPROC_FALSE@
-HAVE_XSLTPROC_TRUE = @HAVE_XSLTPROC_TRUE@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRNDUP = @HAVE_STRNDUP@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE__BOOL = @HAVE__BOOL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -139,22 +197,31 @@ LDFLAGS = @LDFLAGS@
 LEX = @LEX@
 LEXLIB = @LEXLIB@
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
+LIBPTH = @LIBPTH@
+LIBPTH_PREFIX = @LIBPTH_PREFIX@
 LIBS = @LIBS@
+LIBTHREAD = @LIBTHREAD@
 LIBTOOL = @LIBTOOL@
 LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LL_FMT = @LL_FMT@
 LL_RFMT = @LL_RFMT@
 LN_S = @LN_S@
 LTALLOCA = @LTALLOCA@
+LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
 LTLIBOBJS = @LTLIBOBJS@
+LTLIBPTH = @LTLIBPTH@
+LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
 MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@
 MCUTIL = @MCUTIL@
+MKDIR_P = @MKDIR_P@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
+NETINET_IN_H = @NETINET_IN_H@
 OBJEXT = @OBJEXT@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -168,6 +235,9 @@ PERL = @PERL@
 PRINT = @PRINT@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
+REPLACE_STRCASECMP = @REPLACE_STRCASECMP@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRSTR = @REPLACE_STRSTR@
 RESTORE = @RESTORE@
 SAMBA_CLIENT = @SAMBA_CLIENT@
 SERVICE_SUFFIX = @SERVICE_SUFFIX@
@@ -176,7 +246,10 @@ SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 SNAPSHOT_STAMP = @SNAPSHOT_STAMP@
 SORT = @SORT@
+SSH = @SSH@
+STDBOOL_H = @STDBOOL_H@
 STRIP = @STRIP@
+SYS_SOCKET_H = @SYS_SOCKET_H@
 USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@
 VDUMP = @VDUMP@
 VERSION = @VERSION@
@@ -215,6 +288,7 @@ WANT_TAPE_TRUE = @WANT_TAPE_TRUE@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
 XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
 YACC = @YACC@
 ac_c = @ac_c@
 ac_ct_AR = @ac_ct_AR@
@@ -241,6 +315,8 @@ build_os = @build_os@
 build_vendor = @build_vendor@
 datadir = @datadir@
 exec_prefix = @exec_prefix@
+gl_LIBOBJS = @gl_LIBOBJS@
+gl_LTLIBOBJS = @gl_LTLIBOBJS@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -307,7 +383,6 @@ pkgdata_DATA = \
        howto-auth.txt \
        howto-cygwin.txt \
        howto-filedriver.txt \
-       howto-gpg.txt \
        howto-wrapper.txt \
        howtos.txt \
        index.txt \
index 00a9b629fab2475f3a9d879ec90a8d3681e0b47d..5fea43a22e93bb3df7b0067f971d7d36a181030f 100644 (file)
@@ -23,8 +23,11 @@ COMMANDS
 Commands that take a hostname [ disks ] parameter pair operate on all disks in
 the disklist for that hostname if no disks are specified. Where hostname is
 also marked as being optional, the command operates on all hosts and disks in
-the disklist. Both hostname and disks are special expressions, see the "HOST &
+the disklist. Both hostname and disks are special expressions; see the "HOST &
 DISK EXPRESSION" section of amanda(8) for a description.
+Commands that take one or more dumpspec parameters operate on the set of dumps
+specified by all of the expressions. See the "DUMP SPECIFICATIONS" section of
+amanda(8) for a description.
 
 
   version
@@ -77,6 +80,15 @@ DISK EXPRESSION" section of amanda(8) for a description.
       An uppercase letter reverses the sort order for that key. The default
       sort order is hkdlpb.
 
+  holding delete hostname [ disk [ datestamp [ .. ] ] ]
+      Delete holding files matching the given specification. At least a
+      hostname must be provided.
+
+  holding list [-l] [ hostname [ disk [ datestamp [ .. ] ] ] ]
+      List holding files matching the given specification, or all holding files
+      if no specification is provided. With '-l', additional information (size
+      and level) is provided.
+
   delete [ hostname [ disks ]* ]+
       Delete the specified disks on hostname from the Amanda database.
 
@@ -113,7 +125,7 @@ DISK EXPRESSION" section of amanda(8) for a description.
       hosts). Mostly used for debugging.
 
   -o configoption
-      See the "CONFIGURATION OVERWRITE" section in amanda(8).
+      See the "CONFIGURATION OVERRIDE" section in amanda(8).
 
 
 EXAMPLES
index 49dcc7668e13aaf303cb3cab490583553913bcfa..50bdd40b6aca2cf4156d7a13c9f11d87dc6c6594 100644 (file)
@@ -114,6 +114,58 @@ PARAMETERS
       Default: /etc/amandates. The file where amanda keep the last date of each
       dumplevel.
 
+  connect_tries int
+      Default: 3. How many times the server will try a connection.
+
+  rep_tries int
+      Default: 5. How many times amandad will resend a REP packet if it doesn't
+      get the ACK packet.
+
+  debug_amandad int
+      Default: 0. Debug level of the amandad process
+
+  debug_amidxtaped int
+      Default: 0. Debug level of the amidxtaped process
+
+  debug_amindexd int
+      Default: 0. Debug level of the amindexd process
+
+  debug_amrecover int
+      Default: 0. Debug level of the amrecover process
+
+  debug_auth int
+      Default: 0. Debug level of the auth module
+
+  debug_event int
+      Default: 0. Debug level of the event module
+
+  debug_holding int
+      Default: 0. Debug level of the holdingdisk module
+
+  debug_protocol int
+      Default: 0. Debug level of the protocol module
+
+  debug_selfcheck int
+      Default: 0. Debug level of the selfcheck process
+
+  debug_sendsize int
+      Default: 0. Debug level of the sendsize process
+
+  debug_sendbackup int
+      Default: 0. Debug level of the sendbackup process
+
+  reserved-udp-port int,int
+      Default: --with-udpportrange or 512,1023. Reserved udp port that will be
+      used (amrecover with bsd or bsdudp)
+
+  reserved-tcp-port int,int
+      Default: --with-low-tcpportrange or 512,1023. Reserved tcp port that will
+      be used (amrecover with bsdtcp)
+
+  unreserved-tcp-port int,int
+      Default: --with-tcpportrange or 1025,65536. Unreserved tcp port that will
+      be used (bsd, bsdudp)
+
 
 AUTHOR
 
index 8117a38fddec95980fdf23f7a6e4ee93c4819ce0..845dfeecc7f969afabe0d278a8f31fdd1b60c84c 100644 (file)
@@ -439,7 +439,24 @@ Leading ^ is removed. Trailing $ forces an exact match.
 |200010$____|match_only_200010____________________________________________|
 
 
-CONFIGURATION OVERWRITE
+DUMP SPECIFICATIONS
+
+A dump specification selects one or more dumps. It has the form [host][:disk]
+[@datestamp], where each component is a pattern as described above. If a
+component is missing, it is treated as a wildcard. The characters ':', '@', and
+'\' may be escaped within any component by preceding them with a '\'.
+Some examples:
+
+DUMPSPEC                        DESCRIPTION
+client17                        all dumps of client17
+@20080615                       All dumps on with datestamps matching 20080615
+webserver:/var/www              All dumps of /var/www on host webserver
+webserver:/var/www@200806150317 The dump of webserver with datestamp
+                                200806150317
+:/var/www                       All dumps of /var/www on any host
+
+
+CONFIGURATION OVERRIDE
 
 Most command allow to overwrite any configuration parameter on the command line
 with the -o option.
index 7ddef200d079c9c9a9c4e9934154db81dd0db1f9..c1ddfdd03ca55ec5fbd43446f4d32d443e313c89 100644 (file)
@@ -252,6 +252,13 @@ PARAMETERS
       will be interpreted as a total amount of time to wait per client instead
       of per disk.
 
+  connect_tries int
+      Default: 3. How many times the server will try a connection.
+
+  req_tries int
+      Default: 3. How many times the server will resend a REQ packet if it
+      doesn't get the ACK packet.
+
   netusage int
       Default: 300 Kbps. The maximum network bandwidth allocated to Amanda, in
       Kbytes per second. See also the interface section.
@@ -419,6 +426,45 @@ PARAMETERS
       the current file. Useful for sharing dumptypes, tapetypes and interface
       definitions among several configurations.
 
+  debug_auth int
+      Default: 0. Debug level of the auth module
+
+  debug_event int
+      Default: 0. Debug level of the event module
+
+  debug_holding int
+      Default: 0. Debug level of the holdingdisk module
+
+  debug_protocol int
+      Default: 0. Debug level of the protocol module
+
+  debug_planner int
+      Default: 0. Debug level of the planner process
+
+  debug_driver int
+      Default: 0. Debug level of the driver process
+
+  debug_dumper int
+      Default: 0. Debug level of the dumper process
+
+  debug_chunker int
+      Default: 0. Debug level of the chunker process
+
+  debug_taper int
+      Default: 0. Debug level of the taper process
+
+  reserved-udp-port int,int
+      Default: --with-udpportrange or 512,1023. Reserved udp port that will be
+      used (bsd, bsdudp)
+
+  reserved-tcp-port int,int
+      Default: --with-low-tcpportrange or 512,1023. Reserved tcp port that will
+      be used (bsdtcp)
+
+  unreserved-tcp-port int,int
+      Default: --with-tcpportrange or 1025,65536. Unreserved tcp port that will
+      be used (bsd, bsdudp)
+
 
 HOLDINGDISK SECTION
 
@@ -913,6 +959,13 @@ The tapetype options and values are:
       raised if Amanda was compiled with the configure option --with-
       maxtapeblocksize=N set with "N" greater than 32 during configure.
 
+  readblocksize int
+      Default: (from configure --with-maxtapeblocksize). How much data will be
+      read in each tape record expressed in KiloBytes. Some hardware require a
+      value not too large, and some require it to be equal to the blocksize. It
+      is useful if you configured amanda with a big --with-maxtapeblocksize and
+      your hardware don't work with a value that big.
+
   file-pad boolean
       Default: true. If true, every record, including the last one in the file,
       will have the same length. This matches the way Amanda wrote tapes prior
index 64fb2fb82397c8c5aff6963d916a43bb3e566434..f043cf959a35b8857e29276f5fd87aa612d55b57 100644 (file)
@@ -34,7 +34,7 @@ OPTIONS
       Run the tape server local and tape checks (same as -lt).
 
   -c
-      Run the client host checks.Multiple specific clients can be checked by
+      Run the client host checks. Multiple specific clients can be checked by
       specifying the client name.
 
   -l
@@ -67,7 +67,7 @@ OPTIONS
       Specify the host and disk on which the command will work.
 
   -o configoption
-      See the "CONFIGURATION OVERWRITE" section in amanda(8).
+      See the "CONFIGURATION OVERRIDE" section in amanda(8).
 
 The default is -cs.
 
index 36c8636f3e9539787bb8be8dd4cbd0d420777093..bcfbf6e80f2809364d505d25bec0f31253e18f40 100644 (file)
@@ -34,7 +34,7 @@ OPTIONS
       Specify the host and disk on which the command will work.
 
   -o configoption
-      See the "CONFIGURATION OVERWRITE" section in amanda(8).
+      See the "CONFIGURATION OVERRIDE" section in amanda(8).
 
 
 EXAMPLE
index 34c15f500d10599b406c37fa48d4ff55b3369404..7015e6ca6fa281d314569785cb86078fb4b8bdbd 100644 (file)
@@ -97,7 +97,7 @@ OPTIONS
       usually be autodetected, and should not normally need to be set.
 
   -o configoption
-      See the "CONFIGURATION OVERWRITE" section in amanda(8).
+      See the "CONFIGURATION OVERRIDE" section in amanda(8).
 
 
 EXAMPLES
index 556a4e947e156eab921ac287a7a918f364fdf38d..df6d97093cdb604e4fbb2de40da08353796c1958 100644 (file)
@@ -47,7 +47,7 @@ OPTIONS
       Specify the host and disk on which the command will work.
 
   -o configoption
-      See the "CONFIGURATION OVERWRITE" section in amanda(8).
+      See the "CONFIGURATION OVERRIDE" section in amanda(8).
 
 You can specify many host/disk expressions, only disks that match an expression
 will be flushed. All disks are flushed if no expressions are given. see the
index a38cbc0828e9f6e221847f300050accd698a51df..af2093283d01041f149dfe2db3b87b1a2627229c 100644 (file)
@@ -71,7 +71,7 @@ OPTIONS
 
 
   -o configoption
-      See the "CONFIGURATION OVERWRITE" section in amanda(8).
+      See the "CONFIGURATION OVERRIDE" section in amanda(8).
 
 
 EXAMPLE
index 1600f29e2c7df82ad70b45add162381b9d517c9b..89a0985f4d4c7c5980e7b40f1774a44c5a45b129 100644 (file)
@@ -38,7 +38,7 @@ OPTIONS
 
 
   -o configoption
-      See the "CONFIGURATION OVERWRITE" section in amanda(8).
+      See the "CONFIGURATION OVERRIDE" section in amanda(8).
 
 
 EXAMPLE
index a32faf702747f249aa683ceb54ea3dd1e01c75f1..b0f5373427a5fbeb1ffce6037b3e030e2ab26aec 100644 (file)
@@ -47,7 +47,7 @@ client-encrypted or client-custom-compressed tapes.
       Tape device to use on the tape server host.
 
   -o clientconfigoption
-      See the "CONFIGURATION OVERWRITE" section in amanda(8).
+      See the "CONFIGURATION OVERRIDE" section in amanda(8).
 
 
 COMMANDS
@@ -92,7 +92,7 @@ be extracted from the backup system. The following commands are available:
 
 
 
-  setdiskdiskname [mountpoint]
+  setdisk diskname [mountpoint]
       Specifies which disk to consider (default: the disk holding the working
       directory where amrecover is started). It can only be set after the host
       is set with sethost. Diskname is the device name specified in the
@@ -100,13 +100,13 @@ be extracted from the backup system. The following commands are available:
       host. If mountpoint is not specified, all pathnames will be relative to
       the (unknown) mount point instead of full pathnames.
 
-  listhost[diskdevice]
+  listhost [diskdevice]
       List all host
 
-  listdisk[diskdevice]
+  listdisk [diskdevice]
       List all diskname
 
-  settape[[server]:][tapedev|default]
+  settape [[server]:][tapedev|default]
       Specifies the host to use as the tape server, and which of its tape
       devices to use. If the server is omitted, but the colon is not, the
       server name reverts to the configure-time default. If the tape device is
@@ -132,7 +132,7 @@ be extracted from the backup system. The following commands are available:
 
 
 
-  setmodemode
+  setmode mode
       Set the extraction mode for Samba shares. If mode is smb, shares are sent
       to the Samba server to be restored back onto the PC. If mode is tar, they
       are extracted on the local machine the same way tar volumes are
@@ -156,14 +156,14 @@ be extracted from the backup system. The following commands are available:
       otherwise they are relative to the current backup working directory. The
       dir can be a shell style wildcards.
 
-  cdxdir
+  cdx dir
       Like the cd command but allow regular expression.
 
   lpwd
       Display the amrecover working directory. Files will be restored under
       this directory, relative to the backed up filesystem.
 
-  lcdpath
+  lcd path
       Change the amrecover working directory to path.
 
   ls
@@ -171,23 +171,23 @@ be extracted from the backup system. The following commands are available:
       description of the setdate command for how the view of the directory is
       built up. The backup date is shown for each file.
 
-  additem1 item2 ...
+  add item1 item2 ...
       Add the specified files or directories to the restore list. Each item may
       have shell style wildcards.
 
-  addxitem1 item2 ...
+  addx item1 item2 ...
       Add the specified files or directories to the restore list. Each item may
       be a regular expression.
 
-  deleteitem1 item2 ...
+  delete item1 item2 ...
       Delete the specified files or directories from the restore list. Each
       item may have shell style wildcards.
 
-  deletexitem1 item2 ...
+  deletex item1 item2 ...
       Delete the specified files or directories from the restore list. Each
       item may be a regular expression.
 
-  listfile
+  list file
       Display the contents of the restore list. If a file name is specified,
       the restore list is written to that file. This can be used to manually
       extract the files from the Amanda tapes with amrestore.
index d7bd98ef43955a564d15f881c00e31f4d942c8e6..21c0b0cc6ba82f73c0b9c4f830e78d55dd5e4bf0 100644 (file)
@@ -52,7 +52,7 @@ where logdir is the log directory defined in amanda.conf.
       is specified in amanda.conf.
 
   -o configoption
-      See the "CONFIGURATION OVERWRITE" section in amanda(8).
+      See the "CONFIGURATION OVERRIDE" section in amanda(8).
 
 
 LABEL PRINTING
index 2b5f66d2cb5a2251c2fee20d7092de292e4e5b2a..2d8add17fab0042442e6ca094073c55515ff95a1 100644 (file)
@@ -96,7 +96,7 @@ tape blocksize. This makes the resulting image usable as a holding file.
 
 
   -o configoption
-      See the "CONFIGURATION OVERWRITE" section in amanda(8).
+      See the "CONFIGURATION OVERRIDE" section in amanda(8).
 
 
 EXAMPLES
index 3405b7bc2f19d4293d1992fff8beb79821097832..fe6738047ceb9f31b74b26627f66382f1b4a816a 100644 (file)
@@ -91,7 +91,7 @@ COMMANDS
       tape, but do not load it.
 
   -o configoption
-      See the "CONFIGURATION OVERWRITE" section in amanda(8).
+      See the "CONFIGURATION OVERRIDE" section in amanda(8).
 
 This is useful with non-gravity stackers to unload the last tape used and set
 up Amanda for the next run. If you just use eject, the current tape will be
index f0d523be3644953f883e3f6e4c85d28ac495c547..2ce8b229423c85e1d17097f60ccbe551428ba8a5 100644 (file)
@@ -29,11 +29,6 @@ Table of Contents
 
   Hacking_notes
 
-
-Note
-
-Refer to http://www.amanda.org/docs/chgscsi.html for the current version of
-this document.
 Jason's new and improved chg-scsi documentation.
 This documentation will also include an occasional reference to the mtx suite
 as I have attempted to use chg-zd-mtx. I use mtx often as a fast query tool.
@@ -258,6 +253,11 @@ My desires are:
   I had to create a type called "L500" or else the spaces would throw off the
   comparisons.
 
+
+Note
+
+Refer to http://www.amanda.org/docs/chgscsi.html for the current version of
+this document.
 -------------------------------------------------------------------------------
 
 Prev                            Up                                   Next
index 770e1d585a9dfa6b849f2dddc3933203e4692c30..661fa518fc221cc1e090166f2cfdf61334130015 100644 (file)
@@ -46,11 +46,6 @@ Table of Contents
   Conclusion
 
 
-Note
-
-Refer to http://www.amanda.org/docs/dumperapi.html for the current version of
-this document.
-
  Introduction
 
 This is a proposal of a mechanism for Amanda to support arbitrary backup
@@ -317,6 +312,11 @@ the header of backup images, to ease crash-recovery.
 Well, that's all. Drop us a note at the amanda-hackers mailing list (mailto://
 amanda-hackers@amanda.org) if you have suggestions to improve this document
 and/or the API. Some help on its implementation would be welcome, too.
+
+Note
+
+Refer to http://www.amanda.org/docs/dumperapi.html for the current version of
+this document.
 -------------------------------------------------------------------------------
 
 Prev                                     Up                           Next
index dd8e2821f000bb32d689d3e792a02701c6e76746..51c899261431a56c7fbb8d90879c319bae7ee117 100644 (file)
@@ -64,11 +64,6 @@ Table of Contents
 
 
 
-Note
-
-Refer to http://www.amanda.org/docs/eventapi.html for the current version of
-this document.
-
  Introduction
 
 This is a document of the API for the event handler. The purpose of the event
@@ -168,6 +163,11 @@ passed to event_register between each interval.
 
 This type of event will fire when someone calls event_wakeup() with the numeric
 argument equal to the argument this event was registered with.
+
+Note
+
+Refer to http://www.amanda.org/docs/eventapi.html for the current version of
+this document.
 -------------------------------------------------------------------------------
 
 Prev                           Up                              Next
index 16a953077c64f8a37cd0fd4e6925b2736975f73d..030c06b4c47287c4bfb573d8c1fa341eca4cf0b2 100644 (file)
@@ -44,11 +44,6 @@ Table of Contents
 
 
 
-Note
-
-Refer to http://www.amanda.org/docs/exclude.html for the current version of
-this document.
-
  Introduction
 
 There are times when data needs to be excluded from a backup. When these times
@@ -332,6 +327,11 @@ then the string following the "=" is the file or directory that is currently
 set to be excluded.
 Contact the amanda-users mailing list: mailto://amanda-users@amanda.org.
 Subscription information is available at http://www.amanda.org.
+
+Note
+
+Refer to http://www.amanda.org/docs/exclude.html for the current version of
+this document.
 -------------------------------------------------------------------------------
 
 Prev                                   Up                              Next
index 82fb691b6787a9e238a22af0b1518698cfa19bf3..9e4da7b5b1032960cd5b9c39792920e370c23159 100644 (file)
@@ -16,11 +16,6 @@ Stefan G. Weichinger
 XML-conversion;Updates
 AMANDA Core Team
 <sgw@amanda.org>
-
-Note
-
-Refer to http://www.amanda.org/docs/faq.html for the current version of this
-document.
 This file contains answers to some questions that are frequently asked in the
 Amanda mailing lists, specially by new users. Please take a look at this file
 before posting, this can save us time that could be spent improving Amanda and
@@ -575,6 +570,11 @@ www.amanda.org/fom-serve/cache/1.html.
  always correct. You can fix it quickly by setting an environment variable to
  e.g. LINES=24 (and export it).
 
+
+Note
+
+Refer to http://www.amanda.org/docs/faq.html for the current version of this
+document.
 -------------------------------------------------------------------------------
 
 Prev                       Up                                           Next
index 4554e4f7a08336c17f2f70575e4db785a60dcb53..481ac548e131a7038cb2b6b289c9cffed1c429e8 100644 (file)
@@ -16,17 +16,17 @@ Stefan G. Weichinger
 XML-conversion;Updates
 AMANDA Core Team
 <sgw@amanda.org>
-
-Note
-
-Refer to http://www.amanda.org/docs/howto-afs.html for the current version of
-this document.
 You need to download the following package if you want to backup AFS volume
 with amanda:
 ftp://ftp.ccmr.cornell.edu/pub/amanda-afs/amanda-afs.tar.gz
 or anonymous cvs from :pserver:anonymous@cvs.ccmr.cornell.edu:/usr/common/cvs
 and checkout project 'amanda-afs'
 The patch to Amanda is already included in this distribution.
+
+Note
+
+Refer to http://www.amanda.org/docs/howto-afs.html for the current version of
+this document.
 -------------------------------------------------------------------------------
 
 Prev                                     Up                               Next
index 6e3ffc5ac0591195e1b5d9a011865b8ce553e0b4..6098b4a5c4909f3c00f36be16474080cdd8e831e 100644 (file)
@@ -37,11 +37,6 @@ Table of Contents
         For_amrecover:
 
 
-
-Note
-
-Refer to http://www.amanda.org/docs/howto-auth.html for the current version of
-this document.
 This document covers the use of the auth in Amanda 2.5.1 and higher.
 
 Introduction
@@ -188,6 +183,11 @@ For security reason, you must prefix all lines with the following:
 
 That will limit every client key to connect from the client and only be able to
 execute amandad.
+
+Note
+
+Refer to http://www.amanda.org/docs/howto-auth.html for the current version of
+this document.
 -------------------------------------------------------------------------------
 
 Prev                                      Up                           Next
index 5daa0d158238d32b2d32e5a70ad1f6d81b4d9291..6f2e4038c3bbce298ecdc3fae8e7a3d6a5dcd2ad 100644 (file)
@@ -45,11 +45,6 @@ Table of Contents
         Debugging_Files
 
 
-
-Note
-
-Refer to http://www.amanda.org/docs/howto-cygwin.html for the current version
-of this document.
 by Doug Kingston, 30 January 2003. Based on Cygwin 1.3.18, and Amanda 2.4.3-
 20021027 and some fixes which will be in the official release by the time you
 see this.
@@ -254,6 +249,11 @@ something similar if you want to get the Windows files and the Cygwin files. '/
 
 Amanda will leave debugging files in /tmp/amanda if it exists. I have
 recommended to create this directory above.
+
+Note
+
+Refer to http://www.amanda.org/docs/howto-cygwin.html for the current version
+of this document.
 -------------------------------------------------------------------------------
 
 Prev               Up                                            Next
index b6ba1df80977efb32d7034d16441f221405e83b8..0d3104733ca284fcb3aba593ab4e68108b376947 100644 (file)
@@ -27,11 +27,6 @@ Table of Contents
 
   Recovery
 
-
-Note
-
-Refer to http://www.amanda.org/docs/howto-filedriver.html for the current
-version of this document.
 This document covers the use of the file-driver in Amanda 2.4.3 and higher.
 Examples given here have been taken from a SuSE-Linux-8.2-Pro-environment,
 using Amanda 2.4.4p1 and the snapshot 2.4.4p1-20031202. Please adjust paths,
@@ -427,6 +422,11 @@ Please be aware of the fact reported by JC Simonetti: " I have never never used
 the "settape" command of amrecover [with chg-disk] since there's some problems
 with it (tape not loaded correctly, or impossible to change from tape to tape
 when restoring data shared accross multiple tapes...) "
+
+Note
+
+Refer to http://www.amanda.org/docs/howto-filedriver.html for the current
+version of this document.
 -------------------------------------------------------------------------------
 
 Prev                                 Up                    Next
diff --git a/docs/howto-gpg.txt b/docs/howto-gpg.txt
deleted file mode 100644 (file)
index 1c8163c..0000000
+++ /dev/null
@@ -1,281 +0,0 @@
-
-Chapter 16. How to do Amanda-server-side gpg-encrypted backups.
-Prev  Part III. HOWTOs                                     Next
-
--------------------------------------------------------------------------------
-
-Chapter 16. How to do Amanda-server-side gpg-encrypted backups.
-
-
-Stefan G. Weichinger
-
-Original text
-AMANDA Core Team
-<sgw@amanda.org>
-Table of Contents
-
-
-  Setup
-
-  Test
-
-  Plans
-
-
-Note
-
-Refer to http://www.amanda.org/docs/howto-gpg.html for the current version of
-this document.
-
-Note
-
-THIS IS *NOT* YET INTENDED FOR PRODUCTION SERVERS !!!
-Bruce Fletcher asked for a "simple" encryption method to be used with Amanda-
-server. gpg-amanda http://security.uchicago.edu/tools/gpg-amanda/ seems to
-create problems at restore-time, as it uses a wrapper for gzip.
-My solution uses a wrapper for GNU-tar instead, so there are several
-disadvantages avoided.
-
-Note
-
-This is based on a Amanda-vtape-setup with the Amanda-release 2.4.5. As this is
-still in the testing-stage, I have coded the home-dir of the Amanda-user into
-my scripts (/var/lib/amanda). This should be done with variables later, I agree
-...
-What you need:
-
-* aespipe http://loop-aes.sourceforge.net/aespipe/aespipe-v2.3b.tar.bz2 and the
-  bz2aespipe-wrapper that comes with it. It gets patched as described later.
-* the wrapper-script /usr/local/libexec/amgtar, as listed down below,
-* GNU-PG http://www.gnupg.org/(en)/download/index.html. This should be part of
-  most current operating systems already.
-* Amanda ;)
-
-
-Setup
-
-
-* Configure and compile aespipe:
-
-    tar -xjf aespipe-v2.3b.tar.bz2
-    cd aespipe-v2.3b
-    ./configure
-    make
-    make install
-
-* Generate and store the gpg-key for the Amanda-user:
-
-    # taken from the aespipe-README
-    head -c 2925 /dev/random | uuencode -m - | head -n 66 | tail -n 65 | \
-    gpg --symmetric -a > /var/lib/amanda/.gnupg/am_key.gpg
-
-  This will ask for a passphrase. Remember this passphrase as you will need it
-  in the next step.
-  Store the passphrase inside the home-directory of the Amanda-user and protect
-  it with proper permissions:
-
-    echo my_secret_passphrase > ~amanda/.am_passphrase
-    chown amanda:disk ~amanda/.am_passphrase
-    chmod 700 ~amanda/.am_passphrase
-
-  We need this file because we don't want to have to enter the passphrase
-  manually everytime we run amdump. We have to patch bz2aespipe to read the
-  passphrase from a file. I have called that file ~amanda/.am_passphrase.
-  It should NOT ;) look like this:
-
-    # cat ~amanda/.am_passphrase
-    my_secret_passphrase
-
-
-  Note
-
-  Store the key and the passphrase in some other place as well, without these
-  information you can't access any tapes that have been encrypted with it (this
-  is exactly why we are doing all this, isn't it? ;) ).
-* Create the wrapper for GNU-tar:
-  Example 16.1. /usr/local/libexec/amgtar
-
-    #!/bin/sh
-    #
-    # Original wrapper by Paul Bijnens
-    #
-    # crippled by Stefan G. Weichinger
-    # to enable gpg-encrypted dumps via aespipe
-
-    GTAR=/bin/tar
-    AM_AESPIPE=/usr/local/bin/amaespipe
-    AM_PASSPHRASE=/var/lib/amanda/.am_passphrase
-    LOG=/dev/null
-    LOG_ENABLED=1
-
-    if [ "$LOG_ENABLED" = "1" ]
-    then
-    LOG=/var/log/amanda/amgtar.debug
-    date >> $LOG
-    echo "$@" >> $LOG
-    fi
-
-    if [ "$3" = "/dev/null" ]
-    then
-       echo "Estimate only" >> $LOG
-       $GTAR "$@"
-    else
-       echo "Real backup" >> $LOG
-       $GTAR --use-compress-program="$AM_AESPIPE" "$@" 3< $AM_PASSPHRASE
-    fi
-
-    rc=$?
-    exit $rc
-
-
-* Copy the wrapper-script bz2aespipe, which comes with the aespipe-tarball, to
-  /usr/local/bin/amaespipe and edit it this way:
-  Example 16.2. /usr/local/bin/amaespipe
-
-    #! /bin/sh
-
-    # FILE FORMAT
-    # 10 bytes: constant string 'bz2aespipe'
-    # 10 bytes: itercountk digits
-    # 1 byte: '0' = AES128, '1' = AES192, '2' = AES256
-    # 1 byte: '0' = SHA256, '1' = SHA384, '2' = SHA512, '3' = RMD160
-    # 24 bytes: random seed string
-    # remaining bytes are bzip2 compressed and aespipe encrypted
-
-    # These definitions are only used when encrypting.
-    # Decryption will autodetect these definitions from archive.
-    ENCRYPTION=AES256
-    HASHFUNC=SHA256
-    ITERCOUNTK=100
-    WAITSECONDS=1
-    GPGKEY="/var/lib/amanda/.gnupg/am_key.gpg"
-    FDNUMBER=3
-
-    if test x$1 = x-d ; then
-        # decrypt
-        n=`head -c 10 - | tr -d -c 0-9a-zA-Z`
-        if test x${n} != xbz2aespipe ; then
-            echo "bz2aespipe: wrong magic - aborted" >/dev/tty
-            exit 1
-        fi
-        itercountk=`head -c 10 - | tr -d -c 0-9`
-        if test x${itercountk} = x ; then itercountk=0; fi
-        n=`head -c 1 - | tr -d -c 0-9`
-        encryption=AES128
-        if test x${n} = x1 ; then encryption=AES192; fi
-        if test x${n} = x2 ; then encryption=AES256; fi
-        n=`head -c 1 - | tr -d -c 0-9`
-        hashfunc=SHA256
-        if test x${n} = x1 ; then hashfunc=SHA384; fi
-        if test x${n} = x2 ; then hashfunc=SHA512; fi
-        if test x${n} = x3 ; then hashfunc=RMD160; fi
-        seedstr=`head -c 24 - | tr -d -c 0-9a-zA-Z+/`
-        #aespipe -K ${GPGKEY} -p ${FDNUMBER} -e ${encryption} -H ${hashfunc} -
-    S "${seedstr}" -C ${itercountk} -d | bzip2 -d -q
-        aespipe -K ${GPGKEY} -p ${FDNUMBER} -e ${encryption} -H ${hashfunc} -
-    S "${seedstr}" -C ${itercountk} -d
-    else
-        # encrypt
-        echo -n bz2aespipe
-        echo ${ITERCOUNTK} | awk '{printf "%10u", $1;}'
-        n=`echo ${ENCRYPTION} | tr -d -c 0-9`
-        aesstr=0
-        if test x${n} = x192 ; then aesstr=1; fi
-        if test x${n} = x256 ; then aesstr=2; fi
-        n=`echo ${HASHFUNC} | tr -d -c 0-9`
-        hashstr=0
-        if test x${n} = x384 ; then hashstr=1; fi
-        if test x${n} = x512 ; then hashstr=2; fi
-        if test x${n} = x160 ; then hashstr=3; fi
-        seedstr=`head -c 18 /dev/urandom | uuencode -m - | head -n 2 | tail -
-    n 1`
-        echo -n ${aesstr}${hashstr}${seedstr}
-        #bzip2 | aespipe -K ${GPGKEY} -p ${FDNUMBER} -e ${ENCRYPTION} -H $
-    {HASHFUNC} -S ${seedstr} -C ${ITERCOUNTK} -w ${WAITSECONDS}
-        aespipe -K ${GPGKEY} -p ${FDNUMBER} -e ${ENCRYPTION} -H ${HASHFUNC} -
-    S ${seedstr} -C ${ITERCOUNTK} -w ${WAITSECONDS}
-    fi
-    exit 0
-
-
-  or apply this small patch
-  Example 16.3. bz2aespipe.patch
-
-    @@ -15,3 +15,5 @@
-     ITERCOUNTK=100
-    -WAITSECONDS=10
-    +WAITSECONDS=1
-    +GPGKEY="/var/lib/amanda/.gnupg/am_key.gpg"
-    +FDNUMBER=3
-
-    @@ -36,3 +38,4 @@
-         seedstr=`head -c 24 - | tr -d -c 0-9a-zA-Z+/`
-    -    aespipe -e ${encryption} -H ${hashfunc} -S "${seedstr}" -C $
-    {itercountk} -d | bzip2 -d -q
-    +    #aespipe -K ${GPGKEY} -p ${FDNUMBER} -e ${encryption} -H ${hashfunc} -
-    S "${seedstr}" -C ${itercountk} -d | bzip2 -d -q
-    +    aespipe -K ${GPGKEY} -p ${FDNUMBER} -e ${encryption} -H ${hashfunc} -
-    S "${seedstr}" -C ${itercountk} -d
-     else
-    @@ -52,3 +55,4 @@
-         echo -n ${aesstr}${hashstr}${seedstr}
-    -    bzip2 | aespipe -e ${ENCRYPTION} -H ${HASHFUNC} -S ${seedstr} -C $
-    {ITERCOUNTK} -T -w ${WAITSECONDS}
-    +    #bzip2 | aespipe -K ${GPGKEY} -p ${FDNUMBER} -e ${ENCRYPTION} -H $
-    {HASHFUNC} -S ${seedstr} -C ${ITERCOUNTK} -w ${WAITSECONDS}
-    +    aespipe -K ${GPGKEY} -p ${FDNUMBER} -e ${ENCRYPTION} -H ${HASHFUNC} -
-    S ${seedstr} -C ${ITERCOUNTK} -w ${WAITSECONDS}
-     fi
-
-
-  Things I have changed:
-
-  o Decreased WAITSECONDS: No need to wait for 10 seconds to read the
-    passphrase.
-  o Removed bzip2 from the pipes: Amanda triggers GNU-zip-compression by
-    itself, no need to do this twice (slows down things, blows up size).
-  o Added options -K and -p: This enables aespipe to use the generated gpg-key
-    and tells it the number of the file-descriptor to read the passphrase from.
-
-
-  Note
-
-  You may set various parameters inside bz2aespipe. You may also call
-  bz2aespipe with various command-line-parameters to choose the encryption-
-  algorithm, hash-function etc. . For a start I have chosen to call bz2aespipe
-  without command-line-options.
-* Reconfigure and recompile Amanda (yes, I'm sorry ...):
-  As described in How_to_use_a_wrapper you have to run configure again with the
-  option --with-gnutar=/usr/local/libexec/amgtar, after that recompile and
-  reinstall Amanda. These steps are described in the mentioned document.
-
-
-Test
-
-Still to come ...
-
-Plans
-
-There are several wishes:
-
-* Ability to switch encryption inside a dumptype. This HOWTO describes a method
-  that enables/disables encryption for the whole installation. You might remove
-  the amgtar-wrapper and simply link to plain GNU-tar again to disable
-  encryption, but be aware that you also disable decryption with this step. You
-  will hit problems when you then try to restore encrypted tapes.
-* Ability to switch encryption-parameters inside a dumptype. Choice of
-  algorithm, hash-functions etc. I don't know if it makes sense to put it into
-  a dumptype or if it would be enough to configure it once inside amaespipe (I
-  assume the latter).
-* All this leads to the need to code this into Amanda itself: new dumptype-
-  options and corresponding calls to GNU-tar etc. inside client-src/sendbackup-
-  gnutar.c.
-
-This is it so far. Release early, release often. Feel free to contact me with
-your thoughts on this paper.
--------------------------------------------------------------------------------
-
-Prev                               Up                                    Next
-Chapter 15. How to use a wrapper  Home  Chapter 17. How to use different auth
-                                                                  with Amanda
-
index 15ecd962c573798325392409321993c8d5670348..ca8b8c84198808c93dea05477944ab78aa98c7bc 100644 (file)
@@ -28,11 +28,6 @@ Table of Contents
   Paul_Bijnens's_suggestions
 
 
-Note
-
-Refer to http://www.amanda.org/docs/howto-wrapper.html for the current version
-of this document.
-
 Note
 
 The script used in this document is not part of the official Amanda release.
@@ -83,7 +78,7 @@ course is just an example, anything you can do in a shell script can be done.
        no extra
        #   processing is necessary.
 
-       # What you see here is just a log of the backup start time, and \96 more
+       # What you see here is just a log of the backup start time, and more
        important
        #   the stopping of the domino server
 
@@ -295,6 +290,11 @@ Example 15.2.
   exit $rc;
 
 
+
+Note
+
+Refer to http://www.amanda.org/docs/howto-wrapper.html for the current version
+of this document.
 -------------------------------------------------------------------------------
 
 Prev                    Up                                            Next
index 5239e907aaa23c7f3afb85b593d5b6559d7c2833..561abc3ab5599884c176e9a84cf212dd7fd49bd9 100644 (file)
@@ -43,11 +43,6 @@ Table of Contents
 
   Known_Bugs
 
-
-Note
-
-Refer to http://www.amanda.org/docs/indexing.html for the current version of
-this document.
 This file describes how the index files are generated and how amrecover is
 used.
 
@@ -364,6 +359,11 @@ config/config-common.h
   specified by logical names, nor when an automounter is being used, or a link
   is in the path.
 
+
+Note
+
+Refer to http://www.amanda.org/docs/indexing.html for the current version of
+this document.
 -------------------------------------------------------------------------------
 
 Prev                   Up                                     Next
index 5b9e2af8770f57e34f93f25486dec8ab4e628d13..3bb164146a12cd7bb274a33dd4822dd6769e521d 100644 (file)
@@ -33,11 +33,6 @@ Table of Contents
         Set_up_the_Backup_Client_Hosts
 
 
-
-Note
-
-Refer to http://www.amanda.org/docs/install.html for the current version of
-this document.
 This document covers the compilation, installation, and runtime setup of Amanda
 2.4.2 and higher.
 
@@ -445,6 +440,11 @@ Before writing questions, you may prefer to take a look at the Amanda_FAQ and
 at the Amanda home page, at http://www.amanda.org. Browsable archives of Amanda
 mailing-lists are available at http://marc.theaimsgroup.com/?l=amanda-users and
 http://marc.theaimsgroup.com/?l=amanda-hackers.
+
+Note
+
+Refer to http://www.amanda.org/docs/install.html for the current version of
+this document.
 -------------------------------------------------------------------------------
 
 Prev                                       Up                   Next
index a95442ad1c032e54e0b6af2c02aad4ab5e60f111..55167285cc8557e765938a5c35818c869f5396c7 100644 (file)
@@ -29,11 +29,6 @@ Table of Contents
 
   taper(read)_and_taper(write)
 
-
-Note
-
-Refer to http://www.amanda.org/docs/internals.html for the current version of
-this document.
 This is an attempt to document Amanda's internals. Please feel free to make
 comments and suggest changes. Text for new sections gratefully accepted!
 
@@ -174,6 +169,11 @@ Write buffer W<bufnum> ---> <--- R<bufnum> Buffer empty <--- E<message> Error
 ack
 Close tape C ---> <--- C<label><filenum><stats> Closing
 Quit Q --->
+
+Note
+
+Refer to http://www.amanda.org/docs/internals.html for the current version of
+this document.
 -------------------------------------------------------------------------------
 
 Prev                            Up                           Next
index ad2272b89dd3c55ac5731c64e92c2ee7a0338291..8199c101cfc0fc0c2fbcd707abc174dc3894a21a 100644 (file)
@@ -83,6 +83,6 @@ V
 
 -------------------------------------------------------------------------------
 
-Prev                              
-Chapter 37. Web Ressources  Home  
+Prev               
+amverifyrun  Home  
 
index 81fdadd0b57de760ee9e23e226b885f615f1aa42..748a91654c91c6422252310d354dd4fe609e583b 100644 (file)
@@ -43,11 +43,6 @@ Table of Contents
 
 
 
-Note
-
-Refer to http://www.amanda.org/docs/kerberos.html for the current version of
-this document.
-
  Amanda 2.5.0 - KERBEROS v4 SUPPORT NOTES
 
 
@@ -246,6 +241,11 @@ Note
 
 There is no attempt to verify the realm in this case (only a concern if you
 have cross-realm authentication setup).
+
+Note
+
+Refer to http://www.amanda.org/docs/kerberos.html for the current version of
+this document.
 -------------------------------------------------------------------------------
 
 Prev                           Up                        Next
index 7342f166df81923b5b3814df90e8d13b6c91b150..475a4032856b049bdda022c7506dfd35f1c6d561 100644 (file)
@@ -24,11 +24,6 @@ Table of Contents
   How_it_works
 
 
-Note
-
-Refer to http://www.amanda.org/docs/labelprinting.html for the current version
-of this document.
-
  The New Feature
 
 Amanda now has the ability to print postscript paper tape labels. The labels
@@ -73,6 +68,11 @@ is copied, and the successful machines, partitions, and dump levels are
 appended to this. The output either goes to /tmp/reporter.out.ps (when running
 in testing mode) or through a pipe to the printer (default printer, if an
 alternate "printer" is not specified).
+
+Note
+
+Refer to http://www.amanda.org/docs/labelprinting.html for the current version
+of this document.
 -------------------------------------------------------------------------------
 
 Prev                                                    Up               Next
index 2df00fc2d40cc24d76c6ef73970b4ffa861708f2..2bd06985a3687b3d14657b8ea1bd33f20718fbc0 100644 (file)
@@ -12,11 +12,6 @@ Stefan G. Weichinger
 Original text
 AMANDA Core Team
 <sgw@amanda.org>
-
-Note
-
-Refer to http://www.amanda.org/docs/links.html for the current version of this
-document.
 See some original Amanda-papers by James da Silva and Olafur Gundmundsson here:
 
 * The presentation of Amanda:
@@ -26,6 +21,11 @@ See some original Amanda-papers by James da Silva and Olafur Gundmundsson here:
   Postscript: http://www.amanda.org/docs/usenix92.ps
   PDF: http://www.amanda.org/docs/usenix92.pdf
 
+
+Note
+
+Refer to http://www.amanda.org/docs/links.html for the current version of this
+document.
 -------------------------------------------------------------------------------
 
 Prev          Up    Next
index d68c5665836c1604fece92b640f2785e0077d89a..392596e4c2db01a11e789a4e0e75832e46053b9f 100644 (file)
@@ -73,12 +73,12 @@ Table of Contents
 
   amverifyrun \14 check the tapes written by the last Amanda run
 
+This chapter contains the manual pages from the official Amanda distribution.
 
 Note
 
 Refer to http://www.amanda.org/docs/manpages.html for the current version of
 this document.
-This chapter contains the manual pages from the official Amanda distribution.
 -------------------------------------------------------------------------------
 
 Prev                   Up      Next
index b9bbe49d5a00ca4bb6e536bed3fd06b5690aa1d0..eb77f6cc2b95ea6f103f958a385c62132d879ed0 100644 (file)
@@ -49,11 +49,6 @@ Table of Contents
 
 
 
-Note
-
-Refer to http://www.amanda.org/docs/multitape.html for the current version of
-this document.
-
  Introduction
 
 The goal of this enhancement is to make Amanda independent of the number of
@@ -175,6 +170,11 @@ or not.
 The lines in the tapelist file should contain the sequence number of the tape
 in its run, as well as the amount of data written on the tape, and perhaps
 whether or not the end of tape was reached.
+
+Note
+
+Refer to http://www.amanda.org/docs/multitape.html for the current version of
+this document.
 -------------------------------------------------------------------------------
 
 Prev                            Up                                        Next
index 92cd6ba1e51321172475a1b907c45803b1bf2ee1..45c98200ec59ed13003cc032309887b4f2183fd5 100644 (file)
@@ -31,11 +31,6 @@ Table of Contents
 
   Firewalls_and_NAT
 
-
-Note
-
-Refer to http://www.amanda.org/docs/portusage.html for the current version of
-this document.
 Amanda uses both UDP and TCP ports during its operation. The amandad service is
 listening (via inetd/xinetd) at a well known (fixed) port on each client for
 UDP connections. The amindexd and amidxtaped services are listening (also via
@@ -202,6 +197,11 @@ involved.
 The details of how you configure a specific firewall or NAT are beyond the
 scope of this document (although examples would be welcome). You need to read
 up on the documentation that comes with them.
+
+Note
+
+Refer to http://www.amanda.org/docs/portusage.html for the current version of
+this document.
 -------------------------------------------------------------------------------
 
 Prev                           Up                            Next
index 3fc018736dfe4c038ea47351104efcfb0c3dee2d..c75be0c8aa68a24ac1ff4f6d8d0a5a8a06e8c4ad 100644 (file)
@@ -25,11 +25,6 @@ Table of Contents
 
   Disaster_Recovery
 
-
-Note
-
-Refer to http://www.amanda.org/docs/rait.html for the current version of this
-document.
 Currently it is only integrated with the chg-manual changer script;
 collaboration on integrating it with the other tape changers is needed.
 
@@ -97,6 +92,11 @@ now also includes amdd, which is a simple dd(1) replacement which supports
 options, but which can read and write RAIT tapesets.
 Using amdd and your usual Amanda unpack instructions will suffice for disaster
 recovery from RAIT tape-sets.
+
+Note
+
+Refer to http://www.amanda.org/docs/rait.html for the current version of this
+document.
 -------------------------------------------------------------------------------
 
 Prev                  Up                             Next
index 182ae9f21901e51dfa07ed7c20557295ee1b7239..fc9a8d1b65bacd1048a3303152ad7321e77c040a 100644 (file)
@@ -30,11 +30,6 @@ Stefan G. Weichinger
 XML-conversion;Updates
 AMANDA Core Team
 <sgw@amanda.org>
-
-Note
-
-Refer to http://www.amanda.org/docs/restore.html for the current version of
-this document.
 This document describes how to restore files backed up with Amanda either with
 or without Amanda tools.
 All these cases assume you're trying to restore a complete disk, that is,
@@ -194,6 +189,11 @@ Barney) runs sunos.
 
 
 
+
+Note
+
+Refer to http://www.amanda.org/docs/restore.html for the current version of
+this document.
 -------------------------------------------------------------------------------
 
 Prev                                     Up                                Next
index 36046e6844dd7f8b2d474c64f6958fd60d2a4758..403f6f2f9bfb6601d5f8932dab94b1bee1bfe20a 100644 (file)
@@ -36,11 +36,6 @@ Table of Contents
   Bugs_and_notes
 
 
-Note
-
-Refer to http://www.amanda.org/docs/samba.html for the current version of this
-document.
-
  Installation
 
 Amanda is able to back up Microsoft Windows shared disks by using Samba, a
@@ -181,6 +176,11 @@ enabled. If you aren't using the GNU-tar part, you may get warnings about the
 availability of /usr/local/bin/gtar (or whatever it was compiled with). These
 may safely be ignored, unless you enable index generation for those
 filesystems.
+
+Note
+
+Refer to http://www.amanda.org/docs/samba.html for the current version of this
+document.
 -------------------------------------------------------------------------------
 
 Prev                              Up                 Next
index 043d7883190eaaae1ec52b5cefacc1e3548fe464..e0c4a839ed3904e5dd0a1f9f642ee2e0051db53d 100644 (file)
@@ -82,11 +82,6 @@ Table of Contents
 
 
 
-Note
-
-Refer to http://www.amanda.org/docs/security-api.html for the current version
-of this document.
-
  Introduction
 
 This is a document of the API for defining and utilizing multiple security and
@@ -440,6 +435,11 @@ Implementation of security_stream_read.
 
 void (*stream_read_cancel)(void *stream);
 Implementation of security_stream_read_cancel.
+
+Note
+
+Refer to http://www.amanda.org/docs/security-api.html for the current version
+of this document.
 -------------------------------------------------------------------------------
 
 Prev                           Up                           Next
index af06155f066ca45c5c3c5ddfbf231752d534e728..a252a9dd7784a4310171845cc05a40faffc39d09 100644 (file)
@@ -26,11 +26,6 @@ Table of Contents
 
   Acknowledgements
 
-
-Note
-
-Refer to http://www.amanda.org/docs/security.html for the current version of
-this document.
 The Amanda development team confirms the existence of the amrecover security
 hole in recent versions of Amanda. We have made a new release, Amanda 2.4.0b5,
 that fixes the amrecover problem and other potential security holes, and is the
@@ -72,6 +67,11 @@ The Amanda Team would also like to thank the many other people who have
 contributed suggestions, patches, and new subsystems for Amanda. We're grateful
 for any contribution that helps us achieve and sustain critical mass for
 improving Amanda.
+
+Note
+
+Refer to http://www.amanda.org/docs/security.html for the current version of
+this document.
 -------------------------------------------------------------------------------
 
 Prev                        Up                         Next
index fcea728856dd7f1ece4dc5a2832437d6ef6aef18..a7b46682c9e2fa3f8a1e6e6e17802c0935661079 100644 (file)
@@ -19,11 +19,6 @@ XML-conversion
 AMANDA Core Team
 <sgw@amanda.org>
 
-Note
-
-Refer to http://www.amanda.org/docs/strategy-api.html for the current version
-of this document.
-
   Subject: STRATEGY API (was: Re: spelunking)
   From: Alexandre Oliva <oliva@dcc.unicamp.br>
   Date: 03 Oct 1998 02:44:47 -300
@@ -58,6 +53,11 @@ of this document.
   --
   Alexandre Oliva
 
+
+Note
+
+Refer to http://www.amanda.org/docs/strategy-api.html for the current version
+of this document.
 -------------------------------------------------------------------------------
 
 Prev                                          Up                         Next
index 9ab55ca8dea4319eb315f0921d0fddda00675a50..c70aa5cadc9ae436da512b428e4b7e882d1cddca 100644 (file)
@@ -58,11 +58,6 @@ Table of Contents
 
   Mac_OS_X
 
-
-Note
-
-Refer to http://www.amanda.org/docs/systemnotes.html for the current version of
-this document.
 Please read the notes that correspond to the architectures you are installing
 for. If you find additional gotchas, or anything incorrect in these notes,
 please send your updates to mailto://amanda-hackers@amanda.org after checking
@@ -172,7 +167,7 @@ GNU-tar 1.11.8, distributed with some Linux versions, will cause index failures
 (Index returned -1). Upgrading to GNU-tar 1.12 fixes this problem. This is not
 a Linux-specific problem, but it is quite common in this platform.
 Amanda now supports the ftape driver version 3.04d. It adjusts the blocksize
-automatically to 32k and supports QIC volume tables. More details con be found
+automatically to 32k and supports QIC volume tables. More details can be found
 in the file ZFTAPE in this directory.
 Some releases of dump for Linux, such as the one distributed with Debian 2.0,
 have modified dump so that it stores dumpdates in /var/lib. If this is your
@@ -321,6 +316,11 @@ For notes on how to setup Amanda under Apple's OS X, please refer to http://
 web.brandeis.edu/pages/view/Bio/AmandaMacOSXCompileNotes, written by Steven
 Karel<karel@brandeis.edu>. Thanks to Jose L.Hales-Garcia <jose@stat.ucla.edu>
 for the tip.
+
+Note
+
+Refer to http://www.amanda.org/docs/systemnotes.html for the current version of
+this document.
 -------------------------------------------------------------------------------
 
 Prev                   Up                                   Next
index 266a14766f308169bb2d307682c39348cfd40082..178046242f30290c2b8a89774f5f26f3946974d1 100644 (file)
@@ -67,11 +67,6 @@ Table of Contents
 
 
 
-Note
-
-Refer to http://www.amanda.org/docs/tapechangers.html for the current version
-of this document.
-
  Introduction
 
 This document outlines the tape changer support design of Amanda 2.2 and
@@ -669,6 +664,11 @@ chg-null
 
 A trivial changer which loads/unloads on a null: device. Useful with chg-rait
 to throw away a parity stripe by puttin on a null jukebox, or for testing.
+
+Note
+
+Refer to http://www.amanda.org/docs/tapechangers.html for the current version
+of this document.
 -------------------------------------------------------------------------------
 
 Prev                   Up                  Next
index f1e98c0c961a14682c90cb61c5abc48228c2e7d0..ab4c482ac3a45e20258ee12e1d17702829f77368 100644 (file)
@@ -6,11 +6,6 @@ Prev  Part II. About Tapes and Changers  Next
 
 Chapter 7. Tapetypes
 
-
-Note
-
-Refer to http://www.amanda.org/docs/tapetypes.html for the current version of
-this document.
 You may find tapetype-definitions in the example amanda.conf, in the
 mailinglist-archives of the amanda-users-mailinglist at http://
 marc.theaimsgroup.com/?l=amanda-users or in the Amanda-FAQ-O-Matic at http://
@@ -44,6 +39,11 @@ It does NOT warn you if the tape contains a label or data. amtapetype will
 OVERWRITE the tape so be cautious. You have been warned.
 Snapshot 20040915 introduces a warning and the flag -o to overwrite a labelled
 tape.
+
+Note
+
+Refer to http://www.amanda.org/docs/tapetypes.html for the current version of
+this document.
 -------------------------------------------------------------------------------
 
 Prev                                Up                                     Next
index 7cf1e0a17b3315520adb31f697f40097f1c17e22..86714944452a34fc706c1e5f6c8111e5f66bd59d 100644 (file)
@@ -42,11 +42,6 @@ Table of Contents
   ...
 
 
-Note
-
-Refer to http://www.amanda.org/docs/topten.html for the current version of this
-document.
-
  Reason for starting this list.
 
 Jon LaBadie once wrote to me:
@@ -424,6 +419,11 @@ The third word in the message. Some dumps MAY have been left.
 
 Please feel free to suggest additions and corrections. Write to the amanda-
 users-mailinglist at mailto://amanda-users@amanda.org.
+
+Note
+
+Refer to http://www.amanda.org/docs/topten.html for the current version of this
+document.
 -------------------------------------------------------------------------------
 
 Prev                     Up                          Next
index faa9c4582b207938e88833c6b4546d075702ee38..5fee16c7a4697dd58f4e1c9566d320ba3b0062fb 100644 (file)
@@ -12,11 +12,6 @@ Stefan G. Weichinger
 XML-conversion
 AMANDA Core Team
 <sgw@amanda.org>
-
-Note
-
-Refer to http://www.amanda.org/docs/upgrade.html for the current version of
-this document.
 Amanda 2.4.0 has introduced a major incompatibility in the Amanda protocol.
 This means that pre-2.4.0 clients won't interoperate with a 2.4.0 server, nor
 will 2.4.0 clients interoperate with pre-2.4.0 servers. You have to upgrade
@@ -60,6 +55,11 @@ convention matches the one used for the text formatted database.
 A script is available to convert the flat directory structure to the new
 layout:
 http://www.amanda.org/2.4-conv/msg00428.html
+
+Note
+
+Refer to http://www.amanda.org/docs/upgrade.html for the current version of
+this document.
 -------------------------------------------------------------------------------
 
 Prev                                   Up                            Next
index 874eea381b26cd387b5e1393dcd07d7356562d3b..05f7b7c1cbdbefe39e9cd5ba6f9e555a5d2b3c56 100644 (file)
@@ -106,11 +106,6 @@ Table of Contents
 
 
 
-Note
-
-Refer to http://www.amanda.org/docs/using.html for the current version of this
-document.
-
 An Introduction
 
 
@@ -1982,6 +1977,11 @@ To restore, position the tape at start of file and run:
 
 As with any backup system, test these procedures while in normal production so
 the principles and techniques are familiar when disaster strikes.
+
+Note
+
+Refer to http://www.amanda.org/docs/using.html for the current version of this
+document.
 -------------------------------------------------------------------------------
 
 Prev                           Up                     Next
index b23ed3ed16624114bbb40b9d64c20c8909db384b..cef7c2961b1174366a2716950a3f00a745a5aa1d 100644 (file)
@@ -12,11 +12,6 @@ Stefan G. Weichinger
 XML-conversion
 AMANDA Core Team
 <sgw@amanda.org>
-
-Note
-
-Refer to http://www.amanda.org/docs/vtape-api.html for the current version of
-this document.
 The upper level Amanda code (including some of the other tape_xxx routines)
 calls the following routines which implement a virtual tape table:
 
@@ -58,6 +53,11 @@ into the table "vtable" in tape-src/tapeio.c:
 Along with a prefix string which will identify the type. The initial vtape
 layer has two types "plain" and "rait" (Redundant Array of Inexpensive Tapes)
 but we hope to add a "rmt" (remote tape client), and possibly "dvd" types soon.
+
+Note
+
+Refer to http://www.amanda.org/docs/vtape-api.html for the current version of
+this document.
 -------------------------------------------------------------------------------
 
 Prev                              Up                                     Next
index 49c018adc4a80e209fdd721b2a60dc962a5f811b..e3c4f7106c083d08c02446b21d3072fc39e5d0fc 100644 (file)
@@ -77,11 +77,6 @@ Table of Contents
 
 
 
-Note
-
-Refer to http://www.amanda.org/docs/whatwasnew.html for the current version of
-this document.
-
  What's new in Amanda 2.3
 
 This document contains notes on new features in Amanda 2.3 that may not yet be
@@ -461,6 +456,11 @@ Note
 This percentage applies from run to run, so, as in the previous example, when
 Amanda runs the next day, if there is 3.8GB left on the holding disk, 1.9GB
 will be reserved for degraded mode dumps (e.g. the percentage keeps sliding).
+
+Note
+
+Refer to http://www.amanda.org/docs/whatwasnew.html for the current version of
+this document.
 -------------------------------------------------------------------------------
 
 Prev                         Up                                          Next
index 3905640d944ab000992435fd508a65eaabbaf24e..924fece1c747e61efb4f4cc08d9d7feaf1758b6c 100644 (file)
@@ -23,11 +23,6 @@ Stefan G. Weichinger
 XML-conversion; Additions and Updates
 AMANDA Core Team
 <sgw@amanda.org>
-
-Note
-
-Refer to http://www.amanda.org/docs/wishlist.html for the current version of
-this document.
 This is a major update.
 These are items that we are planning to address, OR which we would like to see
 happen sometime in the future.
@@ -248,6 +243,11 @@ Oct. 2004.
   The docs would benefit from adding some illustrations.
 
 The WISHLIST should get shortened.
+
+Note
+
+Refer to http://www.amanda.org/docs/wishlist.html for the current version of
+this document.
 -------------------------------------------------------------------------------
 
 Prev                                          Up                           Next
index 59ff851e798352c96bb8f5cf76825273aacea977..65a8e1b1c7333d4fb814922adab0caa75ac3eab8 100644 (file)
@@ -17,15 +17,15 @@ Stefan G. Weichinger
 XML-conversion
 AMANDA Core Team
 <sgw@amanda.org>
+The Amanda developers believe Amanda is Y2K-compliant, as long as the
+underlying operating system and C library are. The only date manipulations
+performed by Amanda use C-language time manipulation functions and/or strings
+where years are represented with the century-included notation.
 
 Note
 
 Refer to http://www.amanda.org/docs/y2k.html for the current version of this
 document.
-The Amanda developers believe Amanda is Y2K-compliant, as long as the
-underlying operating system and C library are. The only date manipulations
-performed by Amanda use C-language time manipulation functions and/or strings
-where years are represented with the century-included notation.
 -------------------------------------------------------------------------------
 
 Prev                                   Up                               Next
index f00725128260874eb992ba40d68c056818e80c0f..7d84ce665dc9aa83fec97c47b61545ab18414e98 100644 (file)
@@ -16,11 +16,6 @@ Stefan G. Weichinger
 XML-conversion,Updates
 AMANDA Core Team
 <sgw@amanda.org>
-
-Note
-
-Refer to http://www.amanda.org/docs/zftape.html for the current version of this
-document.
 Amanda now supports the ftape driver version 3.04d (see http://www-
 math.math.rwth-aachen.de/~LBFM/claus/ftape ). It adjusts the blocksize
 automatically to 32k and supports QIC volume tables.
@@ -102,6 +97,11 @@ Filemarks are not written to the tape (they are written to the header segment
 and use there 128 byte), so their size could even be 0. But a tape segment
 takes at least 29 kb (+3 kb ecc-code = 32 kb), so in the worst case an eof will
 waste 29 kb.
+
+Note
+
+Refer to http://www.amanda.org/docs/zftape.html for the current version of this
+document.
 -------------------------------------------------------------------------------
 
 Prev                         Up                   Next
index 0b4b739f93624bd65a460ccad99668bc7eb810f6..442c87609264261ddbfe93af88d75f7b885d8f50 100644 (file)
@@ -3,7 +3,7 @@
 INCLUDES =     -I$(top_builddir)/common-src \
                -I$(top_srcdir)/common-src
 
-dumper_SCRIPTS =       gnutar generic-dumper
+dumper_SCRIPTS =       amgtar generic-dumper
 dumperdir =            @DUMPER_DIR@
 
 SUFFIXES =             .sh .pl
@@ -11,7 +11,7 @@ SUFFIXES =            .sh .pl
 .pl:
                        cat $< > $@
                        chmod a+x $@
-                       -test -z "$(PERL)" || $(PERL) -c $@
+                       -test -z "$(PERL)" || $(PERL) -c -w -W -T $@ || rm $@
 
 .sh:
                        cat $< > $@
index ec8872630fed3170610c58d3970a3dbd481e4113..3b657070effd10bffaabc4adc2675f710eb1d249 100644 (file)
@@ -41,23 +41,60 @@ host_triplet = @host@
 target_triplet = @target@
 subdir = dumper-src
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
-       $(srcdir)/generic-dumper.pl.in $(srcdir)/gnutar.pl.in
+       $(srcdir)/amgtar.pl.in $(srcdir)/generic-dumper.pl.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+       $(top_srcdir)/config/gnulib/absolute-header.m4 \
+       $(top_srcdir)/config/gnulib/alloca.m4 \
+       $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/eoverflow.m4 \
+       $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/getaddrinfo.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-cache.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-common.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-comp.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-tool.m4 \
+       $(top_srcdir)/config/gnulib/inet_ntop.m4 \
+       $(top_srcdir)/config/gnulib/intmax_t.m4 \
+       $(top_srcdir)/config/gnulib/inttypes_h.m4 \
+       $(top_srcdir)/config/gnulib/lib-ld.m4 \
+       $(top_srcdir)/config/gnulib/lib-link.m4 \
+       $(top_srcdir)/config/gnulib/lib-prefix.m4 \
+       $(top_srcdir)/config/gnulib/lock.m4 \
+       $(top_srcdir)/config/gnulib/longdouble.m4 \
+       $(top_srcdir)/config/gnulib/longlong.m4 \
+       $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
+       $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \
+       $(top_srcdir)/config/gnulib/size_max.m4 \
+       $(top_srcdir)/config/gnulib/snprintf.m4 \
+       $(top_srcdir)/config/gnulib/socklen.m4 \
+       $(top_srcdir)/config/gnulib/sockpfaf.m4 \
+       $(top_srcdir)/config/gnulib/stdbool.m4 \
+       $(top_srcdir)/config/gnulib/stdint_h.m4 \
+       $(top_srcdir)/config/gnulib/strdup.m4 \
+       $(top_srcdir)/config/gnulib/string_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
+       $(top_srcdir)/config/gnulib/vasnprintf.m4 \
+       $(top_srcdir)/config/gnulib/visibility.m4 \
+       $(top_srcdir)/config/gnulib/wchar_t.m4 \
+       $(top_srcdir)/config/gnulib/wint_t.m4 \
+       $(top_srcdir)/config/gnulib/xsize.m4 \
        $(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config/config.h
-CONFIG_CLEAN_FILES = gnutar.pl generic-dumper.pl
+CONFIG_CLEAN_FILES = amgtar.pl generic-dumper.pl
 am__installdirs = "$(DESTDIR)$(dumperdir)"
 dumperSCRIPT_INSTALL = $(INSTALL_SCRIPT)
 SCRIPTS = $(dumper_SCRIPTS)
 SOURCES =
 DIST_SOURCES =
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ABSOLUTE_STRING_H = @ABSOLUTE_STRING_H@
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
+ALLOCA_H = @ALLOCA_H@
 AMANDA_DBGDIR = @AMANDA_DBGDIR@
 AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@
 AMANDA_TMPDIR = @AMANDA_TMPDIR@
@@ -72,18 +109,17 @@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@
 AMTAR = @AMTAR@
 AM_CFLAGS = @AM_CFLAGS@
 AR = @AR@
+ARPA_INET_H = @ARPA_INET_H@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
-AWK_VAR_ASSIGNMENT_OPT = @AWK_VAR_ASSIGNMENT_OPT@
 BINARY_OWNER = @BINARY_OWNER@
-BUILD_MAN_PAGES_FALSE = @BUILD_MAN_PAGES_FALSE@
-BUILD_MAN_PAGES_TRUE = @BUILD_MAN_PAGES_TRUE@
 CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
+CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
 CHIO = @CHIO@
 CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
@@ -116,18 +152,40 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
+ENABLE_MANPAGE_BUILD_FALSE = @ENABLE_MANPAGE_BUILD_FALSE@
+ENABLE_MANPAGE_BUILD_TRUE = @ENABLE_MANPAGE_BUILD_TRUE@
+EOVERFLOW = @EOVERFLOW@
+EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@
 EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
+GCC_COMPILER_FALSE = @GCC_COMPILER_FALSE@
+GCC_COMPILER_TRUE = @GCC_COMPILER_TRUE@
 GETCONF = @GETCONF@
+GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@
+GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
 GNUTAR_LISTED_INCREMENTAL_DIRX = @GNUTAR_LISTED_INCREMENTAL_DIRX@
 GREP = @GREP@
 GZIP = @GZIP@
-HAVE_XSLTPROC_FALSE = @HAVE_XSLTPROC_FALSE@
-HAVE_XSLTPROC_TRUE = @HAVE_XSLTPROC_TRUE@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRNDUP = @HAVE_STRNDUP@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE__BOOL = @HAVE__BOOL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -136,22 +194,31 @@ LDFLAGS = @LDFLAGS@
 LEX = @LEX@
 LEXLIB = @LEXLIB@
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
+LIBPTH = @LIBPTH@
+LIBPTH_PREFIX = @LIBPTH_PREFIX@
 LIBS = @LIBS@
+LIBTHREAD = @LIBTHREAD@
 LIBTOOL = @LIBTOOL@
 LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LL_FMT = @LL_FMT@
 LL_RFMT = @LL_RFMT@
 LN_S = @LN_S@
 LTALLOCA = @LTALLOCA@
+LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
 LTLIBOBJS = @LTLIBOBJS@
+LTLIBPTH = @LTLIBPTH@
+LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
 MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@
 MCUTIL = @MCUTIL@
+MKDIR_P = @MKDIR_P@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
+NETINET_IN_H = @NETINET_IN_H@
 OBJEXT = @OBJEXT@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -165,6 +232,9 @@ PERL = @PERL@
 PRINT = @PRINT@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
+REPLACE_STRCASECMP = @REPLACE_STRCASECMP@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRSTR = @REPLACE_STRSTR@
 RESTORE = @RESTORE@
 SAMBA_CLIENT = @SAMBA_CLIENT@
 SERVICE_SUFFIX = @SERVICE_SUFFIX@
@@ -173,7 +243,10 @@ SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 SNAPSHOT_STAMP = @SNAPSHOT_STAMP@
 SORT = @SORT@
+SSH = @SSH@
+STDBOOL_H = @STDBOOL_H@
 STRIP = @STRIP@
+SYS_SOCKET_H = @SYS_SOCKET_H@
 USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@
 VDUMP = @VDUMP@
 VERSION = @VERSION@
@@ -212,6 +285,7 @@ WANT_TAPE_TRUE = @WANT_TAPE_TRUE@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
 XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
 YACC = @YACC@
 ac_c = @ac_c@
 ac_ct_AR = @ac_ct_AR@
@@ -238,6 +312,8 @@ build_os = @build_os@
 build_vendor = @build_vendor@
 datadir = @datadir@
 exec_prefix = @exec_prefix@
+gl_LIBOBJS = @gl_LIBOBJS@
+gl_LTLIBOBJS = @gl_LTLIBOBJS@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -265,7 +341,7 @@ target_vendor = @target_vendor@
 INCLUDES = -I$(top_builddir)/common-src \
                -I$(top_srcdir)/common-src
 
-dumper_SCRIPTS = gnutar generic-dumper
+dumper_SCRIPTS = amgtar generic-dumper
 dumperdir = @DUMPER_DIR@
 SUFFIXES = .sh .pl
 DISTCLEANFILES = $(dumper_SCRIPTS)
@@ -302,7 +378,7 @@ $(top_srcdir)/configure:  $(am__configure_deps)
        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-gnutar.pl: $(top_builddir)/config.status $(srcdir)/gnutar.pl.in
+amgtar.pl: $(top_builddir)/config.status $(srcdir)/amgtar.pl.in
        cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
 generic-dumper.pl: $(top_builddir)/config.status $(srcdir)/generic-dumper.pl.in
        cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
@@ -464,7 +540,7 @@ uninstall-am: uninstall-dumperSCRIPTS uninstall-info-am
 .pl:
                        cat $< > $@
                        chmod a+x $@
-                       -test -z "$(PERL)" || $(PERL) -c $@
+                       -test -z "$(PERL)" || $(PERL) -c -w -W -T $@ || rm $@
 
 .sh:
                        cat $< > $@
diff --git a/dumper-src/amgtar.pl.in b/dumper-src/amgtar.pl.in
new file mode 100644 (file)
index 0000000..d315e14
--- /dev/null
@@ -0,0 +1,326 @@
+#!@PERL@ -T
+#
+
+# Run perl.
+eval '(exit $?0)' && eval 'exec @PERL@ -S $0 ${1+"$@"}'
+       & eval 'exec @PERL@ -S $0 $argv:q'
+               if 0;
+
+delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV', 'PATH'};
+$ENV{'PATH'} = "/usr/bin:/usr/sbin:/sbin:/bin";
+
+$debug=1;
+push(@INC, ".", "@DUMPER_DIR@");
+
+use File::Copy;
+use IPC::Open3;
+use Sys::Hostname;
+
+
+open(DEBUG,">>@AMANDA_DBGDIR@/amgtar.$$.debug") if ($debug==1);
+
+$prefix='@prefix@';
+$prefix = $prefix;
+$exec_prefix="@exec_prefix@";
+$exec_prefix=$exec_prefix;
+$libexecdir="@libexecdir@";
+$libexecdir=$libexecdir;
+
+$USE_VERSION_SUFFIXES='@USE_VERSION_SUFFIXES@';
+$suf = '';
+if ( $USE_VERSION_SUFFIXES =~ /^yes$/i ) {
+   $suf='-@VERSION@';
+}
+
+$myhost = hostname;
+$myhost =~ s/\..*$//;
+$runtar="${libexecdir}/runtar${suf}";
+$gnulist = '@GNUTAR_LISTED_INCREMENTAL_DIR@';
+$gnutar = '@GNUTAR@';
+
+
+
+$max_level    = 9;
+$index_line   = 1;
+$index_xml    = 0;
+$message_line = 1;
+$message_xml  = 0;
+$record       = 1;
+$include_file = 1;
+$include_list = 1;
+$exclude_file = 1;
+$exclude_list = 1;
+$collection   = 0;
+
+#$user_support  = "";
+#$group_support = "";
+
+#$user_selfcheck  = "";
+#$group_selfcheck = "";
+
+#$user_estimate  = "";
+#$group_estimate = "";
+
+#$user_estimate_parse  = "";
+#$group_estimate_parse = "";
+
+$user_backup  = "root";
+#$group_backup = "";
+
+#$user_backup_parse  = "";
+#$group_backup_parse = "";
+
+#$user_index_from_output  = "";
+#$group_index_from_output = "";
+
+#$user_index_from_image  = "";
+#$group_index_from_image = "";
+
+#$user_restore  = "";
+#$group_restore = "";
+
+#$user_print_command  = "";
+#$group_print_command = "";
+
+$user_default  = "amanda";
+$group_default = "amanda";
+
+
+sub command_support {
+   my($config, $host, $disk, $device, $level) = @_;
+   print "CONFIG YES\n";
+   print DEBUG "STDOUT: CONFIG YES\n" if ($debug == 1);
+   print "HOST YES\n";
+   print DEBUG "STDOUT: HOST YES\n" if ($debug == 1);
+   print "DISK YES\n";
+   print DEBUG "STDOUT: DISK YES\n" if ($debug == 1);
+   print "MAX-LEVEL 9\n";
+   print DEBUG "STDOUT: MAX-LEVEL 9\n" if ($debug == 1);
+   print "INDEX-LINE YES\n";
+   print DEBUG "STDOUT: INDEX-LINE YES\n" if ($debug == 1);
+   print "INDEX-XML NO\n";
+   print DEBUG "STDOUT: INDEX-XML NO\n" if ($debug == 1);
+   print "MESSAGE-LINE YES\n";
+   print DEBUG "STDOUT: MESSAGE-LINE YES\n" if ($debug == 1);
+   print "MESSAGE-XML NO\n";
+   print DEBUG "STDOUT: MESSAGE-XML NO\n" if ($debug == 1);
+   print "RECORD YES\n";
+   print DEBUG "STDOUT: RECORD YES\n" if ($debug == 1);
+   print "INCLUDE-FILE YES\n";
+   print "INCLUDE-LIST YES\n";
+   print "EXCLUDE-FILE YES\n";
+   print "EXCLUDE-LIST YES\n";
+   print "COLLECTION NO\n";
+}
+
+sub command_selfcheck {
+   my($config, $host, $disk, $device, $level) = @_;
+   print DEBUG "STDOUT: OK $disk\n" if ($debug == 1);
+   print DEBUG "STDOUT: OK $device\n" if ($debug == 1);
+   print "OK $disk\n";
+   print "OK $device\n";
+   #check binary
+   #check statefile
+   #check amdevice
+   #check property include/exclude
+}
+
+sub command_estimate {
+   my($config, $host, $disk, $device, $level) = @_;
+   my($listdir) = "$host$disk";
+   $listdir     =~ s/\//_/g;
+   if($level == 0) {
+      open(GNULIST, ">${gnulist}/${listdir}_${level}.new") || die();
+      close(GNULIST) || die();
+   }
+   else {
+      my($prev_level) = $level - 1;
+      if (-f "${gnulist}/${listdir}_${prev_level}") {
+        copy("${gnulist}/${listdir}_${prev_level}", "${gnulist}/${listdir}_${level}.new");
+      } else {
+        open(GNULIST, ">${gnulist}/${listdir}_${level}.new") || die();
+        close(GNULIST) || die();
+       #print "ERROR file ${gnulist}/${listdir}_${level}.new doesn't exist\n";
+      }
+   }
+   command_estimate_opt_direct($config, $host, $disk, $device, $level, $listdir);
+}
+
+
+sub command_estimate_opt_direct {
+   my($config, $host, $disk, $device, $level, $listdir) = @_;
+   my($size) = -1;
+   my(@cmd) = ($runtar, $config, $gnutar, "--create", "--directory", $device, "--listed-incremental", "${gnulist}/${listdir}_${level}.new", "--sparse", "--one-file-system", "--ignore-failed-read", "--totals", "--file", "/dev/null", ".");
+   #my(@cmd) = ($gnutar, "--create", "--directory", $device, "--listed-incremental", "${gnulist}/${listdir}_${level}.new", "--sparse", "--one-file-system", "--ignore-failed-read", "--totals", "--file", "/dev/null", ".");
+   print DEBUG "cmd:" , join(" ", @cmd), "\n" if ($debug == 1);
+   open3(\*WTRFH, '>&STDOUT', \*ESTIMATE, @cmd);
+
+   $size = parse_estimate(ESTIMATE);
+   close(ESTIMATE);
+   output_size($size);
+   unlink "${gnulist}/${listdir}_${level}.new";
+   exit 0;
+}
+
+sub parse_estimate {
+   my($fh) = @_;
+   my($size) = -1;
+   while(<$fh>) {
+print DEBUG "READ 2: $_" if ($debug == 1);
+      if ($_ =~ /^Total bytes written: (\d*)/) {
+         $size = $1;
+         last;
+      }
+   }
+   return $size;
+}
+
+sub output_size {
+   my($size) = @_;
+   if($size == -1) {
+      print DEBUG "STDOUT A: -1 -1\n" if ($debug == 1);
+      print "-1 -1\n";
+      exit 2;
+   }
+   else {
+      my($ksize) = int $size / (1024);
+      $ksize=32 if ($ksize<32);
+      print DEBUG "STDOUT B: $ksize 1\n" if ($debug == 1);
+      print "$ksize 1\n";
+   }
+}
+
+sub command_backup {
+   my($config, $host, $disk, $device, $level) = @_;
+   my($listdir) = "$host$disk";
+   my($verbose) = "";
+   $listdir     =~ s/\//_/g;
+
+print DEBUG "config =" . $config . "\n" if ($debug == 1);
+print DEBUG "host   =" . $host   . "\n" if ($debug == 1);
+print DEBUG "disk   =" . $disk   . "\n" if ($debug == 1);
+print DEBUG "device =" . $device . "\n" if ($debug == 1);
+print DEBUG "level  =" . $level  . "\n" if ($debug == 1);
+
+   if($level == 0) {
+      open(GNULIST, ">${gnulist}/${listdir}_${level}.new") || die();
+      close(GNULIST) || die();
+   }
+   else {
+      my($prev_level) = $level - 1;
+      copy("${gnulist}/${listdir}_${prev_level}", 
+           "${gnulist}/${listdir}_${level}.new");
+   }
+
+   if(defined($opt_index)) {
+      $verbose = "--verbose";
+   }
+   my(@cmd) = ($runtar, $config, $gnutar, "--create", $verbose, "--directory", $device, "--listed-incremental", "${gnulist}/${listdir}_${level}.new", "--sparse", "--one-file-system", "--ignore-failed-read", "--totals", "--file", "-", ".");
+   #my(@cmd) = ($gnutar, "--create", $verbose, "--directory", $device, "--listed-incremental", "${gnulist}/${listdir}_${level}.new", "--sparse", "--one-file-system", "--ignore-failed-read", "--totals", "--file", "-", ".");
+
+   print DEBUG "cmd:" , join(" ", @cmd), "\n" if ($debug == 1);
+
+   open3(\*WTRFH, '>&STDOUT', \*INDEX, @cmd) || die();
+
+   if(defined($opt_index)) {
+      open(INDEXOUT, '>&=3') || die();
+      parse_backup(INDEX, STDERR, INDEXOUT);
+      close(INDEXOUT);
+   }
+   else {
+      parse_backup(INDEX, STDERR, undef);
+   }
+   close(INDEX);
+   close(WTRFH);
+
+   if(defined($opt_record)) {
+      rename "${gnulist}/${listdir}_${level}.new", 
+             "${gnulist}/${listdir}_${level}";
+   }
+   else {
+      unlink "${gnulist}/${listdir}_${level}.new";
+   }
+   exit 0;
+}
+
+sub parse_backup {
+   my($fhin, $fhout, $indexout) = @_;
+   my($size) = -1;
+   while(<$fhin>) {
+print DEBUG "READ 3: $_" if ($debug == 1);
+      if ( /^\.\//) {
+         if(defined($indexout)) {
+           if(defined($opt_index)) {
+               s/^\.//;
+print DEBUG "INDEXOUT: $_" if ($debug == 1);
+               print $indexout $_;
+           }
+         }
+      }
+      else {
+            if (/^Total bytes written: (\d*)/) {
+               $size = $1;
+              $ksize = int ($size / 1024);
+            }
+            elsif(defined($fhout)) {
+               next if /: Directory is new$/;
+print DEBUG "FHOUT 2: $_" if ($debug == 1);
+               print $fhout $_;
+            }
+      }
+   }
+   if(defined($fhout)) {
+      if ($size == -1) {
+print DEBUG "FHOUT 4: $command -1 -1\n" if ($debug == 1);
+         print $fhout "$command -1 -1\n";
+      }
+      else {
+         my($ksize) = int ($size/1024);
+print DEBUG "FHOUT 5: sendbackup: size $ksize\n" if ($debug == 1);
+         print $fhout "sendbackup: size $ksize\n";
+print DEBUG "FHOUT 5: sendbackup: end\n" if ($debug == 1);
+              print $fhout "sendbackup: end\n";
+      }
+   }
+}
+
+sub command_index_from_output {
+   index_from_output(STDIN, STDOUT);
+   exit 0;
+}
+
+sub index_from_output {
+   my($fhin, $fhout) = @_;
+   my($size) = -1;
+   while(<$fhin>) {
+print DEBUG "READ 4: $_" if ($debug == 1);
+      next if /^Total bytes written:/;
+      next if !/^\.\//;
+      s/^\.//;
+print DEBUG "FHOUT 6: $_" if ($debug == 1);
+      print $fhout $_;
+   }
+}
+
+sub command_index_from_image {
+   my($config, $host, $disk, $device, $level) = @_;
+   open(INDEX, "$gnutar --list --file - |") || die();
+   index_from_output(INDEX, STDOUT);
+}
+
+sub command_restore {
+   my($config, $host, $disk, $device, $level) = @_;
+
+#   $ARGV[0] = undef;   
+   my(@cmd) = ($gnutar, "--numeric-owner", "-xpGvf", "-");
+   for($i=1;defined $ARGV[$i]; $i++) {
+      push @cmd, $ARGV[$i];
+   }
+   print DEBUG "cmd:" , join(" ", @cmd), "\n" if ($debug == 1);
+   exec @cmd;
+}
+
+sub command_print_command {
+}
+
+require "generic-dumper"
index ceb2235f23dc603a7ea25317b9ae1b11d198c384..f1fc6d3eeb583f86a3bd10811061460dafb48f23 100644 (file)
@@ -1,10 +1,89 @@
+require "newgetopt.pl";
+use Text::ParseWords;
 
+print DEBUG "FHOUT 6: ARGV[0]=" . $ARGV[0] . "\n" if ($debug == 1);
+print DEBUG "FHOUT 6: ARGV[1]=" . $ARGV[1] . "\n" if ($debug == 1);
+print DEBUG "FHOUT 6: ARGV[2]=" . $ARGV[2] . "\n" if ($debug == 1);
+print DEBUG "FHOUT 6: ARGV[3]=" . $ARGV[3] . "\n" if ($debug == 1);
+print DEBUG "FHOUT 6: ARGV[4]=" . $ARGV[4] . "\n" if ($debug == 1);
+print DEBUG "FHOUT 6: ARGV[5]=" . $ARGV[5] . "\n" if ($debug == 1);
+print DEBUG "FHOUT 6: ARGV[6]=" . $ARGV[6] . "\n" if ($debug == 1);
+print DEBUG "FHOUT 6: ARGV[7]=" . $ARGV[7] . "\n" if ($debug == 1);
+print DEBUG "FHOUT 6: ARGV[8]=" . $ARGV[8] . "\n" if ($debug == 1);
+print DEBUG "FHOUT 6: ARGV[9]=" . $ARGV[9] . "\n" if ($debug == 1);
+
+$result = &NGetOpt ("config=s", "host=s", "disk=s", "device=s", "level=s", "index=s", "message=s", "collection", "record");
+$result = $result;
+
+print DEBUG "FHOUT 6: config    =" . $opt_config . "\n" if ($debug == 1);
+print DEBUG "FHOUT 6: disk      =" . $opt_disk   . "\n" if ($debug == 1);
+print DEBUG "FHOUT 6: host      =" . $opt_host   . "\n" if ($debug == 1);
+print DEBUG "FHOUT 6: device    =" . $opt_device . "\n" if ($debug == 1);
+print DEBUG "FHOUT 6: level     =" . $opt_level  . "\n" if ($debug == 1);
+print DEBUG "FHOUT 6: index     =" . $opt_index  . "\n" if ($debug == 1);
+print DEBUG "FHOUT 6: message   =" . $opt_message. "\n" if ($debug == 1);
+print DEBUG "FHOUT 6: collection=" . $opt_collection. "\n" if ($debug == 1);
+print DEBUG "FHOUT 6: record    =" . $opt_record . "\n" if ($debug == 1);
+
+print DEBUG "FHOUT 6: A-ARGV[0]=" . $ARGV[0] . "\n" if ($debug == 1);
+print DEBUG "FHOUT 6: A-ARGV[1]=" . $ARGV[1] . "\n" if ($debug == 1);
+print DEBUG "FHOUT 6: A-ARGV[2]=" . $ARGV[2] . "\n" if ($debug == 1);
+print DEBUG "FHOUT 6: A-ARGV[3]=" . $ARGV[3] . "\n" if ($debug == 1);
+print DEBUG "FHOUT 6: A-ARGV[4]=" . $ARGV[4] . "\n" if ($debug == 1);
+print DEBUG "FHOUT 6: A-ARGV[5]=" . $ARGV[5] . "\n" if ($debug == 1);
+print DEBUG "FHOUT 6: A-ARGV[6]=" . $ARGV[6] . "\n" if ($debug == 1);
+
+if (defined $opt_config) {
+  $opt_config =~ /^([\_\.A-Za-z0-9]*)$/;
+  $opt_config = $1;
+}
+
+if (defined $opt_host) {
+  $opt_host =~ /^([\_\.A-Za-z0-9]*)$/;
+  $opt_host = $1;
+}
+
+if (defined $opt_disk) {
+  $opt_disk =~ /^([\/\_\:\.A-Za-z0-9]*)$/;
+  $opt_disk = $1;
+}
+
+if (defined $opt_device) {
+  $opt_device =~ /^([\/\_\:\.A-Za-z0-9]*)$/;
+  $opt_device = $1;
+}
+
+if (defined $opt_level) {
+  $opt_level =~ /^(\d)$/;
+  $opt_level = $1;
+}
+
+# Read tool property
 
 $command = $ARGV[0];
-if ($command eq "privilege") {
-   wrapper_privilege();
+
+%property = ();
+while($property_line = <STDIN>) {
+  chomp $property_line;
+  ($prop_name, $prop_value) = shellwords($property_line);
+  push @{$property{$prop_name}}, $prop_value;
+  print DEBUG "$prop_name = $prop_value\n" if ($debug == 1);
+}
+
+if ($debug == 1) {
+  foreach $prop_name (keys(%property)) {
+    print DEBUG "PROPERTY: $prop_name\n";
+    print DEBUG "    VALUE: ", join(',',@{$property{$prop_name}}) , "\n";
+  }
 }
-elsif ($command eq "support") {
+
+sub wrapper_support();
+sub wrapper_selfcheck();
+sub wrapper_estimate();
+sub wrapper_backup();
+sub wrapper_restore();
+
+if ($command eq "support") {
    wrapper_support();
 }
 elsif ($command eq "selfcheck") {
@@ -13,168 +92,40 @@ elsif ($command eq "selfcheck") {
 elsif ($command eq "estimate") {
    wrapper_estimate();
 }
-elsif ($command eq "estimate-parse") {
-   wrapper_estimate_parse();
-}
 elsif ($command eq "backup") {
    wrapper_backup();
 }
-elsif ($command eq "backup-parse") {
-   wrapper_backup_parse();
-}
-elsif ($command eq "index-from-output") {
-   wrapper_index_from_output();
-}
-elsif ($command eq "index-from-image") {
-   wrapper_index_from_image();
-}
 elsif ($command eq "restore") {
    wrapper_restore();
 }
-elsif ($command eq "print-command") {
-   wrapper_print_command();
-}
 else {
    printf STDERR "Unknown command `$command'.\n";
    exit 1;
 }
 
 
-sub wrapper_privilege() {
-   if(defined(&command_support)) {
-      command_privilege();
-      exit 0;
-   }
-   my($subcommand) = $ARGV[1];
-   if ($subcommand eq "support") {
-      wrapper_print_privilege($subcommand);
-   }
-   elsif ($subcommand eq "selfcheck") {
-      wrapper_print_privilege($subcommand);
-   }
-   elsif ($subcommand eq "estimate") {
-      wrapper_print_privilege($subcommand);
-   }
-   elsif ($subcommand eq "estimate-parse") {
-      wrapper_print_privilege($subcommand);
-   }
-   elsif ($subcommand eq "backup") {
-      wrapper_print_privilege($subcommand);
-   }
-   elsif ($subcommand eq "backup-parse") {
-      wrapper_print_privilege($subcommand);
-   }
-   elsif ($subcommand eq "index-from-output") {
-      wrapper_print_privilege($subcommand);
-   }
-   elsif ($subcommand eq "index-from-image") {
-      wrapper_print_privilege($subcommand);
-   }
-   elsif ($subcommand eq "restore") {
-      wrapper_print_privilege($subcommand);
-   }
-   elsif ($subcommand eq "print-command") {
-      wrapper_print_privilege($subcommand);
-   }
-   else {
-      printf STDERR "Unknown command `$subcommand'.\n";
-      exit 1;
-   }
-   if(defined($user_default) && defined($group_default)) {
-      print "USER $user_default\n";
-      print "GROUP $group_default\n";
-      exit 0;
-   }
-   exit 0;
-}
-
-
-sub wrapper_print_privilege {
-   my($command) = @_;
-   $command =~ s/-/_/g;
-   my($var_user) = "user_$command";
-   my($var_group) = "group_$command";
-   if(defined($$var_user) && defined($$var_group)) {
-      print "USER $$var_user\n";
-      print "GROUP $$var_group\n";
-      exit 0;
-   }
-   elsif(defined($$var_user) && !defined($$var_group)) {
-      print STDERR "\$$var_user defined but \$$var_group not defined\n";
-      exit 1;
-   }
-   elsif(!defined($$var_user) && defined($$var_group)) {
-      print STDERR "\$$var_group defined but \$$var_user not defined\n";
-      exit 1;
-   }
-}
-
 sub wrapper_support() {
    if(defined(&command_support)) {
-      command_support();
+      command_support($opt_config, $opt_host, $opt_disk, $opt_device, $opt_level);
       exit 0;
    }
-   my($subcommand) = $ARGV[1];
-   if ($subcommand eq "level-incrementals") {
-      if (defined($level_incrementals)) {
-         print "$level_incrementals\n";
-      }
-      else {
-         print "1\n";
-      }
-      exit 0;
-   }
-   elsif ($subcommand eq "index") {
-      my($index_generation);
-      foreach $index_generation (@index_generation) {
-         if( $index_generation eq "direct" ||
-             $index_generation eq "parse"  ||
-             $index_generation eq "output" ||
-             $index_generation eq "image") {
-                print "$index_generation\n";
-         }
-         else {
-            print "unknow indexing method '$index_generation'\n";
-         }
-      }
-   exit 0;
-   }
-   elsif ($subcommand eq "parse-estimate") {
-      my($parse_estimate);
-      foreach $parse_estimate (@parse_estimate) {
-         if( $parse_estimate eq "direct" ||
-             $parse_estimate eq "parse" ) {
-            print "$parse_estimate\n";
-         }
-         else {
-            print "unknow parse-estimate method '$parse_estimate'\n";
-         }
-      }
-   exit 0;
-   }
-   elsif ($subcommand eq "parse-backup") {
-      print "direct\n" if (defined($parse_backup_direct));
-      print "parse\n"  if (defined($parse_backup_parse));
-      my($parse_backup);
-      foreach $parse_backup (@parse_backup) {
-         if( $parse_backup eq "direct" ||
-             $parse_backup eq "parse" ) {
-            print "$parse_backup\n";
-         }
-         else {
-            print "unknow parse-backup method '$parse_backup'\n";
-         }
-      }
-      exit 0;
-   }
-   else {
-      exit 1;
-   }
+   print "LEVEL 0-", $max_level , "\n" if defined($max_level);
+   print "INDEX-LINE YES\n"   if defined($index_line)   && $index_line   == 1;
+   print "INDEX-XML NO\n"     if defined($index_xml)    && $index_xml    == 1;
+   print "MESSAGE-LINE YES\n" if defined($message_line) && $message_line == 1;
+   print "MESSAGE-XML NO\n"   if defined($message_xml)  && $message_xml  == 1;
+   print "RECORD YES\n"       if defined($record)       && $record       == 1;
+   print "INCLUDE-FILE NO\n"  if defined($include_file) && $include_file == 1;
+   print "INCLUDE-LIST NO\n"  if defined($include_list) && $include_list == 1;
+   print "EXCLUDE-FILE NO\n"  if defined($exclude_file) && $exclude_file == 1;
+   print "EXCLUDE-LIST NO\n"  if defined($exclude_list) && $exclude_list == 1;
+   print "COLLECTION NO\n"    if defined($collection)   && $collection   == 1;
+   exit 1;
 }
 
 sub wrapper_selfcheck() {
    if(defined(&command_selfcheck)) {
-      command_selfcheck();
+      command_selfcheck($opt_config, $opt_host, $opt_disk, $opt_device, $opt_level);
    }
    else {
       exit 1;
@@ -182,43 +133,16 @@ sub wrapper_selfcheck() {
 }
 
 sub wrapper_estimate() {
-   my($estimate_type) = $ARGV[1];
-   my($option);
-   my($estimate_type_is_ok) = 0;
-   my($backups_type);
-   foreach $backups_type (@backup_type) {
-      $estimate_type_is_ok = 1 if($estimate_type eq $backups_type);
-   }
-   if($estimate_type_is_ok == 0) {
-      print "estimate type `$estimate_type' not supported.\n";
-      exit 3;
-   }
-   $option = 3 if ($estimate_type eq "full");
-   $option = 4 if ($estimate_type eq "level");
-   $option = 4 if ($estimate_type eq "diff");
-   parse_options($option);
-   if($option_estimate_direct + $option_estimate_parse > 1) {
-      print "Can't define both `estimate-direct' and `estimate-parse'.\n";
-      exit 5;
-   }
-   elsif($option_estimate_direct + $option_estimate_parse == 0) {
-      print "You must have the option `estimate-direct' or `estimate-parse'.\n";
-      exit 5;
-   }
-   if($estimate_type eq "full") {
-      command_estimate_full($ARGV[2]);
-   }
-    elsif($estimate_type eq "level") {
-      command_estimate_level($ARGV[2], $ARGV[3]);
-   }
-   elsif($estimate_type eq "diff") {
-      command_estimate_diff($ARGV[2], $ARGV[3]);
+   if(defined(&command_estimate)) {
+      command_estimate($opt_config, $opt_host, $opt_disk, $opt_device, $opt_level);
+   } else {
+      exit 1;
    }
 }
 
 sub wrapper_estimate_parse() {
    if(defined(&command_estimate_parse)) {
-      command_estimate_parse();
+      command_estimate_parse($opt_config, $opt_host, $opt_disk, $opt_device, $opt_level);
    }
    else {
       printf STDERR "`estimate-parse' is not supported.\n";
@@ -227,43 +151,17 @@ sub wrapper_estimate_parse() {
 }
 
 sub wrapper_backup() {
-   my($backup_type) = $ARGV[1];
-   my($option);
-   my($backup_type_is_ok) = 0;
-   my($backups_type);
-   foreach $backups_type (@backup_type) {
-      $backup_type_is_ok = 1 if($backup_type eq $backups_type);
-   }
-   if($backup_type_is_ok == 0) {
-      print "backup type `$backup_type' not supported.\n";
-      exit 3;
-   }
-   $option = 3 if ($backup_type eq "full");
-   $option = 4 if ($backup_type eq "level");
-   $option = 4 if ($backup_type eq "diff");
-   parse_options($option);
-   if($option_backup_direct + $option_backup_parse > 1) {
-      print "Can't define both `backup-direct' and `backup-parse'.\n";
-      exit 5;
-   }
-   elsif($option_backup_direct + $option_backup_parse == 0) {
-      print "You must have the option `backup-direct' or `backup-parse'.\n";
-      exit 5;
-   }
-   if($backup_type eq "full") {
-      command_backup_full($ARGV[2]);
-   }
-   elsif($backup_type eq "level") {
-      command_backup_level($ARGV[2], $ARGV[3]);
-   }
-   elsif($backup_type eq "diff") {
-      command_backup_diff($ARGV[2], $ARGV[3]);
+   if(defined(&command_backup)) {
+      command_backup($opt_config, $opt_host, $opt_disk, $opt_device, $opt_level);
+   } else {
+print DEBUG "wrapper_backup: !defined(command_backup)\n" if ($debug == 1);
+      exit 1;
    }
 }
 
 sub wrapper_backup_parse() {
    if(defined(&command_backup_parse)) {
-      command_backup_parse();
+      command_backup_parse($opt_config, $opt_host, $opt_disk, $opt_device, $opt_level);
    }
    else {
       printf STDERR "`backup-parse' is not supported.\n";
@@ -273,7 +171,7 @@ sub wrapper_backup_parse() {
 
 sub wrapper_index_from_output() {
    if(defined(&command_index_from_output)) {
-      command_index_from_output();
+      command_index_from_output($opt_config, $opt_host, $opt_disk, $opt_device, $opt_level);
    }
    else {
       printf STDERR "`index-from-output' is not supported.\n";
@@ -283,7 +181,7 @@ sub wrapper_index_from_output() {
 
 sub wrapper_index_from_image() {
    if(defined(&command_index_from_image)) {
-      command_index_from_image();
+      command_index_from_image($opt_config, $opt_host, $opt_disk, $opt_device, $opt_level);
    }
    else {
       printf STDERR "command `index-from-image' is not supported.\n";
@@ -293,7 +191,7 @@ sub wrapper_index_from_image() {
 
 sub wrapper_restore() {
    if(defined(&command_restore)) {
-      command_restore();
+      command_restore($opt_config, $opt_host, $opt_disk, $opt_device, $opt_level);
    }
    else {
      printf STDERR "`restore' is not supported.\n";
@@ -301,17 +199,6 @@ sub wrapper_restore() {
    }
 }
 
-sub wrapper_print_command() {
-   if(defined(&command_print_command)) {
-      command_print_command();
-   }
-   else {
-      printf STDERR "`print-command' is not supported.\n";
-      exit 1;
-   }
-}
-
-
 sub parse_options() {
    my($no_option) = @_;
    my($options, @options, $option, $name, $option_name, $value);
diff --git a/dumper-src/gnutar.pl.in b/dumper-src/gnutar.pl.in
deleted file mode 100644 (file)
index dde9982..0000000
+++ /dev/null
@@ -1,321 +0,0 @@
-#!@PERL@
-#
-
-# Run perl.
-eval '(exit $?0)' && eval 'exec @PERL@ -S $0 ${1+"$@"}'
-       & eval 'exec @PERL@ -S $0 $argv:q'
-               if 0;
-
-delete @ENV{'IFS', 'CDPATH', 'ENV', 'BASH_ENV', 'PATH'};
-$ENV{'PATH'} = "/usr/bin:/usr/sbin:/sbin:/bin";
-
-$debug=1;
-push(@INC, "@DUMPER_DIR@");
-
-use File::Copy;
-use IPC::Open3;
-use Sys::Hostname;
-
-
-open(DEBUG,">>@AMANDA_DBGDIR@/gnutar.$$.debug") if ($debug==1);
-
-$prefix='@prefix@';
-$exec_prefix="@exec_prefix@";
-$libexecdir="@libexecdir@";
-$USE_VERSION_SUFFIXES='@USE_VERSION_SUFFIXES@';
-$suf = '';
-if ( $USE_VERSION_SUFFIXES =~ /^yes$/i ) {
-   $suf='-@VERSION@';
-}
-
-$host = hostname;
-$host =~ s/\..*$//;
-$runtar="${libexecdir}/runtar${suf}";
-$gnulist = '@GNUTAR_LISTED_INCREMENTAL_DIR@';
-$gnutar = $runtar;
-
-
-
-$level_incrementals = 9;
-
-@index_generation = ("direct","parse","output","image");
-@parse_estimate   = ("direct","parse");
-@parse_backup     = ("direct","parse");
-@backup_type      = ("full","level","diff");
-
-
-#$user_support  = "";
-#$group_support = "";
-
-#$user_selfcheck  = "";
-#$group_selfcheck = "";
-
-#$user_estimate  = "";
-#$group_estimate = "";
-
-#$user_estimate_parse  = "";
-#$group_estimate_parse = "";
-
-$user_backup  = "root";
-#$group_backup = "";
-
-#$user_backup_parse  = "";
-#$group_backup_parse = "";
-
-#$user_index_from_output  = "";
-#$group_index_from_output = "";
-
-#$user_index_from_image  = "";
-#$group_index_from_image = "";
-
-#$user_restore  = "";
-#$group_restore = "";
-
-#$user_print_command  = "";
-#$group_print_command = "";
-
-$user_default  = "amanda";
-$group_default = "amanda";
-
-
-sub command_selfcheck {
-print DEBUG "STDOUT: OK selfcheck\n" if ($debug == 1);
-   print "OK selfcheck\n";
-}
-
-sub command_estimate_full {
-   my($disk)    = @_;
-   command_estimate_level(0, $disk);
-}
-
-sub command_estimate_level {
-   my($level, $disk) = @_;
-   my($listdir) = "$host$disk";
-   $listdir     =~ s/\//_/g;
-   if($level == 0) {
-      open(GNULIST, ">${gnulist}/${listdir}_${level}.new") || die();
-      close(GNULIST) || die();
-   }
-   else {
-      my($prev_level) = $level - 1;
-      copy("${gnulist}/${listdir}_${prev_level}", "${gnulist}/${listdir}_${level}.new");
-   }
-   if($option_estimate_direct == 1) {
-      command_estimate_opt_direct($disk, $level, $listdir);
-   }
-   else {
-      command_estimate_opt_parse($disk, $level, $listdir);
-   }
-}
-
-#sub command_estimate_diff {
-#}
-
-sub command_estimate_opt_direct {
-   my($disk, $level, $listdir) = @_;
-   my($size) = -1;
-print DEBUG "$gnutar --create --directory $disk --listed-incremental ${gnulist}/${listdir}_${level}.new --sparse --one-file-system --ignore-failed-read --totals --file /dev/null .\n" if ($debug == 1);
-   open3(\*WTRFH, '>&STDOUT', \*ESTIMATE, "$gnutar --create --directory $disk --listed-incremental ${gnulist}/${listdir}_${level}.new --sparse --one-file-system --ignore-failed-read --totals --file /dev/null .") || die();
-
-   $size = parse_estimate(ESTIMATE);
-   close(ESTIMATE);
-   output_size($size);
-   unlink "${gnulist}/${listdir}_${level}.new";
-   exit 0;
-}
-
-sub command_estimate_opt_parse {
-   my($disk, $level, $listdir) = @_;
-
-   open3(\*WTRFH, '>&STDOUT',\*ESTIMATE,"$gnutar --create --directory $disk --listed-incremental ${gnulist}/${listdir}_${level}.new --sparse --one-file-system --ignore-failed-read --totals --file /dev/null .");
-
-   while (<ESTIMATE>) {
-print DEBUG "READ: $_" if ($debug == 1);
-print DEBUG "STDOUT: $_" if ($debug == 1);
-      print $_;
-   }
-   close(ESTIMATE);
-   close(WTRFH);
-
-   unlink "${gnulist}/${listdir}_${level}.new";
-}
-
-sub command_estimate_parse {
-   my($size) = parse_estimate(STDIN);
-   output_size($size);
-   exit 0;
-}
-
-sub parse_estimate {
-   my($fh) = @_;
-   my($size) = -1;
-   while(<$fh>) {
-print DEBUG "READ: $_" if ($debug == 1);
-      if ($_ =~ /^Total bytes written: (\d*)$/) {
-         $size = $1;
-         last;
-      }
-   }
-   return $size;
-}
-
-sub output_size {
-   my($size) = @_;
-   if($size == -1) {
-print DEBUG "STDOUT: -1 -1\n" if ($debug == 1);
-      print "-1 -1\n";
-      exit 2;
-   }
-   else {
-      my($ksize) = $size / 1024;
-print DEBUG "STDOUT: $ksize 1024\n" if ($debug == 1);
-      print "$ksize 1024\n";
-   }
-}
-
-sub command_backup_full {
-   my($disk)    = @_;
-   command_backup_level(0, $disk);
-}
-
-sub command_backup_level {
-   my($level, $disk) = @_;
-   my($listdir) = "$host$disk";
-   my($verbose) = "";
-   $listdir     =~ s/\//_/g;
-
-   if($level == 0) {
-      open(GNULIST, ">${gnulist}/${listdir}_${level}.new") || die();
-      close(GNULIST) || die();
-   }
-   else {
-      my($prev_level) = $level - 1;
-      copy("${gnulist}/${listdir}_${prev_level}", 
-           "${gnulist}/${listdir}_${level}.new");
-   }
-
-   if($option_index_direct == 1 || $option_index_parse == 1) {
-      $verbose = "--verbose";
-   }
-   my($cmd) = "$gnutar --create $verbose --directory $disk --listed-incremental ${gnulist}/${listdir}_${level}.new --sparse --one-file-system --ignore-failed-read --totals --file - .";
-
-   if($option_backup_parse == 1 && $option_index_direct == 0 &&
-                                   $option_index_parse  == 0) {
-      system($cmd);
-   }
-   else {
-      open3(\*WTRFH, '>&STDOUT', \*INDEX, $cmd) || die();
-
-      if($option_index_direct == 1 || $option_index_parse == 1) {
-         open(INDEXOUT, '>&=3') || die();
-         parse_backup(INDEX, STDERR, INDEXOUT);
-         close(INDEXOUT);
-      }
-      else {
-         parse_backup(INDEX, STDERR, undef);
-      }
-      close(INDEX);
-      close(WTRFH);
-   }
-
-   if(!defined($option_no_record)) {
-      rename "${gnulist}/${listdir}_${level}.new", 
-             "${gnulist}/${listdir}_${level}";
-   }
-   else {
-      unlink "${gnulist}/${listdir}_${level}.new";
-   }
-   exit 0;
-}
-
-#sub command_backup_diff {
-#}
-
-sub command_backup_parse {
-   $option_backup_direct = 1;
-   $option_backup_parse  = 0;
-   parse_backup(STDIN, STDOUT, undef);
-   exit 0;
-}
-
-sub parse_backup {
-   my($fhin, $fhout, $indexout) = @_;
-   my($size) = -1;
-   while(<$fhin>) {
-print DEBUG "READ: $_" if ($debug == 1);
-      if ( /^\.\//) {
-         if(defined($indexout)) {
-           if($option_index_direct == 1) {
-               s/^\.//;
-print DEBUG "INDEXOUT: $_" if ($debug == 1);
-               print $indexout $_;
-           }
-           elsif($option_index_parse == 1) {
-print DEBUG "INDEXOUT: $_" if ($debug == 1);
-               print $indexout $_;
-            }
-         }
-      }
-      else {
-         if (/^Total bytes written: (\d*)$/) {
-            $size = $1;
-           if(defined($fhout) && $option_backup_parse == 1) {
-print DEBUG "FHOUT: $_" if ($debug == 1);
-              print $fhout $_;
-           }
-         }
-         elsif(defined($fhout)) {
-            if($option_backup_direct == 1) {
-print DEBUG "FHOUT: $_" if ($debug == 1);
-               print $fhout $_;
-            }
-            elsif($option_backup_parse == 1) {
-print DEBUG "FHOUT: $_" if ($debug == 1);
-               print $fhout $_;
-            }
-         }
-      }
-   }
-   if(defined($fhout) && $option_backup_direct == 1) {
-      if ($size == -1) {
-print DEBUG "FHOUT: $command -1 -1\n" if ($debug == 1);
-         print $fhout "$command -1 -1\n";
-      }
-      else {
-         my($ksize) = $size/1024;
-print DEBUG "FHOUT: $ksize 1024\n" if ($debug == 1);
-         print $fhout "$ksize 1024\n";
-      }
-   }
-}
-
-sub command_index_from_output {
-   index_from_output(STDIN, STDOUT);
-   exit 0;
-}
-
-sub index_from_output {
-   my($fhin, $fhout) = @_;
-   my($size) = -1;
-   while(<$fhin>) {
-print DEBUG "READ: $_" if ($debug == 1);
-      next if /^Total bytes written:/;
-      next if !/^\.\//;
-      s/^\.//;
-print DEBUG "FHOUT: $_" if ($debug == 1);
-      print $fhout $_;
-   }
-}
-
-sub command_index_from_image {
-   open(INDEX, "$gnutar --list --file - |") || die();
-   index_from_output(INDEX, STDOUT);
-}
-
-#sub command_restore {
-#}
-
-sub command_print_command {
-}
-
-require "generic-dumper"
index 1a117f8662347b9937c4d4698f8b327541bb54d2..1144b74f426a7990b59c3bee84d07a8329766c8b 100644 (file)
@@ -45,6 +45,41 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
        $(srcdir)/chg-mcutil.conf.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+       $(top_srcdir)/config/gnulib/absolute-header.m4 \
+       $(top_srcdir)/config/gnulib/alloca.m4 \
+       $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/eoverflow.m4 \
+       $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/getaddrinfo.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-cache.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-common.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-comp.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-tool.m4 \
+       $(top_srcdir)/config/gnulib/inet_ntop.m4 \
+       $(top_srcdir)/config/gnulib/intmax_t.m4 \
+       $(top_srcdir)/config/gnulib/inttypes_h.m4 \
+       $(top_srcdir)/config/gnulib/lib-ld.m4 \
+       $(top_srcdir)/config/gnulib/lib-link.m4 \
+       $(top_srcdir)/config/gnulib/lib-prefix.m4 \
+       $(top_srcdir)/config/gnulib/lock.m4 \
+       $(top_srcdir)/config/gnulib/longdouble.m4 \
+       $(top_srcdir)/config/gnulib/longlong.m4 \
+       $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
+       $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \
+       $(top_srcdir)/config/gnulib/size_max.m4 \
+       $(top_srcdir)/config/gnulib/snprintf.m4 \
+       $(top_srcdir)/config/gnulib/socklen.m4 \
+       $(top_srcdir)/config/gnulib/sockpfaf.m4 \
+       $(top_srcdir)/config/gnulib/stdbool.m4 \
+       $(top_srcdir)/config/gnulib/stdint_h.m4 \
+       $(top_srcdir)/config/gnulib/strdup.m4 \
+       $(top_srcdir)/config/gnulib/string_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
+       $(top_srcdir)/config/gnulib/vasnprintf.m4 \
+       $(top_srcdir)/config/gnulib/visibility.m4 \
+       $(top_srcdir)/config/gnulib/wchar_t.m4 \
+       $(top_srcdir)/config/gnulib/wint_t.m4 \
+       $(top_srcdir)/config/gnulib/xsize.m4 \
        $(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
@@ -55,8 +90,10 @@ SOURCES =
 DIST_SOURCES =
 DATA = $(noinst_DATA)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ABSOLUTE_STRING_H = @ABSOLUTE_STRING_H@
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
+ALLOCA_H = @ALLOCA_H@
 AMANDA_DBGDIR = @AMANDA_DBGDIR@
 AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@
 AMANDA_TMPDIR = @AMANDA_TMPDIR@
@@ -71,18 +108,17 @@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@
 AMTAR = @AMTAR@
 AM_CFLAGS = @AM_CFLAGS@
 AR = @AR@
+ARPA_INET_H = @ARPA_INET_H@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
-AWK_VAR_ASSIGNMENT_OPT = @AWK_VAR_ASSIGNMENT_OPT@
 BINARY_OWNER = @BINARY_OWNER@
-BUILD_MAN_PAGES_FALSE = @BUILD_MAN_PAGES_FALSE@
-BUILD_MAN_PAGES_TRUE = @BUILD_MAN_PAGES_TRUE@
 CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
+CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
 CHIO = @CHIO@
 CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
@@ -115,18 +151,40 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
+ENABLE_MANPAGE_BUILD_FALSE = @ENABLE_MANPAGE_BUILD_FALSE@
+ENABLE_MANPAGE_BUILD_TRUE = @ENABLE_MANPAGE_BUILD_TRUE@
+EOVERFLOW = @EOVERFLOW@
+EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@
 EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
+GCC_COMPILER_FALSE = @GCC_COMPILER_FALSE@
+GCC_COMPILER_TRUE = @GCC_COMPILER_TRUE@
 GETCONF = @GETCONF@
+GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@
+GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
 GNUTAR_LISTED_INCREMENTAL_DIRX = @GNUTAR_LISTED_INCREMENTAL_DIRX@
 GREP = @GREP@
 GZIP = @GZIP@
-HAVE_XSLTPROC_FALSE = @HAVE_XSLTPROC_FALSE@
-HAVE_XSLTPROC_TRUE = @HAVE_XSLTPROC_TRUE@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRNDUP = @HAVE_STRNDUP@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE__BOOL = @HAVE__BOOL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -135,22 +193,31 @@ LDFLAGS = @LDFLAGS@
 LEX = @LEX@
 LEXLIB = @LEXLIB@
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
+LIBPTH = @LIBPTH@
+LIBPTH_PREFIX = @LIBPTH_PREFIX@
 LIBS = @LIBS@
+LIBTHREAD = @LIBTHREAD@
 LIBTOOL = @LIBTOOL@
 LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LL_FMT = @LL_FMT@
 LL_RFMT = @LL_RFMT@
 LN_S = @LN_S@
 LTALLOCA = @LTALLOCA@
+LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
 LTLIBOBJS = @LTLIBOBJS@
+LTLIBPTH = @LTLIBPTH@
+LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
 MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@
 MCUTIL = @MCUTIL@
+MKDIR_P = @MKDIR_P@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
+NETINET_IN_H = @NETINET_IN_H@
 OBJEXT = @OBJEXT@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -164,6 +231,9 @@ PERL = @PERL@
 PRINT = @PRINT@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
+REPLACE_STRCASECMP = @REPLACE_STRCASECMP@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRSTR = @REPLACE_STRSTR@
 RESTORE = @RESTORE@
 SAMBA_CLIENT = @SAMBA_CLIENT@
 SERVICE_SUFFIX = @SERVICE_SUFFIX@
@@ -172,7 +242,10 @@ SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 SNAPSHOT_STAMP = @SNAPSHOT_STAMP@
 SORT = @SORT@
+SSH = @SSH@
+STDBOOL_H = @STDBOOL_H@
 STRIP = @STRIP@
+SYS_SOCKET_H = @SYS_SOCKET_H@
 USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@
 VDUMP = @VDUMP@
 VERSION = @VERSION@
@@ -211,6 +284,7 @@ WANT_TAPE_TRUE = @WANT_TAPE_TRUE@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
 XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
 YACC = @YACC@
 ac_c = @ac_c@
 ac_ct_AR = @ac_ct_AR@
@@ -237,6 +311,8 @@ build_os = @build_os@
 build_vendor = @build_vendor@
 datadir = @datadir@
 exec_prefix = @exec_prefix@
+gl_LIBOBJS = @gl_LIBOBJS@
+gl_LTLIBOBJS = @gl_LTLIBOBJS@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
index 0a10e65f42b8ecf319f177a8d4352d2f03bf2e29..c4cb9b9bcb36d623e14f7e35ab69cded4d268362 100644 (file)
@@ -18,7 +18,7 @@ conf "@DEFAULT_CONFIG@"               # your config name
 
 index_server "@DEFAULT_SERVER@"        # your amindexd server
 tape_server  "@DEFAULT_TAPE_SERVER@"   # your amidxtaped server
-tapedev      "@DEFAULT_TAPE_DEVICE@"           # your tape device
+tapedev      "@EXAMPLE_TAPEDEV@"       # your tape device
 
 #   auth       - authentication scheme to use between server and client.
 #                Valid values are "bsd", "krb4", "krb5" and "ssh".  
index 1a2891ccaff867f87b222594a182d5b1e8147305..1cd99783b94e371480e1f7894aaedf87e0c30644 100644 (file)
@@ -90,7 +90,7 @@ usetimestamps yes
 
 runtapes 1                     # number of tapes to be used in a single run of amdump
 tpchanger "chg-manual"         # the tape-changer glue script
-tapedev "@DEFAULT_TAPE_DEVICE@"        # the no-rewind tape device to be used
+tapedev "@EXAMPLE_TAPEDEV@"    # the no-rewind tape device to be used
 rawtapedev "@DEFAULT_RAW_TAPE_DEVICE@" # the raw device to be used (ftape only)
 #changerfile "@CONFIG_DIR@/@DEFAULT_CONFIG@/changer"
 #changerfile "@CONFIG_DIR@/@DEFAULT_CONFIG@/changer-status"
@@ -112,7 +112,7 @@ amrecover_do_fsf yes                # amrecover will call amrestore with the
                                # -f flag for faster positioning of the tape.
 amrecover_check_label yes      # amrecover will call amrestore with the
                                # -l flag to check the label.
-amrecover_changer "@DEFAULT_TAPE_DEVICE@"      # amrecover will use the changer if you restore
+amrecover_changer "@EXAMPLE_TAPEDEV@"  # amrecover will use the changer if you restore
                                # from this device.
                                # It could be a string like 'changer' and
                                # amrecover will use your changer if you
index 97e42314b07b676763762972cd3a3094d0224574..bf1acfa2c6646f6e3817a2f0164105382e0ea27b 100644 (file)
@@ -26,7 +26,7 @@
 #
 
 mcutil mcutil          #location of the mcutil program
-tape   # use ntape for norewind
+tape /dev/null # use ntape for norewind
                        # {a|m|h|c} suffixes should NOT 
                        # be tape device since they all
                        # implement hardware compression
index e6dfe3a247d3262e6df9f31c1e6116daa4a365c5..d16effd9c1bf76ac374d197511886af170e3d8cb 100644 (file)
@@ -26,7 +26,7 @@
 #
 
 mcutil @MCUTIL@                #location of the mcutil program
-tape @DEFAULT_TAPE_DEVICE@     # use ntape for norewind
+tape @EXAMPLE_TAPEDEV@ # use ntape for norewind
                        # {a|m|h|c} suffixes should NOT 
                        # be tape device since they all
                        # implement hardware compression
diff --git a/gnulib/Makefile.am b/gnulib/Makefile.am
new file mode 100644 (file)
index 0000000..b83d0f2
--- /dev/null
@@ -0,0 +1,245 @@
+## DO NOT EDIT! GENERATED AUTOMATICALLY!
+## Process this file with automake to produce Makefile.in.
+# Copyright (C) 2004-2007 Free Software Foundation, Inc.
+#
+# This file is free software, distributed under the terms of the GNU
+# General Public License.  As a special exception to the GNU General
+# Public License, this file may be distributed as part of a program
+# that contains a configuration script generated by Autoconf, under
+# the same distribution terms as the rest of that program.
+#
+# Generated by gnulib-tool.
+# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib --m4-base=config/gnulib --doc-base=doc --aux-dir=config --libtool --macro-prefix=gl getaddrinfo lock visibility
+
+AUTOMAKE_OPTIONS = 1.5 gnits
+
+noinst_HEADERS =
+noinst_LIBRARIES =
+noinst_LTLIBRARIES =
+EXTRA_DIST =
+BUILT_SOURCES =
+SUFFIXES =
+MOSTLYCLEANFILES = core *.stackdump
+MOSTLYCLEANDIRS =
+CLEANFILES =
+DISTCLEANFILES =
+MAINTAINERCLEANFILES =
+
+AM_CPPFLAGS =
+if GCC_COMPILER
+  AM_CFLAGS += -Wno-error
+endif
+
+noinst_LTLIBRARIES += libgnu.la
+
+libgnu_la_SOURCES =
+libgnu_la_LIBADD = $(gl_LTLIBOBJS)
+libgnu_la_DEPENDENCIES = $(gl_LTLIBOBJS)
+EXTRA_libgnu_la_SOURCES =
+libgnu_la_LDFLAGS = $(AM_LDFLAGS)
+
+## begin gnulib module alloca-opt
+
+BUILT_SOURCES += $(ALLOCA_H)
+
+# We need the following in order to create <alloca.h> when the system
+# doesn't have one that works with the given compiler.
+alloca.h: alloca_.h
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         cat $(srcdir)/alloca_.h; \
+       } > $@-t
+       mv -f $@-t $@
+MOSTLYCLEANFILES += alloca.h alloca.h-t
+
+EXTRA_DIST += alloca_.h
+
+## end   gnulib module alloca-opt
+
+## begin gnulib module arpa_inet
+
+BUILT_SOURCES += $(ARPA_INET_H)
+
+# We need the following in order to create <arpa/inet.h> when the system
+# doesn't have one.
+arpa/inet.h:
+       test -d arpa || mkdir arpa
+       rm -f $@-t $@
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         echo '#include <sys/socket.h>'; \
+       } > $@-t
+       mv $@-t $@
+MOSTLYCLEANFILES += arpa/inet.h arpa/inet.h-t
+MOSTLYCLEANDIRS += arpa
+
+## end   gnulib module arpa_inet
+
+## begin gnulib module getaddrinfo
+
+
+EXTRA_DIST += gai_strerror.c getaddrinfo.c getaddrinfo.h
+
+EXTRA_libgnu_la_SOURCES += gai_strerror.c getaddrinfo.c
+
+## end   gnulib module getaddrinfo
+
+## begin gnulib module gettext-h
+
+libgnu_la_SOURCES += gettext.h
+
+## end   gnulib module gettext-h
+
+## begin gnulib module inet_ntop
+
+
+EXTRA_DIST += inet_ntop.c inet_ntop.h
+
+EXTRA_libgnu_la_SOURCES += inet_ntop.c
+
+## end   gnulib module inet_ntop
+
+## begin gnulib module lock
+
+libgnu_la_SOURCES += lock.h lock.c
+
+## end   gnulib module lock
+
+## begin gnulib module netinet_in
+
+BUILT_SOURCES += $(NETINET_IN_H)
+
+# We need the following in order to create <netinet/in.h> when the system
+# doesn't have one.
+netinet/in.h:
+       test -d netinet || mkdir netinet
+       rm -f $@-t $@
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         echo '#include <sys/socket.h>'; \
+       } > $@-t
+       mv $@-t $@
+MOSTLYCLEANFILES += netinet/in.h netinet/in.h-t
+MOSTLYCLEANDIRS += netinet
+
+## end   gnulib module netinet_in
+
+## begin gnulib module size_max
+
+libgnu_la_SOURCES += size_max.h
+
+## end   gnulib module size_max
+
+## begin gnulib module snprintf
+
+
+EXTRA_DIST += snprintf.c snprintf.h
+
+EXTRA_libgnu_la_SOURCES += snprintf.c
+
+## end   gnulib module snprintf
+
+## begin gnulib module stdbool
+
+BUILT_SOURCES += $(STDBOOL_H)
+
+# We need the following in order to create <stdbool.h> when the system
+# doesn't have one that works.
+stdbool.h: stdbool_.h
+       rm -f $@-t $@
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool_.h; \
+       } > $@-t
+       mv $@-t $@
+MOSTLYCLEANFILES += stdbool.h stdbool.h-t
+
+EXTRA_DIST += stdbool_.h
+
+## end   gnulib module stdbool
+
+## begin gnulib module strdup
+
+
+EXTRA_DIST += strdup.c
+
+EXTRA_libgnu_la_SOURCES += strdup.c
+
+## end   gnulib module strdup
+
+## begin gnulib module string
+
+BUILT_SOURCES += string.h
+
+# We need the following in order to create <string.h> when the system
+# doesn't have one that works with the given compiler.
+string.h: string_.h
+       rm -f $@-t $@
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+         sed -e 's|@''ABSOLUTE_STRING_H''@|$(ABSOLUTE_STRING_H)|g' \
+             -e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \
+             -e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \
+             -e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \
+             -e 's|@''HAVE_STPCPY''@|$(HAVE_STPCPY)|g' \
+             -e 's|@''HAVE_STPNCPY''@|$(HAVE_STPNCPY)|g' \
+             -e 's|@''HAVE_DECL_STRNCASECMP''@|$(HAVE_DECL_STRNCASECMP)|g' \
+             -e 's|@''HAVE_STRCHRNUL''@|$(HAVE_STRCHRNUL)|g' \
+             -e 's|@''HAVE_DECL_STRDUP''@|$(HAVE_DECL_STRDUP)|g' \
+             -e 's|@''HAVE_STRNDUP''@|$(HAVE_STRNDUP)|g' \
+             -e 's|@''HAVE_DECL_STRNDUP''@|$(HAVE_DECL_STRNDUP)|g' \
+             -e 's|@''HAVE_DECL_STRNLEN''@|$(HAVE_DECL_STRNLEN)|g' \
+             -e 's|@''HAVE_STRPBRK''@|$(HAVE_STRPBRK)|g' \
+             -e 's|@''HAVE_STRSEP''@|$(HAVE_STRSEP)|g' \
+             -e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \
+             -e 's|@''REPLACE_STRCASECMP''@|$(REPLACE_STRCASECMP)|g' \
+             -e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \
+             -e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|g' \
+             < $(srcdir)/string_.h; \
+       } > $@-t
+       mv $@-t $@
+MOSTLYCLEANFILES += string.h string.h-t
+
+EXTRA_DIST += string_.h
+
+## end   gnulib module string
+
+## begin gnulib module sys_socket
+
+BUILT_SOURCES += $(SYS_SOCKET_H)
+
+# We need the following in order to create <sys/socket.h> when the system
+# doesn't have one that works with the given compiler.
+sys/socket.h: socket_.h
+       @MKDIR_P@ sys
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         cat $(srcdir)/socket_.h; \
+       } > $@-t
+       mv -f $@-t $@
+MOSTLYCLEANFILES += sys/socket.h sys/socket.h-t
+MOSTLYCLEANDIRS += sys
+
+EXTRA_DIST += socket_.h
+
+## end   gnulib module sys_socket
+
+## begin gnulib module vasnprintf
+
+
+EXTRA_DIST += asnprintf.c printf-args.c printf-args.h printf-parse.c printf-parse.h vasnprintf.c vasnprintf.h
+
+EXTRA_libgnu_la_SOURCES += asnprintf.c printf-args.c printf-parse.c vasnprintf.c
+
+## end   gnulib module vasnprintf
+
+## begin gnulib module xsize
+
+libgnu_la_SOURCES += xsize.h
+
+## end   gnulib module xsize
+
+
+mostlyclean-local: mostlyclean-generic
+       @for dir in '' $(MOSTLYCLEANDIRS); do \
+         if test -n "$$dir" && test -d $$dir; then \
+           echo "rmdir $$dir"; rmdir $$dir; \
+         fi; \
+       done
+
+# Make sure regenerate/* are in the distribution tarball
+EXTRA_DIST += regenerate/getaddrinfo-cygwin.patch regenerate/no-error.patch regenerate/regenerate
diff --git a/gnulib/Makefile.in b/gnulib/Makefile.in
new file mode 100644 (file)
index 0000000..2157892
--- /dev/null
@@ -0,0 +1,752 @@
+# Makefile.in generated by automake 1.9.6 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005  Free Software Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+# Copyright (C) 2004-2007 Free Software Foundation, Inc.
+#
+# This file is free software, distributed under the terms of the GNU
+# General Public License.  As a special exception to the GNU General
+# Public License, this file may be distributed as part of a program
+# that contains a configuration script generated by Autoconf, under
+# the same distribution terms as the rest of that program.
+#
+# Generated by gnulib-tool.
+# Reproduce by: gnulib-tool --import --dir=. --lib=libgnu --source-base=gnulib --m4-base=config/gnulib --doc-base=doc --aux-dir=config --libtool --macro-prefix=gl getaddrinfo lock visibility
+
+
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = ..
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+INSTALL = @INSTALL@
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+@GCC_COMPILER_TRUE@am__append_1 = -Wno-error
+subdir = gnulib
+DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
+       $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+       $(top_srcdir)/config/gnulib/absolute-header.m4 \
+       $(top_srcdir)/config/gnulib/alloca.m4 \
+       $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/eoverflow.m4 \
+       $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/getaddrinfo.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-cache.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-common.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-comp.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-tool.m4 \
+       $(top_srcdir)/config/gnulib/inet_ntop.m4 \
+       $(top_srcdir)/config/gnulib/intmax_t.m4 \
+       $(top_srcdir)/config/gnulib/inttypes_h.m4 \
+       $(top_srcdir)/config/gnulib/lib-ld.m4 \
+       $(top_srcdir)/config/gnulib/lib-link.m4 \
+       $(top_srcdir)/config/gnulib/lib-prefix.m4 \
+       $(top_srcdir)/config/gnulib/lock.m4 \
+       $(top_srcdir)/config/gnulib/longdouble.m4 \
+       $(top_srcdir)/config/gnulib/longlong.m4 \
+       $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
+       $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \
+       $(top_srcdir)/config/gnulib/size_max.m4 \
+       $(top_srcdir)/config/gnulib/snprintf.m4 \
+       $(top_srcdir)/config/gnulib/socklen.m4 \
+       $(top_srcdir)/config/gnulib/sockpfaf.m4 \
+       $(top_srcdir)/config/gnulib/stdbool.m4 \
+       $(top_srcdir)/config/gnulib/stdint_h.m4 \
+       $(top_srcdir)/config/gnulib/strdup.m4 \
+       $(top_srcdir)/config/gnulib/string_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
+       $(top_srcdir)/config/gnulib/vasnprintf.m4 \
+       $(top_srcdir)/config/gnulib/visibility.m4 \
+       $(top_srcdir)/config/gnulib/wchar_t.m4 \
+       $(top_srcdir)/config/gnulib/wint_t.m4 \
+       $(top_srcdir)/config/gnulib/xsize.m4 \
+       $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/config/config.h
+CONFIG_CLEAN_FILES =
+LIBRARIES = $(noinst_LIBRARIES)
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+am__DEPENDENCIES_1 =
+am_libgnu_la_OBJECTS = lock.lo
+libgnu_la_OBJECTS = $(am_libgnu_la_OBJECTS)
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/config
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \
+       $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+       $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(AM_LDFLAGS) $(LDFLAGS) -o $@
+SOURCES = $(libgnu_la_SOURCES) $(EXTRA_libgnu_la_SOURCES)
+DIST_SOURCES = $(libgnu_la_SOURCES) $(EXTRA_libgnu_la_SOURCES)
+HEADERS = $(noinst_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ABSOLUTE_STRING_H = @ABSOLUTE_STRING_H@
+ACLOCAL = @ACLOCAL@
+ALLOCA = @ALLOCA@
+ALLOCA_H = @ALLOCA_H@
+AMANDA_DBGDIR = @AMANDA_DBGDIR@
+AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@
+AMANDA_TMPDIR = @AMANDA_TMPDIR@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMLINT = @AMLINT@
+AMLINTFLAGS = @AMLINTFLAGS@
+AMPLOT_CAT_COMPRESS = @AMPLOT_CAT_COMPRESS@
+AMPLOT_CAT_GZIP = @AMPLOT_CAT_GZIP@
+AMPLOT_CAT_PACK = @AMPLOT_CAT_PACK@
+AMPLOT_COMPRESS = @AMPLOT_COMPRESS@
+AMTAR = @AMTAR@
+AM_CFLAGS = @AM_CFLAGS@ $(am__append_1)
+AR = @AR@
+ARPA_INET_H = @ARPA_INET_H@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BINARY_OWNER = @BINARY_OWNER@
+CAT = @CAT@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
+CHIO = @CHIO@
+CHS = @CHS@
+CLIENT_LOGIN = @CLIENT_LOGIN@
+CLIENT_SCRIPTS_OPT = @CLIENT_SCRIPTS_OPT@
+COMPRESS = @COMPRESS@
+CONFIGURE_COMMAND = @CONFIGURE_COMMAND@
+CONFIG_DIR = @CONFIG_DIR@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DB_EXT = @DB_EXT@
+DD = @DD@
+DEFAULT_CHANGER_DEVICE = @DEFAULT_CHANGER_DEVICE@
+DEFAULT_CONFIG = @DEFAULT_CONFIG@
+DEFAULT_RAW_TAPE_DEVICE = @DEFAULT_RAW_TAPE_DEVICE@
+DEFAULT_SERVER = @DEFAULT_SERVER@
+DEFAULT_TAPE_DEVICE = @DEFAULT_TAPE_DEVICE@
+DEFAULT_TAPE_SERVER = @DEFAULT_TAPE_SERVER@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DOC_BUILD_DATE = @DOC_BUILD_DATE@
+DUMP = @DUMP@
+DUMPER_DIR = @DUMPER_DIR@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_MANPAGE_BUILD_FALSE = @ENABLE_MANPAGE_BUILD_FALSE@
+ENABLE_MANPAGE_BUILD_TRUE = @ENABLE_MANPAGE_BUILD_TRUE@
+EOVERFLOW = @EOVERFLOW@
+EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+GCC_COMPILER_FALSE = @GCC_COMPILER_FALSE@
+GCC_COMPILER_TRUE = @GCC_COMPILER_TRUE@
+GETCONF = @GETCONF@
+GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@
+GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@
+GNUPLOT = @GNUPLOT@
+GNUTAR = @GNUTAR@
+GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
+GNUTAR_LISTED_INCREMENTAL_DIRX = @GNUTAR_LISTED_INCREMENTAL_DIRX@
+GREP = @GREP@
+GZIP = @GZIP@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRNDUP = @HAVE_STRNDUP@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE__BOOL = @HAVE__BOOL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LEX = @LEX@
+LEXLIB = @LEXLIB@
+LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBMULTITHREAD = @LIBMULTITHREAD@
+LIBOBJS = @LIBOBJS@
+LIBPTH = @LIBPTH@
+LIBPTH_PREFIX = @LIBPTH_PREFIX@
+LIBS = @LIBS@
+LIBTHREAD = @LIBTHREAD@
+LIBTOOL = @LIBTOOL@
+LIBTOOL_DEPS = @LIBTOOL_DEPS@
+LL_FMT = @LL_FMT@
+LL_RFMT = @LL_RFMT@
+LN_S = @LN_S@
+LTALLOCA = @LTALLOCA@
+LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
+LTLIBOBJS = @LTLIBOBJS@
+LTLIBPTH = @LTLIBPTH@
+LTLIBTHREAD = @LTLIBTHREAD@
+MAILER = @MAILER@
+MAKEINFO = @MAKEINFO@
+MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@
+MCUTIL = @MCUTIL@
+MKDIR_P = @MKDIR_P@
+MT = @MT@
+MTX = @MTX@
+MT_FILE_FLAG = @MT_FILE_FLAG@
+NETINET_IN_H = @NETINET_IN_H@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PCAT = @PCAT@
+PERL = @PERL@
+PRINT = @PRINT@
+RANLIB = @RANLIB@
+READLINE_LIBS = @READLINE_LIBS@
+REPLACE_STRCASECMP = @REPLACE_STRCASECMP@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRSTR = @REPLACE_STRSTR@
+RESTORE = @RESTORE@
+SAMBA_CLIENT = @SAMBA_CLIENT@
+SERVICE_SUFFIX = @SERVICE_SUFFIX@
+SETUID_GROUP = @SETUID_GROUP@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SNAPSHOT_STAMP = @SNAPSHOT_STAMP@
+SORT = @SORT@
+SSH = @SSH@
+STDBOOL_H = @STDBOOL_H@
+STRIP = @STRIP@
+SYS_SOCKET_H = @SYS_SOCKET_H@
+USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@
+VDUMP = @VDUMP@
+VERSION = @VERSION@
+VERSION_COMMENT = @VERSION_COMMENT@
+VERSION_MAJOR = @VERSION_MAJOR@
+VERSION_MINOR = @VERSION_MINOR@
+VERSION_PATCH = @VERSION_PATCH@
+VERSION_SUFFIX = @VERSION_SUFFIX@
+VRESTORE = @VRESTORE@
+VXDUMP = @VXDUMP@
+VXRESTORE = @VXRESTORE@
+WANT_AMPLOT_FALSE = @WANT_AMPLOT_FALSE@
+WANT_AMPLOT_TRUE = @WANT_AMPLOT_TRUE@
+WANT_CHG_SCSI_FALSE = @WANT_CHG_SCSI_FALSE@
+WANT_CHG_SCSI_TRUE = @WANT_CHG_SCSI_TRUE@
+WANT_CHIO_SCSI_FALSE = @WANT_CHIO_SCSI_FALSE@
+WANT_CHIO_SCSI_TRUE = @WANT_CHIO_SCSI_TRUE@
+WANT_CLIENT_FALSE = @WANT_CLIENT_FALSE@
+WANT_CLIENT_TRUE = @WANT_CLIENT_TRUE@
+WANT_RECOVER_FALSE = @WANT_RECOVER_FALSE@
+WANT_RECOVER_TRUE = @WANT_RECOVER_TRUE@
+WANT_RESTORE_FALSE = @WANT_RESTORE_FALSE@
+WANT_RESTORE_TRUE = @WANT_RESTORE_TRUE@
+WANT_RUNTIME_PSEUDO_RELOC_FALSE = @WANT_RUNTIME_PSEUDO_RELOC_FALSE@
+WANT_RUNTIME_PSEUDO_RELOC_TRUE = @WANT_RUNTIME_PSEUDO_RELOC_TRUE@
+WANT_SAMBA_FALSE = @WANT_SAMBA_FALSE@
+WANT_SAMBA_TRUE = @WANT_SAMBA_TRUE@
+WANT_SERVER_FALSE = @WANT_SERVER_FALSE@
+WANT_SERVER_TRUE = @WANT_SERVER_TRUE@
+WANT_SETUID_CLIENT_FALSE = @WANT_SETUID_CLIENT_FALSE@
+WANT_SETUID_CLIENT_TRUE = @WANT_SETUID_CLIENT_TRUE@
+WANT_SSH_SECURITY_FALSE = @WANT_SSH_SECURITY_FALSE@
+WANT_SSH_SECURITY_TRUE = @WANT_SSH_SECURITY_TRUE@
+WANT_TAPE_FALSE = @WANT_TAPE_FALSE@
+WANT_TAPE_TRUE = @WANT_TAPE_TRUE@
+XFSDUMP = @XFSDUMP@
+XFSRESTORE = @XFSRESTORE@
+XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
+YACC = @YACC@
+ac_c = @ac_c@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+ac_n = @ac_n@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+gl_LIBOBJS = @gl_LIBOBJS@
+gl_LTLIBOBJS = @gl_LTLIBOBJS@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+AUTOMAKE_OPTIONS = 1.5 gnits
+noinst_HEADERS = 
+noinst_LIBRARIES = 
+noinst_LTLIBRARIES = libgnu.la
+
+# Make sure regenerate/* are in the distribution tarball
+EXTRA_DIST = alloca_.h gai_strerror.c getaddrinfo.c getaddrinfo.h \
+       inet_ntop.c inet_ntop.h snprintf.c snprintf.h stdbool_.h \
+       strdup.c string_.h socket_.h asnprintf.c printf-args.c \
+       printf-args.h printf-parse.c printf-parse.h vasnprintf.c \
+       vasnprintf.h regenerate/getaddrinfo-cygwin.patch \
+       regenerate/no-error.patch regenerate/regenerate
+BUILT_SOURCES = $(ALLOCA_H) $(ARPA_INET_H) $(NETINET_IN_H) \
+       $(STDBOOL_H) string.h $(SYS_SOCKET_H)
+SUFFIXES = 
+MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t arpa/inet.h \
+       arpa/inet.h-t netinet/in.h netinet/in.h-t stdbool.h \
+       stdbool.h-t string.h string.h-t sys/socket.h sys/socket.h-t
+MOSTLYCLEANDIRS = arpa netinet sys
+CLEANFILES = 
+DISTCLEANFILES = 
+MAINTAINERCLEANFILES = 
+AM_CPPFLAGS = 
+libgnu_la_SOURCES = gettext.h lock.h lock.c size_max.h xsize.h
+libgnu_la_LIBADD = $(gl_LTLIBOBJS)
+libgnu_la_DEPENDENCIES = $(gl_LTLIBOBJS)
+EXTRA_libgnu_la_SOURCES = gai_strerror.c getaddrinfo.c inet_ntop.c \
+       snprintf.c strdup.c asnprintf.c printf-args.c printf-parse.c \
+       vasnprintf.c
+libgnu_la_LDFLAGS = $(AM_LDFLAGS)
+all: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnits  gnulib/Makefile'; \
+       cd $(top_srcdir) && \
+         $(AUTOMAKE) --gnits  gnulib/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure:  $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4):  $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+clean-noinstLIBRARIES:
+       -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+
+clean-noinstLTLIBRARIES:
+       -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+       @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+         dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+         test "$$dir" != "$$p" || dir=.; \
+         echo "rm -f \"$${dir}/so_locations\""; \
+         rm -f "$${dir}/so_locations"; \
+       done
+libgnu.la: $(libgnu_la_OBJECTS) $(libgnu_la_DEPENDENCIES) 
+       $(LINK)  $(libgnu_la_LDFLAGS) $(libgnu_la_OBJECTS) $(libgnu_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asnprintf.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gai_strerror.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getaddrinfo.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inet_ntop.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lock.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printf-args.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printf-parse.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/snprintf.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strdup.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vasnprintf.Plo@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@   if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@   if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
+@am__fastdepCC_TRUE@   then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+
+distclean-libtool:
+       -rm -f libtool
+uninstall-info-am:
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       here=`pwd`; \
+       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+           $$tags $$unique; \
+       fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+               $(TAGS_FILES) $(LISP)
+       tags=; \
+       here=`pwd`; \
+       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+       unique=`for i in $$list; do \
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+         done | \
+         $(AWK) '    { files[$$0] = 1; } \
+              END { for (i in files) print i; }'`; \
+       test -z "$(CTAGS_ARGS)$$tags$$unique" \
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+            $$tags $$unique
+
+GTAGS:
+       here=`$(am__cd) $(top_builddir) && pwd` \
+         && cd $(top_srcdir) \
+         && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+       $(mkdir_p) $(distdir)/regenerate
+       @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+       list='$(DISTFILES)'; for file in $$list; do \
+         case $$file in \
+           $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+           $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+         esac; \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+         if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+           dir="/$$dir"; \
+           $(mkdir_p) "$(distdir)$$dir"; \
+         else \
+           dir=''; \
+         fi; \
+         if test -d $$d/$$file; then \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+           fi; \
+           cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+         else \
+           test -f $(distdir)/$$file \
+           || cp -p $$d/$$file $(distdir)/$$file \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) check-am
+all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(HEADERS)
+installdirs:
+install: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+         `test -z '$(STRIP)' || \
+           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+       -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES)
+
+clean-generic:
+       -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+       -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+       -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \
+       clean-noinstLTLIBRARIES mostlyclean-am
+
+distclean: distclean-am
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-libtool distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool mostlyclean-local
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-info-am
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+       clean-libtool clean-noinstLIBRARIES clean-noinstLTLIBRARIES \
+       ctags distclean distclean-compile distclean-generic \
+       distclean-libtool distclean-tags distdir dvi dvi-am html \
+       html-am info info-am install install-am install-data \
+       install-data-am install-exec install-exec-am install-info \
+       install-info-am install-man install-strip installcheck \
+       installcheck-am installdirs maintainer-clean \
+       maintainer-clean-generic mostlyclean mostlyclean-compile \
+       mostlyclean-generic mostlyclean-libtool mostlyclean-local pdf \
+       pdf-am ps ps-am tags uninstall uninstall-am uninstall-info-am
+
+
+# We need the following in order to create <alloca.h> when the system
+# doesn't have one that works with the given compiler.
+alloca.h: alloca_.h
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         cat $(srcdir)/alloca_.h; \
+       } > $@-t
+       mv -f $@-t $@
+
+# We need the following in order to create <arpa/inet.h> when the system
+# doesn't have one.
+arpa/inet.h:
+       test -d arpa || mkdir arpa
+       rm -f $@-t $@
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         echo '#include <sys/socket.h>'; \
+       } > $@-t
+       mv $@-t $@
+
+# We need the following in order to create <netinet/in.h> when the system
+# doesn't have one.
+netinet/in.h:
+       test -d netinet || mkdir netinet
+       rm -f $@-t $@
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         echo '#include <sys/socket.h>'; \
+       } > $@-t
+       mv $@-t $@
+
+# We need the following in order to create <stdbool.h> when the system
+# doesn't have one that works.
+stdbool.h: stdbool_.h
+       rm -f $@-t $@
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         sed -e 's/@''HAVE__BOOL''@/$(HAVE__BOOL)/g' < $(srcdir)/stdbool_.h; \
+       } > $@-t
+       mv $@-t $@
+
+# We need the following in order to create <string.h> when the system
+# doesn't have one that works with the given compiler.
+string.h: string_.h
+       rm -f $@-t $@
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+         sed -e 's|@''ABSOLUTE_STRING_H''@|$(ABSOLUTE_STRING_H)|g' \
+             -e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \
+             -e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \
+             -e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \
+             -e 's|@''HAVE_STPCPY''@|$(HAVE_STPCPY)|g' \
+             -e 's|@''HAVE_STPNCPY''@|$(HAVE_STPNCPY)|g' \
+             -e 's|@''HAVE_DECL_STRNCASECMP''@|$(HAVE_DECL_STRNCASECMP)|g' \
+             -e 's|@''HAVE_STRCHRNUL''@|$(HAVE_STRCHRNUL)|g' \
+             -e 's|@''HAVE_DECL_STRDUP''@|$(HAVE_DECL_STRDUP)|g' \
+             -e 's|@''HAVE_STRNDUP''@|$(HAVE_STRNDUP)|g' \
+             -e 's|@''HAVE_DECL_STRNDUP''@|$(HAVE_DECL_STRNDUP)|g' \
+             -e 's|@''HAVE_DECL_STRNLEN''@|$(HAVE_DECL_STRNLEN)|g' \
+             -e 's|@''HAVE_STRPBRK''@|$(HAVE_STRPBRK)|g' \
+             -e 's|@''HAVE_STRSEP''@|$(HAVE_STRSEP)|g' \
+             -e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \
+             -e 's|@''REPLACE_STRCASECMP''@|$(REPLACE_STRCASECMP)|g' \
+             -e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \
+             -e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|g' \
+             < $(srcdir)/string_.h; \
+       } > $@-t
+       mv $@-t $@
+
+# We need the following in order to create <sys/socket.h> when the system
+# doesn't have one that works with the given compiler.
+sys/socket.h: socket_.h
+       @MKDIR_P@ sys
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         cat $(srcdir)/socket_.h; \
+       } > $@-t
+       mv -f $@-t $@
+
+mostlyclean-local: mostlyclean-generic
+       @for dir in '' $(MOSTLYCLEANDIRS); do \
+         if test -n "$$dir" && test -d $$dir; then \
+           echo "rmdir $$dir"; rmdir $$dir; \
+         fi; \
+       done
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/gnulib/alloca_.h b/gnulib/alloca_.h
new file mode 100644 (file)
index 0000000..dd0b3e9
--- /dev/null
@@ -0,0 +1,54 @@
+/* Memory allocation on the stack.
+
+   Copyright (C) 1995, 1999, 2001, 2002, 2003, 2004, 2006 Free Software
+   Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published
+   by the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public
+   License along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+   USA.  */
+
+/* Avoid using the symbol _ALLOCA_H here, as Bison assumes _ALLOCA_H
+   means there is a real alloca function.  */
+#ifndef _GNULIB_ALLOCA_H
+# define _GNULIB_ALLOCA_H
+
+/* alloca (N) returns a pointer to N bytes of memory
+   allocated on the stack, which will last until the function returns.
+   Use of alloca should be avoided:
+     - inside arguments of function calls - undefined behaviour,
+     - in inline functions - the allocation may actually last until the
+       calling function returns,
+     - for huge N (say, N >= 65536) - you never know how large (or small)
+       the stack is, and when the stack cannot fulfill the memory allocation
+       request, the program just crashes.
+ */
+
+#ifndef alloca
+# ifdef __GNUC__
+#  define alloca __builtin_alloca
+# elif defined _AIX
+#  define alloca __alloca
+# elif defined _MSC_VER
+#  include <malloc.h>
+#  define alloca _alloca
+# else
+#  include <stddef.h>
+#  ifdef  __cplusplus
+extern "C"
+#  endif
+void *alloca (size_t);
+# endif
+#endif
+
+#endif /* _GNULIB_ALLOCA_H */
diff --git a/gnulib/asnprintf.c b/gnulib/asnprintf.c
new file mode 100644 (file)
index 0000000..26c3988
--- /dev/null
@@ -0,0 +1,35 @@
+/* Formatted output to strings.
+   Copyright (C) 1999, 2002, 2006 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License along
+   with this program; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include "vasnprintf.h"
+
+#include <stdarg.h>
+
+char *
+asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...)
+{
+  va_list args;
+  char *result;
+
+  va_start (args, format);
+  result = vasnprintf (resultbuf, lengthp, format, args);
+  va_end (args);
+  return result;
+}
diff --git a/gnulib/gai_strerror.c b/gnulib/gai_strerror.c
new file mode 100644 (file)
index 0000000..aa733d6
--- /dev/null
@@ -0,0 +1,78 @@
+/* Copyright (C) 1997, 2001, 2002, 2004, 2005, 2006 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Philip Blundell <pjb27@cam.ac.uk>, 1997.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#ifndef _LIBC
+# include <config.h>
+# include "getaddrinfo.h"
+#endif
+
+#include <stdio.h>
+#ifdef HAVE_NETDB_H
+# include <netdb.h>
+#endif
+
+#ifdef _LIBC
+# include <libintl.h>
+#else
+# include "gettext.h"
+# define _(String) gettext (String)
+# define N_(String) String
+#endif
+
+static struct
+  {
+    int code;
+    const char *msg;
+  }
+values[] =
+  {
+    { EAI_ADDRFAMILY, N_("Address family for hostname not supported") },
+    { EAI_AGAIN, N_("Temporary failure in name resolution") },
+    { EAI_BADFLAGS, N_("Bad value for ai_flags") },
+    { EAI_FAIL, N_("Non-recoverable failure in name resolution") },
+    { EAI_FAMILY, N_("ai_family not supported") },
+    { EAI_MEMORY, N_("Memory allocation failure") },
+    { EAI_NODATA, N_("No address associated with hostname") },
+    { EAI_NONAME, N_("Name or service not known") },
+    { EAI_SERVICE, N_("Servname not supported for ai_socktype") },
+    { EAI_SOCKTYPE, N_("ai_socktype not supported") },
+    { EAI_SYSTEM, N_("System error") },
+    { EAI_OVERFLOW, N_("Argument buffer too small") },
+#ifdef __USE_GNU
+    { EAI_INPROGRESS, N_("Processing request in progress") },
+    { EAI_CANCELED, N_("Request canceled") },
+    { EAI_NOTCANCELED, N_("Request not canceled") },
+    { EAI_ALLDONE, N_("All requests done") },
+    { EAI_INTR, N_("Interrupted by a signal") },
+    { EAI_IDN_ENCODE, N_("Parameter string not correctly encoded") }
+#endif
+  };
+
+const char *
+gai_strerror (int code)
+{
+  size_t i;
+  for (i = 0; i < sizeof (values) / sizeof (values[0]); ++i)
+    if (values[i].code == code)
+      return _(values[i].msg);
+
+  return _("Unknown error");
+}
+#ifdef _LIBC
+libc_hidden_def (gai_strerror)
+#endif
diff --git a/gnulib/getaddrinfo.c b/gnulib/getaddrinfo.c
new file mode 100644 (file)
index 0000000..1b6100d
--- /dev/null
@@ -0,0 +1,477 @@
+/* Get address information (partial implementation).
+   Copyright (C) 1997, 2001, 2002, 2004, 2005, 2006, 2007 Free Software
+   Foundation, Inc.
+   Contributed by Simon Josefsson <simon@josefsson.org>.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#include <config.h>
+
+#include "getaddrinfo.h"
+
+#if HAVE_NETINET_IN_H
+# include <netinet/in.h>
+#endif
+
+/* Get calloc. */
+#include <stdlib.h>
+
+/* Get memcpy, strdup. */
+#include <string.h>
+
+#include <stdbool.h>
+
+#include "gettext.h"
+#define _(String) gettext (String)
+#define N_(String) String
+
+#include "inet_ntop.h"
+#include "snprintf.h"
+
+extern int h_errno;
+
+/* BeOS has AF_INET, but not PF_INET.  */
+#ifndef PF_INET
+# define PF_INET AF_INET
+#endif
+/* BeOS also lacks PF_UNSPEC.  */
+#ifndef PF_UNSPEC
+# define PF_UNSPEC 0
+#endif
+
+#if defined _WIN32 || defined __WIN32__
+# define WIN32_NATIVE
+#endif
+
+#ifdef WIN32_NATIVE
+typedef int (WSAAPI *getaddrinfo_func) (const char*, const char*,
+                                       const struct addrinfo*,
+                                       struct addrinfo**);
+typedef void (WSAAPI *freeaddrinfo_func) (struct addrinfo*);
+typedef int (WSAAPI *getnameinfo_func) (const struct sockaddr*,
+                                       socklen_t, char*, DWORD,
+                                       char*, DWORD, int);
+
+static getaddrinfo_func getaddrinfo_ptr = NULL;
+static freeaddrinfo_func freeaddrinfo_ptr = NULL;
+static getnameinfo_func getnameinfo_ptr = NULL;
+
+static int
+use_win32_p (void)
+{
+  static int done = 0;
+  HMODULE h;
+
+  if (done)
+    return getaddrinfo_ptr ? 1 : 0;
+
+  done = 1;
+
+  h = GetModuleHandle ("ws2_32.dll");
+
+  if (h)
+    {
+      getaddrinfo_ptr = (getaddrinfo_func) GetProcAddress (h, "getaddrinfo");
+      freeaddrinfo_ptr = (freeaddrinfo_func) GetProcAddress (h, "freeaddrinfo");
+      getnameinfo_ptr = (getnameinfo_func) GetProcAddress (h, "getnameinfo");
+    }
+
+  /* If either is missing, something is odd. */
+  if (!getaddrinfo_ptr || !freeaddrinfo_ptr || !getnameinfo_ptr)
+    {
+      getaddrinfo_ptr = NULL;
+      freeaddrinfo_ptr = NULL;
+      getnameinfo_ptr = NULL;
+      return 0;
+    }
+
+  return 1;
+}
+#endif
+
+static inline bool
+validate_family (int family)
+{
+  /* FIXME: Support more families. */
+#if HAVE_IPV4
+     if (family == PF_INET)
+       return true;
+#endif
+#if HAVE_IPV6
+     if (family == PF_INET6)
+       return true;
+#endif
+     if (family == PF_UNSPEC)
+       return true;
+     return false;
+}
+
+/* Translate name of a service location and/or a service name to set of
+   socket addresses. */
+int
+getaddrinfo (const char *restrict nodename,
+            const char *restrict servname,
+            const struct addrinfo *restrict hints,
+            struct addrinfo **restrict res)
+{
+  struct addrinfo *tmp;
+  int port = 0;
+  struct hostent *he;
+  void *storage;
+  size_t size;
+#if HAVE_IPV6
+  struct v6_pair {
+    struct addrinfo addrinfo;
+    struct sockaddr_in6 sockaddr_in6;
+  };
+#endif
+#if HAVE_IPV4
+  struct v4_pair {
+    struct addrinfo addrinfo;
+    struct sockaddr_in sockaddr_in;
+  };
+#endif
+
+#ifdef WIN32_NATIVE
+  if (use_win32_p ())
+    return getaddrinfo_ptr (nodename, servname, hints, res);
+#endif
+
+  if (hints && (hints->ai_flags & ~(AI_CANONNAME | AI_PASSIVE)))
+    /* FIXME: Support more flags. */
+    return EAI_BADFLAGS;
+
+  if (hints && !validate_family (hints->ai_family))
+    return EAI_FAMILY;
+
+  if ((hints != NULL) &&
+      (hints->ai_socktype != 0) &&
+      (hints->ai_socktype != SOCK_STREAM) &&
+      (hints->ai_socktype != SOCK_DGRAM))
+    {
+      /* FIXME: Support other socktype. */
+      return EAI_SOCKTYPE; /* FIXME: Better return code? */
+    }
+
+  if (!nodename)
+    {
+      if (hints && !(hints->ai_flags & AI_PASSIVE))
+       return EAI_NONAME;
+
+#ifdef HAVE_IPV6
+      nodename = (hints && (hints->ai_family == AF_INET6)) ? "::" : "0.0.0.0";
+#else
+      nodename = "0.0.0.0";
+#endif
+    }
+
+  if (servname)
+    {
+      struct servent *se = NULL;
+      const char *proto =
+       (hints && (hints->ai_socktype == SOCK_DGRAM)) ? "udp" : "tcp";
+
+      if ((hints == NULL) || !(hints->ai_flags & AI_NUMERICSERV))
+        {
+         /* FIXME: Use getservbyname_r if available. */
+         se = getservbyname (servname, proto);
+        }
+
+      if (!se)
+       {
+         char *c;
+         if (!(*servname >= '0' && *servname <= '9'))
+           return EAI_NONAME;
+         port = strtoul (servname, &c, 10);
+         if (*c || port > 0xffff)
+           return EAI_NONAME;
+         port = htons (port);
+       }
+      else
+       port = se->s_port;
+    }
+
+  /* FIXME: Use gethostbyname_r if available. */
+  he = gethostbyname(nodename);
+  if (!he || he->h_addr_list[0] == NULL)
+    return EAI_NONAME;
+
+  switch (he->h_addrtype)
+    {
+#if HAVE_IPV6
+    case PF_INET6:
+      size = sizeof (struct v6_pair);
+      break;
+#endif
+
+#if HAVE_IPV4
+    case PF_INET:
+      size = sizeof (struct v4_pair);
+      break;
+#endif
+
+    default:
+      return EAI_NODATA;
+    }
+
+  storage = calloc (1, size);
+  if (!storage)
+    return EAI_MEMORY;
+
+  switch (he->h_addrtype)
+    {
+#if HAVE_IPV6
+    case PF_INET6:
+      {
+       struct v6_pair *p = storage;
+       struct sockaddr_in6 *sinp = &p->sockaddr_in6;
+       tmp = &p->addrinfo;
+
+       if (port)
+         sinp->sin6_port = port;
+
+       if (he->h_length != sizeof (sinp->sin6_addr))
+         {
+           free (storage);
+           return EAI_SYSTEM; /* FIXME: Better return code?  Set errno? */
+         }
+
+       memcpy (&sinp->sin6_addr, he->h_addr_list[0], sizeof sinp->sin6_addr);
+
+       tmp->ai_addr = (struct sockaddr *) sinp;
+       tmp->ai_addrlen = sizeof *sinp;
+      }
+      break;
+#endif
+
+#if HAVE_IPV4
+    case PF_INET:
+      {
+       struct v4_pair *p = storage;
+       struct sockaddr_in *sinp = &p->sockaddr_in;
+       tmp = &p->addrinfo;
+
+       if (port)
+         sinp->sin_port = port;
+
+       if (he->h_length != sizeof (sinp->sin_addr))
+         {
+           free (storage);
+           return EAI_SYSTEM; /* FIXME: Better return code?  Set errno? */
+         }
+
+       memcpy (&sinp->sin_addr, he->h_addr_list[0], sizeof sinp->sin_addr);
+
+       tmp->ai_addr = (struct sockaddr *) sinp;
+       tmp->ai_addrlen = sizeof *sinp;
+      }
+      break;
+#endif
+
+    default:
+      free (storage);
+      return EAI_NODATA;
+    }
+
+  if (hints && (hints->ai_flags & AI_CANONNAME))
+    {
+      const char *cn;
+      if (he->h_name)
+       cn = he->h_name;
+      else
+       cn = nodename;
+
+      tmp->ai_canonname = strdup (cn);
+      if (!tmp->ai_canonname)
+       {
+         free (storage);
+         return EAI_MEMORY;
+       }
+    }
+
+  tmp->ai_protocol = (hints) ? hints->ai_protocol : 0;
+  tmp->ai_socktype = (hints) ? hints->ai_socktype : 0;
+  tmp->ai_addr->sa_family = he->h_addrtype;
+  tmp->ai_family = he->h_addrtype;
+
+  /* FIXME: If more than one address, create linked list of addrinfo's. */
+
+  *res = tmp;
+
+  return 0;
+}
+
+/* Free `addrinfo' structure AI including associated storage.  */
+void
+freeaddrinfo (struct addrinfo *ai)
+{
+#ifdef WIN32_NATIVE
+  if (use_win32_p ())
+    {
+      freeaddrinfo_ptr (ai);
+      return;
+    }
+#endif
+
+  while (ai)
+    {
+      struct addrinfo *cur;
+
+      cur = ai;
+      ai = ai->ai_next;
+
+      if (cur->ai_canonname) free (cur->ai_canonname);
+      free (cur);
+    }
+}
+
+int getnameinfo(const struct sockaddr *restrict sa, socklen_t salen,
+               char *restrict node, socklen_t nodelen,
+               char *restrict service, socklen_t servicelen,
+               int flags)
+{
+#ifdef WIN32_NATIVE
+  if (use_win32_p ())
+    return getnameinfo_ptr (sa, salen, node, nodelen,
+                           service, servicelen, flags);
+#endif
+
+  /* FIXME: Support other flags. */
+  if (flags & ~(NI_NUMERICHOST | NI_NUMERICSERV))
+    return EAI_BADFLAGS;
+
+  if (sa == NULL || salen < sizeof (sa->sa_family))
+    return EAI_FAMILY;
+
+  switch (sa->sa_family)
+    {
+#if HAVE_IPV4
+    case AF_INET:
+      if (salen < sizeof (struct sockaddr_in))
+       return EAI_FAMILY;
+      break;
+#endif
+#if HAVE_IPV6
+    case AF_INET6:
+      if (salen < sizeof (struct sockaddr_in6))
+       return EAI_FAMILY;
+      break;
+#endif
+    default:
+      return EAI_FAMILY;
+    }
+
+  if (node && (nodelen > 0))
+    {
+      char     addrbuf[256];
+
+      switch (sa->sa_family)
+       {
+#if HAVE_IPV4
+       case AF_INET:
+         if (flags & NI_NUMERICHOST)
+           {
+             if (!inet_ntop (AF_INET,
+                         &(((const struct sockaddr_in *) sa)->sin_addr),
+                         addrbuf, sizeof(addrbuf)))
+             return EAI_SYSTEM;
+           }
+         else
+           {
+             struct hostent *host_ent = gethostbyaddr(
+                         (char *)&(((struct sockaddr_in *)sa)->sin_addr),
+                         sizeof(struct sockaddr_in),
+                         sa->sa_family);
+             if (host_ent != NULL)
+               {
+                 if (nodelen <= snprintf(node, nodelen, "%s",
+                                       host_ent->h_name))
+                    return EAI_OVERFLOW;
+               }
+             else
+               {
+                 if (!inet_ntop (AF_INET,
+                         &(((const struct sockaddr_in *) sa)->sin_addr),
+                         addrbuf, sizeof(addrbuf)))
+                   { 
+                     return EAI_SYSTEM;
+                   }
+                   if (nodelen <= snprintf(node, nodelen, "%s", addrbuf))
+                     return EAI_OVERFLOW;
+               }
+           }
+         break;
+#endif
+
+#if HAVE_IPV6
+       case AF_INET6:
+         if (flags & NI_NUMERICHOST)
+           {
+             if (!inet_ntop (AF_INET6,
+                         &(((const struct sockaddr_in6 *) sa)->sin6_addr),
+                         addrbuf, sizeof(addrbuf)))
+             return EAI_SYSTEM;
+           }
+         else
+           {
+             struct hostent *host_ent = gethostbyaddr(
+                         (char *)&(((struct sockaddr_in6 *)sa)->sin6_addr),
+                         sizeof(struct sockaddr_in6),
+                         sa->sa_family);
+             if (host_ent != NULL)
+               {
+                 if (nodelen <= snprintf(node, nodelen, "%s",
+                                       host_ent->h_name))
+                    return EAI_OVERFLOW;
+               }
+             else
+               {
+                 if (!inet_ntop (AF_INET6,
+                         &(((const struct sockaddr_in6 *) sa)->sin6_addr),
+                         addrbuf, sizeof(addrbuf)))
+                   { 
+                     return EAI_SYSTEM;
+                   }
+                   if (nodelen <= snprintf(node, nodelen, "%s", addrbuf))
+                     return EAI_OVERFLOW;
+               }
+           }
+         break;
+#endif
+       default:
+         return EAI_FAMILY;
+       }
+    }
+
+  if (service && (servicelen > 0))
+    switch (sa->sa_family)
+      {
+#if HAVE_IPV4
+      case AF_INET:
+#endif
+#if HAVE_IPV6
+      case AF_INET6:
+#endif
+       {
+         unsigned short int port
+           = ntohs (((const struct sockaddr_in *) sa)->sin_port);
+         if (servicelen <= snprintf (service, servicelen, "%u", port))
+           return EAI_OVERFLOW;
+       }
+       break;
+      }
+
+  return 0;
+}
diff --git a/gnulib/getaddrinfo.h b/gnulib/getaddrinfo.h
new file mode 100644 (file)
index 0000000..b4ef242
--- /dev/null
@@ -0,0 +1,155 @@
+/* Get address information.
+   Copyright (C) 1996-2002, 2003, 2004, 2005, 2006
+                 Free Software Foundation, Inc.
+   Contributed by Simon Josefsson <simon@josefsson.org>.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#ifndef GETADDRINFO_H
+#define GETADDRINFO_H
+
+/* sys/socket.h in i386-unknown-freebsd4.10 and
+   powerpc-apple-darwin5.5 require sys/types.h, so include it first.
+   Then we'll also get 'socklen_t' and 'struct sockaddr' which are
+   used below. */
+#include <sys/types.h>
+/* Get all getaddrinfo related declarations, if available.  */
+#include <sys/socket.h>
+#ifdef HAVE_NETDB_H
+# include <netdb.h>
+#endif
+
+#ifndef HAVE_STRUCT_ADDRINFO
+
+/* Structure to contain information about address of a service provider.  */
+struct addrinfo
+{
+  int ai_flags;                        /* Input flags.  */
+  int ai_family;               /* Protocol family for socket.  */
+  int ai_socktype;             /* Socket type.  */
+  int ai_protocol;             /* Protocol for socket.  */
+  socklen_t ai_addrlen;                /* Length of socket address.  */
+  struct sockaddr *ai_addr;    /* Socket address for socket.  */
+  char *ai_canonname;          /* Canonical name for service location.  */
+  struct addrinfo *ai_next;    /* Pointer to next in list.  */
+};
+#endif
+
+/* Possible values for `ai_flags' field in `addrinfo' structure.  */
+#ifndef AI_PASSIVE
+# define AI_PASSIVE    0x0001  /* Socket address is intended for `bind'.  */
+#endif
+#ifndef AI_CANONNAME
+# define AI_CANONNAME  0x0002  /* Request for canonical name.  */
+#endif
+#ifndef AI_NUMERICSERV
+# define AI_NUMERICSERV        0x0400  /* Don't use name resolution.  */
+#endif
+
+#if 0
+/* The commented out definitions below are not yet implemented in the
+   GNULIB getaddrinfo() replacement, so are not yet needed and may, in fact,
+   cause conflicts on systems with a getaddrinfo() function which does not
+   define them.
+
+   If they are restored, be sure to protect the definitions with #ifndef.  */
+#define AI_NUMERICHOST 0x0004  /* Don't use name resolution.  */
+#define AI_V4MAPPED    0x0008  /* IPv4 mapped addresses are acceptable.  */
+#define AI_ALL         0x0010  /* Return IPv4 mapped and IPv6 addresses.  */
+#define AI_ADDRCONFIG  0x0020  /* Use configuration of this host to choose
+                                  returned address type..  */
+#endif /* 0 */
+
+/* Error values for `getaddrinfo' function.  */
+#ifndef EAI_BADFLAGS
+# define EAI_BADFLAGS    -1    /* Invalid value for `ai_flags' field.  */
+# define EAI_NONAME      -2    /* NAME or SERVICE is unknown.  */
+# define EAI_AGAIN       -3    /* Temporary failure in name resolution.  */
+# define EAI_FAIL        -4    /* Non-recoverable failure in name res.  */
+# define EAI_NODATA      -5    /* No address associated with NAME.  */
+# define EAI_FAMILY      -6    /* `ai_family' not supported.  */
+# define EAI_SOCKTYPE    -7    /* `ai_socktype' not supported.  */
+# define EAI_SERVICE     -8    /* SERVICE not supported for `ai_socktype'.  */
+# define EAI_MEMORY      -10   /* Memory allocation failure.  */
+#endif
+#ifndef EAI_OVERFLOW
+/* Not defined on mingw32. */
+# define EAI_OVERFLOW    -12   /* Argument buffer overflow.  */
+#endif
+#ifndef EAI_ADDRFAMILY
+/* Not defined on mingw32. */
+# define EAI_ADDRFAMILY  -9    /* Address family for NAME not supported.  */
+#endif
+#ifndef EAI_SYSTEM
+/* Not defined on mingw32. */
+# define EAI_SYSTEM      -11   /* System error returned in `errno'.  */
+#endif
+
+#ifdef __USE_GNU
+# ifndef EAI_INPROGRESS
+#  define EAI_INPROGRESS       -100    /* Processing request in progress.  */
+#  define EAI_CANCELED         -101    /* Request canceled.  */
+#  define EAI_NOTCANCELED      -102    /* Request not canceled.  */
+#  define EAI_ALLDONE          -103    /* All requests done.  */
+#  define EAI_INTR             -104    /* Interrupted by a signal.  */
+#  define EAI_IDN_ENCODE       -105    /* IDN encoding failed.  */
+# endif
+#endif
+
+#if !HAVE_DECL_GETADDRINFO
+/* Translate name of a service location and/or a service name to set of
+   socket addresses.
+   For more details, see the POSIX:2001 specification
+   <http://www.opengroup.org/susv3xsh/getaddrinfo.html>.  */
+extern int getaddrinfo (const char *restrict nodename,
+                       const char *restrict servname,
+                       const struct addrinfo *restrict hints,
+                       struct addrinfo **restrict res);
+#endif
+
+#if !HAVE_DECL_FREEADDRINFO
+/* Free `addrinfo' structure AI including associated storage.
+   For more details, see the POSIX:2001 specification
+   <http://www.opengroup.org/susv3xsh/getaddrinfo.html>.  */
+extern void freeaddrinfo (struct addrinfo *ai);
+#endif
+
+#if !HAVE_DECL_GAI_STRERROR
+/* Convert error return from getaddrinfo() to a string.
+   For more details, see the POSIX:2001 specification
+   <http://www.opengroup.org/susv3xsh/gai_strerror.html>.  */
+extern const char *gai_strerror (int ecode);
+#endif
+
+#if !HAVE_DECL_GETNAMEINFO
+/* Convert socket address to printable node and service names.
+   For more details, see the POSIX:2001 specification
+   <http://www.opengroup.org/susv3xsh/getnameinfo.html>.  */
+extern int getnameinfo(const struct sockaddr *restrict sa, socklen_t salen,
+                      char *restrict node, socklen_t nodelen,
+                      char *restrict service, socklen_t servicelen,
+                      int flags);
+
+#endif
+
+/* Possible flags for getnameinfo.  */
+#ifndef NI_NUMERICHOST
+# define NI_NUMERICHOST 1
+#endif
+#ifndef NI_NUMERICSERV
+# define NI_NUMERICSERV 2
+#endif
+
+#endif /* GETADDRINFO_H */
diff --git a/gnulib/gettext.h b/gnulib/gettext.h
new file mode 100644 (file)
index 0000000..9d76ec9
--- /dev/null
@@ -0,0 +1,270 @@
+/* Convenience header for conditional use of GNU <libintl.h>.
+   Copyright (C) 1995-1998, 2000-2002, 2004-2006 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License along
+   with this program; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#ifndef _LIBGETTEXT_H
+#define _LIBGETTEXT_H 1
+
+/* NLS can be disabled through the configure --disable-nls option.  */
+#if ENABLE_NLS
+
+/* Get declarations of GNU message catalog functions.  */
+# include <libintl.h>
+
+/* You can set the DEFAULT_TEXT_DOMAIN macro to specify the domain used by
+   the gettext() and ngettext() macros.  This is an alternative to calling
+   textdomain(), and is useful for libraries.  */
+# ifdef DEFAULT_TEXT_DOMAIN
+#  undef gettext
+#  define gettext(Msgid) \
+     dgettext (DEFAULT_TEXT_DOMAIN, Msgid)
+#  undef ngettext
+#  define ngettext(Msgid1, Msgid2, N) \
+     dngettext (DEFAULT_TEXT_DOMAIN, Msgid1, Msgid2, N)
+# endif
+
+#else
+
+/* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which
+   chokes if dcgettext is defined as a macro.  So include it now, to make
+   later inclusions of <locale.h> a NOP.  We don't include <libintl.h>
+   as well because people using "gettext.h" will not include <libintl.h>,
+   and also including <libintl.h> would fail on SunOS 4, whereas <locale.h>
+   is OK.  */
+#if defined(__sun)
+# include <locale.h>
+#endif
+
+/* Many header files from the libstdc++ coming with g++ 3.3 or newer include
+   <libintl.h>, which chokes if dcgettext is defined as a macro.  So include
+   it now, to make later inclusions of <libintl.h> a NOP.  */
+#if defined(__cplusplus) && defined(__GNUG__) && (__GNUC__ >= 3)
+# include <cstdlib>
+# if (__GLIBC__ >= 2) || _GLIBCXX_HAVE_LIBINTL_H
+#  include <libintl.h>
+# endif
+#endif
+
+/* Disabled NLS.
+   The casts to 'const char *' serve the purpose of producing warnings
+   for invalid uses of the value returned from these functions.
+   On pre-ANSI systems without 'const', the config.h file is supposed to
+   contain "#define const".  */
+# define gettext(Msgid) ((const char *) (Msgid))
+# define dgettext(Domainname, Msgid) ((void) (Domainname), gettext (Msgid))
+# define dcgettext(Domainname, Msgid, Category) \
+    ((void) (Category), dgettext (Domainname, Msgid))
+# define ngettext(Msgid1, Msgid2, N) \
+    ((N) == 1 \
+     ? ((void) (Msgid2), (const char *) (Msgid1)) \
+     : ((void) (Msgid1), (const char *) (Msgid2)))
+# define dngettext(Domainname, Msgid1, Msgid2, N) \
+    ((void) (Domainname), ngettext (Msgid1, Msgid2, N))
+# define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \
+    ((void) (Category), dngettext(Domainname, Msgid1, Msgid2, N))
+# define textdomain(Domainname) ((const char *) (Domainname))
+# define bindtextdomain(Domainname, Dirname) \
+    ((void) (Domainname), (const char *) (Dirname))
+# define bind_textdomain_codeset(Domainname, Codeset) \
+    ((void) (Domainname), (const char *) (Codeset))
+
+#endif
+
+/* A pseudo function call that serves as a marker for the automated
+   extraction of messages, but does not call gettext().  The run-time
+   translation is done at a different place in the code.
+   The argument, String, should be a literal string.  Concatenated strings
+   and other string expressions won't work.
+   The macro's expansion is not parenthesized, so that it is suitable as
+   initializer for static 'char[]' or 'const char[]' variables.  */
+#define gettext_noop(String) String
+
+/* The separator between msgctxt and msgid in a .mo file.  */
+#define GETTEXT_CONTEXT_GLUE "\004"
+
+/* Pseudo function calls, taking a MSGCTXT and a MSGID instead of just a
+   MSGID.  MSGCTXT and MSGID must be string literals.  MSGCTXT should be
+   short and rarely need to change.
+   The letter 'p' stands for 'particular' or 'special'.  */
+#ifdef DEFAULT_TEXT_DOMAIN
+# define pgettext(Msgctxt, Msgid) \
+   pgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
+#else
+# define pgettext(Msgctxt, Msgid) \
+   pgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
+#endif
+#define dpgettext(Domainname, Msgctxt, Msgid) \
+  pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, LC_MESSAGES)
+#define dcpgettext(Domainname, Msgctxt, Msgid, Category) \
+  pgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, Category)
+#ifdef DEFAULT_TEXT_DOMAIN
+# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
+   npgettext_aux (DEFAULT_TEXT_DOMAIN, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
+#else
+# define npgettext(Msgctxt, Msgid, MsgidPlural, N) \
+   npgettext_aux (NULL, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
+#endif
+#define dnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N) \
+  npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, LC_MESSAGES)
+#define dcnpgettext(Domainname, Msgctxt, Msgid, MsgidPlural, N, Category) \
+  npgettext_aux (Domainname, Msgctxt GETTEXT_CONTEXT_GLUE Msgid, Msgid, MsgidPlural, N, Category)
+
+#ifdef __GNUC__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+static const char *
+pgettext_aux (const char *domain,
+             const char *msg_ctxt_id, const char *msgid,
+             int category)
+{
+  const char *translation = dcgettext (domain, msg_ctxt_id, category);
+  if (translation == msg_ctxt_id)
+    return msgid;
+  else
+    return translation;
+}
+
+#ifdef __GNUC__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+static const char *
+npgettext_aux (const char *domain,
+              const char *msg_ctxt_id, const char *msgid,
+              const char *msgid_plural, unsigned long int n,
+              int category)
+{
+  const char *translation =
+    dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
+  if (translation == msg_ctxt_id || translation == msgid_plural)
+    return (n == 1 ? msgid : msgid_plural);
+  else
+    return translation;
+}
+
+/* The same thing extended for non-constant arguments.  Here MSGCTXT and MSGID
+   can be arbitrary expressions.  But for string literals these macros are
+   less efficient than those above.  */
+
+#include <string.h>
+
+#define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS \
+  (((__GNUC__ >= 3 || __GNUG__ >= 2) && !__STRICT_ANSI__) \
+   /* || __STDC_VERSION__ >= 199901L */ )
+
+#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
+#include <stdlib.h>
+#endif
+
+#define pgettext_expr(Msgctxt, Msgid) \
+  dcpgettext_expr (NULL, Msgctxt, Msgid, LC_MESSAGES)
+#define dpgettext_expr(Domainname, Msgctxt, Msgid) \
+  dcpgettext_expr (Domainname, Msgctxt, Msgid, LC_MESSAGES)
+
+#ifdef __GNUC__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+static const char *
+dcpgettext_expr (const char *domain,
+                const char *msgctxt, const char *msgid,
+                int category)
+{
+  size_t msgctxt_len = strlen (msgctxt) + 1;
+  size_t msgid_len = strlen (msgid) + 1;
+  const char *translation;
+#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
+  char msg_ctxt_id[msgctxt_len + msgid_len];
+#else
+  char buf[1024];
+  char *msg_ctxt_id =
+    (msgctxt_len + msgid_len <= sizeof (buf)
+     ? buf
+     : (char *) malloc (msgctxt_len + msgid_len));
+  if (msg_ctxt_id != NULL)
+#endif
+    {
+      memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
+      msg_ctxt_id[msgctxt_len - 1] = '\004';
+      memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
+      translation = dcgettext (domain, msg_ctxt_id, category);
+#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
+      if (msg_ctxt_id != buf)
+       free (msg_ctxt_id);
+#endif
+      if (translation != msg_ctxt_id)
+       return translation;
+    }
+  return msgid;
+}
+
+#define npgettext_expr(Msgctxt, Msgid, MsgidPlural, N) \
+  dcnpgettext_expr (NULL, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES)
+#define dnpgettext_expr(Domainname, Msgctxt, Msgid, MsgidPlural, N) \
+  dcnpgettext_expr (Domainname, Msgctxt, Msgid, MsgidPlural, N, LC_MESSAGES)
+
+#ifdef __GNUC__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+static const char *
+dcnpgettext_expr (const char *domain,
+                 const char *msgctxt, const char *msgid,
+                 const char *msgid_plural, unsigned long int n,
+                 int category)
+{
+  size_t msgctxt_len = strlen (msgctxt) + 1;
+  size_t msgid_len = strlen (msgid) + 1;
+  const char *translation;
+#if _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
+  char msg_ctxt_id[msgctxt_len + msgid_len];
+#else
+  char buf[1024];
+  char *msg_ctxt_id =
+    (msgctxt_len + msgid_len <= sizeof (buf)
+     ? buf
+     : (char *) malloc (msgctxt_len + msgid_len));
+  if (msg_ctxt_id != NULL)
+#endif
+    {
+      memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
+      msg_ctxt_id[msgctxt_len - 1] = '\004';
+      memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
+      translation = dcngettext (domain, msg_ctxt_id, msgid_plural, n, category);
+#if !_LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS
+      if (msg_ctxt_id != buf)
+       free (msg_ctxt_id);
+#endif
+      if (!(translation == msg_ctxt_id || translation == msgid_plural))
+       return translation;
+    }
+  return (n == 1 ? msgid : msgid_plural);
+}
+
+#endif /* _LIBGETTEXT_H */
diff --git a/gnulib/inet_ntop.c b/gnulib/inet_ntop.c
new file mode 100644 (file)
index 0000000..537b59f
--- /dev/null
@@ -0,0 +1,238 @@
+/* inet_ntop.c -- convert IPv4 and IPv6 addresses from binary to text form
+
+   Copyright (C) 2005, 2006  Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+/*
+ * Copyright (c) 1996-1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
+ * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
+ * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, 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.
+ */
+
+#include <config.h>
+
+/* Specification.  */
+#include "inet_ntop.h"
+
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+
+#ifndef EAFNOSUPPORT
+# define EAFNOSUPPORT EINVAL
+#endif
+
+#define NS_IN6ADDRSZ 16
+#define NS_INT16SZ 2
+
+/*
+ * WARNING: Don't even consider trying to compile this on a system where
+ * sizeof(int) < 4.  sizeof(int) > 4 is fine; all the world's not a VAX.
+ */
+typedef int verify_int_size[2 * sizeof (int) - 7];
+
+static const char *inet_ntop4 (const unsigned char *src, char *dst, socklen_t size);
+#if HAVE_IPV6
+static const char *inet_ntop6 (const unsigned char *src, char *dst, socklen_t size);
+#endif
+
+
+/* char *
+ * inet_ntop(af, src, dst, size)
+ *     convert a network format address to presentation format.
+ * return:
+ *     pointer to presentation format address (`dst'), or NULL (see errno).
+ * author:
+ *     Paul Vixie, 1996.
+ */
+const char *
+inet_ntop (int af, const void *restrict src,
+          char *restrict dst, socklen_t cnt)
+{
+  switch (af)
+    {
+#if HAVE_IPV4
+    case AF_INET:
+      return (inet_ntop4 (src, dst, cnt));
+#endif
+
+#if HAVE_IPV6
+    case AF_INET6:
+      return (inet_ntop6 (src, dst, cnt));
+#endif
+
+    default:
+      errno = EAFNOSUPPORT;
+      return (NULL);
+    }
+  /* NOTREACHED */
+}
+
+/* const char *
+ * inet_ntop4(src, dst, size)
+ *     format an IPv4 address
+ * return:
+ *     `dst' (as a const)
+ * notes:
+ *     (1) uses no statics
+ *     (2) takes a u_char* not an in_addr as input
+ * author:
+ *     Paul Vixie, 1996.
+ */
+static const char *
+inet_ntop4 (const unsigned char *src, char *dst, socklen_t size)
+{
+  char tmp[sizeof "255.255.255.255"];
+  int len;
+
+  len = sprintf (tmp, "%u.%u.%u.%u", src[0], src[1], src[2], src[3]);
+  if (len < 0)
+    return NULL;
+
+  if (len > size)
+    {
+      errno = ENOSPC;
+      return NULL;
+    }
+
+  return strcpy (dst, tmp);
+}
+
+#if HAVE_IPV6
+
+/* const char *
+ * inet_ntop6(src, dst, size)
+ *     convert IPv6 binary address into presentation (printable) format
+ * author:
+ *     Paul Vixie, 1996.
+ */
+static const char *
+inet_ntop6 (const unsigned char *src, char *dst, socklen_t size)
+{
+  /*
+   * Note that int32_t and int16_t need only be "at least" large enough
+   * to contain a value of the specified size.  On some systems, like
+   * Crays, there is no such thing as an integer variable with 16 bits.
+   * Keep this in mind if you think this function should have been coded
+   * to use pointer overlays.  All the world's not a VAX.
+   */
+  char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"], *tp;
+  struct
+  {
+    int base, len;
+  } best, cur;
+  unsigned int words[NS_IN6ADDRSZ / NS_INT16SZ];
+  int i;
+
+  /*
+   * Preprocess:
+   *      Copy the input (bytewise) array into a wordwise array.
+   *      Find the longest run of 0x00's in src[] for :: shorthanding.
+   */
+  memset (words, '\0', sizeof words);
+  for (i = 0; i < NS_IN6ADDRSZ; i += 2)
+    words[i / 2] = (src[i] << 8) | src[i + 1];
+  best.base = -1;
+  cur.base = -1;
+  for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++)
+    {
+      if (words[i] == 0)
+       {
+         if (cur.base == -1)
+           cur.base = i, cur.len = 1;
+         else
+           cur.len++;
+       }
+      else
+       {
+         if (cur.base != -1)
+           {
+             if (best.base == -1 || cur.len > best.len)
+               best = cur;
+             cur.base = -1;
+           }
+       }
+    }
+  if (cur.base != -1)
+    {
+      if (best.base == -1 || cur.len > best.len)
+       best = cur;
+    }
+  if (best.base != -1 && best.len < 2)
+    best.base = -1;
+
+  /*
+   * Format the result.
+   */
+  tp = tmp;
+  for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++)
+    {
+      /* Are we inside the best run of 0x00's? */
+      if (best.base != -1 && i >= best.base && i < (best.base + best.len))
+       {
+         if (i == best.base)
+           *tp++ = ':';
+         continue;
+       }
+      /* Are we following an initial run of 0x00s or any real hex? */
+      if (i != 0)
+       *tp++ = ':';
+      /* Is this address an encapsulated IPv4? */
+      if (i == 6 && best.base == 0 &&
+         (best.len == 6 || (best.len == 5 && words[5] == 0xffff)))
+       {
+         if (!inet_ntop4 (src + 12, tp, sizeof tmp - (tp - tmp)))
+           return (NULL);
+         tp += strlen (tp);
+         break;
+       }
+      {
+       int len = sprintf (tp, "%x", words[i]);
+       if (len < 0)
+         return NULL;
+       tp += len;
+      }
+    }
+  /* Was it a trailing run of 0x00's? */
+  if (best.base != -1 && (best.base + best.len) ==
+      (NS_IN6ADDRSZ / NS_INT16SZ))
+    *tp++ = ':';
+  *tp++ = '\0';
+
+  /*
+   * Check for overflow, copy, and we're done.
+   */
+  if ((socklen_t) (tp - tmp) > size)
+    {
+      errno = ENOSPC;
+      return NULL;
+    }
+
+  return strcpy (dst, tmp);
+}
+
+#endif
diff --git a/gnulib/inet_ntop.h b/gnulib/inet_ntop.h
new file mode 100644 (file)
index 0000000..bd1e085
--- /dev/null
@@ -0,0 +1,42 @@
+/* Convert internet address from internal to printable, presentable format.
+   Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+
+/* Converts an internet address from internal format to a printable,
+   presentable format.
+   AF is an internet address family, such as AF_INET or AF_INET6.
+   SRC points to a 'struct in_addr' (for AF_INET) or 'struct in6_addr'
+   (for AF_INET6).
+   DST points to a buffer having room for CNT bytes.
+   The printable representation of the address (in numeric form, not
+   surrounded by [...], no reverse DNS is done) is placed in DST, and
+   DST is returned.  If an error occurs, the return value is NULL and
+   errno is set.  If CNT bytes are not sufficient to hold the result,
+   the return value is NULL and errno is set to ENOSPC.  A good value
+   for CNT is 46.
+
+   For more details, see the POSIX:2001 specification
+   <http://www.opengroup.org/susv3xsh/inet_ntop.html>.  */
+
+#if !HAVE_DECL_INET_NTOP
+extern const char *inet_ntop (int af, const void *restrict src,
+                             char *restrict dst, socklen_t cnt);
+#endif
diff --git a/gnulib/lock.c b/gnulib/lock.c
new file mode 100644 (file)
index 0000000..34a59ab
--- /dev/null
@@ -0,0 +1,921 @@
+/* Locking in multithreaded situations.
+   Copyright (C) 2005-2006 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2005.
+   Based on GCC's gthr-posix.h, gthr-posix95.h, gthr-solaris.h,
+   gthr-win32.h.  */
+
+#include <config.h>
+
+#include "lock.h"
+
+/* ========================================================================= */
+
+#if USE_POSIX_THREADS
+
+/* Use the POSIX threads library.  */
+
+# if PTHREAD_IN_USE_DETECTION_HARD
+
+/* The function to be executed by a dummy thread.  */
+static void *
+dummy_thread_func (void *arg)
+{
+  return arg;
+}
+
+int
+glthread_in_use (void)
+{
+  static int tested;
+  static int result; /* 1: linked with -lpthread, 0: only with libc */
+
+  if (!tested)
+    {
+      pthread_t thread;
+
+      if (pthread_create (&thread, NULL, dummy_thread_func, NULL) != 0)
+       /* Thread creation failed.  */
+       result = 0;
+      else
+       {
+         /* Thread creation works.  */
+         void *retval;
+         if (pthread_join (thread, &retval) != 0)
+           abort ();
+         result = 1;
+       }
+      tested = 1;
+    }
+  return result;
+}
+
+# endif
+
+/* -------------------------- gl_lock_t datatype -------------------------- */
+
+/* ------------------------- gl_rwlock_t datatype ------------------------- */
+
+# if HAVE_PTHREAD_RWLOCK
+
+#  if !defined PTHREAD_RWLOCK_INITIALIZER
+
+void
+glthread_rwlock_init (gl_rwlock_t *lock)
+{
+  if (pthread_rwlock_init (&lock->rwlock, NULL) != 0)
+    abort ();
+  lock->initialized = 1;
+}
+
+void
+glthread_rwlock_rdlock (gl_rwlock_t *lock)
+{
+  if (!lock->initialized)
+    {
+      if (pthread_mutex_lock (&lock->guard) != 0)
+       abort ();
+      if (!lock->initialized)
+       glthread_rwlock_init (lock);
+      if (pthread_mutex_unlock (&lock->guard) != 0)
+       abort ();
+    }
+  if (pthread_rwlock_rdlock (&lock->rwlock) != 0)
+    abort ();
+}
+
+void
+glthread_rwlock_wrlock (gl_rwlock_t *lock)
+{
+  if (!lock->initialized)
+    {
+      if (pthread_mutex_lock (&lock->guard) != 0)
+       abort ();
+      if (!lock->initialized)
+       glthread_rwlock_init (lock);
+      if (pthread_mutex_unlock (&lock->guard) != 0)
+       abort ();
+    }
+  if (pthread_rwlock_wrlock (&lock->rwlock) != 0)
+    abort ();
+}
+
+void
+glthread_rwlock_unlock (gl_rwlock_t *lock)
+{
+  if (!lock->initialized)
+    abort ();
+  if (pthread_rwlock_unlock (&lock->rwlock) != 0)
+    abort ();
+}
+
+void
+glthread_rwlock_destroy (gl_rwlock_t *lock)
+{
+  if (!lock->initialized)
+    abort ();
+  if (pthread_rwlock_destroy (&lock->rwlock) != 0)
+    abort ();
+  lock->initialized = 0;
+}
+
+#  endif
+
+# else
+
+void
+glthread_rwlock_init (gl_rwlock_t *lock)
+{
+  if (pthread_mutex_init (&lock->lock, NULL) != 0)
+    abort ();
+  if (pthread_cond_init (&lock->waiting_readers, NULL) != 0)
+    abort ();
+  if (pthread_cond_init (&lock->waiting_writers, NULL) != 0)
+    abort ();
+  lock->waiting_writers_count = 0;
+  lock->runcount = 0;
+}
+
+void
+glthread_rwlock_rdlock (gl_rwlock_t *lock)
+{
+  if (pthread_mutex_lock (&lock->lock) != 0)
+    abort ();
+  /* Test whether only readers are currently running, and whether the runcount
+     field will not overflow.  */
+  /* POSIX says: "It is implementation-defined whether the calling thread
+     acquires the lock when a writer does not hold the lock and there are
+     writers blocked on the lock."  Let's say, no: give the writers a higher
+     priority.  */
+  while (!(lock->runcount + 1 > 0 && lock->waiting_writers_count == 0))
+    {
+      /* This thread has to wait for a while.  Enqueue it among the
+        waiting_readers.  */
+      if (pthread_cond_wait (&lock->waiting_readers, &lock->lock) != 0)
+       abort ();
+    }
+  lock->runcount++;
+  if (pthread_mutex_unlock (&lock->lock) != 0)
+    abort ();
+}
+
+void
+glthread_rwlock_wrlock (gl_rwlock_t *lock)
+{
+  if (pthread_mutex_lock (&lock->lock) != 0)
+    abort ();
+  /* Test whether no readers or writers are currently running.  */
+  while (!(lock->runcount == 0))
+    {
+      /* This thread has to wait for a while.  Enqueue it among the
+        waiting_writers.  */
+      lock->waiting_writers_count++;
+      if (pthread_cond_wait (&lock->waiting_writers, &lock->lock) != 0)
+       abort ();
+      lock->waiting_writers_count--;
+    }
+  lock->runcount--; /* runcount becomes -1 */
+  if (pthread_mutex_unlock (&lock->lock) != 0)
+    abort ();
+}
+
+void
+glthread_rwlock_unlock (gl_rwlock_t *lock)
+{
+  if (pthread_mutex_lock (&lock->lock) != 0)
+    abort ();
+  if (lock->runcount < 0)
+    {
+      /* Drop a writer lock.  */
+      if (!(lock->runcount == -1))
+       abort ();
+      lock->runcount = 0;
+    }
+  else
+    {
+      /* Drop a reader lock.  */
+      if (!(lock->runcount > 0))
+       abort ();
+      lock->runcount--;
+    }
+  if (lock->runcount == 0)
+    {
+      /* POSIX recommends that "write locks shall take precedence over read
+        locks", to avoid "writer starvation".  */
+      if (lock->waiting_writers_count > 0)
+       {
+         /* Wake up one of the waiting writers.  */
+         if (pthread_cond_signal (&lock->waiting_writers) != 0)
+           abort ();
+       }
+      else
+       {
+         /* Wake up all waiting readers.  */
+         if (pthread_cond_broadcast (&lock->waiting_readers) != 0)
+           abort ();
+       }
+    }
+  if (pthread_mutex_unlock (&lock->lock) != 0)
+    abort ();
+}
+
+void
+glthread_rwlock_destroy (gl_rwlock_t *lock)
+{
+  if (pthread_mutex_destroy (&lock->lock) != 0)
+    abort ();
+  if (pthread_cond_destroy (&lock->waiting_readers) != 0)
+    abort ();
+  if (pthread_cond_destroy (&lock->waiting_writers) != 0)
+    abort ();
+}
+
+# endif
+
+/* --------------------- gl_recursive_lock_t datatype --------------------- */
+
+# if HAVE_PTHREAD_MUTEX_RECURSIVE
+
+#  if !(defined PTHREAD_RECURSIVE_MUTEX_INITIALIZER || defined PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP)
+
+void
+glthread_recursive_lock_init (gl_recursive_lock_t *lock)
+{
+  pthread_mutexattr_t attributes;
+
+  if (pthread_mutexattr_init (&attributes) != 0)
+    abort ();
+  if (pthread_mutexattr_settype (&attributes, PTHREAD_MUTEX_RECURSIVE) != 0)
+    abort ();
+  if (pthread_mutex_init (&lock->recmutex, &attributes) != 0)
+    abort ();
+  if (pthread_mutexattr_destroy (&attributes) != 0)
+    abort ();
+  lock->initialized = 1;
+}
+
+void
+glthread_recursive_lock_lock (gl_recursive_lock_t *lock)
+{
+  if (!lock->initialized)
+    {
+      if (pthread_mutex_lock (&lock->guard) != 0)
+       abort ();
+      if (!lock->initialized)
+       glthread_recursive_lock_init (lock);
+      if (pthread_mutex_unlock (&lock->guard) != 0)
+       abort ();
+    }
+  if (pthread_mutex_lock (&lock->recmutex) != 0)
+    abort ();
+}
+
+void
+glthread_recursive_lock_unlock (gl_recursive_lock_t *lock)
+{
+  if (!lock->initialized)
+    abort ();
+  if (pthread_mutex_unlock (&lock->recmutex) != 0)
+    abort ();
+}
+
+void
+glthread_recursive_lock_destroy (gl_recursive_lock_t *lock)
+{
+  if (!lock->initialized)
+    abort ();
+  if (pthread_mutex_destroy (&lock->recmutex) != 0)
+    abort ();
+  lock->initialized = 0;
+}
+
+#  endif
+
+# else
+
+void
+glthread_recursive_lock_init (gl_recursive_lock_t *lock)
+{
+  if (pthread_mutex_init (&lock->mutex, NULL) != 0)
+    abort ();
+  lock->owner = (pthread_t) 0;
+  lock->depth = 0;
+}
+
+void
+glthread_recursive_lock_lock (gl_recursive_lock_t *lock)
+{
+  pthread_t self = pthread_self ();
+  if (lock->owner != self)
+    {
+      if (pthread_mutex_lock (&lock->mutex) != 0)
+       abort ();
+      lock->owner = self;
+    }
+  if (++(lock->depth) == 0) /* wraparound? */
+    abort ();
+}
+
+void
+glthread_recursive_lock_unlock (gl_recursive_lock_t *lock)
+{
+  if (lock->owner != pthread_self ())
+    abort ();
+  if (lock->depth == 0)
+    abort ();
+  if (--(lock->depth) == 0)
+    {
+      lock->owner = (pthread_t) 0;
+      if (pthread_mutex_unlock (&lock->mutex) != 0)
+       abort ();
+    }
+}
+
+void
+glthread_recursive_lock_destroy (gl_recursive_lock_t *lock)
+{
+  if (lock->owner != (pthread_t) 0)
+    abort ();
+  if (pthread_mutex_destroy (&lock->mutex) != 0)
+    abort ();
+}
+
+# endif
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+static const pthread_once_t fresh_once = PTHREAD_ONCE_INIT;
+
+int
+glthread_once_singlethreaded (pthread_once_t *once_control)
+{
+  /* We don't know whether pthread_once_t is an integer type, a floating-point
+     type, a pointer type, or a structure type.  */
+  char *firstbyte = (char *)once_control;
+  if (*firstbyte == *(const char *)&fresh_once)
+    {
+      /* First time use of once_control.  Invert the first byte.  */
+      *firstbyte = ~ *(const char *)&fresh_once;
+      return 1;
+    }
+  else
+    return 0;
+}
+
+#endif
+
+/* ========================================================================= */
+
+#if USE_PTH_THREADS
+
+/* Use the GNU Pth threads library.  */
+
+/* -------------------------- gl_lock_t datatype -------------------------- */
+
+/* ------------------------- gl_rwlock_t datatype ------------------------- */
+
+/* --------------------- gl_recursive_lock_t datatype --------------------- */
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+void
+glthread_once_call (void *arg)
+{
+  void (**gl_once_temp_addr) (void) = (void (**) (void)) arg;
+  void (*initfunction) (void) = *gl_once_temp_addr;
+  initfunction ();
+}
+
+int
+glthread_once_singlethreaded (pth_once_t *once_control)
+{
+  /* We know that pth_once_t is an integer type.  */
+  if (*once_control == PTH_ONCE_INIT)
+    {
+      /* First time use of once_control.  Invert the marker.  */
+      *once_control = ~ PTH_ONCE_INIT;
+      return 1;
+    }
+  else
+    return 0;
+}
+
+#endif
+
+/* ========================================================================= */
+
+#if USE_SOLARIS_THREADS
+
+/* Use the old Solaris threads library.  */
+
+/* -------------------------- gl_lock_t datatype -------------------------- */
+
+/* ------------------------- gl_rwlock_t datatype ------------------------- */
+
+/* --------------------- gl_recursive_lock_t datatype --------------------- */
+
+void
+glthread_recursive_lock_init (gl_recursive_lock_t *lock)
+{
+  if (mutex_init (&lock->mutex, USYNC_THREAD, NULL) != 0)
+    abort ();
+  lock->owner = (thread_t) 0;
+  lock->depth = 0;
+}
+
+void
+glthread_recursive_lock_lock (gl_recursive_lock_t *lock)
+{
+  thread_t self = thr_self ();
+  if (lock->owner != self)
+    {
+      if (mutex_lock (&lock->mutex) != 0)
+       abort ();
+      lock->owner = self;
+    }
+  if (++(lock->depth) == 0) /* wraparound? */
+    abort ();
+}
+
+void
+glthread_recursive_lock_unlock (gl_recursive_lock_t *lock)
+{
+  if (lock->owner != thr_self ())
+    abort ();
+  if (lock->depth == 0)
+    abort ();
+  if (--(lock->depth) == 0)
+    {
+      lock->owner = (thread_t) 0;
+      if (mutex_unlock (&lock->mutex) != 0)
+       abort ();
+    }
+}
+
+void
+glthread_recursive_lock_destroy (gl_recursive_lock_t *lock)
+{
+  if (lock->owner != (thread_t) 0)
+    abort ();
+  if (mutex_destroy (&lock->mutex) != 0)
+    abort ();
+}
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+void
+glthread_once (gl_once_t *once_control, void (*initfunction) (void))
+{
+  if (!once_control->inited)
+    {
+      /* Use the mutex to guarantee that if another thread is already calling
+        the initfunction, this thread waits until it's finished.  */
+      if (mutex_lock (&once_control->mutex) != 0)
+       abort ();
+      if (!once_control->inited)
+       {
+         once_control->inited = 1;
+         initfunction ();
+       }
+      if (mutex_unlock (&once_control->mutex) != 0)
+       abort ();
+    }
+}
+
+int
+glthread_once_singlethreaded (gl_once_t *once_control)
+{
+  /* We know that gl_once_t contains an integer type.  */
+  if (!once_control->inited)
+    {
+      /* First time use of once_control.  Invert the marker.  */
+      once_control->inited = ~ 0;
+      return 1;
+    }
+  else
+    return 0;
+}
+
+#endif
+
+/* ========================================================================= */
+
+#if USE_WIN32_THREADS
+
+/* -------------------------- gl_lock_t datatype -------------------------- */
+
+void
+glthread_lock_init (gl_lock_t *lock)
+{
+  InitializeCriticalSection (&lock->lock);
+  lock->guard.done = 1;
+}
+
+void
+glthread_lock_lock (gl_lock_t *lock)
+{
+  if (!lock->guard.done)
+    {
+      if (InterlockedIncrement (&lock->guard.started) == 0)
+       /* This thread is the first one to need this lock.  Initialize it.  */
+       glthread_lock_init (lock);
+      else
+       /* Yield the CPU while waiting for another thread to finish
+          initializing this lock.  */
+       while (!lock->guard.done)
+         Sleep (0);
+    }
+  EnterCriticalSection (&lock->lock);
+}
+
+void
+glthread_lock_unlock (gl_lock_t *lock)
+{
+  if (!lock->guard.done)
+    abort ();
+  LeaveCriticalSection (&lock->lock);
+}
+
+void
+glthread_lock_destroy (gl_lock_t *lock)
+{
+  if (!lock->guard.done)
+    abort ();
+  DeleteCriticalSection (&lock->lock);
+  lock->guard.done = 0;
+}
+
+/* ------------------------- gl_rwlock_t datatype ------------------------- */
+
+static inline void
+gl_waitqueue_init (gl_waitqueue_t *wq)
+{
+  wq->array = NULL;
+  wq->count = 0;
+  wq->alloc = 0;
+  wq->offset = 0;
+}
+
+/* Enqueues the current thread, represented by an event, in a wait queue.
+   Returns INVALID_HANDLE_VALUE if an allocation failure occurs.  */
+static HANDLE
+gl_waitqueue_add (gl_waitqueue_t *wq)
+{
+  HANDLE event;
+  unsigned int index;
+
+  if (wq->count == wq->alloc)
+    {
+      unsigned int new_alloc = 2 * wq->alloc + 1;
+      HANDLE *new_array =
+       (HANDLE *) realloc (wq->array, new_alloc * sizeof (HANDLE));
+      if (new_array == NULL)
+       /* No more memory.  */
+       return INVALID_HANDLE_VALUE;
+      /* Now is a good opportunity to rotate the array so that its contents
+        starts at offset 0.  */
+      if (wq->offset > 0)
+       {
+         unsigned int old_count = wq->count;
+         unsigned int old_alloc = wq->alloc;
+         unsigned int old_offset = wq->offset;
+         unsigned int i;
+         if (old_offset + old_count > old_alloc)
+           {
+             unsigned int limit = old_offset + old_count - old_alloc;
+             for (i = 0; i < limit; i++)
+               new_array[old_alloc + i] = new_array[i];
+           }
+         for (i = 0; i < old_count; i++)
+           new_array[i] = new_array[old_offset + i];
+         wq->offset = 0;
+       }
+      wq->array = new_array;
+      wq->alloc = new_alloc;
+    }
+  event = CreateEvent (NULL, TRUE, FALSE, NULL);
+  if (event == INVALID_HANDLE_VALUE)
+    /* No way to allocate an event.  */
+    return INVALID_HANDLE_VALUE;
+  index = wq->offset + wq->count;
+  if (index >= wq->alloc)
+    index -= wq->alloc;
+  wq->array[index] = event;
+  wq->count++;
+  return event;
+}
+
+/* Notifies the first thread from a wait queue and dequeues it.  */
+static inline void
+gl_waitqueue_notify_first (gl_waitqueue_t *wq)
+{
+  SetEvent (wq->array[wq->offset + 0]);
+  wq->offset++;
+  wq->count--;
+  if (wq->count == 0 || wq->offset == wq->alloc)
+    wq->offset = 0;
+}
+
+/* Notifies all threads from a wait queue and dequeues them all.  */
+static inline void
+gl_waitqueue_notify_all (gl_waitqueue_t *wq)
+{
+  unsigned int i;
+
+  for (i = 0; i < wq->count; i++)
+    {
+      unsigned int index = wq->offset + i;
+      if (index >= wq->alloc)
+       index -= wq->alloc;
+      SetEvent (wq->array[index]);
+    }
+  wq->count = 0;
+  wq->offset = 0;
+}
+
+void
+glthread_rwlock_init (gl_rwlock_t *lock)
+{
+  InitializeCriticalSection (&lock->lock);
+  gl_waitqueue_init (&lock->waiting_readers);
+  gl_waitqueue_init (&lock->waiting_writers);
+  lock->runcount = 0;
+  lock->guard.done = 1;
+}
+
+void
+glthread_rwlock_rdlock (gl_rwlock_t *lock)
+{
+  if (!lock->guard.done)
+    {
+      if (InterlockedIncrement (&lock->guard.started) == 0)
+       /* This thread is the first one to need this lock.  Initialize it.  */
+       glthread_rwlock_init (lock);
+      else
+       /* Yield the CPU while waiting for another thread to finish
+          initializing this lock.  */
+       while (!lock->guard.done)
+         Sleep (0);
+    }
+  EnterCriticalSection (&lock->lock);
+  /* Test whether only readers are currently running, and whether the runcount
+     field will not overflow.  */
+  if (!(lock->runcount + 1 > 0))
+    {
+      /* This thread has to wait for a while.  Enqueue it among the
+        waiting_readers.  */
+      HANDLE event = gl_waitqueue_add (&lock->waiting_readers);
+      if (event != INVALID_HANDLE_VALUE)
+       {
+         DWORD result;
+         LeaveCriticalSection (&lock->lock);
+         /* Wait until another thread signals this event.  */
+         result = WaitForSingleObject (event, INFINITE);
+         if (result == WAIT_FAILED || result == WAIT_TIMEOUT)
+           abort ();
+         CloseHandle (event);
+         /* The thread which signalled the event already did the bookkeeping:
+            removed us from the waiting_readers, incremented lock->runcount.  */
+         if (!(lock->runcount > 0))
+           abort ();
+         return;
+       }
+      else
+       {
+         /* Allocation failure.  Weird.  */
+         do
+           {
+             LeaveCriticalSection (&lock->lock);
+             Sleep (1);
+             EnterCriticalSection (&lock->lock);
+           }
+         while (!(lock->runcount + 1 > 0));
+       }
+    }
+  lock->runcount++;
+  LeaveCriticalSection (&lock->lock);
+}
+
+void
+glthread_rwlock_wrlock (gl_rwlock_t *lock)
+{
+  if (!lock->guard.done)
+    {
+      if (InterlockedIncrement (&lock->guard.started) == 0)
+       /* This thread is the first one to need this lock.  Initialize it.  */
+       glthread_rwlock_init (lock);
+      else
+       /* Yield the CPU while waiting for another thread to finish
+          initializing this lock.  */
+       while (!lock->guard.done)
+         Sleep (0);
+    }
+  EnterCriticalSection (&lock->lock);
+  /* Test whether no readers or writers are currently running.  */
+  if (!(lock->runcount == 0))
+    {
+      /* This thread has to wait for a while.  Enqueue it among the
+        waiting_writers.  */
+      HANDLE event = gl_waitqueue_add (&lock->waiting_writers);
+      if (event != INVALID_HANDLE_VALUE)
+       {
+         DWORD result;
+         LeaveCriticalSection (&lock->lock);
+         /* Wait until another thread signals this event.  */
+         result = WaitForSingleObject (event, INFINITE);
+         if (result == WAIT_FAILED || result == WAIT_TIMEOUT)
+           abort ();
+         CloseHandle (event);
+         /* The thread which signalled the event already did the bookkeeping:
+            removed us from the waiting_writers, set lock->runcount = -1.  */
+         if (!(lock->runcount == -1))
+           abort ();
+         return;
+       }
+      else
+       {
+         /* Allocation failure.  Weird.  */
+         do
+           {
+             LeaveCriticalSection (&lock->lock);
+             Sleep (1);
+             EnterCriticalSection (&lock->lock);
+           }
+         while (!(lock->runcount == 0));
+       }
+    }
+  lock->runcount--; /* runcount becomes -1 */
+  LeaveCriticalSection (&lock->lock);
+}
+
+void
+glthread_rwlock_unlock (gl_rwlock_t *lock)
+{
+  if (!lock->guard.done)
+    abort ();
+  EnterCriticalSection (&lock->lock);
+  if (lock->runcount < 0)
+    {
+      /* Drop a writer lock.  */
+      if (!(lock->runcount == -1))
+       abort ();
+      lock->runcount = 0;
+    }
+  else
+    {
+      /* Drop a reader lock.  */
+      if (!(lock->runcount > 0))
+       abort ();
+      lock->runcount--;
+    }
+  if (lock->runcount == 0)
+    {
+      /* POSIX recommends that "write locks shall take precedence over read
+        locks", to avoid "writer starvation".  */
+      if (lock->waiting_writers.count > 0)
+       {
+         /* Wake up one of the waiting writers.  */
+         lock->runcount--;
+         gl_waitqueue_notify_first (&lock->waiting_writers);
+       }
+      else
+       {
+         /* Wake up all waiting readers.  */
+         lock->runcount += lock->waiting_readers.count;
+         gl_waitqueue_notify_all (&lock->waiting_readers);
+       }
+    }
+  LeaveCriticalSection (&lock->lock);
+}
+
+void
+glthread_rwlock_destroy (gl_rwlock_t *lock)
+{
+  if (!lock->guard.done)
+    abort ();
+  if (lock->runcount != 0)
+    abort ();
+  DeleteCriticalSection (&lock->lock);
+  if (lock->waiting_readers.array != NULL)
+    free (lock->waiting_readers.array);
+  if (lock->waiting_writers.array != NULL)
+    free (lock->waiting_writers.array);
+  lock->guard.done = 0;
+}
+
+/* --------------------- gl_recursive_lock_t datatype --------------------- */
+
+void
+glthread_recursive_lock_init (gl_recursive_lock_t *lock)
+{
+  lock->owner = 0;
+  lock->depth = 0;
+  InitializeCriticalSection (&lock->lock);
+  lock->guard.done = 1;
+}
+
+void
+glthread_recursive_lock_lock (gl_recursive_lock_t *lock)
+{
+  if (!lock->guard.done)
+    {
+      if (InterlockedIncrement (&lock->guard.started) == 0)
+       /* This thread is the first one to need this lock.  Initialize it.  */
+       glthread_recursive_lock_init (lock);
+      else
+       /* Yield the CPU while waiting for another thread to finish
+          initializing this lock.  */
+       while (!lock->guard.done)
+         Sleep (0);
+    }
+  {
+    DWORD self = GetCurrentThreadId ();
+    if (lock->owner != self)
+      {
+       EnterCriticalSection (&lock->lock);
+       lock->owner = self;
+      }
+    if (++(lock->depth) == 0) /* wraparound? */
+      abort ();
+  }
+}
+
+void
+glthread_recursive_lock_unlock (gl_recursive_lock_t *lock)
+{
+  if (lock->owner != GetCurrentThreadId ())
+    abort ();
+  if (lock->depth == 0)
+    abort ();
+  if (--(lock->depth) == 0)
+    {
+      lock->owner = 0;
+      LeaveCriticalSection (&lock->lock);
+    }
+}
+
+void
+glthread_recursive_lock_destroy (gl_recursive_lock_t *lock)
+{
+  if (lock->owner != 0)
+    abort ();
+  DeleteCriticalSection (&lock->lock);
+  lock->guard.done = 0;
+}
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+void
+glthread_once (gl_once_t *once_control, void (*initfunction) (void))
+{
+  if (once_control->inited <= 0)
+    {
+      if (InterlockedIncrement (&once_control->started) == 0)
+       {
+         /* This thread is the first one to come to this once_control.  */
+         InitializeCriticalSection (&once_control->lock);
+         EnterCriticalSection (&once_control->lock);
+         once_control->inited = 0;
+         initfunction ();
+         once_control->inited = 1;
+         LeaveCriticalSection (&once_control->lock);
+       }
+      else
+       {
+         /* Undo last operation.  */
+         InterlockedDecrement (&once_control->started);
+         /* Some other thread has already started the initialization.
+            Yield the CPU while waiting for the other thread to finish
+            initializing and taking the lock.  */
+         while (once_control->inited < 0)
+           Sleep (0);
+         if (once_control->inited <= 0)
+           {
+             /* Take the lock.  This blocks until the other thread has
+                finished calling the initfunction.  */
+             EnterCriticalSection (&once_control->lock);
+             LeaveCriticalSection (&once_control->lock);
+             if (!(once_control->inited > 0))
+               abort ();
+           }
+       }
+    }
+}
+
+#endif
+
+/* ========================================================================= */
diff --git a/gnulib/lock.h b/gnulib/lock.h
new file mode 100644 (file)
index 0000000..e6b312a
--- /dev/null
@@ -0,0 +1,832 @@
+/* Locking in multithreaded situations.
+   Copyright (C) 2005-2006 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2005.
+   Based on GCC's gthr-posix.h, gthr-posix95.h, gthr-solaris.h,
+   gthr-win32.h.  */
+
+/* This file contains locking primitives for use with a given thread library.
+   It does not contain primitives for creating threads or for other
+   synchronization primitives.
+
+   Normal (non-recursive) locks:
+     Type:                gl_lock_t
+     Declaration:         gl_lock_define(extern, name)
+     Initializer:         gl_lock_define_initialized(, name)
+     Initialization:      gl_lock_init (name);
+     Taking the lock:     gl_lock_lock (name);
+     Releasing the lock:  gl_lock_unlock (name);
+     De-initialization:   gl_lock_destroy (name);
+
+   Read-Write (non-recursive) locks:
+     Type:                gl_rwlock_t
+     Declaration:         gl_rwlock_define(extern, name)
+     Initializer:         gl_rwlock_define_initialized(, name)
+     Initialization:      gl_rwlock_init (name);
+     Taking the lock:     gl_rwlock_rdlock (name);
+                          gl_rwlock_wrlock (name);
+     Releasing the lock:  gl_rwlock_unlock (name);
+     De-initialization:   gl_rwlock_destroy (name);
+
+   Recursive locks:
+     Type:                gl_recursive_lock_t
+     Declaration:         gl_recursive_lock_define(extern, name)
+     Initializer:         gl_recursive_lock_define_initialized(, name)
+     Initialization:      gl_recursive_lock_init (name);
+     Taking the lock:     gl_recursive_lock_lock (name);
+     Releasing the lock:  gl_recursive_lock_unlock (name);
+     De-initialization:   gl_recursive_lock_destroy (name);
+
+  Once-only execution:
+     Type:                gl_once_t
+     Initializer:         gl_once_define(extern, name)
+     Execution:           gl_once (name, initfunction);
+*/
+
+
+#ifndef _LOCK_H
+#define _LOCK_H
+
+/* ========================================================================= */
+
+#if USE_POSIX_THREADS
+
+/* Use the POSIX threads library.  */
+
+# include <pthread.h>
+# include <stdlib.h>
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+# if PTHREAD_IN_USE_DETECTION_HARD
+
+/* The pthread_in_use() detection needs to be done at runtime.  */
+#  define pthread_in_use() \
+     glthread_in_use ()
+extern int glthread_in_use (void);
+
+# endif
+
+# if USE_POSIX_THREADS_WEAK
+
+/* Use weak references to the POSIX threads library.  */
+
+/* Weak references avoid dragging in external libraries if the other parts
+   of the program don't use them.  Here we use them, because we don't want
+   every program that uses libintl to depend on libpthread.  This assumes
+   that libpthread would not be loaded after libintl; i.e. if libintl is
+   loaded first, by an executable that does not depend on libpthread, and
+   then a module is dynamically loaded that depends on libpthread, libintl
+   will not be multithread-safe.  */
+
+/* The way to test at runtime whether libpthread is present is to test
+   whether a function pointer's value, such as &pthread_mutex_init, is
+   non-NULL.  However, some versions of GCC have a bug through which, in
+   PIC mode, &foo != NULL always evaluates to true if there is a direct
+   call to foo(...) in the same function.  To avoid this, we test the
+   address of a function in libpthread that we don't use.  */
+
+#  pragma weak pthread_mutex_init
+#  pragma weak pthread_mutex_lock
+#  pragma weak pthread_mutex_unlock
+#  pragma weak pthread_mutex_destroy
+#  pragma weak pthread_rwlock_init
+#  pragma weak pthread_rwlock_rdlock
+#  pragma weak pthread_rwlock_wrlock
+#  pragma weak pthread_rwlock_unlock
+#  pragma weak pthread_rwlock_destroy
+#  pragma weak pthread_once
+#  pragma weak pthread_cond_init
+#  pragma weak pthread_cond_wait
+#  pragma weak pthread_cond_signal
+#  pragma weak pthread_cond_broadcast
+#  pragma weak pthread_cond_destroy
+#  pragma weak pthread_mutexattr_init
+#  pragma weak pthread_mutexattr_settype
+#  pragma weak pthread_mutexattr_destroy
+#  ifndef pthread_self
+#   pragma weak pthread_self
+#  endif
+
+#  if !PTHREAD_IN_USE_DETECTION_HARD
+#   pragma weak pthread_cancel
+#   define pthread_in_use() (pthread_cancel != NULL)
+#  endif
+
+# else
+
+#  if !PTHREAD_IN_USE_DETECTION_HARD
+#   define pthread_in_use() 1
+#  endif
+
+# endif
+
+/* -------------------------- gl_lock_t datatype -------------------------- */
+
+typedef pthread_mutex_t gl_lock_t;
+# define gl_lock_define(STORAGECLASS, NAME) \
+    STORAGECLASS pthread_mutex_t NAME;
+# define gl_lock_define_initialized(STORAGECLASS, NAME) \
+    STORAGECLASS pthread_mutex_t NAME = gl_lock_initializer;
+# define gl_lock_initializer \
+    PTHREAD_MUTEX_INITIALIZER
+# define gl_lock_init(NAME) \
+    if (pthread_in_use () && pthread_mutex_init (&NAME, NULL) != 0) abort ()
+# define gl_lock_lock(NAME) \
+    if (pthread_in_use () && pthread_mutex_lock (&NAME) != 0) abort ()
+# define gl_lock_unlock(NAME) \
+    if (pthread_in_use () && pthread_mutex_unlock (&NAME) != 0) abort ()
+# define gl_lock_destroy(NAME) \
+    if (pthread_in_use () && pthread_mutex_destroy (&NAME) != 0) abort ()
+
+/* ------------------------- gl_rwlock_t datatype ------------------------- */
+
+# if HAVE_PTHREAD_RWLOCK
+
+#  ifdef PTHREAD_RWLOCK_INITIALIZER
+
+typedef pthread_rwlock_t gl_rwlock_t;
+#   define gl_rwlock_define(STORAGECLASS, NAME) \
+      STORAGECLASS pthread_rwlock_t NAME;
+#   define gl_rwlock_define_initialized(STORAGECLASS, NAME) \
+      STORAGECLASS pthread_rwlock_t NAME = gl_rwlock_initializer;
+#   define gl_rwlock_initializer \
+      PTHREAD_RWLOCK_INITIALIZER
+#   define gl_rwlock_init(NAME) \
+      if (pthread_in_use () && pthread_rwlock_init (&NAME, NULL) != 0) abort ()
+#   define gl_rwlock_rdlock(NAME) \
+      if (pthread_in_use () && pthread_rwlock_rdlock (&NAME) != 0) abort ()
+#   define gl_rwlock_wrlock(NAME) \
+      if (pthread_in_use () && pthread_rwlock_wrlock (&NAME) != 0) abort ()
+#   define gl_rwlock_unlock(NAME) \
+      if (pthread_in_use () && pthread_rwlock_unlock (&NAME) != 0) abort ()
+#   define gl_rwlock_destroy(NAME) \
+      if (pthread_in_use () && pthread_rwlock_destroy (&NAME) != 0) abort ()
+
+#  else
+
+typedef struct
+        {
+          int initialized;
+          pthread_mutex_t guard;   /* protects the initialization */
+          pthread_rwlock_t rwlock; /* read-write lock */
+        }
+        gl_rwlock_t;
+#   define gl_rwlock_define(STORAGECLASS, NAME) \
+      STORAGECLASS gl_rwlock_t NAME;
+#   define gl_rwlock_define_initialized(STORAGECLASS, NAME) \
+      STORAGECLASS gl_rwlock_t NAME = gl_rwlock_initializer;
+#   define gl_rwlock_initializer \
+      { 0, PTHREAD_MUTEX_INITIALIZER }
+#   define gl_rwlock_init(NAME) \
+      if (pthread_in_use ()) glthread_rwlock_init (&NAME)
+#   define gl_rwlock_rdlock(NAME) \
+      if (pthread_in_use ()) glthread_rwlock_rdlock (&NAME)
+#   define gl_rwlock_wrlock(NAME) \
+      if (pthread_in_use ()) glthread_rwlock_wrlock (&NAME)
+#   define gl_rwlock_unlock(NAME) \
+      if (pthread_in_use ()) glthread_rwlock_unlock (&NAME)
+#   define gl_rwlock_destroy(NAME) \
+      if (pthread_in_use ()) glthread_rwlock_destroy (&NAME)
+extern void glthread_rwlock_init (gl_rwlock_t *lock);
+extern void glthread_rwlock_rdlock (gl_rwlock_t *lock);
+extern void glthread_rwlock_wrlock (gl_rwlock_t *lock);
+extern void glthread_rwlock_unlock (gl_rwlock_t *lock);
+extern void glthread_rwlock_destroy (gl_rwlock_t *lock);
+
+#  endif
+
+# else
+
+typedef struct
+        {
+          pthread_mutex_t lock; /* protects the remaining fields */
+          pthread_cond_t waiting_readers; /* waiting readers */
+          pthread_cond_t waiting_writers; /* waiting writers */
+          unsigned int waiting_writers_count; /* number of waiting writers */
+          int runcount; /* number of readers running, or -1 when a writer runs */
+        }
+        gl_rwlock_t;
+# define gl_rwlock_define(STORAGECLASS, NAME) \
+    STORAGECLASS gl_rwlock_t NAME;
+# define gl_rwlock_define_initialized(STORAGECLASS, NAME) \
+    STORAGECLASS gl_rwlock_t NAME = gl_rwlock_initializer;
+# define gl_rwlock_initializer \
+    { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, PTHREAD_COND_INITIALIZER, 0, 0 }
+# define gl_rwlock_init(NAME) \
+    if (pthread_in_use ()) glthread_rwlock_init (&NAME)
+# define gl_rwlock_rdlock(NAME) \
+    if (pthread_in_use ()) glthread_rwlock_rdlock (&NAME)
+# define gl_rwlock_wrlock(NAME) \
+    if (pthread_in_use ()) glthread_rwlock_wrlock (&NAME)
+# define gl_rwlock_unlock(NAME) \
+    if (pthread_in_use ()) glthread_rwlock_unlock (&NAME)
+# define gl_rwlock_destroy(NAME) \
+    if (pthread_in_use ()) glthread_rwlock_destroy (&NAME)
+extern void glthread_rwlock_init (gl_rwlock_t *lock);
+extern void glthread_rwlock_rdlock (gl_rwlock_t *lock);
+extern void glthread_rwlock_wrlock (gl_rwlock_t *lock);
+extern void glthread_rwlock_unlock (gl_rwlock_t *lock);
+extern void glthread_rwlock_destroy (gl_rwlock_t *lock);
+
+# endif
+
+/* --------------------- gl_recursive_lock_t datatype --------------------- */
+
+# if HAVE_PTHREAD_MUTEX_RECURSIVE
+
+#  if defined PTHREAD_RECURSIVE_MUTEX_INITIALIZER || defined PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+
+typedef pthread_mutex_t gl_recursive_lock_t;
+#   define gl_recursive_lock_define(STORAGECLASS, NAME) \
+      STORAGECLASS pthread_mutex_t NAME;
+#   define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \
+      STORAGECLASS pthread_mutex_t NAME = gl_recursive_lock_initializer;
+#   ifdef PTHREAD_RECURSIVE_MUTEX_INITIALIZER
+#    define gl_recursive_lock_initializer \
+       PTHREAD_RECURSIVE_MUTEX_INITIALIZER
+#   else
+#    define gl_recursive_lock_initializer \
+       PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
+#   endif
+#   define gl_recursive_lock_init(NAME) \
+      if (pthread_in_use () && pthread_mutex_init (&NAME, NULL) != 0) abort ()
+#   define gl_recursive_lock_lock(NAME) \
+      if (pthread_in_use () && pthread_mutex_lock (&NAME) != 0) abort ()
+#   define gl_recursive_lock_unlock(NAME) \
+      if (pthread_in_use () && pthread_mutex_unlock (&NAME) != 0) abort ()
+#   define gl_recursive_lock_destroy(NAME) \
+      if (pthread_in_use () && pthread_mutex_destroy (&NAME) != 0) abort ()
+
+#  else
+
+typedef struct
+        {
+          pthread_mutex_t recmutex; /* recursive mutex */
+          pthread_mutex_t guard;    /* protects the initialization */
+          int initialized;
+        }
+        gl_recursive_lock_t;
+#   define gl_recursive_lock_define(STORAGECLASS, NAME) \
+      STORAGECLASS gl_recursive_lock_t NAME;
+#   define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \
+      STORAGECLASS gl_recursive_lock_t NAME = gl_recursive_lock_initializer;
+#   define gl_recursive_lock_initializer \
+      { PTHREAD_MUTEX_INITIALIZER, PTHREAD_MUTEX_INITIALIZER, 0 }
+#   define gl_recursive_lock_init(NAME) \
+      if (pthread_in_use ()) glthread_recursive_lock_init (&NAME)
+#   define gl_recursive_lock_lock(NAME) \
+      if (pthread_in_use ()) glthread_recursive_lock_lock (&NAME)
+#   define gl_recursive_lock_unlock(NAME) \
+      if (pthread_in_use ()) glthread_recursive_lock_unlock (&NAME)
+#   define gl_recursive_lock_destroy(NAME) \
+      if (pthread_in_use ()) glthread_recursive_lock_destroy (&NAME)
+extern void glthread_recursive_lock_init (gl_recursive_lock_t *lock);
+extern void glthread_recursive_lock_lock (gl_recursive_lock_t *lock);
+extern void glthread_recursive_lock_unlock (gl_recursive_lock_t *lock);
+extern void glthread_recursive_lock_destroy (gl_recursive_lock_t *lock);
+
+#  endif
+
+# else
+
+/* Old versions of POSIX threads on Solaris did not have recursive locks.
+   We have to implement them ourselves.  */
+
+typedef struct
+        {
+          pthread_mutex_t mutex;
+          pthread_t owner;
+          unsigned long depth;
+        }
+        gl_recursive_lock_t;
+#  define gl_recursive_lock_define(STORAGECLASS, NAME) \
+     STORAGECLASS gl_recursive_lock_t NAME;
+#  define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \
+     STORAGECLASS gl_recursive_lock_t NAME = gl_recursive_lock_initializer;
+#  define gl_recursive_lock_initializer \
+     { PTHREAD_MUTEX_INITIALIZER, (pthread_t) 0, 0 }
+#  define gl_recursive_lock_init(NAME) \
+     if (pthread_in_use ()) glthread_recursive_lock_init (&NAME)
+#  define gl_recursive_lock_lock(NAME) \
+     if (pthread_in_use ()) glthread_recursive_lock_lock (&NAME)
+#  define gl_recursive_lock_unlock(NAME) \
+     if (pthread_in_use ()) glthread_recursive_lock_unlock (&NAME)
+#  define gl_recursive_lock_destroy(NAME) \
+     if (pthread_in_use ()) glthread_recursive_lock_destroy (&NAME)
+extern void glthread_recursive_lock_init (gl_recursive_lock_t *lock);
+extern void glthread_recursive_lock_lock (gl_recursive_lock_t *lock);
+extern void glthread_recursive_lock_unlock (gl_recursive_lock_t *lock);
+extern void glthread_recursive_lock_destroy (gl_recursive_lock_t *lock);
+
+# endif
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+typedef pthread_once_t gl_once_t;
+# define gl_once_define(STORAGECLASS, NAME) \
+    STORAGECLASS pthread_once_t NAME = PTHREAD_ONCE_INIT;
+# define gl_once(NAME, INITFUNCTION) \
+    do                                                   \
+      {                                                  \
+        if (pthread_in_use ())                           \
+          {                                              \
+            if (pthread_once (&NAME, INITFUNCTION) != 0) \
+              abort ();                                  \
+          }                                              \
+        else                                             \
+          {                                              \
+            if (glthread_once_singlethreaded (&NAME))    \
+              INITFUNCTION ();                           \
+          }                                              \
+      }                                                  \
+    while (0)
+extern int glthread_once_singlethreaded (pthread_once_t *once_control);
+
+# ifdef __cplusplus
+}
+# endif
+
+#endif
+
+/* ========================================================================= */
+
+#if USE_PTH_THREADS
+
+/* Use the GNU Pth threads library.  */
+
+# include <pth.h>
+# include <stdlib.h>
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+# if USE_PTH_THREADS_WEAK
+
+/* Use weak references to the GNU Pth threads library.  */
+
+#  pragma weak pth_mutex_init
+#  pragma weak pth_mutex_acquire
+#  pragma weak pth_mutex_release
+#  pragma weak pth_rwlock_init
+#  pragma weak pth_rwlock_acquire
+#  pragma weak pth_rwlock_release
+#  pragma weak pth_once
+
+#  pragma weak pth_cancel
+#  define pth_in_use() (pth_cancel != NULL)
+
+# else
+
+#  define pth_in_use() 1
+
+# endif
+
+/* -------------------------- gl_lock_t datatype -------------------------- */
+
+typedef pth_mutex_t gl_lock_t;
+# define gl_lock_define(STORAGECLASS, NAME) \
+    STORAGECLASS pth_mutex_t NAME;
+# define gl_lock_define_initialized(STORAGECLASS, NAME) \
+    STORAGECLASS pth_mutex_t NAME = gl_lock_initializer;
+# define gl_lock_initializer \
+    PTH_MUTEX_INIT
+# define gl_lock_init(NAME) \
+    if (pth_in_use() && !pth_mutex_init (&NAME)) abort ()
+# define gl_lock_lock(NAME) \
+    if (pth_in_use() && !pth_mutex_acquire (&NAME, 0, NULL)) abort ()
+# define gl_lock_unlock(NAME) \
+    if (pth_in_use() && !pth_mutex_release (&NAME)) abort ()
+# define gl_lock_destroy(NAME) \
+    (void)(&NAME)
+
+/* ------------------------- gl_rwlock_t datatype ------------------------- */
+
+typedef pth_rwlock_t gl_rwlock_t;
+#  define gl_rwlock_define(STORAGECLASS, NAME) \
+     STORAGECLASS pth_rwlock_t NAME;
+#  define gl_rwlock_define_initialized(STORAGECLASS, NAME) \
+     STORAGECLASS pth_rwlock_t NAME = gl_rwlock_initializer;
+#  define gl_rwlock_initializer \
+     PTH_RWLOCK_INIT
+#  define gl_rwlock_init(NAME) \
+     if (pth_in_use() && !pth_rwlock_init (&NAME)) abort ()
+#  define gl_rwlock_rdlock(NAME) \
+     if (pth_in_use() && !pth_rwlock_acquire (&NAME, PTH_RWLOCK_RD, 0, NULL)) abort ()
+#  define gl_rwlock_wrlock(NAME) \
+     if (pth_in_use() && !pth_rwlock_acquire (&NAME, PTH_RWLOCK_RW, 0, NULL)) abort ()
+#  define gl_rwlock_unlock(NAME) \
+     if (pth_in_use() && !pth_rwlock_release (&NAME)) abort ()
+#  define gl_rwlock_destroy(NAME) \
+     (void)(&NAME)
+
+/* --------------------- gl_recursive_lock_t datatype --------------------- */
+
+/* In Pth, mutexes are recursive by default.  */
+typedef pth_mutex_t gl_recursive_lock_t;
+#  define gl_recursive_lock_define(STORAGECLASS, NAME) \
+     STORAGECLASS pth_mutex_t NAME;
+#  define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \
+     STORAGECLASS pth_mutex_t NAME = gl_recursive_lock_initializer;
+#  define gl_recursive_lock_initializer \
+     PTH_MUTEX_INIT
+#  define gl_recursive_lock_init(NAME) \
+     if (pth_in_use() && !pth_mutex_init (&NAME)) abort ()
+#  define gl_recursive_lock_lock(NAME) \
+     if (pth_in_use() && !pth_mutex_acquire (&NAME, 0, NULL)) abort ()
+#  define gl_recursive_lock_unlock(NAME) \
+     if (pth_in_use() && !pth_mutex_release (&NAME)) abort ()
+#  define gl_recursive_lock_destroy(NAME) \
+     (void)(&NAME)
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+typedef pth_once_t gl_once_t;
+# define gl_once_define(STORAGECLASS, NAME) \
+    STORAGECLASS pth_once_t NAME = PTH_ONCE_INIT;
+# define gl_once(NAME, INITFUNCTION) \
+    do                                                                \
+      {                                                               \
+        if (pth_in_use ())                                            \
+          {                                                           \
+            void (*gl_once_temp) (void) = INITFUNCTION;               \
+            if (!pth_once (&NAME, glthread_once_call, &gl_once_temp)) \
+              abort ();                                               \
+          }                                                           \
+        else                                                          \
+          {                                                           \
+            if (glthread_once_singlethreaded (&NAME))                 \
+              INITFUNCTION ();                                        \
+          }                                                           \
+      }                                                               \
+    while (0)
+extern void glthread_once_call (void *arg);
+extern int glthread_once_singlethreaded (pth_once_t *once_control);
+
+# ifdef __cplusplus
+}
+# endif
+
+#endif
+
+/* ========================================================================= */
+
+#if USE_SOLARIS_THREADS
+
+/* Use the old Solaris threads library.  */
+
+# include <thread.h>
+# include <synch.h>
+# include <stdlib.h>
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+# if USE_SOLARIS_THREADS_WEAK
+
+/* Use weak references to the old Solaris threads library.  */
+
+#  pragma weak mutex_init
+#  pragma weak mutex_lock
+#  pragma weak mutex_unlock
+#  pragma weak mutex_destroy
+#  pragma weak rwlock_init
+#  pragma weak rw_rdlock
+#  pragma weak rw_wrlock
+#  pragma weak rw_unlock
+#  pragma weak rwlock_destroy
+#  pragma weak thr_self
+
+#  pragma weak thr_suspend
+#  define thread_in_use() (thr_suspend != NULL)
+
+# else
+
+#  define thread_in_use() 1
+
+# endif
+
+/* -------------------------- gl_lock_t datatype -------------------------- */
+
+typedef mutex_t gl_lock_t;
+# define gl_lock_define(STORAGECLASS, NAME) \
+    STORAGECLASS mutex_t NAME;
+# define gl_lock_define_initialized(STORAGECLASS, NAME) \
+    STORAGECLASS mutex_t NAME = gl_lock_initializer;
+# define gl_lock_initializer \
+    DEFAULTMUTEX
+# define gl_lock_init(NAME) \
+    if (thread_in_use () && mutex_init (&NAME, USYNC_THREAD, NULL) != 0) abort ()
+# define gl_lock_lock(NAME) \
+    if (thread_in_use () && mutex_lock (&NAME) != 0) abort ()
+# define gl_lock_unlock(NAME) \
+    if (thread_in_use () && mutex_unlock (&NAME) != 0) abort ()
+# define gl_lock_destroy(NAME) \
+    if (thread_in_use () && mutex_destroy (&NAME) != 0) abort ()
+
+/* ------------------------- gl_rwlock_t datatype ------------------------- */
+
+typedef rwlock_t gl_rwlock_t;
+# define gl_rwlock_define(STORAGECLASS, NAME) \
+    STORAGECLASS rwlock_t NAME;
+# define gl_rwlock_define_initialized(STORAGECLASS, NAME) \
+    STORAGECLASS rwlock_t NAME = gl_rwlock_initializer;
+# define gl_rwlock_initializer \
+    DEFAULTRWLOCK
+# define gl_rwlock_init(NAME) \
+    if (thread_in_use () && rwlock_init (&NAME, USYNC_THREAD, NULL) != 0) abort ()
+# define gl_rwlock_rdlock(NAME) \
+    if (thread_in_use () && rw_rdlock (&NAME) != 0) abort ()
+# define gl_rwlock_wrlock(NAME) \
+    if (thread_in_use () && rw_wrlock (&NAME) != 0) abort ()
+# define gl_rwlock_unlock(NAME) \
+    if (thread_in_use () && rw_unlock (&NAME) != 0) abort ()
+# define gl_rwlock_destroy(NAME) \
+    if (thread_in_use () && rwlock_destroy (&NAME) != 0) abort ()
+
+/* --------------------- gl_recursive_lock_t datatype --------------------- */
+
+/* Old Solaris threads did not have recursive locks.
+   We have to implement them ourselves.  */
+
+typedef struct
+        {
+          mutex_t mutex;
+          thread_t owner;
+          unsigned long depth;
+        }
+        gl_recursive_lock_t;
+# define gl_recursive_lock_define(STORAGECLASS, NAME) \
+    STORAGECLASS gl_recursive_lock_t NAME;
+# define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \
+    STORAGECLASS gl_recursive_lock_t NAME = gl_recursive_lock_initializer;
+# define gl_recursive_lock_initializer \
+    { DEFAULTMUTEX, (thread_t) 0, 0 }
+# define gl_recursive_lock_init(NAME) \
+    if (thread_in_use ()) glthread_recursive_lock_init (&NAME)
+# define gl_recursive_lock_lock(NAME) \
+    if (thread_in_use ()) glthread_recursive_lock_lock (&NAME)
+# define gl_recursive_lock_unlock(NAME) \
+    if (thread_in_use ()) glthread_recursive_lock_unlock (&NAME)
+# define gl_recursive_lock_destroy(NAME) \
+    if (thread_in_use ()) glthread_recursive_lock_destroy (&NAME)
+extern void glthread_recursive_lock_init (gl_recursive_lock_t *lock);
+extern void glthread_recursive_lock_lock (gl_recursive_lock_t *lock);
+extern void glthread_recursive_lock_unlock (gl_recursive_lock_t *lock);
+extern void glthread_recursive_lock_destroy (gl_recursive_lock_t *lock);
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+typedef struct
+        {
+          volatile int inited;
+          mutex_t mutex;
+        }
+        gl_once_t;
+# define gl_once_define(STORAGECLASS, NAME) \
+    STORAGECLASS gl_once_t NAME = { 0, DEFAULTMUTEX };
+# define gl_once(NAME, INITFUNCTION) \
+    do                                                \
+      {                                               \
+        if (thread_in_use ())                         \
+          {                                           \
+            glthread_once (&NAME, INITFUNCTION);      \
+          }                                           \
+        else                                          \
+          {                                           \
+            if (glthread_once_singlethreaded (&NAME)) \
+              INITFUNCTION ();                        \
+          }                                           \
+      }                                               \
+    while (0)
+extern void glthread_once (gl_once_t *once_control, void (*initfunction) (void));
+extern int glthread_once_singlethreaded (gl_once_t *once_control);
+
+# ifdef __cplusplus
+}
+# endif
+
+#endif
+
+/* ========================================================================= */
+
+#if USE_WIN32_THREADS
+
+# include <windows.h>
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+/* We can use CRITICAL_SECTION directly, rather than the Win32 Event, Mutex,
+   Semaphore types, because
+     - we need only to synchronize inside a single process (address space),
+       not inter-process locking,
+     - we don't need to support trylock operations.  (TryEnterCriticalSection
+       does not work on Windows 95/98/ME.  Packages that need trylock usually
+       define their own mutex type.)  */
+
+/* There is no way to statically initialize a CRITICAL_SECTION.  It needs
+   to be done lazily, once only.  For this we need spinlocks.  */
+
+typedef struct { volatile int done; volatile long started; } gl_spinlock_t;
+
+/* -------------------------- gl_lock_t datatype -------------------------- */
+
+typedef struct
+        {
+          gl_spinlock_t guard; /* protects the initialization */
+          CRITICAL_SECTION lock;
+        }
+        gl_lock_t;
+# define gl_lock_define(STORAGECLASS, NAME) \
+    STORAGECLASS gl_lock_t NAME;
+# define gl_lock_define_initialized(STORAGECLASS, NAME) \
+    STORAGECLASS gl_lock_t NAME = gl_lock_initializer;
+# define gl_lock_initializer \
+    { { 0, -1 } }
+# define gl_lock_init(NAME) \
+    glthread_lock_init (&NAME)
+# define gl_lock_lock(NAME) \
+    glthread_lock_lock (&NAME)
+# define gl_lock_unlock(NAME) \
+    glthread_lock_unlock (&NAME)
+# define gl_lock_destroy(NAME) \
+    glthread_lock_destroy (&NAME)
+extern void glthread_lock_init (gl_lock_t *lock);
+extern void glthread_lock_lock (gl_lock_t *lock);
+extern void glthread_lock_unlock (gl_lock_t *lock);
+extern void glthread_lock_destroy (gl_lock_t *lock);
+
+/* ------------------------- gl_rwlock_t datatype ------------------------- */
+
+/* It is impossible to implement read-write locks using plain locks, without
+   introducing an extra thread dedicated to managing read-write locks.
+   Therefore here we need to use the low-level Event type.  */
+
+typedef struct
+        {
+          HANDLE *array; /* array of waiting threads, each represented by an event */
+          unsigned int count; /* number of waiting threads */
+          unsigned int alloc; /* length of allocated array */
+          unsigned int offset; /* index of first waiting thread in array */
+        }
+        gl_waitqueue_t;
+typedef struct
+        {
+          gl_spinlock_t guard; /* protects the initialization */
+          CRITICAL_SECTION lock; /* protects the remaining fields */
+          gl_waitqueue_t waiting_readers; /* waiting readers */
+          gl_waitqueue_t waiting_writers; /* waiting writers */
+          int runcount; /* number of readers running, or -1 when a writer runs */
+        }
+        gl_rwlock_t;
+# define gl_rwlock_define(STORAGECLASS, NAME) \
+    STORAGECLASS gl_rwlock_t NAME;
+# define gl_rwlock_define_initialized(STORAGECLASS, NAME) \
+    STORAGECLASS gl_rwlock_t NAME = gl_rwlock_initializer;
+# define gl_rwlock_initializer \
+    { { 0, -1 } }
+# define gl_rwlock_init(NAME) \
+    glthread_rwlock_init (&NAME)
+# define gl_rwlock_rdlock(NAME) \
+    glthread_rwlock_rdlock (&NAME)
+# define gl_rwlock_wrlock(NAME) \
+    glthread_rwlock_wrlock (&NAME)
+# define gl_rwlock_unlock(NAME) \
+    glthread_rwlock_unlock (&NAME)
+# define gl_rwlock_destroy(NAME) \
+    glthread_rwlock_destroy (&NAME)
+extern void glthread_rwlock_init (gl_rwlock_t *lock);
+extern void glthread_rwlock_rdlock (gl_rwlock_t *lock);
+extern void glthread_rwlock_wrlock (gl_rwlock_t *lock);
+extern void glthread_rwlock_unlock (gl_rwlock_t *lock);
+extern void glthread_rwlock_destroy (gl_rwlock_t *lock);
+
+/* --------------------- gl_recursive_lock_t datatype --------------------- */
+
+/* The Win32 documentation says that CRITICAL_SECTION already implements a
+   recursive lock.  But we need not rely on it: It's easy to implement a
+   recursive lock without this assumption.  */
+
+typedef struct
+        {
+          gl_spinlock_t guard; /* protects the initialization */
+          DWORD owner;
+          unsigned long depth;
+          CRITICAL_SECTION lock;
+        }
+        gl_recursive_lock_t;
+# define gl_recursive_lock_define(STORAGECLASS, NAME) \
+    STORAGECLASS gl_recursive_lock_t NAME;
+# define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \
+    STORAGECLASS gl_recursive_lock_t NAME = gl_recursive_lock_initializer;
+# define gl_recursive_lock_initializer \
+    { { 0, -1 }, 0, 0 }
+# define gl_recursive_lock_init(NAME) \
+    glthread_recursive_lock_init (&NAME)
+# define gl_recursive_lock_lock(NAME) \
+    glthread_recursive_lock_lock (&NAME)
+# define gl_recursive_lock_unlock(NAME) \
+    glthread_recursive_lock_unlock (&NAME)
+# define gl_recursive_lock_destroy(NAME) \
+    glthread_recursive_lock_destroy (&NAME)
+extern void glthread_recursive_lock_init (gl_recursive_lock_t *lock);
+extern void glthread_recursive_lock_lock (gl_recursive_lock_t *lock);
+extern void glthread_recursive_lock_unlock (gl_recursive_lock_t *lock);
+extern void glthread_recursive_lock_destroy (gl_recursive_lock_t *lock);
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+typedef struct
+        {
+          volatile int inited;
+          volatile long started;
+          CRITICAL_SECTION lock;
+        }
+        gl_once_t;
+# define gl_once_define(STORAGECLASS, NAME) \
+    STORAGECLASS gl_once_t NAME = { -1, -1 };
+# define gl_once(NAME, INITFUNCTION) \
+    glthread_once (&NAME, INITFUNCTION)
+extern void glthread_once (gl_once_t *once_control, void (*initfunction) (void));
+
+# ifdef __cplusplus
+}
+# endif
+
+#endif
+
+/* ========================================================================= */
+
+#if !(USE_POSIX_THREADS || USE_PTH_THREADS || USE_SOLARIS_THREADS || USE_WIN32_THREADS)
+
+/* Provide dummy implementation if threads are not supported.  */
+
+/* -------------------------- gl_lock_t datatype -------------------------- */
+
+typedef int gl_lock_t;
+# define gl_lock_define(STORAGECLASS, NAME)
+# define gl_lock_define_initialized(STORAGECLASS, NAME)
+# define gl_lock_init(NAME)
+# define gl_lock_lock(NAME)
+# define gl_lock_unlock(NAME)
+
+/* ------------------------- gl_rwlock_t datatype ------------------------- */
+
+typedef int gl_rwlock_t;
+# define gl_rwlock_define(STORAGECLASS, NAME)
+# define gl_rwlock_define_initialized(STORAGECLASS, NAME)
+# define gl_rwlock_init(NAME)
+# define gl_rwlock_rdlock(NAME)
+# define gl_rwlock_wrlock(NAME)
+# define gl_rwlock_unlock(NAME)
+
+/* --------------------- gl_recursive_lock_t datatype --------------------- */
+
+typedef int gl_recursive_lock_t;
+# define gl_recursive_lock_define(STORAGECLASS, NAME)
+# define gl_recursive_lock_define_initialized(STORAGECLASS, NAME)
+# define gl_recursive_lock_init(NAME)
+# define gl_recursive_lock_lock(NAME)
+# define gl_recursive_lock_unlock(NAME)
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+typedef int gl_once_t;
+# define gl_once_define(STORAGECLASS, NAME) \
+    STORAGECLASS gl_once_t NAME = 0;
+# define gl_once(NAME, INITFUNCTION) \
+    do                       \
+      {                      \
+        if (NAME == 0)       \
+          {                  \
+            NAME = ~ 0;      \
+            INITFUNCTION (); \
+          }                  \
+      }                      \
+    while (0)
+
+#endif
+
+/* ========================================================================= */
+
+#endif /* _LOCK_H */
diff --git a/gnulib/printf-args.c b/gnulib/printf-args.c
new file mode 100644 (file)
index 0000000..2259d53
--- /dev/null
@@ -0,0 +1,141 @@
+/* Decomposed printf argument list.
+   Copyright (C) 1999, 2002-2003, 2005-2007 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License along
+   with this program; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include "printf-args.h"
+
+#ifdef STATIC
+STATIC
+#endif
+int
+printf_fetchargs (va_list args, arguments *a)
+{
+  size_t i;
+  argument *ap;
+
+  for (i = 0, ap = &a->arg[0]; i < a->count; i++, ap++)
+    switch (ap->type)
+      {
+      case TYPE_SCHAR:
+       ap->a.a_schar = va_arg (args, /*signed char*/ int);
+       break;
+      case TYPE_UCHAR:
+       ap->a.a_uchar = va_arg (args, /*unsigned char*/ int);
+       break;
+      case TYPE_SHORT:
+       ap->a.a_short = va_arg (args, /*short*/ int);
+       break;
+      case TYPE_USHORT:
+       ap->a.a_ushort = va_arg (args, /*unsigned short*/ int);
+       break;
+      case TYPE_INT:
+       ap->a.a_int = va_arg (args, int);
+       break;
+      case TYPE_UINT:
+       ap->a.a_uint = va_arg (args, unsigned int);
+       break;
+      case TYPE_LONGINT:
+       ap->a.a_longint = va_arg (args, long int);
+       break;
+      case TYPE_ULONGINT:
+       ap->a.a_ulongint = va_arg (args, unsigned long int);
+       break;
+#if HAVE_LONG_LONG_INT
+      case TYPE_LONGLONGINT:
+       ap->a.a_longlongint = va_arg (args, long long int);
+       break;
+      case TYPE_ULONGLONGINT:
+       ap->a.a_ulonglongint = va_arg (args, unsigned long long int);
+       break;
+#endif
+      case TYPE_DOUBLE:
+       ap->a.a_double = va_arg (args, double);
+       break;
+#if HAVE_LONG_DOUBLE
+      case TYPE_LONGDOUBLE:
+       ap->a.a_longdouble = va_arg (args, long double);
+       break;
+#endif
+      case TYPE_CHAR:
+       ap->a.a_char = va_arg (args, int);
+       break;
+#if HAVE_WINT_T
+      case TYPE_WIDE_CHAR:
+       /* Although ISO C 99 7.24.1.(2) says that wint_t is "unchanged by
+          default argument promotions", this is not the case in mingw32,
+          where wint_t is 'unsigned short'.  */
+       ap->a.a_wide_char =
+         (sizeof (wint_t) < sizeof (int)
+          ? va_arg (args, int)
+          : va_arg (args, wint_t));
+       break;
+#endif
+      case TYPE_STRING:
+       ap->a.a_string = va_arg (args, const char *);
+       /* A null pointer is an invalid argument for "%s", but in practice
+          it occurs quite frequently in printf statements that produce
+          debug output.  Use a fallback in this case.  */
+       if (ap->a.a_string == NULL)
+         ap->a.a_string = "(NULL)";
+       break;
+#if HAVE_WCHAR_T
+      case TYPE_WIDE_STRING:
+       ap->a.a_wide_string = va_arg (args, const wchar_t *);
+       /* A null pointer is an invalid argument for "%ls", but in practice
+          it occurs quite frequently in printf statements that produce
+          debug output.  Use a fallback in this case.  */
+       if (ap->a.a_wide_string == NULL)
+         {
+           static const wchar_t wide_null_string[] =
+             {
+               (wchar_t)'(',
+               (wchar_t)'N', (wchar_t)'U', (wchar_t)'L', (wchar_t)'L',
+               (wchar_t)')',
+               (wchar_t)0
+             };
+           ap->a.a_wide_string = wide_null_string;
+         }
+       break;
+#endif
+      case TYPE_POINTER:
+       ap->a.a_pointer = va_arg (args, void *);
+       break;
+      case TYPE_COUNT_SCHAR_POINTER:
+       ap->a.a_count_schar_pointer = va_arg (args, signed char *);
+       break;
+      case TYPE_COUNT_SHORT_POINTER:
+       ap->a.a_count_short_pointer = va_arg (args, short *);
+       break;
+      case TYPE_COUNT_INT_POINTER:
+       ap->a.a_count_int_pointer = va_arg (args, int *);
+       break;
+      case TYPE_COUNT_LONGINT_POINTER:
+       ap->a.a_count_longint_pointer = va_arg (args, long int *);
+       break;
+#if HAVE_LONG_LONG_INT
+      case TYPE_COUNT_LONGLONGINT_POINTER:
+       ap->a.a_count_longlongint_pointer = va_arg (args, long long int *);
+       break;
+#endif
+      default:
+       /* Unknown type.  */
+       return -1;
+      }
+  return 0;
+}
diff --git a/gnulib/printf-args.h b/gnulib/printf-args.h
new file mode 100644 (file)
index 0000000..74a18d9
--- /dev/null
@@ -0,0 +1,136 @@
+/* Decomposed printf argument list.
+   Copyright (C) 1999, 2002-2003, 2006-2007 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License along
+   with this program; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#ifndef _PRINTF_ARGS_H
+#define _PRINTF_ARGS_H
+
+/* Get size_t.  */
+#include <stddef.h>
+
+/* Get wchar_t.  */
+#if HAVE_WCHAR_T
+# include <stddef.h>
+#endif
+
+/* Get wint_t.  */
+#if HAVE_WINT_T
+# include <wchar.h>
+#endif
+
+/* Get va_list.  */
+#include <stdarg.h>
+
+
+/* Argument types */
+typedef enum
+{
+  TYPE_NONE,
+  TYPE_SCHAR,
+  TYPE_UCHAR,
+  TYPE_SHORT,
+  TYPE_USHORT,
+  TYPE_INT,
+  TYPE_UINT,
+  TYPE_LONGINT,
+  TYPE_ULONGINT,
+#if HAVE_LONG_LONG_INT
+  TYPE_LONGLONGINT,
+  TYPE_ULONGLONGINT,
+#endif
+  TYPE_DOUBLE,
+#if HAVE_LONG_DOUBLE
+  TYPE_LONGDOUBLE,
+#endif
+  TYPE_CHAR,
+#if HAVE_WINT_T
+  TYPE_WIDE_CHAR,
+#endif
+  TYPE_STRING,
+#if HAVE_WCHAR_T
+  TYPE_WIDE_STRING,
+#endif
+  TYPE_POINTER,
+  TYPE_COUNT_SCHAR_POINTER,
+  TYPE_COUNT_SHORT_POINTER,
+  TYPE_COUNT_INT_POINTER,
+  TYPE_COUNT_LONGINT_POINTER
+#if HAVE_LONG_LONG_INT
+, TYPE_COUNT_LONGLONGINT_POINTER
+#endif
+} arg_type;
+
+/* Polymorphic argument */
+typedef struct
+{
+  arg_type type;
+  union
+  {
+    signed char                        a_schar;
+    unsigned char              a_uchar;
+    short                      a_short;
+    unsigned short             a_ushort;
+    int                                a_int;
+    unsigned int               a_uint;
+    long int                   a_longint;
+    unsigned long int          a_ulongint;
+#if HAVE_LONG_LONG_INT
+    long long int              a_longlongint;
+    unsigned long long int     a_ulonglongint;
+#endif
+    float                      a_float;
+    double                     a_double;
+#if HAVE_LONG_DOUBLE
+    long double                        a_longdouble;
+#endif
+    int                                a_char;
+#if HAVE_WINT_T
+    wint_t                     a_wide_char;
+#endif
+    const char*                        a_string;
+#if HAVE_WCHAR_T
+    const wchar_t*             a_wide_string;
+#endif
+    void*                      a_pointer;
+    signed char *              a_count_schar_pointer;
+    short *                    a_count_short_pointer;
+    int *                      a_count_int_pointer;
+    long int *                 a_count_longint_pointer;
+#if HAVE_LONG_LONG_INT
+    long long int *            a_count_longlongint_pointer;
+#endif
+  }
+  a;
+}
+argument;
+
+typedef struct
+{
+  size_t count;
+  argument *arg;
+}
+arguments;
+
+
+/* Fetch the arguments, putting them into a. */
+#ifdef STATIC
+STATIC
+#else
+extern
+#endif
+int printf_fetchargs (va_list args, arguments *a);
+
+#endif /* _PRINTF_ARGS_H */
diff --git a/gnulib/printf-parse.c b/gnulib/printf-parse.c
new file mode 100644 (file)
index 0000000..f5cdb6e
--- /dev/null
@@ -0,0 +1,543 @@
+/* Formatted output to strings.
+   Copyright (C) 1999-2000, 2002-2003, 2006-2007 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License along
+   with this program; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#include <config.h>
+
+/* Specification.  */
+#if WIDE_CHAR_VERSION
+# include "wprintf-parse.h"
+#else
+# include "printf-parse.h"
+#endif
+
+/* Get size_t, NULL.  */
+#include <stddef.h>
+
+/* Get intmax_t.  */
+#if HAVE_STDINT_H_WITH_UINTMAX
+# include <stdint.h>
+#endif
+#if HAVE_INTTYPES_H_WITH_UINTMAX
+# include <inttypes.h>
+#endif
+
+/* malloc(), realloc(), free().  */
+#include <stdlib.h>
+
+/* Checked size_t computations.  */
+#include "xsize.h"
+
+#if WIDE_CHAR_VERSION
+# define PRINTF_PARSE wprintf_parse
+# define CHAR_T wchar_t
+# define DIRECTIVE wchar_t_directive
+# define DIRECTIVES wchar_t_directives
+#else
+# define PRINTF_PARSE printf_parse
+# define CHAR_T char
+# define DIRECTIVE char_directive
+# define DIRECTIVES char_directives
+#endif
+
+#ifdef STATIC
+STATIC
+#endif
+int
+PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
+{
+  const CHAR_T *cp = format;           /* pointer into format */
+  size_t arg_posn = 0;         /* number of regular arguments consumed */
+  size_t d_allocated;                  /* allocated elements of d->dir */
+  size_t a_allocated;                  /* allocated elements of a->arg */
+  size_t max_width_length = 0;
+  size_t max_precision_length = 0;
+
+  d->count = 0;
+  d_allocated = 1;
+  d->dir = (DIRECTIVE *) malloc (d_allocated * sizeof (DIRECTIVE));
+  if (d->dir == NULL)
+    /* Out of memory.  */
+    return -1;
+
+  a->count = 0;
+  a_allocated = 0;
+  a->arg = NULL;
+
+#define REGISTER_ARG(_index_,_type_) \
+  {                                                                    \
+    size_t n = (_index_);                                              \
+    if (n >= a_allocated)                                              \
+      {                                                                        \
+       size_t memory_size;                                             \
+       argument *memory;                                               \
+                                                                       \
+       a_allocated = xtimes (a_allocated, 2);                          \
+       if (a_allocated <= n)                                           \
+         a_allocated = xsum (n, 1);                                    \
+       memory_size = xtimes (a_allocated, sizeof (argument));          \
+       if (size_overflow_p (memory_size))                              \
+         /* Overflow, would lead to out of memory.  */                 \
+         goto error;                                                   \
+       memory = (argument *) (a->arg                                   \
+                              ? realloc (a->arg, memory_size)          \
+                              : malloc (memory_size));                 \
+       if (memory == NULL)                                             \
+         /* Out of memory.  */                                         \
+         goto error;                                                   \
+       a->arg = memory;                                                \
+      }                                                                        \
+    while (a->count <= n)                                              \
+      a->arg[a->count++].type = TYPE_NONE;                             \
+    if (a->arg[n].type == TYPE_NONE)                                   \
+      a->arg[n].type = (_type_);                                       \
+    else if (a->arg[n].type != (_type_))                               \
+      /* Ambiguous type for positional argument.  */                   \
+      goto error;                                                      \
+  }
+
+  while (*cp != '\0')
+    {
+      CHAR_T c = *cp++;
+      if (c == '%')
+       {
+         size_t arg_index = ARG_NONE;
+         DIRECTIVE *dp = &d->dir[d->count];/* pointer to next directive */
+
+         /* Initialize the next directive.  */
+         dp->dir_start = cp - 1;
+         dp->flags = 0;
+         dp->width_start = NULL;
+         dp->width_end = NULL;
+         dp->width_arg_index = ARG_NONE;
+         dp->precision_start = NULL;
+         dp->precision_end = NULL;
+         dp->precision_arg_index = ARG_NONE;
+         dp->arg_index = ARG_NONE;
+
+         /* Test for positional argument.  */
+         if (*cp >= '0' && *cp <= '9')
+           {
+             const CHAR_T *np;
+
+             for (np = cp; *np >= '0' && *np <= '9'; np++)
+               ;
+             if (*np == '$')
+               {
+                 size_t n = 0;
+
+                 for (np = cp; *np >= '0' && *np <= '9'; np++)
+                   n = xsum (xtimes (n, 10), *np - '0');
+                 if (n == 0)
+                   /* Positional argument 0.  */
+                   goto error;
+                 if (size_overflow_p (n))
+                   /* n too large, would lead to out of memory later.  */
+                   goto error;
+                 arg_index = n - 1;
+                 cp = np + 1;
+               }
+           }
+
+         /* Read the flags.  */
+         for (;;)
+           {
+             if (*cp == '\'')
+               {
+                 dp->flags |= FLAG_GROUP;
+                 cp++;
+               }
+             else if (*cp == '-')
+               {
+                 dp->flags |= FLAG_LEFT;
+                 cp++;
+               }
+             else if (*cp == '+')
+               {
+                 dp->flags |= FLAG_SHOWSIGN;
+                 cp++;
+               }
+             else if (*cp == ' ')
+               {
+                 dp->flags |= FLAG_SPACE;
+                 cp++;
+               }
+             else if (*cp == '#')
+               {
+                 dp->flags |= FLAG_ALT;
+                 cp++;
+               }
+             else if (*cp == '0')
+               {
+                 dp->flags |= FLAG_ZERO;
+                 cp++;
+               }
+             else
+               break;
+           }
+
+         /* Parse the field width.  */
+         if (*cp == '*')
+           {
+             dp->width_start = cp;
+             cp++;
+             dp->width_end = cp;
+             if (max_width_length < 1)
+               max_width_length = 1;
+
+             /* Test for positional argument.  */
+             if (*cp >= '0' && *cp <= '9')
+               {
+                 const CHAR_T *np;
+
+                 for (np = cp; *np >= '0' && *np <= '9'; np++)
+                   ;
+                 if (*np == '$')
+                   {
+                     size_t n = 0;
+
+                     for (np = cp; *np >= '0' && *np <= '9'; np++)
+                       n = xsum (xtimes (n, 10), *np - '0');
+                     if (n == 0)
+                       /* Positional argument 0.  */
+                       goto error;
+                     if (size_overflow_p (n))
+                       /* n too large, would lead to out of memory later.  */
+                       goto error;
+                     dp->width_arg_index = n - 1;
+                     cp = np + 1;
+                   }
+               }
+             if (dp->width_arg_index == ARG_NONE)
+               {
+                 dp->width_arg_index = arg_posn++;
+                 if (dp->width_arg_index == ARG_NONE)
+                   /* arg_posn wrapped around.  */
+                   goto error;
+               }
+             REGISTER_ARG (dp->width_arg_index, TYPE_INT);
+           }
+         else if (*cp >= '0' && *cp <= '9')
+           {
+             size_t width_length;
+
+             dp->width_start = cp;
+             for (; *cp >= '0' && *cp <= '9'; cp++)
+               ;
+             dp->width_end = cp;
+             width_length = dp->width_end - dp->width_start;
+             if (max_width_length < width_length)
+               max_width_length = width_length;
+           }
+
+         /* Parse the precision.  */
+         if (*cp == '.')
+           {
+             cp++;
+             if (*cp == '*')
+               {
+                 dp->precision_start = cp - 1;
+                 cp++;
+                 dp->precision_end = cp;
+                 if (max_precision_length < 2)
+                   max_precision_length = 2;
+
+                 /* Test for positional argument.  */
+                 if (*cp >= '0' && *cp <= '9')
+                   {
+                     const CHAR_T *np;
+
+                     for (np = cp; *np >= '0' && *np <= '9'; np++)
+                       ;
+                     if (*np == '$')
+                       {
+                         size_t n = 0;
+
+                         for (np = cp; *np >= '0' && *np <= '9'; np++)
+                           n = xsum (xtimes (n, 10), *np - '0');
+                         if (n == 0)
+                           /* Positional argument 0.  */
+                           goto error;
+                         if (size_overflow_p (n))
+                           /* n too large, would lead to out of memory
+                              later.  */
+                           goto error;
+                         dp->precision_arg_index = n - 1;
+                         cp = np + 1;
+                       }
+                   }
+                 if (dp->precision_arg_index == ARG_NONE)
+                   {
+                     dp->precision_arg_index = arg_posn++;
+                     if (dp->precision_arg_index == ARG_NONE)
+                       /* arg_posn wrapped around.  */
+                       goto error;
+                   }
+                 REGISTER_ARG (dp->precision_arg_index, TYPE_INT);
+               }
+             else
+               {
+                 size_t precision_length;
+
+                 dp->precision_start = cp - 1;
+                 for (; *cp >= '0' && *cp <= '9'; cp++)
+                   ;
+                 dp->precision_end = cp;
+                 precision_length = dp->precision_end - dp->precision_start;
+                 if (max_precision_length < precision_length)
+                   max_precision_length = precision_length;
+               }
+           }
+
+         {
+           arg_type type;
+
+           /* Parse argument type/size specifiers.  */
+           {
+             int flags = 0;
+
+             for (;;)
+               {
+                 if (*cp == 'h')
+                   {
+                     flags |= (1 << (flags & 1));
+                     cp++;
+                   }
+                 else if (*cp == 'L')
+                   {
+                     flags |= 4;
+                     cp++;
+                   }
+                 else if (*cp == 'l')
+                   {
+                     flags += 8;
+                     cp++;
+                   }
+#if HAVE_INTMAX_T
+                 else if (*cp == 'j')
+                   {
+                     if (sizeof (intmax_t) > sizeof (long))
+                       {
+                         /* intmax_t = long long */
+                         flags += 16;
+                       }
+                     else if (sizeof (intmax_t) > sizeof (int))
+                       {
+                         /* intmax_t = long */
+                         flags += 8;
+                       }
+                     cp++;
+                   }
+#endif
+                 else if (*cp == 'z' || *cp == 'Z')
+                   {
+                     /* 'z' is standardized in ISO C 99, but glibc uses 'Z'
+                        because the warning facility in gcc-2.95.2 understands
+                        only 'Z' (see gcc-2.95.2/gcc/c-common.c:1784).  */
+                     if (sizeof (size_t) > sizeof (long))
+                       {
+                         /* size_t = long long */
+                         flags += 16;
+                       }
+                     else if (sizeof (size_t) > sizeof (int))
+                       {
+                         /* size_t = long */
+                         flags += 8;
+                       }
+                     cp++;
+                   }
+                 else if (*cp == 't')
+                   {
+                     if (sizeof (ptrdiff_t) > sizeof (long))
+                       {
+                         /* ptrdiff_t = long long */
+                         flags += 16;
+                       }
+                     else if (sizeof (ptrdiff_t) > sizeof (int))
+                       {
+                         /* ptrdiff_t = long */
+                         flags += 8;
+                       }
+                     cp++;
+                   }
+                 else
+                   break;
+               }
+
+             /* Read the conversion character.  */
+             c = *cp++;
+             switch (c)
+               {
+               case 'd': case 'i':
+#if HAVE_LONG_LONG_INT
+                 /* If 'long long' exists and is larger than 'long':  */
+                 if (flags >= 16 || (flags & 4))
+                   type = TYPE_LONGLONGINT;
+                 else
+#endif
+                 /* If 'long long' exists and is the same as 'long', we parse
+                    "lld" into TYPE_LONGINT.  */
+                 if (flags >= 8)
+                   type = TYPE_LONGINT;
+                 else if (flags & 2)
+                   type = TYPE_SCHAR;
+                 else if (flags & 1)
+                   type = TYPE_SHORT;
+                 else
+                   type = TYPE_INT;
+                 break;
+               case 'o': case 'u': case 'x': case 'X':
+#if HAVE_LONG_LONG_INT
+                 /* If 'long long' exists and is larger than 'long':  */
+                 if (flags >= 16 || (flags & 4))
+                   type = TYPE_ULONGLONGINT;
+                 else
+#endif
+                 /* If 'unsigned long long' exists and is the same as
+                    'unsigned long', we parse "llu" into TYPE_ULONGINT.  */
+                 if (flags >= 8)
+                   type = TYPE_ULONGINT;
+                 else if (flags & 2)
+                   type = TYPE_UCHAR;
+                 else if (flags & 1)
+                   type = TYPE_USHORT;
+                 else
+                   type = TYPE_UINT;
+                 break;
+               case 'f': case 'F': case 'e': case 'E': case 'g': case 'G':
+               case 'a': case 'A':
+#if HAVE_LONG_DOUBLE
+                 if (flags >= 16 || (flags & 4))
+                   type = TYPE_LONGDOUBLE;
+                 else
+#endif
+                 type = TYPE_DOUBLE;
+                 break;
+               case 'c':
+                 if (flags >= 8)
+#if HAVE_WINT_T
+                   type = TYPE_WIDE_CHAR;
+#else
+                   goto error;
+#endif
+                 else
+                   type = TYPE_CHAR;
+                 break;
+#if HAVE_WINT_T
+               case 'C':
+                 type = TYPE_WIDE_CHAR;
+                 c = 'c';
+                 break;
+#endif
+               case 's':
+                 if (flags >= 8)
+#if HAVE_WCHAR_T
+                   type = TYPE_WIDE_STRING;
+#else
+                   goto error;
+#endif
+                 else
+                   type = TYPE_STRING;
+                 break;
+#if HAVE_WCHAR_T
+               case 'S':
+                 type = TYPE_WIDE_STRING;
+                 c = 's';
+                 break;
+#endif
+               case 'p':
+                 type = TYPE_POINTER;
+                 break;
+               case 'n':
+#if HAVE_LONG_LONG_INT
+                 /* If 'long long' exists and is larger than 'long':  */
+                 if (flags >= 16 || (flags & 4))
+                   type = TYPE_COUNT_LONGLONGINT_POINTER;
+                 else
+#endif
+                 /* If 'long long' exists and is the same as 'long', we parse
+                    "lln" into TYPE_COUNT_LONGINT_POINTER.  */
+                 if (flags >= 8)
+                   type = TYPE_COUNT_LONGINT_POINTER;
+                 else if (flags & 2)
+                   type = TYPE_COUNT_SCHAR_POINTER;
+                 else if (flags & 1)
+                   type = TYPE_COUNT_SHORT_POINTER;
+                 else
+                   type = TYPE_COUNT_INT_POINTER;
+                 break;
+               case '%':
+                 type = TYPE_NONE;
+                 break;
+               default:
+                 /* Unknown conversion character.  */
+                 goto error;
+               }
+           }
+
+           if (type != TYPE_NONE)
+             {
+               dp->arg_index = arg_index;
+               if (dp->arg_index == ARG_NONE)
+                 {
+                   dp->arg_index = arg_posn++;
+                   if (dp->arg_index == ARG_NONE)
+                     /* arg_posn wrapped around.  */
+                     goto error;
+                 }
+               REGISTER_ARG (dp->arg_index, type);
+             }
+           dp->conversion = c;
+           dp->dir_end = cp;
+         }
+
+         d->count++;
+         if (d->count >= d_allocated)
+           {
+             size_t memory_size;
+             DIRECTIVE *memory;
+
+             d_allocated = xtimes (d_allocated, 2);
+             memory_size = xtimes (d_allocated, sizeof (DIRECTIVE));
+             if (size_overflow_p (memory_size))
+               /* Overflow, would lead to out of memory.  */
+               goto error;
+             memory = (DIRECTIVE *) realloc (d->dir, memory_size);
+             if (memory == NULL)
+               /* Out of memory.  */
+               goto error;
+             d->dir = memory;
+           }
+       }
+    }
+  d->dir[d->count].dir_start = cp;
+
+  d->max_width_length = max_width_length;
+  d->max_precision_length = max_precision_length;
+  return 0;
+
+error:
+  if (a->arg)
+    free (a->arg);
+  if (d->dir)
+    free (d->dir);
+  return -1;
+}
+
+#undef DIRECTIVES
+#undef DIRECTIVE
+#undef CHAR_T
+#undef PRINTF_PARSE
diff --git a/gnulib/printf-parse.h b/gnulib/printf-parse.h
new file mode 100644 (file)
index 0000000..82a0d37
--- /dev/null
@@ -0,0 +1,74 @@
+/* Parse printf format string.
+   Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License along
+   with this program; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#ifndef _PRINTF_PARSE_H
+#define _PRINTF_PARSE_H
+
+#include "printf-args.h"
+
+
+/* Flags */
+#define FLAG_GROUP      1      /* ' flag */
+#define FLAG_LEFT       2      /* - flag */
+#define FLAG_SHOWSIGN   4      /* + flag */
+#define FLAG_SPACE      8      /* space flag */
+#define FLAG_ALT       16      /* # flag */
+#define FLAG_ZERO      32
+
+/* arg_index value indicating that no argument is consumed.  */
+#define ARG_NONE       (~(size_t)0)
+
+/* A parsed directive.  */
+typedef struct
+{
+  const char* dir_start;
+  const char* dir_end;
+  int flags;
+  const char* width_start;
+  const char* width_end;
+  size_t width_arg_index;
+  const char* precision_start;
+  const char* precision_end;
+  size_t precision_arg_index;
+  char conversion; /* d i o u x X f e E g G c s p n U % but not C S */
+  size_t arg_index;
+}
+char_directive;
+
+/* A parsed format string.  */
+typedef struct
+{
+  size_t count;
+  char_directive *dir;
+  size_t max_width_length;
+  size_t max_precision_length;
+}
+char_directives;
+
+
+/* Parses the format string.  Fills in the number N of directives, and fills
+   in directives[0], ..., directives[N-1], and sets directives[N].dir_start
+   to the end of the format string.  Also fills in the arg_type fields of the
+   arguments and the needed count of arguments.  */
+#ifdef STATIC
+STATIC
+#else
+extern
+#endif
+int printf_parse (const char *format, char_directives *d, arguments *a);
+
+#endif /* _PRINTF_PARSE_H */
diff --git a/gnulib/regenerate/getaddrinfo-cygwin.patch b/gnulib/regenerate/getaddrinfo-cygwin.patch
new file mode 100644 (file)
index 0000000..7a384cc
--- /dev/null
@@ -0,0 +1,194 @@
+--- gnulib/getaddrinfo.c       2007-03-06 13:17:25.733225500 -0600
++++ gnulib/getaddrinfo.c       2007-03-06 13:17:32.345638750 -0600
+@@ -40,6 +40,8 @@
+ #include "inet_ntop.h"
+ #include "snprintf.h"
++extern int h_errno;
++
+ /* BeOS has AF_INET, but not PF_INET.  */
+ #ifndef PF_INET
+ # define PF_INET AF_INET
+@@ -147,25 +149,29 @@
+     return getaddrinfo_ptr (nodename, servname, hints, res);
+ #endif
+-  if (hints && (hints->ai_flags & ~(AI_CANONNAME|AI_PASSIVE)))
++  if (hints && (hints->ai_flags & ~(AI_CANONNAME | AI_PASSIVE)))
+     /* FIXME: Support more flags. */
+     return EAI_BADFLAGS;
+   if (hints && !validate_family (hints->ai_family))
+     return EAI_FAMILY;
+-  if (hints &&
+-      hints->ai_socktype != SOCK_STREAM && hints->ai_socktype != SOCK_DGRAM)
+-    /* FIXME: Support other socktype. */
+-    return EAI_SOCKTYPE; /* FIXME: Better return code? */
++  if ((hints != NULL) &&
++      (hints->ai_socktype != 0) &&
++      (hints->ai_socktype != SOCK_STREAM) &&
++      (hints->ai_socktype != SOCK_DGRAM))
++    {
++      /* FIXME: Support other socktype. */
++      return EAI_SOCKTYPE; /* FIXME: Better return code? */
++    }
+   if (!nodename)
+     {
+-      if (!(hints->ai_flags & AI_PASSIVE))
++      if (hints && !(hints->ai_flags & AI_PASSIVE))
+       return EAI_NONAME;
+ #ifdef HAVE_IPV6
+-      nodename = (hints->ai_family == AF_INET6) ? "::" : "0.0.0.0";
++      nodename = (hints && (hints->ai_family == AF_INET6)) ? "::" : "0.0.0.0";
+ #else
+       nodename = "0.0.0.0";
+ #endif
+@@ -175,11 +181,13 @@
+     {
+       struct servent *se = NULL;
+       const char *proto =
+-      (hints && hints->ai_socktype == SOCK_DGRAM) ? "udp" : "tcp";
++      (hints && (hints->ai_socktype == SOCK_DGRAM)) ? "udp" : "tcp";
+-      if (!(hints->ai_flags & AI_NUMERICSERV))
+-      /* FIXME: Use getservbyname_r if available. */
+-      se = getservbyname (servname, proto);
++      if ((hints == NULL) || !(hints->ai_flags & AI_NUMERICSERV))
++        {
++        /* FIXME: Use getservbyname_r if available. */
++        se = getservbyname (servname, proto);
++        }
+       if (!se)
+       {
+@@ -196,7 +204,7 @@
+     }
+   /* FIXME: Use gethostbyname_r if available. */
+-  he = gethostbyname (nodename);
++  he = gethostbyname(nodename);
+   if (!he || he->h_addr_list[0] == NULL)
+     return EAI_NONAME;
+@@ -277,7 +285,7 @@
+       return EAI_NODATA;
+     }
+-  if (hints && hints->ai_flags & AI_CANONNAME)
++  if (hints && (hints->ai_flags & AI_CANONNAME))
+     {
+       const char *cn;
+       if (he->h_name)
+@@ -341,9 +349,7 @@
+ #endif
+   /* FIXME: Support other flags. */
+-  if ((node && nodelen > 0 && !(flags & NI_NUMERICHOST)) ||
+-      (service && servicelen > 0 && !(flags & NI_NUMERICHOST)) ||
+-      (flags & ~(NI_NUMERICHOST|NI_NUMERICSERV)))
++  if (flags & ~(NI_NUMERICHOST | NI_NUMERICSERV))
+     return EAI_BADFLAGS;
+   if (sa == NULL || salen < sizeof (sa->sa_family))
+@@ -367,34 +373,89 @@
+       return EAI_FAMILY;
+     }
+-  if (node && nodelen > 0 && flags & NI_NUMERICHOST)
++  if (node && (nodelen > 0))
+     {
++      char    addrbuf[256];
++
+       switch (sa->sa_family)
+       {
+ #if HAVE_IPV4
+       case AF_INET:
+-        if (!inet_ntop (AF_INET,
++        if (flags & NI_NUMERICHOST)
++          {
++            if (!inet_ntop (AF_INET,
+                         &(((const struct sockaddr_in *) sa)->sin_addr),
+-                        node, nodelen))
+-          return EAI_SYSTEM;
++                        addrbuf, sizeof(addrbuf)))
++            return EAI_SYSTEM;
++          }
++        else
++          {
++            struct hostent *host_ent = gethostbyaddr(
++                        (char *)&(((struct sockaddr_in *)sa)->sin_addr),
++                        sizeof(struct sockaddr_in),
++                        sa->sa_family);
++            if (host_ent != NULL)
++              {
++                if (nodelen <= snprintf(node, nodelen, "%s",
++                                      host_ent->h_name))
++                   return EAI_OVERFLOW;
++              }
++            else
++              {
++                if (!inet_ntop (AF_INET,
++                        &(((const struct sockaddr_in *) sa)->sin_addr),
++                        addrbuf, sizeof(addrbuf)))
++                  { 
++                    return EAI_SYSTEM;
++                  }
++                  if (nodelen <= snprintf(node, nodelen, "%s", addrbuf))
++                    return EAI_OVERFLOW;
++              }
++          }
+         break;
+ #endif
+ #if HAVE_IPV6
+       case AF_INET6:
+-        if (!inet_ntop (AF_INET6,
++        if (flags & NI_NUMERICHOST)
++          {
++            if (!inet_ntop (AF_INET6,
++                        &(((const struct sockaddr_in6 *) sa)->sin6_addr),
++                        addrbuf, sizeof(addrbuf)))
++            return EAI_SYSTEM;
++          }
++        else
++          {
++            struct hostent *host_ent = gethostbyaddr(
++                        (char *)&(((struct sockaddr_in6 *)sa)->sin6_addr),
++                        sizeof(struct sockaddr_in6),
++                        sa->sa_family);
++            if (host_ent != NULL)
++              {
++                if (nodelen <= snprintf(node, nodelen, "%s",
++                                      host_ent->h_name))
++                   return EAI_OVERFLOW;
++              }
++            else
++              {
++                if (!inet_ntop (AF_INET6,
+                         &(((const struct sockaddr_in6 *) sa)->sin6_addr),
+-                        node, nodelen))
+-          return EAI_SYSTEM;
++                        addrbuf, sizeof(addrbuf)))
++                  { 
++                    return EAI_SYSTEM;
++                  }
++                  if (nodelen <= snprintf(node, nodelen, "%s", addrbuf))
++                    return EAI_OVERFLOW;
++              }
++          }
+         break;
+ #endif
+-
+       default:
+         return EAI_FAMILY;
+       }
+     }
+-  if (service && servicelen > 0 && flags & NI_NUMERICSERV)
++  if (service && (servicelen > 0))
+     switch (sa->sa_family)
+       {
+ #if HAVE_IPV4
diff --git a/gnulib/regenerate/no-error.patch b/gnulib/regenerate/no-error.patch
new file mode 100644 (file)
index 0000000..411d948
--- /dev/null
@@ -0,0 +1,14 @@
+Index: gnulib/Makefile.am
+===================================================================
+--- gnulib/Makefile.am (revision 5691)
++++ gnulib/Makefile.am (working copy)
+@@ -26,6 +26,9 @@
+ MAINTAINERCLEANFILES =
+ AM_CPPFLAGS =
++if GCC_COMPILER
++  AM_CFLAGS += -Wno-error
++endif
+ noinst_LTLIBRARIES += libgnu.la
diff --git a/gnulib/regenerate/regenerate b/gnulib/regenerate/regenerate
new file mode 100644 (file)
index 0000000..0265ca2
--- /dev/null
@@ -0,0 +1,81 @@
+#! /bin/bash
+
+# Gnulib files in zmanda repo are from gnulib CVS updated with:
+#   cvs update -D '2007-01-31 13:12:51 -0600'
+
+# get to the project root
+cd `dirname $0`/../..
+if [ ! -f configure.in ]
+then
+    echo "Cannot navigate to project root"
+    exit 1
+fi
+
+# check that gnulib-tool is available before we do anything drastic
+[ -z "${GNULIB_TOOL}" ] && GNULIB_TOOL=gnulib-tool
+"${GNULIB_TOOL}" --version >/dev/null 2>/dev/null
+if [ "$?" != 0 ]
+then
+    echo "gnulib-tool not found; try using"
+    echo "  GNULIB_TOOL=/path/to/gnulib-tool ${0} ${@}"
+    exit 1
+fi
+
+# remove the files in gnulib and config/gnulib, but not directories
+# (and, in particular, not the gnulib/regenerate directory)
+shopt -s nullglob
+for filename in gnulib/* config/gnulib/*
+do
+    [ -d "${filename}" ] && continue
+    echo "Removing ${filename}"
+    rm "${filename}" || exit 1
+done
+shopt -u nullglob
+
+########################## DEVELOPERS! ###############################
+## Add your modules here, then see below if you need to patch them. ##
+######################################################################
+
+GNULIB_MODULES="getaddrinfo lock visibility"
+
+######################################################################
+## End modules                                                      ##
+######################################################################
+
+# check out a brand new gnulib directory and gnulib.m4i
+
+"${GNULIB_TOOL}" --import \
+        --dir=. --lib=libgnu --source-base=gnulib --m4-base=config/gnulib \
+        --doc-base=doc --aux-dir=config --libtool --macro-prefix=gl \
+        ${GNULIB_MODULES} || exit 1
+
+for filename in config/gnulib/*.m4
+ do
+    echo "m4_include([$filename])"
+done > config/gnulib.m4i || exit 1
+
+########################## DEVELOPERS! ###############################
+## Add your patch commands here, or use sed invoacations, etc.      ##
+## Please comment heavily!                                          ##
+######################################################################
+PATCH_DIR="`pwd`/gnulib/regenerate"
+
+
+# Patch Makefile.am to not error out on warnings
+patch -p0 < "${PATCH_DIR}/no-error.patch" || exit 1
+
+
+# Add John's patches to getaddrinfo.c for use in cygwin
+patch -p0 < "${PATCH_DIR}/getaddrinfo-cygwin.patch" || exit 1
+
+
+# Add info to the makefile to ensure all this stuff gets put in
+# the distribution tarball
+(   echo ""
+    echo "# Make sure regenerate/* are in the distribution tarball"
+    echo "EXTRA_DIST += "`cd gnulib; find regenerate -name .svn -prune -o -type f -print `
+) >> gnulib/Makefile.am
+
+######################################################################
+## End patches                                                      ##
+######################################################################
diff --git a/gnulib/size_max.h b/gnulib/size_max.h
new file mode 100644 (file)
index 0000000..ed0bc13
--- /dev/null
@@ -0,0 +1,31 @@
+/* size_max.h -- declare SIZE_MAX through system headers
+   Copyright (C) 2005-2006 Free Software Foundation, Inc.
+   Written by Simon Josefsson.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#ifndef GNULIB_SIZE_MAX_H
+#define GNULIB_SIZE_MAX_H
+
+/* Get SIZE_MAX declaration on systems like Solaris 7/8/9.  */
+# include <limits.h>
+/* Get SIZE_MAX declaration on systems like glibc 2.  */
+# if HAVE_STDINT_H
+#  include <stdint.h>
+# endif
+/* On systems where these include files don't define it, SIZE_MAX is defined
+   in config.h.  */
+
+#endif /* GNULIB_SIZE_MAX_H */
diff --git a/gnulib/snprintf.c b/gnulib/snprintf.c
new file mode 100644 (file)
index 0000000..db1ca9a
--- /dev/null
@@ -0,0 +1,76 @@
+/* Formatted output to strings.
+   Copyright (C) 2004, 2006 Free Software Foundation, Inc.
+   Written by Simon Josefsson and Paul Eggert.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License along
+   with this program; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#include <config.h>
+
+#include "snprintf.h"
+
+#include <errno.h>
+#include <limits.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "vasnprintf.h"
+
+/* Some systems, like OSF/1 4.0 and Woe32, don't have EOVERFLOW.  */
+#ifndef EOVERFLOW
+# define EOVERFLOW E2BIG
+#endif
+
+/* Print formatted output to string STR.  Similar to sprintf, but
+   additional length SIZE limit how much is written into STR.  Returns
+   string length of formatted string (which may be larger than SIZE).
+   STR may be NULL, in which case nothing will be written.  On error,
+   return a negative value. */
+int
+snprintf (char *str, size_t size, const char *format, ...)
+{
+  char *output;
+  size_t len;
+  size_t lenbuf = size;
+  va_list args;
+
+  va_start (args, format);
+  output = vasnprintf (str, &lenbuf, format, args);
+  len = lenbuf;
+  va_end (args);
+
+  if (!output)
+    return -1;
+
+  if (output != str)
+    {
+      if (size)
+       {
+         size_t pruned_len = (len < size ? len : size - 1);
+         memcpy (str, output, pruned_len);
+         str[pruned_len] = '\0';
+       }
+
+      free (output);
+    }
+
+  if (INT_MAX < len)
+    {
+      errno = EOVERFLOW;
+      return -1;
+    }
+
+  return len;
+}
diff --git a/gnulib/snprintf.h b/gnulib/snprintf.h
new file mode 100644 (file)
index 0000000..5032b9e
--- /dev/null
@@ -0,0 +1,29 @@
+/* Formatted output to strings.
+   Copyright (C) 2004 Free Software Foundation, Inc.
+   Written by Simon Josefsson.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License along
+   with this program; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#ifndef SNPRINTF_H
+#define SNPRINTF_H
+
+/* Get snprintf declaration, if available.  */
+#include <stdio.h>
+
+#if defined HAVE_DECL_SNPRINTF && !HAVE_DECL_SNPRINTF
+int snprintf (char *str, size_t size, const char *format, ...);
+#endif
+
+#endif /* SNPRINTF_H */
diff --git a/gnulib/socket_.h b/gnulib/socket_.h
new file mode 100644 (file)
index 0000000..8b28b5e
--- /dev/null
@@ -0,0 +1,70 @@
+/* Provide a sys/socket header file for systems lacking it (read: MinGW).
+   Copyright (C) 2005, 2006 Free Software Foundation, Inc.
+   Written by Simon Josefsson.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#ifndef _SYS_SOCKET_H
+#define _SYS_SOCKET_H
+
+/* This file is supposed to be used on platforms that lack
+   sys/socket.h.  It is intended to provide definitions and prototypes
+   needed by an application.
+
+   Currently only MinGW is supported.  See the gnulib manual regarding
+   Windows sockets.  MinGW has the header files winsock2.h and
+   ws2tcpip.h that declare the sys/socket.h definitions we need.  Note
+   that you can influence which definitions you get by setting the
+   WINVER symbol before including these two files.  For example,
+   getaddrinfo is only available if _WIN32_WINNT >= 0x0501 (that
+   symbol is set indiriectly through WINVER).  You can set this by
+   adding AC_DEFINE(WINVER, 0x0501) to configure.ac.  Note that your
+   code may not run on older Windows releases then.  My Windows 2000
+   box was not able to run the code, for example.  The situation is
+   slightly confusing because:
+   http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winsock/winsock/getaddrinfo_2.asp
+   suggests that getaddrinfo should be available on all Windows
+   releases. */
+
+
+#if HAVE_WINSOCK2_H
+# include <winsock2.h>
+#endif
+#if HAVE_WS2TCPIP_H
+# include <ws2tcpip.h>
+#endif
+
+/* For shutdown(). */
+#if !defined SHUT_RD && defined SD_RECEIVE
+# define SHUT_RD SD_RECEIVE
+#endif
+#if !defined SHUT_WR && defined SD_SEND
+# define SHUT_WR SD_SEND
+#endif
+#if !defined SHUT_RDWR && defined SD_BOTH
+# define SHUT_RDWR SD_BOTH
+#endif
+
+#if defined _WIN32 || defined __WIN32__
+# define ENOTSOCK                WSAENOTSOCK
+# define EADDRINUSE              WSAEADDRINUSE
+# define ENETRESET               WSAENETRESET
+# define ECONNABORTED            WSAECONNABORTED
+# define ECONNRESET              WSAECONNRESET
+# define ENOTCONN                WSAENOTCONN
+# define ESHUTDOWN               WSAESHUTDOWN
+#endif
+
+#endif /* _SYS_SOCKET_H */
diff --git a/gnulib/stdbool_.h b/gnulib/stdbool_.h
new file mode 100644 (file)
index 0000000..efa80ba
--- /dev/null
@@ -0,0 +1,115 @@
+/* Copyright (C) 2001, 2002, 2003, 2006 Free Software Foundation, Inc.
+   Written by Bruno Haible <haible@clisp.cons.org>, 2001.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#ifndef _STDBOOL_H
+#define _STDBOOL_H
+
+/* ISO C 99 <stdbool.h> for platforms that lack it.  */
+
+/* Usage suggestions:
+
+   Programs that use <stdbool.h> should be aware of some limitations
+   and standards compliance issues.
+
+   Standards compliance:
+
+       - <stdbool.h> must be #included before 'bool', 'false', 'true'
+         can be used.
+
+       - You cannot assume that sizeof (bool) == 1.
+
+       - Programs should not undefine the macros bool, true, and false,
+         as C99 lists that as an "obsolescent feature".
+
+   Limitations of this substitute, when used in a C89 environment:
+
+       - <stdbool.h> must be #included before the '_Bool' type can be used.
+
+       - You cannot assume that _Bool is a typedef; it might be a macro.
+
+       - In C99, casts and automatic conversions to '_Bool' or 'bool' are
+         performed in such a way that every nonzero value gets converted
+         to 'true', and zero gets converted to 'false'.  This doesn't work
+         with this substitute.  With this substitute, only the values 0 and 1
+         give the expected result when converted to _Bool' or 'bool'.
+
+   Also, it is suggested that programs use 'bool' rather than '_Bool';
+   this isn't required, but 'bool' is more common.  */
+
+
+/* 7.16. Boolean type and values */
+
+/* BeOS <sys/socket.h> already #defines false 0, true 1.  We use the same
+   definitions below, but temporarily we have to #undef them.  */
+#ifdef __BEOS__
+# include <OS.h> /* defines bool but not _Bool */
+# undef false
+# undef true
+#endif
+
+/* For the sake of symbolic names in gdb, we define true and false as
+   enum constants, not only as macros.
+   It is tempting to write
+      typedef enum { false = 0, true = 1 } _Bool;
+   so that gdb prints values of type 'bool' symbolically. But if we do
+   this, values of type '_Bool' may promote to 'int' or 'unsigned int'
+   (see ISO C 99 6.7.2.2.(4)); however, '_Bool' must promote to 'int'
+   (see ISO C 99 6.3.1.1.(2)).  So we add a negative value to the
+   enum; this ensures that '_Bool' promotes to 'int'.  */
+#if defined __cplusplus || defined __BEOS__
+  /* A compiler known to have 'bool'.  */
+  /* If the compiler already has both 'bool' and '_Bool', we can assume they
+     are the same types.  */
+# if !@HAVE__BOOL@
+typedef bool _Bool;
+# endif
+#else
+# if !defined __GNUC__
+   /* If @HAVE__BOOL@:
+        Some HP-UX cc and AIX IBM C compiler versions have compiler bugs when
+        the built-in _Bool type is used.  See
+          http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
+          http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
+          http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
+        Similar bugs are likely with other compilers as well; this file
+        wouldn't be used if <stdbool.h> was working.
+        So we override the _Bool type.
+      If !@HAVE__BOOL@:
+        Need to define _Bool ourselves. As 'signed char' or as an enum type?
+        Use of a typedef, with SunPRO C, leads to a stupid
+          "warning: _Bool is a keyword in ISO C99".
+        Use of an enum type, with IRIX cc, leads to a stupid
+          "warning(1185): enumerated type mixed with another type".
+        The only benefit of the enum type, debuggability, is not important
+        with these compilers.  So use 'signed char' and no typedef.  */
+#  define _Bool signed char
+enum { false = 0, true = 1 };
+# else
+   /* With this compiler, trust the _Bool type if the compiler has it.  */
+#  if !@HAVE__BOOL@
+typedef enum { _Bool_must_promote_to_int = -1, false = 0, true = 1 } _Bool;
+#  endif
+# endif
+#endif
+#define bool _Bool
+
+/* The other macros must be usable in preprocessor directives.  */
+#define false 0
+#define true 1
+#define __bool_true_false_are_defined 1
+
+#endif /* _STDBOOL_H */
diff --git a/gnulib/strdup.c b/gnulib/strdup.c
new file mode 100644 (file)
index 0000000..c614108
--- /dev/null
@@ -0,0 +1,55 @@
+/* Copyright (C) 1991, 1996, 1997, 1998, 2002, 2003, 2004, 2006, 2007 Free
+   Software Foundation, Inc.
+
+   This file is part of the GNU C Library.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License along
+   with this program; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#ifndef _LIBC
+# include <config.h>
+#endif
+
+/* Get specification.  */
+#include <string.h>
+
+#include <stdlib.h>
+
+#undef __strdup
+#ifdef _LIBC
+# undef strdup
+#endif
+
+#ifndef weak_alias
+# define __strdup strdup
+#endif
+
+/* Duplicate S, returning an identical malloc'd string.  */
+char *
+__strdup (const char *s)
+{
+  size_t len = strlen (s) + 1;
+  void *new = malloc (len);
+
+  if (new == NULL)
+    return NULL;
+
+  return (char *) memcpy (new, s, len);
+}
+#ifdef libc_hidden_def
+libc_hidden_def (__strdup)
+#endif
+#ifdef weak_alias
+weak_alias (__strdup, strdup)
+#endif
diff --git a/gnulib/string_.h b/gnulib/string_.h
new file mode 100644 (file)
index 0000000..94d991c
--- /dev/null
@@ -0,0 +1,182 @@
+/* A GNU-like <string.h>.
+
+   Copyright (C) 1995-1996, 2001-2007 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#ifndef _GL_STRING_H
+#define _GL_STRING_H
+
+#include @ABSOLUTE_STRING_H@
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Return the first occurrence of NEEDLE in HAYSTACK.  */
+#if ! @HAVE_DECL_MEMMEM@
+extern void *memmem (void const *__haystack, size_t __haystack_len,
+                    void const *__needle, size_t __needle_len);
+#endif
+
+/* Copy N bytes of SRC to DEST, return pointer to bytes after the
+   last written byte.  */
+#if ! @HAVE_MEMPCPY@
+extern void *mempcpy (void *restrict __dest, void const *restrict __src,
+                     size_t __n);
+#endif
+
+/* Search backwards through a block for a byte (specified as an int).  */
+#if ! @HAVE_DECL_MEMRCHR@
+extern void *memrchr (void const *, int, size_t);
+#endif
+
+/* Copy SRC to DST, returning the address of the terminating '\0' in DST.  */
+#if ! @HAVE_STPCPY@
+extern char *stpcpy (char *restrict __dst, char const *restrict __src);
+#endif
+
+/* Copy no more than N bytes of SRC to DST, returning a pointer past the
+   last non-NUL byte written into DST.  */
+#if ! @HAVE_STPNCPY@
+# define stpncpy gnu_stpncpy
+extern char *stpncpy (char *restrict __dst, char const *restrict __src,
+                     size_t __n);
+#endif
+
+/* Compare strings S1 and S2, ignoring case, returning less than, equal to or
+   greater than zero if S1 is lexicographically less than, equal to or greater
+   than S2.
+   Note: This function may, in multibyte locales, return 0 for strings of
+   different lengths!
+   No known system has a strcasecmp() function that works correctly in
+   multibyte locales.  Therefore use our version always, if the
+   strcase module is available.  */
+#if @REPLACE_STRCASECMP@
+# define strcasecmp rpl_strcasecmp
+extern int strcasecmp (char const *__s1, char const *__s2);
+#endif
+
+/* Compare no more than N bytes of strings S1 and S2, ignoring case,
+   returning less than, equal to or greater than zero if S1 is
+   lexicographically less than, equal to or greater than S2.
+   Note: This function cannot work correctly in multibyte locales.  */
+#if ! @HAVE_DECL_STRNCASECMP@
+extern int strncasecmp (char const *__s1, char const *__s2, size_t __n);
+#endif
+
+/* Find the first occurrence of C in S or the final NUL byte.  */
+#if ! @HAVE_STRCHRNUL@
+extern char *strchrnul (char const *__s, int __c_in);
+#endif
+
+/* Duplicate S, returning an identical malloc'd string.  */
+#if ! @HAVE_DECL_STRDUP@ && ! defined strdup
+extern char *strdup (char const *__s);
+#endif
+
+/* Return a newly allocated copy of at most N bytes of STRING.  */
+#if ! @HAVE_STRNDUP@
+# undef strndup
+# define strndup rpl_strndup
+# if ! @HAVE_DECL_STRNDUP@
+extern char *strndup (char const *__string, size_t __n);
+# endif
+#endif
+
+/* Find the length (number of bytes) of STRING, but scan at most
+   MAXLEN bytes.  If no '\0' terminator is found in that many bytes,
+   return MAXLEN.  */
+#if ! @HAVE_DECL_STRNLEN@
+extern size_t strnlen (char const *__string, size_t __maxlen);
+#endif
+
+/* Find the first occurrence in S of any character in ACCEPT.  */
+#if ! @HAVE_STRPBRK@
+extern char *strpbrk (char const *__s, char const *__accept);
+#endif
+
+/* Search the next delimiter (char listed in DELIM) starting at *STRINGP.
+   If one is found, overwrite it with a NUL, and advance *STRINGP
+   to point to the next char after it.  Otherwise, set *STRINGP to NULL.
+   If *STRINGP was already NULL, nothing happens.
+   Return the old value of *STRINGP.
+
+   This is a variant of strtok() that is multithread-safe and supports
+   empty fields.
+
+   Caveat: It modifies the original string.
+   Caveat: These functions cannot be used on constant strings.
+   Caveat: The identity of the delimiting character is lost.
+   Caveat: It doesn't work with multibyte strings unless all of the delimiter
+           characters are ASCII characters < 0x30.
+
+   See also strtok_r().  */
+#if ! @HAVE_STRSEP@
+extern char *strsep (char **restrict __stringp, char const *restrict __delim);
+#endif
+
+/* Find the first occurrence of NEEDLE in HAYSTACK.
+   No known system has a strstr() function that works correctly in
+   multibyte locales.  Therefore use our version always, if the strstr
+   module is available.  */
+#if @REPLACE_STRSTR@
+# undef strstr
+# define strstr rpl_strstr
+extern char *strstr (char const *__haystack, char const *__needle);
+#endif
+
+/* Find the first occurrence of NEEDLE in HAYSTACK, using case-insensitive
+   comparison.
+   Note: This function may, in multibyte locales, return success even if
+   strlen (haystack) < strlen (needle) !  */
+#if @REPLACE_STRCASESTR@
+# undef strcasestr
+# define strcasestr rpl_strcasestr
+extern char *strcasestr (const char *haystack, const char *needle);
+#endif
+
+/* Parse S into tokens separated by characters in DELIM.
+   If S is NULL, the saved pointer in SAVE_PTR is used as
+   the next starting point.  For example:
+       char s[] = "-abc-=-def";
+       char *sp;
+       x = strtok_r(s, "-", &sp);      // x = "abc", sp = "=-def"
+       x = strtok_r(NULL, "-=", &sp);  // x = "def", sp = NULL
+       x = strtok_r(NULL, "=", &sp);   // x = NULL
+               // s = "abc\0-def\0"
+
+   This is a variant of strtok() that is multithread-safe.
+
+   For the POSIX documentation for this function, see:
+   http://www.opengroup.org/susv3xsh/strtok.html
+
+   Caveat: It modifies the original string.
+   Caveat: These functions cannot be used on constant strings.
+   Caveat: The identity of the delimiting character is lost.
+   Caveat: It doesn't work with multibyte strings unless all of the delimiter
+           characters are ASCII characters < 0x30.
+
+   See also strsep().  */
+#if ! @HAVE_DECL_STRTOK_R@
+extern char *strtok_r (char *restrict __s, char const *restrict __sep,
+                      char **restrict __lasts);
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/gnulib/vasnprintf.c b/gnulib/vasnprintf.c
new file mode 100644 (file)
index 0000000..67406ae
--- /dev/null
@@ -0,0 +1,889 @@
+/* vsprintf with automatic memory allocation.
+   Copyright (C) 1999, 2002-2007 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License along
+   with this program; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+/* Tell glibc's <stdio.h> to provide a prototype for snprintf().
+   This must come before <config.h> because <config.h> may include
+   <features.h>, and once <features.h> has been included, it's too late.  */
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE    1
+#endif
+
+#include <config.h>
+#ifndef IN_LIBINTL
+# include <alloca.h>
+#endif
+
+/* Specification.  */
+#if WIDE_CHAR_VERSION
+# include "vasnwprintf.h"
+#else
+# include "vasnprintf.h"
+#endif
+
+#include <stdio.h>     /* snprintf(), sprintf() */
+#include <stdlib.h>    /* abort(), malloc(), realloc(), free() */
+#include <string.h>    /* memcpy(), strlen() */
+#include <errno.h>     /* errno */
+#include <limits.h>    /* CHAR_BIT */
+#include <float.h>     /* DBL_MAX_EXP, LDBL_MAX_EXP */
+#if WIDE_CHAR_VERSION
+# include "wprintf-parse.h"
+#else
+# include "printf-parse.h"
+#endif
+
+/* Checked size_t computations.  */
+#include "xsize.h"
+
+#if HAVE_WCHAR_T
+# if HAVE_WCSLEN
+#  define local_wcslen wcslen
+# else
+   /* Solaris 2.5.1 has wcslen() in a separate library libw.so. To avoid
+      a dependency towards this library, here is a local substitute.
+      Define this substitute only once, even if this file is included
+      twice in the same compilation unit.  */
+#  ifndef local_wcslen_defined
+#   define local_wcslen_defined 1
+static size_t
+local_wcslen (const wchar_t *s)
+{
+  const wchar_t *ptr;
+
+  for (ptr = s; *ptr != (wchar_t) 0; ptr++)
+    ;
+  return ptr - s;
+}
+#  endif
+# endif
+#endif
+
+#if WIDE_CHAR_VERSION
+# define VASNPRINTF vasnwprintf
+# define CHAR_T wchar_t
+# define DIRECTIVE wchar_t_directive
+# define DIRECTIVES wchar_t_directives
+# define PRINTF_PARSE wprintf_parse
+# define USE_SNPRINTF 1
+# if HAVE_DECL__SNWPRINTF
+   /* On Windows, the function swprintf() has a different signature than
+      on Unix; we use the _snwprintf() function instead.  */
+#  define SNPRINTF _snwprintf
+# else
+   /* Unix.  */
+#  define SNPRINTF swprintf
+# endif
+#else
+# define VASNPRINTF vasnprintf
+# define CHAR_T char
+# define DIRECTIVE char_directive
+# define DIRECTIVES char_directives
+# define PRINTF_PARSE printf_parse
+# define USE_SNPRINTF (HAVE_DECL__SNPRINTF || HAVE_SNPRINTF)
+# if HAVE_DECL__SNPRINTF
+   /* Windows.  */
+#  define SNPRINTF _snprintf
+# else
+   /* Unix.  */
+#  define SNPRINTF snprintf
+# endif
+#endif
+
+CHAR_T *
+VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list args)
+{
+  DIRECTIVES d;
+  arguments a;
+
+  if (PRINTF_PARSE (format, &d, &a) < 0)
+    {
+      errno = EINVAL;
+      return NULL;
+    }
+
+#define CLEANUP() \
+  free (d.dir);                                                                \
+  if (a.arg)                                                           \
+    free (a.arg);
+
+  if (printf_fetchargs (args, &a) < 0)
+    {
+      CLEANUP ();
+      errno = EINVAL;
+      return NULL;
+    }
+
+  {
+    size_t buf_neededlength;
+    CHAR_T *buf;
+    CHAR_T *buf_malloced;
+    const CHAR_T *cp;
+    size_t i;
+    DIRECTIVE *dp;
+    /* Output string accumulator.  */
+    CHAR_T *result;
+    size_t allocated;
+    size_t length;
+
+    /* Allocate a small buffer that will hold a directive passed to
+       sprintf or snprintf.  */
+    buf_neededlength =
+      xsum4 (7, d.max_width_length, d.max_precision_length, 6);
+#if HAVE_ALLOCA
+    if (buf_neededlength < 4000 / sizeof (CHAR_T))
+      {
+       buf = (CHAR_T *) alloca (buf_neededlength * sizeof (CHAR_T));
+       buf_malloced = NULL;
+      }
+    else
+#endif
+      {
+       size_t buf_memsize = xtimes (buf_neededlength, sizeof (CHAR_T));
+       if (size_overflow_p (buf_memsize))
+         goto out_of_memory_1;
+       buf = (CHAR_T *) malloc (buf_memsize);
+       if (buf == NULL)
+         goto out_of_memory_1;
+       buf_malloced = buf;
+      }
+
+    if (resultbuf != NULL)
+      {
+       result = resultbuf;
+       allocated = *lengthp;
+      }
+    else
+      {
+       result = NULL;
+       allocated = 0;
+      }
+    length = 0;
+    /* Invariants:
+       result is either == resultbuf or == NULL or malloc-allocated.
+       If length > 0, then result != NULL.  */
+
+    /* Ensures that allocated >= needed.  Aborts through a jump to
+       out_of_memory if needed is SIZE_MAX or otherwise too big.  */
+#define ENSURE_ALLOCATION(needed) \
+    if ((needed) > allocated)                                               \
+      {                                                                             \
+       size_t memory_size;                                                  \
+       CHAR_T *memory;                                                      \
+                                                                            \
+       allocated = (allocated > 0 ? xtimes (allocated, 2) : 12);            \
+       if ((needed) > allocated)                                            \
+         allocated = (needed);                                              \
+       memory_size = xtimes (allocated, sizeof (CHAR_T));                   \
+       if (size_overflow_p (memory_size))                                   \
+         goto out_of_memory;                                                \
+       if (result == resultbuf || result == NULL)                           \
+         memory = (CHAR_T *) malloc (memory_size);                          \
+       else                                                                 \
+         memory = (CHAR_T *) realloc (result, memory_size);                 \
+       if (memory == NULL)                                                  \
+         goto out_of_memory;                                                \
+       if (result == resultbuf && length > 0)                               \
+         memcpy (memory, result, length * sizeof (CHAR_T));                 \
+       result = memory;                                                     \
+      }
+
+    for (cp = format, i = 0, dp = &d.dir[0]; ; cp = dp->dir_end, i++, dp++)
+      {
+       if (cp != dp->dir_start)
+         {
+           size_t n = dp->dir_start - cp;
+           size_t augmented_length = xsum (length, n);
+
+           ENSURE_ALLOCATION (augmented_length);
+           memcpy (result + length, cp, n * sizeof (CHAR_T));
+           length = augmented_length;
+         }
+       if (i == d.count)
+         break;
+
+       /* Execute a single directive.  */
+       if (dp->conversion == '%')
+         {
+           size_t augmented_length;
+
+           if (!(dp->arg_index == ARG_NONE))
+             abort ();
+           augmented_length = xsum (length, 1);
+           ENSURE_ALLOCATION (augmented_length);
+           result[length] = '%';
+           length = augmented_length;
+         }
+       else
+         {
+           if (!(dp->arg_index != ARG_NONE))
+             abort ();
+
+           if (dp->conversion == 'n')
+             {
+               switch (a.arg[dp->arg_index].type)
+                 {
+                 case TYPE_COUNT_SCHAR_POINTER:
+                   *a.arg[dp->arg_index].a.a_count_schar_pointer = length;
+                   break;
+                 case TYPE_COUNT_SHORT_POINTER:
+                   *a.arg[dp->arg_index].a.a_count_short_pointer = length;
+                   break;
+                 case TYPE_COUNT_INT_POINTER:
+                   *a.arg[dp->arg_index].a.a_count_int_pointer = length;
+                   break;
+                 case TYPE_COUNT_LONGINT_POINTER:
+                   *a.arg[dp->arg_index].a.a_count_longint_pointer = length;
+                   break;
+#if HAVE_LONG_LONG_INT
+                 case TYPE_COUNT_LONGLONGINT_POINTER:
+                   *a.arg[dp->arg_index].a.a_count_longlongint_pointer = length;
+                   break;
+#endif
+                 default:
+                   abort ();
+                 }
+             }
+           else
+             {
+               arg_type type = a.arg[dp->arg_index].type;
+               CHAR_T *p;
+               unsigned int prefix_count;
+               int prefixes[2];
+#if !USE_SNPRINTF
+               size_t tmp_length;
+               CHAR_T tmpbuf[700];
+               CHAR_T *tmp;
+
+               /* Allocate a temporary buffer of sufficient size for calling
+                  sprintf.  */
+               {
+                 size_t width;
+                 size_t precision;
+
+                 width = 0;
+                 if (dp->width_start != dp->width_end)
+                   {
+                     if (dp->width_arg_index != ARG_NONE)
+                       {
+                         int arg;
+
+                         if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
+                           abort ();
+                         arg = a.arg[dp->width_arg_index].a.a_int;
+                         width = (arg < 0 ? (unsigned int) (-arg) : arg);
+                       }
+                     else
+                       {
+                         const CHAR_T *digitp = dp->width_start;
+
+                         do
+                           width = xsum (xtimes (width, 10), *digitp++ - '0');
+                         while (digitp != dp->width_end);
+                       }
+                   }
+
+                 precision = 6;
+                 if (dp->precision_start != dp->precision_end)
+                   {
+                     if (dp->precision_arg_index != ARG_NONE)
+                       {
+                         int arg;
+
+                         if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
+                           abort ();
+                         arg = a.arg[dp->precision_arg_index].a.a_int;
+                         precision = (arg < 0 ? 0 : arg);
+                       }
+                     else
+                       {
+                         const CHAR_T *digitp = dp->precision_start + 1;
+
+                         precision = 0;
+                         while (digitp != dp->precision_end)
+                           precision = xsum (xtimes (precision, 10), *digitp++ - '0');
+                       }
+                   }
+
+                 switch (dp->conversion)
+                   {
+
+                   case 'd': case 'i': case 'u':
+# if HAVE_LONG_LONG_INT
+                     if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
+                       tmp_length =
+                         (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
+                                         * 0.30103 /* binary -> decimal */
+                                        )
+                         + 1; /* turn floor into ceil */
+                     else
+# endif
+                     if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
+                       tmp_length =
+                         (unsigned int) (sizeof (unsigned long) * CHAR_BIT
+                                         * 0.30103 /* binary -> decimal */
+                                        )
+                         + 1; /* turn floor into ceil */
+                     else
+                       tmp_length =
+                         (unsigned int) (sizeof (unsigned int) * CHAR_BIT
+                                         * 0.30103 /* binary -> decimal */
+                                        )
+                         + 1; /* turn floor into ceil */
+                     if (tmp_length < precision)
+                       tmp_length = precision;
+                     /* Multiply by 2, as an estimate for FLAG_GROUP.  */
+                     tmp_length = xsum (tmp_length, tmp_length);
+                     /* Add 1, to account for a leading sign.  */
+                     tmp_length = xsum (tmp_length, 1);
+                     break;
+
+                   case 'o':
+# if HAVE_LONG_LONG_INT
+                     if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
+                       tmp_length =
+                         (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
+                                         * 0.333334 /* binary -> octal */
+                                        )
+                         + 1; /* turn floor into ceil */
+                     else
+# endif
+                     if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
+                       tmp_length =
+                         (unsigned int) (sizeof (unsigned long) * CHAR_BIT
+                                         * 0.333334 /* binary -> octal */
+                                        )
+                         + 1; /* turn floor into ceil */
+                     else
+                       tmp_length =
+                         (unsigned int) (sizeof (unsigned int) * CHAR_BIT
+                                         * 0.333334 /* binary -> octal */
+                                        )
+                         + 1; /* turn floor into ceil */
+                     if (tmp_length < precision)
+                       tmp_length = precision;
+                     /* Add 1, to account for a leading sign.  */
+                     tmp_length = xsum (tmp_length, 1);
+                     break;
+
+                   case 'x': case 'X':
+# if HAVE_LONG_LONG_INT
+                     if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
+                       tmp_length =
+                         (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
+                                         * 0.25 /* binary -> hexadecimal */
+                                        )
+                         + 1; /* turn floor into ceil */
+                     else
+# endif
+                     if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
+                       tmp_length =
+                         (unsigned int) (sizeof (unsigned long) * CHAR_BIT
+                                         * 0.25 /* binary -> hexadecimal */
+                                        )
+                         + 1; /* turn floor into ceil */
+                     else
+                       tmp_length =
+                         (unsigned int) (sizeof (unsigned int) * CHAR_BIT
+                                         * 0.25 /* binary -> hexadecimal */
+                                        )
+                         + 1; /* turn floor into ceil */
+                     if (tmp_length < precision)
+                       tmp_length = precision;
+                     /* Add 2, to account for a leading sign or alternate form.  */
+                     tmp_length = xsum (tmp_length, 2);
+                     break;
+
+                   case 'f': case 'F':
+# if HAVE_LONG_DOUBLE
+                     if (type == TYPE_LONGDOUBLE)
+                       tmp_length =
+                         (unsigned int) (LDBL_MAX_EXP
+                                         * 0.30103 /* binary -> decimal */
+                                         * 2 /* estimate for FLAG_GROUP */
+                                        )
+                         + 1 /* turn floor into ceil */
+                         + 10; /* sign, decimal point etc. */
+                     else
+# endif
+                       tmp_length =
+                         (unsigned int) (DBL_MAX_EXP
+                                         * 0.30103 /* binary -> decimal */
+                                         * 2 /* estimate for FLAG_GROUP */
+                                        )
+                         + 1 /* turn floor into ceil */
+                         + 10; /* sign, decimal point etc. */
+                     tmp_length = xsum (tmp_length, precision);
+                     break;
+
+                   case 'e': case 'E': case 'g': case 'G':
+                   case 'a': case 'A':
+                     tmp_length =
+                       12; /* sign, decimal point, exponent etc. */
+                     tmp_length = xsum (tmp_length, precision);
+                     break;
+
+                   case 'c':
+# if HAVE_WINT_T && !WIDE_CHAR_VERSION
+                     if (type == TYPE_WIDE_CHAR)
+                       tmp_length = MB_CUR_MAX;
+                     else
+# endif
+                       tmp_length = 1;
+                     break;
+
+                   case 's':
+# if HAVE_WCHAR_T
+                     if (type == TYPE_WIDE_STRING)
+                       {
+                         tmp_length =
+                           local_wcslen (a.arg[dp->arg_index].a.a_wide_string);
+
+#  if !WIDE_CHAR_VERSION
+                         tmp_length = xtimes (tmp_length, MB_CUR_MAX);
+#  endif
+                       }
+                     else
+# endif
+                       tmp_length = strlen (a.arg[dp->arg_index].a.a_string);
+                     break;
+
+                   case 'p':
+                     tmp_length =
+                       (unsigned int) (sizeof (void *) * CHAR_BIT
+                                       * 0.25 /* binary -> hexadecimal */
+                                      )
+                         + 1 /* turn floor into ceil */
+                         + 2; /* account for leading 0x */
+                     break;
+
+                   default:
+                     abort ();
+                   }
+
+                 if (tmp_length < width)
+                   tmp_length = width;
+
+                 tmp_length = xsum (tmp_length, 1); /* account for trailing NUL */
+               }
+
+               if (tmp_length <= sizeof (tmpbuf) / sizeof (CHAR_T))
+                 tmp = tmpbuf;
+               else
+                 {
+                   size_t tmp_memsize = xtimes (tmp_length, sizeof (CHAR_T));
+
+                   if (size_overflow_p (tmp_memsize))
+                     /* Overflow, would lead to out of memory.  */
+                     goto out_of_memory;
+                   tmp = (CHAR_T *) malloc (tmp_memsize);
+                   if (tmp == NULL)
+                     /* Out of memory.  */
+                     goto out_of_memory;
+                 }
+#endif
+
+               /* Construct the format string for calling snprintf or
+                  sprintf.  */
+               p = buf;
+               *p++ = '%';
+               if (dp->flags & FLAG_GROUP)
+                 *p++ = '\'';
+               if (dp->flags & FLAG_LEFT)
+                 *p++ = '-';
+               if (dp->flags & FLAG_SHOWSIGN)
+                 *p++ = '+';
+               if (dp->flags & FLAG_SPACE)
+                 *p++ = ' ';
+               if (dp->flags & FLAG_ALT)
+                 *p++ = '#';
+               if (dp->flags & FLAG_ZERO)
+                 *p++ = '0';
+               if (dp->width_start != dp->width_end)
+                 {
+                   size_t n = dp->width_end - dp->width_start;
+                   memcpy (p, dp->width_start, n * sizeof (CHAR_T));
+                   p += n;
+                 }
+               if (dp->precision_start != dp->precision_end)
+                 {
+                   size_t n = dp->precision_end - dp->precision_start;
+                   memcpy (p, dp->precision_start, n * sizeof (CHAR_T));
+                   p += n;
+                 }
+
+               switch (type)
+                 {
+#if HAVE_LONG_LONG_INT
+                 case TYPE_LONGLONGINT:
+                 case TYPE_ULONGLONGINT:
+                   *p++ = 'l';
+                   /*FALLTHROUGH*/
+#endif
+                 case TYPE_LONGINT:
+                 case TYPE_ULONGINT:
+#if HAVE_WINT_T
+                 case TYPE_WIDE_CHAR:
+#endif
+#if HAVE_WCHAR_T
+                 case TYPE_WIDE_STRING:
+#endif
+                   *p++ = 'l';
+                   break;
+#if HAVE_LONG_DOUBLE
+                 case TYPE_LONGDOUBLE:
+                   *p++ = 'L';
+                   break;
+#endif
+                 default:
+                   break;
+                 }
+               *p = dp->conversion;
+#if USE_SNPRINTF
+               p[1] = '%';
+               p[2] = 'n';
+               p[3] = '\0';
+#else
+               p[1] = '\0';
+#endif
+
+               /* Construct the arguments for calling snprintf or sprintf.  */
+               prefix_count = 0;
+               if (dp->width_arg_index != ARG_NONE)
+                 {
+                   if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
+                     abort ();
+                   prefixes[prefix_count++] = a.arg[dp->width_arg_index].a.a_int;
+                 }
+               if (dp->precision_arg_index != ARG_NONE)
+                 {
+                   if (!(a.arg[dp->precision_arg_index].type == TYPE_INT))
+                     abort ();
+                   prefixes[prefix_count++] = a.arg[dp->precision_arg_index].a.a_int;
+                 }
+
+#if USE_SNPRINTF
+               /* Prepare checking whether snprintf returns the count
+                  via %n.  */
+               ENSURE_ALLOCATION (xsum (length, 1));
+               result[length] = '\0';
+#endif
+
+               for (;;)
+                 {
+                   size_t maxlen;
+                   int count;
+                   int retcount;
+
+                   maxlen = allocated - length;
+                   count = -1;
+                   retcount = 0;
+
+#if USE_SNPRINTF
+# define SNPRINTF_BUF(arg) \
+                   switch (prefix_count)                                   \
+                     {                                                     \
+                     case 0:                                               \
+                       retcount = SNPRINTF (result + length, maxlen, buf,  \
+                                            arg, &count);                  \
+                       break;                                              \
+                     case 1:                                               \
+                       retcount = SNPRINTF (result + length, maxlen, buf,  \
+                                            prefixes[0], arg, &count);     \
+                       break;                                              \
+                     case 2:                                               \
+                       retcount = SNPRINTF (result + length, maxlen, buf,  \
+                                            prefixes[0], prefixes[1], arg, \
+                                            &count);                       \
+                       break;                                              \
+                     default:                                              \
+                       abort ();                                           \
+                     }
+#else
+# define SNPRINTF_BUF(arg) \
+                   switch (prefix_count)                                   \
+                     {                                                     \
+                     case 0:                                               \
+                       count = sprintf (tmp, buf, arg);                    \
+                       break;                                              \
+                     case 1:                                               \
+                       count = sprintf (tmp, buf, prefixes[0], arg);       \
+                       break;                                              \
+                     case 2:                                               \
+                       count = sprintf (tmp, buf, prefixes[0], prefixes[1],\
+                                        arg);                              \
+                       break;                                              \
+                     default:                                              \
+                       abort ();                                           \
+                     }
+#endif
+
+                   switch (type)
+                     {
+                     case TYPE_SCHAR:
+                       {
+                         int arg = a.arg[dp->arg_index].a.a_schar;
+                         SNPRINTF_BUF (arg);
+                       }
+                       break;
+                     case TYPE_UCHAR:
+                       {
+                         unsigned int arg = a.arg[dp->arg_index].a.a_uchar;
+                         SNPRINTF_BUF (arg);
+                       }
+                       break;
+                     case TYPE_SHORT:
+                       {
+                         int arg = a.arg[dp->arg_index].a.a_short;
+                         SNPRINTF_BUF (arg);
+                       }
+                       break;
+                     case TYPE_USHORT:
+                       {
+                         unsigned int arg = a.arg[dp->arg_index].a.a_ushort;
+                         SNPRINTF_BUF (arg);
+                       }
+                       break;
+                     case TYPE_INT:
+                       {
+                         int arg = a.arg[dp->arg_index].a.a_int;
+                         SNPRINTF_BUF (arg);
+                       }
+                       break;
+                     case TYPE_UINT:
+                       {
+                         unsigned int arg = a.arg[dp->arg_index].a.a_uint;
+                         SNPRINTF_BUF (arg);
+                       }
+                       break;
+                     case TYPE_LONGINT:
+                       {
+                         long int arg = a.arg[dp->arg_index].a.a_longint;
+                         SNPRINTF_BUF (arg);
+                       }
+                       break;
+                     case TYPE_ULONGINT:
+                       {
+                         unsigned long int arg = a.arg[dp->arg_index].a.a_ulongint;
+                         SNPRINTF_BUF (arg);
+                       }
+                       break;
+#if HAVE_LONG_LONG_INT
+                     case TYPE_LONGLONGINT:
+                       {
+                         long long int arg = a.arg[dp->arg_index].a.a_longlongint;
+                         SNPRINTF_BUF (arg);
+                       }
+                       break;
+                     case TYPE_ULONGLONGINT:
+                       {
+                         unsigned long long int arg = a.arg[dp->arg_index].a.a_ulonglongint;
+                         SNPRINTF_BUF (arg);
+                       }
+                       break;
+#endif
+                     case TYPE_DOUBLE:
+                       {
+                         double arg = a.arg[dp->arg_index].a.a_double;
+                         SNPRINTF_BUF (arg);
+                       }
+                       break;
+#if HAVE_LONG_DOUBLE
+                     case TYPE_LONGDOUBLE:
+                       {
+                         long double arg = a.arg[dp->arg_index].a.a_longdouble;
+                         SNPRINTF_BUF (arg);
+                       }
+                       break;
+#endif
+                     case TYPE_CHAR:
+                       {
+                         int arg = a.arg[dp->arg_index].a.a_char;
+                         SNPRINTF_BUF (arg);
+                       }
+                       break;
+#if HAVE_WINT_T
+                     case TYPE_WIDE_CHAR:
+                       {
+                         wint_t arg = a.arg[dp->arg_index].a.a_wide_char;
+                         SNPRINTF_BUF (arg);
+                       }
+                       break;
+#endif
+                     case TYPE_STRING:
+                       {
+                         const char *arg = a.arg[dp->arg_index].a.a_string;
+                         SNPRINTF_BUF (arg);
+                       }
+                       break;
+#if HAVE_WCHAR_T
+                     case TYPE_WIDE_STRING:
+                       {
+                         const wchar_t *arg = a.arg[dp->arg_index].a.a_wide_string;
+                         SNPRINTF_BUF (arg);
+                       }
+                       break;
+#endif
+                     case TYPE_POINTER:
+                       {
+                         void *arg = a.arg[dp->arg_index].a.a_pointer;
+                         SNPRINTF_BUF (arg);
+                       }
+                       break;
+                     default:
+                       abort ();
+                     }
+
+#if USE_SNPRINTF
+                   /* Portability: Not all implementations of snprintf()
+                      are ISO C 99 compliant.  Determine the number of
+                      bytes that snprintf() has produced or would have
+                      produced.  */
+                   if (count >= 0)
+                     {
+                       /* Verify that snprintf() has NUL-terminated its
+                          result.  */
+                       if (count < maxlen && result[length + count] != '\0')
+                         abort ();
+                       /* Portability hack.  */
+                       if (retcount > count)
+                         count = retcount;
+                     }
+                   else
+                     {
+                       /* snprintf() doesn't understand the '%n'
+                          directive.  */
+                       if (p[1] != '\0')
+                         {
+                           /* Don't use the '%n' directive; instead, look
+                              at the snprintf() return value.  */
+                           p[1] = '\0';
+                           continue;
+                         }
+                       else
+                         {
+                           /* Look at the snprintf() return value.  */
+                           if (retcount < 0)
+                             {
+                               /* HP-UX 10.20 snprintf() is doubly deficient:
+                                  It doesn't understand the '%n' directive,
+                                  *and* it returns -1 (rather than the length
+                                  that would have been required) when the
+                                  buffer is too small.  */
+                               size_t bigger_need =
+                                 xsum (xtimes (allocated, 2), 12);
+                               ENSURE_ALLOCATION (bigger_need);
+                               continue;
+                             }
+                           else
+                             count = retcount;
+                         }
+                     }
+#endif
+
+                   /* Attempt to handle failure.  */
+                   if (count < 0)
+                     {
+                       if (!(result == resultbuf || result == NULL))
+                         free (result);
+                       if (buf_malloced != NULL)
+                         free (buf_malloced);
+                       CLEANUP ();
+                       errno = EINVAL;
+                       return NULL;
+                     }
+
+#if !USE_SNPRINTF
+                   if (count >= tmp_length)
+                     /* tmp_length was incorrectly calculated - fix the
+                        code above!  */
+                     abort ();
+#endif
+
+                   /* Make room for the result.  */
+                   if (count >= maxlen)
+                     {
+                       /* Need at least count bytes.  But allocate
+                          proportionally, to avoid looping eternally if
+                          snprintf() reports a too small count.  */
+                       size_t n =
+                         xmax (xsum (length, count), xtimes (allocated, 2));
+
+                       ENSURE_ALLOCATION (n);
+#if USE_SNPRINTF
+                       continue;
+#endif
+                     }
+
+#if USE_SNPRINTF
+                   /* The snprintf() result did fit.  */
+#else
+                   /* Append the sprintf() result.  */
+                   memcpy (result + length, tmp, count * sizeof (CHAR_T));
+                   if (tmp != tmpbuf)
+                     free (tmp);
+#endif
+
+                   length += count;
+                   break;
+                 }
+             }
+         }
+      }
+
+    /* Add the final NUL.  */
+    ENSURE_ALLOCATION (xsum (length, 1));
+    result[length] = '\0';
+
+    if (result != resultbuf && length + 1 < allocated)
+      {
+       /* Shrink the allocated memory if possible.  */
+       CHAR_T *memory;
+
+       memory = (CHAR_T *) realloc (result, (length + 1) * sizeof (CHAR_T));
+       if (memory != NULL)
+         result = memory;
+      }
+
+    if (buf_malloced != NULL)
+      free (buf_malloced);
+    CLEANUP ();
+    *lengthp = length;
+    /* Note that we can produce a big string of a length > INT_MAX.  POSIX
+       says that snprintf() fails with errno = EOVERFLOW in this case, but
+       that's only because snprintf() returns an 'int'.  This function does
+       not have this limitation.  */
+    return result;
+
+  out_of_memory:
+    if (!(result == resultbuf || result == NULL))
+      free (result);
+    if (buf_malloced != NULL)
+      free (buf_malloced);
+  out_of_memory_1:
+    CLEANUP ();
+    errno = ENOMEM;
+    return NULL;
+  }
+}
+
+#undef SNPRINTF
+#undef USE_SNPRINTF
+#undef PRINTF_PARSE
+#undef DIRECTIVES
+#undef DIRECTIVE
+#undef CHAR_T
+#undef VASNPRINTF
diff --git a/gnulib/vasnprintf.h b/gnulib/vasnprintf.h
new file mode 100644 (file)
index 0000000..894008c
--- /dev/null
@@ -0,0 +1,77 @@
+/* vsprintf with automatic memory allocation.
+   Copyright (C) 2002-2004 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License along
+   with this program; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#ifndef _VASNPRINTF_H
+#define _VASNPRINTF_H
+
+/* Get va_list.  */
+#include <stdarg.h>
+
+/* Get size_t.  */
+#include <stddef.h>
+
+#ifndef __attribute__
+/* This feature is available in gcc versions 2.5 and later.  */
+# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) || __STRICT_ANSI__
+#  define __attribute__(Spec) /* empty */
+# endif
+/* The __-protected variants of `format' and `printf' attributes
+   are accepted by gcc versions 2.6.4 (effectively 2.7) and later.  */
+# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
+#  define __format__ format
+#  define __printf__ printf
+# endif
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Write formatted output to a string dynamically allocated with malloc().
+   You can pass a preallocated buffer for the result in RESULTBUF and its
+   size in *LENGTHP; otherwise you pass RESULTBUF = NULL.
+   If successful, return the address of the string (this may be = RESULTBUF
+   if no dynamic memory allocation was necessary) and set *LENGTHP to the
+   number of resulting bytes, excluding the trailing NUL.  Upon error, set
+   errno and return NULL.
+
+   When dynamic memory allocation occurs, the preallocated buffer is left
+   alone (with possibly modified contents).  This makes it possible to use
+   a statically allocated or stack-allocated buffer, like this:
+
+          char buf[100];
+          size_t len = sizeof (buf);
+          char *output = vasnprintf (buf, &len, format, args);
+          if (output == NULL)
+            ... error handling ...;
+          else
+            {
+              ... use the output string ...;
+              if (output != buf)
+                free (output);
+            }
+  */
+extern char * asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...)
+       __attribute__ ((__format__ (__printf__, 3, 4)));
+extern char * vasnprintf (char *resultbuf, size_t *lengthp, const char *format, va_list args)
+       __attribute__ ((__format__ (__printf__, 3, 0)));
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _VASNPRINTF_H */
diff --git a/gnulib/xsize.h b/gnulib/xsize.h
new file mode 100644 (file)
index 0000000..341fb16
--- /dev/null
@@ -0,0 +1,108 @@
+/* xsize.h -- Checked size_t computations.
+
+   Copyright (C) 2003 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software Foundation,
+   Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+
+#ifndef _XSIZE_H
+#define _XSIZE_H
+
+/* Get size_t.  */
+#include <stddef.h>
+
+/* Get SIZE_MAX.  */
+#include <limits.h>
+#if HAVE_STDINT_H
+# include <stdint.h>
+#endif
+
+/* The size of memory objects is often computed through expressions of
+   type size_t. Example:
+      void* p = malloc (header_size + n * element_size).
+   These computations can lead to overflow.  When this happens, malloc()
+   returns a piece of memory that is way too small, and the program then
+   crashes while attempting to fill the memory.
+   To avoid this, the functions and macros in this file check for overflow.
+   The convention is that SIZE_MAX represents overflow.
+   malloc (SIZE_MAX) is not guaranteed to fail -- think of a malloc
+   implementation that uses mmap --, it's recommended to use size_overflow_p()
+   or size_in_bounds_p() before invoking malloc().
+   The example thus becomes:
+      size_t size = xsum (header_size, xtimes (n, element_size));
+      void *p = (size_in_bounds_p (size) ? malloc (size) : NULL);
+*/
+
+/* Convert an arbitrary value >= 0 to type size_t.  */
+#define xcast_size_t(N) \
+  ((N) <= SIZE_MAX ? (size_t) (N) : SIZE_MAX)
+
+/* Sum of two sizes, with overflow check.  */
+static inline size_t
+#if __GNUC__ >= 3
+__attribute__ ((__pure__))
+#endif
+xsum (size_t size1, size_t size2)
+{
+  size_t sum = size1 + size2;
+  return (sum >= size1 ? sum : SIZE_MAX);
+}
+
+/* Sum of three sizes, with overflow check.  */
+static inline size_t
+#if __GNUC__ >= 3
+__attribute__ ((__pure__))
+#endif
+xsum3 (size_t size1, size_t size2, size_t size3)
+{
+  return xsum (xsum (size1, size2), size3);
+}
+
+/* Sum of four sizes, with overflow check.  */
+static inline size_t
+#if __GNUC__ >= 3
+__attribute__ ((__pure__))
+#endif
+xsum4 (size_t size1, size_t size2, size_t size3, size_t size4)
+{
+  return xsum (xsum (xsum (size1, size2), size3), size4);
+}
+
+/* Maximum of two sizes, with overflow check.  */
+static inline size_t
+#if __GNUC__ >= 3
+__attribute__ ((__pure__))
+#endif
+xmax (size_t size1, size_t size2)
+{
+  /* No explicit check is needed here, because for any n:
+     max (SIZE_MAX, n) == SIZE_MAX and max (n, SIZE_MAX) == SIZE_MAX.  */
+  return (size1 >= size2 ? size1 : size2);
+}
+
+/* Multiplication of a count with an element size, with overflow check.
+   The count must be >= 0 and the element size must be > 0.
+   This is a macro, not an inline function, so that it works correctly even
+   when N is of a wider tupe and N > SIZE_MAX.  */
+#define xtimes(N, ELSIZE) \
+  ((N) <= SIZE_MAX / (ELSIZE) ? (size_t) (N) * (ELSIZE) : SIZE_MAX)
+
+/* Check for overflow.  */
+#define size_overflow_p(SIZE) \
+  ((SIZE) == SIZE_MAX)
+/* Check against overflow.  */
+#define size_in_bounds_p(SIZE) \
+  ((SIZE) != SIZE_MAX)
+
+#endif /* _XSIZE_H */
index b590c4e3bb58c7f8709f988f8833b137fdb7ca39..d0cd8a5e0ebab92f45a1aec40a3833fabdd789ce 100644 (file)
@@ -46,13 +46,13 @@ if WANT_RESTORE
 RESTORE_MAN8_PAGES = amrestore.8
 endif
 
-man8_MANS = $(COMMON_MAN8_PAGES) \
+man8_pages = $(COMMON_MAN8_PAGES) \
            $(AMPLOT_MAN8_PAGES) \
            $(SERVER_MAN8_PAGES) \
            $(RECOVER_MAN8_PAGES) \
            $(RESTORE_MAN8_PAGES)
 
-man5_MANS = $(COMMON_MAN5_PAGES)
+man5_pages = $(COMMON_MAN5_PAGES)
 
 ALL_MAN_PAGES = $(AMPLOT_MAN8_PAGES) \
           $(COMMON_MAN5_PAGES) \
@@ -61,7 +61,9 @@ ALL_MAN_PAGES = $(AMPLOT_MAN8_PAGES) \
           $(RECOVER_MAN8_PAGES) \
           $(RESTORE_MAN8_PAGES)
 
-man_MANS = $(man5_MANS) $(man8_MANS)
+# These lines are needed to force automake to set the $man<n>dir variables.
+man5_MANS =
+man8_MANS =
 
 SRCMANPAGEDIR  = $(srcdir)/xml-source
 
@@ -80,57 +82,69 @@ GEN_XML = $(ALL_MAN_PAGES:%=xml-source/%.proc.xml)
 MOSTLYCLEANFILES = $(GEN_XML)
 MAINTAINERCLEANFILES = $(ALL_MAN_PAGES)
 
-if BUILD_MAN_PAGES
-if   HAVE_XSLTPROC
+if   ENABLE_MANPAGE_BUILD
 xml-source/%.proc.xml: $(SRCMANPAGEDIR)/%.xml $(srcdir)/xslt/expand-sambadoc.xsl
-       $(XSLTPROC) --path $(srcdir)/xslt/ --xinclude --stringparam latex.imagebasedir "$*/" --stringparam noreference 1 --output $@ $(srcdir)/xslt/expand-sambadoc.xsl $<
+       $(XSLTPROC) $(XSLTPROC_FLAGS) --path $(srcdir)/xslt/ --xinclude --stringparam latex.imagebasedir "$*/" --stringparam noreference 1 --output $@ $(srcdir)/xslt/expand-sambadoc.xsl $<
 
 %: xml-source/%.proc.xml $(srcdir)/xslt/man.xsl
-       $(XSLTPROC) --path $(srcdir)/xslt/ --output $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
+       $(XSLTPROC) $(XSLTPROC_FLAGS) --path $(srcdir)/xslt/ --output $@ http://docbook.sourceforge.net/release/xsl/1.72.0/manpages/docbook.xsl $<
 
-else    # !HAVE_XSLTPROC
+else   !ENABLE_MANPAGE_BUILD
 
-xml-source/%.proc.xml: $(SRCMANPAGEDIR)/%.xml $(srcdir)/xslt/expand-sambadoc.xsl
-       @echo WARNING: $@ can not be generated: xsltproc is not available.
-
-%: xml-source/%.proc.xml $(srcdir)/xslt/man.xsl
-       @echo WARNING: $@ can not be generated: xsltproc is not available.
-
-endif  # HAVE_XSLTPROC
-
-else  # !BUILD_MAN_PAGES
-
-xml-source/%.proc.xml: $(SRCMANPAGEDIR)/%.xml $(srcdir)/xslt/expand-sambadoc.xsl
-       @echo  Build of $@ skipped.
-
-%: xml-source/%.proc.xml $(srcdir)/xslt/man.xsl
-       @echo  Build of $@ skipped.
+%: $(SRCMANPAGEDIR)/%.xml
+       @echo WARNING: Not building needed $@ because building manpages is disabled.
+endif
 
-endif # BUILD_MAN_PAGES
+all: $(ALL_MAN_PAGES)
 
-if BUILD_MAN_PAGES
-install-data-hook:
-       @list="$(man8_MANS)"; \
+# this is conditioned on ENABLE_MANPAGE_BUILD; it checks for the
+# existence of the file to be installed when building manpages is
+# not enabled.
+install-data-hook: $(ALL_MAN_PAGES)
+if     ENABLE_MANPAGE_BUILD
+       @list="$(man8_pages)"; \
        for p in $$list; do \
                pa=$(DESTDIR)$(man8dir)/`echo $$p|sed '$(transform)'`; \
-               echo chown $(BINARY_OWNER) $$pa; \
-               chown $(BINARY_OWNER) $$pa; \
-               echo chgrp $(SETUID_GROUP) $$pa; \
-               chgrp $(SETUID_GROUP) $$pa; \
+               echo $(INSTALL) -c -m 644 $$p $(DESTDIR)$(man8dir); \
+               $(INSTALL) -c -m 644 $$p $(DESTDIR)$(man8dir); \
+               echo chown \"$(BINARY_OWNER)\" $$pa;    \
+               chown "$(BINARY_OWNER)" $$pa;           \
+               echo chgrp \"$(SETUID_GROUP)\" $$pa;    \
+               chgrp "$(SETUID_GROUP)" $$pa;           \
        done
-       @list="$(man5_MANS)"; \
+       @list="$(man5_pages)"; \
        for p in $$list; do \
                pa=$(DESTDIR)$(man5dir)/`echo $$p|sed '$(transform)'`; \
-               echo chown $(BINARY_OWNER) $$pa; \
-               chown $(BINARY_OWNER) $$pa; \
-               echo chgrp $(SETUID_GROUP) $$pa; \
-               chgrp $(SETUID_GROUP) $$pa; \
+               echo $(INSTALL) -c -m 644 $$p $(DESTDIR)$(man5dir); \
+               $(INSTALL) -c -m 644 $$p $(DESTDIR)$(man5dir); \
+               echo chown \"$(BINARY_OWNER)\" $$pa;    \
+               chown "$(BINARY_OWNER)" $$pa;           \
+               echo chgrp \"$(SETUID_GROUP)\" $$pa;    \
+               chgrp "$(SETUID_GROUP)" $$pa;           \
+       done
+else   !ENABLE_MANPAGE_BUILD
+       @list="$(man8_pages)"; \
+       for p in $$list; do \
+           if test -e $$p; then \
+               pa=$(DESTDIR)$(man8dir)/`echo $$p|sed '$(transform)'`; \
+               echo $(INSTALL) -c -m 644 $$p $(DESTDIR)$(man8dir); \
+               $(INSTALL) -c -m 644 $$p $(DESTDIR)$(man8dir); \
+               echo chown \"$(BINARY_OWNER)\" $$pa;    \
+               chown "$(BINARY_OWNER)" $$pa;           \
+               echo chgrp \"$(SETUID_GROUP)\" $$pa;    \
+               chgrp "$(SETUID_GROUP)" $$pa;           \
+           fi \
+       done
+       @list="$(man5_pages)"; \
+       for p in $$list; do \
+           if test -e $$p; then \
+               pa=$(DESTDIR)$(man5dir)/`echo $$p|sed '$(transform)'`; \
+               echo $(INSTALL) -c -m 644 $$p $(DESTDIR)$(man5dir); \
+               $(INSTALL) -c -m 644 $$p $(DESTDIR)$(man5dir); \
+               echo chown \"$(BINARY_OWNER)\" $$pa;    \
+               chown "$(BINARY_OWNER)" $$pa;           \
+               echo chgrp \"$(SETUID_GROUP)\" $$pa;    \
+               chgrp "$(SETUID_GROUP)" $$pa;           \
+           fi \
        done
-
-else  # !BUILD_MAN_PAGES
-
-install:
-       @echo Skipping man page installation.
-
 endif
-
index b47ea9fe04bc6b8b371575eb5a95915a00c9e421..4fcf3743bd3862c7d982e330ae1a2050a4dd3036 100644 (file)
@@ -41,6 +41,41 @@ subdir = man
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+       $(top_srcdir)/config/gnulib/absolute-header.m4 \
+       $(top_srcdir)/config/gnulib/alloca.m4 \
+       $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/eoverflow.m4 \
+       $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/getaddrinfo.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-cache.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-common.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-comp.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-tool.m4 \
+       $(top_srcdir)/config/gnulib/inet_ntop.m4 \
+       $(top_srcdir)/config/gnulib/intmax_t.m4 \
+       $(top_srcdir)/config/gnulib/inttypes_h.m4 \
+       $(top_srcdir)/config/gnulib/lib-ld.m4 \
+       $(top_srcdir)/config/gnulib/lib-link.m4 \
+       $(top_srcdir)/config/gnulib/lib-prefix.m4 \
+       $(top_srcdir)/config/gnulib/lock.m4 \
+       $(top_srcdir)/config/gnulib/longdouble.m4 \
+       $(top_srcdir)/config/gnulib/longlong.m4 \
+       $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
+       $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \
+       $(top_srcdir)/config/gnulib/size_max.m4 \
+       $(top_srcdir)/config/gnulib/snprintf.m4 \
+       $(top_srcdir)/config/gnulib/socklen.m4 \
+       $(top_srcdir)/config/gnulib/sockpfaf.m4 \
+       $(top_srcdir)/config/gnulib/stdbool.m4 \
+       $(top_srcdir)/config/gnulib/stdint_h.m4 \
+       $(top_srcdir)/config/gnulib/strdup.m4 \
+       $(top_srcdir)/config/gnulib/string_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
+       $(top_srcdir)/config/gnulib/vasnprintf.m4 \
+       $(top_srcdir)/config/gnulib/visibility.m4 \
+       $(top_srcdir)/config/gnulib/wchar_t.m4 \
+       $(top_srcdir)/config/gnulib/wint_t.m4 \
+       $(top_srcdir)/config/gnulib/xsize.m4 \
        $(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
@@ -53,11 +88,13 @@ man5dir = $(mandir)/man5
 am__installdirs = "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)"
 man8dir = $(mandir)/man8
 NROFF = nroff
-MANS = $(man5_MANS) $(man8_MANS) $(man_MANS)
+MANS = $(man5_MANS) $(man8_MANS)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 transform = s,x,x,;
+ABSOLUTE_STRING_H = @ABSOLUTE_STRING_H@
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
+ALLOCA_H = @ALLOCA_H@
 AMANDA_DBGDIR = @AMANDA_DBGDIR@
 AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@
 AMANDA_TMPDIR = @AMANDA_TMPDIR@
@@ -72,18 +109,17 @@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@
 AMTAR = @AMTAR@
 AM_CFLAGS = @AM_CFLAGS@
 AR = @AR@
+ARPA_INET_H = @ARPA_INET_H@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
-AWK_VAR_ASSIGNMENT_OPT = @AWK_VAR_ASSIGNMENT_OPT@
 BINARY_OWNER = @BINARY_OWNER@
-BUILD_MAN_PAGES_FALSE = @BUILD_MAN_PAGES_FALSE@
-BUILD_MAN_PAGES_TRUE = @BUILD_MAN_PAGES_TRUE@
 CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
+CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
 CHIO = @CHIO@
 CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
@@ -116,18 +152,40 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
+ENABLE_MANPAGE_BUILD_FALSE = @ENABLE_MANPAGE_BUILD_FALSE@
+ENABLE_MANPAGE_BUILD_TRUE = @ENABLE_MANPAGE_BUILD_TRUE@
+EOVERFLOW = @EOVERFLOW@
+EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@
 EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
+GCC_COMPILER_FALSE = @GCC_COMPILER_FALSE@
+GCC_COMPILER_TRUE = @GCC_COMPILER_TRUE@
 GETCONF = @GETCONF@
+GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@
+GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
 GNUTAR_LISTED_INCREMENTAL_DIRX = @GNUTAR_LISTED_INCREMENTAL_DIRX@
 GREP = @GREP@
 GZIP = @GZIP@
-HAVE_XSLTPROC_FALSE = @HAVE_XSLTPROC_FALSE@
-HAVE_XSLTPROC_TRUE = @HAVE_XSLTPROC_TRUE@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRNDUP = @HAVE_STRNDUP@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE__BOOL = @HAVE__BOOL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -136,22 +194,31 @@ LDFLAGS = @LDFLAGS@
 LEX = @LEX@
 LEXLIB = @LEXLIB@
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
+LIBPTH = @LIBPTH@
+LIBPTH_PREFIX = @LIBPTH_PREFIX@
 LIBS = @LIBS@
+LIBTHREAD = @LIBTHREAD@
 LIBTOOL = @LIBTOOL@
 LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LL_FMT = @LL_FMT@
 LL_RFMT = @LL_RFMT@
 LN_S = @LN_S@
 LTALLOCA = @LTALLOCA@
+LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
 LTLIBOBJS = @LTLIBOBJS@
+LTLIBPTH = @LTLIBPTH@
+LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
 MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@
 MCUTIL = @MCUTIL@
+MKDIR_P = @MKDIR_P@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
+NETINET_IN_H = @NETINET_IN_H@
 OBJEXT = @OBJEXT@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -165,6 +232,9 @@ PERL = @PERL@
 PRINT = @PRINT@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
+REPLACE_STRCASECMP = @REPLACE_STRCASECMP@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRSTR = @REPLACE_STRSTR@
 RESTORE = @RESTORE@
 SAMBA_CLIENT = @SAMBA_CLIENT@
 SERVICE_SUFFIX = @SERVICE_SUFFIX@
@@ -173,7 +243,10 @@ SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 SNAPSHOT_STAMP = @SNAPSHOT_STAMP@
 SORT = @SORT@
+SSH = @SSH@
+STDBOOL_H = @STDBOOL_H@
 STRIP = @STRIP@
+SYS_SOCKET_H = @SYS_SOCKET_H@
 USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@
 VDUMP = @VDUMP@
 VERSION = @VERSION@
@@ -212,6 +285,7 @@ WANT_TAPE_TRUE = @WANT_TAPE_TRUE@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
 XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
 YACC = @YACC@
 ac_c = @ac_c@
 ac_ct_AR = @ac_ct_AR@
@@ -238,6 +312,8 @@ build_os = @build_os@
 build_vendor = @build_vendor@
 datadir = @datadir@
 exec_prefix = @exec_prefix@
+gl_LIBOBJS = @gl_LIBOBJS@
+gl_LTLIBOBJS = @gl_LTLIBOBJS@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -297,13 +373,13 @@ SERVER_MAN8_PAGES = amadmin.8 \
 #endif
 @WANT_RECOVER_TRUE@RECOVER_MAN8_PAGES = amrecover.8
 @WANT_RESTORE_TRUE@RESTORE_MAN8_PAGES = amrestore.8
-man8_MANS = $(COMMON_MAN8_PAGES) \
+man8_pages = $(COMMON_MAN8_PAGES) \
            $(AMPLOT_MAN8_PAGES) \
            $(SERVER_MAN8_PAGES) \
            $(RECOVER_MAN8_PAGES) \
            $(RESTORE_MAN8_PAGES)
 
-man5_MANS = $(COMMON_MAN5_PAGES)
+man5_pages = $(COMMON_MAN5_PAGES)
 ALL_MAN_PAGES = $(AMPLOT_MAN8_PAGES) \
           $(COMMON_MAN5_PAGES) \
           $(COMMON_MAN8_PAGES) \
@@ -311,7 +387,10 @@ ALL_MAN_PAGES = $(AMPLOT_MAN8_PAGES) \
           $(RECOVER_MAN8_PAGES) \
           $(RESTORE_MAN8_PAGES)
 
-man_MANS = $(man5_MANS) $(man8_MANS)
+
+# These lines are needed to force automake to set the $man<n>dir variables.
+man5_MANS = 
+man8_MANS = 
 SRCMANPAGEDIR = $(srcdir)/xml-source
 MAN_XML = $(ALL_MAN_PAGES:%=xml-source/%.xml)
 EXTRA_XML = xslt/expand-sambadoc.xsl \
@@ -498,7 +577,7 @@ installdirs:
        for dir in "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)"; do \
          test -z "$$dir" || $(mkdir_p) "$$dir"; \
        done
-@BUILD_MAN_PAGES_TRUE@install: install-am
+install: install-am
 install-exec: install-exec-am
 install-data: install-data-am
 uninstall: uninstall-am
@@ -524,7 +603,6 @@ maintainer-clean-generic:
        @echo "This command is intended for maintainers to use"
        @echo "it deletes files that may require special tools to rebuild."
        -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
-@BUILD_MAN_PAGES_FALSE@install-data-hook:
 clean: clean-am
 
 clean-am: clean-generic clean-libtool mostlyclean-am
@@ -587,44 +665,65 @@ uninstall-man: uninstall-man5 uninstall-man8
        uninstall-info-am uninstall-man uninstall-man5 uninstall-man8
 
 
-@BUILD_MAN_PAGES_TRUE@@HAVE_XSLTPROC_TRUE@xml-source/%.proc.xml: $(SRCMANPAGEDIR)/%.xml $(srcdir)/xslt/expand-sambadoc.xsl
-@BUILD_MAN_PAGES_TRUE@@HAVE_XSLTPROC_TRUE@     $(XSLTPROC) --path $(srcdir)/xslt/ --xinclude --stringparam latex.imagebasedir "$*/" --stringparam noreference 1 --output $@ $(srcdir)/xslt/expand-sambadoc.xsl $<
-
-@BUILD_MAN_PAGES_TRUE@@HAVE_XSLTPROC_TRUE@%: xml-source/%.proc.xml $(srcdir)/xslt/man.xsl
-@BUILD_MAN_PAGES_TRUE@@HAVE_XSLTPROC_TRUE@     $(XSLTPROC) --path $(srcdir)/xslt/ --output $@ http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
-
-@BUILD_MAN_PAGES_TRUE@@HAVE_XSLTPROC_FALSE@xml-source/%.proc.xml: $(SRCMANPAGEDIR)/%.xml $(srcdir)/xslt/expand-sambadoc.xsl
-@BUILD_MAN_PAGES_TRUE@@HAVE_XSLTPROC_FALSE@    @echo WARNING: $@ can not be generated: xsltproc is not available.
-
-@BUILD_MAN_PAGES_TRUE@@HAVE_XSLTPROC_FALSE@%: xml-source/%.proc.xml $(srcdir)/xslt/man.xsl
-@BUILD_MAN_PAGES_TRUE@@HAVE_XSLTPROC_FALSE@    @echo WARNING: $@ can not be generated: xsltproc is not available.
-
-@BUILD_MAN_PAGES_FALSE@xml-source/%.proc.xml: $(SRCMANPAGEDIR)/%.xml $(srcdir)/xslt/expand-sambadoc.xsl
-@BUILD_MAN_PAGES_FALSE@        @echo  Build of $@ skipped.
-
-@BUILD_MAN_PAGES_FALSE@%: xml-source/%.proc.xml $(srcdir)/xslt/man.xsl
-@BUILD_MAN_PAGES_FALSE@        @echo  Build of $@ skipped.
-
-@BUILD_MAN_PAGES_TRUE@install-data-hook:
-@BUILD_MAN_PAGES_TRUE@ @list="$(man8_MANS)"; \
-@BUILD_MAN_PAGES_TRUE@ for p in $$list; do \
-@BUILD_MAN_PAGES_TRUE@         pa=$(DESTDIR)$(man8dir)/`echo $$p|sed '$(transform)'`; \
-@BUILD_MAN_PAGES_TRUE@         echo chown $(BINARY_OWNER) $$pa; \
-@BUILD_MAN_PAGES_TRUE@         chown $(BINARY_OWNER) $$pa; \
-@BUILD_MAN_PAGES_TRUE@         echo chgrp $(SETUID_GROUP) $$pa; \
-@BUILD_MAN_PAGES_TRUE@         chgrp $(SETUID_GROUP) $$pa; \
-@BUILD_MAN_PAGES_TRUE@ done
-@BUILD_MAN_PAGES_TRUE@ @list="$(man5_MANS)"; \
-@BUILD_MAN_PAGES_TRUE@ for p in $$list; do \
-@BUILD_MAN_PAGES_TRUE@         pa=$(DESTDIR)$(man5dir)/`echo $$p|sed '$(transform)'`; \
-@BUILD_MAN_PAGES_TRUE@         echo chown $(BINARY_OWNER) $$pa; \
-@BUILD_MAN_PAGES_TRUE@         chown $(BINARY_OWNER) $$pa; \
-@BUILD_MAN_PAGES_TRUE@         echo chgrp $(SETUID_GROUP) $$pa; \
-@BUILD_MAN_PAGES_TRUE@         chgrp $(SETUID_GROUP) $$pa; \
-@BUILD_MAN_PAGES_TRUE@ done
-
-@BUILD_MAN_PAGES_FALSE@install:
-@BUILD_MAN_PAGES_FALSE@        @echo Skipping man page installation.
+@ENABLE_MANPAGE_BUILD_TRUE@xml-source/%.proc.xml: $(SRCMANPAGEDIR)/%.xml $(srcdir)/xslt/expand-sambadoc.xsl
+@ENABLE_MANPAGE_BUILD_TRUE@    $(XSLTPROC) $(XSLTPROC_FLAGS) --path $(srcdir)/xslt/ --xinclude --stringparam latex.imagebasedir "$*/" --stringparam noreference 1 --output $@ $(srcdir)/xslt/expand-sambadoc.xsl $<
+
+@ENABLE_MANPAGE_BUILD_TRUE@%: xml-source/%.proc.xml $(srcdir)/xslt/man.xsl
+@ENABLE_MANPAGE_BUILD_TRUE@    $(XSLTPROC) $(XSLTPROC_FLAGS) --path $(srcdir)/xslt/ --output $@ http://docbook.sourceforge.net/release/xsl/1.72.0/manpages/docbook.xsl $<
+
+@ENABLE_MANPAGE_BUILD_FALSE@%: $(SRCMANPAGEDIR)/%.xml
+@ENABLE_MANPAGE_BUILD_FALSE@   @echo WARNING: Not building needed $@ because building manpages is disabled.
+
+all: $(ALL_MAN_PAGES)
+
+# this is conditioned on ENABLE_MANPAGE_BUILD; it checks for the
+# existence of the file to be installed when building manpages is
+# not enabled.
+install-data-hook: $(ALL_MAN_PAGES)
+@ENABLE_MANPAGE_BUILD_TRUE@    @list="$(man8_pages)"; \
+@ENABLE_MANPAGE_BUILD_TRUE@    for p in $$list; do \
+@ENABLE_MANPAGE_BUILD_TRUE@            pa=$(DESTDIR)$(man8dir)/`echo $$p|sed '$(transform)'`; \
+@ENABLE_MANPAGE_BUILD_TRUE@            echo $(INSTALL) -c -m 644 $$p $(DESTDIR)$(man8dir); \
+@ENABLE_MANPAGE_BUILD_TRUE@            $(INSTALL) -c -m 644 $$p $(DESTDIR)$(man8dir); \
+@ENABLE_MANPAGE_BUILD_TRUE@            echo chown \"$(BINARY_OWNER)\" $$pa;    \
+@ENABLE_MANPAGE_BUILD_TRUE@            chown "$(BINARY_OWNER)" $$pa;           \
+@ENABLE_MANPAGE_BUILD_TRUE@            echo chgrp \"$(SETUID_GROUP)\" $$pa;    \
+@ENABLE_MANPAGE_BUILD_TRUE@            chgrp "$(SETUID_GROUP)" $$pa;           \
+@ENABLE_MANPAGE_BUILD_TRUE@    done
+@ENABLE_MANPAGE_BUILD_TRUE@    @list="$(man5_pages)"; \
+@ENABLE_MANPAGE_BUILD_TRUE@    for p in $$list; do \
+@ENABLE_MANPAGE_BUILD_TRUE@            pa=$(DESTDIR)$(man5dir)/`echo $$p|sed '$(transform)'`; \
+@ENABLE_MANPAGE_BUILD_TRUE@            echo $(INSTALL) -c -m 644 $$p $(DESTDIR)$(man5dir); \
+@ENABLE_MANPAGE_BUILD_TRUE@            $(INSTALL) -c -m 644 $$p $(DESTDIR)$(man5dir); \
+@ENABLE_MANPAGE_BUILD_TRUE@            echo chown \"$(BINARY_OWNER)\" $$pa;    \
+@ENABLE_MANPAGE_BUILD_TRUE@            chown "$(BINARY_OWNER)" $$pa;           \
+@ENABLE_MANPAGE_BUILD_TRUE@            echo chgrp \"$(SETUID_GROUP)\" $$pa;    \
+@ENABLE_MANPAGE_BUILD_TRUE@            chgrp "$(SETUID_GROUP)" $$pa;           \
+@ENABLE_MANPAGE_BUILD_TRUE@    done
+@ENABLE_MANPAGE_BUILD_FALSE@   @list="$(man8_pages)"; \
+@ENABLE_MANPAGE_BUILD_FALSE@   for p in $$list; do \
+@ENABLE_MANPAGE_BUILD_FALSE@       if test -e $$p; then \
+@ENABLE_MANPAGE_BUILD_FALSE@           pa=$(DESTDIR)$(man8dir)/`echo $$p|sed '$(transform)'`; \
+@ENABLE_MANPAGE_BUILD_FALSE@           echo $(INSTALL) -c -m 644 $$p $(DESTDIR)$(man8dir); \
+@ENABLE_MANPAGE_BUILD_FALSE@           $(INSTALL) -c -m 644 $$p $(DESTDIR)$(man8dir); \
+@ENABLE_MANPAGE_BUILD_FALSE@           echo chown \"$(BINARY_OWNER)\" $$pa;    \
+@ENABLE_MANPAGE_BUILD_FALSE@           chown "$(BINARY_OWNER)" $$pa;           \
+@ENABLE_MANPAGE_BUILD_FALSE@           echo chgrp \"$(SETUID_GROUP)\" $$pa;    \
+@ENABLE_MANPAGE_BUILD_FALSE@           chgrp "$(SETUID_GROUP)" $$pa;           \
+@ENABLE_MANPAGE_BUILD_FALSE@       fi \
+@ENABLE_MANPAGE_BUILD_FALSE@   done
+@ENABLE_MANPAGE_BUILD_FALSE@   @list="$(man5_pages)"; \
+@ENABLE_MANPAGE_BUILD_FALSE@   for p in $$list; do \
+@ENABLE_MANPAGE_BUILD_FALSE@       if test -e $$p; then \
+@ENABLE_MANPAGE_BUILD_FALSE@           pa=$(DESTDIR)$(man5dir)/`echo $$p|sed '$(transform)'`; \
+@ENABLE_MANPAGE_BUILD_FALSE@           echo $(INSTALL) -c -m 644 $$p $(DESTDIR)$(man5dir); \
+@ENABLE_MANPAGE_BUILD_FALSE@           $(INSTALL) -c -m 644 $$p $(DESTDIR)$(man5dir); \
+@ENABLE_MANPAGE_BUILD_FALSE@           echo chown \"$(BINARY_OWNER)\" $$pa;    \
+@ENABLE_MANPAGE_BUILD_FALSE@           chown "$(BINARY_OWNER)" $$pa;           \
+@ENABLE_MANPAGE_BUILD_FALSE@           echo chgrp \"$(SETUID_GROUP)\" $$pa;    \
+@ENABLE_MANPAGE_BUILD_FALSE@           chgrp "$(SETUID_GROUP)" $$pa;           \
+@ENABLE_MANPAGE_BUILD_FALSE@       fi \
+@ENABLE_MANPAGE_BUILD_FALSE@   done
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
index 28707f81189712ec0f013013378f12205f41cdc9..671439ef4734106b78b1c747951e76923247aea6 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amadmin
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 02/07/2007
+.\"      Date: 06/06/2007
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMADMIN" "8" "02/07/2007" "" ""
+.TH "AMADMIN" "8" "06/06/2007" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -44,7 +44,13 @@ is also marked as being optional, the command operates on all hosts and disks in
 \fIhostname\fR
 and
 \fIdisks\fR
-are special expressions, see the "HOST & DISK EXPRESSION" section of
+are special expressions; see the "HOST & DISK EXPRESSION" section of
+\fBamanda\fR(8)
+for a description.
+.PP
+Commands that take one or more
+\fIdumpspec\fR
+parameters operate on the set of dumps specified by all of the expressions. See the "DUMP SPECIFICATIONS" section of
 \fBamanda\fR(8)
 for a description.
 .PP
@@ -117,6 +123,12 @@ The tapes listed will not be reused when their turn comes up again in the tape c
 value,
 \fIAmanda\fR
 will request new tapes until the count is satisfied again.
+.sp
+Tape marked
+\fIno\-reuse\fR
+are available for recovery, marking them
+\fIno\-reuse\fR
+is a security to be sure amanda will not overwrite them.
 .RE
 .PP
 \fBdue\fR [ \fIhostname\fR [ \fIdisks\fR ]* ]*
@@ -147,6 +159,16 @@ An uppercase letter reverses the sort order for that key. The default sort order
 \fBhkdlpb\fR.
 .RE
 .PP
+\fBholding delete\fR \fIhostname\fR [ \fIdisk\fR [ \fIdatestamp\fR [ .. ] ] ]
+.RS 4
+Delete holding files matching the given specification. At least a hostname must be provided.
+.RE
+.PP
+\fBholding list\fR [\-l] [ \fIhostname\fR [ \fIdisk\fR [ \fIdatestamp\fR [ .. ] ] ] ]
+.RS 4
+List holding files matching the given specification, or all holding files if no specification is provided. With '\-l', additional information (size and level) is provided.
+.RE
+.PP
 \fBdelete\fR [ \fIhostname\fR [ \fIdisks\fR ]* ]+
 .RS 4
 Delete the specified
@@ -227,7 +249,7 @@ on
 .PP
 \fB\-o\fR \fIconfigoption\fR
 .RS 4
-See the "\fBCONFIGURATION OVERWRITE\fR" section in
+See the "\fBCONFIGURATION OVERRIDE\fR" section in
 \fBamanda\fR(8).
 .RE
 .SH "EXAMPLES"
index 0df976307db5a2fda63779b1e3d3b6fff68ae7b6..ae0d536f188675056bcc08e48aebc0dc1773c235 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amaespipe
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 02/07/2007
+.\"      Date: 06/06/2007
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMAESPIPE" "8" "02/07/2007" "" ""
+.TH "AMAESPIPE" "8" "06/06/2007" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
index c7c3adbc5a67184ccfc1321bfbb4635770f7b2cc..51a72dce990da6068b95c9e15c57065f794405a9 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amanda-client.conf
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 02/07/2007
+.\"      Date: 06/06/2007
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMANDA\-CLIENT.CONF" "5" "02/07/2007" "" ""
+.TH "AMANDA\-CLIENT.CONF" "5" "06/06/2007" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -185,6 +185,102 @@ Default from configure
 Default:
 \fI/etc/amandates\fR. The file where amanda keep the last date of each dumplevel.
 .RE
+.PP
+\fBconnect_tries\fR int
+.RS 4
+Default:
+\fI3\fR. How many times the server will try a connection.
+.RE
+.PP
+\fBrep_tries\fR int
+.RS 4
+Default:
+\fI5\fR. How many times amandad will resend a REP packet if it doesn't get the ACK packet.
+.RE
+.PP
+\fBdebug_amandad\fR int
+.RS 4
+Default:
+\fI0\fR. Debug level of the amandad process
+.RE
+.PP
+\fBdebug_amidxtaped\fR int
+.RS 4
+Default:
+\fI0\fR. Debug level of the amidxtaped process
+.RE
+.PP
+\fBdebug_amindexd\fR int
+.RS 4
+Default:
+\fI0\fR. Debug level of the amindexd process
+.RE
+.PP
+\fBdebug_amrecover\fR int
+.RS 4
+Default:
+\fI0\fR. Debug level of the amrecover process
+.RE
+.PP
+\fBdebug_auth\fR int
+.RS 4
+Default:
+\fI0\fR. Debug level of the auth module
+.RE
+.PP
+\fBdebug_event\fR int
+.RS 4
+Default:
+\fI0\fR. Debug level of the event module
+.RE
+.PP
+\fBdebug_holding\fR int
+.RS 4
+Default:
+\fI0\fR. Debug level of the holdingdisk module
+.RE
+.PP
+\fBdebug_protocol\fR int
+.RS 4
+Default:
+\fI0\fR. Debug level of the protocol module
+.RE
+.PP
+\fBdebug_selfcheck\fR int
+.RS 4
+Default:
+\fI0\fR. Debug level of the selfcheck process
+.RE
+.PP
+\fBdebug_sendsize\fR int
+.RS 4
+Default:
+\fI0\fR. Debug level of the sendsize process
+.RE
+.PP
+\fBdebug_sendbackup\fR int
+.RS 4
+Default:
+\fI0\fR. Debug level of the sendbackup process
+.RE
+.PP
+\fBreserved\-udp\-port\fR int,int
+.RS 4
+Default: \-\-with\-udpportrange or
+\fI512,1023\fR. Reserved udp port that will be used (amrecover with bsd or bsdudp)
+.RE
+.PP
+\fBreserved\-tcp\-port\fR int,int
+.RS 4
+Default: \-\-with\-low\-tcpportrange or
+\fI512,1023\fR. Reserved tcp port that will be used (amrecover with bsdtcp)
+.RE
+.PP
+\fBunreserved\-tcp\-port\fR int,int
+.RS 4
+Default: \-\-with\-tcpportrange or
+\fI1025,65536\fR. Unreserved tcp port that will be used (bsd, bsdudp)
+.RE
 .SH "AUTHOR"
 .PP
 James da Silva,
index 60e88f7ad17496d44a19178ecaf23e3b3e507367..f34b9a57af7abd1e8cfdf12407f1697c63511615 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amanda
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 02/07/2007
+.\"      Date: 06/06/2007
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMANDA" "8" "02/07/2007" "" ""
+.TH "AMANDA" "8" "06/06/2007" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -1041,7 +1041,53 @@ T}
 .TE
 .sp
 .PP
-.SH "CONFIGURATION OVERWRITE"
+.SH "DUMP SPECIFICATIONS"
+.PP
+A dump specification selects one or more dumps. It has the form
+\fI[host][:disk][@datestamp]\fR, where each component is a pattern as described above. If a component is missing, it is treated as a wildcard. The characters ':', '@', and '\e' may be escaped within any component by preceding them with a '\e'.
+.PP
+Some examples:
+.TS
+tab(:);
+l l
+l l
+l l
+l l
+l l
+l l.
+T{
+DUMPSPEC
+T}:T{
+DESCRIPTION
+T}
+T{
+client17
+T}:T{
+all dumps of client17
+T}
+T{
+@20080615
+T}:T{
+All dumps on with datestamps matching 20080615
+T}
+T{
+webserver:/var/www
+T}:T{
+All dumps of /var/www on host webserver
+T}
+T{
+webserver:/var/www@200806150317
+T}:T{
+The dump of webserver with datestamp 200806150317
+T}
+T{
+:/var/www
+T}:T{
+All dumps of /var/www on any host
+T}
+.TE
+.sp
+.SH "CONFIGURATION OVERRIDE"
 .PP
 Most command allow to overwrite any configuration parameter on the command line with the \-o option.
 .PP
index b9f6aaae7b663c16c21d8b81144ff3af659eb778..2064aafeb67afa124df281e25ee420354a1fd55e 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amanda.conf
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 02/07/2007
+.\"      Date: 06/06/2007
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMANDA.CONF" "5" "02/07/2007" "" ""
+.TH "AMANDA.CONF" "5" "06/06/2007" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -410,6 +410,18 @@ will wait to get the dump size estimates. For instance, with the default of 300
 will wait up to 20 minutes for that machine. A negative value will be interpreted as a total amount of time to wait per client instead of per disk.
 .RE
 .PP
+\fBconnect_tries\fR int
+.RS 4
+Default:
+\fI3\fR. How many times the server will try a connection.
+.RE
+.PP
+\fBreq_tries\fR int
+.RS 4
+Default:
+\fI3\fR. How many times the server will resend a REQ packet if it doesn't get the ACK packet.
+.RE
+.PP
 \fBnetusage\fR int
 .RS 4
 Default:
@@ -675,6 +687,78 @@ Default:
 \fIAmanda\fR
 configuration file to include within the current file. Useful for sharing dumptypes, tapetypes and interface definitions among several configurations.
 .RE
+.PP
+\fBdebug_auth\fR int
+.RS 4
+Default:
+\fI0\fR. Debug level of the auth module
+.RE
+.PP
+\fBdebug_event\fR int
+.RS 4
+Default:
+\fI0\fR. Debug level of the event module
+.RE
+.PP
+\fBdebug_holding\fR int
+.RS 4
+Default:
+\fI0\fR. Debug level of the holdingdisk module
+.RE
+.PP
+\fBdebug_protocol\fR int
+.RS 4
+Default:
+\fI0\fR. Debug level of the protocol module
+.RE
+.PP
+\fBdebug_planner\fR int
+.RS 4
+Default:
+\fI0\fR. Debug level of the planner process
+.RE
+.PP
+\fBdebug_driver\fR int
+.RS 4
+Default:
+\fI0\fR. Debug level of the driver process
+.RE
+.PP
+\fBdebug_dumper\fR int
+.RS 4
+Default:
+\fI0\fR. Debug level of the dumper process
+.RE
+.PP
+\fBdebug_chunker\fR int
+.RS 4
+Default:
+\fI0\fR. Debug level of the chunker process
+.RE
+.PP
+\fBdebug_taper\fR int
+.RS 4
+Default:
+\fI0\fR. Debug level of the taper process
+.RE
+.PP
+\fBreserved\-udp\-port\fR int,int
+.RS 4
+Default: \-\-with\-udpportrange or
+\fI512,1023\fR. Reserved udp port that will be used (bsd, bsdudp)
+.RE
+.PP
+\fBreserved\-tcp\-port\fR int,int
+.RS 4
+Default: \-\-with\-low\-tcpportrange or
+\fI512,1023\fR. Reserved tcp port that will be used (bsdtcp)
+.RE
+.PP
+\fBunreserved\-tcp\-port\fR int,int
+.RS 4
+Default: \-\-with\-tcpportrange or
+\fI1025,65536\fR. Unreserved tcp port that will be used (bsd, bsdudp)
+.RE
 .SH "HOLDINGDISK SECTION"
 .PP
 The
@@ -1464,6 +1548,11 @@ was compiled with the configure option \-\-with\-maxtapeblocksize=N set with "N"
 \fBconfigure\fR.
 .RE
 .PP
+\fBreadblocksize\fR \fI int\fR
+.RS 4
+Default: (\fIfrom configure \-\-with\-maxtapeblocksize\fR). How much data will be read in each tape record expressed in KiloBytes. Some hardware require a value not too large, and some require it to be equal to the blocksize. It is useful if you configured amanda with a big \-\-with\-maxtapeblocksize and your hardware don't work with a value that big.
+.RE
+.PP
 \fBfile\-pad\fR \fI boolean\fR
 .RS 4
 Default:
index 8d5493893ef7bfff133134d39c1bfca455b9e62b..5ed8abb908fe4eef7ce808ef4414f3ff1d004c6f 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amcheck
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 02/07/2007
+.\"      Date: 06/06/2007
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMCHECK" "8" "02/07/2007" "" ""
+.TH "AMCHECK" "8" "06/06/2007" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -107,7 +107,7 @@ Specify the host and disk on which the command will work.
 .PP
 \fB\-o\fR \fIconfigoption\fR
 .RS 4
-See the "\fBCONFIGURATION OVERWRITE\fR" section in
+See the "\fBCONFIGURATION OVERRIDE\fR" section in
 \fBamanda\fR(8).
 .RE
 .PP
index ba518506a96bed08019449de332d86beb7d54ec7..c1b6fc3da8397b7c1cd436e8f3dc96b2f80e2a7f 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amcheckdb
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 02/07/2007
+.\"      Date: 06/06/2007
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMCHECKDB" "8" "02/07/2007" "" ""
+.TH "AMCHECKDB" "8" "06/06/2007" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
index 3542e3ea160c776df4149b70cb06aa5b2bf9115c..4efa160fc00159774e1538e3e31bf1426cff1a49 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amcleanup
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 02/07/2007
+.\"      Date: 06/06/2007
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMCLEANUP" "8" "02/07/2007" "" ""
+.TH "AMCLEANUP" "8" "06/06/2007" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
index 0478b62d8f72583c247dca1fc199ada80e2b3f1c..ee8095522e72354ac58b2f6b1c4dd45362778511 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amcrypt-ossl-asym
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 02/07/2007
+.\"      Date: 06/06/2007
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMCRYPT\-OSSL\-ASYM" "8" "02/07/2007" "" ""
+.TH "AMCRYPT\-OSSL\-ASYM" "8" "06/06/2007" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
index 17509ef5710d56c9bc8dd2de06ba49d38cd51026..c172d979fa2dd0f08b770d8adac88144680a5c60 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amcrypt-ossl
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 02/07/2007
+.\"      Date: 06/06/2007
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMCRYPT\-OSSL" "8" "02/07/2007" "" ""
+.TH "AMCRYPT\-OSSL" "8" "06/06/2007" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
index 54cd69012e1d4021bb4e8a2696e1039b0eb565b6..07fab4ab5587493e1b645c1ee020193a01ea8b4f 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amcrypt
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 02/07/2007
+.\"      Date: 06/06/2007
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMCRYPT" "8" "02/07/2007" "" ""
+.TH "AMCRYPT" "8" "06/06/2007" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
index d8463dcb46e4e63a6e300659b796ee673355f3bb..cb058bcf93c4e3350d7e41d9590cadc8d9921839 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amdd
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 02/07/2007
+.\"      Date: 06/06/2007
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMDD" "8" "02/07/2007" "" ""
+.TH "AMDD" "8" "06/06/2007" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
index 3b3b5d9e70287727763bb9748cdc862204b2de66..52d075785b74442994432d017fd2ce758dc24f22 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amdump
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 02/07/2007
+.\"      Date: 06/06/2007
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMDUMP" "8" "02/07/2007" "" ""
+.TH "AMDUMP" "8" "06/06/2007" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -48,7 +48,7 @@ Specify the host and disk on which the command will work.
 .PP
 \fB\-o\fR \fIconfigoption\fR
 .RS 4
-See the "\fBCONFIGURATION OVERWRITE\fR" section in
+See the "\fBCONFIGURATION OVERRIDE\fR" section in
 \fBamanda\fR(8).
 .RE
 .SH "EXAMPLE"
index ff941928651cd7beda0031de132a8ab6af6627a8..f83330c0d88a08f9ebd013f1db6a583592c47ac9 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amfetchdump
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 02/07/2007
+.\"      Date: 06/06/2007
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMFETCHDUMP" "8" "02/07/2007" "" ""
+.TH "AMFETCHDUMP" "8" "06/06/2007" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -121,7 +121,7 @@ Force a particular block size when reading from tapes. This value will usually b
 .PP
 \fB\-o\fR \fIconfigoption\fR
 .RS 4
-See the "\fBCONFIGURATION OVERWRITE\fR" section in
+See the "\fBCONFIGURATION OVERRIDE\fR" section in
 \fBamanda\fR(8).
 .RE
 .SH "EXAMPLES"
index ff914dbc6a46fb3e4baa8695cd744015f29957c8..ba1b3e354fbf2267d3bd1cf86b5baf7dfdda3632 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amflush
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 02/07/2007
+.\"      Date: 06/06/2007
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMFLUSH" "8" "02/07/2007" "" ""
+.TH "AMFLUSH" "8" "06/06/2007" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -74,7 +74,7 @@ Specify the host and disk on which the command will work.
 .PP
 \fB\-o\fR \fIconfigoption\fR
 .RS 4
-See the "\fBCONFIGURATION OVERWRITE\fR" section in
+See the "\fBCONFIGURATION OVERRIDE\fR" section in
 \fBamanda\fR(8).
 .RE
 .PP
index a8f8217913e85256cf3a02cacda4096795be2841..b2f6d9652db2d17657f187cee93212d231a5e9e6 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amgetconf
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 02/07/2007
+.\"      Date: 06/06/2007
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMGETCONF" "8" "02/07/2007" "" ""
+.TH "AMGETCONF" "8" "06/06/2007" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -116,7 +116,7 @@ HOLDINGDISK:hd1:use
 .PP
 \fB\-o\fR \fIconfigoption\fR
 .RS 4
-See the "\fBCONFIGURATION OVERWRITE\fR" section in
+See the "\fBCONFIGURATION OVERRIDE\fR" section in
 \fBamanda\fR(8).
 .RE
 .SH "EXAMPLE"
index 89331dedc9614094e601936e3e96b693a369f00a..9fdfd0ecfc69323315d6341c37527119ad83327d 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amlabel
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 02/07/2007
+.\"      Date: 06/06/2007
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMLABEL" "8" "02/07/2007" "" ""
+.TH "AMLABEL" "8" "06/06/2007" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -71,7 +71,7 @@ man page for more details about
 .PP
 \fB\-o\fR \fIconfigoption\fR
 .RS 4
-See the "\fBCONFIGURATION OVERWRITE\fR" section in
+See the "\fBCONFIGURATION OVERRIDE\fR" section in
 \fBamanda\fR(8).
 .RE
 .SH "EXAMPLE"
index 7999eade9a3ffc1ba39b9711c7164916c17be8fd..e56e038b017a09e651c8fcb23dc17f744125aba1 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: ammt
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 02/07/2007
+.\"      Date: 06/06/2007
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMMT" "8" "02/07/2007" "" ""
+.TH "AMMT" "8" "06/06/2007" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
index f0376b06352e369aece3963c70070cc2bb7505d8..8696154fd0989c2e2b17060dca65d6f48c38f1a0 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amoverview
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 02/07/2007
+.\"      Date: 06/06/2007
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMOVERVIEW" "8" "02/07/2007" "" ""
+.TH "AMOVERVIEW" "8" "06/06/2007" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
index 20d825fb654d77ff79dd65aa9473c121a566e666..af605477ba474a7a80ac281937b62a75606b896e 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amplot
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 02/07/2007
+.\"      Date: 06/06/2007
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMPLOT" "8" "02/07/2007" "" ""
+.TH "AMPLOT" "8" "06/06/2007" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
index c2e9dad174fc4a0ca5594f2d9b3617a3b533ccee..083fa495078615a637d0ced676695d4d643065ca 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amrecover
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 02/07/2007
+.\"      Date: 06/06/2007
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMRECOVER" "8" "02/07/2007" "" ""
+.TH "AMRECOVER" "8" "06/06/2007" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -73,7 +73,7 @@ Tape device to use on the tape server host.
 .PP
 \fB\-o\fR \fIclientconfigoption\fR
 .RS 4
-See the "\fBCONFIGURATION OVERWRITE\fR" section in
+See the "\fBCONFIGURATION OVERRIDE\fR" section in
 \fBamanda\fR(8).
 .RE
 .SH "COMMANDS"
@@ -134,7 +134,7 @@ dates in the current month of the current year
 .RE
 .RE
 .PP
-\fBsetdisk \fR\fIdiskname\fR [\fImountpoint\fR]
+\fBsetdisk\fR \fIdiskname\fR [\fImountpoint\fR]
 .RS 4
 Specifies which disk to consider (default: the disk holding the working directory where
 \fBamrecover\fR
@@ -150,19 +150,19 @@ configuration file. The disk must be local to the host. If
 is not specified, all pathnames will be relative to the (unknown) mount point instead of full pathnames.
 .RE
 .PP
-\fBlisthost \fR[\fIdiskdevice\fR]
+\fBlisthost\fR [\fIdiskdevice\fR]
 .RS 4
 List all
 \fBhost\fR
 .RE
 .PP
-\fBlistdisk \fR[\fIdiskdevice\fR]
+\fBlistdisk\fR [\fIdiskdevice\fR]
 .RS 4
 List all
 \fBdiskname\fR
 .RE
 .PP
-\fBsettape \fR[[\fIserver\fR]:][\fItapedev\fR|\fIdefault\fR]
+\fBsettape\fR [[\fIserver\fR]:][\fItapedev\fR|\fIdefault\fR]
 .RS 4
 Specifies the host to use as the tape server, and which of its tape devices to use. If the server is omitted, but the colon is not, the server name reverts to the configure\-time default. If the tape device is omitted, it remains unchanged. To use the default tape device selected by the tape server, the word
 \fIdefault\fR
@@ -192,7 +192,7 @@ Using tape /dev/nst2 from server server2.
 .RE
 .RE
 .PP
-\fBsetmode \fR\fImode\fR
+\fBsetmode\fR \fImode\fR
 .RS 4
 Set the extraction mode for Samba shares. If
 \fImode\fR
@@ -218,7 +218,7 @@ Show the backup history of the current host and disk. Dates, levels, tapes and f
 Display the name of the current backup working directory.
 .RE
 .PP
-\fBcd dir\fR
+\fBcd\fR \fIdir\fR
 .RS 4
 Change the backup working directory to
 \fIdir.\fR
@@ -228,7 +228,7 @@ If the mount point was specified with
 can be a shell style wildcards.
 .RE
 .PP
-\fBcdx \fR\fIdir\fR
+\fBcdx\fR \fIdir\fR
 .RS 4
 Like the
 \fBcd\fR
@@ -242,7 +242,7 @@ Display the
 working directory. Files will be restored under this directory, relative to the backed up filesystem.
 .RE
 .PP
-\fBlcd \fR\fIpath\fR
+\fBlcd\fR \fIpath\fR
 .RS 4
 Change the
 \fBamrecover\fR
@@ -257,27 +257,27 @@ List the contents of the current backup working directory. See the description o
 command for how the view of the directory is built up. The backup date is shown for each file.
 .RE
 .PP
-\fBadd \fR\fIitem1 item2 ...\fR
+\fBadd\fR \fIitem1 item2 ...\fR
 .RS 4
 Add the specified files or directories to the restore list. Each item may have shell style wildcards.
 .RE
 .PP
-\fBaddx \fR\fIitem1 item2 ...\fR
+\fBaddx\fR \fIitem1 item2 ...\fR
 .RS 4
 Add the specified files or directories to the restore list. Each item may be a regular expression.
 .RE
 .PP
-\fBdelete \fR\fIitem1 item2 ...\fR
+\fBdelete\fR \fIitem1 item2 ...\fR
 .RS 4
 Delete the specified files or directories from the restore list. Each item may have shell style wildcards.
 .RE
 .PP
-\fBdeletex \fR\fIitem1 item2 ...\fR
+\fBdeletex\fR \fIitem1 item2 ...\fR
 .RS 4
 Delete the specified files or directories from the restore list. Each item may be a regular expression.
 .RE
 .PP
-\fBlist \fR\fIfile\fR
+\fBlist\fR \fIfile\fR
 .RS 4
 Display the contents of the restore list. If a file name is specified, the restore list is written to that file. This can be used to manually extract the files from the
 \fIAmanda\fR
index 0aa0e09b98cba8d755a66aacda95388e54fb92d5..f9b6380fbe240b1b84d633d0afcf41377922654a 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amreport
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 02/07/2007
+.\"      Date: 06/06/2007
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMREPORT" "8" "02/07/2007" "" ""
+.TH "AMREPORT" "8" "06/06/2007" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -84,7 +84,7 @@ directive is specified in amanda.conf.
 .PP
 \fB\-o\fR \fIconfigoption\fR
 .RS 4
-See the "\fBCONFIGURATION OVERWRITE\fR" section in
+See the "\fBCONFIGURATION OVERRIDE\fR" section in
 \fBamanda\fR(8).
 .RE
 .SH "LABEL PRINTING"
index 551d48287fe408ce4a29910ce5ccfac7e6832517..6a92015353ca0c28517364f189b5e1250a2e5dd4 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amrestore
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 02/07/2007
+.\"      Date: 06/06/2007
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMRESTORE" "8" "02/07/2007" "" ""
+.TH "AMRESTORE" "8" "06/06/2007" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -174,7 +174,7 @@ If a header is written (\-r or \-h), only 32 KBytes are output regardless of the
 .PP
 \fB\-o\fR \fIconfigoption\fR
 .RS 4
-See the "\fBCONFIGURATION OVERWRITE\fR" section in
+See the "\fBCONFIGURATION OVERRIDE\fR" section in
 \fBamanda\fR(8).
 .RE
 .SH "EXAMPLES"
index a3327be13b233f0ad09f511fd7ab1ceded6f0ac2..7ed6110fe7928c56093e6a7a74cf8cc7567b5c58 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amrmtape
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 02/07/2007
+.\"      Date: 06/06/2007
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMRMTAPE" "8" "02/07/2007" "" ""
+.TH "AMRMTAPE" "8" "06/06/2007" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
index 9733d1181d3f74e0096464c8b7fe734279e0abf8..7e8fd20129101e03c3d78b57b5f3cb79812bdb6c 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amstatus
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 02/07/2007
+.\"      Date: 06/06/2007
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMSTATUS" "8" "02/07/2007" "" ""
+.TH "AMSTATUS" "8" "06/06/2007" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
index 4e7edb8bda629e7fba0213a7458a92f358211d0c..56e5c8a7aec767e7a00c819bd9d1ff19f536b811 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amtape
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 02/07/2007
+.\"      Date: 06/06/2007
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMTAPE" "8" "02/07/2007" "" ""
+.TH "AMTAPE" "8" "06/06/2007" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
@@ -141,7 +141,7 @@ to the next tape, but do not load it.
 .PP
 \fB\-o\fR \fIconfigoption\fR
 .RS 4
-See the "\fBCONFIGURATION OVERWRITE\fR" section in
+See the "\fBCONFIGURATION OVERRIDE\fR" section in
 \fBamanda\fR(8).
 .RE
 .PP
index fd5f6bd169b0038aebae66d1f368b70b57ea5510..0734bf1577814736ce13704a754844a1559d417e 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amtapetype
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 02/07/2007
+.\"      Date: 06/06/2007
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMTAPETYPE" "8" "02/07/2007" "" ""
+.TH "AMTAPETYPE" "8" "06/06/2007" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
index fb387e9b8ce55206203ddec7e324de50dae26736..3d010f680a57e5b2ea854dcf583aa2fc805edb1b 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amtoc
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 02/07/2007
+.\"      Date: 06/06/2007
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMTOC" "8" "02/07/2007" "" ""
+.TH "AMTOC" "8" "06/06/2007" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
index d56f3946cf45b3c716ed2dbe51bcd7ea329a94f4..59ca7cd9af49fb41f99ca903b504aad94c0419dd 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amverify
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 02/07/2007
+.\"      Date: 06/06/2007
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMVERIFY" "8" "02/07/2007" "" ""
+.TH "AMVERIFY" "8" "06/06/2007" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
index 5111f8b4a4ed448581dd5347af4bc3a6c339f304..50bb981f2f3c7b378204ac038bdc9cba53b59244 100644 (file)
@@ -1,11 +1,11 @@
 .\"     Title: amverifyrun
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.72.0 <http://docbook.sf.net/>
-.\"      Date: 02/07/2007
+.\"      Date: 06/06/2007
 .\"    Manual: 
 .\"    Source: 
 .\"
-.TH "AMVERIFYRUN" "8" "02/07/2007" "" ""
+.TH "AMVERIFYRUN" "8" "06/06/2007" "" ""
 .\" disable hyphenation
 .nh
 .\" disable justification (adjust text to left margin only)
index 8a94b614e6d403d8441c7aa3ec81da1ad848e7da..b66f5af5735e13520f3e711f382af1a2631a485b 100644 (file)
@@ -42,27 +42,19 @@ man page for more details about &A;.</para>
 </refsect1>
 
 <refsect1><title>COMMANDS</title>
-<para>Commands that take a
-<emphasis remap='I'>hostname</emphasis>
-[
-<emphasis remap='I'>disks</emphasis>
-]
-parameter pair operate on all disks in the
-<emphasis remap='I'>disklist</emphasis>
-for that
-<emphasis remap='I'>hostname</emphasis>
-if no disks are specified.
-Where
-<emphasis remap='I'>hostname</emphasis>
-is also marked as being optional,
-the command operates on all hosts and disks in the
-<emphasis remap='I'>disklist</emphasis>.
-Both
-<emphasis remap='I'>hostname</emphasis>
-and
-<emphasis remap='I'>disks</emphasis>
-are special expressions, see the &quot;HOST &amp; DISK EXPRESSION&quot; section
-of 
+<para>Commands that take a <emphasis remap='I'>hostname</emphasis> [ <emphasis remap='I'>disks</emphasis> ]
+parameter pair operate on all disks in the <emphasis remap='I'>disklist</emphasis> for that
+<emphasis remap='I'>hostname</emphasis> if no disks are specified.  Where
+<emphasis remap='I'>hostname</emphasis> is also marked as being optional,
+the command operates on all hosts and disks in the <emphasis remap='I'>disklist</emphasis>.
+Both <emphasis remap='I'>hostname</emphasis> and <emphasis remap='I'>disks</emphasis>
+are special expressions; see the &quot;HOST &amp; DISK EXPRESSION&quot; section
+of <citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>
+for a description.</para>
+
+<para>Commands that take one or more <emphasis remap='I'>dumpspec</emphasis> parameters operate
+on the set of dumps specified by all of the expressions.  See the &quot;DUMP SPECIFICATIONS&quot;
+section of
 <citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>
 for a description.</para>
 
@@ -140,6 +132,9 @@ Note that if this causes the number of reusable tapes to drop below the
 <emphasis remap='B'>amanda.conf</emphasis>
 <emphasis remap='I'>tapecycle</emphasis>
 value, &A; will request new tapes until the count is satisfied again.</para>
+<para>Tape marked <emphasis remap='I'>no-reuse</emphasis> are available
+for recovery, marking them <emphasis remap='I'>no-reuse</emphasis> is a
+security to be sure amanda will not overwrite them.</para>
   </listitem>
   </varlistentry>
   <varlistentry>
@@ -170,6 +165,27 @@ The default sort order is <emphasis remap='B'>hkdlpb</emphasis>.</para>
 </listitem>
 </varlistentry>
 
+  <varlistentry>
+  <term><emphasis remap='B'>holding delete</emphasis> <emphasis remap="I">hostname</emphasis> [ <emphasis remap="I">disk</emphasis> [ <emphasis remap="I">datestamp</emphasis> [ .. ] ] ]</term>
+  <listitem>
+
+    <para>Delete holding files matching the given specification.  At least
+    a hostname must be provided.</para>
+
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><emphasis remap='B'>holding list</emphasis> [-l] [ <emphasis remap="I">hostname</emphasis> [ <emphasis remap="I">disk</emphasis> [ <emphasis remap="I">datestamp</emphasis> [ .. ] ] ] ]</term>
+  <listitem>
+
+    <para>List holding files matching the given specification, or all holding
+    files if no specification is provided.  With '-l', additional information
+    (size and level) is provided.</para>
+
+  </listitem>
+  </varlistentry>
+
   <varlistentry>
   <term><emphasis remap='B'>delete</emphasis> [ <emphasis remap='I'>hostname</emphasis> [ <emphasis remap='I'>disks</emphasis> ]* ]+</term>
   <listitem>
@@ -252,7 +268,7 @@ Mostly used for debugging.</para>
   <varlistentry>
   <term><emphasis remap='B'>-o</emphasis> <replaceable>configoption</replaceable></term>
   <listitem>
-<para>See the "<emphasis remap='B'>CONFIGURATION OVERWRITE</emphasis>"
+<para>See the "<emphasis remap='B'>CONFIGURATION OVERRIDE</emphasis>"
  section in <citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
   </listitem>
   </varlistentry>
index 077f3b81f08c7734f29a3cc0b17f472d4ffa2b78..2cf5f381f3588b6f567fd39663591f7089872261 100644 (file)
@@ -231,6 +231,150 @@ The file where amanda keep the last date of each dumplevel.</para>
   </listitem>
   </varlistentry>
 
+  <varlistentry>
+  <term><emphasis remap='B'>connect_tries</emphasis> int</term>
+  <listitem>
+<para>Default:
+<emphasis remap='I'>3</emphasis>.
+How many times the server will try a connection.</para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><emphasis remap='B'>rep_tries</emphasis> int</term>
+  <listitem>
+<para>Default:
+<emphasis remap='I'>5</emphasis>.
+How many times amandad will resend a REP packet if it doesn't get the ACK packet.</para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><emphasis remap='B'>debug_amandad</emphasis> int</term>
+  <listitem>
+<para>Default:
+<emphasis remap='I'>0</emphasis>.
+Debug level of the amandad process</para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><emphasis remap='B'>debug_amidxtaped</emphasis> int</term>
+  <listitem>
+<para>Default:
+<emphasis remap='I'>0</emphasis>.
+Debug level of the amidxtaped process</para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><emphasis remap='B'>debug_amindexd</emphasis> int</term>
+  <listitem>
+<para>Default:
+<emphasis remap='I'>0</emphasis>.
+Debug level of the amindexd process</para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><emphasis remap='B'>debug_amrecover</emphasis> int</term>
+  <listitem>
+<para>Default:
+<emphasis remap='I'>0</emphasis>.
+Debug level of the amrecover process</para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><emphasis remap='B'>debug_auth</emphasis> int</term>
+  <listitem>
+<para>Default:
+<emphasis remap='I'>0</emphasis>.
+Debug level of the auth module</para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><emphasis remap='B'>debug_event</emphasis> int</term>
+  <listitem>
+<para>Default:
+<emphasis remap='I'>0</emphasis>.
+Debug level of the event module</para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><emphasis remap='B'>debug_holding</emphasis> int</term>
+  <listitem>
+<para>Default:
+<emphasis remap='I'>0</emphasis>.
+Debug level of the holdingdisk module</para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><emphasis remap='B'>debug_protocol</emphasis> int</term>
+  <listitem>
+<para>Default:
+<emphasis remap='I'>0</emphasis>.
+Debug level of the protocol module</para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><emphasis remap='B'>debug_selfcheck</emphasis> int</term>
+  <listitem>
+<para>Default:
+<emphasis remap='I'>0</emphasis>.
+Debug level of the selfcheck process</para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><emphasis remap='B'>debug_sendsize</emphasis> int</term>
+  <listitem>
+<para>Default:
+<emphasis remap='I'>0</emphasis>.
+Debug level of the sendsize process</para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><emphasis remap='B'>debug_sendbackup</emphasis> int</term>
+  <listitem>
+<para>Default:
+<emphasis remap='I'>0</emphasis>.
+Debug level of the sendbackup process</para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><emphasis remap='B'>reserved-udp-port</emphasis> int,int</term>
+  <listitem>
+<para>Default: --with-udpportrange or 
+<emphasis remap='I'>512,1023</emphasis>.
+Reserved udp port that will be used (amrecover with bsd or bsdudp)</para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><emphasis remap='B'>reserved-tcp-port</emphasis> int,int</term>
+  <listitem>
+<para>Default: --with-low-tcpportrange or 
+<emphasis remap='I'>512,1023</emphasis>.
+Reserved tcp port that will be used (amrecover with bsdtcp)</para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><emphasis remap='B'>unreserved-tcp-port</emphasis> int,int</term>
+  <listitem>
+<para>Default: --with-tcpportrange or 
+<emphasis remap='I'>1025,65536</emphasis>.
+Unreserved tcp port that will be used (bsd, bsdudp)</para>
+  </listitem>
+  </varlistentry>
+
 </variablelist>
 </refsect2>
 </refsect1>
index a30c086108ebd8e03da92ba40b77fe5141bb9a58..e65d913aaa7b78b9b46ba3c4edf8165c1ceef89d 100644 (file)
@@ -1170,7 +1170,57 @@ Leading ^ is removed. Trailing $ forces an exact match.</para>
 
 </refsect1>
 
-<refsect1><title>CONFIGURATION OVERWRITE</title>
+<refsect1><title>DUMP SPECIFICATIONS</title> <para>A dump
+specification selects one or more dumps.  It has the form <emphasis
+remap="I">[host][:disk][@datestamp]</emphasis>, where each component
+is a pattern as described above.  If a component is missing, it
+is treated as a wildcard.  The characters ':', '@', and '\' may be
+escaped within any component by preceding them with a '\'.</para>
+
+<para>Some examples:</para>
+
+<informaltable frame="none">
+<tgroup cols="2" align="left">
+<tbody>
+
+<row>
+<entry>DUMPSPEC</entry>
+<entry>DESCRIPTION</entry>
+</row>
+
+<row>
+<entry>client17</entry>
+<entry>all dumps of client17</entry>
+</row>
+
+<row>
+<entry>@20080615</entry>
+<entry>All dumps on with datestamps matching 20080615</entry>
+</row>
+
+<row>
+<entry>webserver:/var/www</entry>
+<entry>All dumps of /var/www on host webserver</entry>
+</row>
+
+<row>
+<entry>webserver:/var/www@200806150317</entry>
+<entry>The dump of webserver with datestamp 200806150317</entry>
+</row>
+
+<row>
+<entry>:/var/www</entry>
+<entry>All dumps of /var/www on any host</entry>
+</row>
+
+</tbody>
+</tgroup>
+</informaltable>
+
+
+</refsect1>
+
+<refsect1><title>CONFIGURATION OVERRIDE</title>
 <para>Most command allow to overwrite any configuration parameter on
 the command line with the -o option.</para>
 <para>-o NAME=value</para>
index adcae4f97b83f6a3b6c33617630d134a2032cfdd..027a4ab18c0ff4647e7e80391137906154b171e6 100644 (file)
@@ -501,6 +501,7 @@ running from within
 will wait before it fails with a data timeout error.</para>
   </listitem>
   </varlistentry>
+
   <varlistentry>
   <term><emphasis remap='B'>etimeout</emphasis> int</term>
   <listitem>
@@ -518,6 +519,25 @@ A negative value will be interpreted as a total amount of time to wait
 per client instead of per disk.</para>
   </listitem>
   </varlistentry>
+
+  <varlistentry>
+  <term><emphasis remap='B'>connect_tries</emphasis> int</term>
+  <listitem>
+<para>Default:
+<emphasis remap='I'>3</emphasis>.
+How many times the server will try a connection.</para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><emphasis remap='B'>req_tries</emphasis> int</term>
+  <listitem>
+<para>Default:
+<emphasis remap='I'>3</emphasis>.
+How many times the server will resend a REQ packet if it doesn't get the ACK packet.</para>
+  </listitem>
+  </varlistentry>
+
   <varlistentry>
   <term><emphasis remap='B'>netusage</emphasis> int</term>
   <listitem>
@@ -866,6 +886,115 @@ The name of an &A; configuration file to include within the current file.
 Useful for sharing dumptypes, tapetypes and interface definitions among several configurations.</para>
   </listitem>
   </varlistentry>
+
+  <varlistentry>
+  <term><emphasis remap='B'>debug_auth</emphasis> int</term>
+  <listitem>
+<para>Default:
+<emphasis remap='I'>0</emphasis>.
+Debug level of the auth module</para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><emphasis remap='B'>debug_event</emphasis> int</term>
+  <listitem>
+<para>Default:
+<emphasis remap='I'>0</emphasis>.
+Debug level of the event module</para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><emphasis remap='B'>debug_holding</emphasis> int</term>
+  <listitem>
+<para>Default:
+<emphasis remap='I'>0</emphasis>.
+Debug level of the holdingdisk module</para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><emphasis remap='B'>debug_protocol</emphasis> int</term>
+  <listitem>
+<para>Default:
+<emphasis remap='I'>0</emphasis>.
+Debug level of the protocol module</para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><emphasis remap='B'>debug_planner</emphasis> int</term>
+  <listitem>
+<para>Default:
+<emphasis remap='I'>0</emphasis>.
+Debug level of the planner process</para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><emphasis remap='B'>debug_driver</emphasis> int</term>
+  <listitem>
+<para>Default:
+<emphasis remap='I'>0</emphasis>.
+Debug level of the driver process</para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><emphasis remap='B'>debug_dumper</emphasis> int</term>
+  <listitem>
+<para>Default:
+<emphasis remap='I'>0</emphasis>.
+Debug level of the dumper process</para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><emphasis remap='B'>debug_chunker</emphasis> int</term>
+  <listitem>
+<para>Default:
+<emphasis remap='I'>0</emphasis>.
+Debug level of the chunker process</para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><emphasis remap='B'>debug_taper</emphasis> int</term>
+  <listitem>
+<para>Default:
+<emphasis remap='I'>0</emphasis>.
+Debug level of the taper process</para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><emphasis remap='B'>reserved-udp-port</emphasis> int,int</term>
+  <listitem>
+<para>Default: --with-udpportrange or 
+<emphasis remap='I'>512,1023</emphasis>.
+Reserved udp port that will be used (bsd, bsdudp)</para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><emphasis remap='B'>reserved-tcp-port</emphasis> int,int</term>
+  <listitem>
+<para>Default: --with-low-tcpportrange or 
+<emphasis remap='I'>512,1023</emphasis>.
+Reserved tcp port that will be used (bsdtcp)</para>
+  </listitem>
+  </varlistentry>
+
+  <varlistentry>
+  <term><emphasis remap='B'>unreserved-tcp-port</emphasis> int,int</term>
+  <listitem>
+<para>Default: --with-tcpportrange or 
+<emphasis remap='I'>1025,65536</emphasis>.
+Unreserved tcp port that will be used (bsd, bsdudp)</para>
+  </listitem>
+  </varlistentry>
+
 </variablelist>
 </refsect2>
 </refsect1>
@@ -1742,6 +1871,18 @@ The tape record size (= blocksize) can not be reduced below the default 32 KByte
 The parameter blocksize can only be raised if &A; was compiled with the configure option
 --with-maxtapeblocksize=N set with &quot;N&quot; greater than 32 during
 &configure;.
+</para>
+  </listitem>
+  </varlistentry>
+<varlistentry>
+<term><emphasis remap='B'>readblocksize</emphasis> <emphasis remap='I'> int</emphasis></term>
+<listitem>
+<para>Default:
+(<emphasis remap='I'>from configure --with-maxtapeblocksize</emphasis>).
+How much data will be read in each tape record expressed in KiloBytes.
+Some hardware require a value not too large, and some require it to be equal to the blocksize.
+It is useful if you configured amanda with a big --with-maxtapeblocksize and your 
+hardware don't work with a value that big.
 </para>
   </listitem>
   </varlistentry>
index b9f72c0a3e4341b46e67b724d94e6f64332d42bf..4001dfe5e53d493322001d242b2dbd939d213fef 100644 (file)
@@ -152,7 +152,7 @@ Implies
   <varlistentry>
   <term><emphasis remap='B'>-o</emphasis> <replaceable>configoption</replaceable></term>
   <listitem>
-<para>See the "<emphasis remap='B'>CONFIGURATION OVERWRITE</emphasis>" section in <citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
+<para>See the "<emphasis remap='B'>CONFIGURATION OVERRIDE</emphasis>" section in <citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
   </listitem>
   </varlistentry>
 </variablelist>
index 7c7a7635d612e9b26658bf7dd8539b9ebd387815..740f58984fcfc1dd9ba414bd88176d424feb0491 100644 (file)
@@ -74,7 +74,7 @@ man page for more details about &A;.</para>
   <varlistentry>
   <term><emphasis remap='B'>-o</emphasis> <replaceable>configoption</replaceable></term>
   <listitem>
-<para>See the "<emphasis remap='B'>CONFIGURATION OVERWRITE</emphasis>" section in <citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
+<para>See the "<emphasis remap='B'>CONFIGURATION OVERRIDE</emphasis>" section in <citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
   </listitem>
   </varlistentry>
 
index 4f4d4a3878679c7f74491d2dc1239d7b37cc1520..8e717222e7e9592a842c534ea11a8c003c91fb9e 100644 (file)
@@ -169,7 +169,7 @@ operation.</para></listitem>
   <varlistentry>
   <term><emphasis remap='B'>-o</emphasis> <replaceable>configoption</replaceable></term>
   <listitem>
-<para>See the "<emphasis remap='B'>CONFIGURATION OVERWRITE</emphasis>"
+<para>See the "<emphasis remap='B'>CONFIGURATION OVERRIDE</emphasis>"
  section in <citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
   </listitem>
   </varlistentry>
index 9c268d33435bc1d66a9ac2898d639af332235125..aaa9ed1e6a1e1fd2ef661e521ae25f0f1b4eb68c 100644 (file)
@@ -110,7 +110,7 @@ dumps from 25 december 2000 to 27 december 2000.</para>
   <varlistentry>
   <term><emphasis remap='B'>-o</emphasis> <replaceable>configoption</replaceable></term>
   <listitem>
-<para>See the "<emphasis remap='B'>CONFIGURATION OVERWRITE</emphasis>" section in <citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
+<para>See the "<emphasis remap='B'>CONFIGURATION OVERRIDE</emphasis>" section in <citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
   </listitem>
   </varlistentry>
 
index 933b877cd7b7a46489505a265ac7ea7b6b84a1aa..17755986117355299c2bd0d9f8d00acef65beea9 100644 (file)
@@ -146,7 +146,7 @@ man page for more details about &A;.</para>
 <varlistentry>
 <term><emphasis remap='B'>-o</emphasis> <replaceable>configoption</replaceable></term>
   <listitem>
-<para>See the "<emphasis remap='B'>CONFIGURATION OVERWRITE</emphasis>" section in <citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
+<para>See the "<emphasis remap='B'>CONFIGURATION OVERRIDE</emphasis>" section in <citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
   </listitem>
   </varlistentry>
 
index 05c0a5b71acd448ef68ed430a981db3984483316..c36ee0e65fe2a67ef10be8d5267f2a448d1edd1e 100644 (file)
@@ -85,7 +85,7 @@ man page for more details about &A;.</para>
   <varlistentry>
   <term><emphasis remap='B'>-o</emphasis> <replaceable>configoption</replaceable></term>
   <listitem>
-<para>See the "<emphasis remap='B'>CONFIGURATION OVERWRITE</emphasis>" section in <citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
+<para>See the "<emphasis remap='B'>CONFIGURATION OVERRIDE</emphasis>" section in <citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
   </listitem>
   </varlistentry>
 
index d00fbca0e3da03aca5c49916a47ed7f7fab5be48..db25f8e882fd8d97f73822b6e636ded8c49606e0 100644 (file)
@@ -86,7 +86,7 @@ client-custom-compressed tapes.</para>
   <varlistentry>
   <term><emphasis remap='B'>-o</emphasis> <replaceable>clientconfigoption</replaceable></term>
   <listitem>
-<para>See the "<emphasis remap='B'>CONFIGURATION OVERWRITE</emphasis>"
+<para>See the "<emphasis remap='B'>CONFIGURATION OVERRIDE</emphasis>"
  section in <citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
   </listitem>
   </varlistentry>
@@ -167,7 +167,7 @@ would yield files from the following days:</para>
 <!-- .RE -->
 <variablelist remap='TP'>
   <varlistentry>
-  <term><emphasis remap='B'>setdisk </emphasis><emphasis remap='I'>diskname</emphasis> [<emphasis remap='I'>mountpoint</emphasis>]</term>
+  <term><emphasis remap='B'>setdisk</emphasis> <emphasis remap='I'>diskname</emphasis> [<emphasis remap='I'>mountpoint</emphasis>]</term>
   <listitem>
 <para>Specifies which disk to consider
 (default: the disk holding the working directory where
@@ -189,21 +189,21 @@ mount point instead of full pathnames.</para>
   </listitem>
   </varlistentry>
   <varlistentry>
-  <term><emphasis remap='B'>listhost </emphasis>[<emphasis remap='I'>diskdevice</emphasis>]</term>
+  <term><emphasis remap='B'>listhost</emphasis> [<emphasis remap='I'>diskdevice</emphasis>]</term>
   <listitem>
 <para>List all
 <emphasis remap='B'>host</emphasis></para>
   </listitem>
   </varlistentry>
   <varlistentry>
-  <term><emphasis remap='B'>listdisk </emphasis>[<emphasis remap='I'>diskdevice</emphasis>]</term>
+  <term><emphasis remap='B'>listdisk</emphasis> [<emphasis remap='I'>diskdevice</emphasis>]</term>
   <listitem>
 <para>List all
 <emphasis remap='B'>diskname</emphasis></para>
   </listitem>
   </varlistentry>
   <varlistentry>
-  <term><emphasis remap='B'>settape </emphasis>[[<emphasis remap='I'>server</emphasis>]:][<emphasis remap='I'>tapedev</emphasis>|<emphasis remap='I'>default</emphasis>]</term>
+  <term><emphasis remap='B'>settape</emphasis> [[<emphasis remap='I'>server</emphasis>]:][<emphasis remap='I'>tapedev</emphasis>|<emphasis remap='I'>default</emphasis>]</term>
   <listitem>
 <para>Specifies the host to use as the tape server, and which of its tape
 devices to use.
@@ -244,7 +244,7 @@ Using tape /dev/nst2 from server server2.
 
 <variablelist remap='TP'>
   <varlistentry>
-  <term><emphasis remap='B'>setmode </emphasis><emphasis remap='I'>mode</emphasis></term>
+  <term><emphasis remap='B'>setmode</emphasis> <emphasis remap='I'>mode</emphasis></term>
   <listitem>
 <para>Set the extraction mode for Samba shares.
 If
@@ -280,7 +280,7 @@ Dates, levels, tapes and file position on tape of each backup are displayed.</pa
   </listitem>
   </varlistentry>
   <varlistentry>
-  <term><emphasis remap='B'>cd dir</emphasis></term>
+  <term><emphasis remap='B'>cd</emphasis> <emphasis remap='I'>dir</emphasis></term>
   <listitem>
 <para>Change the backup working directory to
 <emphasis remap='I'>dir.</emphasis>
@@ -297,7 +297,7 @@ can be a shell style wildcards.</para>
   </listitem>
   </varlistentry>
   <varlistentry>
-  <term><emphasis remap='B'>cdx </emphasis><emphasis remap='I'>dir</emphasis></term>
+  <term><emphasis remap='B'>cdx</emphasis> <emphasis remap='I'>dir</emphasis></term>
   <listitem>
 <para>Like the
 <emphasis remap='B'>cd</emphasis>
@@ -315,7 +315,7 @@ relative to the backed up filesystem.</para>
   </listitem>
   </varlistentry>
   <varlistentry>
-  <term><emphasis remap='B'>lcd </emphasis><emphasis remap='I'>path</emphasis></term>
+  <term><emphasis remap='B'>lcd</emphasis> <emphasis remap='I'>path</emphasis></term>
   <listitem>
 <para>Change the
 <command>amrecover</command>
@@ -335,35 +335,35 @@ The backup date is shown for each file.</para>
   </listitem>
   </varlistentry>
   <varlistentry>
-  <term><emphasis remap='B'>add </emphasis><emphasis remap='I'>item1 item2 ...</emphasis></term>
+  <term><emphasis remap='B'>add</emphasis> <emphasis remap='I'>item1 item2 ...</emphasis></term>
   <listitem>
 <para>Add the specified files or directories to the restore list.
 Each item may have shell style wildcards.</para>
   </listitem>
   </varlistentry>
   <varlistentry>
-  <term><emphasis remap='B'>addx </emphasis><emphasis remap='I'>item1 item2 ...</emphasis></term>
+  <term><emphasis remap='B'>addx</emphasis> <emphasis remap='I'>item1 item2 ...</emphasis></term>
   <listitem>
 <para>Add the specified files or directories to the restore list.
 Each item may be a regular expression.</para>
   </listitem>
   </varlistentry>
   <varlistentry>
-  <term><emphasis remap='B'>delete </emphasis><emphasis remap='I'>item1 item2 ...</emphasis></term>
+  <term><emphasis remap='B'>delete</emphasis> <emphasis remap='I'>item1 item2 ...</emphasis></term>
   <listitem>
 <para>Delete the specified files or directories from the restore list.
 Each item may have shell style wildcards.</para>
   </listitem>
   </varlistentry>
   <varlistentry>
-  <term><emphasis remap='B'>deletex </emphasis><emphasis remap='I'>item1 item2 ...</emphasis></term>
+  <term><emphasis remap='B'>deletex</emphasis> <emphasis remap='I'>item1 item2 ...</emphasis></term>
   <listitem>
 <para>Delete the specified files or directories from the restore list.
 Each item may be a regular expression.</para>
   </listitem>
   </varlistentry>
   <varlistentry>
-  <term><emphasis remap='B'>list </emphasis><emphasis remap='I'>file</emphasis></term>
+  <term><emphasis remap='B'>list</emphasis> <emphasis remap='I'>file</emphasis></term>
   <listitem>
 <para>Display the contents of the restore list.
 If a file name is specified,
index b59c06e4acad0de009d58c3ae2ed27f26522666f..70f7474cb08f5fd4601bffb115cc47df0e7e5670 100644 (file)
@@ -122,7 +122,7 @@ directive is specified in amanda.conf.</para>
   <varlistentry>
   <term><emphasis remap='B'>-o</emphasis> <replaceable>configoption</replaceable></term>
   <listitem>
-<para>See the "<emphasis remap='B'>CONFIGURATION OVERWRITE</emphasis>" section in <citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
+<para>See the "<emphasis remap='B'>CONFIGURATION OVERRIDE</emphasis>" section in <citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
   </listitem>
   </varlistentry>
 
index 75304bebff12a0e16403d0a4627e02d01514f497..a63412e326aadb05343cbade0d5bf108911e9b2b 100644 (file)
@@ -246,7 +246,7 @@ This makes the resulting image usable as a holding file.</para>
   <varlistentry>
   <term><emphasis remap='B'>-o</emphasis> <replaceable>configoption</replaceable></term>
   <listitem>
-<para>See the "<emphasis remap='B'>CONFIGURATION OVERWRITE</emphasis>" section in <citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
+<para>See the "<emphasis remap='B'>CONFIGURATION OVERRIDE</emphasis>" section in <citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
   </listitem>
   </varlistentry>
 </variablelist>
index f8fb7a2744a093940ea54feebf1bd7ee5c275416..497c824f9558b7dc65b8d0609dcd44ce48a8c4b9 100644 (file)
@@ -192,7 +192,7 @@ to the next tape, but do not load it.</para>
   <varlistentry>
   <term><emphasis remap='B'>-o</emphasis> <replaceable>configoption</replaceable></term>
   <listitem>
-<para>See the "<emphasis remap='B'>CONFIGURATION OVERWRITE</emphasis>"
+<para>See the "<emphasis remap='B'>CONFIGURATION OVERRIDE</emphasis>"
  section in <citerefentry><refentrytitle>amanda</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
   </listitem>
   </varlistentry>
index 85719957f499547d0075f3434a14abb8cff31f3a..766afd299b9c2dfe2a29e5801e2fc2609100b0ec 100644 (file)
@@ -2,7 +2,8 @@
 
 INCLUDES =     -I$(top_builddir)/common-src \
                -I$(top_srcdir)/common-src   \
-               -I$(top_srcdir)/client-src
+               -I$(top_srcdir)/client-src   \
+               -I$(top_srcdir)/gnulib
 
 LINT=@AMLINT@
 LINTFLAGS=@AMLINTFLAGS@
@@ -26,7 +27,8 @@ LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
        @LEXLIB@ \
        ../client-src/libamclient.$(LIB_EXTENSION) \
        $(READLINE_LIBS) \
-       ../common-src/libamanda.$(LIB_EXTENSION)
+       ../common-src/libamanda.$(LIB_EXTENSION) \
+       ../gnulib/libgnu.$(LIB_EXTENSION)
 
 amoldrecover_CSRC =    amrecover.c                                     \
                        display_commands.c              extract_list.c  \
index a68d475fc9220ab1cdaa81865145349e73868522..448a2062ccb46c0c1010376db8c5bbb6a44abe7b 100644 (file)
@@ -46,6 +46,41 @@ DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
        $(srcdir)/Makefile.in uparse.c uparse.h uscan.c
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+       $(top_srcdir)/config/gnulib/absolute-header.m4 \
+       $(top_srcdir)/config/gnulib/alloca.m4 \
+       $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/eoverflow.m4 \
+       $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/getaddrinfo.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-cache.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-common.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-comp.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-tool.m4 \
+       $(top_srcdir)/config/gnulib/inet_ntop.m4 \
+       $(top_srcdir)/config/gnulib/intmax_t.m4 \
+       $(top_srcdir)/config/gnulib/inttypes_h.m4 \
+       $(top_srcdir)/config/gnulib/lib-ld.m4 \
+       $(top_srcdir)/config/gnulib/lib-link.m4 \
+       $(top_srcdir)/config/gnulib/lib-prefix.m4 \
+       $(top_srcdir)/config/gnulib/lock.m4 \
+       $(top_srcdir)/config/gnulib/longdouble.m4 \
+       $(top_srcdir)/config/gnulib/longlong.m4 \
+       $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
+       $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \
+       $(top_srcdir)/config/gnulib/size_max.m4 \
+       $(top_srcdir)/config/gnulib/snprintf.m4 \
+       $(top_srcdir)/config/gnulib/socklen.m4 \
+       $(top_srcdir)/config/gnulib/sockpfaf.m4 \
+       $(top_srcdir)/config/gnulib/stdbool.m4 \
+       $(top_srcdir)/config/gnulib/stdint_h.m4 \
+       $(top_srcdir)/config/gnulib/strdup.m4 \
+       $(top_srcdir)/config/gnulib/string_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
+       $(top_srcdir)/config/gnulib/vasnprintf.m4 \
+       $(top_srcdir)/config/gnulib/visibility.m4 \
+       $(top_srcdir)/config/gnulib/wchar_t.m4 \
+       $(top_srcdir)/config/gnulib/wint_t.m4 \
+       $(top_srcdir)/config/gnulib/xsize.m4 \
        $(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
@@ -64,7 +99,8 @@ amoldrecover_LDADD = $(LDADD)
 am__DEPENDENCIES_1 =
 amoldrecover_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
        ../client-src/libamclient.$(LIB_EXTENSION) \
-       $(am__DEPENDENCIES_1) ../common-src/libamanda.$(LIB_EXTENSION)
+       $(am__DEPENDENCIES_1) ../common-src/libamanda.$(LIB_EXTENSION) \
+       ../gnulib/libgnu.$(LIB_EXTENSION)
 DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/config
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
 am__depfiles_maybe = depfiles
@@ -87,8 +123,10 @@ HEADERS = $(noinst_HEADERS)
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ABSOLUTE_STRING_H = @ABSOLUTE_STRING_H@
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
+ALLOCA_H = @ALLOCA_H@
 AMANDA_DBGDIR = @AMANDA_DBGDIR@
 AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@
 AMANDA_TMPDIR = @AMANDA_TMPDIR@
@@ -103,18 +141,17 @@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@
 AMTAR = @AMTAR@
 AM_CFLAGS = @AM_CFLAGS@
 AR = @AR@
+ARPA_INET_H = @ARPA_INET_H@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
-AWK_VAR_ASSIGNMENT_OPT = @AWK_VAR_ASSIGNMENT_OPT@
 BINARY_OWNER = @BINARY_OWNER@
-BUILD_MAN_PAGES_FALSE = @BUILD_MAN_PAGES_FALSE@
-BUILD_MAN_PAGES_TRUE = @BUILD_MAN_PAGES_TRUE@
 CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
+CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
 CHIO = @CHIO@
 CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
@@ -147,18 +184,40 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
+ENABLE_MANPAGE_BUILD_FALSE = @ENABLE_MANPAGE_BUILD_FALSE@
+ENABLE_MANPAGE_BUILD_TRUE = @ENABLE_MANPAGE_BUILD_TRUE@
+EOVERFLOW = @EOVERFLOW@
+EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@
 EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
+GCC_COMPILER_FALSE = @GCC_COMPILER_FALSE@
+GCC_COMPILER_TRUE = @GCC_COMPILER_TRUE@
 GETCONF = @GETCONF@
+GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@
+GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
 GNUTAR_LISTED_INCREMENTAL_DIRX = @GNUTAR_LISTED_INCREMENTAL_DIRX@
 GREP = @GREP@
 GZIP = @GZIP@
-HAVE_XSLTPROC_FALSE = @HAVE_XSLTPROC_FALSE@
-HAVE_XSLTPROC_TRUE = @HAVE_XSLTPROC_TRUE@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRNDUP = @HAVE_STRNDUP@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE__BOOL = @HAVE__BOOL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -167,22 +226,31 @@ LDFLAGS = @LDFLAGS@
 LEX = @LEX@
 LEXLIB = @LEXLIB@
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
+LIBPTH = @LIBPTH@
+LIBPTH_PREFIX = @LIBPTH_PREFIX@
 LIBS = @LIBS@
+LIBTHREAD = @LIBTHREAD@
 LIBTOOL = @LIBTOOL@
 LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LL_FMT = @LL_FMT@
 LL_RFMT = @LL_RFMT@
 LN_S = @LN_S@
 LTALLOCA = @LTALLOCA@
+LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
 LTLIBOBJS = @LTLIBOBJS@
+LTLIBPTH = @LTLIBPTH@
+LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
 MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@
 MCUTIL = @MCUTIL@
+MKDIR_P = @MKDIR_P@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
+NETINET_IN_H = @NETINET_IN_H@
 OBJEXT = @OBJEXT@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -196,6 +264,9 @@ PERL = @PERL@
 PRINT = @PRINT@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
+REPLACE_STRCASECMP = @REPLACE_STRCASECMP@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRSTR = @REPLACE_STRSTR@
 RESTORE = @RESTORE@
 SAMBA_CLIENT = @SAMBA_CLIENT@
 SERVICE_SUFFIX = @SERVICE_SUFFIX@
@@ -204,7 +275,10 @@ SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 SNAPSHOT_STAMP = @SNAPSHOT_STAMP@
 SORT = @SORT@
+SSH = @SSH@
+STDBOOL_H = @STDBOOL_H@
 STRIP = @STRIP@
+SYS_SOCKET_H = @SYS_SOCKET_H@
 USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@
 VDUMP = @VDUMP@
 VERSION = @VERSION@
@@ -243,6 +317,7 @@ WANT_TAPE_TRUE = @WANT_TAPE_TRUE@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
 XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
 YACC = @YACC@
 ac_c = @ac_c@
 ac_ct_AR = @ac_ct_AR@
@@ -269,6 +344,8 @@ build_os = @build_os@
 build_vendor = @build_vendor@
 datadir = @datadir@
 exec_prefix = @exec_prefix@
+gl_LIBOBJS = @gl_LIBOBJS@
+gl_LTLIBOBJS = @gl_LTLIBOBJS@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -295,7 +372,8 @@ target_os = @target_os@
 target_vendor = @target_vendor@
 INCLUDES = -I$(top_builddir)/common-src \
                -I$(top_srcdir)/common-src   \
-               -I$(top_srcdir)/client-src
+               -I$(top_srcdir)/client-src   \
+               -I$(top_srcdir)/gnulib
 
 LINT = @AMLINT@
 LINTFLAGS = @AMLINTFLAGS@
@@ -312,7 +390,8 @@ LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
        @LEXLIB@ \
        ../client-src/libamclient.$(LIB_EXTENSION) \
        $(READLINE_LIBS) \
-       ../common-src/libamanda.$(LIB_EXTENSION)
+       ../common-src/libamanda.$(LIB_EXTENSION) \
+       ../gnulib/libgnu.$(LIB_EXTENSION)
 
 amoldrecover_CSRC = amrecover.c                                        \
                        display_commands.c              extract_list.c  \
index 4201fc2c0d72b3875ccb94d722dca223edf4a0cf..6b4aaff95872146aaa8d5f06a2d68211ebae7452 100644 (file)
@@ -24,7 +24,7 @@
  * file named AUTHORS, in the root directory of this distribution.
  */
 /*
- * $Id: amrecover.c,v 1.7.2.2 2006/12/12 14:56:38 martinea Exp $
+ * $Id: amrecover.c,v 1.7 2006/07/25 18:27:57 martinea Exp $
  *
  * an interactive program for recovering backed-up files
  */
@@ -37,6 +37,7 @@
 #include "getfsent.h"
 #include "dgram.h"
 #include "util.h"
+#include "conffile.h"
 
 extern int process_line(char *line);
 int guess_disk(char *cwd, size_t cwd_len, char **dn_guess, char **mpt_guess);
@@ -294,7 +295,7 @@ guess_disk (
        /*NOTREACHED*/
     }
     cwd_length = strlen(cwd);
-    dbprintf(("guess_disk: %zu: \"%s\"\n", cwd_length, cwd));
+    dbprintf(("guess_disk: " SSIZE_T_FMT ": \"%s\"\n", cwd_length, cwd));
 
     if (open_fstab() == 0) {
        return -1;
@@ -304,7 +305,7 @@ guess_disk (
     while (get_fstab_nextentry(&fsent))
     {
        current_length = fsent.mntdir ? strlen(fsent.mntdir) : (size_t)0;
-       dbprintf(("guess_disk: %zu: %zu: \"%s\": \"%s\"\n",
+       dbprintf(("guess_disk: " SSIZE_T_FMT ": " SSIZE_T_FMT": \"%s\": \"%s\"\n",
                  longest_match,
                  current_length,
                  fsent.mntdir ? fsent.mntdir : "(mntdir null)",
@@ -408,6 +409,7 @@ main(
     char *service_name;
     char *line = NULL;
     struct tm *tm;
+    char *conffile;
 
     safe_fd(-1, 0);
 
@@ -447,6 +449,13 @@ main(
     if(!tape_server_name) tape_server_name = DEFAULT_TAPE_SERVER;
     tape_server_name = stralloc(tape_server_name);
 
+    conffile = vstralloc(CONFIG_DIR, "/", "amanda-client.conf", NULL);
+    if (read_clientconf(conffile) > 0) {
+       error("error reading conffile: %s", conffile);
+       /*NOTREACHED*/
+    }
+    amfree(conffile);
+
     if (argc > 1 && argv[1][0] != '-')
     {
        /*
index 538c855eab714133526f214e6a0c5af8b28bd624..54a975b77bcd2eb41bd994375452fd0d538c56f2 100644 (file)
@@ -79,6 +79,7 @@ extern void list_host(void);
 extern void set_host(const char *host);
 extern int set_date(char *date);
 extern void set_directory(char *dir);
+extern void local_cd(char *dir);
 extern void cd_glob(char *dir);
 extern void cd_regex(char *dir);
 extern void cd_dir(char *dir, char *default_dir);
index 0969a93285951d98d998211ceae8816a7f1c5591..2a15332542467451758063af10b632186495c6ba 100644 (file)
@@ -198,14 +198,13 @@ suck_dir_list_from_server(void)
            printf("%s\n", l);
            continue;
        }
-#define sc "201-"
-       if (strncmp(l, sc, sizeof(sc)-1) != 0) {
+       s = l;
+       if (strncmp_const_skip(s, "201-", s, ch) != 0) {
            err = "bad reply: not 201-";
            continue;
        }
-       s = l + sizeof(sc)-1;
        ch = *s++;
-#undef sc
+
        skip_whitespace(s, ch);
        if(ch == '\0') {
            err = "bad reply: missing date field";
@@ -234,12 +233,13 @@ suck_dir_list_from_server(void)
        *tape_undo = '\0';
 
        if(am_has_feature(indexsrv_features, fe_amindexd_fileno_in_OLSD)) {
+           OFF_T_FMT_TYPE fileno_ = (OFF_T_FMT_TYPE)0;
            skip_whitespace(s, ch);
-           if(ch == '\0' || sscanf(s - 1, OFF_T_FMT,
-                                   (OFF_T_FMT_TYPE *)&fileno) != 1) {
+           if(ch == '\0' || sscanf(s - 1, OFF_T_FMT, &fileno_) != 1) {
                err = "bad reply: cannot parse fileno field";
                continue;
            }
+           fileno = (off_t)fileno_;
            skip_integer(s, ch);
        }
        else {
index 6d69910a32e43aff25c6473fa3b9f7e7ef7c73f4..a952ac0d0a9e2ea78f4531ca0d096115fcb350fb 100644 (file)
@@ -24,7 +24,7 @@
  * file named AUTHORS, in the root directory of this distribution.
  */
 /*
- * $Id: extract_list.c,v 1.6.2.1 2006/11/08 17:11:39 martinea Exp $
+ * $Id: extract_list.c,v 1.6 2006/08/24 01:57:15 paddy_s Exp $
  *
  * implements the "extract" command in amrecover
  */
@@ -702,15 +702,14 @@ void add_file(
                        puts(l);
                        continue;
                    }
-#define sc "201-"
-                   if(strncmp(l, sc, sizeof(sc)-1) != 0) {
+
+                   s = l;
+                   if(strncmp_const_skip(l, "201-", s, ch) != 0) {
                        err = "bad reply: not 201-";
                        continue;
                    }
 
-                   s = l + sizeof(sc)-1;
                    ch = *s++;
-#undef sc
                    skip_whitespace(s, ch);
                    if(ch == '\0') {
                        err = "bad reply: missing date field";
@@ -741,12 +740,14 @@ void add_file(
                     s[-1] = (char)ch;
 
                    if(am_has_feature(indexsrv_features, fe_amindexd_fileno_in_ORLD)) {
+                       OFF_T_FMT_TYPE fileno_ = (OFF_T_FMT_TYPE)0;
                        skip_whitespace(s, ch);
-                       if(ch == '\0' || sscanf(s - 1, OFF_T_FMT,
-                               (OFF_T_FMT_TYPE *)&lditem.fileno) != 1) {
+                       if(ch == '\0' ||
+                          sscanf(s - 1, OFF_T_FMT, &fileno_) != 1) {
                            err = "bad reply: cannot parse fileno field";
                            continue;
                        }
+                       lditem.fileno = (off_t)fileno_;
                        skip_integer(s, ch);
                    }
 
@@ -1019,14 +1020,14 @@ delete_file(
                        puts(l);
                        continue;
                    }
-#define sc "201-"
-                   if(strncmp(l, sc, sizeof(sc)-1) != 0) {
+
+                   s = l;
+                   if(strncmp_const_skip(l, "201-", s, ch) != 0) {
                        err = "bad reply: not 201-";
                        continue;
                    }
-                   s = l + sizeof(sc)-1;
                    ch = *s++;
-#undef sc
+
                    skip_whitespace(s, ch);
                    if(ch == '\0') {
                        err = "bad reply: missing date field";
@@ -1055,12 +1056,14 @@ delete_file(
                    *tape_undo = '\0';
 
                    if(am_has_feature(indexsrv_features, fe_amindexd_fileno_in_ORLD)) {
+                       OFF_T_FMT_TYPE fileno_ = (OFF_T_FMT_TYPE)0;
                        skip_whitespace(s, ch);
-                       if(ch == '\0' || sscanf(s - 1, OFF_T_FMT,
-                               (OFF_T_FMT_TYPE *)&fileno) != 1) {
+                       if(ch == '\0' ||
+                          sscanf(s - 1, OFF_T_FMT, &fileno_) != 1) {
                            err = "bad reply: cannot parse fileno field";
                            continue;
                        }
+                       fileno = (off_t)fileno_;
                        skip_integer(s, ch);
                    }
 
index 48e655d602e5792ffa1a2d62b860a808c201f2d6..812e181c003742b5716328ca5722557c3e090cc7 100644 (file)
@@ -30,6 +30,7 @@
  */
 
 #include "amanda.h"
+#include "util.h"
 #include "amrecover.h"
 
 #ifdef SAMBA_CLIENT
@@ -81,6 +82,7 @@ set_host(
     struct hostent *hp;
     char **hostp;
     int found_host = 0;
+    char *uqhost = unquote_string(host);
 
     if (is_extract_list_nonempty())
     {
@@ -88,7 +90,7 @@ set_host(
        return;
     }
 
-    cmd = stralloc2("HOST ", host);
+    cmd = stralloc2("HOST ", uqhost);
     if (converse(cmd) == -1)
        exit(1);
     if (server_happy())
@@ -101,7 +103,7 @@ set_host(
         * Try converting the given host to a fully qualified name
         * and then try each of the aliases.
         */
-       if ((hp = gethostbyname(host)) != NULL) {
+       if ((hp = gethostbyname(uqhost)) != NULL) {
            host = hp->h_name;
            printf("Trying host %s ...\n", host);
            cmd = newstralloc2(cmd, "HOST ", host);
@@ -137,6 +139,7 @@ set_host(
        clear_dir_list();
     }
     amfree(cmd);
+    amfree(uqhost);
 }
 
 
@@ -157,6 +160,8 @@ set_disk(
     char *     mtpt)
 {
     char *cmd = NULL;
+    char *uqdsk;
+    char *uqmtpt = NULL;
 
     if (is_extract_list_nonempty())
     {
@@ -165,14 +170,18 @@ set_disk(
     }
 
     /* if mount point specified, check it is valid */
-    if ((mtpt != NULL) && (*mtpt != '/'))
-    {
-       printf("Mount point \"%s\" invalid - must start with /\n", mtpt);
-       return;
+    if (mtpt != NULL) {
+       uqmtpt = unquote_string(mtpt);
+       if (*mtpt != '/') {
+           printf("Mount point \"%s\" invalid - must start with /\n", uqmtpt);
+           amfree(uqmtpt);
+           return;
+       }
     }
 
     clear_dir_list();
-    cmd = stralloc2("DISK ", dsk);
+    uqdsk = unquote_string(dsk);
+    cmd = stralloc2("DISK ", uqdsk);
     if (converse(cmd) == -1)
        exit(1);
     amfree(cmd);
@@ -180,14 +189,14 @@ set_disk(
     if (!server_happy())
        return;
 
-    disk_name = newstralloc(disk_name, dsk);
+    disk_name = newstralloc(disk_name, uqdsk);
     if (mtpt == NULL)
     {
        /* mount point not specified */
-       if (*dsk == '/')
+       if (*uqdsk == '/')
        {
            /* disk specified by mount point, hence use it */
-           mount_point = newstralloc(mount_point, dsk);
+           mount_point = newstralloc(mount_point, uqdsk);
        }
        else
        {
@@ -198,7 +207,7 @@ set_disk(
     else
     {
        /* mount point specified */
-       mount_point = newstralloc(mount_point, mtpt);
+       mount_point = newstralloc(mount_point, uqmtpt);
     }
 
     /* set the working directory to the mount point */
@@ -220,6 +229,8 @@ set_disk(
        disk_path = newstralloc(disk_path, "/");        /* fake it */
        clear_dir_list();
     }
+    amfree(uqmtpt);
+    amfree(uqdsk);
 }
 
 void
@@ -227,9 +238,12 @@ list_disk(
     char *     amdevice)
 {
     char *cmd = NULL;
+    char *uqamdevice;
 
     if(amdevice) {
-       cmd = stralloc2("LISTDISK ", amdevice);
+       uqamdevice = unquote_string(amdevice);
+       cmd = stralloc2("LISTDISK ", uqamdevice);
+       amfree(uqamdevice);
        if (converse(cmd) == -1)
            exit(1);
        amfree(cmd);
@@ -242,6 +256,17 @@ list_disk(
     }
 }
 
+void
+local_cd(
+    char *dir)
+{
+    char *uqdir = unquote_string(dir);
+    if (chdir(uqdir) == -1) {
+       perror(uqdir);
+    }
+    amfree(uqdir);
+}
+
 void
 cd_glob(
     char *     glob)
@@ -249,6 +274,7 @@ cd_glob(
     char *regex;
     char *regex_path;
     char *s;
+    char *uqglob;
 
     char *path_on_disk = NULL;
 
@@ -257,8 +283,9 @@ cd_glob(
        return;
     }
 
-    regex = glob_to_regex(glob);
-    dbprintf(("cd_glob (%s) -> %s\n", glob, regex));
+    uqglob = unquote_string(glob);
+    regex = glob_to_regex(uqglob);
+    dbprintf(("cd_glob (%s) -> %s\n", uqglob, regex));
     if ((s = validate_regexp(regex)) != NULL) {
         printf("\"%s\" is not a valid shell wildcard pattern: ", glob);
         puts(s);
@@ -287,10 +314,11 @@ cd_glob(
         amfree(clean_disk_path);
     }
 
-    cd_dir(path_on_disk, glob);
+    cd_dir(path_on_disk, uqglob);
 
     amfree(regex_path);
     amfree(path_on_disk);
+    amfree(uqglob);
 }
 
 void
@@ -298,6 +326,7 @@ cd_regex(
     char *     regex)
 {
     char *s;
+    char *uqregex;
 
     char *path_on_disk = NULL;
 
@@ -306,8 +335,10 @@ cd_regex(
        return;
     }
 
-    if ((s = validate_regexp(regex)) != NULL) {
-       printf("\"%s\" is not a valid regular expression: ", regex);
+    uqregex = unquote_string(regex);
+    if ((s = validate_regexp(uqregex)) != NULL) {
+       printf("\"%s\" is not a valid regular expression: ", uqregex);
+       amfree(uqregex);
        puts(s);
        return;
     }
@@ -321,9 +352,10 @@ cd_regex(
         amfree(clean_disk_path);
     }
 
-    cd_dir(path_on_disk, regex);
+    cd_dir(path_on_disk, uqregex);
 
     amfree(path_on_disk);
+    amfree(uqregex);
 }
 
 void
@@ -530,21 +562,22 @@ void
 set_tape(
     char *     tape)
 {
-    char *tapedev = strchr(tape, ':');
+    char *uqtape = unquote_string(tape);
+    char *tapedev = strchr(uqtape, ':');
 
     if (tapedev)
     {
-       if (tapedev != tape) {
+       if (tapedev != uqtape) {
            if((strchr(tapedev+1, ':') == NULL) &&
-              (strncmp(tape, "null:", 5) == 0 ||
-               strncmp(tape, "rait:", 5) == 0 ||
-               strncmp(tape, "file:", 5) == 0 ||
-               strncmp(tape, "tape:", 5) == 0)) {
-               tapedev = tape;
+              (strncmp(uqtape, "null:", 5) == 0 ||
+               strncmp(uqtape, "rait:", 5) == 0 ||
+               strncmp(uqtape, "file:", 5) == 0 ||
+               strncmp(uqtape, "tape:", 5) == 0)) {
+               tapedev = uqtape;
            }
            else {
                *tapedev = '\0';
-               tape_server_name = newstralloc(tape_server_name, tape);
+               tape_server_name = newstralloc(tape_server_name, uqtape);
                ++tapedev;
            }
        } else { /* reset server_name if start with : */
@@ -552,7 +585,7 @@ set_tape(
            ++tapedev;
        }
     } else
-       tapedev = tape;
+       tapedev = uqtape;
     
     if (tapedev[0])
     {
index 9e0739f9305ef1c729b2f1110c2bd28727bcc055..e4dc87a8139c8daed4b745356aefe58a265cff46 100644 (file)
@@ -1,7 +1,9 @@
-/* A Bison parser, made by GNU Bison 2.1.  */
+/* A Bison parser, made by GNU Bison 2.3.  */
 
-/* Skeleton parser for Yacc-like parsing with Bison,
-   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+/* Skeleton implementation for Bison's Yacc-like parsers in C
+
+   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+   Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    Foundation, Inc., 51 Franklin Street, Fifth Floor,
    Boston, MA 02110-1301, USA.  */
 
-/* As a special exception, when this file is copied by Bison into a
-   Bison output file, you may use that output file without restriction.
-   This special exception was added by the Free Software Foundation
-   in version 1.24 of Bison.  */
+/* As a special exception, you may create a larger work that contains
+   part or all of the Bison parser skeleton and distribute that work
+   under terms of your choice, so long as that work isn't itself a
+   parser generator using the skeleton or a modified version thereof
+   as a parser skeleton.  Alternatively, if you modify or redistribute
+   the parser skeleton itself, you may (at your option) remove this
+   special exception, which will cause the skeleton and the resulting
+   Bison output files to be licensed under the GNU General Public
+   License without this special exception.
+
+   This special exception was added by the Free Software Foundation in
+   version 2.2 of Bison.  */
 
-/* Written by Richard Stallman by simplifying the original so called
-   ``semantic'' parser.  */
+/* C LALR(1) parser skeleton written by Richard Stallman, by
+   simplifying the original so-called "semantic" parser.  */
 
 /* All symbols defined below should begin with yy or YY, to avoid
    infringing on user name space.  This should be done even for local
@@ -37,7 +47,7 @@
 #define YYBISON 1
 
 /* Bison version.  */
-#define YYBISON_VERSION "2.1"
+#define YYBISON_VERSION "2.3"
 
 /* Skeleton name.  */
 #define YYSKELETON_NAME "yacc.c"
@@ -149,16 +159,18 @@ extern char *     yytext;
 # define YYTOKEN_TABLE 0
 #endif
 
-#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+typedef union YYSTYPE
 #line 42 "uparse.y"
-typedef union YYSTYPE {
+{
        int     intval;
        double  floatval;
        char *  strval;
        int     subtok;
-} YYSTYPE;
-/* Line 196 of yacc.c.  */
-#line 162 "uparse.c"
+}
+/* Line 187 of yacc.c.  */
+#line 173 "uparse.c"
+       YYSTYPE;
 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
 # define YYSTYPE_IS_DECLARED 1
 # define YYSTYPE_IS_TRIVIAL 1
@@ -169,23 +181,56 @@ typedef union YYSTYPE {
 /* Copy the second part of user declarations.  */
 
 
-/* Line 219 of yacc.c.  */
-#line 174 "uparse.c"
+/* Line 216 of yacc.c.  */
+#line 186 "uparse.c"
 
-#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
-# define YYSIZE_T __SIZE_TYPE__
+#ifdef short
+# undef short
 #endif
-#if ! defined (YYSIZE_T) && defined (size_t)
-# define YYSIZE_T size_t
+
+#ifdef YYTYPE_UINT8
+typedef YYTYPE_UINT8 yytype_uint8;
+#else
+typedef unsigned char yytype_uint8;
 #endif
-#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus))
-# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
-# define YYSIZE_T size_t
+
+#ifdef YYTYPE_INT8
+typedef YYTYPE_INT8 yytype_int8;
+#elif (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+typedef signed char yytype_int8;
+#else
+typedef short int yytype_int8;
+#endif
+
+#ifdef YYTYPE_UINT16
+typedef YYTYPE_UINT16 yytype_uint16;
+#else
+typedef unsigned short int yytype_uint16;
+#endif
+
+#ifdef YYTYPE_INT16
+typedef YYTYPE_INT16 yytype_int16;
+#else
+typedef short int yytype_int16;
 #endif
-#if ! defined (YYSIZE_T)
-# define YYSIZE_T unsigned int
+
+#ifndef YYSIZE_T
+# ifdef __SIZE_TYPE__
+#  define YYSIZE_T __SIZE_TYPE__
+# elif defined size_t
+#  define YYSIZE_T size_t
+# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
+#  define YYSIZE_T size_t
+# else
+#  define YYSIZE_T unsigned int
+# endif
 #endif
 
+#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
+
 #ifndef YY_
 # if YYENABLE_NLS
 #  if ENABLE_NLS
@@ -198,7 +243,32 @@ typedef union YYSTYPE {
 # endif
 #endif
 
-#if ! defined (yyoverflow) || YYERROR_VERBOSE
+/* Suppress unused-variable warnings by "using" E.  */
+#if ! defined lint || defined __GNUC__
+# define YYUSE(e) ((void) (e))
+#else
+# define YYUSE(e) /* empty */
+#endif
+
+/* Identity function, used to suppress warnings about constant conditions.  */
+#ifndef lint
+# define YYID(n) (n)
+#else
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static int
+YYID (int i)
+#else
+static int
+YYID (i)
+    int i;
+#endif
+{
+  return i;
+}
+#endif
+
+#if ! defined yyoverflow || YYERROR_VERBOSE
 
 /* The parser invokes alloca or malloc; define the necessary symbols.  */
 
@@ -206,64 +276,76 @@ typedef union YYSTYPE {
 #  if YYSTACK_USE_ALLOCA
 #   ifdef __GNUC__
 #    define YYSTACK_ALLOC __builtin_alloca
+#   elif defined __BUILTIN_VA_ARG_INCR
+#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
+#   elif defined _AIX
+#    define YYSTACK_ALLOC __alloca
+#   elif defined _MSC_VER
+#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
+#    define alloca _alloca
 #   else
 #    define YYSTACK_ALLOC alloca
-#    if defined (__STDC__) || defined (__cplusplus)
+#    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
 #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-#     define YYINCLUDED_STDLIB_H
+#     ifndef _STDLIB_H
+#      define _STDLIB_H 1
+#     endif
 #    endif
 #   endif
 #  endif
 # endif
 
 # ifdef YYSTACK_ALLOC
-   /* Pacify GCC's `empty if-body' warning. */
-#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
+   /* Pacify GCC's `empty if-body' warning.  */
+#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
 #  ifndef YYSTACK_ALLOC_MAXIMUM
     /* The OS might guarantee only one guard page at the bottom of the stack,
        and a page size can be as small as 4096 bytes.  So we cannot safely
        invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
        to allow for a few compiler-allocated temporary stack slots.  */
-#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */
+#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
 #  endif
 # else
 #  define YYSTACK_ALLOC YYMALLOC
 #  define YYSTACK_FREE YYFREE
 #  ifndef YYSTACK_ALLOC_MAXIMUM
-#   define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1)
+#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
 #  endif
-#  ifdef __cplusplus
-extern "C" {
+#  if (defined __cplusplus && ! defined _STDLIB_H \
+       && ! ((defined YYMALLOC || defined malloc) \
+            && (defined YYFREE || defined free)))
+#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+#   ifndef _STDLIB_H
+#    define _STDLIB_H 1
+#   endif
 #  endif
 #  ifndef YYMALLOC
 #   define YYMALLOC malloc
-#   if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \
-       && (defined (__STDC__) || defined (__cplusplus)))
+#   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
 #   endif
 #  endif
 #  ifndef YYFREE
 #   define YYFREE free
-#   if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \
-       && (defined (__STDC__) || defined (__cplusplus)))
+#   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
 void free (void *); /* INFRINGES ON USER NAME SPACE */
 #   endif
 #  endif
-#  ifdef __cplusplus
-}
-#  endif
 # endif
-#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
+#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
 
 
-#if (! defined (yyoverflow) \
-     && (! defined (__cplusplus) \
-        || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
+#if (! defined yyoverflow \
+     && (! defined __cplusplus \
+        || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
 
 /* A type that is properly aligned for any stack member.  */
 union yyalloc
 {
-  short int yyss;
+  yytype_int16 yyss;
   YYSTYPE yyvs;
   };
 
@@ -273,13 +355,13 @@ union yyalloc
 /* The size of an array large to enough to hold all stacks, each with
    N elements.  */
 # define YYSTACK_BYTES(N) \
-     ((N) * (sizeof (short int) + sizeof (YYSTYPE))                    \
+     ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
       + YYSTACK_GAP_MAXIMUM)
 
 /* Copy COUNT objects from FROM to TO.  The source and destination do
    not overlap.  */
 # ifndef YYCOPY
-#  if defined (__GNUC__) && 1 < __GNUC__
+#  if defined __GNUC__ && 1 < __GNUC__
 #   define YYCOPY(To, From, Count) \
       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
 #  else
@@ -290,7 +372,7 @@ union yyalloc
          for (yyi = 0; yyi < (Count); yyi++)   \
            (To)[yyi] = (From)[yyi];            \
        }                                       \
-      while (0)
+      while (YYID (0))
 #  endif
 # endif
 
@@ -308,28 +390,22 @@ union yyalloc
        yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
        yyptr += yynewbytes / sizeof (*yyptr);                          \
       }                                                                        \
-    while (0)
+    while (YYID (0))
 
 #endif
 
-#if defined (__STDC__) || defined (__cplusplus)
-   typedef signed char yysigned_char;
-#else
-   typedef short int yysigned_char;
-#endif
-
-/* YYFINAL -- State number of the termination state. */
+/* YYFINAL -- State number of the termination state.  */
 #define YYFINAL  55
 /* YYLAST -- Last index in YYTABLE.  */
 #define YYLAST   45
 
-/* YYNTOKENS -- Number of terminals. */
+/* YYNTOKENS -- Number of terminals.  */
 #define YYNTOKENS  31
-/* YYNNTS -- Number of nonterminals. */
+/* YYNNTS -- Number of nonterminals.  */
 #define YYNNTS  16
-/* YYNRULES -- Number of rules. */
+/* YYNRULES -- Number of rules.  */
 #define YYNRULES  49
-/* YYNRULES -- Number of states. */
+/* YYNRULES -- Number of states.  */
 #define YYNSTATES  61
 
 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
@@ -340,7 +416,7 @@ union yyalloc
   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
 
 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
-static const unsigned char yytranslate[] =
+static const yytype_uint8 yytranslate[] =
 {
        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
@@ -376,7 +452,7 @@ static const unsigned char yytranslate[] =
 #if YYDEBUG
 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
    YYRHS.  */
-static const unsigned char yyprhs[] =
+static const yytype_uint8 yyprhs[] =
 {
        0,     0,     3,     5,     7,     9,    11,    13,    15,    17,
       19,    21,    23,    24,    26,    29,    31,    34,    37,    41,
@@ -385,8 +461,8 @@ static const unsigned char yyprhs[] =
       94,    97,   100,   102,   105,   108,   110,   112,   115,   117
 };
 
-/* YYRHS -- A `-1'-separated list of the rules' RHS. */
-static const yysigned_char yyrhs[] =
+/* YYRHS -- A `-1'-separated list of the rules' RHS.  */
+static const yytype_int8 yyrhs[] =
 {
       32,     0,    -1,    33,    -1,    34,    -1,    35,    -1,    36,
       -1,    38,    -1,    40,    -1,    42,    -1,    44,    -1,    45,
@@ -403,19 +479,19 @@ static const yysigned_char yyrhs[] =
 };
 
 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
-static const unsigned char yyrline[] =
+static const yytype_uint8 yyrline[] =
 {
        0,    65,    65,    66,    67,    68,    69,    70,    71,    72,
       73,    74,    75,    84,    85,    86,    87,    88,    89,    90,
       91,    92,    93,    94,    95,   100,   108,   109,   110,   111,
      112,   113,   114,   118,   122,   126,   127,   131,   135,   136,
-     140,   144,   145,   149,   153,   154,   158,   159,   168,   172
+     140,   144,   145,   149,   153,   154,   158,   159,   166,   170
 };
 #endif
 
 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
-   First, the terminals, then, starting at YYNTOKENS, nonterminals. */
+   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
 static const char *const yytname[] =
 {
   "$end", "error", "$undefined", "LISTHOST", "LISTDISK", "SETHOST",
@@ -432,7 +508,7 @@ static const char *const yytname[] =
 # ifdef YYPRINT
 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
    token YYLEX-NUM.  */
-static const unsigned short int yytoknum[] =
+static const yytype_uint16 yytoknum[] =
 {
        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
      265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
@@ -442,7 +518,7 @@ static const unsigned short int yytoknum[] =
 # endif
 
 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
-static const unsigned char yyr1[] =
+static const yytype_uint8 yyr1[] =
 {
        0,    31,    32,    32,    32,    32,    32,    32,    32,    32,
       32,    32,    32,    33,    33,    33,    33,    33,    33,    33,
@@ -452,7 +528,7 @@ static const unsigned char yyr1[] =
 };
 
 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
-static const unsigned char yyr2[] =
+static const yytype_uint8 yyr2[] =
 {
        0,     2,     1,     1,     1,     1,     1,     1,     1,     1,
        1,     1,     0,     1,     2,     1,     2,     2,     3,     2,
@@ -464,7 +540,7 @@ static const unsigned char yyr2[] =
 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
    STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
    means the default is an error.  */
-static const unsigned char yydefact[] =
+static const yytype_uint8 yydefact[] =
 {
       12,    13,    15,     0,     0,     0,    21,     0,     0,     0,
       33,    26,    27,     0,     0,    49,    29,     0,     0,    30,
@@ -475,8 +551,8 @@ static const unsigned char yydefact[] =
       44
 };
 
-/* YYDEFGOTO[NTERM-NUM]. */
-static const yysigned_char yydefgoto[] =
+/* YYDEFGOTO[NTERM-NUM].  */
+static const yytype_int8 yydefgoto[] =
 {
       -1,    25,    26,    27,    28,    29,    46,    30,    48,    31,
       51,    32,    53,    33,    34,    35
@@ -485,7 +561,7 @@ static const yysigned_char yydefgoto[] =
 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
    STATE-NUM.  */
 #define YYPACT_NINF -6
-static const yysigned_char yypact[] =
+static const yytype_int8 yypact[] =
 {
       -3,    -6,    -5,    -1,     0,     1,     3,    -2,     4,     5,
       -6,    -6,    -6,     6,     7,    -6,     8,     9,    10,    -6,
@@ -497,7 +573,7 @@ static const yysigned_char yypact[] =
 };
 
 /* YYPGOTO[NTERM-NUM].  */
-static const yysigned_char yypgoto[] =
+static const yytype_int8 yypgoto[] =
 {
       -6,    -6,    -6,    -6,    -6,    -6,    -6,    -6,    -6,    -6,
       -6,    -6,    -6,    -6,    -6,    -6
@@ -508,7 +584,7 @@ static const yysigned_char yypgoto[] =
    number is the opposite.  If zero, do what YYDEFACT says.
    If YYTABLE_NINF, syntax error.  */
 #define YYTABLE_NINF -1
-static const unsigned char yytable[] =
+static const yytype_uint8 yytable[] =
 {
        1,     2,     3,     4,     5,     6,     7,     8,     9,    10,
       11,    12,    13,    14,    15,    16,    17,    18,    19,    20,
@@ -517,7 +593,7 @@ static const unsigned char yytable[] =
       54,    56,    57,    58,    59,    60
 };
 
-static const yysigned_char yycheck[] =
+static const yytype_int8 yycheck[] =
 {
        3,     4,     5,     6,     7,     8,     9,    10,    11,    12,
       13,    14,    15,    16,    17,    18,    19,    20,    21,    22,
@@ -528,7 +604,7 @@ static const yysigned_char yycheck[] =
 
 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
    symbol of state STATE-NUM.  */
-static const unsigned char yystos[] =
+static const yytype_uint8 yystos[] =
 {
        0,     3,     4,     5,     6,     7,     8,     9,    10,    11,
       12,    13,    14,    15,    16,    17,    18,    19,    20,    21,
@@ -564,7 +640,7 @@ do                                                          \
       yychar = (Token);                                                \
       yylval = (Value);                                                \
       yytoken = YYTRANSLATE (yychar);                          \
-      YYPOPSTACK;                                              \
+      YYPOPSTACK (1);                                          \
       goto yybackup;                                           \
     }                                                          \
   else                                                         \
@@ -572,7 +648,7 @@ do                                                          \
       yyerror (YY_("syntax error: cannot back up")); \
       YYERROR;                                                 \
     }                                                          \
-while (0)
+while (YYID (0))
 
 
 #define YYTERROR       1
@@ -587,7 +663,7 @@ while (0)
 #ifndef YYLLOC_DEFAULT
 # define YYLLOC_DEFAULT(Current, Rhs, N)                               \
     do                                                                 \
-      if (N)                                                           \
+      if (YYID (N))                                                    \
        {                                                               \
          (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
          (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
@@ -601,7 +677,7 @@ while (0)
          (Current).first_column = (Current).last_column =              \
            YYRHSLOC (Rhs, 0).last_column;                              \
        }                                                               \
-    while (0)
+    while (YYID (0))
 #endif
 
 
@@ -613,8 +689,8 @@ while (0)
 # if YYLTYPE_IS_TRIVIAL
 #  define YY_LOCATION_PRINT(File, Loc)                 \
      fprintf (File, "%d.%d-%d.%d",                     \
-              (Loc).first_line, (Loc).first_column,    \
-              (Loc).last_line,  (Loc).last_column)
+             (Loc).first_line, (Loc).first_column,     \
+             (Loc).last_line,  (Loc).last_column)
 # else
 #  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
 # endif
@@ -641,36 +717,96 @@ while (0)
 do {                                           \
   if (yydebug)                                 \
     YYFPRINTF Args;                            \
-} while (0)
+} while (YYID (0))
 
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location)         \
-do {                                                           \
-  if (yydebug)                                                 \
-    {                                                          \
-      YYFPRINTF (stderr, "%s ", Title);                                \
-      yysymprint (stderr,                                      \
-                  Type, Value);        \
-      YYFPRINTF (stderr, "\n");                                        \
-    }                                                          \
-} while (0)
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location)                   \
+do {                                                                     \
+  if (yydebug)                                                           \
+    {                                                                    \
+      YYFPRINTF (stderr, "%s ", Title);                                          \
+      yy_symbol_print (stderr,                                           \
+                 Type, Value); \
+      YYFPRINTF (stderr, "\n");                                                  \
+    }                                                                    \
+} while (YYID (0))
+
+
+/*--------------------------------.
+| Print this symbol on YYOUTPUT.  |
+`--------------------------------*/
+
+/*ARGSUSED*/
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static void
+yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
+#else
+static void
+yy_symbol_value_print (yyoutput, yytype, yyvaluep)
+    FILE *yyoutput;
+    int yytype;
+    YYSTYPE const * const yyvaluep;
+#endif
+{
+  if (!yyvaluep)
+    return;
+# ifdef YYPRINT
+  if (yytype < YYNTOKENS)
+    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
+# else
+  YYUSE (yyoutput);
+# endif
+  switch (yytype)
+    {
+      default:
+       break;
+    }
+}
+
+
+/*--------------------------------.
+| Print this symbol on YYOUTPUT.  |
+`--------------------------------*/
+
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static void
+yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
+#else
+static void
+yy_symbol_print (yyoutput, yytype, yyvaluep)
+    FILE *yyoutput;
+    int yytype;
+    YYSTYPE const * const yyvaluep;
+#endif
+{
+  if (yytype < YYNTOKENS)
+    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
+  else
+    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
+
+  yy_symbol_value_print (yyoutput, yytype, yyvaluep);
+  YYFPRINTF (yyoutput, ")");
+}
 
 /*------------------------------------------------------------------.
 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
 | TOP (included).                                                   |
 `------------------------------------------------------------------*/
 
-#if defined (__STDC__) || defined (__cplusplus)
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
 static void
-yy_stack_print (short int *bottom, short int *top)
+yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
 #else
 static void
 yy_stack_print (bottom, top)
-    short int *bottom;
-    short int *top;
+    yytype_int16 *bottom;
+    yytype_int16 *top;
 #endif
 {
   YYFPRINTF (stderr, "Stack now");
-  for (/* Nothing. */; bottom <= top; ++bottom)
+  for (; bottom <= top; ++bottom)
     YYFPRINTF (stderr, " %d", *bottom);
   YYFPRINTF (stderr, "\n");
 }
@@ -679,37 +815,45 @@ yy_stack_print (bottom, top)
 do {                                                           \
   if (yydebug)                                                 \
     yy_stack_print ((Bottom), (Top));                          \
-} while (0)
+} while (YYID (0))
 
 
 /*------------------------------------------------.
 | Report that the YYRULE is going to be reduced.  |
 `------------------------------------------------*/
 
-#if defined (__STDC__) || defined (__cplusplus)
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
 static void
-yy_reduce_print (int yyrule)
+yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
 #else
 static void
-yy_reduce_print (yyrule)
+yy_reduce_print (yyvsp, yyrule)
+    YYSTYPE *yyvsp;
     int yyrule;
 #endif
 {
+  int yynrhs = yyr2[yyrule];
   int yyi;
   unsigned long int yylno = yyrline[yyrule];
-  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ",
-             yyrule - 1, yylno);
-  /* Print the symbols being reduced, and their result.  */
-  for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
-    YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
-  YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]);
+  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
+            yyrule - 1, yylno);
+  /* The symbols being reduced.  */
+  for (yyi = 0; yyi < yynrhs; yyi++)
+    {
+      fprintf (stderr, "   $%d = ", yyi + 1);
+      yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
+                      &(yyvsp[(yyi + 1) - (yynrhs)])
+                                      );
+      fprintf (stderr, "\n");
+    }
 }
 
 # define YY_REDUCE_PRINT(Rule)         \
 do {                                   \
   if (yydebug)                         \
-    yy_reduce_print (Rule);            \
-} while (0)
+    yy_reduce_print (yyvsp, Rule); \
+} while (YYID (0))
 
 /* Nonzero means print parse trace.  It is left uninitialized so that
    multiple parsers can coexist.  */
@@ -743,42 +887,44 @@ int yydebug;
 #if YYERROR_VERBOSE
 
 # ifndef yystrlen
-#  if defined (__GLIBC__) && defined (_STRING_H)
+#  if defined __GLIBC__ && defined _STRING_H
 #   define yystrlen strlen
 #  else
 /* Return the length of YYSTR.  */
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
 static YYSIZE_T
-#   if defined (__STDC__) || defined (__cplusplus)
 yystrlen (const char *yystr)
-#   else
+#else
+static YYSIZE_T
 yystrlen (yystr)
-     const char *yystr;
-#   endif
+    const char *yystr;
+#endif
 {
-  const char *yys = yystr;
-
-  while (*yys++ != '\0')
+  YYSIZE_T yylen;
+  for (yylen = 0; yystr[yylen]; yylen++)
     continue;
-
-  return yys - yystr - 1;
+  return yylen;
 }
 #  endif
 # endif
 
 # ifndef yystpcpy
-#  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
+#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
 #   define yystpcpy stpcpy
 #  else
 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
    YYDEST.  */
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
 static char *
-#   if defined (__STDC__) || defined (__cplusplus)
 yystpcpy (char *yydest, const char *yysrc)
-#   else
+#else
+static char *
 yystpcpy (yydest, yysrc)
-     char *yydest;
-     const char *yysrc;
-#   endif
+    char *yydest;
+    const char *yysrc;
+#endif
 {
   char *yyd = yydest;
   const char *yys = yysrc;
@@ -804,7 +950,7 @@ yytnamerr (char *yyres, const char *yystr)
 {
   if (*yystr == '"')
     {
-      size_t yyn = 0;
+      YYSIZE_T yyn = 0;
       char const *yyp = yystr;
 
       for (;;)
@@ -839,53 +985,123 @@ yytnamerr (char *yyres, const char *yystr)
 }
 # endif
 
-#endif /* YYERROR_VERBOSE */
-
-\f
-
-#if YYDEBUG
-/*--------------------------------.
-| Print this symbol on YYOUTPUT.  |
-`--------------------------------*/
-
-#if defined (__STDC__) || defined (__cplusplus)
-static void
-yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
-#else
-static void
-yysymprint (yyoutput, yytype, yyvaluep)
-    FILE *yyoutput;
-    int yytype;
-    YYSTYPE *yyvaluep;
-#endif
+/* Copy into YYRESULT an error message about the unexpected token
+   YYCHAR while in state YYSTATE.  Return the number of bytes copied,
+   including the terminating null byte.  If YYRESULT is null, do not
+   copy anything; just return the number of bytes that would be
+   copied.  As a special case, return 0 if an ordinary "syntax error"
+   message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
+   size calculation.  */
+static YYSIZE_T
+yysyntax_error (char *yyresult, int yystate, int yychar)
 {
-  /* Pacify ``unused variable'' warnings.  */
-  (void) yyvaluep;
+  int yyn = yypact[yystate];
 
-  if (yytype < YYNTOKENS)
-    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
+  if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
+    return 0;
   else
-    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
+    {
+      int yytype = YYTRANSLATE (yychar);
+      YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
+      YYSIZE_T yysize = yysize0;
+      YYSIZE_T yysize1;
+      int yysize_overflow = 0;
+      enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
+      char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
+      int yyx;
+
+# if 0
+      /* This is so xgettext sees the translatable formats that are
+        constructed on the fly.  */
+      YY_("syntax error, unexpected %s");
+      YY_("syntax error, unexpected %s, expecting %s");
+      YY_("syntax error, unexpected %s, expecting %s or %s");
+      YY_("syntax error, unexpected %s, expecting %s or %s or %s");
+      YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
+# endif
+      char *yyfmt;
+      char const *yyf;
+      static char const yyunexpected[] = "syntax error, unexpected %s";
+      static char const yyexpecting[] = ", expecting %s";
+      static char const yyor[] = " or %s";
+      char yyformat[sizeof yyunexpected
+                   + sizeof yyexpecting - 1
+                   + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
+                      * (sizeof yyor - 1))];
+      char const *yyprefix = yyexpecting;
+
+      /* Start YYX at -YYN if negative to avoid negative indexes in
+        YYCHECK.  */
+      int yyxbegin = yyn < 0 ? -yyn : 0;
+
+      /* Stay within bounds of both yycheck and yytname.  */
+      int yychecklim = YYLAST - yyn + 1;
+      int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
+      int yycount = 1;
+
+      yyarg[0] = yytname[yytype];
+      yyfmt = yystpcpy (yyformat, yyunexpected);
+
+      for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+       if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+         {
+           if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
+             {
+               yycount = 1;
+               yysize = yysize0;
+               yyformat[sizeof yyunexpected - 1] = '\0';
+               break;
+             }
+           yyarg[yycount++] = yytname[yyx];
+           yysize1 = yysize + yytnamerr (0, yytname[yyx]);
+           yysize_overflow |= (yysize1 < yysize);
+           yysize = yysize1;
+           yyfmt = yystpcpy (yyfmt, yyprefix);
+           yyprefix = yyor;
+         }
 
+      yyf = YY_(yyformat);
+      yysize1 = yysize + yystrlen (yyf);
+      yysize_overflow |= (yysize1 < yysize);
+      yysize = yysize1;
 
-# ifdef YYPRINT
-  if (yytype < YYNTOKENS)
-    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
-# endif
-  switch (yytype)
-    {
-      default:
-        break;
+      if (yysize_overflow)
+       return YYSIZE_MAXIMUM;
+
+      if (yyresult)
+       {
+         /* Avoid sprintf, as that infringes on the user's name space.
+            Don't have undefined behavior even if the translation
+            produced a string with the wrong number of "%s"s.  */
+         char *yyp = yyresult;
+         int yyi = 0;
+         while ((*yyp = *yyf) != '\0')
+           {
+             if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
+               {
+                 yyp += yytnamerr (yyp, yyarg[yyi++]);
+                 yyf += 2;
+               }
+             else
+               {
+                 yyp++;
+                 yyf++;
+               }
+           }
+       }
+      return yysize;
     }
-  YYFPRINTF (yyoutput, ")");
 }
+#endif /* YYERROR_VERBOSE */
+\f
 
-#endif /* ! YYDEBUG */
 /*-----------------------------------------------.
 | Release the memory associated to this symbol.  |
 `-----------------------------------------------*/
 
-#if defined (__STDC__) || defined (__cplusplus)
+/*ARGSUSED*/
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
 static void
 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
 #else
@@ -896,8 +1112,7 @@ yydestruct (yymsg, yytype, yyvaluep)
     YYSTYPE *yyvaluep;
 #endif
 {
-  /* Pacify ``unused variable'' warnings.  */
-  (void) yyvaluep;
+  YYUSE (yyvaluep);
 
   if (!yymsg)
     yymsg = "Deleting";
@@ -907,7 +1122,7 @@ yydestruct (yymsg, yytype, yyvaluep)
     {
 
       default:
-        break;
+       break;
     }
 }
 \f
@@ -915,13 +1130,13 @@ yydestruct (yymsg, yytype, yyvaluep)
 /* Prevent warnings from -Wmissing-prototypes.  */
 
 #ifdef YYPARSE_PARAM
-# if defined (__STDC__) || defined (__cplusplus)
+#if defined __STDC__ || defined __cplusplus
 int yyparse (void *YYPARSE_PARAM);
-# else
+#else
 int yyparse ();
-# endif
+#endif
 #else /* ! YYPARSE_PARAM */
-#if defined (__STDC__) || defined (__cplusplus)
+#if defined __STDC__ || defined __cplusplus
 int yyparse (void);
 #else
 int yyparse ();
@@ -946,14 +1161,18 @@ int yynerrs;
 `----------*/
 
 #ifdef YYPARSE_PARAM
-# if defined (__STDC__) || defined (__cplusplus)
-int yyparse (void *YYPARSE_PARAM)
-# else
-int yyparse (YYPARSE_PARAM)
-  void *YYPARSE_PARAM;
-# endif
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+int
+yyparse (void *YYPARSE_PARAM)
+#else
+int
+yyparse (YYPARSE_PARAM)
+    void *YYPARSE_PARAM;
+#endif
 #else /* ! YYPARSE_PARAM */
-#if defined (__STDC__) || defined (__cplusplus)
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
 int
 yyparse (void)
 #else
@@ -971,6 +1190,12 @@ yyparse ()
   int yyerrstatus;
   /* Look-ahead token as an internal (translated) token number.  */
   int yytoken = 0;
+#if YYERROR_VERBOSE
+  /* Buffer for error messages, and its allocated size.  */
+  char yymsgbuf[128];
+  char *yymsg = yymsgbuf;
+  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
+#endif
 
   /* Three stacks and their tools:
      `yyss': related to states,
@@ -981,9 +1206,9 @@ yyparse ()
      to reallocate them elsewhere.  */
 
   /* The state stack.  */
-  short int yyssa[YYINITDEPTH];
-  short int *yyss = yyssa;
-  short int *yyssp;
+  yytype_int16 yyssa[YYINITDEPTH];
+  yytype_int16 *yyss = yyssa;
+  yytype_int16 *yyssp;
 
   /* The semantic value stack.  */
   YYSTYPE yyvsa[YYINITDEPTH];
@@ -992,7 +1217,7 @@ yyparse ()
 
 
 
-#define YYPOPSTACK   (yyvsp--, yyssp--)
+#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
 
   YYSIZE_T yystacksize = YYINITDEPTH;
 
@@ -1001,9 +1226,9 @@ yyparse ()
   YYSTYPE yyval;
 
 
-  /* When reducing, the number of symbols on the RHS of the reduced
-     rule.  */
-  int yylen;
+  /* The number of symbols on the RHS of the reduced rule.
+     Keep to zero when no symbol should be popped.  */
+  int yylen = 0;
 
   YYDPRINTF ((stderr, "Starting parse\n"));
 
@@ -1027,8 +1252,7 @@ yyparse ()
 `------------------------------------------------------------*/
  yynewstate:
   /* In all cases, when you get here, the value and location stacks
-     have just been pushed. so pushing a state here evens the stacks.
-     */
+     have just been pushed.  So pushing a state here evens the stacks.  */
   yyssp++;
 
  yysetstate:
@@ -1041,11 +1265,11 @@ yyparse ()
 
 #ifdef yyoverflow
       {
-       /* Give user a chance to reallocate the stack. Use copies of
+       /* Give user a chance to reallocate the stack.  Use copies of
           these so that the &'s don't force the real ones into
           memory.  */
        YYSTYPE *yyvs1 = yyvs;
-       short int *yyss1 = yyss;
+       yytype_int16 *yyss1 = yyss;
 
 
        /* Each stack pointer address is followed by the size of the
@@ -1073,7 +1297,7 @@ yyparse ()
        yystacksize = YYMAXDEPTH;
 
       {
-       short int *yyss1 = yyss;
+       yytype_int16 *yyss1 = yyss;
        union yyalloc *yyptr =
          (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
        if (! yyptr)
@@ -1108,12 +1332,10 @@ yyparse ()
 `-----------*/
 yybackup:
 
-/* Do appropriate processing given the current state.  */
-/* Read a look-ahead token if we need one and don't already have one.  */
-/* yyresume: */
+  /* Do appropriate processing given the current state.  Read a
+     look-ahead token if we need one and don't already have one.  */
 
   /* First try to decide what to do without reference to look-ahead token.  */
-
   yyn = yypact[yystate];
   if (yyn == YYPACT_NINF)
     goto yydefault;
@@ -1155,22 +1377,21 @@ yybackup:
   if (yyn == YYFINAL)
     YYACCEPT;
 
+  /* Count tokens shifted since error; after three, turn off error
+     status.  */
+  if (yyerrstatus)
+    yyerrstatus--;
+
   /* Shift the look-ahead token.  */
   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
 
-  /* Discard the token being shifted unless it is eof.  */
+  /* Discard the shifted token unless it is eof.  */
   if (yychar != YYEOF)
     yychar = YYEMPTY;
 
+  yystate = yyn;
   *++yyvsp = yylval;
 
-
-  /* Count tokens shifted since error; after three, turn off error
-     status.  */
-  if (yyerrstatus)
-    yyerrstatus--;
-
-  yystate = yyn;
   goto yynewstate;
 
 
@@ -1222,7 +1443,7 @@ yyreduce:
 
   case 14:
 #line 85 "uparse.y"
-    { list_disk((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
+    { list_disk((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
     break;
 
   case 15:
@@ -1232,27 +1453,27 @@ yyreduce:
 
   case 16:
 #line 87 "uparse.y"
-    { set_date((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
+    { set_date((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
     break;
 
   case 17:
 #line 88 "uparse.y"
-    { set_host((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
+    { set_host((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
     break;
 
   case 18:
 #line 89 "uparse.y"
-    { set_disk((yyvsp[-1].strval), (yyvsp[0].strval)); amfree((yyvsp[-1].strval)); amfree((yyvsp[0].strval)); }
+    { set_disk((yyvsp[(2) - (3)].strval), (yyvsp[(3) - (3)].strval)); amfree((yyvsp[(2) - (3)].strval)); amfree((yyvsp[(3) - (3)].strval)); }
     break;
 
   case 19:
 #line 90 "uparse.y"
-    { set_disk((yyvsp[0].strval), NULL); amfree((yyvsp[0].strval)); }
+    { set_disk((yyvsp[(2) - (2)].strval), NULL); amfree((yyvsp[(2) - (2)].strval)); }
     break;
 
   case 20:
 #line 91 "uparse.y"
-    { set_tape((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
+    { set_tape((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
     break;
 
   case 21:
@@ -1262,12 +1483,12 @@ yyreduce:
 
   case 22:
 #line 93 "uparse.y"
-    { cd_glob((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
+    { cd_glob((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
     break;
 
   case 23:
 #line 94 "uparse.y"
-    { cd_regex((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
+    { cd_regex((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
     break;
 
   case 24:
@@ -1300,7 +1521,7 @@ yyreduce:
 
   case 28:
 #line 110 "uparse.y"
-    { display_extract_list((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
+    { display_extract_list((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
     break;
 
   case 29:
@@ -1330,42 +1551,42 @@ yyreduce:
 
   case 35:
 #line 126 "uparse.y"
-    { add_glob((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
+    { add_glob((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
     break;
 
   case 36:
 #line 127 "uparse.y"
-    { add_glob((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
+    { add_glob((yyvsp[(1) - (1)].strval)); amfree((yyvsp[(1) - (1)].strval)); }
     break;
 
   case 38:
 #line 135 "uparse.y"
-    { add_regex((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
+    { add_regex((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
     break;
 
   case 39:
 #line 136 "uparse.y"
-    { add_regex((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
+    { add_regex((yyvsp[(1) - (1)].strval)); amfree((yyvsp[(1) - (1)].strval)); }
     break;
 
   case 41:
 #line 144 "uparse.y"
-    { delete_glob((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
+    { delete_glob((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
     break;
 
   case 42:
 #line 145 "uparse.y"
-    { delete_glob((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
+    { delete_glob((yyvsp[(1) - (1)].strval)); amfree((yyvsp[(1) - (1)].strval)); }
     break;
 
   case 44:
 #line 153 "uparse.y"
-    { delete_regex((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
+    { delete_regex((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
     break;
 
   case 45:
 #line 154 "uparse.y"
-    { delete_regex((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
+    { delete_regex((yyvsp[(1) - (1)].strval)); amfree((yyvsp[(1) - (1)].strval)); }
     break;
 
   case 46:
@@ -1376,34 +1597,30 @@ yyreduce:
   case 47:
 #line 159 "uparse.y"
     {
-               if (chdir((yyvsp[0].strval)) == -1) {
-                       perror((yyvsp[0].strval));
-               }
-               amfree((yyvsp[0].strval));
+               local_cd((yyvsp[(2) - (2)].strval));
+               amfree((yyvsp[(2) - (2)].strval));
        }
     break;
 
   case 48:
-#line 168 "uparse.y"
+#line 166 "uparse.y"
     { help_list(); }
     break;
 
   case 49:
-#line 172 "uparse.y"
+#line 170 "uparse.y"
     { extract_files(); }
     break;
 
 
+/* Line 1267 of yacc.c.  */
+#line 1618 "uparse.c"
       default: break;
     }
+  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
 
-/* Line 1126 of yacc.c.  */
-#line 1402 "uparse.c"
-\f
-  yyvsp -= yylen;
-  yyssp -= yylen;
-
-
+  YYPOPSTACK (yylen);
+  yylen = 0;
   YY_STACK_PRINT (yyss, yyssp);
 
   *++yyvsp = yyval;
@@ -1432,110 +1649,41 @@ yyerrlab:
   if (!yyerrstatus)
     {
       ++yynerrs;
-#if YYERROR_VERBOSE
-      yyn = yypact[yystate];
-
-      if (YYPACT_NINF < yyn && yyn < YYLAST)
-       {
-         int yytype = YYTRANSLATE (yychar);
-         YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
-         YYSIZE_T yysize = yysize0;
-         YYSIZE_T yysize1;
-         int yysize_overflow = 0;
-         char *yymsg = 0;
-#        define YYERROR_VERBOSE_ARGS_MAXIMUM 5
-         char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
-         int yyx;
-
-#if 0
-         /* This is so xgettext sees the translatable formats that are
-            constructed on the fly.  */
-         YY_("syntax error, unexpected %s");
-         YY_("syntax error, unexpected %s, expecting %s");
-         YY_("syntax error, unexpected %s, expecting %s or %s");
-         YY_("syntax error, unexpected %s, expecting %s or %s or %s");
-         YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
-#endif
-         char *yyfmt;
-         char const *yyf;
-         static char const yyunexpected[] = "syntax error, unexpected %s";
-         static char const yyexpecting[] = ", expecting %s";
-         static char const yyor[] = " or %s";
-         char yyformat[sizeof yyunexpected
-                       + sizeof yyexpecting - 1
-                       + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
-                          * (sizeof yyor - 1))];
-         char const *yyprefix = yyexpecting;
-
-         /* Start YYX at -YYN if negative to avoid negative indexes in
-            YYCHECK.  */
-         int yyxbegin = yyn < 0 ? -yyn : 0;
-
-         /* Stay within bounds of both yycheck and yytname.  */
-         int yychecklim = YYLAST - yyn;
-         int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
-         int yycount = 1;
-
-         yyarg[0] = yytname[yytype];
-         yyfmt = yystpcpy (yyformat, yyunexpected);
-
-         for (yyx = yyxbegin; yyx < yyxend; ++yyx)
-           if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+#if ! YYERROR_VERBOSE
+      yyerror (YY_("syntax error"));
+#else
+      {
+       YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
+       if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
+         {
+           YYSIZE_T yyalloc = 2 * yysize;
+           if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
+             yyalloc = YYSTACK_ALLOC_MAXIMUM;
+           if (yymsg != yymsgbuf)
+             YYSTACK_FREE (yymsg);
+           yymsg = (char *) YYSTACK_ALLOC (yyalloc);
+           if (yymsg)
+             yymsg_alloc = yyalloc;
+           else
              {
-               if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
-                 {
-                   yycount = 1;
-                   yysize = yysize0;
-                   yyformat[sizeof yyunexpected - 1] = '\0';
-                   break;
-                 }
-               yyarg[yycount++] = yytname[yyx];
-               yysize1 = yysize + yytnamerr (0, yytname[yyx]);
-               yysize_overflow |= yysize1 < yysize;
-               yysize = yysize1;
-               yyfmt = yystpcpy (yyfmt, yyprefix);
-               yyprefix = yyor;
+               yymsg = yymsgbuf;
+               yymsg_alloc = sizeof yymsgbuf;
              }
+         }
 
-         yyf = YY_(yyformat);
-         yysize1 = yysize + yystrlen (yyf);
-         yysize_overflow |= yysize1 < yysize;
-         yysize = yysize1;
-
-         if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM)
-           yymsg = (char *) YYSTACK_ALLOC (yysize);
-         if (yymsg)
-           {
-             /* Avoid sprintf, as that infringes on the user's name space.
-                Don't have undefined behavior even if the translation
-                produced a string with the wrong number of "%s"s.  */
-             char *yyp = yymsg;
-             int yyi = 0;
-             while ((*yyp = *yyf))
-               {
-                 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
-                   {
-                     yyp += yytnamerr (yyp, yyarg[yyi++]);
-                     yyf += 2;
-                   }
-                 else
-                   {
-                     yyp++;
-                     yyf++;
-                   }
-               }
-             yyerror (yymsg);
-             YYSTACK_FREE (yymsg);
-           }
-         else
-           {
-             yyerror (YY_("syntax error"));
+       if (0 < yysize && yysize <= yymsg_alloc)
+         {
+           (void) yysyntax_error (yymsg, yystate, yychar);
+           yyerror (yymsg);
+         }
+       else
+         {
+           yyerror (YY_("syntax error"));
+           if (yysize != 0)
              goto yyexhaustedlab;
-           }
-       }
-      else
-#endif /* YYERROR_VERBOSE */
-       yyerror (YY_("syntax error"));
+         }
+      }
+#endif
     }
 
 
@@ -1546,14 +1694,15 @@ yyerrlab:
         error, discard it.  */
 
       if (yychar <= YYEOF)
-        {
+       {
          /* Return failure if at end of input.  */
          if (yychar == YYEOF)
            YYABORT;
-        }
+       }
       else
        {
-         yydestruct ("Error: discarding", yytoken, &yylval);
+         yydestruct ("Error: discarding",
+                     yytoken, &yylval);
          yychar = YYEMPTY;
        }
     }
@@ -1571,11 +1720,14 @@ yyerrorlab:
   /* Pacify compilers like GCC when the user code never invokes
      YYERROR and the label yyerrorlab therefore never appears in user
      code.  */
-  if (0)
+  if (/*CONSTCOND*/ 0)
      goto yyerrorlab;
 
-yyvsp -= yylen;
-  yyssp -= yylen;
+  /* Do not reclaim the symbols of the rule which action triggered
+     this YYERROR.  */
+  YYPOPSTACK (yylen);
+  yylen = 0;
+  YY_STACK_PRINT (yyss, yyssp);
   yystate = *yyssp;
   goto yyerrlab1;
 
@@ -1605,8 +1757,9 @@ yyerrlab1:
        YYABORT;
 
 
-      yydestruct ("Error: popping", yystos[yystate], yyvsp);
-      YYPOPSTACK;
+      yydestruct ("Error: popping",
+                 yystos[yystate], yyvsp);
+      YYPOPSTACK (1);
       yystate = *yyssp;
       YY_STACK_PRINT (yyss, yyssp);
     }
@@ -1617,7 +1770,7 @@ yyerrlab1:
   *++yyvsp = yylval;
 
 
-  /* Shift the error token. */
+  /* Shift the error token.  */
   YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
 
   yystate = yyn;
@@ -1652,21 +1805,30 @@ yyreturn:
   if (yychar != YYEOF && yychar != YYEMPTY)
      yydestruct ("Cleanup: discarding lookahead",
                 yytoken, &yylval);
+  /* Do not reclaim the symbols of the rule which action triggered
+     this YYABORT or YYACCEPT.  */
+  YYPOPSTACK (yylen);
+  YY_STACK_PRINT (yyss, yyssp);
   while (yyssp != yyss)
     {
       yydestruct ("Cleanup: popping",
                  yystos[*yyssp], yyvsp);
-      YYPOPSTACK;
+      YYPOPSTACK (1);
     }
 #ifndef yyoverflow
   if (yyss != yyssa)
     YYSTACK_FREE (yyss);
 #endif
-  return yyresult;
+#if YYERROR_VERBOSE
+  if (yymsg != yymsgbuf)
+    YYSTACK_FREE (yymsg);
+#endif
+  /* Make sure YYID is used.  */
+  return YYID (yyresult);
 }
 
 
-#line 176 "uparse.y"
+#line 174 "uparse.y"
 
 
 void
index 30d97fae14d0b01316e74461d91156235cec75b7..d813294dfdcbf9abe68cf20b461d144d655a944f 100644 (file)
@@ -1,7 +1,9 @@
-/* A Bison parser, made by GNU Bison 2.1.  */
+/* A Bison parser, made by GNU Bison 2.3.  */
 
-/* Skeleton parser for Yacc-like parsing with Bison,
-   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+/* Skeleton interface for Bison's Yacc-like parsers in C
+
+   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+   Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    Foundation, Inc., 51 Franklin Street, Fifth Floor,
    Boston, MA 02110-1301, USA.  */
 
-/* As a special exception, when this file is copied by Bison into a
-   Bison output file, you may use that output file without restriction.
-   This special exception was added by the Free Software Foundation
-   in version 1.24 of Bison.  */
+/* As a special exception, you may create a larger work that contains
+   part or all of the Bison parser skeleton and distribute that work
+   under terms of your choice, so long as that work isn't itself a
+   parser generator using the skeleton or a modified version thereof
+   as a parser skeleton.  Alternatively, if you modify or redistribute
+   the parser skeleton itself, you may (at your option) remove this
+   special exception, which will cause the skeleton and the resulting
+   Bison output files to be licensed under the GNU General Public
+   License without this special exception.
+
+   This special exception was added by the Free Software Foundation in
+   version 2.2 of Bison.  */
 
 /* Tokens.  */
 #ifndef YYTOKENTYPE
 
 
 
-#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+typedef union YYSTYPE
 #line 42 "uparse.y"
-typedef union YYSTYPE {
+{
        int     intval;
        double  floatval;
        char *  strval;
        int     subtok;
-} YYSTYPE;
-/* Line 1447 of yacc.c.  */
-#line 105 "uparse.h"
+}
+/* Line 1489 of yacc.c.  */
+#line 116 "uparse.h"
+       YYSTYPE;
 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
 # define YYSTYPE_IS_DECLARED 1
 # define YYSTYPE_IS_TRIVIAL 1
@@ -109,5 +121,3 @@ typedef union YYSTYPE {
 
 extern YYSTYPE yylval;
 
-
-
index 117e6d9cbf5d8ac20b7bf7b3a2691f48640ee2e2..3700981d2e089852066baf5cdedead60a5513f85 100644 (file)
@@ -157,9 +157,7 @@ deletex_path:
 local_command:
        LPWD { char buf[STR_SIZE]; puts(getcwd(buf, sizeof(buf))); }
   |     LCD PATH {
-               if (chdir($2) == -1) {
-                       perror($2);
-               }
+               local_cd($2);
                amfree($2);
        }
   ;
index 2dfe457161560535b710dfed0b226f3b8fef33f2..ac37b7300e7dd9934e684b287c17701d5e029143 100644 (file)
@@ -2,7 +2,8 @@
 
 INCLUDES =     -I$(top_builddir)/common-src \
                -I$(top_srcdir)/common-src   \
-               -I$(top_srcdir)/client-src
+               -I$(top_srcdir)/client-src   \
+               -I$(top_srcdir)/gnulib
 
 LINT=@AMLINT@
 LINTFLAGS=@AMLINTFLAGS@
@@ -26,6 +27,7 @@ LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
        @LEXLIB@ \
        ../client-src/libamclient.$(LIB_EXTENSION) \
        ../common-src/libamanda.$(LIB_EXTENSION) \
+       ../gnulib/libgnu.$(LIB_EXTENSION) \
        $(READLINE_LIBS)
 
 amrecover_CSRC =       amrecover.c                                     \
index 3943606a06ceda53b188c8fc4ff91a09b0c264d5..a31769562b42f6c1fe751a5e16649b77556c3791 100644 (file)
@@ -46,6 +46,41 @@ DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
        $(srcdir)/Makefile.in uparse.c uparse.h uscan.c
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+       $(top_srcdir)/config/gnulib/absolute-header.m4 \
+       $(top_srcdir)/config/gnulib/alloca.m4 \
+       $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/eoverflow.m4 \
+       $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/getaddrinfo.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-cache.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-common.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-comp.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-tool.m4 \
+       $(top_srcdir)/config/gnulib/inet_ntop.m4 \
+       $(top_srcdir)/config/gnulib/intmax_t.m4 \
+       $(top_srcdir)/config/gnulib/inttypes_h.m4 \
+       $(top_srcdir)/config/gnulib/lib-ld.m4 \
+       $(top_srcdir)/config/gnulib/lib-link.m4 \
+       $(top_srcdir)/config/gnulib/lib-prefix.m4 \
+       $(top_srcdir)/config/gnulib/lock.m4 \
+       $(top_srcdir)/config/gnulib/longdouble.m4 \
+       $(top_srcdir)/config/gnulib/longlong.m4 \
+       $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
+       $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \
+       $(top_srcdir)/config/gnulib/size_max.m4 \
+       $(top_srcdir)/config/gnulib/snprintf.m4 \
+       $(top_srcdir)/config/gnulib/socklen.m4 \
+       $(top_srcdir)/config/gnulib/sockpfaf.m4 \
+       $(top_srcdir)/config/gnulib/stdbool.m4 \
+       $(top_srcdir)/config/gnulib/stdint_h.m4 \
+       $(top_srcdir)/config/gnulib/strdup.m4 \
+       $(top_srcdir)/config/gnulib/string_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
+       $(top_srcdir)/config/gnulib/vasnprintf.m4 \
+       $(top_srcdir)/config/gnulib/visibility.m4 \
+       $(top_srcdir)/config/gnulib/wchar_t.m4 \
+       $(top_srcdir)/config/gnulib/wint_t.m4 \
+       $(top_srcdir)/config/gnulib/xsize.m4 \
        $(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
@@ -64,7 +99,8 @@ amrecover_LDADD = $(LDADD)
 am__DEPENDENCIES_1 =
 amrecover_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
        ../client-src/libamclient.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
+       ../common-src/libamanda.$(LIB_EXTENSION) \
+       ../gnulib/libgnu.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
 DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/config
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
 am__depfiles_maybe = depfiles
@@ -87,8 +123,10 @@ HEADERS = $(noinst_HEADERS)
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ABSOLUTE_STRING_H = @ABSOLUTE_STRING_H@
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
+ALLOCA_H = @ALLOCA_H@
 AMANDA_DBGDIR = @AMANDA_DBGDIR@
 AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@
 AMANDA_TMPDIR = @AMANDA_TMPDIR@
@@ -103,18 +141,17 @@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@
 AMTAR = @AMTAR@
 AM_CFLAGS = @AM_CFLAGS@
 AR = @AR@
+ARPA_INET_H = @ARPA_INET_H@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
-AWK_VAR_ASSIGNMENT_OPT = @AWK_VAR_ASSIGNMENT_OPT@
 BINARY_OWNER = @BINARY_OWNER@
-BUILD_MAN_PAGES_FALSE = @BUILD_MAN_PAGES_FALSE@
-BUILD_MAN_PAGES_TRUE = @BUILD_MAN_PAGES_TRUE@
 CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
+CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
 CHIO = @CHIO@
 CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
@@ -147,18 +184,40 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
+ENABLE_MANPAGE_BUILD_FALSE = @ENABLE_MANPAGE_BUILD_FALSE@
+ENABLE_MANPAGE_BUILD_TRUE = @ENABLE_MANPAGE_BUILD_TRUE@
+EOVERFLOW = @EOVERFLOW@
+EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@
 EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
+GCC_COMPILER_FALSE = @GCC_COMPILER_FALSE@
+GCC_COMPILER_TRUE = @GCC_COMPILER_TRUE@
 GETCONF = @GETCONF@
+GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@
+GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
 GNUTAR_LISTED_INCREMENTAL_DIRX = @GNUTAR_LISTED_INCREMENTAL_DIRX@
 GREP = @GREP@
 GZIP = @GZIP@
-HAVE_XSLTPROC_FALSE = @HAVE_XSLTPROC_FALSE@
-HAVE_XSLTPROC_TRUE = @HAVE_XSLTPROC_TRUE@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRNDUP = @HAVE_STRNDUP@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE__BOOL = @HAVE__BOOL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -167,22 +226,31 @@ LDFLAGS = @LDFLAGS@
 LEX = @LEX@
 LEXLIB = @LEXLIB@
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
+LIBPTH = @LIBPTH@
+LIBPTH_PREFIX = @LIBPTH_PREFIX@
 LIBS = @LIBS@
+LIBTHREAD = @LIBTHREAD@
 LIBTOOL = @LIBTOOL@
 LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LL_FMT = @LL_FMT@
 LL_RFMT = @LL_RFMT@
 LN_S = @LN_S@
 LTALLOCA = @LTALLOCA@
+LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
 LTLIBOBJS = @LTLIBOBJS@
+LTLIBPTH = @LTLIBPTH@
+LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
 MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@
 MCUTIL = @MCUTIL@
+MKDIR_P = @MKDIR_P@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
+NETINET_IN_H = @NETINET_IN_H@
 OBJEXT = @OBJEXT@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -196,6 +264,9 @@ PERL = @PERL@
 PRINT = @PRINT@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
+REPLACE_STRCASECMP = @REPLACE_STRCASECMP@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRSTR = @REPLACE_STRSTR@
 RESTORE = @RESTORE@
 SAMBA_CLIENT = @SAMBA_CLIENT@
 SERVICE_SUFFIX = @SERVICE_SUFFIX@
@@ -204,7 +275,10 @@ SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 SNAPSHOT_STAMP = @SNAPSHOT_STAMP@
 SORT = @SORT@
+SSH = @SSH@
+STDBOOL_H = @STDBOOL_H@
 STRIP = @STRIP@
+SYS_SOCKET_H = @SYS_SOCKET_H@
 USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@
 VDUMP = @VDUMP@
 VERSION = @VERSION@
@@ -243,6 +317,7 @@ WANT_TAPE_TRUE = @WANT_TAPE_TRUE@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
 XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
 YACC = @YACC@
 ac_c = @ac_c@
 ac_ct_AR = @ac_ct_AR@
@@ -269,6 +344,8 @@ build_os = @build_os@
 build_vendor = @build_vendor@
 datadir = @datadir@
 exec_prefix = @exec_prefix@
+gl_LIBOBJS = @gl_LIBOBJS@
+gl_LTLIBOBJS = @gl_LTLIBOBJS@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -295,7 +372,8 @@ target_os = @target_os@
 target_vendor = @target_vendor@
 INCLUDES = -I$(top_builddir)/common-src \
                -I$(top_srcdir)/common-src   \
-               -I$(top_srcdir)/client-src
+               -I$(top_srcdir)/client-src   \
+               -I$(top_srcdir)/gnulib
 
 LINT = @AMLINT@
 LINTFLAGS = @AMLINTFLAGS@
@@ -312,6 +390,7 @@ LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
        @LEXLIB@ \
        ../client-src/libamclient.$(LIB_EXTENSION) \
        ../common-src/libamanda.$(LIB_EXTENSION) \
+       ../gnulib/libgnu.$(LIB_EXTENSION) \
        $(READLINE_LIBS)
 
 amrecover_CSRC = amrecover.c                                   \
index f3630b2abc17fd1c2301b0925d257dea70bd0d51..7752ee6f8a98c6e03fa4360c852765daef21d006 100644 (file)
@@ -24,7 +24,7 @@
  * file named AUTHORS, in the root directory of this distribution.
  */
 /*
- * $Id: amrecover.c,v 1.73.2.2 2007/01/24 18:33:30 martinea Exp $
+ * $Id: amrecover.c,v 1.73 2006/07/25 18:27:57 martinea Exp $
  *
  * an interactive program for recovering backed-up files
  */
 #include "getfsent.h"
 #include "dgram.h"
 #include "util.h"
-#include "clientconf.h"
+#include "conffile.h"
 #include "protocol.h"
 #include "event.h"
 #include "security.h"
 
+#define amrecover_debug(i,x) do {      \
+       if ((i) <= debug_amrecover) {   \
+           dbprintf(x);                \
+       }                               \
+} while (0)
+
 extern int process_line(char *line);
 int get_line(void);
 int grab_reply(int show);
@@ -101,13 +107,21 @@ get_line(void)
        mesg_buffer = stralloc("");
  
     while (!strstr(mesg_buffer,"\r\n")) {
+       buf = NULL;
        size = security_stream_read_sync(streams[MESGFD].fd, &buf);
        if(size < 0) {
+           amrecover_debug(1, ("%s: amrecover: get_line size < 0 (%zd)\n", debug_prefix_time(NULL), size));
            return -1;
        }
        else if(size == 0) {
+           amrecover_debug(1, ("%s: amrecover: get_line size == 0 (%zd)\n", debug_prefix_time(NULL), size));
+           return -1;
+       }
+       else if (buf == NULL) {
+           amrecover_debug(1, ("%s: amrecover: get_line buf == NULL\n", debug_prefix_time(NULL)));
            return -1;
        }
+        amrecover_debug(1, ("%s: amrecover: get_line size = %zd\n", debug_prefix_time(NULL), size));
        newbuf = alloc(strlen(mesg_buffer)+size+1);
        strncpy(newbuf, mesg_buffer, (size_t)(strlen(mesg_buffer) + size));
        memcpy(newbuf+strlen(mesg_buffer), buf, (size_t)size);
@@ -331,7 +345,7 @@ main(
     }
     localhost[MAX_HOSTNAME_LENGTH] = '\0';
 
-    parse_client_conf(argc, argv, &new_argc, &new_argv);
+    parse_conf(argc, argv, &new_argc, &new_argv);
 
     if (new_argc > 1 && new_argv[1][0] != '-') {
        /*
@@ -355,19 +369,19 @@ main(
     while ((i = getopt(new_argc, new_argv, "C:s:t:d:U")) != EOF) {
        switch (i) {
            case 'C':
-               add_client_conf(CLN_CONF, optarg);
+               add_client_conf(CNF_CONF, optarg);
                break;
 
            case 's':
-               add_client_conf(CLN_INDEX_SERVER, optarg);
+               add_client_conf(CNF_INDEX_SERVER, optarg);
                break;
 
            case 't':
-               add_client_conf(CLN_TAPE_SERVER, optarg);
+               add_client_conf(CNF_TAPE_SERVER, optarg);
                break;
 
            case 'd':
-               add_client_conf(CLN_TAPEDEV, optarg);
+               add_client_conf(CNF_TAPEDEV, optarg);
                break;
 
            case 'U':
@@ -391,7 +405,7 @@ main(
     }
     amfree(conffile);
 
-    config = stralloc(client_getconf_str(CLN_CONF));
+    config = stralloc(getconf_str(CNF_CONF));
 
     conffile = vstralloc(CONFIG_DIR, "/", config, "/", "amanda-client.conf",
                         NULL);
@@ -403,11 +417,11 @@ main(
 
     dbrename(config, DBG_SUBDIR_CLIENT);
 
-    report_bad_client_arg();
+    report_bad_conf_arg();
 
     server_name = NULL;
-    if (client_getconf_seen(CLN_INDEX_SERVER) == -2) { /* command line argument */
-       server_name = client_getconf_str(CLN_INDEX_SERVER);
+    if (getconf_seen(CNF_INDEX_SERVER) == -2) { /* command line argument */
+       server_name = getconf_str(CNF_INDEX_SERVER);
     }
     if (!server_name) {
        server_name = getenv("AMANDA_SERVER");
@@ -416,7 +430,7 @@ main(
        }
     }
     if (!server_name) {
-       server_name = client_getconf_str(CLN_INDEX_SERVER);
+       server_name = getconf_str(CNF_INDEX_SERVER);
     }
     if (!server_name) {
        error("No index server set");
@@ -425,8 +439,8 @@ main(
     server_name = stralloc(server_name);
 
     tape_server_name = NULL;
-    if (client_getconf_seen(CLN_TAPE_SERVER) == -2) { /* command line argument */
-       tape_server_name = client_getconf_str(CLN_TAPE_SERVER);
+    if (getconf_seen(CNF_TAPE_SERVER) == -2) { /* command line argument */
+       tape_server_name = getconf_str(CNF_TAPE_SERVER);
     }
     if (!tape_server_name) {
        tape_server_name = getenv("AMANDA_TAPE_SERVER");
@@ -440,7 +454,7 @@ main(
        }
     }
     if (!tape_server_name) {
-       tape_server_name = client_getconf_str(CLN_TAPE_SERVER);
+       tape_server_name = getconf_str(CNF_TAPE_SERVER);
     }
     if (!tape_server_name) {
        error("No tape server set");
@@ -449,11 +463,11 @@ main(
     tape_server_name = stralloc(tape_server_name);
 
     amfree(tape_device_name);
-    tape_device_name = client_getconf_str(CLN_TAPEDEV);
+    tape_device_name = getconf_str(CNF_TAPEDEV);
     if (tape_device_name)
        tape_device_name = stralloc(tape_device_name);
 
-    authopt = stralloc(client_getconf_str(CLN_AUTH));
+    authopt = stralloc(getconf_str(CNF_AUTH));
 
 
     amfree(disk_name);
@@ -490,7 +504,7 @@ main(
        /*NOTREACHED*/
     }
 
-    protocol_sendreq(server_name, secdrv, amindexd_client_get_security_conf,
+    protocol_sendreq(server_name, secdrv, generic_client_get_security_conf,
                     req, STARTUP_TIMEOUT, amindexd_response, &response_error);
 
     amfree(req);
@@ -718,10 +732,8 @@ bad_nak:
            tok_end = tok + strlen(tok);
            while((p = strchr(tok, ';')) != NULL) {
                *p++ = '\0';
-#define sc "features="
-               if(strncmp(tok, sc, sizeof(sc)-1) == 0) {
-                   tok += sizeof(sc) - 1;
-#undef sc
+               if(strncmp_const(tok, "features=") == 0) {
+                   tok += SIZEOF("features=") - 1;
                    am_release_feature_set(their_features);
                    if((their_features = am_string_to_feature(tok)) == NULL) {
                        errstr = newvstralloc(errstr,
@@ -831,10 +843,10 @@ amindexd_client_get_security_conf(
        return(NULL);
 
     if(strcmp(string, "auth")==0) {
-       return(client_getconf_str(CLN_AUTH));
+       return(getconf_str(CNF_AUTH));
     }
     else if(strcmp(string, "ssh_keys")==0) {
-       return(client_getconf_str(CLN_SSH_KEYS));
+       return(getconf_str(CNF_SSH_KEYS));
     }
     return(NULL);
 }
index 79a9a922b495196d83372d13fe22b9c6e49ef655..5accbb78b8965827a3c9b4d13e618aa42b3ced01 100644 (file)
@@ -83,6 +83,7 @@ extern void set_host(const char *host);
 extern void list_host(void);
 extern int set_date(char *date);
 extern void set_directory(char *dir);
+extern void local_cd(char *dir);
 extern void cd_glob(char *dir);
 extern void cd_regex(char *dir);
 extern void cd_dir(char *dir, char *default_dir);
index 1a5b63876c42173cb0b63c0d873d226cea3e18b1..826c4ce3a5b8304336d16370f1ec931f9ce2443d 100644 (file)
@@ -24,7 +24,7 @@
  * file named AUTHORS, in the root directory of this distribution.
  */
 /*
- * $Id: display_commands.c,v 1.22.2.1 2006/12/22 15:10:26 martinea Exp $
+ * $Id: display_commands.c,v 1.22 2006/07/05 19:42:17 martinea Exp $
  *
  * implements the directory-display related commands in amrecover
  */
@@ -203,14 +203,12 @@ suck_dir_list_from_server(void)
            printf("%s\n", l);
            continue;
        }
-#define sc "201-"
-       if (strncmp(l, sc, sizeof(sc)-1) != 0) {
+       s = l;
+       if (strncmp_const_skip(l, "201-", s, ch) != 0) {
            err = "bad reply: not 201-";
            continue;
        }
-       s = l + sizeof(sc)-1;
        ch = *s++;
-#undef sc
        skip_whitespace(s, ch);
        if(ch == '\0') {
            err = "bad reply: missing date field";
@@ -239,12 +237,13 @@ suck_dir_list_from_server(void)
        *tape_undo = '\0';
 
        if(am_has_feature(indexsrv_features, fe_amindexd_fileno_in_OLSD)) {
+           OFF_T_FMT_TYPE fileno_ = (OFF_T_FMT_TYPE)0;
            skip_whitespace(s, ch);
-           if(ch == '\0' || sscanf(s - 1, OFF_T_FMT,
-                                   (OFF_T_FMT_TYPE *)&fileno) != 1) {
+           if(ch == '\0' || sscanf(s - 1, OFF_T_FMT, &fileno_) != 1) {
                err = "bad reply: cannot parse fileno field";
                continue;
            }
+           fileno = (off_t)fileno_;
            skip_integer(s, ch);
        }
        else {
index 4cd35b22e5e23cf701d7e8ff02f92f25fb426392..e46eb763d1d1160cbd47f439051b7cbdee2722e6 100644 (file)
@@ -24,7 +24,7 @@
  * file named AUTHORS, in the root directory of this distribution.
  */
 /*
- * $Id: extract_list.c,v 1.117.2.2 2006/12/22 15:10:26 martinea Exp $
+ * $Id: extract_list.c,v 1.117 2006/08/24 01:57:15 paddy_s Exp $
  *
  * implements the "extract" command in amrecover
  */
@@ -40,7 +40,7 @@
 #include "findpass.h"
 #endif
 #include "util.h"
-#include "clientconf.h"
+#include "conffile.h"
 #include "protocol.h"
 #include "event.h"
 #include "security.h"
@@ -166,7 +166,7 @@ read_buffer(
     long       timeout_s)
 {
     ssize_t size = 0;
-    fd_set readset;
+    SELECT_ARG_TYPE readset;
     struct timeval timeout;
     char *dataptr;
     ssize_t spaceleft;
@@ -736,7 +736,6 @@ add_file(
 {
     DIR_ITEM *ditem, lditem;
     char *path_on_disk = NULL;
-    char *path_on_disk_slash = NULL;
     char *cmd = NULL;
     char *err = NULL;
     int i;
@@ -786,8 +785,6 @@ add_file(
        amfree(clean_disk_path);
     }
 
-    path_on_disk_slash = stralloc2(path_on_disk, "/");
-
     dbprintf(("add_file: Converted path=\"%s\" to path_on_disk=\"%s\"\n",
              regex, path_on_disk));
 
@@ -799,8 +796,7 @@ add_file(
        quoted = quote_string(ditem->path);
        dbprintf(("add_file: Pondering ditem->path=%s\n", quoted));
        amfree(quoted);
-       if (match(path_on_disk, ditem->path)
-           || match(path_on_disk_slash, ditem->path))
+       if (match(path_on_disk, ditem->path))
        {
            found_one = 1;
            j = (ssize_t)strlen(ditem->path);
@@ -817,7 +813,6 @@ add_file(
                    amfree(cmd);
                    amfree(ditem_path);
                    amfree(path_on_disk);
-                   amfree(path_on_disk_slash);
                    exit(1);
                }
                amfree(cmd);
@@ -826,13 +821,11 @@ add_file(
                if ((i = get_reply_line()) == -1) {
                    amfree(ditem_path);
                    amfree(path_on_disk);
-                   amfree(path_on_disk_slash);
                    exit(1);
                }
                if(i==0) {              /* assume something wrong */
                    amfree(ditem_path);
                    amfree(path_on_disk);
-                   amfree(path_on_disk_slash);
                    l = reply_line();
                    printf("%s\n", l);
                    return;
@@ -846,7 +839,6 @@ add_file(
                    if (i == -1) {
                        amfree(ditem_path);
                        amfree(path_on_disk);
-                       amfree(path_on_disk_slash);
                        exit(1);
                    }
                    if(err) {
@@ -862,15 +854,14 @@ add_file(
                        puts(l);
                        continue;
                    }
-#define sc "201-"
-                   if(strncmp(l, sc, sizeof(sc)-1) != 0) {
+
+                   s = l;
+                   if(strncmp_const_skip(l, "201-", s, ch) != 0) {
                        err = "bad reply: not 201-";
                        continue;
                    }
-
-                   s = l + sizeof(sc)-1;
                    ch = *s++;
-#undef sc
+
                    skip_whitespace(s, ch);
                    if(ch == '\0') {
                        err = "bad reply: missing date field";
@@ -901,12 +892,14 @@ add_file(
                     s[-1] = (char)ch;
 
                    if(am_has_feature(indexsrv_features, fe_amindexd_fileno_in_ORLD)) {
+                       OFF_T_FMT_TYPE fileno_ = (OFF_T_FMT_TYPE)0;
                        skip_whitespace(s, ch);
-                       if(ch == '\0' || sscanf(s - 1, OFF_T_FMT,
-                               (OFF_T_FMT_TYPE *)&lditem.fileno) != 1) {
+                       if(ch == '\0' ||
+                          sscanf(s - 1, OFF_T_FMT, &fileno_) != 1) {
                            err = "bad reply: cannot parse fileno field";
                            continue;
                        }
+                       lditem.fileno = (off_t)fileno_;
                        skip_integer(s, ch);
                    }
 
@@ -983,7 +976,6 @@ add_file(
     amfree(cmd);
     amfree(ditem_path);
     amfree(path_on_disk);
-    amfree(path_on_disk_slash);
 
     amfree(lditem.path);
     amfree(lditem.date);
@@ -1054,7 +1046,6 @@ delete_file(
 {
     DIR_ITEM *ditem, lditem;
     char *path_on_disk = NULL;
-    char *path_on_disk_slash = NULL;
     char *cmd = NULL;
     char *err = NULL;
     int i;
@@ -1110,8 +1101,6 @@ delete_file(
        amfree(clean_disk_path);
     }
 
-    path_on_disk_slash = stralloc2(path_on_disk, "/");
-
     dbprintf(("delete_file: Converted path=\"%s\" to path_on_disk=\"%s\"\n",
              regex, path_on_disk));
     found_one = 0;
@@ -1120,8 +1109,7 @@ delete_file(
        quoted = quote_string(ditem->path);
        dbprintf(("delete_file: Pondering ditem->path=%s\n", quoted));
        amfree(quoted);
-       if (match(path_on_disk, ditem->path)
-           || match(path_on_disk_slash, ditem->path))
+       if (match(path_on_disk, ditem->path))
        {
            found_one = 1;
            j = (ssize_t)strlen(ditem->path);
@@ -1138,7 +1126,6 @@ delete_file(
                    amfree(cmd);
                    amfree(ditem_path);
                    amfree(path_on_disk);
-                   amfree(path_on_disk_slash);
                    exit(1);
                }
                amfree(cmd);
@@ -1146,14 +1133,12 @@ delete_file(
                if ((i = get_reply_line()) == -1) {
                    amfree(ditem_path);
                    amfree(path_on_disk);
-                   amfree(path_on_disk_slash);
                    exit(1);
                }
                if(i==0)                /* assume something wrong */
                {
                    amfree(ditem_path);
                    amfree(path_on_disk);
-                   amfree(path_on_disk_slash);
                    l = reply_line();
                    printf("%s\n", l);
                    return;
@@ -1168,7 +1153,6 @@ delete_file(
                    if (i == -1) {
                        amfree(ditem_path);
                        amfree(path_on_disk);
-                       amfree(path_on_disk_slash);
                        exit(1);
                    }
                    if(err) {
@@ -1185,14 +1169,14 @@ delete_file(
                        puts(l);
                        continue;
                    }
-#define sc "201-"
-                   if(strncmp(l, sc, sizeof(sc)-1) != 0) {
+
+                   s = l;
+                   if(strncmp_const_skip(l, "201-", s, ch) != 0) {
                        err = "bad reply: not 201-";
                        continue;
                    }
-                   s = l + sizeof(sc)-1;
                    ch = *s++;
-#undef sc
+
                    skip_whitespace(s, ch);
                    if(ch == '\0') {
                        err = "bad reply: missing date field";
@@ -1221,12 +1205,14 @@ delete_file(
                    *tape_undo = '\0';
 
                    if(am_has_feature(indexsrv_features, fe_amindexd_fileno_in_ORLD)) {
+                       OFF_T_FMT_TYPE fileno_ = (OFF_T_FMT_TYPE)0;
                        skip_whitespace(s, ch);
-                       if(ch == '\0' || sscanf(s - 1, OFF_T_FMT,
-                               (OFF_T_FMT_TYPE *)&fileno) != 1) {
+                       if(ch == '\0' ||
+                          sscanf(s - 1, OFF_T_FMT, &fileno_) != 1) {
                            err = "bad reply: cannot parse fileno field";
                            continue;
                        }
+                       fileno = (off_t)fileno_;
                        skip_integer(s, ch);
                    }
 
@@ -1297,7 +1283,6 @@ delete_file(
     amfree(cmd);
     amfree(ditem_path);
     amfree(path_on_disk);
-    amfree(path_on_disk_slash);
 
     if(! found_one) {
        printf("File %s doesn't exist in directory\n", path);
@@ -1523,7 +1508,7 @@ extract_files_setup(
                                "auth=", authopt, ";",
                    "\n", NULL);
     protocol_sendreq(tape_server_name, amidxtaped_secdrv,
-                    amidxtaped_client_get_security_conf, req, STARTUP_TIMEOUT,
+                    generic_client_get_security_conf, req, STARTUP_TIMEOUT,
                     amidxtaped_response, &response_error);
     amfree(req);
     protocol_run();
@@ -1594,7 +1579,7 @@ extract_files_setup(
        tt = newstralloc2(tt, "FEATURES=", our_features_string);
        send_to_tape_server(amidxtaped_streams[CTLFD].fd, tt);
        get_amidxtaped_line();
-       if(strncmp(amidxtaped_line,"FEATURES=",9) == 0) {
+       if(strncmp_const(amidxtaped_line,"FEATURES=") == 0) {
            tapesrv_features = am_string_to_feature(amidxtaped_line+9);
        } else {
            fprintf(stderr, "amrecover - expecting FEATURES line from amidxtaped\n");
@@ -1708,7 +1693,8 @@ enum dumptypes {
        IS_GNUTAR,
        IS_TAR,
        IS_SAMBA,
-       IS_SAMBA_TAR
+       IS_SAMBA_TAR,
+       IS_BACKUP_API
 };
 
 static void
@@ -1753,6 +1739,8 @@ extract_files_child(
     }
 
     if (file.program != NULL) {
+       if (strcmp(file.program, "BACKUP") == 0)
+           dumptype = IS_BACKUP_API;
 #ifdef GNUTAR
        if (strcmp(file.program, GNUTAR) == 0)
            dumptype = IS_GNUTAR;
@@ -1805,8 +1793,10 @@ extract_files_child(
        }
 #endif
        break;
+    case IS_BACKUP_API:
+       extra_params = 5;
+       break;
     }
-
     restore_args = (char **)alloc((size_t)((extra_params + files_off_tape + 1)
                                  * sizeof(char *)));
     switch(dumptype) {
@@ -1867,11 +1857,21 @@ extract_files_child(
         restore_args[j++] = stralloc("-");     /* data on stdin */
        }
 #endif
+       break;
+    case IS_BACKUP_API:
+       restore_args[j++] = stralloc(file.dumper);
+       restore_args[j++] = stralloc("restore");
+       restore_args[j++] = stralloc("--config");
+       restore_args[j++] = stralloc(config);
+       restore_args[j++] = stralloc("--disk");
+       restore_args[j++] = stralloc(file.disk);
+       break;
     }
   
     for (i = 0, fn = elist->files; i < files_off_tape; i++, fn = fn->next)
     {
        switch (dumptype) {
+       case IS_BACKUP_API:
        case IS_TAR:
        case IS_GNUTAR:
        case IS_SAMBA_TAR:
@@ -1896,6 +1896,7 @@ extract_files_child(
            {
            restore_args[j++] = stralloc(fn->path);
            }
+           break;
        }
     }
 #if defined(XFSDUMP)
@@ -1952,6 +1953,10 @@ extract_files_child(
                    file.program);
            cmd = stralloc("restore");
        }
+       break;
+    case IS_BACKUP_API:
+       cmd = vstralloc(DUMPER_DIR, "/", file.dumper, NULL);
+       break;
     }
     if (cmd) {
         dbprintf(("Exec'ing %s with arguments:\n", cmd));
@@ -2039,7 +2044,7 @@ writer_intermediary(
                send_to_tape_server(amidxtaped_streams[CTLFD].fd, "ERROR");
                break;
            }
-       } else if(strncmp(amidxtaped_line, "MESSAGE ", 8) == 0) {
+       } else if(strncmp_const(amidxtaped_line, "MESSAGE ") == 0) {
            printf("%s\n",&amidxtaped_line[8]);
        } else {
            fprintf(stderr, "Strange message from tape server: %s",
@@ -2216,7 +2221,7 @@ extract_files(void)
        /* connect to the tape handler daemon on the tape drive server */
        if ((extract_files_setup(elist->tape, elist->fileno)) == -1)
        {
-           fprintf(stderr, "amrecover - can't talk to tape server\n");
+           fprintf(stderr, "amrecover - can't talk to tape server: %s\n",errstr);
            return;
        }
 
@@ -2247,13 +2252,13 @@ amidxtaped_response(
     assert(sech != NULL);
     memset(ports, -1, SIZEOF(ports));
 
-    security_close_connection(sech, dump_hostname);
     if (pkt == NULL) {
        errstr = newvstralloc(errstr, "[request failed: ",
                             security_geterror(sech), "]", NULL);
        *response_error = 1;
        return;
     }
+    security_close_connection(sech, dump_hostname);
 
     if (pkt->type == P_NAK) {
 #if defined(PACKET_DEBUG)
@@ -2355,10 +2360,8 @@ bad_nak:
 /*
            while((p = strchr(tok, ';')) != NULL) {
                *p++ = '\0';
-#define sc "features="
-               if(strncmp(tok, sc, sizeof(sc)-1) == 0) {
-                   tok += sizeof(sc) - 1;
-#undef sc
+               if(strncmp_const(tok, "features=") == 0) {
+                   tok += sizeof("features=") - 1;
                    am_release_feature_set(their_features);
                    if((their_features = am_string_to_feature(tok)) == NULL) {
                        errstr = newvstralloc(errstr,
@@ -2551,10 +2554,10 @@ amidxtaped_client_get_security_conf(
        return(NULL);
 
     if(strcmp(string, "auth")==0) {
-       return(client_getconf_str(CLN_AUTH));
+       return(getconf_str(CNF_AUTH));
     }
     if(strcmp(string, "ssh_keys")==0) {
-       return(client_getconf_str(CLN_SSH_KEYS));
+       return(getconf_str(CNF_SSH_KEYS));
     }
     return(NULL);
 }
index c460d380d90d9a8433e7324b28bec5176c72354e..194e88d9243f9e7dc640d5cfbe48f562c8d7e903 100644 (file)
@@ -24,7 +24,7 @@
  * file named AUTHORS, in the root directory of this distribution.
  */
 /*
- * $Id: set_commands.c,v 1.26.2.1 2006/12/22 15:10:27 martinea Exp $
+ * $Id: set_commands.c,v 1.26 2006/07/05 13:14:58 martinea Exp $
  *
  * implements the "set" commands in amrecover
  */
@@ -82,9 +82,10 @@ set_host(
     const char *host)
 {
     char *cmd = NULL;
-    struct hostent *hp;
+    struct hostent *hp = NULL;
     char **hostp;
     int found_host = 0;
+    char *uqhost = unquote_string(host);
 
     if (is_extract_list_nonempty())
     {
@@ -92,48 +93,89 @@ set_host(
        return;
     }
 
-    cmd = stralloc2("HOST ", host);
+    /*
+     * The idea here is to try as many permutations of the hostname
+     * as we can imagine.  The server will reject anything it doesn't
+     * recognize.
+     */
+
+    cmd = stralloc2("HOST ", uqhost);
     if (converse(cmd) == -1)
        exit(1);
     if (server_happy())
-    {
        found_host = 1;
-    }
-    else
-    {
-       /*
-        * Try converting the given host to a fully qualified name
-        * and then try each of the aliases.
-        */
-       if ((hp = gethostbyname(host)) != NULL) {
+
+    /*
+     * Try converting the given host to a fully qualified, canonical
+     * name.
+     */
+    if (!found_host) {
+       if ((hp = gethostbyname(uqhost)) != NULL) {
            host = hp->h_name;
            printf("Trying host %s ...\n", host);
            cmd = newstralloc2(cmd, "HOST ", host);
            if (converse(cmd) == -1)
                exit(1);
            if(server_happy())
-           {
                found_host = 1;
-           }
-           else
+       }
+    }
+
+    /*
+     * Since we have them, try any CNAMEs that were traversed from uqhost
+     * to the canonical name (this assumes gethostbyname was called above)
+     */
+    if (!found_host) {
+       if (hp) {
+           for (hostp = hp->h_aliases; (host = *hostp) != NULL; hostp++)
            {
-               for (hostp = hp->h_aliases; (host = *hostp) != NULL; hostp++)
-               {
-                   printf("Trying host %s ...\n", host);
-                   cmd = newstralloc2(cmd, "HOST ", host);
-                   if (converse(cmd) == -1)
-                       exit(1);
-                   if(server_happy())
-                   {
-                       found_host = 1;
-                       break;
-                   }
+               printf(_("Trying host %s ...\n"), host);
+               cmd = newstralloc2(cmd, "HOST ", host);
+               if (converse(cmd) == -1)
+                   exit(1);
+               if(server_happy())
+               {
+                   found_host = 1;
+                   break;
                }
            }
        }
     }
-    if(found_host)
-    {
+
+    /*
+     * gethostbyname() will not return a canonical name for a host with no
+     * IPv4 addresses, so use getaddrinfo() (if supported)
+     */
+#ifdef WORKING_IPV6
+    if (!found_host) {
+       struct addrinfo hints;
+       struct addrinfo *gaires = NULL;
+       int res;
+
+       hints.ai_flags = AI_CANONNAME;
+       hints.ai_family = AF_UNSPEC;
+       hints.ai_socktype = 0;
+       hints.ai_protocol = 0;
+       hints.ai_addrlen = 0;
+       hints.ai_addr = NULL;
+       hints.ai_canonname = NULL;
+       hints.ai_next = NULL;
+       if ((res = getaddrinfo(uqhost, NULL, &hints, &gaires)) == 0) {
+           if (gaires && (host = gaires->ai_canonname)) {
+               printf(_("Trying host %s ...\n"), host);
+               cmd = newstralloc2(cmd, "HOST ", host);
+               if (converse(cmd) == -1)
+                   exit(1);
+               if(server_happy())
+                   found_host = 1;
+           }
+       }
+
+       if (gaires) freeaddrinfo(gaires);
+    }
+#endif
+
+    if(found_host) {
        dump_hostname = newstralloc(dump_hostname, host);
        amfree(disk_name);
        amfree(mount_point);
@@ -141,6 +183,7 @@ set_host(
        clear_dir_list();
     }
     amfree(cmd);
+    amfree(uqhost);
 }
 
 void
@@ -161,6 +204,8 @@ set_disk(
 {
     char *cmd = NULL;
     char *qdsk;
+    char *uqdsk;
+    char *uqmtpt = NULL;
 
     if (is_extract_list_nonempty())
     {
@@ -169,14 +214,18 @@ set_disk(
     }
 
     /* if mount point specified, check it is valid */
-    if ((mtpt != NULL) && (*mtpt != '/'))
-    {
-       printf("Mount point \"%s\" invalid - must start with /\n", mtpt);
-       return;
+    if (mtpt != NULL) {
+       uqmtpt = unquote_string(mtpt);
+       if (*mtpt != '/') {
+           printf("Mount point \"%s\" invalid - must start with /\n", uqmtpt);
+           amfree(uqmtpt);
+           return;
+       }
     }
 
     clear_dir_list();
-    qdsk = quote_string(dsk);
+    uqdsk = unquote_string(dsk);
+    qdsk = quote_string(uqdsk);
     cmd = stralloc2("DISK ", qdsk);
     amfree(qdsk);
     if (converse(cmd) == -1)
@@ -186,14 +235,14 @@ set_disk(
     if (!server_happy())
        return;
 
-    disk_name = newstralloc(disk_name, dsk);
+    disk_name = newstralloc(disk_name, uqdsk);
     if (mtpt == NULL)
     {
        /* mount point not specified */
-       if (*dsk == '/')
+       if (*uqdsk == '/')
        {
            /* disk specified by mount point, hence use it */
-           mount_point = newstralloc(mount_point, dsk);
+           mount_point = newstralloc(mount_point, uqdsk);
        }
        else
        {
@@ -204,7 +253,7 @@ set_disk(
     else
     {
        /* mount point specified */
-       mount_point = newstralloc(mount_point, mtpt);
+       mount_point = newstralloc(mount_point, uqmtpt);
     }
 
     /* set the working directory to the mount point */
@@ -226,6 +275,8 @@ set_disk(
        disk_path = newstralloc(disk_path, "/");        /* fake it */
        clear_dir_list();
     }
+    amfree(uqmtpt);
+    amfree(uqdsk);
 }
 
 void
@@ -233,11 +284,13 @@ list_disk(
     char *     amdevice)
 {
     char *cmd = NULL;
-    char *qamdevice;
+    char *qamdevice, *uqamdevice;
 
     if(amdevice) {
-       qamdevice = quote_string(amdevice);
+       uqamdevice = unquote_string(amdevice);
+       qamdevice = quote_string(uqamdevice);
        cmd = stralloc2("LISTDISK ", qamdevice);
+       amfree(uqamdevice);
        amfree(qamdevice);
        if (converse(cmd) == -1)
            exit(1);
@@ -251,6 +304,17 @@ list_disk(
     }
 }
 
+void
+local_cd(
+    char *dir)
+{
+    char *uqdir = unquote_string(dir);
+    if (chdir(uqdir) == -1) {
+       perror(uqdir);
+    }
+    amfree(uqdir);
+}
+
 void
 cd_glob(
     char *     glob)
@@ -258,6 +322,7 @@ cd_glob(
     char *regex;
     char *regex_path;
     char *s;
+    char *uqglob;
 
     char *path_on_disk = NULL;
 
@@ -266,8 +331,9 @@ cd_glob(
        return;
     }
 
-    regex = glob_to_regex(glob);
-    dbprintf(("cd_glob (%s) -> %s\n", glob, regex));
+    uqglob = unquote_string(glob);
+    regex = glob_to_regex(uqglob);
+    dbprintf(("cd_glob (%s) -> %s\n", uqglob, regex));
     if ((s = validate_regexp(regex)) != NULL) {
         printf("\"%s\" is not a valid shell wildcard pattern: ", glob);
         puts(s);
@@ -296,10 +362,11 @@ cd_glob(
         amfree(clean_disk_path);
     }
 
-    cd_dir(path_on_disk, glob);
+    cd_dir(path_on_disk, uqglob);
 
     amfree(regex_path);
     amfree(path_on_disk);
+    amfree(uqglob);
 }
 
 void
@@ -307,6 +374,7 @@ cd_regex(
     char *     regex)
 {
     char *s;
+    char *uqregex;
 
     char *path_on_disk = NULL;
 
@@ -315,8 +383,10 @@ cd_regex(
        return;
     }
 
-    if ((s = validate_regexp(regex)) != NULL) {
-       printf("\"%s\" is not a valid regular expression: ", regex);
+    uqregex = unquote_string(regex);
+    if ((s = validate_regexp(uqregex)) != NULL) {
+       printf("\"%s\" is not a valid regular expression: ", uqregex);
+       amfree(uqregex);
        puts(s);
        return;
     }
@@ -330,9 +400,10 @@ cd_regex(
         amfree(clean_disk_path);
     }
 
-    cd_dir(path_on_disk, regex);
+    cd_dir(path_on_disk, uqregex);
 
     amfree(path_on_disk);
+    amfree(uqregex);
 }
 
 void
@@ -342,6 +413,7 @@ cd_dir(
 {
     char *path_on_disk_slash = NULL;
     char *dir = NULL;
+    char *s;
 
     int nb_found;
     size_t i;
@@ -349,14 +421,21 @@ cd_dir(
     DIR_ITEM *ditem;
 
     path_on_disk_slash = stralloc2(path_on_disk, "/");
+    if ((s = validate_regexp(path_on_disk_slash)) != NULL) {
+       amfree(path_on_disk_slash);
+    }
+
+    if ((s = validate_regexp(path_on_disk)) != NULL) {
+       path_on_disk = NULL;
+    }
 
     nb_found = 0;
 
     for (ditem=get_dir_list(); ditem!=NULL && nb_found <= 1; 
                               ditem=get_next_dir_item(ditem))
     {
-       if (match(path_on_disk, ditem->path)
-           || match(path_on_disk_slash, ditem->path))
+       if ((path_on_disk && match(path_on_disk, ditem->path))
+           || (path_on_disk_slash && match(path_on_disk_slash, ditem->path)))
        {
            i = strlen(ditem->path);
            if((i > 0 && ditem->path[i-1] == '/')
@@ -542,21 +621,22 @@ void
 set_tape(
     char *     tape)
 {
-    char *tapedev = strchr(tape, ':');
+    char *uqtape = unquote_string(tape);
+    char *tapedev = strchr(uqtape, ':');
 
     if (tapedev)
     {
-       if (tapedev != tape) {
+       if (tapedev != uqtape) {
            if((strchr(tapedev+1, ':') == NULL) &&
-              (strncmp(tape, "null:", 5) == 0 ||
-               strncmp(tape, "rait:", 5) == 0 ||
-               strncmp(tape, "file:", 5) == 0 ||
-               strncmp(tape, "tape:", 5) == 0)) {
-               tapedev = tape;
+              (strncmp(uqtape, "null:", 5) == 0 ||
+               strncmp(uqtape, "rait:", 5) == 0 ||
+               strncmp(uqtape, "file:", 5) == 0 ||
+               strncmp(uqtape, "tape:", 5) == 0)) {
+               tapedev = uqtape;
            }
            else {
                *tapedev = '\0';
-               tape_server_name = newstralloc(tape_server_name, tape);
+               tape_server_name = newstralloc(tape_server_name, uqtape);
                ++tapedev;
            }
        } else { /* reset server_name if start with : */
@@ -564,7 +644,7 @@ set_tape(
            ++tapedev;
        }
     } else
-       tapedev = tape;
+       tapedev = uqtape;
     
     if (tapedev[0])
     {
index c7c39eff4d8ed5a1916ad432be8bcf3ad49ca4b9..9a2010a2923fd9fdc10437d41812d6757d280b3e 100644 (file)
@@ -1,7 +1,9 @@
-/* A Bison parser, made by GNU Bison 2.1.  */
+/* A Bison parser, made by GNU Bison 2.3.  */
 
-/* Skeleton parser for Yacc-like parsing with Bison,
-   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+/* Skeleton implementation for Bison's Yacc-like parsers in C
+
+   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+   Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    Foundation, Inc., 51 Franklin Street, Fifth Floor,
    Boston, MA 02110-1301, USA.  */
 
-/* As a special exception, when this file is copied by Bison into a
-   Bison output file, you may use that output file without restriction.
-   This special exception was added by the Free Software Foundation
-   in version 1.24 of Bison.  */
+/* As a special exception, you may create a larger work that contains
+   part or all of the Bison parser skeleton and distribute that work
+   under terms of your choice, so long as that work isn't itself a
+   parser generator using the skeleton or a modified version thereof
+   as a parser skeleton.  Alternatively, if you modify or redistribute
+   the parser skeleton itself, you may (at your option) remove this
+   special exception, which will cause the skeleton and the resulting
+   Bison output files to be licensed under the GNU General Public
+   License without this special exception.
+
+   This special exception was added by the Free Software Foundation in
+   version 2.2 of Bison.  */
 
-/* Written by Richard Stallman by simplifying the original so called
-   ``semantic'' parser.  */
+/* C LALR(1) parser skeleton written by Richard Stallman, by
+   simplifying the original so-called "semantic" parser.  */
 
 /* All symbols defined below should begin with yy or YY, to avoid
    infringing on user name space.  This should be done even for local
@@ -37,7 +47,7 @@
 #define YYBISON 1
 
 /* Bison version.  */
-#define YYBISON_VERSION "2.1"
+#define YYBISON_VERSION "2.3"
 
 /* Skeleton name.  */
 #define YYSKELETON_NAME "yacc.c"
@@ -149,16 +159,18 @@ extern char *     yytext;
 # define YYTOKEN_TABLE 0
 #endif
 
-#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+typedef union YYSTYPE
 #line 42 "uparse.y"
-typedef union YYSTYPE {
+{
        int     intval;
        double  floatval;
        char *  strval;
        int     subtok;
-} YYSTYPE;
-/* Line 196 of yacc.c.  */
-#line 162 "uparse.c"
+}
+/* Line 187 of yacc.c.  */
+#line 173 "uparse.c"
+       YYSTYPE;
 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
 # define YYSTYPE_IS_DECLARED 1
 # define YYSTYPE_IS_TRIVIAL 1
@@ -169,23 +181,56 @@ typedef union YYSTYPE {
 /* Copy the second part of user declarations.  */
 
 
-/* Line 219 of yacc.c.  */
-#line 174 "uparse.c"
+/* Line 216 of yacc.c.  */
+#line 186 "uparse.c"
 
-#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
-# define YYSIZE_T __SIZE_TYPE__
+#ifdef short
+# undef short
 #endif
-#if ! defined (YYSIZE_T) && defined (size_t)
-# define YYSIZE_T size_t
+
+#ifdef YYTYPE_UINT8
+typedef YYTYPE_UINT8 yytype_uint8;
+#else
+typedef unsigned char yytype_uint8;
 #endif
-#if ! defined (YYSIZE_T) && (defined (__STDC__) || defined (__cplusplus))
-# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
-# define YYSIZE_T size_t
+
+#ifdef YYTYPE_INT8
+typedef YYTYPE_INT8 yytype_int8;
+#elif (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+typedef signed char yytype_int8;
+#else
+typedef short int yytype_int8;
+#endif
+
+#ifdef YYTYPE_UINT16
+typedef YYTYPE_UINT16 yytype_uint16;
+#else
+typedef unsigned short int yytype_uint16;
+#endif
+
+#ifdef YYTYPE_INT16
+typedef YYTYPE_INT16 yytype_int16;
+#else
+typedef short int yytype_int16;
 #endif
-#if ! defined (YYSIZE_T)
-# define YYSIZE_T unsigned int
+
+#ifndef YYSIZE_T
+# ifdef __SIZE_TYPE__
+#  define YYSIZE_T __SIZE_TYPE__
+# elif defined size_t
+#  define YYSIZE_T size_t
+# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
+#  define YYSIZE_T size_t
+# else
+#  define YYSIZE_T unsigned int
+# endif
 #endif
 
+#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
+
 #ifndef YY_
 # if YYENABLE_NLS
 #  if ENABLE_NLS
@@ -198,7 +243,32 @@ typedef union YYSTYPE {
 # endif
 #endif
 
-#if ! defined (yyoverflow) || YYERROR_VERBOSE
+/* Suppress unused-variable warnings by "using" E.  */
+#if ! defined lint || defined __GNUC__
+# define YYUSE(e) ((void) (e))
+#else
+# define YYUSE(e) /* empty */
+#endif
+
+/* Identity function, used to suppress warnings about constant conditions.  */
+#ifndef lint
+# define YYID(n) (n)
+#else
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static int
+YYID (int i)
+#else
+static int
+YYID (i)
+    int i;
+#endif
+{
+  return i;
+}
+#endif
+
+#if ! defined yyoverflow || YYERROR_VERBOSE
 
 /* The parser invokes alloca or malloc; define the necessary symbols.  */
 
@@ -206,64 +276,76 @@ typedef union YYSTYPE {
 #  if YYSTACK_USE_ALLOCA
 #   ifdef __GNUC__
 #    define YYSTACK_ALLOC __builtin_alloca
+#   elif defined __BUILTIN_VA_ARG_INCR
+#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
+#   elif defined _AIX
+#    define YYSTACK_ALLOC __alloca
+#   elif defined _MSC_VER
+#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
+#    define alloca _alloca
 #   else
 #    define YYSTACK_ALLOC alloca
-#    if defined (__STDC__) || defined (__cplusplus)
+#    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
 #     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-#     define YYINCLUDED_STDLIB_H
+#     ifndef _STDLIB_H
+#      define _STDLIB_H 1
+#     endif
 #    endif
 #   endif
 #  endif
 # endif
 
 # ifdef YYSTACK_ALLOC
-   /* Pacify GCC's `empty if-body' warning. */
-#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
+   /* Pacify GCC's `empty if-body' warning.  */
+#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
 #  ifndef YYSTACK_ALLOC_MAXIMUM
     /* The OS might guarantee only one guard page at the bottom of the stack,
        and a page size can be as small as 4096 bytes.  So we cannot safely
        invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
        to allow for a few compiler-allocated temporary stack slots.  */
-#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2005 */
+#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
 #  endif
 # else
 #  define YYSTACK_ALLOC YYMALLOC
 #  define YYSTACK_FREE YYFREE
 #  ifndef YYSTACK_ALLOC_MAXIMUM
-#   define YYSTACK_ALLOC_MAXIMUM ((YYSIZE_T) -1)
+#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
 #  endif
-#  ifdef __cplusplus
-extern "C" {
+#  if (defined __cplusplus && ! defined _STDLIB_H \
+       && ! ((defined YYMALLOC || defined malloc) \
+            && (defined YYFREE || defined free)))
+#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+#   ifndef _STDLIB_H
+#    define _STDLIB_H 1
+#   endif
 #  endif
 #  ifndef YYMALLOC
 #   define YYMALLOC malloc
-#   if (! defined (malloc) && ! defined (YYINCLUDED_STDLIB_H) \
-       && (defined (__STDC__) || defined (__cplusplus)))
+#   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
 void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
 #   endif
 #  endif
 #  ifndef YYFREE
 #   define YYFREE free
-#   if (! defined (free) && ! defined (YYINCLUDED_STDLIB_H) \
-       && (defined (__STDC__) || defined (__cplusplus)))
+#   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
 void free (void *); /* INFRINGES ON USER NAME SPACE */
 #   endif
 #  endif
-#  ifdef __cplusplus
-}
-#  endif
 # endif
-#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
+#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
 
 
-#if (! defined (yyoverflow) \
-     && (! defined (__cplusplus) \
-        || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
+#if (! defined yyoverflow \
+     && (! defined __cplusplus \
+        || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
 
 /* A type that is properly aligned for any stack member.  */
 union yyalloc
 {
-  short int yyss;
+  yytype_int16 yyss;
   YYSTYPE yyvs;
   };
 
@@ -273,13 +355,13 @@ union yyalloc
 /* The size of an array large to enough to hold all stacks, each with
    N elements.  */
 # define YYSTACK_BYTES(N) \
-     ((N) * (sizeof (short int) + sizeof (YYSTYPE))                    \
+     ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
       + YYSTACK_GAP_MAXIMUM)
 
 /* Copy COUNT objects from FROM to TO.  The source and destination do
    not overlap.  */
 # ifndef YYCOPY
-#  if defined (__GNUC__) && 1 < __GNUC__
+#  if defined __GNUC__ && 1 < __GNUC__
 #   define YYCOPY(To, From, Count) \
       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
 #  else
@@ -290,7 +372,7 @@ union yyalloc
          for (yyi = 0; yyi < (Count); yyi++)   \
            (To)[yyi] = (From)[yyi];            \
        }                                       \
-      while (0)
+      while (YYID (0))
 #  endif
 # endif
 
@@ -308,28 +390,22 @@ union yyalloc
        yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
        yyptr += yynewbytes / sizeof (*yyptr);                          \
       }                                                                        \
-    while (0)
+    while (YYID (0))
 
 #endif
 
-#if defined (__STDC__) || defined (__cplusplus)
-   typedef signed char yysigned_char;
-#else
-   typedef short int yysigned_char;
-#endif
-
-/* YYFINAL -- State number of the termination state. */
+/* YYFINAL -- State number of the termination state.  */
 #define YYFINAL  55
 /* YYLAST -- Last index in YYTABLE.  */
 #define YYLAST   45
 
-/* YYNTOKENS -- Number of terminals. */
+/* YYNTOKENS -- Number of terminals.  */
 #define YYNTOKENS  31
-/* YYNNTS -- Number of nonterminals. */
+/* YYNNTS -- Number of nonterminals.  */
 #define YYNNTS  16
-/* YYNRULES -- Number of rules. */
+/* YYNRULES -- Number of rules.  */
 #define YYNRULES  49
-/* YYNRULES -- Number of states. */
+/* YYNRULES -- Number of states.  */
 #define YYNSTATES  61
 
 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
@@ -340,7 +416,7 @@ union yyalloc
   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
 
 /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
-static const unsigned char yytranslate[] =
+static const yytype_uint8 yytranslate[] =
 {
        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
@@ -376,7 +452,7 @@ static const unsigned char yytranslate[] =
 #if YYDEBUG
 /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
    YYRHS.  */
-static const unsigned char yyprhs[] =
+static const yytype_uint8 yyprhs[] =
 {
        0,     0,     3,     5,     7,     9,    11,    13,    15,    17,
       19,    21,    23,    24,    26,    29,    31,    34,    37,    41,
@@ -385,8 +461,8 @@ static const unsigned char yyprhs[] =
       94,    97,   100,   102,   105,   108,   110,   112,   115,   117
 };
 
-/* YYRHS -- A `-1'-separated list of the rules' RHS. */
-static const yysigned_char yyrhs[] =
+/* YYRHS -- A `-1'-separated list of the rules' RHS.  */
+static const yytype_int8 yyrhs[] =
 {
       32,     0,    -1,    33,    -1,    34,    -1,    35,    -1,    36,
       -1,    38,    -1,    40,    -1,    42,    -1,    44,    -1,    45,
@@ -403,19 +479,19 @@ static const yysigned_char yyrhs[] =
 };
 
 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
-static const unsigned char yyrline[] =
+static const yytype_uint8 yyrline[] =
 {
        0,    65,    65,    66,    67,    68,    69,    70,    71,    72,
       73,    74,    75,    84,    85,    86,    87,    88,    89,    90,
       91,    92,    93,    94,    95,   100,   108,   109,   110,   111,
      112,   113,   114,   118,   122,   126,   127,   131,   135,   136,
-     140,   144,   145,   149,   153,   154,   158,   159,   168,   172
+     140,   144,   145,   149,   153,   154,   158,   159,   166,   170
 };
 #endif
 
 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
-   First, the terminals, then, starting at YYNTOKENS, nonterminals. */
+   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
 static const char *const yytname[] =
 {
   "$end", "error", "$undefined", "LISTHOST", "LISTDISK", "SETHOST",
@@ -432,7 +508,7 @@ static const char *const yytname[] =
 # ifdef YYPRINT
 /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
    token YYLEX-NUM.  */
-static const unsigned short int yytoknum[] =
+static const yytype_uint16 yytoknum[] =
 {
        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
      265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
@@ -442,7 +518,7 @@ static const unsigned short int yytoknum[] =
 # endif
 
 /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
-static const unsigned char yyr1[] =
+static const yytype_uint8 yyr1[] =
 {
        0,    31,    32,    32,    32,    32,    32,    32,    32,    32,
       32,    32,    32,    33,    33,    33,    33,    33,    33,    33,
@@ -452,7 +528,7 @@ static const unsigned char yyr1[] =
 };
 
 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
-static const unsigned char yyr2[] =
+static const yytype_uint8 yyr2[] =
 {
        0,     2,     1,     1,     1,     1,     1,     1,     1,     1,
        1,     1,     0,     1,     2,     1,     2,     2,     3,     2,
@@ -464,7 +540,7 @@ static const unsigned char yyr2[] =
 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
    STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
    means the default is an error.  */
-static const unsigned char yydefact[] =
+static const yytype_uint8 yydefact[] =
 {
       12,    13,    15,     0,     0,     0,    21,     0,     0,     0,
       33,    26,    27,     0,     0,    49,    29,     0,     0,    30,
@@ -475,8 +551,8 @@ static const unsigned char yydefact[] =
       44
 };
 
-/* YYDEFGOTO[NTERM-NUM]. */
-static const yysigned_char yydefgoto[] =
+/* YYDEFGOTO[NTERM-NUM].  */
+static const yytype_int8 yydefgoto[] =
 {
       -1,    25,    26,    27,    28,    29,    46,    30,    48,    31,
       51,    32,    53,    33,    34,    35
@@ -485,7 +561,7 @@ static const yysigned_char yydefgoto[] =
 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
    STATE-NUM.  */
 #define YYPACT_NINF -6
-static const yysigned_char yypact[] =
+static const yytype_int8 yypact[] =
 {
       -3,    -6,    -5,    -1,     0,     1,     3,    -2,     4,     5,
       -6,    -6,    -6,     6,     7,    -6,     8,     9,    10,    -6,
@@ -497,7 +573,7 @@ static const yysigned_char yypact[] =
 };
 
 /* YYPGOTO[NTERM-NUM].  */
-static const yysigned_char yypgoto[] =
+static const yytype_int8 yypgoto[] =
 {
       -6,    -6,    -6,    -6,    -6,    -6,    -6,    -6,    -6,    -6,
       -6,    -6,    -6,    -6,    -6,    -6
@@ -508,7 +584,7 @@ static const yysigned_char yypgoto[] =
    number is the opposite.  If zero, do what YYDEFACT says.
    If YYTABLE_NINF, syntax error.  */
 #define YYTABLE_NINF -1
-static const unsigned char yytable[] =
+static const yytype_uint8 yytable[] =
 {
        1,     2,     3,     4,     5,     6,     7,     8,     9,    10,
       11,    12,    13,    14,    15,    16,    17,    18,    19,    20,
@@ -517,7 +593,7 @@ static const unsigned char yytable[] =
       54,    56,    57,    58,    59,    60
 };
 
-static const yysigned_char yycheck[] =
+static const yytype_int8 yycheck[] =
 {
        3,     4,     5,     6,     7,     8,     9,    10,    11,    12,
       13,    14,    15,    16,    17,    18,    19,    20,    21,    22,
@@ -528,7 +604,7 @@ static const yysigned_char yycheck[] =
 
 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
    symbol of state STATE-NUM.  */
-static const unsigned char yystos[] =
+static const yytype_uint8 yystos[] =
 {
        0,     3,     4,     5,     6,     7,     8,     9,    10,    11,
       12,    13,    14,    15,    16,    17,    18,    19,    20,    21,
@@ -564,7 +640,7 @@ do                                                          \
       yychar = (Token);                                                \
       yylval = (Value);                                                \
       yytoken = YYTRANSLATE (yychar);                          \
-      YYPOPSTACK;                                              \
+      YYPOPSTACK (1);                                          \
       goto yybackup;                                           \
     }                                                          \
   else                                                         \
@@ -572,7 +648,7 @@ do                                                          \
       yyerror (YY_("syntax error: cannot back up")); \
       YYERROR;                                                 \
     }                                                          \
-while (0)
+while (YYID (0))
 
 
 #define YYTERROR       1
@@ -587,7 +663,7 @@ while (0)
 #ifndef YYLLOC_DEFAULT
 # define YYLLOC_DEFAULT(Current, Rhs, N)                               \
     do                                                                 \
-      if (N)                                                           \
+      if (YYID (N))                                                    \
        {                                                               \
          (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;        \
          (Current).first_column = YYRHSLOC (Rhs, 1).first_column;      \
@@ -601,7 +677,7 @@ while (0)
          (Current).first_column = (Current).last_column =              \
            YYRHSLOC (Rhs, 0).last_column;                              \
        }                                                               \
-    while (0)
+    while (YYID (0))
 #endif
 
 
@@ -613,8 +689,8 @@ while (0)
 # if YYLTYPE_IS_TRIVIAL
 #  define YY_LOCATION_PRINT(File, Loc)                 \
      fprintf (File, "%d.%d-%d.%d",                     \
-              (Loc).first_line, (Loc).first_column,    \
-              (Loc).last_line,  (Loc).last_column)
+             (Loc).first_line, (Loc).first_column,     \
+             (Loc).last_line,  (Loc).last_column)
 # else
 #  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
 # endif
@@ -641,36 +717,96 @@ while (0)
 do {                                           \
   if (yydebug)                                 \
     YYFPRINTF Args;                            \
-} while (0)
+} while (YYID (0))
 
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location)         \
-do {                                                           \
-  if (yydebug)                                                 \
-    {                                                          \
-      YYFPRINTF (stderr, "%s ", Title);                                \
-      yysymprint (stderr,                                      \
-                  Type, Value);        \
-      YYFPRINTF (stderr, "\n");                                        \
-    }                                                          \
-} while (0)
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location)                   \
+do {                                                                     \
+  if (yydebug)                                                           \
+    {                                                                    \
+      YYFPRINTF (stderr, "%s ", Title);                                          \
+      yy_symbol_print (stderr,                                           \
+                 Type, Value); \
+      YYFPRINTF (stderr, "\n");                                                  \
+    }                                                                    \
+} while (YYID (0))
+
+
+/*--------------------------------.
+| Print this symbol on YYOUTPUT.  |
+`--------------------------------*/
+
+/*ARGSUSED*/
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static void
+yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
+#else
+static void
+yy_symbol_value_print (yyoutput, yytype, yyvaluep)
+    FILE *yyoutput;
+    int yytype;
+    YYSTYPE const * const yyvaluep;
+#endif
+{
+  if (!yyvaluep)
+    return;
+# ifdef YYPRINT
+  if (yytype < YYNTOKENS)
+    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
+# else
+  YYUSE (yyoutput);
+# endif
+  switch (yytype)
+    {
+      default:
+       break;
+    }
+}
+
+
+/*--------------------------------.
+| Print this symbol on YYOUTPUT.  |
+`--------------------------------*/
+
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static void
+yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
+#else
+static void
+yy_symbol_print (yyoutput, yytype, yyvaluep)
+    FILE *yyoutput;
+    int yytype;
+    YYSTYPE const * const yyvaluep;
+#endif
+{
+  if (yytype < YYNTOKENS)
+    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
+  else
+    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
+
+  yy_symbol_value_print (yyoutput, yytype, yyvaluep);
+  YYFPRINTF (yyoutput, ")");
+}
 
 /*------------------------------------------------------------------.
 | yy_stack_print -- Print the state stack from its BOTTOM up to its |
 | TOP (included).                                                   |
 `------------------------------------------------------------------*/
 
-#if defined (__STDC__) || defined (__cplusplus)
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
 static void
-yy_stack_print (short int *bottom, short int *top)
+yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
 #else
 static void
 yy_stack_print (bottom, top)
-    short int *bottom;
-    short int *top;
+    yytype_int16 *bottom;
+    yytype_int16 *top;
 #endif
 {
   YYFPRINTF (stderr, "Stack now");
-  for (/* Nothing. */; bottom <= top; ++bottom)
+  for (; bottom <= top; ++bottom)
     YYFPRINTF (stderr, " %d", *bottom);
   YYFPRINTF (stderr, "\n");
 }
@@ -679,37 +815,45 @@ yy_stack_print (bottom, top)
 do {                                                           \
   if (yydebug)                                                 \
     yy_stack_print ((Bottom), (Top));                          \
-} while (0)
+} while (YYID (0))
 
 
 /*------------------------------------------------.
 | Report that the YYRULE is going to be reduced.  |
 `------------------------------------------------*/
 
-#if defined (__STDC__) || defined (__cplusplus)
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
 static void
-yy_reduce_print (int yyrule)
+yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
 #else
 static void
-yy_reduce_print (yyrule)
+yy_reduce_print (yyvsp, yyrule)
+    YYSTYPE *yyvsp;
     int yyrule;
 #endif
 {
+  int yynrhs = yyr2[yyrule];
   int yyi;
   unsigned long int yylno = yyrline[yyrule];
-  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu), ",
-             yyrule - 1, yylno);
-  /* Print the symbols being reduced, and their result.  */
-  for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
-    YYFPRINTF (stderr, "%s ", yytname[yyrhs[yyi]]);
-  YYFPRINTF (stderr, "-> %s\n", yytname[yyr1[yyrule]]);
+  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
+            yyrule - 1, yylno);
+  /* The symbols being reduced.  */
+  for (yyi = 0; yyi < yynrhs; yyi++)
+    {
+      fprintf (stderr, "   $%d = ", yyi + 1);
+      yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
+                      &(yyvsp[(yyi + 1) - (yynrhs)])
+                                      );
+      fprintf (stderr, "\n");
+    }
 }
 
 # define YY_REDUCE_PRINT(Rule)         \
 do {                                   \
   if (yydebug)                         \
-    yy_reduce_print (Rule);            \
-} while (0)
+    yy_reduce_print (yyvsp, Rule); \
+} while (YYID (0))
 
 /* Nonzero means print parse trace.  It is left uninitialized so that
    multiple parsers can coexist.  */
@@ -743,42 +887,44 @@ int yydebug;
 #if YYERROR_VERBOSE
 
 # ifndef yystrlen
-#  if defined (__GLIBC__) && defined (_STRING_H)
+#  if defined __GLIBC__ && defined _STRING_H
 #   define yystrlen strlen
 #  else
 /* Return the length of YYSTR.  */
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
 static YYSIZE_T
-#   if defined (__STDC__) || defined (__cplusplus)
 yystrlen (const char *yystr)
-#   else
+#else
+static YYSIZE_T
 yystrlen (yystr)
-     const char *yystr;
-#   endif
+    const char *yystr;
+#endif
 {
-  const char *yys = yystr;
-
-  while (*yys++ != '\0')
+  YYSIZE_T yylen;
+  for (yylen = 0; yystr[yylen]; yylen++)
     continue;
-
-  return yys - yystr - 1;
+  return yylen;
 }
 #  endif
 # endif
 
 # ifndef yystpcpy
-#  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
+#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
 #   define yystpcpy stpcpy
 #  else
 /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
    YYDEST.  */
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
 static char *
-#   if defined (__STDC__) || defined (__cplusplus)
 yystpcpy (char *yydest, const char *yysrc)
-#   else
+#else
+static char *
 yystpcpy (yydest, yysrc)
-     char *yydest;
-     const char *yysrc;
-#   endif
+    char *yydest;
+    const char *yysrc;
+#endif
 {
   char *yyd = yydest;
   const char *yys = yysrc;
@@ -804,7 +950,7 @@ yytnamerr (char *yyres, const char *yystr)
 {
   if (*yystr == '"')
     {
-      size_t yyn = 0;
+      YYSIZE_T yyn = 0;
       char const *yyp = yystr;
 
       for (;;)
@@ -839,53 +985,123 @@ yytnamerr (char *yyres, const char *yystr)
 }
 # endif
 
-#endif /* YYERROR_VERBOSE */
-
-\f
-
-#if YYDEBUG
-/*--------------------------------.
-| Print this symbol on YYOUTPUT.  |
-`--------------------------------*/
-
-#if defined (__STDC__) || defined (__cplusplus)
-static void
-yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
-#else
-static void
-yysymprint (yyoutput, yytype, yyvaluep)
-    FILE *yyoutput;
-    int yytype;
-    YYSTYPE *yyvaluep;
-#endif
+/* Copy into YYRESULT an error message about the unexpected token
+   YYCHAR while in state YYSTATE.  Return the number of bytes copied,
+   including the terminating null byte.  If YYRESULT is null, do not
+   copy anything; just return the number of bytes that would be
+   copied.  As a special case, return 0 if an ordinary "syntax error"
+   message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
+   size calculation.  */
+static YYSIZE_T
+yysyntax_error (char *yyresult, int yystate, int yychar)
 {
-  /* Pacify ``unused variable'' warnings.  */
-  (void) yyvaluep;
+  int yyn = yypact[yystate];
 
-  if (yytype < YYNTOKENS)
-    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
+  if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
+    return 0;
   else
-    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
+    {
+      int yytype = YYTRANSLATE (yychar);
+      YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
+      YYSIZE_T yysize = yysize0;
+      YYSIZE_T yysize1;
+      int yysize_overflow = 0;
+      enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
+      char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
+      int yyx;
+
+# if 0
+      /* This is so xgettext sees the translatable formats that are
+        constructed on the fly.  */
+      YY_("syntax error, unexpected %s");
+      YY_("syntax error, unexpected %s, expecting %s");
+      YY_("syntax error, unexpected %s, expecting %s or %s");
+      YY_("syntax error, unexpected %s, expecting %s or %s or %s");
+      YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
+# endif
+      char *yyfmt;
+      char const *yyf;
+      static char const yyunexpected[] = "syntax error, unexpected %s";
+      static char const yyexpecting[] = ", expecting %s";
+      static char const yyor[] = " or %s";
+      char yyformat[sizeof yyunexpected
+                   + sizeof yyexpecting - 1
+                   + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
+                      * (sizeof yyor - 1))];
+      char const *yyprefix = yyexpecting;
+
+      /* Start YYX at -YYN if negative to avoid negative indexes in
+        YYCHECK.  */
+      int yyxbegin = yyn < 0 ? -yyn : 0;
+
+      /* Stay within bounds of both yycheck and yytname.  */
+      int yychecklim = YYLAST - yyn + 1;
+      int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
+      int yycount = 1;
+
+      yyarg[0] = yytname[yytype];
+      yyfmt = yystpcpy (yyformat, yyunexpected);
+
+      for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+       if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+         {
+           if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
+             {
+               yycount = 1;
+               yysize = yysize0;
+               yyformat[sizeof yyunexpected - 1] = '\0';
+               break;
+             }
+           yyarg[yycount++] = yytname[yyx];
+           yysize1 = yysize + yytnamerr (0, yytname[yyx]);
+           yysize_overflow |= (yysize1 < yysize);
+           yysize = yysize1;
+           yyfmt = yystpcpy (yyfmt, yyprefix);
+           yyprefix = yyor;
+         }
 
+      yyf = YY_(yyformat);
+      yysize1 = yysize + yystrlen (yyf);
+      yysize_overflow |= (yysize1 < yysize);
+      yysize = yysize1;
 
-# ifdef YYPRINT
-  if (yytype < YYNTOKENS)
-    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
-# endif
-  switch (yytype)
-    {
-      default:
-        break;
+      if (yysize_overflow)
+       return YYSIZE_MAXIMUM;
+
+      if (yyresult)
+       {
+         /* Avoid sprintf, as that infringes on the user's name space.
+            Don't have undefined behavior even if the translation
+            produced a string with the wrong number of "%s"s.  */
+         char *yyp = yyresult;
+         int yyi = 0;
+         while ((*yyp = *yyf) != '\0')
+           {
+             if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
+               {
+                 yyp += yytnamerr (yyp, yyarg[yyi++]);
+                 yyf += 2;
+               }
+             else
+               {
+                 yyp++;
+                 yyf++;
+               }
+           }
+       }
+      return yysize;
     }
-  YYFPRINTF (yyoutput, ")");
 }
+#endif /* YYERROR_VERBOSE */
+\f
 
-#endif /* ! YYDEBUG */
 /*-----------------------------------------------.
 | Release the memory associated to this symbol.  |
 `-----------------------------------------------*/
 
-#if defined (__STDC__) || defined (__cplusplus)
+/*ARGSUSED*/
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
 static void
 yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
 #else
@@ -896,8 +1112,7 @@ yydestruct (yymsg, yytype, yyvaluep)
     YYSTYPE *yyvaluep;
 #endif
 {
-  /* Pacify ``unused variable'' warnings.  */
-  (void) yyvaluep;
+  YYUSE (yyvaluep);
 
   if (!yymsg)
     yymsg = "Deleting";
@@ -907,7 +1122,7 @@ yydestruct (yymsg, yytype, yyvaluep)
     {
 
       default:
-        break;
+       break;
     }
 }
 \f
@@ -915,13 +1130,13 @@ yydestruct (yymsg, yytype, yyvaluep)
 /* Prevent warnings from -Wmissing-prototypes.  */
 
 #ifdef YYPARSE_PARAM
-# if defined (__STDC__) || defined (__cplusplus)
+#if defined __STDC__ || defined __cplusplus
 int yyparse (void *YYPARSE_PARAM);
-# else
+#else
 int yyparse ();
-# endif
+#endif
 #else /* ! YYPARSE_PARAM */
-#if defined (__STDC__) || defined (__cplusplus)
+#if defined __STDC__ || defined __cplusplus
 int yyparse (void);
 #else
 int yyparse ();
@@ -946,14 +1161,18 @@ int yynerrs;
 `----------*/
 
 #ifdef YYPARSE_PARAM
-# if defined (__STDC__) || defined (__cplusplus)
-int yyparse (void *YYPARSE_PARAM)
-# else
-int yyparse (YYPARSE_PARAM)
-  void *YYPARSE_PARAM;
-# endif
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+int
+yyparse (void *YYPARSE_PARAM)
+#else
+int
+yyparse (YYPARSE_PARAM)
+    void *YYPARSE_PARAM;
+#endif
 #else /* ! YYPARSE_PARAM */
-#if defined (__STDC__) || defined (__cplusplus)
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
 int
 yyparse (void)
 #else
@@ -971,6 +1190,12 @@ yyparse ()
   int yyerrstatus;
   /* Look-ahead token as an internal (translated) token number.  */
   int yytoken = 0;
+#if YYERROR_VERBOSE
+  /* Buffer for error messages, and its allocated size.  */
+  char yymsgbuf[128];
+  char *yymsg = yymsgbuf;
+  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
+#endif
 
   /* Three stacks and their tools:
      `yyss': related to states,
@@ -981,9 +1206,9 @@ yyparse ()
      to reallocate them elsewhere.  */
 
   /* The state stack.  */
-  short int yyssa[YYINITDEPTH];
-  short int *yyss = yyssa;
-  short int *yyssp;
+  yytype_int16 yyssa[YYINITDEPTH];
+  yytype_int16 *yyss = yyssa;
+  yytype_int16 *yyssp;
 
   /* The semantic value stack.  */
   YYSTYPE yyvsa[YYINITDEPTH];
@@ -992,7 +1217,7 @@ yyparse ()
 
 
 
-#define YYPOPSTACK   (yyvsp--, yyssp--)
+#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
 
   YYSIZE_T yystacksize = YYINITDEPTH;
 
@@ -1001,9 +1226,9 @@ yyparse ()
   YYSTYPE yyval;
 
 
-  /* When reducing, the number of symbols on the RHS of the reduced
-     rule.  */
-  int yylen;
+  /* The number of symbols on the RHS of the reduced rule.
+     Keep to zero when no symbol should be popped.  */
+  int yylen = 0;
 
   YYDPRINTF ((stderr, "Starting parse\n"));
 
@@ -1027,8 +1252,7 @@ yyparse ()
 `------------------------------------------------------------*/
  yynewstate:
   /* In all cases, when you get here, the value and location stacks
-     have just been pushed. so pushing a state here evens the stacks.
-     */
+     have just been pushed.  So pushing a state here evens the stacks.  */
   yyssp++;
 
  yysetstate:
@@ -1041,11 +1265,11 @@ yyparse ()
 
 #ifdef yyoverflow
       {
-       /* Give user a chance to reallocate the stack. Use copies of
+       /* Give user a chance to reallocate the stack.  Use copies of
           these so that the &'s don't force the real ones into
           memory.  */
        YYSTYPE *yyvs1 = yyvs;
-       short int *yyss1 = yyss;
+       yytype_int16 *yyss1 = yyss;
 
 
        /* Each stack pointer address is followed by the size of the
@@ -1073,7 +1297,7 @@ yyparse ()
        yystacksize = YYMAXDEPTH;
 
       {
-       short int *yyss1 = yyss;
+       yytype_int16 *yyss1 = yyss;
        union yyalloc *yyptr =
          (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
        if (! yyptr)
@@ -1108,12 +1332,10 @@ yyparse ()
 `-----------*/
 yybackup:
 
-/* Do appropriate processing given the current state.  */
-/* Read a look-ahead token if we need one and don't already have one.  */
-/* yyresume: */
+  /* Do appropriate processing given the current state.  Read a
+     look-ahead token if we need one and don't already have one.  */
 
   /* First try to decide what to do without reference to look-ahead token.  */
-
   yyn = yypact[yystate];
   if (yyn == YYPACT_NINF)
     goto yydefault;
@@ -1155,22 +1377,21 @@ yybackup:
   if (yyn == YYFINAL)
     YYACCEPT;
 
+  /* Count tokens shifted since error; after three, turn off error
+     status.  */
+  if (yyerrstatus)
+    yyerrstatus--;
+
   /* Shift the look-ahead token.  */
   YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
 
-  /* Discard the token being shifted unless it is eof.  */
+  /* Discard the shifted token unless it is eof.  */
   if (yychar != YYEOF)
     yychar = YYEMPTY;
 
+  yystate = yyn;
   *++yyvsp = yylval;
 
-
-  /* Count tokens shifted since error; after three, turn off error
-     status.  */
-  if (yyerrstatus)
-    yyerrstatus--;
-
-  yystate = yyn;
   goto yynewstate;
 
 
@@ -1222,7 +1443,7 @@ yyreduce:
 
   case 14:
 #line 85 "uparse.y"
-    { list_disk((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
+    { list_disk((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
     break;
 
   case 15:
@@ -1232,27 +1453,27 @@ yyreduce:
 
   case 16:
 #line 87 "uparse.y"
-    { set_date((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
+    { set_date((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
     break;
 
   case 17:
 #line 88 "uparse.y"
-    { set_host((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
+    { set_host((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
     break;
 
   case 18:
 #line 89 "uparse.y"
-    { set_disk((yyvsp[-1].strval), (yyvsp[0].strval)); amfree((yyvsp[-1].strval)); amfree((yyvsp[0].strval)); }
+    { set_disk((yyvsp[(2) - (3)].strval), (yyvsp[(3) - (3)].strval)); amfree((yyvsp[(2) - (3)].strval)); amfree((yyvsp[(3) - (3)].strval)); }
     break;
 
   case 19:
 #line 90 "uparse.y"
-    { set_disk((yyvsp[0].strval), NULL); amfree((yyvsp[0].strval)); }
+    { set_disk((yyvsp[(2) - (2)].strval), NULL); amfree((yyvsp[(2) - (2)].strval)); }
     break;
 
   case 20:
 #line 91 "uparse.y"
-    { set_tape((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
+    { set_tape((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
     break;
 
   case 21:
@@ -1262,12 +1483,12 @@ yyreduce:
 
   case 22:
 #line 93 "uparse.y"
-    { cd_glob((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
+    { cd_glob((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
     break;
 
   case 23:
 #line 94 "uparse.y"
-    { cd_regex((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
+    { cd_regex((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
     break;
 
   case 24:
@@ -1300,7 +1521,7 @@ yyreduce:
 
   case 28:
 #line 110 "uparse.y"
-    { display_extract_list((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
+    { display_extract_list((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
     break;
 
   case 29:
@@ -1330,42 +1551,42 @@ yyreduce:
 
   case 35:
 #line 126 "uparse.y"
-    { add_glob((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
+    { add_glob((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
     break;
 
   case 36:
 #line 127 "uparse.y"
-    { add_glob((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
+    { add_glob((yyvsp[(1) - (1)].strval)); amfree((yyvsp[(1) - (1)].strval)); }
     break;
 
   case 38:
 #line 135 "uparse.y"
-    { add_regex((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
+    { add_regex((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
     break;
 
   case 39:
 #line 136 "uparse.y"
-    { add_regex((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
+    { add_regex((yyvsp[(1) - (1)].strval)); amfree((yyvsp[(1) - (1)].strval)); }
     break;
 
   case 41:
 #line 144 "uparse.y"
-    { delete_glob((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
+    { delete_glob((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
     break;
 
   case 42:
 #line 145 "uparse.y"
-    { delete_glob((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
+    { delete_glob((yyvsp[(1) - (1)].strval)); amfree((yyvsp[(1) - (1)].strval)); }
     break;
 
   case 44:
 #line 153 "uparse.y"
-    { delete_regex((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
+    { delete_regex((yyvsp[(2) - (2)].strval)); amfree((yyvsp[(2) - (2)].strval)); }
     break;
 
   case 45:
 #line 154 "uparse.y"
-    { delete_regex((yyvsp[0].strval)); amfree((yyvsp[0].strval)); }
+    { delete_regex((yyvsp[(1) - (1)].strval)); amfree((yyvsp[(1) - (1)].strval)); }
     break;
 
   case 46:
@@ -1376,34 +1597,30 @@ yyreduce:
   case 47:
 #line 159 "uparse.y"
     {
-               if (chdir((yyvsp[0].strval)) == -1) {
-                       perror((yyvsp[0].strval));
-               }
-               amfree((yyvsp[0].strval));
+               local_cd((yyvsp[(2) - (2)].strval));
+               amfree((yyvsp[(2) - (2)].strval));
        }
     break;
 
   case 48:
-#line 168 "uparse.y"
+#line 166 "uparse.y"
     { help_list(); }
     break;
 
   case 49:
-#line 172 "uparse.y"
+#line 170 "uparse.y"
     { extract_files(); }
     break;
 
 
+/* Line 1267 of yacc.c.  */
+#line 1618 "uparse.c"
       default: break;
     }
+  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
 
-/* Line 1126 of yacc.c.  */
-#line 1402 "uparse.c"
-\f
-  yyvsp -= yylen;
-  yyssp -= yylen;
-
-
+  YYPOPSTACK (yylen);
+  yylen = 0;
   YY_STACK_PRINT (yyss, yyssp);
 
   *++yyvsp = yyval;
@@ -1432,110 +1649,41 @@ yyerrlab:
   if (!yyerrstatus)
     {
       ++yynerrs;
-#if YYERROR_VERBOSE
-      yyn = yypact[yystate];
-
-      if (YYPACT_NINF < yyn && yyn < YYLAST)
-       {
-         int yytype = YYTRANSLATE (yychar);
-         YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
-         YYSIZE_T yysize = yysize0;
-         YYSIZE_T yysize1;
-         int yysize_overflow = 0;
-         char *yymsg = 0;
-#        define YYERROR_VERBOSE_ARGS_MAXIMUM 5
-         char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
-         int yyx;
-
-#if 0
-         /* This is so xgettext sees the translatable formats that are
-            constructed on the fly.  */
-         YY_("syntax error, unexpected %s");
-         YY_("syntax error, unexpected %s, expecting %s");
-         YY_("syntax error, unexpected %s, expecting %s or %s");
-         YY_("syntax error, unexpected %s, expecting %s or %s or %s");
-         YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
-#endif
-         char *yyfmt;
-         char const *yyf;
-         static char const yyunexpected[] = "syntax error, unexpected %s";
-         static char const yyexpecting[] = ", expecting %s";
-         static char const yyor[] = " or %s";
-         char yyformat[sizeof yyunexpected
-                       + sizeof yyexpecting - 1
-                       + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
-                          * (sizeof yyor - 1))];
-         char const *yyprefix = yyexpecting;
-
-         /* Start YYX at -YYN if negative to avoid negative indexes in
-            YYCHECK.  */
-         int yyxbegin = yyn < 0 ? -yyn : 0;
-
-         /* Stay within bounds of both yycheck and yytname.  */
-         int yychecklim = YYLAST - yyn;
-         int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
-         int yycount = 1;
-
-         yyarg[0] = yytname[yytype];
-         yyfmt = yystpcpy (yyformat, yyunexpected);
-
-         for (yyx = yyxbegin; yyx < yyxend; ++yyx)
-           if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+#if ! YYERROR_VERBOSE
+      yyerror (YY_("syntax error"));
+#else
+      {
+       YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
+       if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
+         {
+           YYSIZE_T yyalloc = 2 * yysize;
+           if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
+             yyalloc = YYSTACK_ALLOC_MAXIMUM;
+           if (yymsg != yymsgbuf)
+             YYSTACK_FREE (yymsg);
+           yymsg = (char *) YYSTACK_ALLOC (yyalloc);
+           if (yymsg)
+             yymsg_alloc = yyalloc;
+           else
              {
-               if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
-                 {
-                   yycount = 1;
-                   yysize = yysize0;
-                   yyformat[sizeof yyunexpected - 1] = '\0';
-                   break;
-                 }
-               yyarg[yycount++] = yytname[yyx];
-               yysize1 = yysize + yytnamerr (0, yytname[yyx]);
-               yysize_overflow |= yysize1 < yysize;
-               yysize = yysize1;
-               yyfmt = yystpcpy (yyfmt, yyprefix);
-               yyprefix = yyor;
+               yymsg = yymsgbuf;
+               yymsg_alloc = sizeof yymsgbuf;
              }
+         }
 
-         yyf = YY_(yyformat);
-         yysize1 = yysize + yystrlen (yyf);
-         yysize_overflow |= yysize1 < yysize;
-         yysize = yysize1;
-
-         if (!yysize_overflow && yysize <= YYSTACK_ALLOC_MAXIMUM)
-           yymsg = (char *) YYSTACK_ALLOC (yysize);
-         if (yymsg)
-           {
-             /* Avoid sprintf, as that infringes on the user's name space.
-                Don't have undefined behavior even if the translation
-                produced a string with the wrong number of "%s"s.  */
-             char *yyp = yymsg;
-             int yyi = 0;
-             while ((*yyp = *yyf))
-               {
-                 if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
-                   {
-                     yyp += yytnamerr (yyp, yyarg[yyi++]);
-                     yyf += 2;
-                   }
-                 else
-                   {
-                     yyp++;
-                     yyf++;
-                   }
-               }
-             yyerror (yymsg);
-             YYSTACK_FREE (yymsg);
-           }
-         else
-           {
-             yyerror (YY_("syntax error"));
+       if (0 < yysize && yysize <= yymsg_alloc)
+         {
+           (void) yysyntax_error (yymsg, yystate, yychar);
+           yyerror (yymsg);
+         }
+       else
+         {
+           yyerror (YY_("syntax error"));
+           if (yysize != 0)
              goto yyexhaustedlab;
-           }
-       }
-      else
-#endif /* YYERROR_VERBOSE */
-       yyerror (YY_("syntax error"));
+         }
+      }
+#endif
     }
 
 
@@ -1546,14 +1694,15 @@ yyerrlab:
         error, discard it.  */
 
       if (yychar <= YYEOF)
-        {
+       {
          /* Return failure if at end of input.  */
          if (yychar == YYEOF)
            YYABORT;
-        }
+       }
       else
        {
-         yydestruct ("Error: discarding", yytoken, &yylval);
+         yydestruct ("Error: discarding",
+                     yytoken, &yylval);
          yychar = YYEMPTY;
        }
     }
@@ -1571,11 +1720,14 @@ yyerrorlab:
   /* Pacify compilers like GCC when the user code never invokes
      YYERROR and the label yyerrorlab therefore never appears in user
      code.  */
-  if (0)
+  if (/*CONSTCOND*/ 0)
      goto yyerrorlab;
 
-yyvsp -= yylen;
-  yyssp -= yylen;
+  /* Do not reclaim the symbols of the rule which action triggered
+     this YYERROR.  */
+  YYPOPSTACK (yylen);
+  yylen = 0;
+  YY_STACK_PRINT (yyss, yyssp);
   yystate = *yyssp;
   goto yyerrlab1;
 
@@ -1605,8 +1757,9 @@ yyerrlab1:
        YYABORT;
 
 
-      yydestruct ("Error: popping", yystos[yystate], yyvsp);
-      YYPOPSTACK;
+      yydestruct ("Error: popping",
+                 yystos[yystate], yyvsp);
+      YYPOPSTACK (1);
       yystate = *yyssp;
       YY_STACK_PRINT (yyss, yyssp);
     }
@@ -1617,7 +1770,7 @@ yyerrlab1:
   *++yyvsp = yylval;
 
 
-  /* Shift the error token. */
+  /* Shift the error token.  */
   YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
 
   yystate = yyn;
@@ -1652,21 +1805,30 @@ yyreturn:
   if (yychar != YYEOF && yychar != YYEMPTY)
      yydestruct ("Cleanup: discarding lookahead",
                 yytoken, &yylval);
+  /* Do not reclaim the symbols of the rule which action triggered
+     this YYABORT or YYACCEPT.  */
+  YYPOPSTACK (yylen);
+  YY_STACK_PRINT (yyss, yyssp);
   while (yyssp != yyss)
     {
       yydestruct ("Cleanup: popping",
                  yystos[*yyssp], yyvsp);
-      YYPOPSTACK;
+      YYPOPSTACK (1);
     }
 #ifndef yyoverflow
   if (yyss != yyssa)
     YYSTACK_FREE (yyss);
 #endif
-  return yyresult;
+#if YYERROR_VERBOSE
+  if (yymsg != yymsgbuf)
+    YYSTACK_FREE (yymsg);
+#endif
+  /* Make sure YYID is used.  */
+  return YYID (yyresult);
 }
 
 
-#line 176 "uparse.y"
+#line 174 "uparse.y"
 
 
 void
index 30d97fae14d0b01316e74461d91156235cec75b7..d813294dfdcbf9abe68cf20b461d144d655a944f 100644 (file)
@@ -1,7 +1,9 @@
-/* A Bison parser, made by GNU Bison 2.1.  */
+/* A Bison parser, made by GNU Bison 2.3.  */
 
-/* Skeleton parser for Yacc-like parsing with Bison,
-   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
+/* Skeleton interface for Bison's Yacc-like parsers in C
+
+   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+   Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    Foundation, Inc., 51 Franklin Street, Fifth Floor,
    Boston, MA 02110-1301, USA.  */
 
-/* As a special exception, when this file is copied by Bison into a
-   Bison output file, you may use that output file without restriction.
-   This special exception was added by the Free Software Foundation
-   in version 1.24 of Bison.  */
+/* As a special exception, you may create a larger work that contains
+   part or all of the Bison parser skeleton and distribute that work
+   under terms of your choice, so long as that work isn't itself a
+   parser generator using the skeleton or a modified version thereof
+   as a parser skeleton.  Alternatively, if you modify or redistribute
+   the parser skeleton itself, you may (at your option) remove this
+   special exception, which will cause the skeleton and the resulting
+   Bison output files to be licensed under the GNU General Public
+   License without this special exception.
+
+   This special exception was added by the Free Software Foundation in
+   version 2.2 of Bison.  */
 
 /* Tokens.  */
 #ifndef YYTOKENTYPE
 
 
 
-#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+typedef union YYSTYPE
 #line 42 "uparse.y"
-typedef union YYSTYPE {
+{
        int     intval;
        double  floatval;
        char *  strval;
        int     subtok;
-} YYSTYPE;
-/* Line 1447 of yacc.c.  */
-#line 105 "uparse.h"
+}
+/* Line 1489 of yacc.c.  */
+#line 116 "uparse.h"
+       YYSTYPE;
 # define yystype YYSTYPE /* obsolescent; will be withdrawn */
 # define YYSTYPE_IS_DECLARED 1
 # define YYSTYPE_IS_TRIVIAL 1
@@ -109,5 +121,3 @@ typedef union YYSTYPE {
 
 extern YYSTYPE yylval;
 
-
-
index 35d6d3e43162221058007dcfc3fd8f7a8b617248..6be3562f6914ca8504aebfe9686854bcfd59aeaa 100644 (file)
@@ -157,9 +157,7 @@ deletex_path:
 local_command:
        LPWD { char buf[STR_SIZE]; puts(getcwd(buf, sizeof(buf))); }
   |     LCD PATH {
-               if (chdir($2) == -1) {
-                       perror($2);
-               }
+               local_cd($2);
                amfree($2);
        }
   ;
diff --git a/regex-src/COPYRIGHT b/regex-src/COPYRIGHT
deleted file mode 100644 (file)
index 30c1f7a..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-Copyright 1992, 1993, 1994, 1997 Henry Spencer.  All rights reserved.
-This software is not subject to any license of the American Telephone
-and Telegraph Company or of the Regents of the University of California.
-
-Permission is granted to anyone to use this software for any purpose on
-any computer system, and to alter it and redistribute it, subject
-to the following restrictions:
-
-1. The author is not responsible for the consequences of use of this
-   software, no matter how awful, even if they arise from flaws in it.
-
-2. The origin of this software must not be misrepresented, either by
-   explicit claim or by omission.  Since few users ever read sources,
-   credits must appear in the documentation.
-
-3. Altered versions must be plainly marked as such, and must not be
-   misrepresented as being the original software.  Since few users
-   ever read sources, credits must appear in the documentation.
-
-4. This notice may not be removed or altered.
diff --git a/regex-src/Makefile b/regex-src/Makefile
deleted file mode 100644 (file)
index b4d9b99..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-# You probably want to take -DREDEBUG out of CFLAGS, and put something like
-# -O in, *after* testing (-DREDEBUG strengthens testing by enabling a lot of
-# internal assertion checking and some debugging facilities).
-# Put -Dconst= in for a pre-ANSI compiler.
-# Do not take -DPOSIX_MISTAKE out.
-# REGCFLAGS isn't important to you (it's for my use in some special contexts).
-CFLAGS=-I. -DPOSIX_MISTAKE -DREDEBUG $(REGCFLAGS)
-
-# If you have a pre-ANSI compiler, put -o into MKHFLAGS.  If you want
-# the Berkeley __P macro, put -b in.
-MKHFLAGS=
-
-# Flags for linking but not compiling, if any.
-LDFLAGS=
-
-# Extra libraries for linking, if any.
-LIBS=
-
-# Internal stuff, should not need changing.
-OBJPRODN=regcomp.o regexec.o regerror.o regfree.o
-OBJS=$(OBJPRODN) split.o debug.o main.o
-H=cclass.h cname.h regex2.h utils.h
-REGSRC=regcomp.c regerror.c regexec.c regfree.c
-ALLSRC=$(REGSRC) engine.c debug.c main.c split.c
-
-# Stuff that matters only if you're trying to lint the package.
-LINTFLAGS=-I. -Dstatic= -Dconst= -DREDEBUG
-LINTC=regcomp.c regexec.c regerror.c regfree.c debug.c main.c
-JUNKLINT=possible pointer alignment|null effect
-
-# arrangements to build forward-reference header files
-.SUFFIXES:     .ih .h
-.c.ih:
-       sh ./mkh -A $(MKHFLAGS) -p $< >$@
-
-default:       r
-
-lib:   purge $(OBJPRODN)
-       rm -f libregex.a
-       ar crv libregex.a $(OBJPRODN)
-
-purge:
-       rm -f *.o
-
-# stuff to build regex.h
-REGEXH=regex.h
-REGEXHSRC=regex2.h $(REGSRC)
-$(REGEXH):     $(REGEXHSRC) mkh
-       sh ./mkh -A $(MKHFLAGS) -i _REGEX_H_ $(REGEXHSRC) >regex.tmp
-       cmp -s regex.tmp regex.h 2>/dev/null || cp regex.tmp regex.h
-       rm -f regex.tmp
-
-# dependencies
-$(OBJPRODN) debug.o:   utils.h regex.h regex2.h
-regcomp.o:     cclass.h cname.h regcomp.ih
-regexec.o:     engine.c engine.ih
-regerror.o:    regerror.ih
-debug.o:       debug.ih
-main.o:        main.ih
-
-# tester
-re:    $(OBJS)
-       $(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) $(LIBS) -o $@
-
-# regression test
-r:     re tests
-       ./re <tests
-       ./re -el <tests
-       ./re -er <tests
-
-# 57 variants, and other stuff, for development use -- not useful to you
-ra:    ./re tests
-       -./re <tests
-       -./re -el <tests
-       -./re -er <tests
-
-rx:    ./re tests
-       ./re -x <tests
-       ./re -x -el <tests
-       ./re -x -er <tests
-
-t:     ./re tests
-       -time ./re <tests
-       -time ./re -cs <tests
-       -time ./re -el <tests
-       -time ./re -cs -el <tests
-
-l:     $(LINTC)
-       lint $(LINTFLAGS) -h $(LINTC) 2>&1 | egrep -v '$(JUNKLINT)' | tee lint
-
-fullprint:
-       ti README WHATSNEW notes todo | list
-       ti *.h | list
-       list *.c
-       list regex.3 regex.7
-
-print:
-       ti README WHATSNEW notes todo | list
-       ti *.h | list
-       list reg*.c engine.c
-
-
-mf.tmp:        Makefile
-       sed '/^REGEXH=/s/=.*/=regex.h/' Makefile | sed '/#DEL$$/d' >$@
-
-DTRH=cclass.h cname.h regex2.h utils.h
-PRE=COPYRIGHT README WHATSNEW
-POST=mkh regex.3 regex.7 tests $(DTRH) $(ALLSRC) fake/*.[ch]
-FILES=$(PRE) Makefile $(POST)
-DTR=$(PRE) Makefile=mf.tmp $(POST)
-dtr:   $(FILES) mf.tmp
-       makedtr $(DTR) >$@
-       rm mf.tmp
-
-cio:   $(FILES)
-       cio $(FILES)
-
-rdf:   $(FILES)
-       rcsdiff -c $(FILES) 2>&1 | p
-
-# various forms of cleanup
-tidy:
-       rm -f junk* core core.* *.core dtr *.tmp lint
-
-clean: tidy
-       rm -f *.o *.s *.ih re libregex.a
-
-# don't do this one unless you know what you're doing
-spotless:      clean
-       rm -f mkh regex.h
-
-lint:
-
diff --git a/regex-src/README b/regex-src/README
deleted file mode 100644 (file)
index 166b181..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-alpha3.6 release.
-Tue Sep 30 13:46:32 EDT 1997
-henry@zoo.toronto.edu
-
-See WHATSNEW for change listing.
-
-installation notes:
---------
-Read the comments at the beginning of Makefile before running.
-
-Utils.h contains some things that just might have to be modified on
-some systems, as well as a nested include (ugh) of <assert.h>.
-
-The "fake" directory contains quick-and-dirty fakes for some header
-files and routines that old systems may not have.  Note also that
--DUSEBCOPY will make utils.h substitute bcopy() for memmove().
-
-After that, "make r" will build regcomp.o, regexec.o, regfree.o,
-and regerror.o (the actual routines), bundle them together into a test
-program, and run regression tests on them.  No output is good output.
-
-"make lib" builds just the .o files for the actual routines (when
-you're happy with testing and have adjusted CFLAGS for production),
-and puts them together into libregex.a.  You can pick up either the
-library or *.o ("make lib" makes sure there are no other .o files left
-around to confuse things).
-
-Main.c, debug.c, split.c are used for regression testing but are not part
-of the RE routines themselves.
-
-Regex.h goes in /usr/include.  All other .h files are internal only.
---------
diff --git a/regex-src/WHATSNEW b/regex-src/WHATSNEW
deleted file mode 100644 (file)
index 230ca86..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-New in alpha3.6:  A couple more portability glitches fixed.
-
-New in alpha3.5:  Active development of this code has been stopped --
-I'm working on a complete reimplementation -- but folks have found some
-minor portability glitches and the like, hence this release to fix them.
-One penalty:  slightly reduced compatibility with old compilers, because
-the ANSI C `unsigned long' type and `ul' constant suffix are used in a
-few places (I could avoid this but it would be considerably more work).
-
-New in alpha3.4:  The complex bug alluded to below has been fixed (in a
-slightly kludgey temporary way that may hurt efficiency a bit; this is
-another "get it out the door for 4.4" release).  The tests at the end of
-the tests file have accordingly been uncommented.  The primary sign of
-the bug was that something like a?b matching ab matched b rather than ab.
-(The bug was essentially specific to this exact situation, else it would
-have shown up earlier.)
-
-New in alpha3.3:  The definition of word boundaries has been altered
-slightly, to more closely match the usual programming notion that "_"
-is an alphabetic.  Stuff used for pre-ANSI systems is now in a subdir,
-and the makefile no longer alludes to it in mysterious ways.  The
-makefile has generally been cleaned up some.  Fixes have been made
-(again!) so that the regression test will run without -DREDEBUG, at
-the cost of weaker checking.  A workaround for a bug in some folks'
-<assert.h> has been added.  And some more things have been added to
-tests, including a couple right at the end which are commented out
-because the code currently flunks them (complex bug; fix coming).
-Plus the usual minor cleanup.
-
-New in alpha3.2:  Assorted bits of cleanup and portability improvement
-(the development base is now a BSDI system using GCC instead of an ancient
-Sun system, and the newer compiler exposed some glitches).  Fix for a
-serious bug that affected REs using many [] (including REG_ICASE REs
-because of the way they are implemented), *sometimes*, depending on
-memory-allocation patterns.  The header-file prototypes no longer name
-the parameters, avoiding possible name conflicts.  The possibility that
-some clot has defined CHAR_MIN as (say) `-128' instead of `(-128)' is
-now handled gracefully.  "uchar" is no longer used as an internal type
-name (too many people have the same idea).  Still the same old lousy
-performance, alas.
-
-New in alpha3.1:  Basically nothing, this release is just a bookkeeping
-convenience.  Stay tuned.
-
-New in alpha3.0:  Performance is no better, alas, but some fixes have been
-made and some functionality has been added.  (This is basically the "get
-it out the door in time for 4.4" release.)  One bug fix:  regfree() didn't
-free the main internal structure (how embarrassing).  It is now possible
-to put NULs in either the RE or the target string, using (resp.) a new
-REG_PEND flag and the old REG_STARTEND flag.  The REG_NOSPEC flag to
-regcomp() makes all characters ordinary, so you can match a literal
-string easily (this will become more useful when performance improves!).
-There are now primitives to match beginnings and ends of words, although
-the syntax is disgusting and so is the implementation.  The REG_ATOI
-debugging interface has changed a bit.  And there has been considerable
-internal cleanup of various kinds.
-
-New in alpha2.3:  Split change list out of README, and moved flags notes
-into Makefile.  Macro-ized the name of regex(7) in regex(3), since it has
-to change for 4.4BSD.  Cleanup work in engine.c, and some new regression
-tests to catch tricky cases thereof.
-
-New in alpha2.2:  Out-of-date manpages updated.  Regerror() acquires two
-small extensions -- REG_ITOA and REG_ATOI -- which avoid debugging kludges
-in my own test program and might be useful to others for similar purposes.
-The regression test will now compile (and run) without REDEBUG.  The
-BRE \$ bug is fixed.  Most uses of "uchar" are gone; it's all chars now.
-Char/uchar parameters are now written int/unsigned, to avoid possible
-portability problems with unpromoted parameters.  Some unsigned casts have
-been introduced to minimize portability problems with shifting into sign
-bits.
-
-New in alpha2.1:  Lots of little stuff, cleanup and fixes.  The one big
-thing is that regex.h is now generated, using mkh, rather than being
-supplied in the distribution; due to circularities in dependencies,
-you have to build regex.h explicitly by "make h".  The two known bugs
-have been fixed (and the regression test now checks for them), as has a
-problem with assertions not being suppressed in the absence of REDEBUG.
-No performance work yet.
-
-New in alpha2:  Backslash-anything is an ordinary character, not an
-error (except, of course, for the handful of backslashed metacharacters
-in BREs), which should reduce script breakage.  The regression test
-checks *where* null strings are supposed to match, and has generally
-been tightened up somewhat.  Small bug fixes in parameter passing (not
-harmful, but technically errors) and some other areas.  Debugging
-invoked by defining REDEBUG rather than not defining NDEBUG.
-
-New in alpha+3:  full prototyping for internal routines, using a little
-helper program, mkh, which extracts prototypes given in stylized comments.
-More minor cleanup.  Buglet fix:  it's CHAR_BIT, not CHAR_BITS.  Simple
-pre-screening of input when a literal string is known to be part of the
-RE; this does wonders for performance.
-
-New in alpha+2:  minor bits of cleanup.  Notably, the number "32" for the
-word width isn't hardwired into regexec.c any more, the public header
-file prototypes the functions if __STDC__ is defined, and some small typos
-in the manpages have been fixed.
-
-New in alpha+1:  improvements to the manual pages, and an important
-extension, the REG_STARTEND option to regexec().
diff --git a/regex-src/cclass.h b/regex-src/cclass.h
deleted file mode 100644 (file)
index 61a65ce..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-#ifndef CCLASS_H
-#define CCLASS_H
-
-/* character-class table */
-static struct cclass {
-       char *name;
-       char *chars;
-       char *multis;
-} cclasses[] = {
-    {
-       "alnum",
-       "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
-       ""
-    }, {
-       "alpha", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", ""
-    }, {
-       "blank", " \t", ""
-    }, {
-       "cntrl",
-       "\007\b\t\n\v\f\r\1\2\3\4\5\6\16\17\20\21\22\23\24\25\26\27"
-         "\30\31\32\33\34\35\36\37\177",
-       ""
-    }, {
-       "digit", "0123456789", ""
-    }, {
-       "graph",
-       "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
-         "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~",
-       ""
-    }, {
-       "lower", "abcdefghijklmnopqrstuvwxyz", ""
-    }, {
-       "print",
-       "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
-         "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~ ",
-       ""
-    }, {
-       "punct", "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~", ""
-    }, {
-       "space", "\t\n\v\f\r ", ""
-    }, {
-       "upper", "ABCDEFGHIJKLMNOPQRSTUVWXYZ", ""
-    }, {
-       "xdigit", "0123456789ABCDEFabcdef", ""
-    }, {
-       NULL, NULL, ""
-    }
-};
-
-#endif /* !CCLASS_H */
diff --git a/regex-src/cname.h b/regex-src/cname.h
deleted file mode 100644 (file)
index 8d5c602..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-#ifndef CNAME_H
-#define CNAME_H
-
-/* character-name table */
-static struct cname {
-       char *name;
-       char code;
-} cnames[] = {
-       { "NUL",                        '\0' },
-       { "SOH",                        '\001' },
-       { "STX",                        '\002' },
-       { "ETX",                        '\003' },
-       { "EOT",                        '\004' },
-       { "ENQ",                        '\005' },
-       { "ACK",                        '\006' },
-       { "BEL",                        '\007' },
-       { "alert",                      '\007' },
-       { "BS",                         '\010' },
-       { "backspace",                  '\b' },
-       { "HT",                         '\011' },
-       { "tab",                        '\t' },
-       { "LF",                         '\012' },
-       { "newline",                    '\n' },
-       { "VT",                         '\013' },
-       { "vertical-tab",               '\v' },
-       { "FF",                         '\014' },
-       { "form-feed",                  '\f' },
-       { "CR",                         '\015' },
-       { "carriage-return",            '\r' },
-       { "SO",                         '\016' },
-       { "SI",                         '\017' },
-       { "DLE",                        '\020' },
-       { "DC1",                        '\021' },
-       { "DC2",                        '\022' },
-       { "DC3",                        '\023' },
-       { "DC4",                        '\024' },
-       { "NAK",                        '\025' },
-       { "SYN",                        '\026' },
-       { "ETB",                        '\027' },
-       { "CAN",                        '\030' },
-       { "EM",                         '\031' },
-       { "SUB",                        '\032' },
-       { "ESC",                        '\033' },
-       { "IS4",                        '\034' },
-       { "FS",                         '\034' },
-       { "IS3",                        '\035' },
-       { "GS",                         '\035' },
-       { "IS2",                        '\036' },
-       { "RS",                         '\036' },
-       { "IS1",                        '\037' },
-       { "US",                         '\037' },
-       { "space",                      ' ' },
-       { "exclamation-mark",           '!' },
-       { "quotation-mark",             '"' },
-       { "number-sign",                '#' },
-       { "dollar-sign",                '$' },
-       { "percent-sign",               '%' },
-       { "ampersand",                  '&' },
-       { "apostrophe",                 '\'' },
-       { "left-parenthesis",           '(' },
-       { "right-parenthesis",          ')' },
-       { "asterisk",                   '*' },
-       { "plus-sign",                  '+' },
-       { "comma",                      ',' },
-       { "hyphen",                     '-' },
-       { "hyphen-minus",               '-' },
-       { "period",                     '.' },
-       { "full-stop",                  '.' },
-       { "slash",                      '/' },
-       { "solidus",                    '/' },
-       { "zero",                       '0' },
-       { "one",                        '1' },
-       { "two",                        '2' },
-       { "three",                      '3' },
-       { "four",                       '4' },
-       { "five",                       '5' },
-       { "six",                        '6' },
-       { "seven",                      '7' },
-       { "eight",                      '8' },
-       { "nine",                       '9' },
-       { "colon",                      ':' },
-       { "semicolon",                  ';' },
-       { "less-than-sign",             '<' },
-       { "equals-sign",                '=' },
-       { "greater-than-sign",          '>' },
-       { "question-mark",              '?' },
-       { "commercial-at",              '@' },
-       { "left-square-bracket",        '[' },
-       { "backslash",                  '\\' },
-       { "reverse-solidus",            '\\' },
-       { "right-square-bracket",       ']' },
-       { "circumflex",                 '^' },
-       { "circumflex-accent",          '^' },
-       { "underscore",                 '_' },
-       { "low-line",                   '_' },
-       { "grave-accent",               '`' },
-       { "left-brace",                 '{' },
-       { "left-curly-bracket",         '{' },
-       { "vertical-line",              '|' },
-       { "right-brace",                '}' },
-       { "right-curly-bracket",        '}' },
-       { "tilde",                      '~' },
-       { "DEL",                        '\177' },
-       { NULL,                         0 }
-};
-
-#endif /* !CNAME_H */
diff --git a/regex-src/debug.c b/regex-src/debug.c
deleted file mode 100644 (file)
index 3663b75..0000000
+++ /dev/null
@@ -1,237 +0,0 @@
-#include "amanda.h"
-#include <regex.h>
-
-#include "utils.h"
-#include "regex2.h"
-#include "debug.ih"
-
-/*
- - regprint - print a regexp for debugging
- == void regprint(regex_t *r, FILE *d);
- */
-void
-regprint(r, d)
-regex_t *r;
-FILE *d;
-{
-       register struct re_guts *g = r->re_g;
-       register int i;
-       register int c;
-       register int last;
-       int nincat[NC];
-
-       fprintf(d, "%ld states, %d categories", (long)g->nstates,
-                                                       g->ncategories);
-       fprintf(d, ", first %ld last %ld", (long)g->firststate,
-                                               (long)g->laststate);
-       if (g->iflags&USEBOL)
-               fprintf(d, ", USEBOL");
-       if (g->iflags&USEEOL)
-               fprintf(d, ", USEEOL");
-       if (g->iflags&BAD)
-               fprintf(d, ", BAD");
-       if (g->nsub > 0)
-               fprintf(d, ", nsub=%ld", (long)g->nsub);
-       if (g->must != NULL)
-               fprintf(d, ", must(%ld) `%*s'", (long)g->mlen, (int)g->mlen,
-                                                               g->must);
-       if (g->backrefs)
-               fprintf(d, ", backrefs");
-       if (g->nplus > 0)
-               fprintf(d, ", nplus %ld", (long)g->nplus);
-       fprintf(d, "\n");
-       s_print(g, d);
-       for (i = 0; i < g->ncategories; i++) {
-               nincat[i] = 0;
-               for (c = CHAR_MIN; c <= CHAR_MAX; c++)
-                       if (g->categories[c] == i)
-                               nincat[i]++;
-       }
-       fprintf(d, "cc0#%d", nincat[0]);
-       for (i = 1; i < g->ncategories; i++)
-               if (nincat[i] == 1) {
-                       for (c = CHAR_MIN; c <= CHAR_MAX; c++)
-                               if (g->categories[c] == i)
-                                       break;
-                       fprintf(d, ", %d=%s", i, regchar(c));
-               }
-       fprintf(d, "\n");
-       for (i = 1; i < g->ncategories; i++)
-               if (nincat[i] != 1) {
-                       fprintf(d, "cc%d\t", i);
-                       last = -1;
-                       for (c = CHAR_MIN; c <= CHAR_MAX+1; c++)        /* +1 does flush */
-                               if (c <= CHAR_MAX && g->categories[c] == i) {
-                                       if (last < 0) {
-                                               fprintf(d, "%s", regchar(c));
-                                               last = c;
-                                       }
-                               } else {
-                                       if (last >= 0) {
-                                               if (last != c-1)
-                                                       fprintf(d, "-%s",
-                                                               regchar(c-1));
-                                               last = -1;
-                                       }
-                               }
-                       fprintf(d, "\n");
-               }
-}
-
-/*
- - s_print - print the strip for debugging
- == static void s_print(register struct re_guts *g, FILE *d);
- */
-static void
-s_print(g, d)
-register struct re_guts *g;
-FILE *d;
-{
-       register sop *s;
-       register cset *cs;
-       register int i;
-       register int done = 0;
-       register sop opnd;
-       register int col = 0;
-       register int last;
-       register sopno offset = 2;
-#      define  GAP()   {       if (offset % 5 == 0) { \
-                                       if (col > 40) { \
-                                               fprintf(d, "\n\t"); \
-                                               col = 0; \
-                                       } else { \
-                                               fprintf(d, " "); \
-                                               col++; \
-                                       } \
-                               } else \
-                                       col++; \
-                               offset++; \
-                       }
-
-       if (OP(g->strip[0]) != OEND)
-               fprintf(d, "missing initial OEND!\n");
-       for (s = &g->strip[1]; !done; s++) {
-               opnd = OPND(*s);
-               switch (OP(*s)) {
-               case OEND:
-                       fprintf(d, "\n");
-                       done = 1;
-                       break;
-               case OCHAR:
-                       if (strchr("\\|()^$.[+*?{}!<> ", (char)opnd) != NULL)
-                               fprintf(d, "\\%c", (char)opnd);
-                       else
-                               fprintf(d, "%s", regchar((char)opnd));
-                       break;
-               case OBOL:
-                       fprintf(d, "^");
-                       break;
-               case OEOL:
-                       fprintf(d, "$");
-                       break;
-               case OBOW:
-                       fprintf(d, "\\{");
-                       break;
-               case OEOW:
-                       fprintf(d, "\\}");
-                       break;
-               case OANY:
-                       fprintf(d, ".");
-                       break;
-               case OANYOF:
-                       fprintf(d, "[(%ld)", (long)opnd);
-                       cs = &g->sets[opnd];
-                       last = -1;
-                       for (i = 0; i < g->csetsize+1; i++)     /* +1 flushes */
-                               if (CHIN(cs, i) && i < g->csetsize) {
-                                       if (last < 0) {
-                                               fprintf(d, "%s", regchar(i));
-                                               last = i;
-                                       }
-                               } else {
-                                       if (last >= 0) {
-                                               if (last != i-1)
-                                                       fprintf(d, "-%s",
-                                                               regchar(i-1));
-                                               last = -1;
-                                       }
-                               }
-                       fprintf(d, "]");
-                       break;
-               case OBACK_:
-                       fprintf(d, "(\\<%ld>", (long)opnd);
-                       break;
-               case O_BACK:
-                       fprintf(d, "<%ld>\\)", (long)opnd);
-                       break;
-               case OPLUS_:
-                       fprintf(d, "(+");
-                       if (OP(*(s+opnd)) != O_PLUS)
-                               fprintf(d, "<%ld>", (long)opnd);
-                       break;
-               case O_PLUS:
-                       if (OP(*(s-opnd)) != OPLUS_)
-                               fprintf(d, "<%ld>", (long)opnd);
-                       fprintf(d, "+)");
-                       break;
-               case OQUEST_:
-                       fprintf(d, "(?");
-                       if (OP(*(s+opnd)) != O_QUEST)
-                               fprintf(d, "<%ld>", (long)opnd);
-                       break;
-               case O_QUEST:
-                       if (OP(*(s-opnd)) != OQUEST_)
-                               fprintf(d, "<%ld>", (long)opnd);
-                       fprintf(d, "?)");
-                       break;
-               case OLPAREN:
-                       fprintf(d, "((<%ld>", (long)opnd);
-                       break;
-               case ORPAREN:
-                       fprintf(d, "<%ld>))", (long)opnd);
-                       break;
-               case OCH_:
-                       fprintf(d, "<");
-                       if (OP(*(s+opnd)) != OOR2)
-                               fprintf(d, "<%ld>", (long)opnd);
-                       break;
-               case OOR1:
-                       if (OP(*(s-opnd)) != OOR1 && OP(*(s-opnd)) != OCH_)
-                               fprintf(d, "<%ld>", (long)opnd);
-                       fprintf(d, "|");
-                       break;
-               case OOR2:
-                       fprintf(d, "|");
-                       if (OP(*(s+opnd)) != OOR2 && OP(*(s+opnd)) != O_CH)
-                               fprintf(d, "<%ld>", (long)opnd);
-                       break;
-               case O_CH:
-                       if (OP(*(s-opnd)) != OOR1)
-                               fprintf(d, "<%ld>", (long)opnd);
-                       fprintf(d, ">");
-                       break;
-               default:
-                       fprintf(d, "!%d(%d)!", OP(*s), opnd);
-                       break;
-               }
-               if (!done)
-                       GAP();
-       }
-}
-
-/*
- - regchar - make a character printable
- == static char *regchar(int ch);
- */
-static char *                  /* -> representation */
-regchar(ch)
-int ch;
-{
-       static char buf[10];
-
-       if (isprint(ch) || ch == ' ')
-               snprintf(buf, SIZEOF(buf), "%c", ch);
-       else
-               snprintf(buf, SIZEOF(buf), "\\%o", ch);
-       return(buf);
-}
diff --git a/regex-src/engine.c b/regex-src/engine.c
deleted file mode 100644 (file)
index 3439b5a..0000000
+++ /dev/null
@@ -1,1027 +0,0 @@
-#include "amanda.h"
-
-/*
- * The matching engine and friends.  This file is #included by regexec.c
- * after suitable #defines of a variety of macros used herein, so that
- * different state representations can be used without duplicating masses
- * of code.
- */
-
-#ifdef SNAMES
-#define        matcher smatcher
-#define        fast    sfast
-#define        slow    sslow
-#define        dissect sdissect
-#define        backref sbackref
-#define        step    sstep
-#define        print   sprint
-#define        at      sat
-#define        match   smat
-#endif
-#ifdef LNAMES
-#define        matcher lmatcher
-#define        fast    lfast
-#define        slow    lslow
-#define        dissect ldissect
-#define        backref lbackref
-#define        step    lstep
-#define        print   lprint
-#define        at      lat
-#define        match   lmat
-#endif
-
-/* another structure passed up and down to avoid zillions of parameters */
-struct match {
-       struct re_guts *g;
-       int eflags;
-       regmatch_t *pmatch;     /* [nsub+1] (0 element unused) */
-       const char *offp;       /* offsets work from here */
-       const char *beginp;     /* start of string -- virtual NUL precedes */
-       const char *endp;       /* end of string -- virtual NUL here */
-       const char *coldp;      /* can be no match starting before here */
-       const char **lastpos;   /* [nplus+1] */
-       STATEVARS;
-       states st;              /* current states */
-       states fresh;           /* states for a fresh start */
-       states tmp;             /* temporary */
-       states empty;           /* empty set of states */
-};
-
-#include "engine.ih"
-
-#ifdef REDEBUG
-#define        SP(t, s, c)     print(m, t, s, c, stdout)
-#define        AT(t, p1, p2, s1, s2)   at(m, t, p1, p2, s1, s2)
-#define        NOTE(str)       { if (m->eflags&REG_TRACE) printf("=%s\n", (str)); }
-#else
-#define        SP(t, s, c)     /* nothing */
-#define        AT(t, p1, p2, s1, s2)   /* nothing */
-#define        NOTE(s) /* nothing */
-#endif
-
-/*
- - matcher - the actual matching engine
- == static int matcher(register struct re_guts *g, const char *string, \
- ==    size_t nmatch, regmatch_t pmatch[], int eflags);
- */
-static int                     /* 0 success, REG_NOMATCH failure */
-matcher(
-    struct re_guts *   g,
-    const char *       string,
-    size_t             nmatch,
-    regmatch_t         pmatch[],
-    int                        eflags)
-{
-       register const char *endp;
-       register size_t i;
-       struct match mv;
-       register struct match *m = &mv;
-       register const char *dp;
-       const sopno gf = g->firststate+1;       /* +1 for OEND */
-       const sopno gl = g->laststate;
-       const char *start;
-       const char *stop;
-
-       /* simplify the situation where possible */
-       if (g->cflags&REG_NOSUB)
-               nmatch = 0;
-       if (eflags&REG_STARTEND) {
-               start = string + (int)pmatch[0].rm_so;
-               stop = string + (int)pmatch[0].rm_eo;
-       } else {
-               start = string;
-               stop = start + strlen(start);
-       }
-       if (stop < start)
-               return(REG_INVARG);
-
-       /* prescreening; this does wonders for this rather slow code */
-       if (g->must != NULL) {
-               for (dp = start; dp < stop; dp++) {
-                       if ((*dp == g->must[0]) &&
-                           ((sopno)(stop - dp) >= g->mlen) &&
-                           (memcmp(dp, g->must, (size_t)g->mlen) == 0)) {
-                               break;
-                       }
-               }
-               if (dp == stop)         /* we didn't find g->must */
-                       return(REG_NOMATCH);
-       }
-
-       /* match struct setup */
-       memset(m, 0, SIZEOF(*m));
-       m->g = g;
-       m->eflags = eflags;
-       m->pmatch = NULL;
-       m->lastpos = NULL;
-       m->offp = string;
-       m->beginp = start;
-       m->endp = stop;
-       STATESETUP(m, 4);
-       SETUP(m->st);
-       SETUP(m->fresh);
-       SETUP(m->tmp);
-       SETUP(m->empty);
-
-       /* this loop does only one repetition except for backrefs */
-       for (;;) {
-               endp = fast(m, start, stop, gf, gl);
-               if ((endp == NULL) || (m->coldp == NULL)) {     /* a miss */
-                       STATETEARDOWN(m);
-                       return(REG_NOMATCH);
-               }
-
-               if (nmatch == 0 && !g->backrefs)
-                       break;          /* no further info needed */
-
-               for (;;) {
-                       NOTE("finding start");
-                       endp = slow(m, m->coldp, stop, gf, gl);
-                       if (endp != NULL)
-                               break;
-                       assert(m->coldp < m->endp);
-                       m->coldp++;
-               }
-               if (nmatch == 1 && !g->backrefs)
-                       break;          /* no further info needed */
-
-               /* oh my, he wants the subexpressions... */
-               if (m->pmatch == NULL)
-                       m->pmatch = (regmatch_t *)alloc((m->g->nsub + 1) *
-                                                       SIZEOF(regmatch_t));
-               if (m->pmatch == NULL) {
-                       STATETEARDOWN(m);
-                       return(REG_ESPACE);
-               }
-               for (i = 1; i <= m->g->nsub; i++)
-                       m->pmatch[i].rm_so = m->pmatch[i].rm_eo = (regoff_t)-1;
-               if (!g->backrefs && !(m->eflags&REG_BACKR)) {
-                       NOTE("dissecting");
-                       dp = dissect(m, m->coldp, endp, gf, gl);
-               } else {
-                       if (g->nplus > 0 && m->lastpos == NULL) {
-                               m->lastpos = (const char **)
-                                   alloc(((size_t)g->nplus+1) *
-                                               SIZEOF(const char *));
-                       }
-                       if (g->nplus > 0 && m->lastpos == NULL) {
-                               free(m->pmatch);
-                               STATETEARDOWN(m);
-                               return(REG_ESPACE);
-                       }
-                       NOTE("backref dissect");
-                       dp = backref(m, m->coldp, endp, gf, gl, (sopno)0);
-               }
-               if (dp != NULL)
-                       break;
-
-               /* uh-oh... we couldn't find a subexpression-level match */
-               assert(g->backrefs);    /* must be back references doing it */
-               assert(g->nplus == 0 || m->lastpos != NULL);
-               for (;;) {
-                       if (dp != NULL || endp <= m->coldp)
-                               break;          /* defeat */
-                       NOTE("backoff");
-                       endp = slow(m, m->coldp, endp-1, gf, gl);
-                       if (endp == NULL)
-                               break;          /* defeat */
-                       /* try it on a shorter possibility */
-#ifndef NDEBUG
-                       for (i = 1; i <= m->g->nsub; i++) {
-                               assert(m->pmatch[i].rm_so == -1);
-                               assert(m->pmatch[i].rm_eo == -1);
-                       }
-#endif
-                       NOTE("backoff dissect");
-                       dp = backref(m, m->coldp, endp, gf, gl, (sopno)0);
-               }
-               assert(dp == NULL || dp == endp);
-               if (dp != NULL)         /* found a shorter one */
-                       break;
-
-               /* despite initial appearances, there is no match here */
-               NOTE("false alarm");
-               start = m->coldp + 1;   /* recycle starting later */
-               assert(start <= stop);
-       }
-
-       /* fill in the details if requested */
-       /*@ignore@*/
-       if (nmatch > 0) {
-               pmatch[0].rm_so = (regoff_t)(m->coldp - m->offp);
-               pmatch[0].rm_eo = (regoff_t)(endp - m->offp);
-       }
-       /*@end@*/
-       if (nmatch > 1) {
-               assert(m->pmatch != NULL);
-               for (i = 1; i < nmatch; i++)
-                       if (i <= m->g->nsub)
-                               pmatch[i] = m->pmatch[i];
-                       else {
-                               pmatch[i].rm_so = (regoff_t)-1;
-                               pmatch[i].rm_eo = (regoff_t)-1;
-                       }
-       }
-
-       if (m->pmatch != NULL)
-               free((void *)m->pmatch);
-       if (m->lastpos != NULL)
-               free((void *)m->lastpos);
-       STATETEARDOWN(m);
-       return(0);
-}
-
-/*
- - dissect - figure out what matched what, no back references
- == static const char *dissect(register struct match *m, const char *start, \
- ==    const char *stop, sopno startst, sopno stopst);
- */
-static const char *                    /* == stop (success) always */
-dissect(
-    struct match *     m,
-    const char *       start,
-    const char *       stop,
-    sopno              startst,
-    sopno              stopst)
-{
-       size_t i;
-       register sopno ss;              /* start sop of current subRE */
-       register sopno es;              /* end sop of current subRE */
-       register const char *sp;        /* start of string matched by it */
-       register const char *stp;       /* string matched by it cannot pass here */
-       register const char *rest = NULL;/* start of rest of string */
-       register const char *tail;      /* string unmatched by rest of RE */
-       register sopno ssub;            /* start sop of subsubRE */
-       register sopno esub;            /* end sop of subsubRE */
-       register const char *ssp;       /* start of string matched by subsubRE */
-       register const char *sep;       /* end of string matched by subsubRE */
-       register const char *oldssp;    /* previous ssp */
-       register const char *dp;
-
-       AT("diss", start, stop, startst, stopst);
-       sp = start;
-       for (ss = startst; ss < stopst; ss = es) {
-               /* identify end of subRE */
-               es = ss;
-               switch (OP(m->g->strip[es])) {
-               case OPLUS_:
-               case OQUEST_:
-                       es += OPND(m->g->strip[es]);
-                       break;
-
-               case OCH_:
-                       while (OP(m->g->strip[es]) != O_CH)
-                               es += OPND(m->g->strip[es]);
-                       break;
-               }
-               es++;
-
-               /* figure out what it matched */
-               switch (OP(m->g->strip[ss])) {
-               case OEND:
-                       break;
-
-               case OCHAR:
-                       sp++;
-                       break;
-
-               case OBOL:
-               case OEOL:
-               case OBOW:
-               case OEOW:
-                       break;
-
-               case OANY:
-               case OANYOF:
-                       sp++;
-                       break;
-
-               case OBACK_:
-               case O_BACK:
-                       break;
-
-               /* cases where length of match is hard to find */
-               case OQUEST_:
-                       stp = stop;
-                       rest = slow(m, sp, stp, ss, es);
-                       for (;;) {
-                               /* how long could this one be? */
-                               assert(rest != NULL);   /* it did match */
-                               /* could the rest match the rest? */
-                               tail = slow(m, rest, stop, es, stopst);
-                               if (tail == stop)
-                                       break;          /* yes! */
-                               /* no -- try a shorter match for this one */
-                               stp = rest - 1;
-                               assert(stp >= sp);      /* it did work */
-                               rest = slow(m, sp, stp, ss, es);
-                       }
-                       ssub = ss + 1;
-                       esub = es - 1;
-                       /* did innards match? */
-                       if (slow(m, sp, rest, ssub, esub) != NULL) {
-                               dp = dissect(m, sp, rest, ssub, esub);
-                               assert(dp == rest);
-                       }
-                       sp = rest;
-                       break;
-
-               case OPLUS_:
-                       stp = stop;
-                       for (;;) {
-                               /* how long could this one be? */
-                               rest = slow(m, sp, stp, ss, es);
-                               assert(rest != NULL);   /* it did match */
-                               /* could the rest match the rest? */
-                               tail = slow(m, rest, stop, es, stopst);
-                               if (tail == stop)
-                                       break;          /* yes! */
-                               /* no -- try a shorter match for this one */
-                               stp = rest - 1;
-                               assert(stp >= sp);      /* it did work */
-                       }
-                       ssub = ss + 1;
-                       esub = es - 1;
-                       ssp = sp;
-                       oldssp = ssp;
-                       sep = slow(m, ssp, rest, ssub, esub);
-                       for (;;) {      /* find last match of innards */
-                               if (sep == NULL || sep == ssp)
-                                       break;  /* failed or matched null */
-                               oldssp = ssp;   /* on to next try */
-                               ssp = sep;
-                               sep = slow(m, ssp, rest, ssub, esub);
-                       }
-                       if (sep == NULL) {
-                               /* last successful match */
-                               sep = ssp;
-                               ssp = oldssp;
-                       }
-                       assert(sep == rest);    /* must exhaust substring */
-                       assert(slow(m, ssp, sep, ssub, esub) == rest);
-                       dp = dissect(m, ssp, sep, ssub, esub);
-                       assert(dp == sep);
-                       sp = dp;
-                       break;
-
-               case OCH_:
-                       stp = stop;
-                       for (;;) {
-                               /* how long could this one be? */
-                               rest = slow(m, sp, stp, ss, es);
-                               assert(rest != NULL);   /* it did match */
-                               /* could the rest match the rest? */
-                               tail = slow(m, rest, stop, es, stopst);
-                               if (tail == stop)
-                                       break;          /* yes! */
-                               /* no -- try a shorter match for this one */
-                               stp = rest - 1;
-                               assert(stp >= sp);      /* it did work */
-                       }
-                       ssub = ss + 1;
-                       esub = ss + OPND(m->g->strip[ss]) - 1;
-                       assert(OP(m->g->strip[esub]) == OOR1);
-                       /*@ignore@*/
-                       for (;;) {      /* find first matching branch */
-                               if (slow(m, sp, rest, ssub, esub) == rest)
-                                       break;  /* it matched all of it */
-                               /* that one missed, try next one */
-                               assert(OP(m->g->strip[esub]) == OOR1);
-                               esub++;
-                               assert(OP(m->g->strip[esub]) == OOR2);
-                               ssub = esub + 1;
-                               esub += OPND(m->g->strip[esub]);
-                               if (OP(m->g->strip[esub]) == OOR2)
-                                       esub--;
-                               else
-                                       assert(OP(m->g->strip[esub]) == O_CH);
-                       }
-                       dp = dissect(m, sp, rest, ssub, esub);
-                       assert(dp == rest);
-                       sp = dp;
-                       /*@end@*/
-                       break;
-
-               case O_PLUS:
-               case O_QUEST:
-               case OOR1:
-               case OOR2:
-               case O_CH:
-                       break;
-
-               case OLPAREN:
-                       i = (size_t)OPND(m->g->strip[ss]);
-                       assert(0 < i && i <= m->g->nsub);
-                       m->pmatch[i].rm_so = (regoff_t)(sp - m->offp);
-                       break;
-
-               case ORPAREN:
-                       i = (size_t)OPND(m->g->strip[ss]);
-                       assert(0 < i && i <= m->g->nsub);
-                       m->pmatch[i].rm_eo = (regoff_t)(sp - m->offp);
-                       break;
-
-               default:                /* uh oh */
-                       break;
-               }
-       }
-
-       assert(sp == stop);
-       return(sp);
-}
-
-/*
- - backref - figure out what matched what, figuring in back references
- == static const char *backref(register struct match *m, const char *start, \
- ==    const char *stop, sopno startst, sopno stopst, sopno lev);
- */
-static const char *            /* == stop (success) or NULL (failure) */
-backref(
-    struct match *     m,
-    const char *       start,
-    const char *       stop,
-    sopno              startst,
-    sopno              stopst,
-    sopno              lev)                    /* PLUS nesting level */
-{
-       register size_t i;
-       register sopno ss;      /* start sop of current subRE */
-       register const char *sp;/* start of string matched by it */
-       register sopno ssub;    /* start sop of subsubRE */
-       register sopno esub;    /* end sop of subsubRE */
-       register const char *ssp;/* start of string matched by subsubRE */
-       register const char *dp;
-       register size_t len;
-       register int hard;
-       register sop s;
-       register regoff_t offsave;
-       register cset *cs;
-
-       AT("back", start, stop, startst, stopst);
-       sp = start;
-
-       /* get as far as we can with easy stuff */
-       hard = 0;
-       for (ss = startst; !hard && ss < stopst; ss++)
-               switch (OP(s = m->g->strip[ss])) {
-               case OCHAR:
-                       if (sp == stop || *sp++ != (char)OPND(s))
-                               return(NULL);
-                       break;
-               case OANY:
-                       if (sp == stop)
-                               return(NULL);
-                       sp++;
-                       break;
-               case OANYOF:
-                       cs = &m->g->sets[OPND(s)];
-                       if (sp == stop || !CHIN(cs, *sp++))
-                               return(NULL);
-                       break;
-               case OBOL:
-                       if (!((sp == m->beginp && !(m->eflags&REG_NOTBOL)) ||
-                                       (sp < m->endp && *(sp-1) == '\n' &&
-                                               (m->g->cflags&REG_NEWLINE)))) {
-                               return(NULL);
-                       }
-                       break;
-               case OEOL:
-                       if (!((sp == m->endp && !(m->eflags&REG_NOTEOL)) ||
-                                       (sp < m->endp && *sp == '\n' &&
-                                               (m->g->cflags&REG_NEWLINE)))) {
-                               return(NULL);
-                       }
-                       break;
-               case OBOW:
-                       if (!(((sp == m->beginp && !(m->eflags&REG_NOTBOL))
-                           || ((sp < m->endp) && (*(sp-1) == '\n')
-                             && (m->g->cflags & REG_NEWLINE))
-                           || (((sp > m->beginp) && !ISWORD(*(sp-1)))
-                             && (sp < m->endp && ISWORD(*sp)))))) {
-                               return(NULL);
-                       }
-                       break;
-               case OEOW:
-                       if (!(((sp == m->endp && !(m->eflags&REG_NOTEOL)) ||
-                                       (sp < m->endp && *sp == '\n' &&
-                                               (m->g->cflags&REG_NEWLINE)) ||
-                                       (sp < m->endp && !ISWORD(*sp)) ) &&
-                                       (sp > m->beginp && ISWORD(*(sp-1))))) {
-                               return(NULL);
-                       }
-                       break;
-               case O_QUEST:
-                       break;
-               case OOR1:      /* matches null but needs to skip */
-                       ss++;
-                       s = m->g->strip[ss];
-                       do {
-                               assert(OP(s) == OOR2);
-                               ss += OPND(s);
-                       } while (OP(s = m->g->strip[ss]) != O_CH);
-                       /* note that the ss++ gets us past the O_CH */
-                       break;
-               default:        /* have to make a choice */
-                       hard = 1;
-                       break;
-               }
-       if (!hard) {            /* that was it! */
-               if (sp != stop)
-                       return(NULL);
-               return(sp);
-       }
-       ss--;                   /* adjust for the for's final increment */
-
-       /* the hard stuff */
-       AT("hard", sp, stop, ss, stopst);
-       s = m->g->strip[ss];
-       switch (OP(s)) {
-       case OBACK_:            /* the vilest depths */
-               i = (size_t)OPND(s);
-               assert(0 < i && i <= m->g->nsub);
-               if (m->pmatch[i].rm_eo == (regoff_t)-1)
-                       return(NULL);
-               assert(m->pmatch[i].rm_so != (regoff_t)-1);
-               len = (size_t)(m->pmatch[i].rm_eo - m->pmatch[i].rm_so);
-               assert((size_t)(stop - m->beginp) >= len);
-               if (sp > stop - len)
-                       return(NULL);   /* not enough left to match */
-               ssp = m->offp + (size_t)m->pmatch[i].rm_so;
-               if (memcmp(sp, ssp, len) != 0)
-                       return(NULL);
-               while (m->g->strip[ss] != SOP(O_BACK, i))
-                       ss++;
-               return(backref(m, sp+len, stop, ss+1, stopst, lev));
-
-       case OQUEST_:           /* to null or not */
-               dp = backref(m, sp, stop, ss+1, stopst, lev);
-               if (dp != NULL)
-                       return(dp);     /* not */
-               return(backref(m, sp, stop, ss+OPND(s)+1, stopst, lev));
-
-       case OPLUS_:
-               assert(m->lastpos != NULL);
-               assert(lev+1 <= m->g->nplus);
-               m->lastpos[lev+1] = sp;
-               return(backref(m, sp, stop, ss+1, stopst, lev+1));
-
-       case O_PLUS:
-               if (sp == m->lastpos[lev])      /* last pass matched null */
-                       return(backref(m, sp, stop, ss+1, stopst, lev-1));
-               /* try another pass */
-               m->lastpos[lev] = sp;
-               dp = backref(m, sp, stop, ss-OPND(s)+1, stopst, lev);
-               if (dp == NULL)
-                       return(backref(m, sp, stop, ss+1, stopst, lev-1));
-               return(dp);
-
-       case OCH_:              /* find the right one, if any */
-               ssub = ss + 1;
-               esub = ss + OPND(s) - 1;
-               assert(OP(m->g->strip[esub]) == OOR1);
-               for (;;) {      /* find first matching branch */
-                       dp = backref(m, sp, stop, ssub, esub, lev);
-                       if (dp != NULL)
-                               return(dp);
-                       /* that one missed, try next one */
-                       if (OP(m->g->strip[esub]) == O_CH)
-                               break;
-                       esub++;
-                       assert(OP(m->g->strip[esub]) == OOR2);
-                       ssub = esub + 1;
-                       esub += OPND(m->g->strip[esub]);
-                       if (OP(m->g->strip[esub]) == OOR2)
-                               esub--;
-                       else
-                               assert(OP(m->g->strip[esub]) == O_CH);
-               }
-               return(NULL);   /* there is none */
-
-       case OLPAREN:           /* must undo assignment if rest fails */
-               i = (size_t)OPND(s);
-               assert(0 < i && i <= m->g->nsub);
-               offsave = m->pmatch[i].rm_so;
-               m->pmatch[i].rm_so = (regoff_t)(sp - m->offp);
-               dp = backref(m, sp, stop, ss+1, stopst, lev);
-               if (dp != NULL)
-                       return(dp);
-               m->pmatch[i].rm_so = offsave;
-               return(NULL);
-
-       case ORPAREN:           /* must undo assignment if rest fails */
-               i = (size_t)OPND(s);
-               assert(0 < i && i <= m->g->nsub);
-               offsave = m->pmatch[i].rm_eo;
-               m->pmatch[i].rm_eo = (regoff_t)(sp - m->offp);
-               dp = backref(m, sp, stop, ss+1, stopst, lev);
-               if (dp != NULL)
-                       return(dp);
-               m->pmatch[i].rm_eo = offsave;
-               return(NULL);
-
-       default:                /* uh oh */
-               break;
-       }
-       return((const char *)NULL);     /* dummy */
-}
-
-/*
- - fast - step through the string at top speed
- == static const char *fast(register struct match *m, const char *start, \
- ==    const char *stop, sopno startst, sopno stopst);
- */
-static const char *                    /* where tentative match ended, or NULL */
-fast(
-    struct match *     m,
-    const char *       start,
-    const char *       stop,
-    sopno              startst,
-    sopno              stopst)
-{
-       register states st = m->st;
-       register states fresh = m->fresh;
-       register states tmp = m->tmp;
-       register const char *p = start;
-       register int c = (start == m->beginp) ? OUT : *(start-1);
-       register int lastc;     /* previous c */
-       register int flagch;
-       register int i;
-       register const char *coldp;/* last p after which no match was underway */
-
-       CLEAR(st);
-       SET1(st, startst);
-       st = step(m->g, startst, stopst, st, NOTHING, st);
-       ASSIGN(fresh, st);
-       SP("start", st, *p);
-       coldp = NULL;
-       for (;;) {
-               /* next character */
-               lastc = c;
-               c = (p == m->endp) ? OUT : *p;
-               if (EQ(st, fresh))
-                       coldp = p;
-
-               /* is there an EOL and/or BOL between lastc and c? */
-               flagch = '\0';
-               i = 0;
-               if ( (lastc == '\n' && m->g->cflags&REG_NEWLINE) ||
-                               (lastc == OUT && !(m->eflags&REG_NOTBOL)) ) {
-                       flagch = BOL;
-                       i = m->g->nbol;
-               }
-               if ( (c == '\n' && m->g->cflags&REG_NEWLINE) ||
-                               (c == OUT && !(m->eflags&REG_NOTEOL)) ) {
-                       flagch = (flagch == BOL) ? BOLEOL : EOL;
-                       i += m->g->neol;
-               }
-               if (i != 0) {
-                       for (; i > 0; i--)
-                               st = step(m->g, startst, stopst, st, flagch, st);
-                       SP("boleol", st, c);
-               }
-
-               /* how about a word boundary? */
-               if ( (flagch == BOL || (lastc != OUT && !ISWORD(lastc))) &&
-                                       (c != OUT && ISWORD(c)) ) {
-                       flagch = BOW;
-               }
-               if ( (lastc != OUT && ISWORD(lastc)) &&
-                               (flagch == EOL || (c != OUT && !ISWORD(c))) ) {
-                       flagch = EOW;
-               }
-               if (flagch == BOW || flagch == EOW) {
-                       st = step(m->g, startst, stopst, st, flagch, st);
-                       SP("boweow", st, c);
-               }
-
-               /* are we done? */
-               if (ISSET(st, stopst) || p == stop)
-                       break;          /* NOTE BREAK OUT */
-
-               /* no, we must deal with this character */
-               ASSIGN(tmp, st);
-               ASSIGN(st, fresh);
-               assert(c != OUT);
-               st = step(m->g, startst, stopst, tmp, c, st);
-               SP("aft", st, c);
-               assert(EQ(step(m->g, startst, stopst, st, NOTHING, st), st));
-               p++;
-       }
-
-       assert(coldp != NULL);
-       m->coldp = coldp;
-       if (ISSET(st, stopst))
-               return(p+1);
-       else
-               return(NULL);
-}
-
-/*
- - slow - step through the string more deliberately
- == static const char *slow(register struct match *m, const char *start, \
- ==    const char *stop, sopno startst, sopno stopst);
- */
-static const char *                    /* where it ended */
-slow(
-    struct match *     m,
-    const char *       start,
-    const char *       stop,
-    sopno              startst,
-    sopno              stopst)
-{
-       register states st = m->st;
-       register states empty = m->empty;
-       register states tmp = m->tmp;
-       register const char *p = start;
-       register int c = (start == m->beginp) ? OUT : *(start-1);
-       register int lastc;     /* previous c */
-       register int flagch;
-       register int i;
-       register const char *matchp;    /* last p at which a match ended */
-
-       AT("slow", start, stop, startst, stopst);
-       CLEAR(st);
-       SET1(st, startst);
-       SP("sstart", st, *p);
-       st = step(m->g, startst, stopst, st, NOTHING, st);
-       matchp = NULL;
-       for (;;) {
-               /* next character */
-               lastc = c;
-               c = (p == m->endp) ? OUT : *p;
-
-               /* is there an EOL and/or BOL between lastc and c? */
-               flagch = '\0';
-               i = 0;
-               if ( (lastc == '\n' && m->g->cflags&REG_NEWLINE) ||
-                               (lastc == OUT && !(m->eflags&REG_NOTBOL)) ) {
-                       flagch = BOL;
-                       i = m->g->nbol;
-               }
-               if ( (c == '\n' && m->g->cflags&REG_NEWLINE) ||
-                               (c == OUT && !(m->eflags&REG_NOTEOL)) ) {
-                       flagch = (flagch == BOL) ? BOLEOL : EOL;
-                       i += m->g->neol;
-               }
-               if (i != 0) {
-                       for (; i > 0; i--)
-                               st = step(m->g, startst, stopst, st, flagch, st);
-                       SP("sboleol", st, c);
-               }
-
-               /* how about a word boundary? */
-               if ( (flagch == BOL || (lastc != OUT && !ISWORD(lastc))) &&
-                                       (c != OUT && ISWORD(c)) ) {
-                       flagch = BOW;
-               }
-               if ( (lastc != OUT && ISWORD(lastc)) &&
-                               (flagch == EOL || (c != OUT && !ISWORD(c))) ) {
-                       flagch = EOW;
-               }
-               if (flagch == BOW || flagch == EOW) {
-                       st = step(m->g, startst, stopst, st, flagch, st);
-                       SP("sboweow", st, c);
-               }
-
-               /* are we done? */
-               if (ISSET(st, stopst))
-                       matchp = p;
-               if (EQ(st, empty) || p == stop)
-                       break;          /* NOTE BREAK OUT */
-
-               /* no, we must deal with this character */
-               ASSIGN(tmp, st);
-               ASSIGN(st, empty);
-               assert(c != OUT);
-               st = step(m->g, startst, stopst, tmp, c, st);
-               SP("saft", st, c);
-               assert(EQ(step(m->g, startst, stopst, st, NOTHING, st), st));
-               p++;
-       }
-
-       return(matchp);
-}
-
-
-/*
- - step - map set of states reachable before char to set reachable after
- == static states step(register struct re_guts *g, sopno start, sopno stop, \
- ==    register states bef, int ch, register states aft);
- == #define    BOL     (OUT+1)
- == #define    EOL     (BOL+1)
- == #define    BOLEOL  (BOL+2)
- == #define    NOTHING (BOL+3)
- == #define    BOW     (BOL+4)
- == #define    EOW     (BOL+5)
- == #define    CODEMAX (BOL+5)         // highest code used
- == #define    NONCHAR(c)      ((c) > CHAR_MAX)
- == #define    NNONCHAR        (CODEMAX-CHAR_MAX)
- */
-static states
-step(
-    struct re_guts *   g,
-    sopno              start,  /* start state within strip */
-    sopno              stop,   /* state after stop state within strip */
-    register states    bef,    /* states reachable before */
-    int                        ch,     /* character or NONCHAR code */
-    states             aft)    /* states already known reachable after */
-{
-       register cset *cs;
-       register sop s;
-       register sopno pc;
-       register sopno here;            /* note, macros know this name */
-       register sopno look;
-       register unsigned long i;
-
-       for (pc = start, INIT(here, pc); pc != stop; pc++, INC(here)) {
-               s = g->strip[pc];
-               switch (OP(s)) {
-               case OEND:
-                       assert(pc == stop-1);
-                       break;
-               case OCHAR:
-                       /* only characters can match */
-                       assert(!NONCHAR(ch) || ch != (char)OPND(s));
-                       if (ch == (char)OPND(s))
-                               FWD(aft, bef, 1);
-                       break;
-               case OBOL:
-                       if (ch == BOL || ch == BOLEOL)
-                               FWD(aft, bef, 1);
-                       break;
-               case OEOL:
-                       if (ch == EOL || ch == BOLEOL)
-                               FWD(aft, bef, 1);
-                       break;
-               case OBOW:
-                       if (ch == BOW)
-                               FWD(aft, bef, 1);
-                       break;
-               case OEOW:
-                       if (ch == EOW)
-                               FWD(aft, bef, 1);
-                       break;
-               case OANY:
-                       if (!NONCHAR(ch))
-                               FWD(aft, bef, 1);
-                       break;
-               case OANYOF:
-                       cs = &g->sets[OPND(s)];
-                       if (!NONCHAR(ch) && CHIN(cs, ch))
-                               FWD(aft, bef, 1);
-                       break;
-               case OBACK_:            /* ignored here */
-               case O_BACK:
-                       FWD(aft, aft, 1);
-                       break;
-               case OPLUS_:            /* forward, this is just an empty */
-                       FWD(aft, aft, 1);
-                       break;
-               case O_PLUS:            /* both forward and back */
-                       FWD(aft, aft, 1);
-                       i = (unsigned long)ISSETBACK(aft, OPND(s));
-                       BACK(aft, aft, OPND(s));
-                       if (!i && ISSETBACK(aft, OPND(s))) {
-                               /* oho, must reconsider loop body */
-                               pc -= OPND(s) + 1;
-                               INIT(here, pc);
-                       }
-                       break;
-               case OQUEST_:           /* two branches, both forward */
-                       FWD(aft, aft, 1);
-                       FWD(aft, aft, OPND(s));
-                       break;
-               case O_QUEST:           /* just an empty */
-                       FWD(aft, aft, 1);
-                       break;
-               case OLPAREN:           /* not significant here */
-               case ORPAREN:
-                       FWD(aft, aft, 1);
-                       break;
-               case OCH_:              /* mark the first two branches */
-                       FWD(aft, aft, 1);
-                       assert(OP(g->strip[pc+OPND(s)]) == OOR2);
-                       FWD(aft, aft, OPND(s));
-                       break;
-               case OOR1:              /* done a branch, find the O_CH */
-                       if (ISSTATEIN(aft, here)) {
-                               for (look = 1;
-                                               OP(s = g->strip[pc+look]) != O_CH;
-                                               look += OPND(s))
-                                       assert(OP(s) == OOR2);
-                               FWD(aft, aft, look);
-                       }
-                       break;
-               case OOR2:              /* propagate OCH_'s marking */
-                       FWD(aft, aft, 1);
-                       if (OP(g->strip[pc+OPND(s)]) != O_CH) {
-                               assert(OP(g->strip[pc+OPND(s)]) == OOR2);
-                               FWD(aft, aft, OPND(s));
-                       }
-                       break;
-               case O_CH:              /* just empty */
-                       FWD(aft, aft, 1);
-                       break;
-               default:                /* ooooops... */
-                       break;
-               }
-       }
-
-       return(aft);
-}
-
-#ifdef REDEBUG
-/*
- - print - print a set of states
- == #ifdef REDEBUG
- == static void print(struct match *m, char *caption, states st, \
- ==    int ch, FILE *d);
- == #endif
- */
-static void
-print(
-    struct match *     m,
-    char *             caption,
-    states             st,
-    int                        ch,
-    FILE *             d)
-{
-       register struct re_guts *g = m->g;
-       register int i;
-       register int first = 1;
-
-       if (!(m->eflags&REG_TRACE))
-               return;
-
-       fprintf(d, "%s", caption);
-       if (ch != '\0')
-               fprintf(d, " %s", pchar(ch));
-       for (i = 0; i < g->nstates; i++)
-               if (ISSET(st, i)) {
-                       fprintf(d, "%s%d", (first) ? "\t" : ", ", i);
-                       first = 0;
-               }
-       fprintf(d, "\n");
-}
-
-/* 
- - at - print current situation
- == #ifdef REDEBUG
- == static void at(struct match *m, char *title, const char *start, \
- ==                    const char *stop, sopno startst, sopno stopst);
- == #endif
- */
-static void
-at(
-    struct match *     m,
-    const char *       title,
-    const char *       start,
-    const char *       stop,
-    sopno              startst,
-    sopno              stopst)
-{
-       if (!(m->eflags&REG_TRACE))
-               return;
-
-       printf("%s %s-", title, pchar(*start));
-       printf("%s ", pchar(*stop));
-       printf("%ld-%ld\n", (long)startst, (long)stopst);
-}
-
-#ifndef PCHARDONE
-#define        PCHARDONE       /* never again */
-/*
- - pchar - make a character printable
- == #ifdef REDEBUG
- == static char *pchar(int ch);
- == #endif
- *
- * Is this identical to regchar() over in debug.c?  Well, yes.  But a
- * duplicate here avoids having a debugging-capable regexec.o tied to
- * a matching debug.o, and this is convenient.  It all disappears in
- * the non-debug compilation anyway, so it doesn't matter much.
- */
-static char *                  /* -> representation */
-pchar(
-    int                ch)
-{
-       static char pbuf[10];
-
-       if (isprint(ch) || ch == ' ')
-               snprintf(pbuf, SIZEOF(pbuf), "%c", ch);
-       else
-               snprintf(pbuf, SIZEOF(pbuf), "\\%o", ch);
-       return(pbuf);
-}
-#endif
-#endif
-
-#undef matcher
-#undef fast
-#undef slow
-#undef dissect
-#undef backref
-#undef step
-#undef print
-#undef at
-#undef match
diff --git a/regex-src/fake/limits.h b/regex-src/fake/limits.h
deleted file mode 100644 (file)
index 94429e6..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#define        _POSIX2_RE_DUP_MAX      255
-#define        CHAR_MIN        (-128)
-#define        CHAR_MAX        127
-#define        CHAR_BIT        8
diff --git a/regex-src/fake/memmove.c b/regex-src/fake/memmove.c
deleted file mode 100644 (file)
index daebcd0..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-#include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
-
-/*
- - memmove - fake ANSI C routine
- */
-char *
-memmove(dst, src, count)
-char *dst;
-char *src;
-size_t count;
-{
-       register char *s;
-       register char *d;
-       register size_t n;
-
-       if (dst > src)
-               for (d = dst+count, s = src+count, n = count; n > 0; n--)
-                       *--d = *--s;
-       else
-               for (d = dst, s = src, n = count; n > 0; n--)
-                       *d++ = *s++;
-
-       return(dst);
-}
diff --git a/regex-src/fake/stdlib.h b/regex-src/fake/stdlib.h
deleted file mode 100644 (file)
index 34ac2ee..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-extern char *malloc();
-extern char *realloc();
diff --git a/regex-src/main.c b/regex-src/main.c
deleted file mode 100644 (file)
index 8519d36..0000000
+++ /dev/null
@@ -1,512 +0,0 @@
-#include "amanda.h"
-#include <regex.h>
-
-#include "main.ih"
-
-char *progname;
-int debug = 0;
-int line = 0;
-int status = 0;
-
-int copts = REG_EXTENDED;
-int eopts = 0;
-regoff_t startoff = 0;
-regoff_t endoff = 0;
-
-
-extern int split();
-extern void regprint();
-
-/*
- - main - do the simple case, hand off to regress() for regression
- */
-main(argc, argv)
-int argc;
-char *argv[];
-{
-       regex_t re;
-#      define  NS      10
-       regmatch_t subs[NS];
-       char erbuf[100];
-       int err;
-       size_t len;
-       int c;
-       int errflg = 0;
-       register int i;
-       extern int optind;
-       extern char *optarg;
-
-       progname = argv[0];
-
-       while ((c = getopt(argc, argv, "c:e:S:E:x")) != EOF)
-               switch (c) {
-               case 'c':       /* compile options */
-                       copts = options('c', optarg);
-                       break;
-               case 'e':       /* execute options */
-                       eopts = options('e', optarg);
-                       break;
-               case 'S':       /* start offset */
-                       startoff = (regoff_t)atoi(optarg);
-                       break;
-               case 'E':       /* end offset */
-                       endoff = (regoff_t)atoi(optarg);
-                       break;
-               case 'x':       /* Debugging. */
-                       debug++;
-                       break;
-               case '?':
-               default:
-                       errflg++;
-                       break;
-               }
-       if (errflg) {
-               fprintf(stderr, "usage: %s ", progname);
-               fprintf(stderr, "[-c copt][-C][-d] [re]\n");
-               exit(2);
-       }
-
-       if (optind >= argc) {
-               regress(stdin);
-               exit(status);
-       }
-
-       err = regcomp(&re, argv[optind++], copts);
-       if (err) {
-               len = regerror(err, &re, erbuf, SIZEOF(erbuf));
-               fprintf(stderr, "error %s, %d/%d `%s'\n",
-                       eprint(err), len, SIZEOF(erbuf), erbuf);
-               exit(status);
-       }
-       regprint(&re, stdout);  
-
-       if (optind >= argc) {
-               regfree(&re);
-               exit(status);
-       }
-
-       if (eopts&REG_STARTEND) {
-               subs[0].rm_so = startoff;
-               subs[0].rm_eo = strlen(argv[optind]) - endoff;
-       }
-       err = regexec(&re, argv[optind], (size_t)NS, subs, eopts);
-       if (err) {
-               len = regerror(err, &re, erbuf, SIZEOF(erbuf));
-               fprintf(stderr, "error %s, %d/%d `%s'\n",
-                       eprint(err), len, SIZEOF(erbuf), erbuf);
-               exit(status);
-       }
-       if (!(copts&REG_NOSUB)) {
-               len = (int)(subs[0].rm_eo - subs[0].rm_so);
-               if (subs[0].rm_so != -1) {
-                       if (len != 0)
-                               printf("match `%.*s'\n", len,
-                                       argv[optind] + subs[0].rm_so);
-                       else
-                               printf("match `'@%.1s\n",
-                                       argv[optind] + subs[0].rm_so);
-               }
-               for (i = 1; i < NS; i++)
-                       if (subs[i].rm_so != -1)
-                               printf("(%d) `%.*s'\n", i,
-                                       (int)(subs[i].rm_eo - subs[i].rm_so),
-                                       argv[optind] + subs[i].rm_so);
-       }
-       exit(status);
-}
-
-/*
- - regress - main loop of regression test
- == void regress(FILE *in);
- */
-void
-regress(in)
-FILE *in;
-{
-       char inbuf[1000];
-#      define  MAXF    10
-       char *f[MAXF];
-       int nf;
-       int i;
-       char erbuf[100];
-       size_t ne;
-       char *badpat = "invalid regular expression";
-#      define  SHORT   10
-       char *bpname = "REG_BADPAT";
-       regex_t re;
-
-       while (fgets(inbuf, (int)sizeof(inbuf), in) != NULL) {
-               line++;
-               if (inbuf[0] == '#' || inbuf[0] == '\n')
-                       continue;                       /* NOTE CONTINUE */
-               inbuf[strlen(inbuf)-1] = '\0';  /* get rid of stupid \n */
-               if (debug)
-                       fprintf(stdout, "%d:\n", line);
-               nf = split(inbuf, f, MAXF, "\t\t");
-               if (nf < 3) {
-                       fprintf(stderr, "bad input, line %d\n", line);
-                       exit(1);
-               }
-               for (i = 0; i < nf; i++)
-                       if (strcmp(f[i], "\"\"") == 0)
-                               f[i] = "";
-               if (nf <= 3)
-                       f[3] = NULL;
-               if (nf <= 4)
-                       f[4] = NULL;
-               try(f[0], f[1], f[2], f[3], f[4], options('c', f[1]));
-               if (opt('&', f[1]))     /* try with either type of RE */
-                       try(f[0], f[1], f[2], f[3], f[4],
-                                       options('c', f[1]) &~ REG_EXTENDED);
-       }
-
-       ne = regerror(REG_BADPAT, (regex_t *)NULL, erbuf, SIZEOF(erbuf));
-       if (strcmp(erbuf, badpat) != 0 || ne != strlen(badpat)+1) {
-               fprintf(stderr, "end: regerror() test gave `%s' not `%s'\n",
-                                                       erbuf, badpat);
-               status = 1;
-       }
-       ne = regerror(REG_BADPAT, (regex_t *)NULL, erbuf, (size_t)SHORT);
-       if (strncmp(erbuf, badpat, SHORT-1) != 0 || erbuf[SHORT-1] != '\0' ||
-                                               ne != strlen(badpat)+1) {
-               fprintf(stderr, "end: regerror() short test gave `%s' not `%.*s'\n",
-                                               erbuf, SHORT-1, badpat);
-               status = 1;
-       }
-       ne = regerror(REG_ITOA|REG_BADPAT, (regex_t *)NULL, erbuf, SIZEOF(erbuf));
-       if (strcmp(erbuf, bpname) != 0 || ne != strlen(bpname)+1) {
-               fprintf(stderr, "end: regerror() ITOA test gave `%s' not `%s'\n",
-                                               erbuf, bpname);
-               status = 1;
-       }
-       re.re_endp = bpname;
-       ne = regerror(REG_ATOI, &re, erbuf, SIZEOF(erbuf));
-       if (atoi(erbuf) != (int)REG_BADPAT) {
-               fprintf(stderr, "end: regerror() ATOI test gave `%s' not `%ld'\n",
-                                               erbuf, (long)REG_BADPAT);
-               status = 1;
-       } else if (ne != strlen(erbuf)+1) {
-               fprintf(stderr, "end: regerror() ATOI test len(`%s') = %ld\n",
-                                               erbuf, (long)REG_BADPAT);
-               status = 1;
-       }
-}
-
-/*
- - try - try it, and report on problems
- == void try(char *f0, char *f1, char *f2, char *f3, char *f4, int opts);
- */
-void
-try(f0, f1, f2, f3, f4, opts)
-char *f0;
-char *f1;
-char *f2;
-char *f3;
-char *f4;
-int opts;                      /* may not match f1 */
-{
-       regex_t re;
-#      define  NSUBS   10
-       regmatch_t subs[NSUBS];
-#      define  NSHOULD 15
-       char *should[NSHOULD];
-       int nshould;
-       char erbuf[100];
-       int err;
-       int len;
-       char *type = (opts & REG_EXTENDED) ? "ERE" : "BRE";
-       register int i;
-       char *grump;
-       char f0copy[1000];
-       char f2copy[1000];
-
-       strncpy(f0copy, f0, SIZEOF(f0copy)-1);
-       f0copy[SIZEOF(f0copy)-1] = '\0';
-       re.re_endp = (opts&REG_PEND) ? f0copy + strlen(f0copy) : NULL;
-       fixstr(f0copy);
-       err = regcomp(&re, f0copy, opts);
-       if (err != 0 && (!opt('C', f1) || err != efind(f2))) {
-               /* unexpected error or wrong error */
-               len = regerror(err, &re, erbuf, SIZEOF(erbuf));
-               fprintf(stderr, "%d: %s error %s, %d/%d `%s'\n",
-                                       line, type, eprint(err), len,
-                                       SIZEOF(erbuf), erbuf);
-               status = 1;
-       } else if (err == 0 && opt('C', f1)) {
-               /* unexpected success */
-               fprintf(stderr, "%d: %s should have given REG_%s\n",
-                                               line, type, f2);
-               status = 1;
-               err = 1;        /* so we won't try regexec */
-       }
-
-       if (err != 0) {
-               regfree(&re);
-               return;
-       }
-
-       strncpy(f2copy, f2, SIZEOF(f2copy)-1);
-       f2copy[SIZEOF(f2copy)-1] = '\0';
-       fixstr(f2copy);
-
-       if (options('e', f1)&REG_STARTEND) {
-               if (strchr(f2, '(') == NULL || strchr(f2, ')') == NULL)
-                       fprintf(stderr, "%d: bad STARTEND syntax\n", line);
-               subs[0].rm_so = strchr(f2, '(') - f2 + 1;
-               subs[0].rm_eo = strchr(f2, ')') - f2;
-       }
-       err = regexec(&re, f2copy, NSUBS, subs, options('e', f1));
-
-       if (err != 0 && (f3 != NULL || err != REG_NOMATCH)) {
-               /* unexpected error or wrong error */
-               len = regerror(err, &re, erbuf, SIZEOF(erbuf));
-               fprintf(stderr, "%d: %s exec error %s, %d/%d `%s'\n",
-                                       line, type, eprint(err), len,
-                                       SIZEOF(erbuf), erbuf);
-               status = 1;
-       } else if (err != 0) {
-               /* nothing more to check */
-       } else if (f3 == NULL) {
-               /* unexpected success */
-               fprintf(stderr, "%d: %s exec should have failed\n",
-                                               line, type);
-               status = 1;
-               err = 1;                /* just on principle */
-       } else if (opts&REG_NOSUB) {
-               /* nothing more to check */
-       } else if ((grump = check(f2, subs[0], f3)) != NULL) {
-               fprintf(stderr, "%d: %s %s\n", line, type, grump);
-               status = 1;
-               err = 1;
-       }
-
-       if (err != 0 || f4 == NULL) {
-               regfree(&re);
-               return;
-       }
-
-       for (i = 1; i < NSHOULD; i++)
-               should[i] = NULL;
-       nshould = split(f4, should+1, NSHOULD-1, ",");
-       if (nshould == 0) {
-               nshould = 1;
-               should[1] = "";
-       }
-       for (i = 1; i < NSUBS; i++) {
-               grump = check(f2, subs[i], should[i]);
-               if (grump != NULL) {
-                       fprintf(stderr, "%d: %s $%d %s\n", line,
-                                                       type, i, grump);
-                       status = 1;
-                       err = 1;
-               }
-       }
-
-       regfree(&re);
-}
-
-/*
- - options - pick options out of a regression-test string
- == int options(int type, char *s);
- */
-int
-options(type, s)
-int type;                      /* 'c' compile, 'e' exec */
-char *s;
-{
-       register char *p;
-       register int o = (type == 'c') ? copts : eopts;
-       register char *legal = (type == 'c') ? "bisnmp" : "^$#tl";
-
-       for (p = s; *p != '\0'; p++)
-               if (strchr(legal, *p) != NULL)
-                       switch (*p) {
-                       case 'b':
-                               o &= ~REG_EXTENDED;
-                               break;
-                       case 'i':
-                               o |= REG_ICASE;
-                               break;
-                       case 's':
-                               o |= REG_NOSUB;
-                               break;
-                       case 'n':
-                               o |= REG_NEWLINE;
-                               break;
-                       case 'm':
-                               o &= ~REG_EXTENDED;
-                               o |= REG_NOSPEC;
-                               break;
-                       case 'p':
-                               o |= REG_PEND;
-                               break;
-                       case '^':
-                               o |= REG_NOTBOL;
-                               break;
-                       case '$':
-                               o |= REG_NOTEOL;
-                               break;
-                       case '#':
-                               o |= REG_STARTEND;
-                               break;
-                       case 't':       /* trace */
-                               o |= REG_TRACE;
-                               break;
-                       case 'l':       /* force long representation */
-                               o |= REG_LARGE;
-                               break;
-                       case 'r':       /* force backref use */
-                               o |= REG_BACKR;
-                               break;
-                       }
-       return(o);
-}
-
-/*
- - opt - is a particular option in a regression string?
- == int opt(int c, char *s);
- */
-int                            /* predicate */
-opt(c, s)
-int c;
-char *s;
-{
-       return(strchr(s, c) != NULL);
-}
-
-/*
- - fixstr - transform magic characters in strings
- == void fixstr(register char *p);
- */
-void
-fixstr(p)
-register char *p;
-{
-       if (p == NULL)
-               return;
-
-       for (; *p != '\0'; p++)
-               if (*p == 'N')
-                       *p = '\n';
-               else if (*p == 'T')
-                       *p = '\t';
-               else if (*p == 'S')
-                       *p = ' ';
-               else if (*p == 'Z')
-                       *p = '\0';
-}
-
-/*
- - check - check a substring match
- == char *check(char *str, regmatch_t sub, char *should);
- */
-char *                         /* NULL or complaint */
-check(str, sub, should)
-char *str;
-regmatch_t sub;
-char *should;
-{
-       register int len;
-       register int shlen;
-       register char *p;
-       static char grump[500];
-       register char *at = NULL;
-
-       if (should != NULL && strcmp(should, "-") == 0)
-               should = NULL;
-       if (should != NULL && should[0] == '@') {
-               at = should + 1;
-               should = "";
-       }
-
-       /* check rm_so and rm_eo for consistency */
-       if (sub.rm_so > sub.rm_eo || (sub.rm_so == -1 && sub.rm_eo != -1) ||
-                               (sub.rm_so != -1 && sub.rm_eo == -1) ||
-                               (sub.rm_so != -1 && sub.rm_so < 0) ||
-                               (sub.rm_eo != -1 && sub.rm_eo < 0) ) {
-               snprintf(grump, SIZEOF(grump),
-                           "start %ld end %ld", (long)sub.rm_so,
-                           (long)sub.rm_eo);
-               return(grump);
-       }
-
-       /* check for no match */
-       if (sub.rm_so == -1 && should == NULL)
-               return(NULL);
-       if (sub.rm_so == -1)
-               return("did not match");
-
-       /* check for in range */
-       if (sub.rm_eo > strlen(str)) {
-               snprintf(grump, SIZEOF(grump),
-                           "start %ld end %ld, past end of string",
-                           (long)sub.rm_so, (long)sub.rm_eo);
-               return(grump);
-       }
-
-       len = (int)(sub.rm_eo - sub.rm_so);
-       shlen = (int)strlen(should);
-       p = str + sub.rm_so;
-
-       /* check for not supposed to match */
-       if (should == NULL) {
-               snprintf(grump, SIZEOF(grump), "matched `%.*s'", len, p);
-               return(grump);
-       }
-
-       /* check for wrong match */
-       if (len != shlen || strncmp(p, should, (size_t)shlen) != 0) {
-               snprintf(grump, SIZEOF(grump),
-                           "matched `%.*s' instead", len, p);
-               return(grump);
-       }
-       if (shlen > 0)
-               return(NULL);
-
-       /* check null match in right place */
-       if (at == NULL)
-               return(NULL);
-       shlen = strlen(at);
-       if (shlen == 0)
-               shlen = 1;      /* force check for end-of-string */
-       if (strncmp(p, at, shlen) != 0) {
-               snprintf(grump, SIZEOF(grump), "matched null at `%.20s'", p);
-               return(grump);
-       }
-       return(NULL);
-}
-
-/*
- - eprint - convert error number to name
- == static char *eprint(int err);
- */
-static char *
-eprint(err)
-int err;
-{
-       static char epbuf[100];
-       size_t len;
-
-       len = regerror(REG_ITOA|err, (regex_t *)NULL, epbuf, SIZEOF(epbuf));
-       assert(len <= SIZEOF(epbuf));
-       return(epbuf);
-}
-
-/*
- - efind - convert error name to number
- == static int efind(char *name);
- */
-static int
-efind(name)
-char *name;
-{
-       static char efbuf[100];
-       size_t n;
-       regex_t re;
-
-       snprintf(efbuf, SIZEOF(efbuf), "REG_%s", name);
-       assert(strlen(efbuf) < SIZEOF(efbuf));
-       re.re_endp = efbuf;
-       (void) regerror(REG_ATOI, &re, efbuf, SIZEOF(efbuf));
-       return(atoi(efbuf));
-}
diff --git a/regex-src/mkh b/regex-src/mkh
deleted file mode 100644 (file)
index 92d2bfa..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-#! /bin/sh
-# mkh - pull headers out of C source
-PATH=/bin:/usr/bin ; export PATH
-
-# egrep pattern to pick out marked lines
-egrep='^ =([   ]|$)'
-
-# Sed program to process marked lines into lines for the header file.
-# The markers have already been removed.  Two things are done here:  removal
-# of backslashed newlines, and some fudging of comments.  The first is done
-# because -o needs to have prototypes on one line to strip them down.
-# Getting comments into the output is tricky; we turn C++-style // comments
-# into /* */ comments, after altering any existing */'s to avoid trouble.
-peel=' /\\$/N
-       /\\\n[  ]*/s///g
-       /\/\//s;\*/;* /;g
-       /\/\//s;//\(.*\);/*\1 */;'
-
-for a
-do
-       case "$a" in
-       -o)     # old (pre-function-prototype) compiler
-               # add code to comment out argument lists
-               peel="$peel
-                       "'/^\([^#\/][^\/]*[a-zA-Z0-9_)]\)(\(.*\))/s;;\1(/*\2*/);'
-               shift
-               ;;
-       -A)     # funny Amanda P macro
-               peel="$peel
-                       "'/^\([^#\/][^\/]*[a-zA-Z0-9_)]\)(\(.*\))/s;;\1 P((\2));'
-               shift
-               ;;
-       -b)     # funny Berkeley __P macro
-               peel="$peel
-                       "'/^\([^#\/][^\/]*[a-zA-Z0-9_)]\)(\(.*\))/s;;\1 __P((\2));'
-               shift
-               ;;
-       -s)     # compiler doesn't like `static foo();'
-               # add code to get rid of the `static'
-               peel="$peel
-                       "'/^static[     ][^\/]*[a-zA-Z0-9_)](.*)/s;static.;;'
-               shift
-               ;;
-       -p)     # private declarations
-               egrep='^ ==([   ]|$)'
-               shift
-               ;;
-       -i)     # wrap in #ifndef, argument is name
-               ifndef="$2"
-               shift ; shift
-               ;;
-       *)      break
-               ;;
-       esac
-done
-
-if test " $ifndef" != " "
-then
-       echo "#ifndef $ifndef"
-       echo "#define   $ifndef /* never again */"
-fi
-echo "/* ========= begin header generated by $0 ========= */"
-echo '#ifdef __cplusplus'
-echo 'extern "C" {'
-echo '#endif'
-for f
-do
-       echo
-       echo "/* === $f === */"
-       egrep "$egrep" $f | sed 's/^ ==*[       ]//;s/^ ==*$//' | sed "$peel"
-       echo
-done
-echo '#ifdef __cplusplus'
-echo '}'
-echo '#endif'
-echo "/* ========= end header generated by $0 ========= */"
-if test " $ifndef" != " "
-then
-       echo "#endif"
-fi
-exit 0
diff --git a/regex-src/regcomp.c b/regex-src/regcomp.c
deleted file mode 100644 (file)
index 2f9fa70..0000000
+++ /dev/null
@@ -1,1592 +0,0 @@
-#include "amanda.h"
-#include <regex.h>
-#include "utils.h"
-#include "regex2.h"
-
-#include "cclass.h"
-#include "cname.h"
-
-/*
- * parse structure, passed up and down to avoid global variables and
- * other clumsinesses
- */
-struct parse {
-       char *next;             /* next character in RE */
-       char *end;              /* end of string (-> NUL normally) */
-       int error;              /* has an error been seen? */
-       sop *strip;             /* malloced strip */
-       size_t ssize;           /* malloced strip size (allocated) */
-       size_t slen;            /* malloced strip length (used) */
-       int ncsalloc;           /* number of csets allocated */
-       struct re_guts *g;
-#      define  NPAREN  10      /* we need to remember () 1-9 for back refs */
-       sopno pbegin[NPAREN];   /* -> ( ([0] unused) */
-       sopno pend[NPAREN];     /* -> ) ([0] unused) */
-};
-
-#include "regcomp.ih"
-
-static char nuls[10];          /* place to point scanner in event of error */
-
-/*
- * macros for use with parse structure
- * BEWARE:  these know that the parse structure is named `p' !!!
- */
-#define        PEEK()  (*p->next)
-#define        PEEK2() (*(p->next+1))
-#define        MORE()  (p->next < p->end)
-#define        MORE2() (p->next+1 < p->end)
-#define        SEE(c)  (MORE() && PEEK() == (c))
-#define        SEETWO(a, b)    (MORE() && MORE2() && PEEK() == (a) && PEEK2() == (b))
-#define        EAT(c)  ((SEE(c)) ? (NEXT(), 1) : 0)
-#define        EATTWO(a, b)    ((SEETWO(a, b)) ? (NEXT2(), 1) : 0)
-#define        NEXT()  (p->next++)
-#define        NEXT2() (p->next += 2)
-#define        NEXTn(n)        (p->next += (n))
-#define        GETNEXT()       (*p->next++)
-#define        SETERROR(e)     seterr(p, (e))
-#define        REQUIRE(co, e)  ((co) || SETERROR(e))
-#define        MUSTSEE(c, e)   (REQUIRE(MORE() && PEEK() == (c), e))
-#define        MUSTEAT(c, e)   (REQUIRE(MORE() && GETNEXT() == (c), e))
-#define        MUSTNOTSEE(c, e)        (REQUIRE(!MORE() || PEEK() != (c), e))
-#define        EMIT(op, sopnd) doemit(p, (sop)(op), (size_t)(sopnd))
-#define        INSERT(op, pos) doinsert(p, (sop)(op), HERE()-(size_t)(pos)+1, (size_t)pos)
-#define        AHEAD(pos)              dofwd(p, (size_t)pos, HERE()-(size_t)(pos))
-#define        ASTERN(sop, pos)        EMIT(sop, HERE()-(size_t)(pos))
-#define        HERE()          (size_t)(p->slen)
-#define        THERE()         (size_t)(p->slen - 1)
-#define        THERETHERE()    (size_t)(p->slen - 2)
-#define        DROP(n)         (p->slen = p->slen - (size_t)(n))
-
-#ifndef NDEBUG
-static int never = 0;          /* for use in asserts; shuts lint up */
-#else
-#define        never   0               /* some <assert.h>s have bugs too */
-#endif
-
-static void p_ere(struct parse *p, int stop);
-static void p_ere_exp(struct parse *p);
-static void p_str(struct parse *p);
-static void p_bre(struct parse *p, int end1, int end2);
-static int p_simp_re(struct parse *p, int starordinary);
-static int p_count(struct parse *p);
-static void p_bracket(struct parse *p);
-static void p_b_term(struct parse *p, cset *cs);
-static void p_b_cclass(struct parse *p, cset *cs);
-static void p_b_eclass(struct parse *p, cset *cs);
-static char p_b_symbol(struct parse *p);
-static char p_b_coll_elem(struct parse *p, int endc);
-static char othercase(int ch);
-static void bothcases(struct parse *p, int ch);
-static void ordinary(struct parse *p, int ch);
-static void nonnewline(struct parse *p);
-static void repeat(struct parse *p, sopno start, int from, int to);
-static int seterr(struct parse *p, int e);
-static cset * allocset(struct parse *p);
-static void freeset(struct parse *p, cset *cs);
-static int freezeset(struct parse *p, cset *cs);
-static int firstch(struct parse *p, cset *cs);
-static int nch(struct parse *p, cset *cs);
-static void mcadd(struct parse *p, cset *cs, char *cp);
-static void mcinvert(struct parse *p, cset *cs);
-static void mccase(struct parse *p, cset *cs);
-static int isinsets(struct re_guts *g, int c);
-static int samesets(struct re_guts *g, int c1, int c2);
-static void categorize(struct parse *p, struct re_guts *g);
-static sopno dupl(struct parse *p, sopno start, sopno finish);
-static void doemit(struct parse *p, sop op, size_t opnd);
-static void doinsert(struct parse *p, sop op, size_t opnd, sopno pos);
-static void dofwd(struct parse *p, sopno pos, sop value);
-static void enlarge(struct parse *p, sopno size);
-static void stripsnug(struct parse *p, struct re_guts *g);
-static void findmust(struct parse *p, struct re_guts *g);
-static sopno pluscount(struct parse *p, struct re_guts *g);
-
-
-/*
- - regcomp - interface for parser and compilation
- = extern int regcomp(regex_t *, const char *, int);
- = #define     REG_BASIC       0000
- = #define     REG_EXTENDED    0001
- = #define     REG_ICASE       0002
- = #define     REG_NOSUB       0004
- = #define     REG_NEWLINE     0010
- = #define     REG_NOSPEC      0020
- = #define     REG_PEND        0040
- = #define     REG_DUMP        0200
- */
-int                            /* 0 success, otherwise REG_something */
-regcomp(
-    regex_t *  preg,
-    const char *pattern,
-    int                cflags)
-{
-       struct parse pa;
-       struct re_guts *g;
-       struct parse *p = &pa;
-       int i;
-       size_t len;
-#ifdef REDEBUG
-#      define  GOODFLAGS(f)    (f)
-#else
-#      define  GOODFLAGS(f)    ((f)&~REG_DUMP)
-#endif
-
-       cflags = GOODFLAGS(cflags);
-#if !defined(__lint) /* Lint global check knows nobody calls with this combo */
-       if ((cflags&REG_EXTENDED) && (cflags&REG_NOSPEC))
-               return(REG_INVARG);
-
-       if (cflags & REG_PEND) {
-               /*@ignore@*/
-               if (preg->re_endp < pattern)
-                       return(REG_INVARG);
-               len = (size_t)(preg->re_endp - pattern);
-               /*@end@*/
-       } else
-#endif
-               len = strlen((char *)pattern);
-
-       /* do the mallocs early so failure handling is easy */
-       g = (struct re_guts *)malloc(SIZEOF(struct re_guts) +
-                                                       (NC-1)*SIZEOF(cat_t));
-       if (g == NULL)
-               return(REG_ESPACE);
-       p->ssize = (sopno)(((len / (size_t)2) * (size_t)3) + (size_t)1);
-       p->strip = (sop *)malloc((size_t)p->ssize * SIZEOF(sop));
-       p->slen = 0;
-       if (p->strip == NULL) {
-               free((char *)g);
-               return(REG_ESPACE);
-       }
-
-       /* set things up */
-       p->g = g;
-       p->next = (char *)pattern;      /* convenience; we do not modify it */
-       p->end = p->next + len;
-       p->error = 0;
-       p->ncsalloc = 0;
-       for (i = 0; i < NPAREN; i++) {
-               p->pbegin[i] = 0;
-               p->pend[i] = 0;
-       }
-       g->csetsize = NC;
-       g->sets = NULL;
-       g->setbits = NULL;
-       g->ncsets = 0;
-       g->cflags = cflags;
-       g->iflags = 0;
-       g->nbol = 0;
-       g->neol = 0;
-       g->must = NULL;
-       g->mlen = 0;
-       g->nsub = 0;
-       g->ncategories = 1;     /* category 0 is "everything else" */
-       g->categories = &g->catspace[-(CHAR_MIN)];
-       (void) memset((char *)g->catspace, 0, NC*SIZEOF(cat_t));
-       g->backrefs = 0;
-
-       /* do it */
-       EMIT(OEND, 0);
-       g->firststate = (sopno)THERE();
-       if (cflags & REG_EXTENDED)
-               p_ere(p, OUT);
-       else if (cflags & REG_NOSPEC)
-               p_str(p);
-       else
-               p_bre(p, OUT, OUT);
-       EMIT(OEND, 0);
-       g->laststate = THERE();
-
-       /* tidy up loose ends and fill things in */
-       categorize(p, g);
-       stripsnug(p, g);
-       findmust(p, g);
-       g->nplus = pluscount(p, g);
-       g->magic = MAGIC2;
-       /*@ignore@*/
-       preg->re_nsub = g->nsub;
-       preg->re_g = g;
-       preg->re_magic = MAGIC1;
-       /*@end@*/
-#ifndef REDEBUG
-       /* not debugging, so can't rely on the assert() in regexec() */
-       if (g->iflags&BAD)
-               SETERROR(REG_ASSERT);
-#endif
-
-       /* win or lose, we're done */
-       if (p->error != 0)      /* lose */
-               regfree(preg);
-       return(p->error);
-}
-
-/*
- - p_ere - ERE parser top level, concatenation and alternation
- == static void p_ere(struct parse *p, int stop);
- */
-static void
-p_ere(
-    struct parse *     p,
-    int                        stop)   /* character this ERE should end at */
-{
-       char c;
-       sopno prevback = 0;
-       sopno prevfwd = 0;
-       sopno conc;
-       int first = 1;          /* is this the first alternative? */
-
-       for (;;) {
-               /* do a bunch of concatenated expressions */
-               conc = HERE();
-               while (MORE() && (c = PEEK()) != '|' && c != stop)
-                       p_ere_exp(p);
-               (void)REQUIRE(HERE() != conc, REG_EMPTY);       /* require nonempty */
-
-               if (!EAT('|'))
-                       break;          /* NOTE BREAK OUT */
-
-               if (first) {
-                       INSERT(OCH_, conc);     /* offset is wrong */
-                       prevfwd = conc;
-                       prevback = conc;
-                       first = 0;
-               }
-               ASTERN(OOR1, prevback);
-               prevback = THERE();
-               AHEAD(prevfwd);                 /* fix previous offset */
-               prevfwd = HERE();
-               EMIT(OOR2, 0);                  /* offset is very wrong */
-       }
-
-       if (!first) {           /* tail-end fixups */
-               AHEAD(prevfwd);
-               ASTERN(O_CH, prevback);
-       }
-
-       assert(!MORE() || SEE(stop));
-}
-
-/*
- - p_ere_exp - parse one subERE, an atom possibly followed by a repetition op
- == static void p_ere_exp(struct parse *p);
- */
-static void
-p_ere_exp(
-    struct parse *     p)
-{
-       char c;
-       sopno pos;
-       int count;
-       int count2;
-       sopno subno;
-       int wascaret = 0;
-
-       assert(MORE());         /* caller should have ensured this */
-       c = GETNEXT();
-
-       pos = HERE();
-       switch (c) {
-       case '(':
-               (void)REQUIRE(MORE(), REG_EPAREN);
-               p->g->nsub++;
-               subno = p->g->nsub;
-               if (subno < NPAREN)
-                       p->pbegin[subno] = HERE();
-               EMIT(OLPAREN, subno);
-               if (!SEE(')'))
-                       p_ere(p, ')');
-               if (subno < NPAREN) {
-                       p->pend[subno] = HERE();
-                       assert(p->pend[subno] != 0);
-               }
-               EMIT(ORPAREN, subno);
-               (void)MUSTEAT(')', REG_EPAREN);
-               break;
-#ifndef POSIX_MISTAKE
-       case ')':               /* happens only if no current unmatched ( */
-               /*
-                * You may ask, why the ifndef?  Because I didn't notice
-                * this until slightly too late for 1003.2, and none of the
-                * other 1003.2 regular-expression reviewers noticed it at
-                * all.  So an unmatched ) is legal POSIX, at least until
-                * we can get it fixed.
-                */
-               SETERROR(REG_EPAREN);
-               break;
-#endif
-       case '^':
-               EMIT(OBOL, 0);
-               p->g->iflags |= USEBOL;
-               p->g->nbol++;
-               wascaret = 1;
-               break;
-       case '$':
-               EMIT(OEOL, 0);
-               p->g->iflags |= USEEOL;
-               p->g->neol++;
-               break;
-       case '|':
-               SETERROR(REG_EMPTY);
-               break;
-       case '*':
-       case '+':
-       case '?':
-               SETERROR(REG_BADRPT);
-               break;
-       case '.':
-               if (p->g->cflags&REG_NEWLINE)
-                       nonnewline(p);
-               else
-                       EMIT(OANY, 0);
-               break;
-       case '[':
-               p_bracket(p);
-               break;
-       case '\\':
-               (void)REQUIRE(MORE(), REG_EESCAPE);
-               c = GETNEXT();
-               ordinary(p, c);
-               break;
-       case '{':               /* okay as ordinary except if digit follows */
-               (void)REQUIRE(!MORE() || !isdigit(PEEK()), REG_BADRPT);
-               /* FALLTHROUGH */
-       default:
-               ordinary(p, c);
-               break;
-       }
-
-       if (!MORE())
-               return;
-       c = PEEK();
-       /* we call { a repetition if followed by a digit */
-       if (!( c == '*' || c == '+' || c == '?' ||
-                               (c == '{' && MORE2() && isdigit(PEEK2())) ))
-               return;         /* no repetition, we're done */
-       NEXT();
-
-       (void)REQUIRE(!wascaret, REG_BADRPT);
-       switch (c) {
-       case '*':       /* implemented as +? */
-               /* this case does not require the (y|) trick, noKLUDGE */
-               INSERT(OPLUS_, pos);
-               ASTERN(O_PLUS, pos);
-               INSERT(OQUEST_, pos);
-               ASTERN(O_QUEST, pos);
-               break;
-       case '+':
-               INSERT(OPLUS_, pos);
-               ASTERN(O_PLUS, pos);
-               break;
-       case '?':
-               /* KLUDGE: emit y? as (y|) until subtle bug gets fixed */
-               INSERT(OCH_, pos);              /* offset slightly wrong */
-               ASTERN(OOR1, pos);              /* this one's right */
-               AHEAD(pos);                     /* fix the OCH_ */
-               EMIT(OOR2, 0);                  /* offset very wrong... */
-               AHEAD(THERE());                 /* ...so fix it */
-               ASTERN(O_CH, THERETHERE());
-               break;
-       case '{':
-               count = p_count(p);
-               if (EAT(',')) {
-                       if (isdigit(PEEK())) {
-                               count2 = p_count(p);
-                               (void)REQUIRE(count <= count2, REG_BADBR);
-                       } else          /* single number with comma */
-                               count2 = (int)REINFINITY;
-               } else          /* just a single number */
-                       count2 = count;
-               repeat(p, pos, count, count2);
-               if (!EAT('}')) {        /* error heuristics */
-                       while (MORE() && PEEK() != '}')
-                               NEXT();
-                       (void)REQUIRE(MORE(), REG_EBRACE);
-                       SETERROR(REG_BADBR);
-               }
-               break;
-       }
-
-       if (!MORE())
-               return;
-       c = PEEK();
-       if (!( c == '*' || c == '+' || c == '?' ||
-                               (c == '{' && MORE2() && isdigit(PEEK2())) ) )
-               return;
-       SETERROR(REG_BADRPT);
-}
-
-/*
- - p_str - string (no metacharacters) "parser"
- == static void p_str(struct parse *p);
- */
-static void
-p_str(
-    struct parse *     p)
-{
-       (void)REQUIRE(MORE(), REG_EMPTY);
-       while (MORE())
-               ordinary(p, GETNEXT());
-}
-
-/*
- - p_bre - BRE parser top level, anchoring and concatenation
- == static void p_bre(struct parse *p, register int end1, \
- ==    int end2);
- * Giving end1 as OUT essentially eliminates the end1/end2 check.
- *
- * This implementation is a bit of a kludge, in that a trailing $ is first
- * taken as an ordinary character and then revised to be an anchor.  The
- * only undesirable side effect is that '$' gets included as a character
- * category in such cases.  This is fairly harmless; not worth fixing.
- * The amount of lookahead needed to avoid this kludge is excessive.
- */
-static void
-p_bre(
-    struct parse *     p,
-    int                        end1,           /* first terminating character */
-    int                        end2)           /* second terminating character */
-{
-       sopno start = HERE();
-       int first = 1;                  /* first subexpression? */
-       int wasdollar = 0;
-
-       if (EAT('^')) {
-               EMIT(OBOL, 0);
-               p->g->iflags |= USEBOL;
-               p->g->nbol++;
-       }
-       while (MORE() && !SEETWO(end1, end2)) {
-               wasdollar = p_simp_re(p, first);
-               first = 0;
-       }
-       if (wasdollar) {        /* oops, that was a trailing anchor */
-               DROP(1);
-               EMIT(OEOL, 0);
-               p->g->iflags |= USEEOL;
-               p->g->neol++;
-       }
-
-       (void)REQUIRE(HERE() != start, REG_EMPTY);      /* require nonempty */
-}
-
-/*
- - p_simp_re - parse a simple RE, an atom possibly followed by a repetition
- == static int p_simp_re(struct parse *p, int starordinary);
- */
-static int                     /* was the simple RE an unbackslashed $? */
-p_simp_re(
-    struct parse *     p,
-    int                        starordinary)/* is a leading * an ordinary character? */
-{
-       int c;
-       int count;
-       int count2;
-       sopno pos;
-       int i;
-       sopno subno;
-#      define  BACKSL  (1<<CHAR_BIT)
-
-       pos = HERE();           /* repetion op, if any, covers from here */
-
-       assert(MORE());         /* caller should have ensured this */
-       c = GETNEXT();
-       if (c == '\\') {
-               (void)REQUIRE(MORE(), REG_EESCAPE);
-               c = BACKSL | (unsigned char)GETNEXT();
-       }
-       switch (c) {
-       case '.':
-               if (p->g->cflags&REG_NEWLINE)
-                       nonnewline(p);
-               else
-                       EMIT(OANY, 0);
-               break;
-       case '[':
-               p_bracket(p);
-               break;
-       case BACKSL|'{':
-               SETERROR(REG_BADRPT);
-               break;
-       case BACKSL|'(':
-               p->g->nsub++;
-               subno = p->g->nsub;
-               if (subno < NPAREN)
-                       p->pbegin[subno] = HERE();
-               EMIT(OLPAREN, subno);
-               /* the MORE here is an error heuristic */
-               if (MORE() && !SEETWO('\\', ')'))
-                       p_bre(p, '\\', ')');
-               if (subno < NPAREN) {
-                       p->pend[subno] = HERE();
-                       assert(p->pend[subno] != 0);
-               }
-               EMIT(ORPAREN, subno);
-               (void)REQUIRE(EATTWO('\\', ')'), REG_EPAREN);
-               break;
-       case BACKSL|')':        /* should not get here -- must be user */
-       case BACKSL|'}':
-               SETERROR(REG_EPAREN);
-               break;
-       case BACKSL|'1':
-       case BACKSL|'2':
-       case BACKSL|'3':
-       case BACKSL|'4':
-       case BACKSL|'5':
-       case BACKSL|'6':
-       case BACKSL|'7':
-       case BACKSL|'8':
-       case BACKSL|'9':
-               i = (c&~BACKSL) - '0';
-               assert(i < NPAREN);
-               if (p->pend[i] != 0) {
-                       assert(i <= (int)p->g->nsub);
-                       EMIT(OBACK_, i);
-                       assert(p->pbegin[i] != 0);
-                       assert(OP(p->strip[p->pbegin[i]]) == OLPAREN);
-                       assert(OP(p->strip[p->pend[i]]) == ORPAREN);
-                       (void)dupl(p, p->pbegin[i]+1, p->pend[i]);
-                       EMIT(O_BACK, i);
-               } else
-                       SETERROR(REG_ESUBREG);
-               p->g->backrefs = 1;
-               break;
-       case '*':
-               (void)REQUIRE(starordinary, REG_BADRPT);
-               /* FALLTHROUGH */
-       default:
-               ordinary(p, c &~ BACKSL);
-               break;
-       }
-
-       if (EAT('*')) {         /* implemented as +? */
-               /* this case does not require the (y|) trick, noKLUDGE */
-               INSERT(OPLUS_, pos);
-               ASTERN(O_PLUS, pos);
-               INSERT(OQUEST_, pos);
-               ASTERN(O_QUEST, pos);
-       } else if (EATTWO('\\', '{')) {
-               count = p_count(p);
-               if (EAT(',')) {
-                       if (MORE() && isdigit(PEEK())) {
-                               count2 = p_count(p);
-                               (void)REQUIRE(count <= count2, REG_BADBR);
-                       } else          /* single number with comma */
-                               count2 = REINFINITY;
-               } else          /* just a single number */
-                       count2 = count;
-               repeat(p, pos, count, count2);
-               if (!EATTWO('\\', '}')) {       /* error heuristics */
-                       while (MORE() && !SEETWO('\\', '}'))
-                               NEXT();
-                       (void)REQUIRE(MORE(), REG_EBRACE);
-                       SETERROR(REG_BADBR);
-               }
-       } else if (c == (unsigned char)'$')     /* $ (but not \$) ends it */
-               return(1);
-
-       return(0);
-}
-
-/*
- - p_count - parse a repetition count
- == static int p_count(struct parse *p);
- */
-static int                     /* the value */
-p_count(
-    struct parse *     p)
-{
-       int count = 0;
-       int ndigits = 0;
-
-       while (MORE() && isdigit(PEEK()) && count <= DUPMAX) {
-               count = count*10 + (GETNEXT() - '0');
-               ndigits++;
-       }
-
-       (void)REQUIRE(ndigits > 0 && count <= DUPMAX, REG_BADBR);
-       return(count);
-}
-
-/*
- - p_bracket - parse a bracketed character list
- == static void p_bracket(struct parse *p);
- *
- * Note a significant property of this code:  if the allocset() did SETERROR,
- * no set operations are done.
- */
-static void
-p_bracket(
-    struct parse *     p)
-{
-       cset *cs = allocset(p);
-       int invert = 0;
-
-       /* Dept of Truly Sickening Special-Case Kludges */
-       if (p->next + 5 < p->end && strncmp(p->next, "[:<:]]", 6) == 0) {
-               EMIT(OBOW, 0);
-               NEXTn(6);
-               return;
-       }
-       if (p->next + 5 < p->end && strncmp(p->next, "[:>:]]", 6) == 0) {
-               EMIT(OEOW, 0);
-               NEXTn(6);
-               return;
-       }
-
-       if (EAT('^'))
-               invert++;       /* make note to invert set at end */
-       if (EAT(']'))
-               CHadd(cs, ']');
-       else if (EAT('-'))
-               CHadd(cs, '-');
-       while (MORE() && PEEK() != ']' && !SEETWO('-', ']'))
-               p_b_term(p, cs);
-       if (EAT('-'))
-               CHadd(cs, '-');
-       (void)MUSTEAT(']', REG_EBRACK);
-
-       if (p->error != 0)      /* don't mess things up further */
-               return;
-
-       if (p->g->cflags&REG_ICASE) {
-               int i;
-               int ci;
-
-               for (i = p->g->csetsize - 1; i >= 0; i--)
-                       if (CHIN(cs, i) && isalpha(i)) {
-                               ci = othercase(i);
-                               if (ci != i)
-                                       CHadd(cs, ci);
-                       }
-               if (cs->multis != NULL)
-                       mccase(p, cs);
-       }
-       if (invert) {
-               int i;
-
-               for (i = p->g->csetsize - 1; i >= 0; i--)
-                       if (CHIN(cs, i))
-                               CHsub(cs, i);
-                       else
-                               CHadd(cs, i);
-               if (p->g->cflags&REG_NEWLINE)
-                       CHsub(cs, '\n');
-               if (cs->multis != NULL)
-                       mcinvert(p, cs);
-       }
-
-       assert(cs->multis == NULL);             /* xxx */
-
-       if (nch(p, cs) == 1) {          /* optimize singleton sets */
-               ordinary(p, firstch(p, cs));
-               freeset(p, cs);
-       } else
-               EMIT(OANYOF, freezeset(p, cs));
-}
-
-/*
- - p_b_term - parse one term of a bracketed character list
- == static void p_b_term(struct parse *p, register cset *cs);
- */
-static void
-p_b_term(
-    struct parse *     p,
-    cset *             cs)
-{
-       char c;
-       char start, finish;
-       int i;
-
-       /* classify what we've got */
-       switch ((MORE()) ? PEEK() : '\0') {
-       case '[':
-               c = (char)((MORE2()) ? PEEK2() : '\0');
-               break;
-       case '-':
-               SETERROR(REG_ERANGE);
-               return;                 /* NOTE RETURN */
-
-       default:
-               c = '\0';
-               break;
-       }
-
-       switch (c) {
-       case ':':               /* character class */
-               NEXT2();
-               (void)REQUIRE(MORE(), REG_EBRACK);
-               c = PEEK();
-               (void)REQUIRE(c != '-' && c != ']', REG_ECTYPE);
-               p_b_cclass(p, cs);
-               (void)REQUIRE(MORE(), REG_EBRACK);
-               (void)REQUIRE(EATTWO(':', ']'), REG_ECTYPE);
-               break;
-       case '=':               /* equivalence class */
-               NEXT2();
-               (void)REQUIRE(MORE(), REG_EBRACK);
-               c = PEEK();
-               (void)REQUIRE(c != '-' && c != ']', REG_ECOLLATE);
-               p_b_eclass(p, cs);
-               (void)REQUIRE(MORE(), REG_EBRACK);
-               (void)REQUIRE(EATTWO('=', ']'), REG_ECOLLATE);
-               break;
-       default:                /* symbol, ordinary character, or range */
-/* xxx revision needed for multichar stuff */
-               start = (char)p_b_symbol(p);
-               if (SEE('-') && MORE2() && PEEK2() != ']') {
-                       /* range */
-                       NEXT();
-                       if (EAT('-'))
-                               finish = '-';
-                       else
-                               finish = (char)p_b_symbol(p);
-               } else
-                       finish = start;
-/* xxx what about signed chars here... */
-               (void)REQUIRE(start <= finish, REG_ERANGE);
-               for (i = start; i <= finish; i++)
-                       CHadd(cs, i);
-               break;
-       }
-}
-
-/*
- - p_b_cclass - parse a character-class name and deal with it
- == static void p_b_cclass(struct parse *p, register cset *cs);
- */
-static void
-p_b_cclass(
-    struct parse *     p,
-    cset *             cs)
-{
-       char *sp = p->next;
-       struct cclass *cp;
-       size_t len;
-       char *u;
-       char c;
-
-       while (MORE() && isalpha(PEEK()))
-               NEXT();
-       len = (size_t)(p->next - sp);
-       for (cp = cclasses; cp->name != NULL; cp++)
-               if (strncmp(cp->name, sp, len) == 0 && cp->name[len] == '\0')
-                       break;
-       if (cp->name == NULL) {
-               /* oops, didn't find it */
-               SETERROR(REG_ECTYPE);
-               return;
-       }
-
-       u = cp->chars;
-       while ((c = *u++) != '\0')
-               CHadd(cs, c);
-       for (u = cp->multis; *u != '\0'; u += strlen(u) + 1)
-               MCadd(p, cs, u);
-}
-
-/*
- - p_b_eclass - parse an equivalence-class name and deal with it
- == static void p_b_eclass(struct parse *p, register cset *cs);
- *
- * This implementation is incomplete. xxx
- */
-static void
-p_b_eclass(
-    struct parse *     p,
-    cset *             cs)
-{
-       char c;
-
-       c = (char)p_b_coll_elem(p, '=');
-       CHadd(cs, c);
-}
-
-/*
- - p_b_symbol - parse a character or [..]ed multicharacter collating symbol
- == static char p_b_symbol(struct parse *p);
- */
-static char                    /* value of symbol */
-p_b_symbol(
-    struct parse *     p)
-{
-       char value;
-
-       (void)REQUIRE(MORE(), REG_EBRACK);
-       if (!EATTWO('[', '.'))
-               return(GETNEXT());
-
-       /* collating symbol */
-       value = (char)p_b_coll_elem(p, '.');
-       (void)REQUIRE(EATTWO('.', ']'), REG_ECOLLATE);
-       return(value);
-}
-
-/*
- - p_b_coll_elem - parse a collating-element name and look it up
- == static char p_b_coll_elem(struct parse *p, int endc);
- */
-static char                    /* value of collating element */
-p_b_coll_elem(
-    struct parse *     p,
-    int                        endc)   /* name ended by endc,']' */
-{
-       char *sp = p->next;
-       struct cname *cp;
-       size_t len;
-
-       while (MORE() && !SEETWO(endc, ']'))
-               NEXT();
-       if (!MORE()) {
-               SETERROR(REG_EBRACK);
-               return((char)0);
-       }
-       len = (size_t)(p->next - sp);
-       for (cp = cnames; cp->name != NULL; cp++)
-               if (strncmp(cp->name, sp, len) == 0 && cp->name[len] == '\0')
-                       return(cp->code);       /* known name */
-       if (len == 1)
-               return(*sp);    /* single character */
-       SETERROR(REG_ECOLLATE);                 /* neither */
-       return((char)0);
-}
-
-/*
- - othercase - return the case counterpart of an alphabetic
- == static char othercase(int ch);
- */
-static char                    /* if no counterpart, return ch */
-othercase(
-    int                ch)
-{
-       assert(isalpha(ch));
-       if (isupper(ch))
-               return(tolower(ch));
-       else if (islower(ch))
-               return(toupper(ch));
-       else                    /* peculiar, but could happen */
-               return(ch);
-}
-
-/*
- - bothcases - emit a dualcase version of a two-case character
- == static void bothcases(struct parse *p, int ch);
- *
- * Boy, is this implementation ever a kludge...
- */
-static void
-bothcases(
-    struct parse *     p,
-    int                        ch)
-{
-       char *oldnext = p->next;
-       char *oldend = p->end;
-       static char bracket[3];
-
-       assert(othercase(ch) != ch);    /* p_bracket() would recurse */
-       p->next = bracket;
-       p->end = bracket+2;
-       bracket[0] = (char)ch;
-       bracket[1] = ']';
-       bracket[2] = '\0';
-       p_bracket(p);
-       assert(p->next == bracket+2);
-       p->next = oldnext;
-       p->end = oldend;
-}
-
-/*
- - ordinary - emit an ordinary character
- == static void ordinary(struct parse *p, register int ch);
- */
-static void
-ordinary(
-    struct parse *     p,
-    int                        ch)
-{
-       cat_t *cap = p->g->categories;
-
-       if ((p->g->cflags&REG_ICASE) && isalpha(ch) && othercase(ch) != ch)
-               bothcases(p, ch);
-       else {
-               EMIT(OCHAR, (unsigned char)ch);
-               if (cap[ch] == 0)
-                       cap[ch] = (cat_t)(p->g->ncategories++);
-       }
-}
-
-/*
- - nonnewline - emit REG_NEWLINE version of OANY
- == static void nonnewline(struct parse *p);
- *
- * Boy, is this implementation ever a kludge...
- */
-static void
-nonnewline(
-    struct parse *     p)
-{
-       char *oldnext = p->next;
-       char *oldend = p->end;
-       static char bracket[4];
-
-       p->next = bracket;
-       p->end = bracket+3;
-       bracket[0] = '^';
-       bracket[1] = '\n';
-       bracket[2] = ']';
-       bracket[3] = '\0';
-       p_bracket(p);
-       assert(p->next == bracket+3);
-       p->next = oldnext;
-       p->end = oldend;
-}
-
-/*
- - repeat - generate code for a bounded repetition, recursively if needed
- == static void repeat(struct parse *p, sopno start, int from, int to);
- */
-static void
-repeat(
-    struct parse *     p,
-    sopno              start,  /* operand from here to end of strip */
-    int                        from,   /* repeated from this number */
-    int                        to)     /* to this number of times (maybe REINFINITY) */
-{
-       sopno finish = HERE();
-#      define  N       2
-#      define  INF     3
-#      define  REP(f, t)       ((f)*8 + (t))
-#      define  MAP(n)  (((n) <= 1) ? (n) : ((n) == REINFINITY) ? INF : N)
-       sopno copy;
-
-       if (p->error != 0)      /* head off possible runaway recursion */
-               return;
-
-       assert(from <= to);
-
-       switch (REP(MAP(from), MAP(to))) {
-       case REP(0, 0):                 /* must be user doing this */
-               DROP(finish-start);     /* drop the operand */
-               break;
-       case REP(0, 1):                 /* as x{1,1}? */
-       case REP(0, N):                 /* as x{1,n}? */
-       case REP(0, INF):               /* as x{1,}? */
-               /* KLUDGE: emit y? as (y|) until subtle bug gets fixed */
-               INSERT(OCH_, start);            /* offset is wrong... */
-               repeat(p, start+1, 1, to);
-               ASTERN(OOR1, start);
-               AHEAD(start);                   /* ... fix it */
-               EMIT(OOR2, 0);
-               AHEAD(THERE());
-               ASTERN(O_CH, THERETHERE());
-               break;
-       case REP(1, 1):                 /* trivial case */
-               /* done */
-               break;
-       case REP(1, N):                 /* as x?x{1,n-1} */
-               /* KLUDGE: emit y? as (y|) until subtle bug gets fixed */
-               INSERT(OCH_, start);
-               ASTERN(OOR1, start);
-               AHEAD(start);
-               EMIT(OOR2, 0);                  /* offset very wrong... */
-               AHEAD(THERE());                 /* ...so fix it */
-               ASTERN(O_CH, THERETHERE());
-               copy = dupl(p, start+1, finish+1);
-               assert(copy == finish+4);
-               repeat(p, copy, 1, to-1);
-               break;
-       case REP(1, INF):               /* as x+ */
-               INSERT(OPLUS_, start);
-               ASTERN(O_PLUS, start);
-               break;
-       case REP(N, N):                 /* as xx{m-1,n-1} */
-               copy = dupl(p, start, finish);
-               repeat(p, copy, from-1, to-1);
-               break;
-       case REP(N, INF):               /* as xx{n-1,INF} */
-               copy = dupl(p, start, finish);
-               repeat(p, copy, from-1, to);
-               break;
-       default:                        /* "can't happen" */
-               SETERROR(REG_ASSERT);   /* just in case */
-               break;
-       }
-}
-
-/*
- - seterr - set an error condition
- == static int seterr(struct parse *p, int e);
- */
-static int                     /* useless but makes type checking happy */
-seterr(
-    struct parse *     p,
-    int                        e)
-{
-       if (p->error == 0)      /* keep earliest error condition */
-               p->error = e;
-       p->next = nuls;         /* try to bring things to a halt */
-       p->end = nuls;
-       return(0);              /* make the return value well-defined */
-}
-
-/*
- - allocset - allocate a set of characters for []
- == static cset *allocset(struct parse *p);
- */
-static cset *
-allocset(
-    struct parse *     p)
-{
-       int no = p->g->ncsets++;
-       int nc;
-       size_t nbytes;
-       cset *cs;
-       size_t css = (size_t)p->g->csetsize;
-       int i;
-
-       if (no >= p->ncsalloc) {        /* need another column of space */
-               p->ncsalloc += CHAR_BIT;
-               nc = p->ncsalloc;
-               assert(nc % CHAR_BIT == 0);
-               nbytes = nc / CHAR_BIT * css;
-               if (p->g->sets == NULL)
-                       p->g->sets = (cset *)malloc(nc * SIZEOF(cset));
-               else
-                       p->g->sets = (cset *)realloc((char *)p->g->sets,
-                                       (size_t)nc * SIZEOF(cset));
-               if (p->g->setbits == NULL)
-                       p->g->setbits = (uch *)malloc(nbytes);
-               else {
-                       p->g->setbits = (uch *)realloc((char *)p->g->setbits,
-                                                               nbytes);
-                       /* xxx this isn't right if setbits is now NULL */
-                       if (p->g->sets && p->g->setbits)
-                               for (i = 0; i < no; i++)
-                                       p->g->sets[i].ptr = p->g->setbits + css*(i/CHAR_BIT);
-               }
-               if (p->g->sets != NULL && p->g->setbits != NULL)
-                       (void) memset((char *)p->g->setbits + (nbytes - css),
-                                                               0, css);
-               else {
-                       no = 0;
-                       SETERROR(REG_ESPACE);
-                       /* caller's responsibility not to do set ops */
-               }
-       }
-
-       assert(p->g->sets != NULL);     /* xxx */
-       cs = &p->g->sets[no];
-       cs->ptr = p->g->setbits + css*((no)/CHAR_BIT);
-       cs->mask = (uch)(1 << ((no) % CHAR_BIT));
-       cs->hash = 0;
-       cs->smultis = 0;
-       cs->multis = NULL;
-
-       return(cs);
-}
-
-/*
- - freeset - free a now-unused set
- == static void freeset(struct parse *p, register cset *cs);
- */
-static void
-freeset(
-    struct parse *     p,
-    cset *             cs)
-{
-       int i;
-       cset *top = &p->g->sets[p->g->ncsets];
-       int css = p->g->csetsize;
-
-       for (i = 0; i < css; i++)
-               CHsub(cs, i);
-       if (cs == top-1)        /* recover only the easy case */
-               p->g->ncsets--;
-}
-
-/*
- - freezeset - final processing on a set of characters
- == static int freezeset(struct parse *p, register cset *cs);
- *
- * The main task here is merging identical sets.  This is usually a waste
- * of time (although the hash code minimizes the overhead), but can win
- * big if REG_ICASE is being used.  REG_ICASE, by the way, is why the hash
- * is done using addition rather than xor -- all ASCII [aA] sets xor to
- * the same value!
- */
-static int                     /* set number */
-freezeset(
-    struct parse *     p,
-    cset *             cs)
-{
-       uch h = cs->hash;
-       int i;
-       cset *top = &p->g->sets[p->g->ncsets];
-       cset *cs2;
-       int css = p->g->csetsize;
-
-       /* look for an earlier one which is the same */
-       for (cs2 = &p->g->sets[0]; cs2 < top; cs2++)
-               if (cs2->hash == h && cs2 != cs) {
-                       /* maybe */
-                       for (i = 0; i < css; i++)
-                               if (!!CHIN(cs2, i) != !!CHIN(cs, i))
-                                       break;          /* no */
-                       if (i == css)
-                               break;                  /* yes */
-               }
-
-       if (cs2 < top) {        /* found one */
-               freeset(p, cs);
-               cs = cs2;
-       }
-
-       return((int)(cs - p->g->sets));
-}
-
-/*
- - firstch - return first character in a set (which must have at least one)
- == static int firstch(struct parse *p, register cset *cs);
- */
-static int                     /* character; there is no "none" value */
-firstch(
-    struct parse *     p,
-    cset *             cs)
-{
-       int i;
-       int css = p->g->csetsize;
-
-       for (i = 0; i < css; i++)
-               if (CHIN(cs, i))
-                       return((char)i);
-       assert(never);
-       return(0);              /* arbitrary */
-}
-
-/*
- - nch - number of characters in a set
- == static int nch(struct parse *p, register cset *cs);
- */
-static int
-nch(
-    struct parse *     p,
-    cset *             cs)
-{
-       int i;
-       int css = p->g->csetsize;
-       int n = 0;
-
-       for (i = 0; i < css; i++)
-               if (CHIN(cs, i))
-                       n++;
-       return(n);
-}
-
-/*
- - mcadd - add a collating element to a cset
- == static void mcadd(struct parse *p, register cset *cs, \
- ==    char *cp);
- */
-static void
-mcadd(
-    struct parse *     p,
-    cset *             cs,
-    char *             cp)
-{
-       size_t oldend = cs->smultis;
-
-       cs->smultis += strlen(cp) + 1;
-       if (cs->multis == NULL)
-               cs->multis = malloc(cs->smultis);
-       else
-               cs->multis = realloc(cs->multis, (size_t)cs->smultis);
-       if (cs->multis == NULL) {
-               SETERROR(REG_ESPACE);
-               return;
-       }
-
-       (void) strncpy(cs->multis + oldend - 1, cp, cs->smultis - (oldend - 1));
-       cs->multis[cs->smultis - 1] = '\0';
-}
-
-
-/*
- - mcinvert - invert the list of collating elements in a cset
- == static void mcinvert(struct parse *p, register cset *cs);
- *
- * This would have to know the set of possibilities.  Implementation
- * is deferred.
- */
-static void
-mcinvert(
-   struct parse *      p,
-   cset *              cs)
-{
-       (void)p;        /* Quiet unused parameter warning */
-       (void)cs;       /* Quiet unused parameter warning */
-       assert(cs->multis == NULL);     /* xxx */
-}
-
-/*
- - mccase - add case counterparts of the list of collating elements in a cset
- == static void mccase(struct parse *p, register cset *cs);
- *
- * This would have to know the set of possibilities.  Implementation
- * is deferred.
- */
-static void
-mccase(
-    struct parse *     p,
-    cset *             cs)
-{
-       (void)p;        /* Quiet unused parameter warning */
-       (void)cs;       /* Quiet unused parameter warning */
-       assert(cs->multis == NULL);     /* xxx */
-}
-
-/*
- - isinsets - is this character in any sets?
- == static int isinsets(struct re_guts *g, int c);
- */
-static int                     /* predicate */
-isinsets(
-    struct re_guts *   g,
-    int                        c)
-{
-       uch *col;
-       int i;
-       int ncols = (g->ncsets+(CHAR_BIT-1)) / CHAR_BIT;
-       unsigned uc = (unsigned char)c;
-
-       for (i = 0, col = g->setbits; i < ncols; i++, col += g->csetsize)
-               if (col[uc] != 0)
-                       return(1);
-       return(0);
-}
-
-/*
- - samesets - are these two characters in exactly the same sets?
- == static int samesets(struct re_guts *g, int c1, int c2);
- */
-static int                     /* predicate */
-samesets(
-    struct re_guts *   g,
-    int                        c1,
-    int                        c2)
-{
-       uch *col;
-       int i;
-       int ncols = (g->ncsets+(CHAR_BIT-1)) / CHAR_BIT;
-       unsigned uc1 = (unsigned char)c1;
-       unsigned uc2 = (unsigned char)c2;
-
-       for (i = 0, col = g->setbits; i < ncols; i++, col += g->csetsize)
-               if (col[uc1] != col[uc2])
-                       return(0);
-       return(1);
-}
-
-/*
- - categorize - sort out character categories
- == static void categorize(struct parse *p, struct re_guts *g);
- */
-static void
-categorize(
-    struct parse *     p,
-    struct re_guts *   g)
-{
-       cat_t *cats = g->categories;
-       int c;
-       int c2;
-       cat_t cat;
-
-       /* avoid making error situations worse */
-       if (p->error != 0)
-               return;
-
-       for (c = CHAR_MIN; c <= CHAR_MAX; c++)
-               if (cats[c] == 0 && isinsets(g, c)) {
-                       cat = (cat_t)g->ncategories++;
-                       cats[c] = cat;
-                       for (c2 = c+1; c2 <= CHAR_MAX; c2++)
-                               if (cats[c2] == 0 && samesets(g, c, c2))
-                                       cats[c2] = cat;
-               }
-}
-
-/*
- - dupl - emit a duplicate of a bunch of sops
- == static sopno dupl(struct parse *p, sopno start, sopno finish);
- */
-static sopno                   /* start of duplicate */
-dupl(
-   struct parse *      p,
-   sopno               start,  /* from here */
-   sopno               finish) /* to this less one */
-{
-       sopno ret = HERE();
-       size_t len = (size_t)(finish - start);
-
-       assert(finish >= start);
-       if (len == 0)
-               return(ret);
-       enlarge(p, p->ssize + len);     /* this many unexpected additions */
-       assert(p->ssize >= (p->slen + len));
-       (void) memcpy((char *)(p->strip + p->slen),
-               (char *)(p->strip + start), ((size_t)len * SIZEOF(sop)));
-       p->slen += len;
-       return(ret);
-}
-
-/*
- - doemit - emit a strip operator
- == static void doemit(struct parse *p, sop op, size_t opnd);
- *
- * It might seem better to implement this as a macro with a function as
- * hard-case backup, but it's just too big and messy unless there are
- * some changes to the data structures.  Maybe later.
- */
-static void
-doemit(
-    struct parse *     p,
-    sop                        op,
-    size_t             opnd)
-{
-       /* avoid making error situations worse */
-       if (p->error != 0)
-               return;
-
-       /* deal with oversize operands ("can't happen", more or less) */
-       assert(opnd < (1 << OPSHIFT));
-
-       /* deal with undersized strip */
-       if (p->slen >= p->ssize)
-               enlarge(p, (p->ssize+1) / 2 * 3);       /* +50% */
-       assert(p->slen < p->ssize);
-
-       /* finally, it's all reduced to the easy case */
-       p->strip[p->slen++] = SOP(op, opnd);
-}
-
-/*
- - doinsert - insert a sop into the strip
- == static void doinsert(struct parse *p, sop op, size_t opnd, sopno pos);
- */
-static void
-doinsert(
-    struct parse *     p,
-    sop                        op,
-    size_t             opnd,
-    sopno              pos)
-{
-       sopno sn;
-       sop s;
-       int i;
-
-       /* avoid making error situations worse */
-       if (p->error != 0)
-               return;
-
-       sn = HERE();
-       EMIT(op, opnd);         /* do checks, ensure space */
-       assert(HERE() == sn+1);
-       s = p->strip[sn];
-
-       /* adjust paren pointers */
-       assert(pos > 0);
-       for (i = 1; i < NPAREN; i++) {
-               if (p->pbegin[i] >= pos) {
-                       p->pbegin[i]++;
-               }
-               if (p->pend[i] >= pos) {
-                       p->pend[i]++;
-               }
-       }
-
-       memmove((char *)&p->strip[pos+1], (char *)&p->strip[pos],
-               (HERE() - (size_t)pos - 1) * SIZEOF(sop));
-       p->strip[pos] = s;
-}
-
-/*
- - dofwd - complete a forward reference
- == static void dofwd(struct parse *p, sopno pos, sop value);
- */
-static void
-dofwd(
-    struct parse *     p,
-    sopno              pos,
-    sop                        value)
-{
-       /* avoid making error situations worse */
-       if (p->error != 0)
-               return;
-
-       assert(value < 1<<OPSHIFT);
-       p->strip[pos] = OP(p->strip[pos]) | value;
-} 
-/*
- - enlarge - enlarge the strip
- == static void enlarge(struct parse *p, sopno size);
- */
-static void
-enlarge(
-    struct parse *     p,
-    sopno              size)
-{
-       sop *sp;
-
-       assert(size <= (sopno)SSIZE_MAX);
-       if (p->ssize >= (size_t)size)
-               return;
-
-       sp = (sop *)realloc(p->strip, (size_t)size * SIZEOF(sop));
-       if (sp == NULL) {
-               SETERROR(REG_ESPACE);
-               return;
-       }
-       p->strip = sp;
-       p->ssize = (size_t)size;
-}
-
-/*
- - stripsnug - compact the strip
- == static void stripsnug(struct parse *p, register struct re_guts *g);
- */
-static void
-stripsnug(
-    /*@keep@*/ struct parse *  p,
-    /*@keep@*/ struct re_guts *g)
-{
-       g->nstates = p->slen;
-       g->strip = (sop *)realloc((char *)p->strip,
-                               (size_t)p->slen * SIZEOF(sop));
-       if (g->strip == NULL) {
-               SETERROR(REG_ESPACE);
-               g->strip = p->strip;
-       }
-}
-
-/*
- - findmust - fill in must and mlen with longest mandatory literal string
- == static void findmust(struct parse *p, register struct re_guts *g);
- *
- * This algorithm could do fancy things like analyzing the operands of |
- * for common subsequences.  Someday.  This code is simple and finds most
- * of the interesting cases.
- *
- * Note that must and mlen got initialized during setup.
- */
-static void
-findmust(
-    struct parse *     p,
-    struct re_guts *   g)
-{
-       sop *scan;
-       sop *start;
-       sop *newstart = NULL;
-       sopno newlen;
-       sop s;
-       char *cp;
-       sopno i;
-
-       /* avoid making error situations worse */
-       if (p->error != 0)
-               return;
-
-       /* find the longest OCHAR sequence in strip */
-       newlen = 0;
-       start = scan = g->strip + 1;
-       do {
-               s = *scan++;
-               switch (OP(s)) {
-               case OCHAR:             /* sequence member */
-                       if (newlen == 0)                /* new sequence */
-                               newstart = scan - 1;
-                       newlen++;
-                       break;
-               case OPLUS_:            /* things that don't break one */
-               case OLPAREN:
-               case ORPAREN:
-                       break;
-               case OQUEST_:           /* things that must be skipped */
-               case OCH_:
-                       scan--;
-                       do {
-                               scan += OPND(s);
-                               s = *scan;
-                               /* assert() interferes w debug printouts */
-                               if (OP(s) != O_QUEST && OP(s) != O_CH &&
-                                                       OP(s) != OOR2) {
-                                       g->iflags |= BAD;
-                                       return;
-                               }
-                       } while (OP(s) != O_QUEST && OP(s) != O_CH);
-                       /* fallthrough */
-               default:                /* things that break a sequence */
-                       if (newlen > g->mlen) {         /* ends one */
-                               start = newstart;
-                               g->mlen = newlen;
-                       }
-                       newlen = 0;
-                       break;
-               }
-       } while (OP(s) != OEND);
-
-       if (g->mlen == 0)               /* there isn't one */
-               return;
-
-       /* turn it into a character string */
-       g->must = malloc((size_t)g->mlen + 1);
-       if (g->must == NULL) {          /* argh; just forget it */
-               g->mlen = 0;
-               return;
-       }
-       cp = g->must;
-       scan = start;
-       for (i = g->mlen; i > 0; i--) {
-               s = *scan++;
-               while (OP(s) != OCHAR)
-                       s = *scan++;
-               assert(cp < g->must + g->mlen);
-               *cp++ = (char)OPND(s);
-       }
-       assert(cp == g->must + g->mlen);
-       *cp++ = '\0';           /* just on general principles */
-}
-
-/*
- - pluscount - count + nesting
- == static sopno pluscount(struct parse *p, register struct re_guts *g);
- */
-static sopno                   /* nesting depth */
-pluscount(
-    struct parse *     p,
-    struct re_guts *   g)
-{
-       sop *scan;
-       sop s;
-       sopno plusnest = 0;
-       sopno maxnest = 0;
-
-       if (p->error != 0)
-               return(0);      /* there may not be an OEND */
-
-       scan = g->strip + 1;
-       do {
-               s = *scan++;
-               switch (OP(s)) {
-               case OPLUS_:
-                       plusnest++;
-                       break;
-               case O_PLUS:
-                       if (plusnest > maxnest)
-                               maxnest = plusnest;
-                       plusnest--;
-                       break;
-               }
-       } while (OP(s) != OEND);
-       if (plusnest != 0)
-               g->iflags |= BAD;
-       return(maxnest);
-}
diff --git a/regex-src/regerror.c b/regex-src/regerror.c
deleted file mode 100644 (file)
index 1eab5ca..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-#include "amanda.h"
-#include <regex.h>
-#include "utils.h"
-#include "regerror.ih"
-
-/*
- = #define     REG_OKAY         0
- = #define     REG_NOMATCH      1
- = #define     REG_BADPAT       2
- = #define     REG_ECOLLATE     3
- = #define     REG_ECTYPE       4
- = #define     REG_EESCAPE      5
- = #define     REG_ESUBREG      6
- = #define     REG_EBRACK       7
- = #define     REG_EPAREN       8
- = #define     REG_EBRACE       9
- = #define     REG_BADBR       10
- = #define     REG_ERANGE      11
- = #define     REG_ESPACE      12
- = #define     REG_BADRPT      13
- = #define     REG_EMPTY       14
- = #define     REG_ASSERT      15
- = #define     REG_INVARG      16
- = #define     REG_ATOI        255     // convert name to number (!)
- = #define     REG_ITOA        0400    // convert number to name (!)
- */
-static struct rerr {
-       int code;
-       char *name;
-       char *explain;
-} rerrs[] = {
-       { REG_OKAY,     "REG_OKAY",     "no errors detected"},
-       { REG_NOMATCH,  "REG_NOMATCH",  "regexec() failed to match"},
-       { REG_BADPAT,   "REG_BADPAT",   "invalid regular expression"},
-       { REG_ECOLLATE, "REG_ECOLLATE", "invalid collating element"},
-       { REG_ECTYPE,   "REG_ECTYPE",   "invalid character class"},
-       { REG_EESCAPE,  "REG_EESCAPE",  "trailing backslash (\\)"},
-       { REG_ESUBREG,  "REG_ESUBREG",  "invalid backreference number"},
-       { REG_EBRACK,   "REG_EBRACK",   "brackets ([ ]) not balanced"},
-       { REG_EPAREN,   "REG_EPAREN",   "parentheses not balanced"},
-       { REG_EBRACE,   "REG_EBRACE",   "braces not balanced"},
-       { REG_BADBR,    "REG_BADBR",    "invalid repetition count(s)"},
-       { REG_ERANGE,   "REG_ERANGE",   "invalid character range"},
-       { REG_ESPACE,   "REG_ESPACE",   "out of memory"},
-       { REG_BADRPT,   "REG_BADRPT",   "repetition-operator operand invalid"},
-       { REG_EMPTY,    "REG_EMPTY",    "empty (sub)expression"},
-       { REG_ASSERT,   "REG_ASSERT",   "\"can't happen\" -- you found a bug"},
-       { REG_INVARG,   "REG_INVARG",   "invalid argument to regex routine"},
-       { -1,           "",             "*** unknown regexp error code ***"}
-};
-
-/*
- - regerror - the interface to error numbers
- = extern size_t regerror(int, const regex_t *, char *, size_t);
- */
-/* ARGSUSED */
-size_t
-regerror(
-    int                   errcode,
-    const regex_t *preg,
-    char *        errbuf,
-    size_t        errbuf_size)
-{
-       register struct rerr *r;
-       register size_t len;
-       register int target = errcode &~ REG_ITOA;
-       register char *s;
-       char convbuf[50];
-
-       if (errcode == REG_ATOI)
-               s = regatoi(preg, convbuf, SIZEOF(convbuf));
-       else {
-               for (r = rerrs; r->code >= 0; r++)
-                       if (r->code == target)
-                               break;
-
-               if (errcode&REG_ITOA) {
-                       if (r->code >= 0) {
-                               strncpy(convbuf, r->name, SIZEOF(convbuf)-1);
-                               convbuf[SIZEOF(convbuf)-1] = '\0';
-                       } else {
-                               snprintf(convbuf, SIZEOF(convbuf),
-                                           "REG_0x%x", (unsigned)target);
-                       }
-                       assert(strlen(convbuf) < SIZEOF(convbuf));
-                       s = convbuf;
-               } else
-                       s = r->explain;
-       }
-
-       len = strlen(s) + 1;
-       if (errbuf_size > 0) {
-               (void) strncpy(errbuf, s, errbuf_size-1);
-               errbuf[errbuf_size-1] = '\0';
-       }
-
-       return(len);
-}
-
-/*
- - regatoi - internal routine to implement REG_ATOI
- == static char *regatoi(const regex_t *preg, char *localbuf, size_t buflen);
- */
-static char *
-regatoi(
-    const regex_t *    preg,
-    char *             localbuf,
-    size_t             buflen)
-{
-       register struct rerr *r;
-
-       for (r = rerrs; r->code >= 0; r++) {
-               /*@ignore@*/
-               if (strcmp(r->name, preg->re_endp) == 0)
-                       break;
-               /*@end@*/
-       }
-       if (r->code < 0)
-               return("0");
-
-       snprintf(localbuf, buflen, "%d", r->code);
-       return(localbuf);
-}
diff --git a/regex-src/regex.3 b/regex-src/regex.3
deleted file mode 100644 (file)
index bc74709..0000000
+++ /dev/null
@@ -1,509 +0,0 @@
-.TH REGEX 3 "25 Sept 1997"
-.BY "Henry Spencer"
-.de ZR
-.\" one other place knows this name:  the SEE ALSO section
-.IR regex (7) \\$1
-..
-.SH NAME
-regcomp, regexec, regerror, regfree \- regular-expression library
-.SH SYNOPSIS
-.ft B
-.\".na
-#include <sys/types.h>
-.br
-#include <regex.h>
-.HP 10
-int regcomp(regex_t\ *preg, const\ char\ *pattern, int\ cflags);
-.HP
-int\ regexec(const\ regex_t\ *preg, const\ char\ *string,
-size_t\ nmatch, regmatch_t\ pmatch[], int\ eflags);
-.HP
-size_t\ regerror(int\ errcode, const\ regex_t\ *preg,
-char\ *errbuf, size_t\ errbuf_size);
-.HP
-void\ regfree(regex_t\ *preg);
-.\".ad
-.ft
-.SH DESCRIPTION
-These routines implement POSIX 1003.2 regular expressions (``RE''s);
-see
-.ZR .
-.I Regcomp
-compiles an RE written as a string into an internal form,
-.I regexec
-matches that internal form against a string and reports results,
-.I regerror
-transforms error codes from either into human-readable messages,
-and
-.I regfree
-frees any dynamically-allocated storage used by the internal form
-of an RE.
-.PP
-The header
-.I <regex.h>
-declares two structure types,
-.I regex_t
-and
-.IR regmatch_t ,
-the former for compiled internal forms and the latter for match reporting.
-It also declares the four functions,
-a type
-.IR regoff_t ,
-and a number of constants with names starting with ``REG_''.
-.PP
-.I Regcomp
-compiles the regular expression contained in the
-.I pattern
-string,
-subject to the flags in
-.IR cflags ,
-and places the results in the
-.I regex_t
-structure pointed to by
-.IR preg .
-.I Cflags
-is the bitwise OR of zero or more of the following flags:
-.IP REG_EXTENDED \w'REG_EXTENDED'u+2n
-Compile modern (``extended'') REs,
-rather than the obsolete (``basic'') REs that
-are the default.
-.IP REG_BASIC
-This is a synonym for 0,
-provided as a counterpart to REG_EXTENDED to improve readability.
-This is an extension,
-compatible with but not specified by POSIX 1003.2,
-and should be used with
-caution in software intended to be portable to other systems.
-.IP REG_NOSPEC
-Compile with recognition of all special characters turned off.
-All characters are thus considered ordinary,
-so the ``RE'' is a literal string.
-This is an extension,
-compatible with but not specified by POSIX 1003.2,
-and should be used with
-caution in software intended to be portable to other systems.
-REG_EXTENDED and REG_NOSPEC may not be used
-in the same call to
-.IR regcomp .
-.IP REG_ICASE
-Compile for matching that ignores upper/lower case distinctions.
-See
-.ZR .
-.IP REG_NOSUB
-Compile for matching that need only report success or failure,
-not what was matched.
-.IP REG_NEWLINE
-Compile for newline-sensitive matching.
-By default, newline is a completely ordinary character with no special
-meaning in either REs or strings.
-With this flag,
-`[^' bracket expressions and `.' never match newline,
-a `^' anchor matches the null string after any newline in the string
-in addition to its normal function,
-and the `$' anchor matches the null string before any newline in the
-string in addition to its normal function.
-.IP REG_PEND
-The regular expression ends,
-not at the first NUL,
-but just before the character pointed to by the
-.I re_endp
-member of the structure pointed to by
-.IR preg .
-The
-.I re_endp
-member is of type
-.IR const\ char\ * .
-This flag permits inclusion of NULs in the RE;
-they are considered ordinary characters.
-This is an extension,
-compatible with but not specified by POSIX 1003.2,
-and should be used with
-caution in software intended to be portable to other systems.
-.PP
-When successful,
-.I regcomp
-returns 0 and fills in the structure pointed to by
-.IR preg .
-One member of that structure
-(other than
-.IR re_endp )
-is publicized:
-.IR re_nsub ,
-of type
-.IR size_t ,
-contains the number of parenthesized subexpressions within the RE
-(except that the value of this member is undefined if the
-REG_NOSUB flag was used).
-If
-.I regcomp
-fails, it returns a non-zero error code;
-see DIAGNOSTICS.
-.PP
-.I Regexec
-matches the compiled RE pointed to by
-.I preg
-against the
-.IR string ,
-subject to the flags in
-.IR eflags ,
-and reports results using
-.IR nmatch ,
-.IR pmatch ,
-and the returned value.
-The RE must have been compiled by a previous invocation of
-.IR regcomp .
-The compiled form is not altered during execution of
-.IR regexec ,
-so a single compiled RE can be used simultaneously by multiple threads.
-.PP
-By default,
-the NUL-terminated string pointed to by
-.I string
-is considered to be the text of an entire line,
-with the NUL indicating the end of the line.
-(That is,
-any other end-of-line marker is considered to have been removed
-and replaced by the NUL.)
-The
-.I eflags
-argument is the bitwise OR of zero or more of the following flags:
-.IP REG_NOTBOL \w'REG_STARTEND'u+2n
-The first character of
-the string
-is not the beginning of a line, so the `^' anchor should not match before it.
-This does not affect the behavior of newlines under REG_NEWLINE.
-.IP REG_NOTEOL
-The NUL terminating
-the string
-does not end a line, so the `$' anchor should not match before it.
-This does not affect the behavior of newlines under REG_NEWLINE.
-.IP REG_STARTEND
-The string is considered to start at
-\fIstring\fR\ + \fIpmatch\fR[0].\fIrm_so\fR
-and to have a terminating NUL located at
-\fIstring\fR\ + \fIpmatch\fR[0].\fIrm_eo\fR
-(there need not actually be a NUL at that location),
-regardless of the value of
-.IR nmatch .
-See below for the definition of
-.IR pmatch
-and
-.IR nmatch .
-This is an extension,
-compatible with but not specified by POSIX 1003.2,
-and should be used with
-caution in software intended to be portable to other systems.
-Note that a non-zero \fIrm_so\fR does not imply REG_NOTBOL;
-REG_STARTEND affects only the location of the string,
-not how it is matched.
-.PP
-See
-.ZR
-for a discussion of what is matched in situations where an RE or a
-portion thereof could match any of several substrings of
-.IR string .
-.PP
-Normally,
-.I regexec
-returns 0 for success and the non-zero code REG_NOMATCH for failure.
-Other non-zero error codes may be returned in exceptional situations;
-see DIAGNOSTICS.
-.PP
-If REG_NOSUB was specified in the compilation of the RE,
-or if
-.I nmatch
-is 0,
-.I regexec
-ignores the
-.I pmatch
-argument (but see below for the case where REG_STARTEND is specified).
-Otherwise,
-.I pmatch
-points to an array of
-.I nmatch
-structures of type
-.IR regmatch_t .
-Such a structure has at least the members
-.I rm_so
-and
-.IR rm_eo ,
-both of type
-.I regoff_t
-(a signed arithmetic type at least as large as an
-.I off_t
-and a
-.IR ssize_t ),
-containing respectively the offset of the first character of a substring
-and the offset of the first character after the end of the substring.
-Offsets are measured from the beginning of the
-.I string
-argument given to
-.IR regexec .
-An empty substring is denoted by equal offsets,
-both indicating the character following the empty substring.
-.PP
-The 0th member of the
-.I pmatch
-array is filled in to indicate what substring of
-.I string
-was matched by the entire RE.
-Remaining members report what substring was matched by parenthesized
-subexpressions within the RE;
-member
-.I i
-reports subexpression
-.IR i ,
-with subexpressions counted (starting at 1) by the order of their opening
-parentheses in the RE, left to right.
-Unused entries in the array\(emcorresponding either to subexpressions that
-did not participate in the match at all, or to subexpressions that do not
-exist in the RE (that is, \fIi\fR\ > \fIpreg\fR\->\fIre_nsub\fR)\(emhave both
-.I rm_so
-and
-.I rm_eo
-set to \-1.
-If a subexpression participated in the match several times,
-the reported substring is the last one it matched.
-(Note, as an example in particular, that when the RE `(b*)+' matches `bbb',
-the parenthesized subexpression matches the three `b's and then
-an infinite number of empty strings following the last `b',
-so the reported substring is one of the empties.)
-.PP
-If REG_STARTEND is specified,
-.I pmatch
-must point to at least one
-.I regmatch_t
-(even if
-.I nmatch
-is 0 or REG_NOSUB was specified),
-to hold the input offsets for REG_STARTEND.
-Use for output is still entirely controlled by
-.IR nmatch ;
-if
-.I nmatch
-is 0 or REG_NOSUB was specified,
-the value of
-.IR pmatch [0]
-will not be changed by a successful
-.IR regexec .
-.PP
-.I Regerror
-maps a non-zero
-.I errcode
-from either
-.I regcomp
-or
-.I regexec
-to a human-readable, printable message.
-If
-.I preg
-is non-NULL,
-the error code should have arisen from use of
-the
-.I regex_t
-pointed to by
-.IR preg ,
-and if the error code came from
-.IR regcomp ,
-it should have been the result from the most recent
-.I regcomp
-using that
-.IR regex_t .
-.RI ( Regerror
-may be able to supply a more detailed message using information
-from the
-.IR regex_t .)
-.I Regerror
-places the NUL-terminated message into the buffer pointed to by
-.IR errbuf ,
-limiting the length (including the NUL) to at most
-.I errbuf_size
-bytes.
-If the whole message won't fit,
-as much of it as will fit before the terminating NUL is supplied.
-In any case,
-the returned value is the size of buffer needed to hold the whole
-message (including terminating NUL).
-If
-.I errbuf_size
-is 0,
-.I errbuf
-is ignored but the return value is still correct.
-.PP
-If the
-.I errcode
-given to
-.I regerror
-is first ORed with REG_ITOA,
-the ``message'' that results is the printable name of the error code,
-e.g. ``REG_NOMATCH'',
-rather than an explanation thereof.
-If
-.I errcode
-is REG_ATOI,
-then
-.I preg
-shall be non-NULL and the
-.I re_endp
-member of the structure it points to
-must point to the printable name of an error code;
-in this case, the result in
-.I errbuf
-is the decimal digits of
-the numeric value of the error code
-(0 if the name is not recognized).
-REG_ITOA and REG_ATOI are intended primarily as debugging facilities;
-they are extensions,
-compatible with but not specified by POSIX 1003.2,
-and should be used with
-caution in software intended to be portable to other systems.
-Be warned also that they are considered experimental and changes are possible.
-.PP
-.I Regfree
-frees any dynamically-allocated storage associated with the compiled RE
-pointed to by
-.IR preg .
-The remaining
-.I regex_t
-is no longer a valid compiled RE
-and the effect of supplying it to
-.I regexec
-or
-.I regerror
-is undefined.
-.PP
-None of these functions references global variables except for tables
-of constants;
-all are safe for use from multiple threads if the arguments are safe.
-.SH IMPLEMENTATION CHOICES
-There are a number of decisions that 1003.2 leaves up to the implementor,
-either by explicitly saying ``undefined'' or by virtue of them being
-forbidden by the RE grammar.
-This implementation treats them as follows.
-.PP
-See
-.ZR
-for a discussion of the definition of case-independent matching.
-.PP
-There is no particular limit on the length of REs,
-except insofar as memory is limited.
-Memory usage is approximately linear in RE size, and largely insensitive
-to RE complexity, except for bounded repetitions.
-See BUGS for one short RE using them
-that will run almost any system out of memory.
-.PP
-A backslashed character other than one specifically given a magic meaning
-by 1003.2 (such magic meanings occur only in obsolete [``basic''] REs)
-is taken as an ordinary character.
-.PP
-Any unmatched [ is a REG_EBRACK error.
-.PP
-Equivalence classes cannot begin or end bracket-expression ranges.
-The endpoint of one range cannot begin another.
-.PP
-RE_DUP_MAX, the limit on repetition counts in bounded repetitions, is 255.
-.PP
-A repetition operator (?, *, +, or bounds) cannot follow another
-repetition operator.
-A repetition operator cannot begin an expression or subexpression
-or follow `^' or `|'.
-.PP
-`|' cannot appear first or last in a (sub)expression or after another `|',
-i.e. an operand of `|' cannot be an empty subexpression.
-An empty parenthesized subexpression, `()', is legal and matches an
-empty (sub)string.
-An empty string is not a legal RE.
-.PP
-A `{' followed by a digit is considered the beginning of bounds for a
-bounded repetition, which must then follow the syntax for bounds.
-A `{' \fInot\fR followed by a digit is considered an ordinary character.
-.PP
-`^' and `$' beginning and ending subexpressions in obsolete (``basic'')
-REs are anchors, not ordinary characters.
-.SH SEE ALSO
-grep(1), regex(7)
-.PP
-POSIX 1003.2, sections 2.8 (Regular Expression Notation)
-and
-B.5 (C Binding for Regular Expression Matching).
-.SH DIAGNOSTICS
-Non-zero error codes from
-.I regcomp
-and
-.I regexec
-include the following:
-.PP
-.nf
-.ta \w'REG_ECOLLATE'u+3n
-REG_NOMATCH    regexec() failed to match
-REG_BADPAT     invalid regular expression
-REG_ECOLLATE   invalid collating element
-REG_ECTYPE     invalid character class
-REG_EESCAPE    \e applied to unescapable character
-REG_ESUBREG    invalid backreference number
-REG_EBRACK     brackets [ ] not balanced
-REG_EPAREN     parentheses ( ) not balanced
-REG_EBRACE     braces { } not balanced
-REG_BADBR      invalid repetition count(s) in { }
-REG_ERANGE     invalid character range in [ ]
-REG_ESPACE     ran out of memory
-REG_BADRPT     ?, *, or + operand invalid
-REG_EMPTY      empty (sub)expression
-REG_ASSERT     ``can't happen''\(emyou found a bug
-REG_INVARG     invalid argument, e.g. negative-length string
-.fi
-.SH HISTORY
-Written by Henry Spencer,
-henry@zoo.toronto.edu.
-.SH BUGS
-This is an alpha release with known defects.
-Please report problems.
-.PP
-There is one known functionality bug.
-The implementation of internationalization is incomplete:
-the locale is always assumed to be the default one of 1003.2,
-and only the collating elements etc. of that locale are available.
-.PP
-The back-reference code is subtle and doubts linger about its correctness
-in complex cases.
-.PP
-.I Regexec
-performance is poor.
-This will improve with later releases.
-.I Nmatch
-exceeding 0 is expensive;
-.I nmatch
-exceeding 1 is worse.
-.I Regexec
-is largely insensitive to RE complexity \fIexcept\fR that back
-references are massively expensive.
-RE length does matter; in particular, there is a strong speed bonus
-for keeping RE length under about 30 characters,
-with most special characters counting roughly double.
-.PP
-.I Regcomp
-implements bounded repetitions by macro expansion,
-which is costly in time and space if counts are large
-or bounded repetitions are nested.
-An RE like, say,
-`((((a{1,100}){1,100}){1,100}){1,100}){1,100}'
-will (eventually) run almost any existing machine out of swap space.
-.PP
-There are suspected problems with response to obscure error conditions.
-Notably,
-certain kinds of internal overflow,
-produced only by truly enormous REs or by multiply nested bounded repetitions,
-are probably not handled well.
-.PP
-Due to a mistake in 1003.2, things like `a)b' are legal REs because `)' is
-a special character only in the presence of a previous unmatched `('.
-This can't be fixed until the spec is fixed.
-.PP
-The standard's definition of back references is vague.
-For example, does
-`a\e(\e(b\e)*\e2\e)*d' match `abbbd'?
-Until the standard is clarified,
-behavior in such cases should not be relied on.
-.PP
-The implementation of word-boundary matching is a bit of a kludge,
-and bugs may lurk in combinations of word-boundary matching and anchoring.
diff --git a/regex-src/regex.7 b/regex-src/regex.7
deleted file mode 100644 (file)
index 0fa1802..0000000
+++ /dev/null
@@ -1,235 +0,0 @@
-.TH REGEX 7 "25 Oct 1995"
-.BY "Henry Spencer"
-.SH NAME
-regex \- POSIX 1003.2 regular expressions
-.SH DESCRIPTION
-Regular expressions (``RE''s),
-as defined in POSIX 1003.2, come in two forms:
-modern REs (roughly those of
-.IR egrep ;
-1003.2 calls these ``extended'' REs)
-and obsolete REs (roughly those of
-.IR ed ;
-1003.2 ``basic'' REs).
-Obsolete REs mostly exist for backward compatibility in some old programs;
-they will be discussed at the end.
-1003.2 leaves some aspects of RE syntax and semantics open;
-`\(dg' marks decisions on these aspects that
-may not be fully portable to other 1003.2 implementations.
-.PP
-A (modern) RE is one\(dg or more non-empty\(dg \fIbranches\fR,
-separated by `|'.
-It matches anything that matches one of the branches.
-.PP
-A branch is one\(dg or more \fIpieces\fR, concatenated.
-It matches a match for the first, followed by a match for the second, etc.
-.PP
-A piece is an \fIatom\fR possibly followed
-by a single\(dg `*', `+', `?', or \fIbound\fR.
-An atom followed by `*' matches a sequence of 0 or more matches of the atom.
-An atom followed by `+' matches a sequence of 1 or more matches of the atom.
-An atom followed by `?' matches a sequence of 0 or 1 matches of the atom.
-.PP
-A \fIbound\fR is `{' followed by an unsigned decimal integer,
-possibly followed by `,'
-possibly followed by another unsigned decimal integer,
-always followed by `}'.
-The integers must lie between 0 and RE_DUP_MAX (255\(dg) inclusive,
-and if there are two of them, the first may not exceed the second.
-An atom followed by a bound containing one integer \fIi\fR
-and no comma matches
-a sequence of exactly \fIi\fR matches of the atom.
-An atom followed by a bound
-containing one integer \fIi\fR and a comma matches
-a sequence of \fIi\fR or more matches of the atom.
-An atom followed by a bound
-containing two integers \fIi\fR and \fIj\fR matches
-a sequence of \fIi\fR through \fIj\fR (inclusive) matches of the atom.
-.PP
-An atom is a regular expression enclosed in `()' (matching a match for the
-regular expression),
-an empty set of `()' (matching the null string)\(dg,
-a \fIbracket expression\fR (see below), `.'
-(matching any single character), `^' (matching the null string at the
-beginning of a line), `$' (matching the null string at the
-end of a line), a `\e' followed by one of the characters
-`^.[$()|*+?{\e'
-(matching that character taken as an ordinary character),
-a `\e' followed by any other character\(dg
-(matching that character taken as an ordinary character,
-as if the `\e' had not been present\(dg),
-or a single character with no other significance (matching that character).
-A `{' followed by a character other than a digit is an ordinary
-character, not the beginning of a bound\(dg.
-It is illegal to end an RE with `\e'.
-.PP
-A \fIbracket expression\fR is a list of characters enclosed in `[]'.
-It normally matches any single character from the list (but see below).
-If the list begins with `^',
-it matches any single character
-(but see below) \fInot\fR from the rest of the list.
-If two characters in the list are separated by `\-', this is shorthand
-for the full \fIrange\fR of characters between those two (inclusive) in the
-collating sequence,
-e.g. `[0\-9]' in ASCII matches any decimal digit.
-It is illegal\(dg for two ranges to share an
-endpoint, e.g. `a\-c\-e'.
-Ranges are very collating-sequence-dependent,
-and portable programs should avoid relying on them.
-.PP
-To include a literal `]' in the list, make it the first character
-(following a possible `^').
-To include a literal `\-', make it the first or last character,
-or the second endpoint of a range.
-To use a literal `\-' as the first endpoint of a range,
-enclose it in `[.' and `.]' to make it a collating element (see below).
-With the exception of these and some combinations using `[' (see next
-paragraphs), all other special characters, including `\e', lose their
-special significance within a bracket expression.
-.PP
-Within a bracket expression, a collating element (a character,
-a multi-character sequence that collates as if it were a single character,
-or a collating-sequence name for either)
-enclosed in `[.' and `.]' stands for the
-sequence of characters of that collating element.
-The sequence is a single element of the bracket expression's list.
-A bracket expression containing a multi-character collating element 
-can thus match more than one character,
-e.g. if the collating sequence includes a `ch' collating element,
-then the RE `[[.ch.]]*c' matches the first five characters
-of `chchcc'.
-.PP
-Within a bracket expression, a collating element enclosed in `[=' and
-`=]' is an equivalence class, standing for the sequences of characters
-of all collating elements equivalent to that one, including itself.
-(If there are no other equivalent collating elements,
-the treatment is as if the enclosing delimiters were `[.' and `.]'.)
-For example, if o and \o'o^' are the members of an equivalence class,
-then `[[=o=]]', `[[=\o'o^'=]]', and `[o\o'o^']' are all synonymous.
-An equivalence class may not\(dg be an endpoint
-of a range.
-.PP
-Within a bracket expression, the name of a \fIcharacter class\fR enclosed
-in `[:' and `:]' stands for the list of all characters belonging to that
-class.
-Standard character class names are:
-.PP
-.RS
-.nf
-.ta 3c 6c 9c
-alnum  digit   punct
-alpha  graph   space
-blank  lower   upper
-cntrl  print   xdigit
-.fi
-.RE
-.PP
-These stand for the character classes defined in
-.IR ctype (3).
-A locale may provide others.
-A character class may not be used as an endpoint of a range.
-.PP
-There are two special cases\(dg of bracket expressions:
-the bracket expressions `[[:<:]]' and `[[:>:]]' match the null string at
-the beginning and end of a word respectively.
-A word is defined as a sequence of
-word characters
-which is neither preceded nor followed by
-word characters.
-A word character is an
-.I alnum
-character (as defined by
-.IR ctype (3))
-or an underscore.
-This is an extension,
-compatible with but not specified by POSIX 1003.2,
-and should be used with
-caution in software intended to be portable to other systems.
-.PP
-In the event that an RE could match more than one substring of a given
-string,
-the RE matches the one starting earliest in the string.
-If the RE could match more than one substring starting at that point,
-it matches the longest.
-Subexpressions also match the longest possible substrings, subject to
-the constraint that the whole match be as long as possible,
-with subexpressions starting earlier in the RE taking priority over
-ones starting later.
-Note that higher-level subexpressions thus take priority over
-their lower-level component subexpressions.
-.PP
-Match lengths are measured in characters, not collating elements.
-A null string is considered longer than no match at all.
-For example,
-`bb*' matches the three middle characters of `abbbc',
-`(wee|week)(knights|nights)' matches all ten characters of `weeknights',
-when `(.*).*' is matched against `abc' the parenthesized subexpression
-matches all three characters, and
-when `(a*)*' is matched against `bc' both the whole RE and the parenthesized
-subexpression match the null string.
-.PP
-If case-independent matching is specified,
-the effect is much as if all case distinctions had vanished from the
-alphabet.
-When an alphabetic that exists in multiple cases appears as an
-ordinary character outside a bracket expression, it is effectively
-transformed into a bracket expression containing both cases,
-e.g. `x' becomes `[xX]'.
-When it appears inside a bracket expression, all case counterparts
-of it are added to the bracket expression, so that (e.g.) `[x]'
-becomes `[xX]' and `[^x]' becomes `[^xX]'.
-.PP
-No particular limit is imposed on the length of REs\(dg.
-Programs intended to be portable should not employ REs longer
-than 256 bytes,
-as an implementation can refuse to accept such REs and remain
-POSIX-compliant.
-.PP
-Obsolete (``basic'') regular expressions differ in several respects.
-`|', `+', and `?' are ordinary characters and there is no equivalent
-for their functionality.
-The delimiters for bounds are `\e{' and `\e}',
-with `{' and `}' by themselves ordinary characters.
-The parentheses for nested subexpressions are `\e(' and `\e)',
-with `(' and `)' by themselves ordinary characters.
-`^' is an ordinary character except at the beginning of the
-RE or\(dg the beginning of a parenthesized subexpression,
-`$' is an ordinary character except at the end of the
-RE or\(dg the end of a parenthesized subexpression,
-and `*' is an ordinary character if it appears at the beginning of the
-RE or the beginning of a parenthesized subexpression
-(after a possible leading `^').
-Finally, there is one new type of atom, a \fIback reference\fR:
-`\e' followed by a non-zero decimal digit \fId\fR
-matches the same sequence of characters
-matched by the \fId\fRth parenthesized subexpression
-(numbering subexpressions by the positions of their opening parentheses,
-left to right),
-so that (e.g.) `\e([bc]\e)\e1' matches `bb' or `cc' but not `bc'.
-.SH SEE ALSO
-regex(3)
-.PP
-POSIX 1003.2, section 2.8 (Regular Expression Notation).
-.SH HISTORY
-Written by Henry Spencer, based on the 1003.2 spec.
-.SH BUGS
-Having two kinds of REs is a botch.
-.PP
-The current 1003.2 spec says that `)' is an ordinary character in
-the absence of an unmatched `(';
-this was an unintentional result of a wording error,
-and change is likely.
-Avoid relying on it.
-.PP
-Back references are a dreadful botch,
-posing major problems for efficient implementations.
-They are also somewhat vaguely defined
-(does
-`a\e(\e(b\e)*\e2\e)*d' match `abbbd'?).
-Avoid using them.
-.PP
-1003.2's specification of case-independent matching is vague.
-The ``one case implies all cases'' definition given above
-is current consensus among implementors as to the right interpretation.
-.PP
-The syntax for word boundaries is incredibly ugly.
diff --git a/regex-src/regex2.h b/regex-src/regex2.h
deleted file mode 100644 (file)
index 52aa9df..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-#ifndef REGEX2_H
-#define REGEX2_H
-
-/*
- * First, the stuff that ends up in the outside-world include file
- = typedef off_t regoff_t;
- = typedef struct {
- =     int re_magic;
- =     size_t re_nsub;         // number of parenthesized subexpressions
- =     const char *re_endp;    // end pointer for REG_PEND
- =     struct re_guts *re_g;   // none of your business :-)
- = } regex_t;
- = typedef struct {
- =     regoff_t rm_so;         // start of match
- =     regoff_t rm_eo;         // end of match
- = } regmatch_t;
- */
-/*
- * internals of regex_t
- */
-#define        MAGIC1  ((('r'^0200)<<8) | 'e')
-
-/*
- * The internal representation is a *strip*, a sequence of
- * operators ending with an endmarker.  (Some terminology etc. is a
- * historical relic of earlier versions which used multiple strips.)
- * Certain oddities in the representation are there to permit running
- * the machinery backwards; in particular, any deviation from sequential
- * flow must be marked at both its source and its destination.  Some
- * fine points:
- *
- * - OPLUS_ and O_PLUS are *inside* the loop they create.
- * - OQUEST_ and O_QUEST are *outside* the bypass they create.
- * - OCH_ and O_CH are *outside* the multi-way branch they create, while
- *   OOR1 and OOR2 are respectively the end and the beginning of one of
- *   the branches.  Note that there is an implicit OOR2 following OCH_
- *   and an implicit OOR1 preceding O_CH.
- *
- * In state representations, an operator's bit is on to signify a state
- * immediately *preceding* "execution" of that operator.
- */
-typedef unsigned long sop;     /* strip operator */
-typedef unsigned long sopno;
-#define        OPRMASK 0xf8000000
-#define        OPDMASK 0x07ffffff
-#define        OPSHIFT ((unsigned)27)
-#define        OP(n)   ((n)&OPRMASK)
-#define        OPND(n) ((n)&OPDMASK)
-#define        SOP(op, opnd)   ((op)|(opnd))
-
-#ifndef UNSIGNEDLONG1
-#ifndef NO_UL_CNSTS
-#define UNSIGNEDLONG1 1ul
-#else
-#define UNSIGNEDLONG1 ((unsigned long)1)
-#endif
-#endif
-
-#define MAKE_UNSIGNED_LONG(num) (UNSIGNEDLONG1*num)
-#define SHIFTED_UL(num) (MAKE_UNSIGNED_LONG(num) << OPSHIFT)
-
-/* operators                      meaning      operand                 */
-/*                                             (back, fwd are offsets) */
-#define        OEND    (SHIFTED_UL(1)) /* endmarker    -                       */
-#define        OCHAR   (SHIFTED_UL(2)) /* character    unsigned char           */
-#define        OBOL    (SHIFTED_UL(3)) /* left anchor  -                       */
-#define        OEOL    (SHIFTED_UL(4)) /* right anchor -                       */
-#define        OANY    (SHIFTED_UL(5)) /* .            -                       */
-#define        OANYOF  (SHIFTED_UL(6)) /* [...]        set number              */
-#define        OBACK_  (SHIFTED_UL(7)) /* begin \d     paren number            */
-#define        O_BACK  (SHIFTED_UL(8)) /* end \d       paren number            */
-#define        OPLUS_  (SHIFTED_UL(9)) /* + prefix     fwd to suffix           */
-#define        O_PLUS  (SHIFTED_UL(10))        /* + suffix     back to prefix          */
-#define        OQUEST_ (SHIFTED_UL(11))        /* ? prefix     fwd to suffix           */
-#define        O_QUEST (SHIFTED_UL(12))        /* ? suffix     back to prefix          */
-#define        OLPAREN (SHIFTED_UL(13))        /* (            fwd to )                */
-#define        ORPAREN (SHIFTED_UL(14))        /* )            back to (               */
-#define        OCH_    (SHIFTED_UL(15))        /* begin choice fwd to OOR2             */
-#define        OOR1    (SHIFTED_UL(16))        /* | pt. 1      back to OOR1 or OCH_    */
-#define        OOR2    (SHIFTED_UL(17))        /* | pt. 2      fwd to OOR2 or O_CH     */
-#define        O_CH    (SHIFTED_UL(18))        /* end choice   back to OOR1            */
-#define        OBOW    (SHIFTED_UL(19))        /* begin word   -                       */
-#define        OEOW    (SHIFTED_UL(20))        /* end word     -                       */
-
-/*
- * Structure for [] character-set representation.  Character sets are
- * done as bit vectors, grouped 8 to a byte vector for compactness.
- * The individual set therefore has both a pointer to the byte vector
- * and a mask to pick out the relevant bit of each byte.  A hash code
- * simplifies testing whether two sets could be identical.
- *
- * This will get trickier for multicharacter collating elements.  As
- * preliminary hooks for dealing with such things, we also carry along
- * a string of multi-character elements, and decide the size of the
- * vectors at run time.
- */
-typedef struct {
-       uch *ptr;               /* -> uch [csetsize] */
-       uch mask;               /* bit within array */
-       uch hash;               /* hash code */
-       size_t smultis;
-       char *multis;           /* -> char[smulti]  ab\0cd\0ef\0\0 */
-} cset;
-/* note that CHadd and CHsub are unsafe, and CHIN doesn't yield 0/1 */
-#define        CHadd(cs, c)    do {                                            \
-    (cs)->ptr[(uch)(c)] = (uch)((cs)->ptr[(uch)(c)] | (cs)->mask);     \
-    (cs)->hash = (uch)((cs)->hash + (c));                              \
-} while (0)
-
-#define        CHsub(cs, c)    do {                                            \
-    (cs)->ptr[(uch)(c)] = (uch)((cs)->ptr[(uch)(c)] & ~(cs)->mask);    \
-    (cs)->hash = (uch)((cs)->hash - (c));                              \
-} while (0)
-
-#define        CHIN(cs, c)     ((cs)->ptr[(uch)(c)] & (cs)->mask)
-#define        MCadd(p, cs, cp)        mcadd(p, cs, cp)        /* regcomp() internal fns */
-#define        MCsub(p, cs, cp)        mcsub(p, cs, cp)
-#define        MCin(p, cs, cp) mcin(p, cs, cp)
-
-/* stuff for character categories */
-typedef unsigned char cat_t;
-
-/*
- * main compiled-expression structure
- */
-struct re_guts {
-       int magic;
-#              define  MAGIC2  ((('R'^0200)<<8)|'E')
-       sop *strip;             /* malloced area for strip */
-       int csetsize;           /* number of bits in a cset vector */
-       int ncsets;             /* number of csets in use */
-       cset *sets;             /* -> cset [ncsets] */
-       uch *setbits;           /* -> uch[csetsize][ncsets/CHAR_BIT] */
-       int cflags;             /* copy of regcomp() cflags argument */
-       sopno nstates;          /* = number of sops */
-       sopno firststate;       /* the initial OEND (normally 0) */
-       sopno laststate;        /* the final OEND */
-       int iflags;             /* internal flags */
-#              define  USEBOL  01      /* used ^ */
-#              define  USEEOL  02      /* used $ */
-#              define  BAD     04      /* something wrong */
-       int nbol;               /* number of ^ used */
-       int neol;               /* number of $ used */
-       int ncategories;        /* how many character categories */
-       cat_t *categories;      /* ->catspace[-CHAR_MIN] */
-       char *must;             /* match must contain this string */
-       sopno mlen;             /* length of must */
-       size_t nsub;            /* copy of re_nsub */
-       int backrefs;           /* does it use back references? */
-       sopno nplus;            /* how deep does it nest +s? */
-       /* catspace must be last */
-       cat_t catspace[1];      /* actually [NC] */
-};
-
-/* misc utilities */
-#define        OUT     (CHAR_MAX+1)    /* a non-character value */
-#define        ISWORD(c)       (isalnum(c) || (c) == '_')
-
-#endif /* !REGEX2_H */
diff --git a/regex-src/regexec.c b/regex-src/regexec.c
deleted file mode 100644 (file)
index 4213cdd..0000000
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * the outer shell of regexec()
- *
- * This file includes engine.c *twice*, after muchos fiddling with the
- * macros that code uses.  This lets the same code operate on two different
- * representations for state sets.
- */
-#include "amanda.h"
-#include <regex.h>
-#include "utils.h"
-#include "regex2.h"
-
-#undef ISSET
-
-/* macros for manipulating states, small version */
-#define        states  unsigned long
-#define        states1 states          /* for later use in regexec() decision */
-#define        CLEAR(v)        (((v) = 0), (void)(v))
-#define        SET0(v, n)      ((v) &= ~(MAKE_UNSIGNED_LONG(1) << (n)))
-#define        SET1(v, n)      ((v) |= (MAKE_UNSIGNED_LONG(1)) << (n))
-#define        ISSET(v, n)     ((v) & ((MAKE_UNSIGNED_LONG(1)) << (n)))
-#define        ASSIGN(d, s)    ((d) = (s), (void)(d))
-#define        EQ(a, b)        ((a) == (b))
-#define        STATEVARS       int dummy       /* dummy version */
-#define        STATESETUP(m, n)        /* nothing */
-#define        STATETEARDOWN(m)        /* nothing */
-#define        SETUP(v)        ((v) = 0)
-#define        onestate        sopno
-#define        INIT(o, n)      ((o) = (sopno)1 << (n))
-#define        INC(o)  ((o) <<= 1)
-#define        ISSTATEIN(v, o) ((v) & (o))
-/* some abbreviations; note that some of these know variable names! */
-/* do "if I'm here, I can also be there" etc without branches */
-#define        FWD(dst, src, n)        ((dst) |= ((unsigned long)(src)&(here)) << (n))
-#define        BACK(dst, src, n)       ((dst) |= ((unsigned long)(src)&(here)) >> (n))
-#define        ISSETBACK(v, n) ((v) & ((long)here >> (n)))
-/* function names */
-#define SNAMES                 /* engine.c looks after details */
-
-#include "engine.c"
-
-/* now undo things */
-#undef states
-#undef CLEAR
-#undef SET0
-#undef SET1
-#undef ISSET
-#undef ASSIGN
-#undef EQ
-#undef STATEVARS
-#undef STATESETUP
-#undef STATETEARDOWN
-#undef SETUP
-#undef onestate
-#undef INIT
-#undef INC
-#undef ISSTATEIN
-#undef FWD
-#undef BACK
-#undef ISSETBACK
-#undef SNAMES
-
-/* macros for manipulating states, large version */
-#define        states  char *
-#define        CLEAR(v)        memset((v), 0, (size_t)m->g->nstates)
-#define        SET0(v, n)      ((v)[n] = 0)
-#define        SET1(v, n)      ((v)[n] = 1)
-#define        ISSET(v, n)     ((v)[n])
-#define        ASSIGN(d, s)    memcpy((d), (s), (size_t)m->g->nstates)
-#define        EQ(a, b)        (memcmp((a), (b), (size_t)m->g->nstates) == 0)
-#define        STATEVARS       int vn; char *space
-#define        STATESETUP(m, nv) do {                                          \
-           (m)->space = malloc((size_t)(nv)*(size_t)(m)->g->nstates);  \
-           if ((m)->space == NULL)                                     \
-               return(REG_ESPACE);                                     \
-           (m)->vn = 0;                                                \
-} while (0);
-
-#define        STATETEARDOWN(m)        { free((m)->space); }
-#define        SETUP(v)        ((v) = &m->space[m->vn++ * m->g->nstates])
-#define        onestate        int
-#define        INIT(o, n)      ((o) = (n))
-#define        INC(o)  ((o)++)
-#define        ISSTATEIN(v, o) ((v)[o])
-/* some abbreviations; note that some of these know variable names! */
-/* do "if I'm here, I can also be there" etc without branches */
-#define        FWD(dst, src, n)        ((dst)[here+(n)] |= (src)[here])
-#define        BACK(dst, src, n)       ((dst)[here-(n)] |= (src)[here])
-#define        ISSETBACK(v, n) ((v)[here - (n)])
-/* function names */
-#define        LNAMES                  /* flag */
-
-#include "engine.c"
-
-/*
- - regexec - interface for matching
- = int regexec(regex_t *preg, const char *string, size_t nmatch, regmatch_t pmatch[], int eflags);
- = #define     REG_NOTBOL      00001
- = #define     REG_NOTEOL      00002
- = #define     REG_STARTEND    00004
- = #define     REG_TRACE       00400   // tracing of execution
- = #define     REG_LARGE       01000   // force large representation
- = #define     REG_BACKR       02000   // force use of backref code
- *
- * We put this here so we can exploit knowledge of the state representation
- * when choosing which matcher to call.  Also, by this point the matchers
- * have been prototyped.
- */
-int                            /* 0 success, REG_NOMATCH failure */
-regexec(
-    regex_t *preg,
-    const char *string,
-    size_t nmatch,
-    regmatch_t pmatch[],
-    int eflags)
-{
-       /*@ignore@*/
-       register struct re_guts *g = preg->re_g;
-#ifdef REDEBUG
-#      define  GOODFLAGS(f)    (f)
-#else
-#      define  GOODFLAGS(f)    ((f)&(REG_NOTBOL|REG_NOTEOL|REG_STARTEND))
-#endif
-
-       if (preg->re_magic != MAGIC1 || g->magic != MAGIC2)
-               return(REG_BADPAT);
-       /*@end@*/
-       assert(!(g->iflags&BAD));
-       if (g->iflags&BAD)              /* backstop for no-debug case */
-               return(REG_BADPAT);
-       eflags = GOODFLAGS(eflags);
-
-       if ((g->nstates <= ((sopno)(CHAR_BIT * SIZEOF(states1))) &&
-           !(eflags & REG_LARGE)))
-               return(smatcher(g, string, nmatch, pmatch, eflags));
-       return(lmatcher(g, string, nmatch, pmatch, eflags));
-}
diff --git a/regex-src/regfree.c b/regex-src/regfree.c
deleted file mode 100644 (file)
index be39831..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-#include "amanda.h"
-#include <regex.h>
-#include "utils.h"
-#include "regex2.h"
-
-/*
- - regfree - free everything
- = extern void regfree(regex_t *);
- */
-void
-regfree(
-    regex_t *preg)
-{
-       register struct re_guts *g;
-
-       /*@ignore@*/
-       if (preg->re_magic != MAGIC1)   /* oops */
-               return;                 /* nice to complain, but hard */
-
-       g = preg->re_g;
-       if (g == NULL || g->magic != MAGIC2)    /* oops again */
-               return;
-       preg->re_magic = 0;             /* mark it invalid */
-       /*@end@*/
-       g->magic = 0;                   /* mark it invalid */
-
-       if (g->strip != NULL)
-               free((char *)g->strip);
-       if (g->sets != NULL)
-               free((char *)g->sets);
-       if (g->setbits != NULL)
-               free((char *)g->setbits);
-       if (g->must != NULL)
-               free(g->must);
-       free((char *)g);
-}
diff --git a/regex-src/split.c b/regex-src/split.c
deleted file mode 100644 (file)
index 415f8ab..0000000
+++ /dev/null
@@ -1,323 +0,0 @@
-#include <amanda.h>
-#include <stdio.h>
-#include <string.h>
-
-/*
- - split - divide a string into fields, like awk split()
- = int split(char *string, char *fields[], int nfields, char *sep);
- */
-int                            /* number of fields, including overflow */
-split(
-    char *     string,
-    char *     fields[],       /* list is not NULL-terminated */
-    int                nfields,        /* number of entries available in fields[] */
-    char *     sep)            /* "" white, "c" single char, "ab" [ab]+ */
-{
-       register char *p = string;
-       register char c;                        /* latest character */
-       register char sepc = sep[0];
-       register char sepc2;
-       register int fn;
-       register char **fp = fields;
-       register char *sepp;
-       register int trimtrail;
-
-       /* white space */
-       if (sepc == '\0') {
-               while ((c = *p++) == ' ' || c == '\t')
-                       continue;
-               p--;
-               trimtrail = 1;
-               sep = " \t";    /* note, code below knows this is 2 long */
-               sepc = ' ';
-       } else
-               trimtrail = 0;
-       sepc2 = sep[1];         /* now we can safely pick this up */
-
-       /* catch empties */
-       if (*p == '\0')
-               return(0);
-
-       /* single separator */
-       if (sepc2 == '\0') {
-               fn = nfields;
-               for (;;) {
-                       *fp++ = p;
-                       fn--;
-                       if (fn == 0)
-                               break;
-                       while ((c = *p++) != sepc)
-                               if (c == '\0')
-                                       return(nfields - fn);
-                       *(p-1) = '\0';
-               }
-               /* we have overflowed the fields vector -- just count them */
-               fn = nfields;
-               for (;;) {
-                       while ((c = *p++) != sepc)
-                               if (c == '\0')
-                                       return(fn);
-                       fn++;
-               }
-               /* not reached */
-       }
-
-       /* two separators */
-       if (sep[2] == '\0') {
-               fn = nfields;
-               for (;;) {
-                       *fp++ = p;
-                       fn--;
-                       while ((c = *p++) != sepc && c != sepc2)
-                               if (c == '\0') {
-                                       if (trimtrail && **(fp-1) == '\0')
-                                               fn++;
-                                       return(nfields - fn);
-                               }
-                       if (fn == 0)
-                               break;
-                       *(p-1) = '\0';
-                       while ((c = *p++) == sepc || c == sepc2)
-                               continue;
-                       p--;
-               }
-               /* we have overflowed the fields vector -- just count them */
-               fn = nfields;
-               while (c != '\0') {
-                       while ((c = *p++) == sepc || c == sepc2)
-                               continue;
-                       p--;
-                       fn++;
-                       while ((c = *p++) != '\0' && c != sepc && c != sepc2)
-                               continue;
-               }
-               /* might have to trim trailing white space */
-               if (trimtrail) {
-                       p--;
-                       while ((c = *--p) == sepc || c == sepc2)
-                               continue;
-                       p++;
-                       if (*p != '\0') {
-                               if (fn == nfields+1)
-                                       *p = '\0';
-                               fn--;
-                       }
-               }
-               return(fn);
-       }
-
-       /* n separators */
-       fn = 0;
-       for (;;) {
-               if (fn < nfields)
-                       *fp++ = p;
-               fn++;
-               for (;;) {
-                       c = *p++;
-                       if (c == '\0')
-                               return(fn);
-                       sepp = sep;
-                       while ((sepc = *sepp++) != '\0' && sepc != c)
-                               continue;
-                       if (sepc != '\0')       /* it was a separator */
-                               break;
-               }
-               if (fn < nfields)
-                       *(p-1) = '\0';
-               for (;;) {
-                       c = *p++;
-                       sepp = sep;
-                       while ((sepc = *sepp++) != '\0' && sepc != c)
-                               continue;
-                       if (sepc == '\0')       /* it wasn't a separator */
-                               break;
-               }
-               p--;
-       }
-
-       /* not reached */
-}
-
-#ifdef TEST_SPLIT
-
-
-/*
- * test program
- * pgm         runs regression
- * pgm sep     splits stdin lines by sep
- * pgm str sep splits str by sep
- * pgm str sep n       splits str by sep n times
- */
-int
-main(
-    int                argc,
-    char *     argv[])
-{
-       char buf[512];
-       register int n;
-#      define  MNF     10
-       char *fields[MNF];
-
-       if (argc > 4)
-               for (n = atoi(argv[3]); n > 0; n--) {
-                       strncpy(buf, argv[1], SIZEOF(buf)-1);
-                       buf[SIZEOF(buf)-1] = '\0';
-               }
-       else if (argc > 3)
-               for (n = atoi(argv[3]); n > 0; n--) {
-                       strncpy(buf, argv[1], SIZEOF(buf)-1);
-                       buf[SIZEOF(buf)-1] = '\0';
-                       (void) split(buf, fields, MNF, argv[2]);
-               }
-       else if (argc > 2)
-               dosplit(argv[1], argv[2]);
-       else if (argc > 1)
-               while (fgets(buf, (int)sizeof(buf), stdin) != NULL) {
-                       buf[strlen(buf)-1] = '\0';      /* stomp newline */
-                       dosplit(buf, argv[1]);
-               }
-       else
-               regress();
-
-       exit(0);
-}
-
-int
-dosplit(
-    char *     string,
-    char *     seps)
-{
-#      define  NF      5
-       char *fields[NF];
-       register int nf;
-
-       nf = split(string, fields, NF, seps);
-       print(nf, NF, fields);
-}
-
-int
-print(
-    int nf,
-    int nfp,
-    char *fields[])
-{
-       register int fn;
-       register int bound;
-
-       bound = (nf > nfp) ? nfp : nf;
-       printf("%d:\t", nf);
-       for (fn = 0; fn < bound; fn++)
-               printf("\"%s\"%s", fields[fn], (fn+1 < nf) ? ", " : "\n");
-}
-
-#define        RNF     5               /* some table entries know this */
-struct {
-       char *str;
-       char *seps;
-       int nf;
-       char *fi[RNF];
-} tests[] = {
-       "",             " ",    0,      { "" },
-       " ",            " ",    2,      { "", "" },
-       "x",            " ",    1,      { "x" },
-       "xy",           " ",    1,      { "xy" },
-       "x y",          " ",    2,      { "x", "y" },
-       "abc def  g ",  " ",    5,      { "abc", "def", "", "g", "" },
-       "  a bcd",      " ",    4,      { "", "", "a", "bcd" },
-       "a b c d e f",  " ",    6,      { "a", "b", "c", "d", "e f" },
-       " a b c d ",    " ",    6,      { "", "a", "b", "c", "d " },
-
-       "",             " _",   0,      { "" },
-       " ",            " _",   2,      { "", "" },
-       "x",            " _",   1,      { "x" },
-       "x y",          " _",   2,      { "x", "y" },
-       "ab _ cd",      " _",   2,      { "ab", "cd" },
-       " a_b  c ",     " _",   5,      { "", "a", "b", "c", "" },
-       "a b c_d e f",  " _",   6,      { "a", "b", "c", "d", "e f" },
-       " a b c d ",    " _",   6,      { "", "a", "b", "c", "d " },
-
-       "",             " _~",  0,      { "" },
-       " ",            " _~",  2,      { "", "" },
-       "x",            " _~",  1,      { "x" },
-       "x y",          " _~",  2,      { "x", "y" },
-       "ab _~ cd",     " _~",  2,      { "ab", "cd" },
-       " a_b  c~",     " _~",  5,      { "", "a", "b", "c", "" },
-       "a b_c d~e f",  " _~",  6,      { "a", "b", "c", "d", "e f" },
-       "~a b c d ",    " _~",  6,      { "", "a", "b", "c", "d " },
-
-       "",             " _~-", 0,      { "" },
-       " ",            " _~-", 2,      { "", "" },
-       "x",            " _~-", 1,      { "x" },
-       "x y",          " _~-", 2,      { "x", "y" },
-       "ab _~- cd",    " _~-", 2,      { "ab", "cd" },
-       " a_b  c~",     " _~-", 5,      { "", "a", "b", "c", "" },
-       "a b_c-d~e f",  " _~-", 6,      { "a", "b", "c", "d", "e f" },
-       "~a-b c d ",    " _~-", 6,      { "", "a", "b", "c", "d " },
-
-       "",             "  ",   0,      { "" },
-       " ",            "  ",   2,      { "", "" },
-       "x",            "  ",   1,      { "x" },
-       "xy",           "  ",   1,      { "xy" },
-       "x y",          "  ",   2,      { "x", "y" },
-       "abc def  g ",  "  ",   4,      { "abc", "def", "g", "" },
-       "  a bcd",      "  ",   3,      { "", "a", "bcd" },
-       "a b c d e f",  "  ",   6,      { "a", "b", "c", "d", "e f" },
-       " a b c d ",    "  ",   6,      { "", "a", "b", "c", "d " },
-
-       "",             "",     0,      { "" },
-       " ",            "",     0,      { "" },
-       "x",            "",     1,      { "x" },
-       "xy",           "",     1,      { "xy" },
-       "x y",          "",     2,      { "x", "y" },
-       "abc def  g ",  "",     3,      { "abc", "def", "g" },
-       "\t a bcd",     "",     2,      { "a", "bcd" },
-       "  a \tb\t c ", "",     3,      { "a", "b", "c" },
-       "a b c d e ",   "",     5,      { "a", "b", "c", "d", "e" },
-       "a b\tc d e f", "",     6,      { "a", "b", "c", "d", "e f" },
-       " a b c d e f ",        "",     6,      { "a", "b", "c", "d", "e f " },
-
-       NULL,           NULL,   0,      { NULL },
-};
-
-int
-regress(void)
-{
-       char buf[512];
-       register int n;
-       char *fields[RNF+1];
-       register int nf;
-       register int i;
-       register int printit;
-       register char *f;
-
-       for (n = 0; tests[n].str != NULL; n++) {
-               strncpy(buf, tests[n].str, SIZEOF(buf)-1);
-               buf[SIZEOF(buf)-1] = '\0';
-               fields[RNF] = NULL;
-               nf = split(buf, fields, RNF, tests[n].seps);
-               printit = 0;
-               if (nf != tests[n].nf) {
-                       printf("split `%s' by `%s' gave %d fields, not %d\n",
-                               tests[n].str, tests[n].seps, nf, tests[n].nf);
-                       printit = 1;
-               } else if (fields[RNF] != NULL) {
-                       printf("split() went beyond array end\n");
-                       printit = 1;
-               } else {
-                       for (i = 0; i < nf && i < RNF; i++) {
-                               f = fields[i];
-                               if (f == NULL)
-                                       f = "(NULL)";
-                               if (strcmp(f, tests[n].fi[i]) != 0) {
-                                       printf("split `%s' by `%s', field %d is `%s', not `%s'\n",
-                                               tests[n].str, tests[n].seps,
-                                               i, fields[i], tests[n].fi[i]);
-                                       printit = 1;
-                               }
-                       }
-               }
-               if (printit)
-                       print(nf, RNF, fields);
-       }
-}
-#endif
diff --git a/regex-src/tests b/regex-src/tests
deleted file mode 100644 (file)
index 0de9118..0000000
+++ /dev/null
@@ -1,476 +0,0 @@
-# regular expression test set
-# Lines are at least three fields, separated by one or more tabs.  "" stands
-# for an empty field.  First field is an RE.  Second field is flags.  If
-# C flag given, regcomp() is expected to fail, and the third field is the
-# error name (minus the leading REG_).
-#
-# Otherwise it is expected to succeed, and the third field is the string to
-# try matching it against.  If there is no fourth field, the match is
-# expected to fail.  If there is a fourth field, it is the substring that
-# the RE is expected to match.  If there is a fifth field, it is a comma-
-# separated list of what the subexpressions should match, with - indicating
-# no match for that one.  In both the fourth and fifth fields, a (sub)field
-# starting with @ indicates that the (sub)expression is expected to match
-# a null string followed by the stuff after the @; this provides a way to
-# test where null strings match.  The character `N' in REs and strings
-# is newline, `S' is space, `T' is tab, `Z' is NUL.
-#
-# The full list of flags:
-#      -       placeholder, does nothing
-#      b       RE is a BRE, not an ERE
-#      &       try it as both an ERE and a BRE
-#      C       regcomp() error expected, third field is error name
-#      i       REG_ICASE
-#      m       ("mundane") REG_NOSPEC
-#      s       REG_NOSUB (not really testable)
-#      n       REG_NEWLINE
-#      ^       REG_NOTBOL
-#      $       REG_NOTEOL
-#      #       REG_STARTEND (see below)
-#      p       REG_PEND
-#
-# For REG_STARTEND, the start/end offsets are those of the substring
-# enclosed in ().
-
-# basics
-a              &       a       a
-abc            &       abc     abc
-abc|de         -       abc     abc
-a|b|c          -       abc     a
-
-# parentheses and perversions thereof
-a(b)c          -       abc     abc
-a\(b\)c                b       abc     abc
-a(             C       EPAREN
-a(             b       a(      a(
-a\(            -       a(      a(
-a\(            bC      EPAREN
-a\(b           bC      EPAREN
-a(b            C       EPAREN
-a(b            b       a(b     a(b
-# gag me with a right parenthesis -- 1003.2 goofed here (my fault, partly)
-a)             -       a)      a)
-)              -       )       )
-# end gagging (in a just world, those *should* give EPAREN)
-a)             b       a)      a)
-a\)            bC      EPAREN
-\)             bC      EPAREN
-a()b           -       ab      ab
-a\(\)b         b       ab      ab
-
-# anchoring and REG_NEWLINE
-^abc$          &       abc     abc
-a^b            -       a^b
-a^b            b       a^b     a^b
-a$b            -       a$b
-a$b            b       a$b     a$b
-^              &       abc     @abc
-$              &       abc     @
-^$             &       ""      @
-$^             -       ""      @
-\($\)\(^\)     b       ""      @
-# stop retching, those are legitimate (although disgusting)
-^^             -       ""      @
-$$             -       ""      @
-b$             &       abNc
-b$             &n      abNc    b
-^b$            &       aNbNc
-^b$            &n      aNbNc   b
-^$             &n      aNNb    @Nb
-^$             n       abc
-^$             n       abcN    @
-$^             n       aNNb    @Nb
-\($\)\(^\)     bn      aNNb    @Nb
-^^             n^      aNNb    @Nb
-$$             n       aNNb    @NN
-^a             ^       a
-a$             $       a
-^a             ^n      aNb
-^b             ^n      aNb     b
-a$             $n      bNa
-b$             $n      bNa     b
-a*(^b$)c*      -       b       b
-a*\(^b$\)c*    b       b       b
-
-# certain syntax errors and non-errors
-|              C       EMPTY
-|              b       |       |
-*              C       BADRPT
-*              b       *       *
-+              C       BADRPT
-?              C       BADRPT
-""             &C      EMPTY
-()             -       abc     @abc
-\(\)           b       abc     @abc
-a||b           C       EMPTY
-|ab            C       EMPTY
-ab|            C       EMPTY
-(|a)b          C       EMPTY
-(a|)b          C       EMPTY
-(*a)           C       BADRPT
-(+a)           C       BADRPT
-(?a)           C       BADRPT
-({1}a)         C       BADRPT
-\(\{1\}a\)     bC      BADRPT
-(a|*b)         C       BADRPT
-(a|+b)         C       BADRPT
-(a|?b)         C       BADRPT
-(a|{1}b)       C       BADRPT
-^*             C       BADRPT
-^*             b       *       *
-^+             C       BADRPT
-^?             C       BADRPT
-^{1}           C       BADRPT
-^\{1\}         bC      BADRPT
-
-# metacharacters, backslashes
-a.c            &       abc     abc
-a[bc]d         &       abd     abd
-a\*c           &       a*c     a*c
-a\\b           &       a\b     a\b
-a\\\*b         &       a\*b    a\*b
-a\bc           &       abc     abc
-a\             &C      EESCAPE
-a\\bc          &       a\bc    a\bc
-\{             bC      BADRPT
-a\[b           &       a[b     a[b
-a[b            &C      EBRACK
-# trailing $ is a peculiar special case for the BRE code
-a$             &       a       a
-a$             &       a$
-a\$            &       a
-a\$            &       a$      a$
-a\\$           &       a
-a\\$           &       a$
-a\\$           &       a\$
-a\\$           &       a\      a\
-
-# back references, ugh
-a\(b\)\2c      bC      ESUBREG
-a\(b\1\)c      bC      ESUBREG
-a\(b*\)c\1d    b       abbcbbd abbcbbd bb
-a\(b*\)c\1d    b       abbcbd
-a\(b*\)c\1d    b       abbcbbbd
-^\(.\)\1       b       abc
-a\([bc]\)\1d   b       abcdabbd        abbd    b
-a\(\([bc]\)\2\)*d      b       abbccd  abbccd
-a\(\([bc]\)\2\)*d      b       abbcbd
-# actually, this next one probably ought to fail, but the spec is unclear
-a\(\(b\)*\2\)*d                b       abbbd   abbbd
-# here is a case that no NFA implementation does right
-\(ab*\)[ab]*\1 b       ababaaa ababaaa a
-# check out normal matching in the presence of back refs
-\(a\)\1bcd     b       aabcd   aabcd
-\(a\)\1bc*d    b       aabcd   aabcd
-\(a\)\1bc*d    b       aabd    aabd
-\(a\)\1bc*d    b       aabcccd aabcccd
-\(a\)\1bc*[ce]d        b       aabcccd aabcccd
-^\(a\)\1b\(c\)*cd$     b       aabcccd aabcccd
-
-# ordinary repetitions
-ab*c           &       abc     abc
-ab+c           -       abc     abc
-ab?c           -       abc     abc
-a\(*\)b                b       a*b     a*b
-a\(**\)b       b       ab      ab
-a\(***\)b      bC      BADRPT
-*a             b       *a      *a
-**a            b       a       a
-***a           bC      BADRPT
-
-# the dreaded bounded repetitions
-{              &       {       {
-{abc           &       {abc    {abc
-{1             C       BADRPT
-{1}            C       BADRPT
-a{b            &       a{b     a{b
-a{1}b          -       ab      ab
-a\{1\}b                b       ab      ab
-a{1,}b         -       ab      ab
-a\{1,\}b       b       ab      ab
-a{1,2}b                -       aab     aab
-a\{1,2\}b      b       aab     aab
-a{1            C       EBRACE
-a\{1           bC      EBRACE
-a{1a           C       EBRACE
-a\{1a          bC      EBRACE
-a{1a}          C       BADBR
-a\{1a\}                bC      BADBR
-a{,2}          -       a{,2}   a{,2}
-a\{,2\}                bC      BADBR
-a{,}           -       a{,}    a{,}
-a\{,\}         bC      BADBR
-a{1,x}         C       BADBR
-a\{1,x\}       bC      BADBR
-a{1,x          C       EBRACE
-a\{1,x         bC      EBRACE
-a{300}         C       BADBR
-a\{300\}       bC      BADBR
-a{1,0}         C       BADBR
-a\{1,0\}       bC      BADBR
-ab{0,0}c       -       abcac   ac
-ab\{0,0\}c     b       abcac   ac
-ab{0,1}c       -       abcac   abc
-ab\{0,1\}c     b       abcac   abc
-ab{0,3}c       -       abbcac  abbc
-ab\{0,3\}c     b       abbcac  abbc
-ab{1,1}c       -       acabc   abc
-ab\{1,1\}c     b       acabc   abc
-ab{1,3}c       -       acabc   abc
-ab\{1,3\}c     b       acabc   abc
-ab{2,2}c       -       abcabbc abbc
-ab\{2,2\}c     b       abcabbc abbc
-ab{2,4}c       -       abcabbc abbc
-ab\{2,4\}c     b       abcabbc abbc
-((a{1,10}){1,10}){1,10}        -       a       a       a,a
-
-# multiple repetitions
-a**            &C      BADRPT
-a++            C       BADRPT
-a??            C       BADRPT
-a*+            C       BADRPT
-a*?            C       BADRPT
-a+*            C       BADRPT
-a+?            C       BADRPT
-a?*            C       BADRPT
-a?+            C       BADRPT
-a{1}{1}                C       BADRPT
-a*{1}          C       BADRPT
-a+{1}          C       BADRPT
-a?{1}          C       BADRPT
-a{1}*          C       BADRPT
-a{1}+          C       BADRPT
-a{1}?          C       BADRPT
-a*{b}          -       a{b}    a{b}
-a\{1\}\{1\}    bC      BADRPT
-a*\{1\}                bC      BADRPT
-a\{1\}*                bC      BADRPT
-
-# brackets, and numerous perversions thereof
-a[b]c          &       abc     abc
-a[ab]c         &       abc     abc
-a[^ab]c                &       adc     adc
-a[]b]c         &       a]c     a]c
-a[[b]c         &       a[c     a[c
-a[-b]c         &       a-c     a-c
-a[^]b]c                &       adc     adc
-a[^-b]c                &       adc     adc
-a[b-]c         &       a-c     a-c
-a[b            &C      EBRACK
-a[]            &C      EBRACK
-a[1-3]c                &       a2c     a2c
-a[3-1]c                &C      ERANGE
-a[1-3-5]c      &C      ERANGE
-a[[.-.]--]c    &       a-c     a-c
-a[1-           &C      ERANGE
-a[[.           &C      EBRACK
-a[[.x          &C      EBRACK
-a[[.x.         &C      EBRACK
-a[[.x.]                &C      EBRACK
-a[[.x.]]       &       ax      ax
-a[[.x,.]]      &C      ECOLLATE
-a[[.one.]]b    &       a1b     a1b
-a[[.notdef.]]b &C      ECOLLATE
-a[[.].]]b      &       a]b     a]b
-a[[:alpha:]]c  &       abc     abc
-a[[:notdef:]]c &C      ECTYPE
-a[[:           &C      EBRACK
-a[[:alpha      &C      EBRACK
-a[[:alpha:]    &C      EBRACK
-a[[:alpha,:]   &C      ECTYPE
-a[[:]:]]b      &C      ECTYPE
-a[[:-:]]b      &C      ECTYPE
-a[[:alph:]]    &C      ECTYPE
-a[[:alphabet:]]        &C      ECTYPE
-[[:alnum:]]+   -       -%@a0X- a0X
-[[:alpha:]]+   -       -%@aX0- aX
-[[:blank:]]+   -       aSSTb   SST
-[[:cntrl:]]+   -       aNTb    NT
-[[:digit:]]+   -       a019b   019
-[[:graph:]]+   -       Sa%bS   a%b
-[[:lower:]]+   -       AabC    ab
-[[:print:]]+   -       NaSbN   aSb
-[[:punct:]]+   -       S%-&T   %-&
-[[:space:]]+   -       aSNTb   SNT
-[[:upper:]]+   -       aBCd    BC
-[[:xdigit:]]+  -       p0f3Cq  0f3C
-a[[=b=]]c      &       abc     abc
-a[[=           &C      EBRACK
-a[[=b          &C      EBRACK
-a[[=b=         &C      EBRACK
-a[[=b=]                &C      EBRACK
-a[[=b,=]]      &C      ECOLLATE
-a[[=one=]]b    &       a1b     a1b
-
-# complexities
-a(((b)))c      -       abc     abc
-a(b|(c))d      -       abd     abd
-a(b*|c)d       -       abbd    abbd
-# just gotta have one DFA-buster, of course
-a[ab]{20}      -       aaaaabaaaabaaaabaaaab   aaaaabaaaabaaaabaaaab
-# and an inline expansion in case somebody gets tricky
-a[ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab]      -       aaaaabaaaabaaaabaaaab   aaaaabaaaabaaaabaaaab
-# and in case somebody just slips in an NFA...
-a[ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab][ab](wee|week)(knights|night)     -       aaaaabaaaabaaaabaaaabweeknights aaaaabaaaabaaaabaaaabweeknights
-# fish for anomalies as the number of states passes 32
-12345678901234567890123456789  -       a12345678901234567890123456789b 12345678901234567890123456789
-123456789012345678901234567890 -       a123456789012345678901234567890b        123456789012345678901234567890
-1234567890123456789012345678901        -       a1234567890123456789012345678901b       1234567890123456789012345678901
-12345678901234567890123456789012       -       a12345678901234567890123456789012b      12345678901234567890123456789012
-123456789012345678901234567890123      -       a123456789012345678901234567890123b     123456789012345678901234567890123
-# and one really big one, beyond any plausible word width
-1234567890123456789012345678901234567890123456789012345678901234567890 -       a1234567890123456789012345678901234567890123456789012345678901234567890b        1234567890123456789012345678901234567890123456789012345678901234567890
-# fish for problems as brackets go past 8
-[ab][cd][ef][gh][ij][kl][mn]   -       xacegikmoq      acegikm
-[ab][cd][ef][gh][ij][kl][mn][op]       -       xacegikmoq      acegikmo
-[ab][cd][ef][gh][ij][kl][mn][op][qr]   -       xacegikmoqy     acegikmoq
-[ab][cd][ef][gh][ij][kl][mn][op][q]    -       xacegikmoqy     acegikmoq
-
-# subtleties of matching
-abc            &       xabcy   abc
-a\(b\)?c\1d    b       acd
-aBc            i       Abc     Abc
-a[Bc]*d                i       abBCcd  abBCcd
-0[[:upper:]]1  &i      0a1     0a1
-0[[:lower:]]1  &i      0A1     0A1
-a[^b]c         &i      abc
-a[^b]c         &i      aBc
-a[^b]c         &i      adc     adc
-[a]b[c]                -       abc     abc
-[a]b[a]                -       aba     aba
-[abc]b[abc]    -       abc     abc
-[abc]b[abd]    -       abd     abd
-a(b?c)+d       -       accd    accd
-(wee|week)(knights|night)      -       weeknights      weeknights
-(we|wee|week|frob)(knights|night|day)  -       weeknights      weeknights
-a[bc]d         -       xyzaaabcaababdacd       abd
-a[ab]c         -       aaabc   abc
-abc            s       abc     abc
-a*             &       b       @b
-
-# Let's have some fun -- try to match a C comment.
-# first the obvious, which looks okay at first glance...
-/\*.*\*/       -       /*x*/   /*x*/
-# but...
-/\*.*\*/       -       /*x*/y/*z*/     /*x*/y/*z*/
-# okay, we must not match */ inside; try to do that...
-/\*([^*]|\*[^/])*\*/   -       /*x*/   /*x*/
-/\*([^*]|\*[^/])*\*/   -       /*x*/y/*z*/     /*x*/
-# but...
-/\*([^*]|\*[^/])*\*/   -       /*x**/y/*z*/    /*x**/y/*z*/
-# and a still fancier version, which does it right (I think)...
-/\*([^*]|\*+[^*/])*\*+/        -       /*x*/   /*x*/
-/\*([^*]|\*+[^*/])*\*+/        -       /*x*/y/*z*/     /*x*/
-/\*([^*]|\*+[^*/])*\*+/        -       /*x**/y/*z*/    /*x**/
-/\*([^*]|\*+[^*/])*\*+/        -       /*x****/y/*z*/  /*x****/
-/\*([^*]|\*+[^*/])*\*+/        -       /*x**x*/y/*z*/  /*x**x*/
-/\*([^*]|\*+[^*/])*\*+/        -       /*x***x/y/*z*/  /*x***x/y/*z*/
-
-# subexpressions
-.*             -       abc     abc     -
-a(b)(c)d       -       abcd    abcd    b,c
-a(((b)))c      -       abc     abc     b,b,b
-a(b|(c))d      -       abd     abd     b,-
-a(b*|c|e)d     -       abbd    abbd    bb
-a(b*|c|e)d     -       acd     acd     c
-a(b*|c|e)d     -       ad      ad      @d
-a(b?)c         -       abc     abc     b
-a(b?)c         -       ac      ac      @c
-a(b+)c         -       abc     abc     b
-a(b+)c         -       abbbc   abbbc   bbb
-a(b*)c         -       ac      ac      @c
-(a|ab)(bc([de]+)f|cde) -       abcdef  abcdef  a,bcdef,de
-# the regression tester only asks for 9 subexpressions
-a(b)(c)(d)(e)(f)(g)(h)(i)(j)k  -       abcdefghijk     abcdefghijk     b,c,d,e,f,g,h,i,j
-a(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)l       -       abcdefghijkl    abcdefghijkl    b,c,d,e,f,g,h,i,j,k
-a([bc]?)c      -       abc     abc     b
-a([bc]?)c      -       ac      ac      @c
-a([bc]+)c      -       abc     abc     b
-a([bc]+)c      -       abcc    abcc    bc
-a([bc]+)bc     -       abcbc   abcbc   bc
-a(bb+|b)b      -       abb     abb     b
-a(bbb+|bb+|b)b -       abb     abb     b
-a(bbb+|bb+|b)b -       abbb    abbb    bb
-a(bbb+|bb+|b)bb        -       abbb    abbb    b
-(.*).*         -       abcdef  abcdef  abcdef
-(a*)*          -       bc      @b      @b
-
-# do we get the right subexpression when it is used more than once?
-a(b|c)*d       -       ad      ad      -
-a(b|c)*d       -       abcd    abcd    c
-a(b|c)+d       -       abd     abd     b
-a(b|c)+d       -       abcd    abcd    c
-a(b|c?)+d      -       ad      ad      @d
-a(b|c?)+d      -       abcd    abcd    @d
-a(b|c){0,0}d   -       ad      ad      -
-a(b|c){0,1}d   -       ad      ad      -
-a(b|c){0,1}d   -       abd     abd     b
-a(b|c){0,2}d   -       ad      ad      -
-a(b|c){0,2}d   -       abcd    abcd    c
-a(b|c){0,}d    -       ad      ad      -
-a(b|c){0,}d    -       abcd    abcd    c
-a(b|c){1,1}d   -       abd     abd     b
-a(b|c){1,1}d   -       acd     acd     c
-a(b|c){1,2}d   -       abd     abd     b
-a(b|c){1,2}d   -       abcd    abcd    c
-a(b|c){1,}d    -       abd     abd     b
-a(b|c){1,}d    -       abcd    abcd    c
-a(b|c){2,2}d   -       acbd    acbd    b
-a(b|c){2,2}d   -       abcd    abcd    c
-a(b|c){2,4}d   -       abcd    abcd    c
-a(b|c){2,4}d   -       abcbd   abcbd   b
-a(b|c){2,4}d   -       abcbcd  abcbcd  c
-a(b|c){2,}d    -       abcd    abcd    c
-a(b|c){2,}d    -       abcbd   abcbd   b
-a(b+|((c)*))+d -       abd     abd     @d,@d,-
-a(b+|((c)*))+d -       abcd    abcd    @d,@d,-
-
-# check out the STARTEND option
-[abc]          &#      a(b)c   b
-[abc]          &#      a(d)c
-[abc]          &#      a(bc)d  b
-[abc]          &#      a(dc)d  c
-.              &#      a()c
-b.*c           &#      b(bc)c  bc
-b.*            &#      b(bc)c  bc
-.*c            &#      b(bc)c  bc
-
-# plain strings, with the NOSPEC flag
-abc            m       abc     abc
-abc            m       xabcy   abc
-abc            m       xyz
-a*b            m       aba*b   a*b
-a*b            m       ab
-""             mC      EMPTY
-
-# cases involving NULs
-aZb            &       a       a
-aZb            &p      a
-aZb            &p#     (aZb)   aZb
-aZ*b           &p#     (ab)    ab
-a.b            &#      (aZb)   aZb
-a.*            &#      (aZb)c  aZb
-
-# word boundaries (ick)
-[[:<:]]a       &       a       a
-[[:<:]]a       &       ba
-[[:<:]]a       &       -a      a
-a[[:>:]]       &       a       a
-a[[:>:]]       &       ab
-a[[:>:]]       &       a-      a
-[[:<:]]a.c[[:>:]]      &       axcd-dayc-dazce-abc     abc
-[[:<:]]a.c[[:>:]]      &       axcd-dayc-dazce-abc-q   abc
-[[:<:]]a.c[[:>:]]      &       axc-dayc-dazce-abc      axc
-[[:<:]]b.c[[:>:]]      &       a_bxc-byc_d-bzc-q       bzc
-[[:<:]].x..[[:>:]]     &       y_xa_-_xb_y-_xc_-axdc   _xc_
-[[:<:]]a_b[[:>:]]      &       x_a_b
-
-# past problems, and suspected problems
-(A[1])|(A[2])|(A[3])|(A[4])|(A[5])|(A[6])|(A[7])|(A[8])|(A[9])|(A[A])  -       A1      A1
-abcdefghijklmnop       i       abcdefghijklmnop        abcdefghijklmnop
-abcdefghijklmnopqrstuv i       abcdefghijklmnopqrstuv  abcdefghijklmnopqrstuv
-(ALAK)|(ALT[AB])|(CC[123]1)|(CM[123]1)|(GAMC)|(LC[23][EO ])|(SEM[1234])|(SL[ES][12])|(SLWW)|(SLF )|(SLDT)|(VWH[12])|(WH[34][EW])|(WP1[ESN])    -       CC11    CC11
-CC[13]1|a{21}[23][EO][123][Es][12]a{15}aa[34][EW]aaaaaaa[X]a   -       CC11    CC11
-Char \([a-z0-9_]*\)\[.*        b       Char xyz[k      Char xyz[k      xyz
-a?b    -       ab      ab
--\{0,1\}[0-9]*$        b       -5      -5
diff --git a/regex-src/utils.h b/regex-src/utils.h
deleted file mode 100644 (file)
index 539d645..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-#ifndef REGEX_UTILS_H
-#define REGEX_UTILS_H
-
-/* utility definitions */
-#ifdef _POSIX2_RE_DUP_MAX
-#define        DUPMAX  _POSIX2_RE_DUP_MAX
-#else
-#define        DUPMAX  255
-#endif
-#define        REINFINITY      (DUPMAX + 1)
-#define        NC              (CHAR_MAX - CHAR_MIN + 1)
-typedef unsigned char uch;
-
-/* switch off assertions (if not already off) if no REDEBUG */
-#ifndef REDEBUG
-#ifndef NDEBUG
-#define        NDEBUG  /* no assertions please */
-#endif
-#endif
-#include <assert.h>
-/* for old systems with bcopy() but no memmove() */
-#ifdef USEBCOPY
-#define        memmove(d, s, c)        bcopy(s, d, c)
-#endif
-
-#endif /* !REGEX_UTILS_H */
index 3ca04e7b26467f5ee14b1034cdac49e38e4cec42..f12bdbf199d67eadec270bb1745e33256b8858f5 100644 (file)
@@ -4,7 +4,8 @@ INCLUDES =      -I$(top_builddir)/common-src \
                -I$(top_srcdir)/common-src   \
                -I$(top_srcdir)/tape-src     \
                -I$(top_srcdir)/server-src   \
-               -I$(top_srcdir)/amandad-src
+               -I$(top_srcdir)/amandad-src  \
+               -I$(top_srcdir)/gnulib
 
 LINT=@AMLINT@
 LINTFLAGS=@AMLINTFLAGS@
@@ -25,9 +26,13 @@ libexec_PROGRAMS =   amidxtaped
 
 LDADD = librestore.$(LIB_EXTENSION)              \
       ../common-src/libamanda.$(LIB_EXTENSION) \
+      ../gnulib/libgnu.$(LIB_EXTENSION) \
       $(READLINE_LIBS)
 
-amidxtaped_LDADD = $(LDADD) ../amandad-src/libamandad.$(LIB_EXTENSION)
+amidxtaped_LDADD = $(LDADD) \
+                  ../gnulib/libgnu.$(LIB_EXTENSION) \
+                  ../amandad-src/libamandad.$(LIB_EXTENSION)
+
 amidxtaped_SOURCES =   amidxtaped.c
 
 amfetchdump_SOURCES =  amfetchdump.c
index ee23c557256437a9c7dc18d3b843df894ab8f362..ec68cbebf5e61d8d893bb3717487d134766dcb16 100644 (file)
@@ -48,6 +48,41 @@ DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
        $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+       $(top_srcdir)/config/gnulib/absolute-header.m4 \
+       $(top_srcdir)/config/gnulib/alloca.m4 \
+       $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/eoverflow.m4 \
+       $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/getaddrinfo.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-cache.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-common.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-comp.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-tool.m4 \
+       $(top_srcdir)/config/gnulib/inet_ntop.m4 \
+       $(top_srcdir)/config/gnulib/intmax_t.m4 \
+       $(top_srcdir)/config/gnulib/inttypes_h.m4 \
+       $(top_srcdir)/config/gnulib/lib-ld.m4 \
+       $(top_srcdir)/config/gnulib/lib-link.m4 \
+       $(top_srcdir)/config/gnulib/lib-prefix.m4 \
+       $(top_srcdir)/config/gnulib/lock.m4 \
+       $(top_srcdir)/config/gnulib/longdouble.m4 \
+       $(top_srcdir)/config/gnulib/longlong.m4 \
+       $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
+       $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \
+       $(top_srcdir)/config/gnulib/size_max.m4 \
+       $(top_srcdir)/config/gnulib/snprintf.m4 \
+       $(top_srcdir)/config/gnulib/socklen.m4 \
+       $(top_srcdir)/config/gnulib/sockpfaf.m4 \
+       $(top_srcdir)/config/gnulib/stdbool.m4 \
+       $(top_srcdir)/config/gnulib/stdint_h.m4 \
+       $(top_srcdir)/config/gnulib/strdup.m4 \
+       $(top_srcdir)/config/gnulib/string_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
+       $(top_srcdir)/config/gnulib/vasnprintf.m4 \
+       $(top_srcdir)/config/gnulib/visibility.m4 \
+       $(top_srcdir)/config/gnulib/wchar_t.m4 \
+       $(top_srcdir)/config/gnulib/wint_t.m4 \
+       $(top_srcdir)/config/gnulib/xsize.m4 \
        $(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
@@ -77,18 +112,22 @@ amfetchdump_OBJECTS = $(am_amfetchdump_OBJECTS)
 amfetchdump_LDADD = $(LDADD)
 am__DEPENDENCIES_1 =
 amfetchdump_DEPENDENCIES = librestore.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
+       ../common-src/libamanda.$(LIB_EXTENSION) \
+       ../gnulib/libgnu.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
 am_amidxtaped_OBJECTS = amidxtaped.$(OBJEXT)
 amidxtaped_OBJECTS = $(am_amidxtaped_OBJECTS)
 am__DEPENDENCIES_2 = librestore.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
+       ../common-src/libamanda.$(LIB_EXTENSION) \
+       ../gnulib/libgnu.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
 amidxtaped_DEPENDENCIES = $(am__DEPENDENCIES_2) \
+       ../gnulib/libgnu.$(LIB_EXTENSION) \
        ../amandad-src/libamandad.$(LIB_EXTENSION)
 amrestore_SOURCES = amrestore.c
 amrestore_OBJECTS = amrestore.$(OBJEXT)
 amrestore_LDADD = $(LDADD)
 amrestore_DEPENDENCIES = librestore.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
+       ../common-src/libamanda.$(LIB_EXTENSION) \
+       ../gnulib/libgnu.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
 DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/config
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
 am__depfiles_maybe = depfiles
@@ -108,8 +147,10 @@ HEADERS = $(noinst_HEADERS)
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ABSOLUTE_STRING_H = @ABSOLUTE_STRING_H@
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
+ALLOCA_H = @ALLOCA_H@
 AMANDA_DBGDIR = @AMANDA_DBGDIR@
 AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@
 AMANDA_TMPDIR = @AMANDA_TMPDIR@
@@ -124,18 +165,17 @@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@
 AMTAR = @AMTAR@
 AM_CFLAGS = @AM_CFLAGS@
 AR = @AR@
+ARPA_INET_H = @ARPA_INET_H@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
-AWK_VAR_ASSIGNMENT_OPT = @AWK_VAR_ASSIGNMENT_OPT@
 BINARY_OWNER = @BINARY_OWNER@
-BUILD_MAN_PAGES_FALSE = @BUILD_MAN_PAGES_FALSE@
-BUILD_MAN_PAGES_TRUE = @BUILD_MAN_PAGES_TRUE@
 CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
+CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
 CHIO = @CHIO@
 CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
@@ -168,18 +208,40 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
+ENABLE_MANPAGE_BUILD_FALSE = @ENABLE_MANPAGE_BUILD_FALSE@
+ENABLE_MANPAGE_BUILD_TRUE = @ENABLE_MANPAGE_BUILD_TRUE@
+EOVERFLOW = @EOVERFLOW@
+EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@
 EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
+GCC_COMPILER_FALSE = @GCC_COMPILER_FALSE@
+GCC_COMPILER_TRUE = @GCC_COMPILER_TRUE@
 GETCONF = @GETCONF@
+GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@
+GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
 GNUTAR_LISTED_INCREMENTAL_DIRX = @GNUTAR_LISTED_INCREMENTAL_DIRX@
 GREP = @GREP@
 GZIP = @GZIP@
-HAVE_XSLTPROC_FALSE = @HAVE_XSLTPROC_FALSE@
-HAVE_XSLTPROC_TRUE = @HAVE_XSLTPROC_TRUE@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRNDUP = @HAVE_STRNDUP@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE__BOOL = @HAVE__BOOL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -188,22 +250,31 @@ LDFLAGS = @LDFLAGS@
 LEX = @LEX@
 LEXLIB = @LEXLIB@
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
+LIBPTH = @LIBPTH@
+LIBPTH_PREFIX = @LIBPTH_PREFIX@
 LIBS = @LIBS@
+LIBTHREAD = @LIBTHREAD@
 LIBTOOL = @LIBTOOL@
 LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LL_FMT = @LL_FMT@
 LL_RFMT = @LL_RFMT@
 LN_S = @LN_S@
 LTALLOCA = @LTALLOCA@
+LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
 LTLIBOBJS = @LTLIBOBJS@
+LTLIBPTH = @LTLIBPTH@
+LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
 MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@
 MCUTIL = @MCUTIL@
+MKDIR_P = @MKDIR_P@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
+NETINET_IN_H = @NETINET_IN_H@
 OBJEXT = @OBJEXT@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -217,6 +288,9 @@ PERL = @PERL@
 PRINT = @PRINT@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
+REPLACE_STRCASECMP = @REPLACE_STRCASECMP@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRSTR = @REPLACE_STRSTR@
 RESTORE = @RESTORE@
 SAMBA_CLIENT = @SAMBA_CLIENT@
 SERVICE_SUFFIX = @SERVICE_SUFFIX@
@@ -225,7 +299,10 @@ SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 SNAPSHOT_STAMP = @SNAPSHOT_STAMP@
 SORT = @SORT@
+SSH = @SSH@
+STDBOOL_H = @STDBOOL_H@
 STRIP = @STRIP@
+SYS_SOCKET_H = @SYS_SOCKET_H@
 USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@
 VDUMP = @VDUMP@
 VERSION = @VERSION@
@@ -264,6 +341,7 @@ WANT_TAPE_TRUE = @WANT_TAPE_TRUE@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
 XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
 YACC = @YACC@
 ac_c = @ac_c@
 ac_ct_AR = @ac_ct_AR@
@@ -290,6 +368,8 @@ build_os = @build_os@
 build_vendor = @build_vendor@
 datadir = @datadir@
 exec_prefix = @exec_prefix@
+gl_LIBOBJS = @gl_LIBOBJS@
+gl_LTLIBOBJS = @gl_LTLIBOBJS@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -318,7 +398,8 @@ INCLUDES = -I$(top_builddir)/common-src \
                -I$(top_srcdir)/common-src   \
                -I$(top_srcdir)/tape-src     \
                -I$(top_srcdir)/server-src   \
-               -I$(top_srcdir)/amandad-src
+               -I$(top_srcdir)/amandad-src  \
+               -I$(top_srcdir)/gnulib
 
 LINT = @AMLINT@
 LINTFLAGS = @AMLINTFLAGS@
@@ -333,9 +414,13 @@ LIB_EXTENSION = la
 ###
 LDADD = librestore.$(LIB_EXTENSION)              \
       ../common-src/libamanda.$(LIB_EXTENSION) \
+      ../gnulib/libgnu.$(LIB_EXTENSION) \
       $(READLINE_LIBS)
 
-amidxtaped_LDADD = $(LDADD) ../amandad-src/libamandad.$(LIB_EXTENSION)
+amidxtaped_LDADD = $(LDADD) \
+                  ../gnulib/libgnu.$(LIB_EXTENSION) \
+                  ../amandad-src/libamandad.$(LIB_EXTENSION)
+
 amidxtaped_SOURCES = amidxtaped.c
 amfetchdump_SOURCES = amfetchdump.c
 librestore_la_SOURCES = restore.c
index fd1b783b6b6f753ad48713f6ba361e50d3ccd55d..2253b60a92003d90c2047d9296535967ad888e59 100644 (file)
@@ -24,7 +24,7 @@
  * file named AUTHORS, in the root directory of this distribution.
  */
 /*
- * $Id: amfetchdump.c,v 1.16.2.2 2007/01/18 20:07:55 martinea Exp $
+ * $Id: amfetchdump.c,v 1.16 2006/08/24 01:57:15 paddy_s Exp $
  *
  * retrieves specific dumps from a set of amanda tapes
  */
@@ -273,7 +273,9 @@ main(
     char *e;
     int arg_state;
     rst_flags_t *rst_flags;
+#ifdef FORCE_USERID
     struct passwd *pwent;
+#endif
     int    new_argc,   my_argc;
     char **new_argv, **my_argv;
 
@@ -322,7 +324,7 @@ main(
 
     onerror(errexit);
 
-    parse_server_conf(argc, argv, &new_argc, &new_argv);
+    parse_conf(argc, argv, &new_argc, &new_argv);
     my_argc = new_argc;
     my_argv = new_argv;
 
index 44f8c5b048d67da21ac3a1f8cd226752b964430c..2e7492c87a096988a9e2c6231b8938cf7646e056 100644 (file)
@@ -23,7 +23,7 @@
  * Authors: the Amanda Development Team.  Its members are listed in a
  * file named AUTHORS, in the root directory of this distribution.
  */
-/* $Id: amidxtaped.c,v 1.73.2.3 2006/11/01 12:26:22 martinea Exp $
+/* $Id: amidxtaped.c,v 1.73 2006/07/25 19:06:46 martinea Exp $
  *
  * This daemon extracts a dump image off a tape for amrecover and
  * returns it over the network. It basically, reads a number of
 #include "stream.h"
 #include "amandad.h"
 
+#define amidxtaped_debug(i,x) do {     \
+       if ((i) <= debug_amidxtaped) {  \
+           dbprintf(x);                \
+       }                               \
+} while (0)
+
 #define TIMEOUT 30
 
 static char *pgm = "amidxtaped";       /* in case argv[0] is not set */
@@ -188,7 +194,7 @@ check_security_buffer(
     char *errstr = NULL;
 
     dbprintf(("%s: check_security_buffer(buffer='%s')\n",
-               debug_prefix(NULL), buffer));
+               debug_prefix_time(NULL), buffer));
 
     i = SIZEOF(addr);
     if (getpeername(0, (struct sockaddr *)&addr, &i) == -1) {
@@ -219,7 +225,7 @@ check_security_buffer(
        /*NOTREACHED*/
     }
     skip_whitespace(s, ch);
-    if (!check_security(&addr, s-1, 0, &errstr)) {
+    if (!check_security((struct sockaddr_storage *)&addr, s-1, 0, &errstr)) {
        error("security check failed: %s", errstr);
        /*NOTREACHED*/
     }
@@ -371,9 +377,7 @@ main(
 
        /* read the REQ packet */
        for(; (line = agets(stdin)) != NULL; free(line)) {
-#define sc "OPTIONS "
-           if(strncmp(line, sc, sizeof(sc)-1) == 0) {
-#undef sc
+           if(strncmp_const(line, "OPTIONS ") == 0) {
                g_options = parse_g_options(line+8, 1);
                if(!g_options->hostname) {
                    g_options->hostname = alloc(MAX_HOSTNAME_LENGTH+1);
@@ -420,20 +424,22 @@ main(
     match_list->diskname = "";
 
     for (re_end = 0; re_end == 0; ) {
+       char *s, ch;
        amfree(buf);
        buf = stralloc(get_client_line(cmdin));
-       if(strncmp(buf, "LABEL=", 6) == 0) {
-           tapes = unmarshal_tapelist_str(buf+6);
+       s = buf;
+       if(strncmp_const_skip(buf, "LABEL=", s, ch) == 0) {
+           tapes = unmarshal_tapelist_str(s);
        }
-       else if(strncmp(buf, "FSF=", 4) == 0) {
-           rst_flags->fsf = OFF_T_ATOI(buf + 4);
+       else if(strncmp_const_skip(buf, "FSF=", s, ch) == 0) {
+           rst_flags->fsf = OFF_T_ATOI(s);
        }
-       else if(strncmp(buf, "HEADER", 6) == 0) {
+       else if(strncmp_const_skip(buf, "HEADER", s, ch) == 0) {
            rst_flags->headers = 1;
        }
-       else if(strncmp(buf, "FEATURES=", 9) == 0) {
+       else if(strncmp_const_skip(buf, "FEATURES=", s, ch) == 0) {
            char *our_feature_string = NULL;
-           their_feature_string = stralloc(buf+9);
+           their_feature_string = stralloc(s);
            am_release_feature_set(their_features);
            their_features = am_string_to_feature(their_feature_string);
            amfree(their_feature_string);
@@ -445,23 +451,23 @@ main(
            fflush(cmdout);
            amfree(our_feature_string);
        }
-       else if(strncmp(buf, "DEVICE=", 7) == 0) {
-           rst_flags->alt_tapedev= stralloc(buf+7);
+       else if(strncmp_const_skip(buf, "DEVICE=", s, ch) == 0) {
+           rst_flags->alt_tapedev= stralloc(s);
        }
-       else if(strncmp(buf, "HOST=", 5) == 0) {
-           match_list->hostname = stralloc(buf+5);
+       else if(strncmp_const_skip(buf, "HOST=", s, ch) == 0) {
+           match_list->hostname = stralloc(s);
        }
-       else if(strncmp(buf, "DISK=", 5) == 0) {
-           match_list->diskname = stralloc(buf+5);
+       else if(strncmp_const_skip(buf, "DISK=", s, ch) == 0) {
+           match_list->diskname = stralloc(s);
        }
-       else if(strncmp(buf, "DATESTAMP=", 10) == 0) {
-           match_list->datestamp = stralloc(buf+10);
+       else if(strncmp_const_skip(buf, "DATESTAMP=", s, ch) == 0) {
+           match_list->datestamp = stralloc(s);
        }
-       else if(strncmp(buf, "END", 3) == 0) {
+       else if(strncmp_const(buf, "END") == 0) {
            re_end = 1;
        }
-       else if(strncmp(buf, "CONFIG=", 7) == 0) {
-           re_config = stralloc(buf+7);
+       else if(strncmp_const_skip(buf, "CONFIG=", s, ch) == 0) {
+           re_config = stralloc(s);
        }
        else if(buf[0] != '\0' && buf[0] >= '0' && buf[0] <= '9') {
 /* XXX does nothing?     amrestore_nargs = atoi(buf); */
index 57746f59ae56d7849e8b2166a36dd30eb9aac50c..d0a6435618b9ea61267a7d508f552e0b67472b87 100644 (file)
@@ -24,7 +24,7 @@
  * file named AUTHORS, in the root directory of this distribution.
  */
 /*
- * $Id: amrestore.c,v 1.63.2.1 2006/11/08 17:11:40 martinea Exp $
+ * $Id: amrestore.c,v 1.63 2006/07/25 18:58:10 martinea Exp $
  *
  * retrieves files from an amanda tape
  */
index 8163b232666ff97488c53da1cf53d0d6ce629e85..9cede42df06a317c68eb7c37853bb8a55be83139 100644 (file)
@@ -24,7 +24,7 @@
  * file named AUTHORS, in the root directory of this distribution.
  */
 /*
- * $Id: restore.c,v 1.52.2.7 2007/01/04 20:20:48 martinea Exp $
+ * $Id: restore.c,v 1.52 2006/08/23 11:41:54 martinea Exp $
  *
  * retrieves files from an amanda tape
  */
@@ -231,7 +231,7 @@ append_file_to_fd(
                error("restore: write error = %s", strerror(errno));
                /*NOTREACHED*/
            }
-           error("Short write: wrote %zd bytes expected %zd.", s, bytes_read);
+           error("Short write: wrote " SSIZE_T_FMT " bytes expected " SSIZE_T_FMT ".", s, bytes_read);
            /*NOTREACHCED*/
        }
        wc += (off_t)bytes_read;
@@ -647,7 +647,7 @@ read_file_header(
        fprintf(stderr, "%s: error reading file header: %s\n",
                get_pname(), strerror(errno));
        file->type = F_UNKNOWN;
-    } else if((size_t)bytes_read < blocksize) {
+    } else if((size_t)bytes_read < DISK_BLOCK_BYTES) {
        if(bytes_read == 0) {
            fprintf(stderr, "%s: missing file header block\n", get_pname());
        } else {
@@ -882,7 +882,7 @@ restore(
                error("write error: %s", strerror(errno));
                /*NOTREACHED*/
            } else {
-               error("write error: %zd instead of %d", w, DISK_BLOCK_BYTES);
+               error("write error: " SSIZE_T_FMT " instead of %d", w, DISK_BLOCK_BYTES);
                /*NOTREACHED*/
            }
        }
@@ -902,7 +902,8 @@ restore(
          || file->type != F_SPLIT_DUMPFILE))
        need_uncompress=1;   
 
-    if(!flags->raw && file->encrypted)
+    if(!flags->raw && file->encrypted && !is_continuation
+         && (flags->inline_assemble || file->type != F_SPLIT_DUMPFILE))
        need_decrypt=1;
    
     /* Setup pipes for decryption / compression / uncompression  */
@@ -1093,7 +1094,7 @@ restore(
                error("restore: write error: %s", strerror(errno));
                /* NOTREACHED */
            } else if (s < bytes_read) {
-               error("restore: wrote %zd of %zd bytes: %s",
+               error("restore: wrote " SSIZE_T_FMT " of " SSIZE_T_FMT " bytes: %s",
                    s, bytes_read, strerror(errno));
                /* NOTREACHED */
            }
index 70868d1a57e028d588669d43481efdb1f20f16da..ae11c8c501f5d156005351b5fca34231b27fc7d8 100644 (file)
@@ -24,7 +24,7 @@
  * file named AUTHORS, in the root directory of this distribution.
  */
 /*
- * $Id: restore.h,v 1.8.2.1 2006/09/27 12:04:09 martinea Exp $
+ * $Id: restore.h,v 1.8 2006/06/22 17:16:39 martinea Exp $
  *
  * 
  */
index 01f864101bc714aeb50041ea2853aa5e45f9ccc6..c883daf4ee0d8b5d061037e304026f8b4358d66c 100644 (file)
@@ -4,7 +4,8 @@ INCLUDES =      -I$(top_builddir)/common-src \
                -I$(top_srcdir)/common-src   \
                -I$(top_srcdir)/restore-src  \
                -I$(top_srcdir)/tape-src     \
-               -I$(top_srcdir)/amandad-src
+               -I$(top_srcdir)/amandad-src  \
+               -I$(top_srcdir)/gnulib
 
 LINT=@AMLINT@
 LINTFLAGS=@AMLINTFLAGS@
@@ -28,7 +29,7 @@ sbin_SCRIPTS =                amcheckdb       amcleanup       amdump          \
                        amcrypt-ossl-asym
 
 libamserver_la_SOURCES=        amindex.c       changer.c                       \
-                       conffile.c      diskfile.c      driverio.c      \
+                       diskfile.c      driverio.c      cmdline.c  \
                        holding.c       infofile.c      logfile.c       \
                        tapefile.c      find.c          server_util.c   \
                         taperscan.c
@@ -42,12 +43,13 @@ libamserver_la_LDFLAGS= -release $(VERSION)
 # routines, and second to pick up any references in the other libraries.
 ###
 
-LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
-       libamserver.$(LIB_EXTENSION)             \
-       ../tape-src/libamtape.$(LIB_EXTENSION)   \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION)   \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
+LDADD = ../common-src/libamanda.$(LIB_EXTENSION)   \
+       libamserver.$(LIB_EXTENSION)               \
+       ../tape-src/libamtape.$(LIB_EXTENSION)     \
+       ../common-src/libamanda.$(LIB_EXTENSION)   \
+       ../tape-src/libamtape.$(LIB_EXTENSION)     \
+       ../common-src/libamanda.$(LIB_EXTENSION)   \
+       ../gnulib/libgnu.$(LIB_EXTENSION)          \
         $(READLINE_LIBS)
 
 amindexd_LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
@@ -56,21 +58,22 @@ amindexd_LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
        ../tape-src/libamtape.$(LIB_EXTENSION) \
        ../common-src/libamanda.$(LIB_EXTENSION) \
        ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION)
+       ../common-src/libamanda.$(LIB_EXTENSION) \
+       ../gnulib/libgnu.$(LIB_EXTENSION)
 
 SUFFIXES =             .sh .pl
 
 .pl:
                        cat $< > $@
                        chmod a+x $@
-                       -test -z "$(PERL)" || $(PERL) -c $@
+                       -test -z "$(PERL)" || $(PERL) -c -w -W -t -T $@
 
 .sh:
                        cat $< > $@
                        chmod a+x $@
 
 # there are used for testing only:
-TEST_PROGS = diskfile conffile infofile
+TEST_PROGS = diskfile infofile
 
 EXTRA_PROGRAMS =       $(TEST_PROGS)
 
@@ -84,10 +87,10 @@ amreport_SOURCES =  reporter.c
 amgetconf_SOURCES =    getconf.c
 
 noinst_HEADERS =       amindex.h       changer.h                       \
-                       conffile.h      diskfile.h      driverio.h      \
+                       diskfile.h      driverio.h      \
                        holding.h       infofile.h      logfile.h       \
                        tapefile.h      find.h          server_util.h   \
-                       taperscan.h
+                       taperscan.h cmdline.h
 
 install-exec-hook:
        @list="$(sbin_PROGRAMS) $(sbin_SCRIPTS)"; \
@@ -166,7 +169,6 @@ listlibsrc:
 
 
 diskfile_SOURCES = diskfile.test.c
-conffile_SOURCES = conffile.test.c
 infofile_SOURCES = infofile.test.c
 
 %.test.c: $(srcdir)/%.c
index e4fe23a598c462ecfd3c17f667cbfc5406393d36..1b30e78f811ff8bdb6315e0ccf90fcd53539aed6 100644 (file)
@@ -62,6 +62,41 @@ DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
        $(srcdir)/amverifyrun.sh.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+       $(top_srcdir)/config/gnulib/absolute-header.m4 \
+       $(top_srcdir)/config/gnulib/alloca.m4 \
+       $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/eoverflow.m4 \
+       $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/getaddrinfo.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-cache.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-common.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-comp.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-tool.m4 \
+       $(top_srcdir)/config/gnulib/inet_ntop.m4 \
+       $(top_srcdir)/config/gnulib/intmax_t.m4 \
+       $(top_srcdir)/config/gnulib/inttypes_h.m4 \
+       $(top_srcdir)/config/gnulib/lib-ld.m4 \
+       $(top_srcdir)/config/gnulib/lib-link.m4 \
+       $(top_srcdir)/config/gnulib/lib-prefix.m4 \
+       $(top_srcdir)/config/gnulib/lock.m4 \
+       $(top_srcdir)/config/gnulib/longdouble.m4 \
+       $(top_srcdir)/config/gnulib/longlong.m4 \
+       $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
+       $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \
+       $(top_srcdir)/config/gnulib/size_max.m4 \
+       $(top_srcdir)/config/gnulib/snprintf.m4 \
+       $(top_srcdir)/config/gnulib/socklen.m4 \
+       $(top_srcdir)/config/gnulib/sockpfaf.m4 \
+       $(top_srcdir)/config/gnulib/stdbool.m4 \
+       $(top_srcdir)/config/gnulib/stdint_h.m4 \
+       $(top_srcdir)/config/gnulib/strdup.m4 \
+       $(top_srcdir)/config/gnulib/string_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
+       $(top_srcdir)/config/gnulib/vasnprintf.m4 \
+       $(top_srcdir)/config/gnulib/visibility.m4 \
+       $(top_srcdir)/config/gnulib/wchar_t.m4 \
+       $(top_srcdir)/config/gnulib/wint_t.m4 \
+       $(top_srcdir)/config/gnulib/xsize.m4 \
        $(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
@@ -82,11 +117,11 @@ am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(libexecdir)" \
 libLTLIBRARIES_INSTALL = $(INSTALL)
 LTLIBRARIES = $(lib_LTLIBRARIES)
 libamserver_la_LIBADD =
-am_libamserver_la_OBJECTS = amindex.lo changer.lo conffile.lo \
-       diskfile.lo driverio.lo holding.lo infofile.lo logfile.lo \
+am_libamserver_la_OBJECTS = amindex.lo changer.lo diskfile.lo \
+       driverio.lo cmdline.lo holding.lo infofile.lo logfile.lo \
        tapefile.lo find.lo server_util.lo taperscan.lo
 libamserver_la_OBJECTS = $(am_libamserver_la_OBJECTS)
-am__EXEEXT_1 = diskfile$(EXEEXT) conffile$(EXEEXT) infofile$(EXEEXT)
+am__EXEEXT_1 = diskfile$(EXEEXT) infofile$(EXEEXT)
 libexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
 sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
 PROGRAMS = $(libexec_PROGRAMS) $(sbin_PROGRAMS)
@@ -99,7 +134,8 @@ amadmin_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
        ../tape-src/libamtape.$(LIB_EXTENSION) \
        ../common-src/libamanda.$(LIB_EXTENSION) \
        ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
+       ../common-src/libamanda.$(LIB_EXTENSION) \
+       ../gnulib/libgnu.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
 amcheck_SOURCES = amcheck.c
 amcheck_OBJECTS = amcheck.$(OBJEXT)
 amcheck_LDADD = $(LDADD)
@@ -108,7 +144,8 @@ amcheck_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
        ../tape-src/libamtape.$(LIB_EXTENSION) \
        ../common-src/libamanda.$(LIB_EXTENSION) \
        ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
+       ../common-src/libamanda.$(LIB_EXTENSION) \
+       ../gnulib/libgnu.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
 amcleanupdisk_SOURCES = amcleanupdisk.c
 amcleanupdisk_OBJECTS = amcleanupdisk.$(OBJEXT)
 amcleanupdisk_LDADD = $(LDADD)
@@ -117,7 +154,8 @@ amcleanupdisk_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
        ../tape-src/libamtape.$(LIB_EXTENSION) \
        ../common-src/libamanda.$(LIB_EXTENSION) \
        ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
+       ../common-src/libamanda.$(LIB_EXTENSION) \
+       ../gnulib/libgnu.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
 amflush_SOURCES = amflush.c
 amflush_OBJECTS = amflush.$(OBJEXT)
 amflush_LDADD = $(LDADD)
@@ -126,7 +164,8 @@ amflush_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
        ../tape-src/libamtape.$(LIB_EXTENSION) \
        ../common-src/libamanda.$(LIB_EXTENSION) \
        ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
+       ../common-src/libamanda.$(LIB_EXTENSION) \
+       ../gnulib/libgnu.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
 am_amgetconf_OBJECTS = getconf.$(OBJEXT)
 amgetconf_OBJECTS = $(am_amgetconf_OBJECTS)
 amgetconf_LDADD = $(LDADD)
@@ -135,7 +174,8 @@ amgetconf_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
        ../tape-src/libamtape.$(LIB_EXTENSION) \
        ../common-src/libamanda.$(LIB_EXTENSION) \
        ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
+       ../common-src/libamanda.$(LIB_EXTENSION) \
+       ../gnulib/libgnu.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
 am__objects_1 = amindexd.$(OBJEXT) disk_history.$(OBJEXT) \
        list_dir.$(OBJEXT)
 am_amindexd_OBJECTS = $(am__objects_1)
@@ -146,7 +186,8 @@ amindexd_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
        ../tape-src/libamtape.$(LIB_EXTENSION) \
        ../common-src/libamanda.$(LIB_EXTENSION) \
        ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION)
+       ../common-src/libamanda.$(LIB_EXTENSION) \
+       ../gnulib/libgnu.$(LIB_EXTENSION)
 amlabel_SOURCES = amlabel.c
 amlabel_OBJECTS = amlabel.$(OBJEXT)
 amlabel_LDADD = $(LDADD)
@@ -155,7 +196,8 @@ amlabel_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
        ../tape-src/libamtape.$(LIB_EXTENSION) \
        ../common-src/libamanda.$(LIB_EXTENSION) \
        ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
+       ../common-src/libamanda.$(LIB_EXTENSION) \
+       ../gnulib/libgnu.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
 amlogroll_SOURCES = amlogroll.c
 amlogroll_OBJECTS = amlogroll.$(OBJEXT)
 amlogroll_LDADD = $(LDADD)
@@ -164,7 +206,8 @@ amlogroll_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
        ../tape-src/libamtape.$(LIB_EXTENSION) \
        ../common-src/libamanda.$(LIB_EXTENSION) \
        ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
+       ../common-src/libamanda.$(LIB_EXTENSION) \
+       ../gnulib/libgnu.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
 am_amreport_OBJECTS = reporter.$(OBJEXT)
 amreport_OBJECTS = $(am_amreport_OBJECTS)
 amreport_LDADD = $(LDADD)
@@ -173,7 +216,8 @@ amreport_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
        ../tape-src/libamtape.$(LIB_EXTENSION) \
        ../common-src/libamanda.$(LIB_EXTENSION) \
        ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
+       ../common-src/libamanda.$(LIB_EXTENSION) \
+       ../gnulib/libgnu.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
 amtape_SOURCES = amtape.c
 amtape_OBJECTS = amtape.$(OBJEXT)
 amtape_LDADD = $(LDADD)
@@ -182,7 +226,8 @@ amtape_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
        ../tape-src/libamtape.$(LIB_EXTENSION) \
        ../common-src/libamanda.$(LIB_EXTENSION) \
        ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
+       ../common-src/libamanda.$(LIB_EXTENSION) \
+       ../gnulib/libgnu.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
 amtrmidx_SOURCES = amtrmidx.c
 amtrmidx_OBJECTS = amtrmidx.$(OBJEXT)
 amtrmidx_LDADD = $(LDADD)
@@ -191,7 +236,8 @@ amtrmidx_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
        ../tape-src/libamtape.$(LIB_EXTENSION) \
        ../common-src/libamanda.$(LIB_EXTENSION) \
        ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
+       ../common-src/libamanda.$(LIB_EXTENSION) \
+       ../gnulib/libgnu.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
 amtrmlog_SOURCES = amtrmlog.c
 amtrmlog_OBJECTS = amtrmlog.$(OBJEXT)
 amtrmlog_LDADD = $(LDADD)
@@ -200,7 +246,8 @@ amtrmlog_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
        ../tape-src/libamtape.$(LIB_EXTENSION) \
        ../common-src/libamanda.$(LIB_EXTENSION) \
        ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
+       ../common-src/libamanda.$(LIB_EXTENSION) \
+       ../gnulib/libgnu.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
 chunker_SOURCES = chunker.c
 chunker_OBJECTS = chunker.$(OBJEXT)
 chunker_LDADD = $(LDADD)
@@ -209,16 +256,8 @@ chunker_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
        ../tape-src/libamtape.$(LIB_EXTENSION) \
        ../common-src/libamanda.$(LIB_EXTENSION) \
        ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
-am_conffile_OBJECTS = conffile.test.$(OBJEXT)
-conffile_OBJECTS = $(am_conffile_OBJECTS)
-conffile_LDADD = $(LDADD)
-conffile_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
-       libamserver.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
        ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
+       ../gnulib/libgnu.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
 am_diskfile_OBJECTS = diskfile.test.$(OBJEXT)
 diskfile_OBJECTS = $(am_diskfile_OBJECTS)
 diskfile_LDADD = $(LDADD)
@@ -227,7 +266,8 @@ diskfile_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
        ../tape-src/libamtape.$(LIB_EXTENSION) \
        ../common-src/libamanda.$(LIB_EXTENSION) \
        ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
+       ../common-src/libamanda.$(LIB_EXTENSION) \
+       ../gnulib/libgnu.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
 driver_SOURCES = driver.c
 driver_OBJECTS = driver.$(OBJEXT)
 driver_LDADD = $(LDADD)
@@ -236,7 +276,8 @@ driver_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
        ../tape-src/libamtape.$(LIB_EXTENSION) \
        ../common-src/libamanda.$(LIB_EXTENSION) \
        ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
+       ../common-src/libamanda.$(LIB_EXTENSION) \
+       ../gnulib/libgnu.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
 dumper_SOURCES = dumper.c
 dumper_OBJECTS = dumper.$(OBJEXT)
 dumper_LDADD = $(LDADD)
@@ -245,7 +286,8 @@ dumper_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
        ../tape-src/libamtape.$(LIB_EXTENSION) \
        ../common-src/libamanda.$(LIB_EXTENSION) \
        ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
+       ../common-src/libamanda.$(LIB_EXTENSION) \
+       ../gnulib/libgnu.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
 am_infofile_OBJECTS = infofile.test.$(OBJEXT)
 infofile_OBJECTS = $(am_infofile_OBJECTS)
 infofile_LDADD = $(LDADD)
@@ -254,7 +296,8 @@ infofile_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
        ../tape-src/libamtape.$(LIB_EXTENSION) \
        ../common-src/libamanda.$(LIB_EXTENSION) \
        ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
+       ../common-src/libamanda.$(LIB_EXTENSION) \
+       ../gnulib/libgnu.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
 planner_SOURCES = planner.c
 planner_OBJECTS = planner.$(OBJEXT)
 planner_LDADD = $(LDADD)
@@ -263,7 +306,8 @@ planner_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
        ../tape-src/libamtape.$(LIB_EXTENSION) \
        ../common-src/libamanda.$(LIB_EXTENSION) \
        ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
+       ../common-src/libamanda.$(LIB_EXTENSION) \
+       ../gnulib/libgnu.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
 taper_SOURCES = taper.c
 taper_OBJECTS = taper.$(OBJEXT)
 taper_LDADD = $(LDADD)
@@ -272,7 +316,8 @@ taper_DEPENDENCIES = ../common-src/libamanda.$(LIB_EXTENSION) \
        ../tape-src/libamtape.$(LIB_EXTENSION) \
        ../common-src/libamanda.$(LIB_EXTENSION) \
        ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
+       ../common-src/libamanda.$(LIB_EXTENSION) \
+       ../gnulib/libgnu.$(LIB_EXTENSION) $(am__DEPENDENCIES_1)
 sbinSCRIPT_INSTALL = $(INSTALL_SCRIPT)
 SCRIPTS = $(sbin_SCRIPTS)
 DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/config
@@ -289,21 +334,21 @@ LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
 SOURCES = $(libamserver_la_SOURCES) amadmin.c amcheck.c \
        amcleanupdisk.c amflush.c $(amgetconf_SOURCES) \
        $(amindexd_SOURCES) amlabel.c amlogroll.c $(amreport_SOURCES) \
-       amtape.c amtrmidx.c amtrmlog.c chunker.c $(conffile_SOURCES) \
-       $(diskfile_SOURCES) driver.c dumper.c $(infofile_SOURCES) \
-       planner.c taper.c
+       amtape.c amtrmidx.c amtrmlog.c chunker.c $(diskfile_SOURCES) \
+       driver.c dumper.c $(infofile_SOURCES) planner.c taper.c
 DIST_SOURCES = $(libamserver_la_SOURCES) amadmin.c amcheck.c \
        amcleanupdisk.c amflush.c $(amgetconf_SOURCES) \
        $(amindexd_SOURCES) amlabel.c amlogroll.c $(amreport_SOURCES) \
-       amtape.c amtrmidx.c amtrmlog.c chunker.c $(conffile_SOURCES) \
-       $(diskfile_SOURCES) driver.c dumper.c $(infofile_SOURCES) \
-       planner.c taper.c
+       amtape.c amtrmidx.c amtrmlog.c chunker.c $(diskfile_SOURCES) \
+       driver.c dumper.c $(infofile_SOURCES) planner.c taper.c
 HEADERS = $(noinst_HEADERS)
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ABSOLUTE_STRING_H = @ABSOLUTE_STRING_H@
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
+ALLOCA_H = @ALLOCA_H@
 AMANDA_DBGDIR = @AMANDA_DBGDIR@
 AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@
 AMANDA_TMPDIR = @AMANDA_TMPDIR@
@@ -318,18 +363,17 @@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@
 AMTAR = @AMTAR@
 AM_CFLAGS = @AM_CFLAGS@
 AR = @AR@
+ARPA_INET_H = @ARPA_INET_H@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
-AWK_VAR_ASSIGNMENT_OPT = @AWK_VAR_ASSIGNMENT_OPT@
 BINARY_OWNER = @BINARY_OWNER@
-BUILD_MAN_PAGES_FALSE = @BUILD_MAN_PAGES_FALSE@
-BUILD_MAN_PAGES_TRUE = @BUILD_MAN_PAGES_TRUE@
 CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
+CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
 CHIO = @CHIO@
 CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
@@ -362,18 +406,40 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
+ENABLE_MANPAGE_BUILD_FALSE = @ENABLE_MANPAGE_BUILD_FALSE@
+ENABLE_MANPAGE_BUILD_TRUE = @ENABLE_MANPAGE_BUILD_TRUE@
+EOVERFLOW = @EOVERFLOW@
+EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@
 EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
+GCC_COMPILER_FALSE = @GCC_COMPILER_FALSE@
+GCC_COMPILER_TRUE = @GCC_COMPILER_TRUE@
 GETCONF = @GETCONF@
+GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@
+GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
 GNUTAR_LISTED_INCREMENTAL_DIRX = @GNUTAR_LISTED_INCREMENTAL_DIRX@
 GREP = @GREP@
 GZIP = @GZIP@
-HAVE_XSLTPROC_FALSE = @HAVE_XSLTPROC_FALSE@
-HAVE_XSLTPROC_TRUE = @HAVE_XSLTPROC_TRUE@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRNDUP = @HAVE_STRNDUP@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE__BOOL = @HAVE__BOOL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -382,22 +448,31 @@ LDFLAGS = @LDFLAGS@
 LEX = @LEX@
 LEXLIB = @LEXLIB@
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
+LIBPTH = @LIBPTH@
+LIBPTH_PREFIX = @LIBPTH_PREFIX@
 LIBS = @LIBS@
+LIBTHREAD = @LIBTHREAD@
 LIBTOOL = @LIBTOOL@
 LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LL_FMT = @LL_FMT@
 LL_RFMT = @LL_RFMT@
 LN_S = @LN_S@
 LTALLOCA = @LTALLOCA@
+LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
 LTLIBOBJS = @LTLIBOBJS@
+LTLIBPTH = @LTLIBPTH@
+LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
 MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@
 MCUTIL = @MCUTIL@
+MKDIR_P = @MKDIR_P@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
+NETINET_IN_H = @NETINET_IN_H@
 OBJEXT = @OBJEXT@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -411,6 +486,9 @@ PERL = @PERL@
 PRINT = @PRINT@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
+REPLACE_STRCASECMP = @REPLACE_STRCASECMP@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRSTR = @REPLACE_STRSTR@
 RESTORE = @RESTORE@
 SAMBA_CLIENT = @SAMBA_CLIENT@
 SERVICE_SUFFIX = @SERVICE_SUFFIX@
@@ -419,7 +497,10 @@ SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 SNAPSHOT_STAMP = @SNAPSHOT_STAMP@
 SORT = @SORT@
+SSH = @SSH@
+STDBOOL_H = @STDBOOL_H@
 STRIP = @STRIP@
+SYS_SOCKET_H = @SYS_SOCKET_H@
 USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@
 VDUMP = @VDUMP@
 VERSION = @VERSION@
@@ -458,6 +539,7 @@ WANT_TAPE_TRUE = @WANT_TAPE_TRUE@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
 XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
 YACC = @YACC@
 ac_c = @ac_c@
 ac_ct_AR = @ac_ct_AR@
@@ -484,6 +566,8 @@ build_os = @build_os@
 build_vendor = @build_vendor@
 datadir = @datadir@
 exec_prefix = @exec_prefix@
+gl_LIBOBJS = @gl_LIBOBJS@
+gl_LTLIBOBJS = @gl_LTLIBOBJS@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -512,7 +596,8 @@ INCLUDES = -I$(top_builddir)/common-src \
                -I$(top_srcdir)/common-src   \
                -I$(top_srcdir)/restore-src  \
                -I$(top_srcdir)/tape-src     \
-               -I$(top_srcdir)/amandad-src
+               -I$(top_srcdir)/amandad-src  \
+               -I$(top_srcdir)/gnulib
 
 LINT = @AMLINT@
 LINTFLAGS = @AMLINTFLAGS@
@@ -525,7 +610,7 @@ sbin_SCRIPTS = amcheckdb    amcleanup       amdump          \
                        amcrypt-ossl-asym
 
 libamserver_la_SOURCES = amindex.c     changer.c                       \
-                       conffile.c      diskfile.c      driverio.c      \
+                       diskfile.c      driverio.c      cmdline.c  \
                        holding.c       infofile.c      logfile.c       \
                        tapefile.c      find.c          server_util.c   \
                         taperscan.c
@@ -538,12 +623,13 @@ libamserver_la_LDFLAGS = -release $(VERSION)
 # need to list libamanda twice here, first to override the system library
 # routines, and second to pick up any references in the other libraries.
 ###
-LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
-       libamserver.$(LIB_EXTENSION)             \
-       ../tape-src/libamtape.$(LIB_EXTENSION)   \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
-       ../tape-src/libamtape.$(LIB_EXTENSION)   \
-       ../common-src/libamanda.$(LIB_EXTENSION) \
+LDADD = ../common-src/libamanda.$(LIB_EXTENSION)   \
+       libamserver.$(LIB_EXTENSION)               \
+       ../tape-src/libamtape.$(LIB_EXTENSION)     \
+       ../common-src/libamanda.$(LIB_EXTENSION)   \
+       ../tape-src/libamtape.$(LIB_EXTENSION)     \
+       ../common-src/libamanda.$(LIB_EXTENSION)   \
+       ../gnulib/libgnu.$(LIB_EXTENSION)          \
         $(READLINE_LIBS)
 
 amindexd_LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
@@ -552,25 +638,25 @@ amindexd_LDADD = ../common-src/libamanda.$(LIB_EXTENSION) \
        ../tape-src/libamtape.$(LIB_EXTENSION) \
        ../common-src/libamanda.$(LIB_EXTENSION) \
        ../tape-src/libamtape.$(LIB_EXTENSION) \
-       ../common-src/libamanda.$(LIB_EXTENSION)
+       ../common-src/libamanda.$(LIB_EXTENSION) \
+       ../gnulib/libgnu.$(LIB_EXTENSION)
 
 SUFFIXES = .sh .pl
 
 # there are used for testing only:
-TEST_PROGS = diskfile conffile infofile
+TEST_PROGS = diskfile infofile
 CLEANFILES = *.test.c $(sbin_SCRIPTS)
 amindexd_CSRC = amindexd.c     disk_history.c  list_dir.c
 amindexd_SOURCES = disk_history.h      list_dir.h      $(amindexd_CSRC)
 amreport_SOURCES = reporter.c
 amgetconf_SOURCES = getconf.c
 noinst_HEADERS = amindex.h     changer.h                       \
-                       conffile.h      diskfile.h      driverio.h      \
+                       diskfile.h      driverio.h      \
                        holding.h       infofile.h      logfile.h       \
                        tapefile.h      find.h          server_util.h   \
-                       taperscan.h
+                       taperscan.h cmdline.h
 
 diskfile_SOURCES = diskfile.test.c
-conffile_SOURCES = conffile.test.c
 infofile_SOURCES = infofile.test.c
 all: all-am
 
@@ -757,9 +843,6 @@ amtrmlog$(EXEEXT): $(amtrmlog_OBJECTS) $(amtrmlog_DEPENDENCIES)
 chunker$(EXEEXT): $(chunker_OBJECTS) $(chunker_DEPENDENCIES) 
        @rm -f chunker$(EXEEXT)
        $(LINK) $(chunker_LDFLAGS) $(chunker_OBJECTS) $(chunker_LDADD) $(LIBS)
-conffile$(EXEEXT): $(conffile_OBJECTS) $(conffile_DEPENDENCIES) 
-       @rm -f conffile$(EXEEXT)
-       $(LINK) $(conffile_LDFLAGS) $(conffile_OBJECTS) $(conffile_LDADD) $(LIBS)
 diskfile$(EXEEXT): $(diskfile_OBJECTS) $(diskfile_DEPENDENCIES) 
        @rm -f diskfile$(EXEEXT)
        $(LINK) $(diskfile_LDFLAGS) $(diskfile_OBJECTS) $(diskfile_LDADD) $(LIBS)
@@ -817,8 +900,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/amtrmlog.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/changer.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chunker.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conffile.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/conffile.test.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cmdline.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/disk_history.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diskfile.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diskfile.test.Po@am__quote@
@@ -1053,7 +1135,7 @@ uninstall-am: uninstall-info-am uninstall-libLTLIBRARIES \
 .pl:
                        cat $< > $@
                        chmod a+x $@
-                       -test -z "$(PERL)" || $(PERL) -c $@
+                       -test -z "$(PERL)" || $(PERL) -c -w -W -t -T $@
 
 .sh:
                        cat $< > $@
index d1ea05784dbeba3b5bc7c60fdece7c29b4624642..526434c895efca54eff374e024a7d8ba730dfd99 100644 (file)
  *                        University of Maryland at College Park
  */
 /*
- * $Id: amadmin.c,v 1.124.2.1 2006/11/01 14:45:39 martinea Exp $
+ * $Id: amadmin.c,v 1.124 2006/07/26 15:17:37 martinea Exp $
  *
  * controlling process for the Amanda backup system
  */
 #include "amanda.h"
+#include "cmdline.h"
 #include "conffile.h"
 #include "diskfile.h"
 #include "tapefile.h"
@@ -38,6 +39,7 @@
 #include "version.h"
 #include "holding.h"
 #include "find.h"
+#include "util.h"
 
 disklist_t diskq;
 
@@ -60,6 +62,7 @@ void info_one(disk_t *dp);
 void due(int argc, char **argv);
 void due_one(disk_t *dp);
 void find(int argc, char **argv);
+void holding(int argc, char **argv);
 void delete(int argc, char **argv);
 void delete_one(disk_t *dp);
 void balance(int argc, char **argv);
@@ -108,6 +111,8 @@ static const struct {
        " <tapelabel> ...\t # never re-use this tape." },
     { "find", find,
        " [<hostname> [<disks>]* ]*\t # Show which tapes these dumps are on." },
+    { "holding", holding,
+       " {list [ -l ] |delete} [ <hostname> [ <disk> [ <datestamp> [ .. ] ] ] ]+\t # Show or delete holding disk contents." },
     { "delete", delete,
        " [<hostname> [<disks>]* ]+ # Delete from database." },
     { "info", info,
@@ -156,7 +161,7 @@ main(
 
     erroutput_type = ERR_INTERACTIVE;
 
-    parse_server_conf(argc, argv, &new_argc, &new_argv);
+    parse_conf(argc, argv, &new_argc, &new_argv);
 
     if(new_argc < 3) usage();
 
@@ -1170,6 +1175,256 @@ find(
 }
 
 
+/* ------------------------ */
+
+static sl_t *
+get_file_list(
+    int argc,
+    char **argv,
+    int allow_empty)
+{
+    sl_t * file_list = NULL;
+    dumpspec_list_t * dumplist;
+
+    if (argc > 0) {
+        dumplist = cmdline_parse_dumpspecs(argc, argv);
+        if (!dumplist) {
+            fprintf(stderr, _("Could not get dump list\n"));
+            return NULL;
+        }
+
+        file_list = cmdline_match_holding(dumplist);
+        dumpspec_free_list(dumplist);
+    } else if (allow_empty) {
+        /* just list all of them */
+        file_list = holding_get_files(NULL, NULL, 1);
+    }
+
+    return file_list;
+}
+
+static int
+remove_holding_file_from_catalog(
+    char *filename)
+{
+    static int warnings_printed; /* only print once per invocation */
+    char *host;
+    char *disk;
+    int level;
+    char *datestamp;
+    info_t info;
+    int matching_hist_idx = -1;
+    history_t matching_hist; /* will be a copy */
+    int nhist;
+    int i;
+
+    if (!holding_file_read_header(filename, &host, &disk, &level, &datestamp)) {
+        printf(_("Could not read holding file %s\n"), filename);
+        return 0;
+    }
+
+    if (get_info(host, disk, &info) == -1) {
+           printf(_("WARNING: No curinfo record for %s:%s\n"), host, disk);
+           return 1; /* not an error */
+    }
+
+    /* Begin by trying to find the history element matching this dump.
+     * The datestamp on the dump is for the entire run of amdump, while the
+     * 'date' in the history element of 'info' is the time the dump itself
+     * began.  A matching history element, then, is the earliest element
+     * with a 'date' equal to or later than the date of the dumpfile. 
+     *
+     * We compare using formatted datestamps; even using seconds since epoch,
+     * we would still face timezone issues, and have to do a reverse (timezone
+     * to gmt) translation.
+     */
+
+    /* get to the end of the history list and search backward */
+    for (nhist = 0; info.history[nhist].level > -1; nhist++) /* empty loop */;
+    for (i = nhist-1; i > -1; i--) {
+        char *info_datestamp = construct_timestamp(&info.history[i].date);
+        int order = strcmp(datestamp, info_datestamp);
+        amfree(info_datestamp);
+
+        if (order <= 0) {
+            /* only a match if the levels are equal */
+            if (info.history[i].level == level) {
+                matching_hist_idx = i;
+                matching_hist = info.history[matching_hist_idx];
+            }
+            break;
+        }
+    }
+
+    if (matching_hist_idx == -1) {
+        printf(_("WARNING: No dump matching %s found in curinfo.\n"), filename);
+        return 1; /* not an error */
+    }
+
+    /* Remove the history element itself before doing the stats */
+    for (i = matching_hist_idx; i <= NB_HISTORY; i++) {
+        info.history[i] = info.history[i+1];
+    }
+    info.history[NB_HISTORY].level = -1;
+
+    /* Remove stats for that history element, if necessary.  Doing so
+     * will result in an inconsistent set of backups, so we warn the
+     * user and adjust last_level to make the next dump get us a 
+     * consistent picture. */
+    if (matching_hist.date == info.inf[matching_hist.level].date) {
+        /* search for an earlier dump at this level */
+        for (i = matching_hist_idx; info.history[i].level > -1; i++) {
+            if (info.history[i].level == matching_hist.level)
+                break;
+        }
+
+        if (info.history[i].level < 0) {
+            /* not found => zero it out */
+            info.inf[matching_hist.level].date = (time_t)-1; /* flag as not set */
+            info.inf[matching_hist.level].label[0] = '\0';
+        } else {
+            /* found => reconstruct stats as best we can */
+            info.inf[matching_hist.level].size = info.history[i].size;
+            info.inf[matching_hist.level].csize = info.history[i].csize;
+            info.inf[matching_hist.level].secs = info.history[i].secs;
+            info.inf[matching_hist.level].date = info.history[i].date;
+            info.inf[matching_hist.level].filenum = 0; /* we don't know */
+            info.inf[matching_hist.level].label[0] = '\0'; /* we don't know */
+        }
+
+        /* set last_level to the level we just deleted, and set command
+         * appropriately to make sure planner does a new dump at this level
+         * or lower */
+        info.last_level = matching_hist.level;
+        if (info.last_level == 0) {
+            printf(_("WARNING: Deleting the most recent full dump; forcing a full dump at next run.\n"));
+            SET(info.command, FORCE_FULL);
+        } else {
+            printf(_("WARNING: Deleting the most recent level %d dump; forcing a level %d dump or \nWARNING: lower at next run.\n"),
+                info.last_level, info.last_level);
+            SET(info.command, FORCE_NO_BUMP);
+        }
+
+        /* Search for and display any subsequent runs that depended on this one */
+        warnings_printed = 0;
+        for (i = matching_hist_idx-1; i >= 0; i--) {
+            char *datestamp;
+            if (info.history[i].level <= matching_hist.level) break;
+
+            datestamp = construct_timestamp(&info.history[i].date);
+            printf(_("WARNING: Level %d dump made %s can no longer be accurately restored.\n"), 
+                info.history[i].level, datestamp);
+            amfree(datestamp);
+
+            warnings_printed = 1;
+        }
+        if (warnings_printed)
+            printf(_("WARNING: (note, dates shown above are for dumps, and may be later than the\nWARNING: corresponding run date)\n"));
+    }
+
+    /* recalculate consecutive_runs based on the history: find the first run
+     * at this level, and then count the consecutive runs at that level. This
+     * number may be zero (if we just deleted the last run at this level) */
+    info.consecutive_runs = 0;
+    for (i = 0; info.history[i].level >= 0; i++) {
+        if (info.history[i].level == info.last_level) break;
+    }
+    while (info.history[i+info.consecutive_runs].level == info.last_level)
+        info.consecutive_runs++;
+
+    /* this function doesn't touch the performance stats */
+
+    /* write out the changes */
+    if (put_info(host, disk, &info) == -1) {
+           printf(_("Could not write curinfo record for %s:%s\n"), host, disk);
+           return 0;
+    }
+
+    return 1;
+}
+void
+holding(
+    int                argc,
+    char **    argv)
+{
+    sl_t *file_list;
+    sle_t *h;
+    enum { HOLDING_USAGE, HOLDING_LIST, HOLDING_DELETE } action = HOLDING_USAGE;
+    char *host;
+    char *disk;
+    char *datestamp;
+    int level;
+    int long_list = 0;
+
+    if (argc < 4)
+        action = HOLDING_USAGE;
+    else if (strcmp(argv[3], "list") == 0 && argc >= 4)
+        action = HOLDING_LIST;
+    else if (strcmp(argv[3], "delete") == 0 && argc > 4)
+        action = HOLDING_DELETE;
+
+    holding_set_verbosity(1);
+
+    switch (action) {
+        case HOLDING_USAGE:
+            fprintf(stderr,
+                    _("%s: expecting \"holding list [-l]\" or \"holding delete <host> [ .. ]\"\n"),
+                    get_pname());
+            usage();
+            return;
+
+        case HOLDING_LIST:
+            argc -= 4; argv += 4;
+            if (argc && strcmp(argv[0], "-l") == 0) {
+                argc--; argv++;
+                long_list = 1;
+            }
+
+            file_list = get_file_list(argc, argv, 1);
+            if (long_list) {
+                printf("%-10s %-2s %s\n", "size (kB)", "lv", "dump specification");
+            }
+            for (h = file_list->first; h != NULL; h = h->next) {
+                char *dumpstr;
+                if (!holding_file_read_header(h->name, &host, &disk, &level, &datestamp)) {
+                    fprintf(stderr, _("Error reading %s\n"), h->name);
+                    continue;
+                }
+
+                dumpstr = cmdline_format_dumpspec_components(host, disk, datestamp);
+                if (long_list) {
+                    printf("%-10"OFF_T_RFMT" %-2d %s\n", 
+                        (OFF_T_FMT_TYPE)holding_file_size(h->name, 0), level, dumpstr);
+                } else {
+                    printf("%s\n", dumpstr);
+                }
+                amfree(dumpstr);
+            }
+            free_sl(file_list);
+            break;
+            
+        case HOLDING_DELETE:
+            argc -= 4; argv += 4;
+
+            file_list = get_file_list(argc, argv, 0);
+            for (h = file_list->first; h != NULL; h = h->next) {
+                fprintf(stderr, _("Deleting '%s'\n"), h->name);
+                /* remove it from the catalog */
+                if (!remove_holding_file_from_catalog(h->name))
+                    exit(1);
+
+                /* unlink it */
+                if (!holding_file_unlink(h->name)) {
+                    /* holding_file_unlink printed an error message */
+                    exit(1);
+                }
+            }
+            free_sl(file_list);
+            break;
+    }
+}
+
+
 /* ------------------------ */
 
 
@@ -1351,13 +1606,10 @@ import_db(
     ch = *s++;
 
     hdr = "version";
-#define sc "CURINFO Version"
-    if(strncmp(s - 1, sc, SIZEOF(sc)-1) != 0) {
+    if(strncmp_const_skip(s - 1, "CURINFO Version", s, ch) != 0) {
        goto bad_header;
     }
-    s += SIZEOF(sc)-1;
     ch = *s++;
-#undef sc
     skip_whitespace(s, ch);
     if(ch == '\0'
        || sscanf(s - 1, "%d.%d.%d", &vers_maj, &vers_min, &vers_patch) != 3) {
@@ -1385,13 +1637,10 @@ import_db(
 
     hdr = "CONF";
     skip_whitespace(s, ch);                    /* find the org keyword */
-#define sc "CONF"
-    if(ch == '\0' || strncmp(s - 1, sc, SIZEOF(sc)-1) != 0) {
+    if(ch == '\0' || strncmp_const_skip(s - 1, "CONF", s, ch) != 0) {
        goto bad_header;
     }
-    s += SIZEOF(sc)-1;
     ch = *s++;
-#undef sc
 
     hdr = "org";
     skip_whitespace(s, ch);                    /* find the org string */
@@ -1467,11 +1716,7 @@ import_one(void)
     ch = *s++;
 
     skip_whitespace(s, ch);
-#define sc "host:"
-    if(ch == '\0' || strncmp(s - 1, sc, SIZEOF(sc)-1) != 0) goto parse_err;
-    s += SIZEOF(sc)-1;
-    ch = s[-1];
-#undef sc
+    if(ch == '\0' || strncmp_const_skip(s - 1, "host:", s, ch) != 0) goto parse_err;
     skip_whitespace(s, ch);
     if(ch == '\0') goto parse_err;
     fp = s-1;
@@ -1488,11 +1733,7 @@ import_one(void)
       ch = *s++;
       skip_whitespace(s, ch);
     }
-#define sc "disk:"
-    if(strncmp(s - 1, sc, SIZEOF(sc)-1) != 0) goto parse_err;
-    s += SIZEOF(sc)-1;
-    ch = s[-1];
-#undef sc
+    if(strncmp_const_skip(s - 1, "disk:", s, ch) != 0) goto parse_err;
     skip_whitespace(s, ch);
     if(ch == '\0') goto parse_err;
     fp = s-1;
@@ -1549,11 +1790,11 @@ import_one(void)
     while(1) {
        amfree(line);
        if((line = impget_line()) == NULL) goto shortfile_err;
-       if(strncmp(line, "//", 2) == 0) {
+       if(strncmp_const(line, "//") == 0) {
            /* end of record */
            break;
        }
-       if(strncmp(line, "history:", 8) == 0) {
+       if(strncmp_const(line, "history:") == 0) {
            /* end of record */
            break;
        }
@@ -1563,13 +1804,9 @@ import_one(void)
        ch = *s++;
 
        skip_whitespace(s, ch);
-#define sc "stats:"
-       if(ch == '\0' || strncmp(s - 1, sc, SIZEOF(sc)-1) != 0) {
+       if(ch == '\0' || strncmp_const_skip(s - 1, "stats:", s, ch) != 0) {
            goto parse_err;
        }
-       s += SIZEOF(sc)-1;
-       ch = s[-1];
-#undef sc
 
        skip_whitespace(s, ch);
        if(ch == '\0' || sscanf(s - 1, "%d", &level) != 1) {
@@ -1647,13 +1884,10 @@ import_one(void)
        memset(&onehistory, 0, SIZEOF(onehistory));
        s = line;
        ch = *s++;
-#define sc "history:"
-       if(strncmp(line, sc, SIZEOF(sc)-1) != 0) {
+       if(strncmp_const_skip(line, "history:", s, ch) != 0) {
            break;
        }
-       s += SIZEOF(sc)-1;
-       ch = s[-1];
-#undef sc
+
        skip_whitespace(s, ch);
        if(ch == '\0' || sscanf((s - 1), "%d", &onehistory.level) != 1) {
            break;
@@ -1828,7 +2062,7 @@ disklist_one(
        printf("INCRONLY\n");
        break;
     }
-
+    printf("        ignore %s\n", (dp->ignore? "YES" : "NO"));
     printf("        estimate ");
     switch(dp->estimate) {
     case ES_CLIENT:
@@ -1853,10 +2087,10 @@ disklist_one(
     case COMP_BEST:
        printf("CLIENT BEST\n");
        break;
-    case COMP_SERV_FAST:
+    case COMP_SERVER_FAST:
        printf("SERVER FAST\n");
        break;
-    case COMP_SERV_BEST:
+    case COMP_SERVER_BEST:
        printf("SERVER BEST\n");
        break;
     }
@@ -1900,7 +2134,6 @@ disklist_one(
     printf("        record %s\n", (dp->record? "YES" : "NO"));
     printf("        index %s\n", (dp->index? "YES" : "NO"));
     printf("        starttime %04d\n", (int)dp->starttime);
-   
     if(dp->tape_splitsize > (off_t)0) {
        printf("        tape_splitsize " OFF_T_FMT "\n",
               (OFF_T_FMT_TYPE)dp->tape_splitsize);
index 2dd7322e5777a183622ea617c1b74eda3c5bf962..4498cd7a6bf77a04830c3ae677fe3817dcb6f11c 100644 (file)
@@ -24,7 +24,7 @@
  * file named AUTHORS, in the root directory of this distribution.
  */
 /*
- * $Id: amcheck.c,v 1.149.2.10 2007/02/05 18:54:13 martinea Exp $
+ * $Id: amcheck.c,v 1.149 2006/08/24 01:57:16 paddy_s Exp $
  *
  * checks for common problems in server and clients
  */
@@ -141,7 +141,7 @@ main(
     server_probs = client_probs = 0;
     tempfd = mainfd = -1;
 
-    parse_server_conf(argc, argv, &new_argc, &new_argv);
+    parse_conf(argc, argv, &new_argc, &new_argv);
     my_argc = new_argc;
     my_argv = new_argv;
 
@@ -244,7 +244,7 @@ main(
       }
     }
 
-    conf_ctimeout = getconf_int(CNF_CTIMEOUT);
+    conf_ctimeout = (time_t)getconf_int(CNF_CTIMEOUT);
 
     conf_diskfile = getconf_str(CNF_DISKFILE);
     if (*conf_diskfile == '/') {
@@ -481,7 +481,7 @@ main(
                    error("mailfd write: %s", strerror(errno));
                    /*NOTREACHED*/
                } else {
-                   error("mailfd write: wrote %zd instead of %zd", w, r);
+                   error("mailfd write: wrote " SSIZE_T_FMT " instead of " SIZE_T_FMT, w, r);
                    /*NOTREACHED*/
                }
            }
@@ -601,6 +601,9 @@ start_server_check(
     int testtape = do_tapechk;
     tapetype_t *tp = NULL;
     char *quoted;
+    int res;
+    struct addrinfo *gaires;
+    struct addrinfo hints;
 
     switch(pid = fork()) {
     case -1:
@@ -668,10 +671,32 @@ start_server_check(
 #endif
        }
 
-       /* check that localhost is resolvable */
-       if ((gethostbyname("localhost")) == NULL) {
-           fprintf(outf, "ERROR: Cannot resolve `localhost'.\n");
+       /* Double-check that 'localhost' resolves properly */
+#ifdef WORKING_IPV6
+       hints.ai_flags = AI_CANONNAME | AI_V4MAPPED | AI_ALL;
+       hints.ai_family = AF_UNSPEC;
+#else
+       hints.ai_flags = AI_CANONNAME;
+       hints.ai_family = AF_INET;
+#endif
+       hints.ai_socktype = 0;
+       hints.ai_protocol = 0;
+       hints.ai_addrlen = 0;
+       hints.ai_addr = NULL;
+       hints.ai_canonname = NULL;
+       hints.ai_next = NULL;
+       res = getaddrinfo("localhost", NULL, &hints, &gaires);
+#ifdef WORKING_IPV6
+       if (res != 0) {
+           hints.ai_flags = AI_CANONNAME;
+           hints.ai_family = AF_UNSPEC;
+           res = getaddrinfo("localhost", NULL, &hints, &gaires);
+       }
+#endif
+       if (res != 0) {
+           fprintf(outf, _("ERROR: Cannot resolve `localhost': %s\n"), gai_strerror(res));
        }
+       if (gaires) freeaddrinfo(gaires);
     }
 
     /*
@@ -809,7 +834,7 @@ start_server_check(
                testtape = 0;
                do_tapechk = 0;
            }
-       } else if (strncmp(tapename, "null:", 5) == 0) {
+       } else if (strncmp_const(tapename, "null:") == 0) {
            fprintf(outf,
                    "WARNING: tapedev is %s, dumps will be thrown away\n",
                    tapename);
@@ -926,7 +951,7 @@ start_server_check(
 
        if(access(logfile, F_OK) == 0) {
            testtape = 0;
-           logbad = 1;
+           logbad = 2;
            if(access(logfile, W_OK) != 0) {
                quoted = quote_string(logfile);
                fprintf(outf, "ERROR: log file %s: not writable\n", quoted);
@@ -940,14 +965,17 @@ start_server_check(
            if(!(S_ISDIR(stat_old.st_mode))) {
                fprintf(outf, "ERROR: oldlog directory %s is not a directory\n",
                        quoted);
+               logbad = 1;
            }
            if(access(olddir, W_OK) == -1) {
                fprintf(outf, "ERROR: oldlog dir %s: not writable\n", quoted);
+               logbad = 1;
            }
        }
        else if(lstat(olddir,&stat_old) == 0) {
            fprintf(outf, "ERROR: oldlog directory %s is not a directory\n",
                    quoted);
+           logbad = 1;
        }
        amfree(quoted);
 
@@ -955,7 +983,7 @@ start_server_check(
            logfile = newvstralloc(logfile, conf_logdir, "/amdump", NULL);
            if (access(logfile, F_OK) == 0) {
                testtape = 0;
-               logbad = 1;
+               logbad = 2;
            }
        }
 
@@ -983,14 +1011,17 @@ start_server_check(
            if (tape_access(tapename,F_OK) == -1) {
                fprintf(outf, "ERROR: Can't access device %s: %s\n", tapename,
                        strerror(errno));
+               tapebad = 1;
            }
            if (tape_access(tapename,R_OK) == -1) {
                fprintf(outf, "ERROR: Can't read device %s: %s\n", tapename,
                        strerror(errno));
+               tapebad = 1;
            }
            if (tape_access(tapename,W_OK) == -1) {
                fprintf(outf, "ERROR: Can't write to device %s: %s\n", tapename,
                        strerror(errno));
+               tapebad = 1;
            }
        }
         if (tape_status < 0) {
@@ -1037,6 +1068,9 @@ start_server_check(
     } else if (do_tapechk) {
        fprintf(outf, "WARNING: skipping tape test because amdump or amflush seem to be running\n");
        fprintf(outf, "WARNING: if they are not, you must run amcleanup\n");
+    } else if (logbad == 2) {
+       fprintf(outf, "WARNING: amdump or amflush seem to be running\n");
+       fprintf(outf, "WARNING: if they are not, you must run amcleanup\n");
     } else {
        fprintf(outf, "NOTE: skipping tape checks\n");
     }
@@ -1094,6 +1128,7 @@ start_server_check(
            } else {
                fprintf(outf, "ERROR: conf info dir %s (%s)\n",
                        quoted, strerror(errno));
+               infobad = 1;
            }   
            amfree(conf_infofile);
        } else if (!S_ISDIR(statbuf.st_mode)) {
@@ -1108,6 +1143,7 @@ start_server_check(
            char *errmsg = NULL;
            if (check_infofile(conf_infofile, &origq, &errmsg) == -1) {
                fprintf(outf, "ERROR: Can't copy infofile: %s\n", errmsg);
+               infobad = 1;
                amfree(errmsg);
            }
            strappend(conf_infofile, "/");
@@ -1131,6 +1167,7 @@ start_server_check(
                    } else {
                        fprintf(outf, "ERROR: host info dir %s (%s)\n",
                                quoted, strerror(errno));
+                       infobad = 1;
                    }   
                    amfree(hostinfodir);
                } else if (!S_ISDIR(statbuf.st_mode)) {
@@ -1167,6 +1204,7 @@ start_server_check(
                        } else {
                            fprintf(outf, "ERROR: info dir %s (%s)\n",
                                    quoted, strerror(errno));
+                           infobad = 1;
                        }       
                    } else if (!S_ISDIR(statbuf.st_mode)) {
                        fprintf(outf, "ERROR: info dir %s: not a directory\n",
@@ -1183,7 +1221,8 @@ start_server_check(
                            fprintf(outf, "NOTE: it will be created on the next run.\n");
                        } else {
                            fprintf(outf, "ERROR: info dir %s (%s)\n",
-                               quoted, strerror(errno));
+                                   quoted, strerror(errno));
+                           infobad = 1;
                        }       
                    } else if (!S_ISREG(statbuf.st_mode)) {
                        fprintf(outf, "ERROR: info file %s: not a file\n",
@@ -1205,11 +1244,12 @@ start_server_check(
                        if(stat(conf_indexdir, &statbuf) == -1) {
                            if (errno == ENOENT) {
                                fprintf(outf, "NOTE: index dir %s does not exist\n",
-                                   quoted);
+                                       quoted);
                                fprintf(outf, "NOTE: it will be created on the next run.\n");
                            } else {
                                fprintf(outf, "ERROR: index dir %s (%s)\n",
                                        quoted, strerror(errno));
+                               indexbad = 1;
                            }   
                            amfree(conf_indexdir);
                        } else if (!S_ISDIR(statbuf.st_mode)) {
@@ -1235,11 +1275,12 @@ start_server_check(
                            if(stat(hostindexdir, &statbuf) == -1) {
                                if (errno == ENOENT) {
                                    fprintf(outf, "NOTE: index dir %s does not exist\n",
-                                       quoted);
+                                           quoted);
                                    fprintf(outf, "NOTE: it will be created on the next run.\n");
                                } else {
                                    fprintf(outf, "ERROR: index dir %s (%s)\n",
                                            quoted, strerror(errno));
+                                   indexbad = 1;
                                }
                                amfree(hostindexdir);
                            } else if (!S_ISDIR(statbuf.st_mode)) {
@@ -1264,11 +1305,12 @@ start_server_check(
                            if(stat(diskdir, &statbuf) == -1) {
                                if (errno == ENOENT) {
                                    fprintf(outf, "NOTE: index dir %s does not exist\n",
-                                       quoted);
+                                           quoted);
                                    fprintf(outf, "NOTE: it will be created on the next run.\n");
                                } else {
                                    fprintf(outf, "ERROR: index dir %s (%s)\n",
                                        quoted, strerror(errno));
+                                   indexbad = 1;
                                }       
                            } else if (!S_ISDIR(statbuf.st_mode)) {
                                fprintf(outf, "ERROR: index dir %s: not a directory\n",
@@ -1295,7 +1337,7 @@ start_server_check(
                    pgmbad = 1;
                  }
                }
-               if ( dp->compress == COMP_SERV_CUST ) {
+               if ( dp->compress == COMP_SERVER_CUST ) {
                  if ( dp->srvcompprog[0] == '\0' ) {
                    fprintf(outf, "ERROR: server custom compression program not specified\n");
                    pgmbad = 1;
@@ -1381,7 +1423,7 @@ start_host(
        return;
     }
 
-    if (strncmp (hostp->hostname,"localhost",9) == 0) {
+    if (strcmp(hostp->hostname,"localhost") == 0) {
        fprintf(outf,
                     "WARNING: Usage of fully qualified hostname recommended for Client %s.\n",
                     hostp->hostname);
@@ -1505,8 +1547,8 @@ start_host(
                     hostp->hostname, qname, dp->device);
                }
            }
-           if(strncmp(dp->program,"DUMP",4) == 0 || 
-              strncmp(dp->program,"GNUTAR",6) == 0) {
+           if(strcmp(dp->program,"DUMP") == 0 || 
+              strcmp(dp->program,"GNUTAR") == 0) {
                if(strcmp(dp->program, "DUMP") == 0 &&
                   !am_has_feature(hostp->features, fe_program_dump)) {
                    fprintf(outf, "ERROR: %s:%s does not support DUMP.\n",
@@ -1541,9 +1583,9 @@ start_host(
                            "ERROR: Client %s does not support data encryption.\n",
                            hostp->hostname);
                    remote_errors++;
-                 } else if ( dp->compress == COMP_SERV_FAST || 
-                             dp->compress == COMP_SERV_BEST ||
-                             dp->compress == COMP_SERV_CUST ) {
+                 } else if ( dp->compress == COMP_SERVER_FAST || 
+                             dp->compress == COMP_SERVER_BEST ||
+                             dp->compress == COMP_SERVER_CUST ) {
                    fprintf(outf,
                            "ERROR: %s: Client encryption with server compression is not supported. See amanda.conf(5) for detail.\n", hostp->hostname);
                    remote_errors++;
@@ -1553,7 +1595,7 @@ start_host(
                    l = vstralloc(calcsize,
                                  dp->program, " ",
                                  qname, " ",
-                                 dp->device,
+                                 qdevice,
                                  " 0 OPTIONS |",
                                  o,
                                  "\n",
@@ -1569,20 +1611,31 @@ start_host(
                                  NULL);
                }
            } else {
-               if(!am_has_feature(hostp->features, fe_program_dumper_api)) {
-                   fprintf(outf, "ERROR: %s:%s does not support DUMPER-API.\n",
+               if(!am_has_feature(hostp->features, fe_program_backup_api)) {
+                   fprintf(outf, "ERROR: %s:%s does not support BACKUP-API.\n",
                            hostp->hostname, qname);
                }
-               l = vstralloc("DUMPER ",
-                             dp->program, 
-                             " ",
-                             qname,
-                             " ",
-                             dp->device,
-                             " 0 OPTIONS |",
-                             o,
-                             "\n",
-                             NULL);
+               if(dp->device) {
+                   l = vstralloc("BACKUP ",
+                                 dp->program, 
+                                 " ",
+                                 qname,
+                                 " ",
+                                 qdevice,
+                                 " 0 OPTIONS |",
+                                 o,
+                                 "\n",
+                                 NULL);
+               } else {
+                   l = vstralloc("BACKUP ",
+                                 dp->program, 
+                                 " ",
+                                 qname,
+                                 " 0 OPTIONS |",
+                                 o,
+                                 "\n",
+                                 NULL);
+               }
            }
            amfree(qname);
            amfree(qdevice);
@@ -1744,15 +1797,11 @@ handle_result(
            s[-2] = '\0';
        }
 
-#define sc "OPTIONS "
-       if(strncmp(line, sc, SIZEOF(sc)-1) == 0) {
-#undef sc
+       if(strncmp_const(line, "OPTIONS ") == 0) {
 
-#define sc "features="
-           t = strstr(line, sc);
+           t = strstr(line, "features=");
            if(t != NULL && (isspace((int)t[-1]) || t[-1] == ';')) {
-               t += SIZEOF(sc)-1;
-#undef sc
+               t += SIZEOF("features=")-1;
                am_release_feature_set(hostp->features);
                if((hostp->features = am_string_to_feature(t)) == NULL) {
                    fprintf(outf, "ERROR: %s: bad features value: %s\n",
@@ -1763,18 +1812,12 @@ handle_result(
            continue;
        }
 
-#define sc "OK "
-       if(strncmp(line, sc, SIZEOF(sc)-1) == 0) {
+       if(strncmp_const(line, "OK ") == 0) {
            continue;
-#undef sc
        }
 
-#define sc "ERROR "
-       if(strncmp(line, sc, SIZEOF(sc)-1) == 0) {
-           t = line + SIZEOF(sc) - 1;
-           tch = t[-1];
-#undef sc
-
+       t = line;
+       if(strncmp_const_skip(line, "ERROR ", t, tch) == 0) {
            skip_whitespace(t, tch);
            /*
             * If the "error" is that the "noop" service is unknown, it
index c358194d1e2a6aa0d20ad48cddb24b9f3f1df17e..924e3cdee93ef245970cd81edb8c8d303788fa35 100644 (file)
@@ -24,7 +24,7 @@
  * file named AUTHORS, in the root directory of this distribution.
  */
 /*
- * $Id: amcleanupdisk.c,v 1.22.2.1 2006/10/03 18:57:25 martinea Exp $
+ * $Id: amcleanupdisk.c,v 1.22 2006/07/25 18:27:57 martinea Exp $
  */
 #include "amanda.h"
 
@@ -182,7 +182,7 @@ check_holdingdisk(
 
        amfree(hostname);
        amfree(diskname);
-       filetype = get_amanda_names(tmpname, &hostname, &diskname, &level);
+       filetype = holding_file_read_header(tmpname, &hostname, &diskname, &level, NULL);
        amfree(tmpname);
        if(filetype != F_DUMPFILE) {
            continue;
index 39746d58ea930f070d1145bfdeec63afe77566ab..9afc4307b6d23d3a7c7e03d0fe6fe7089283c2ff 100644 (file)
@@ -36,7 +36,7 @@
 # change these as needed
 OPENSSL=                       # whatever's in $PATH
 CIPHER=aes-256-cbc             # see `openssl help` for more ciphers
-AMANDA_HOME=~amandabackup
+AMANDA_HOME=~@CLIENT_LOGIN@
 RANDFILE=$AMANDA_HOME/.rnd
 export RANDFILE
 PASSPHRASE=$AMANDA_HOME/.am_passphrase # optional
index 0529cab199b39b1a973f2cc9a541dcfc1cfc46a7..9799d4a8f51ab554b30437447308629ea6ed35f0 100644 (file)
@@ -7,7 +7,7 @@
 # change these as needed
 OPENSSL=                       # whatever's in $PATH
 CIPHER=aes-256-cbc             # see `openssl help` for more ciphers
-AMANDA_HOME=~amandabackup
+AMANDA_HOME=~@CLIENT_LOGIN@
 RANDFILE=$AMANDA_HOME/.rnd
 export RANDFILE
 PASSPHRASE=$AMANDA_HOME/.am_passphrase # required
index bb94630079340c81d543b67321ccef9fd6d6e5ac..5b9e6448c167bca72fbc461a349c9ca0727121d0 100644 (file)
@@ -24,7 +24,7 @@
  * file named AUTHORS, in the root directory of this distribution.
  */
 /*
- * $Id: amflush.c,v 1.95.2.3 2007/02/01 19:25:15 martinea Exp $
+ * $Id: amflush.c,v 1.95 2006/07/25 21:41:24 martinea Exp $
  *
  * write files from work directory onto tape
  */
@@ -94,6 +94,7 @@ main(
     struct tm *tm;
     char *tapedev;
     char *tpchanger;
+    char *qdisk, *qhname;
 
     safe_fd(-1, 0);
     safe_cd();
@@ -112,7 +113,7 @@ main(
 
     /* process arguments */
 
-    parse_server_conf(main_argc, main_argv, &new_argc, &new_argv);
+    parse_conf(main_argc, main_argv, &new_argc, &new_argv);
     my_argc = new_argc;
     my_argv = new_argv;
 
@@ -267,7 +268,7 @@ main(
        exit(1);
     }
 
-    holding_list = get_flush(datestamp_list, NULL, 1, 0);
+    holding_list = holding_get_files_for_flush(datestamp_list, 1);
     if(holding_list->first == NULL) {
        printf("Could not find any valid dump image, check directory.\n");
        exit(1);
@@ -276,8 +277,12 @@ main(
     if(!batch) confirm();
 
     for(dp = diskq.head; dp != NULL; dp = dp->next) {
-       if(dp->todo)
-           log_add(L_DISK, "%s %s", dp->host->hostname, dp->name);
+       if(dp->todo) {
+           char *qname;
+           qname = quote_string(dp->name);
+           log_add(L_DISK, "%s %s", dp->host->hostname, qname);
+           amfree(qname);
+       }
     }
 
     if(!foreground) { /* write it before redirecting stdout */
@@ -331,7 +336,14 @@ main(
     fprintf(driver_stream, "DATE %s\n", amflush_timestamp);
     for(holding_file=holding_list->first; holding_file != NULL;
                                   holding_file = holding_file->next) {
-       get_dumpfile(holding_file->name, &file);
+       holding_file_get_dumpfile(holding_file->name, &file);
+
+       if (holding_file_size(holding_file->name, 1) <= 0) {
+           log_add(L_INFO, "%s: removing file with no data.",
+                   holding_file->name);
+           holding_file_unlink(holding_file->name);
+           continue;
+       }
 
        dp = lookup_disk(file.name, file.disk);
        if (!dp) {
@@ -340,20 +352,24 @@ main(
        }
        if (dp->todo == 0) continue;
 
+       qdisk = quote_string(file.disk);
+       qhname = quote_string(holding_file->name);
        fprintf(stderr,
                "FLUSH %s %s %s %d %s\n",
                file.name,
-               file.disk,
+               qdisk,
                file.datestamp,
                file.dumplevel,
-               holding_file->name);
+               qhname);
        fprintf(driver_stream,
                "FLUSH %s %s %s %d %s\n",
                file.name,
-               file.disk,
+               qdisk,
                file.datestamp,
                file.dumplevel,
-               holding_file->name);
+               qhname);
+       amfree(qdisk);
+       amfree(qhname);
     }
     fprintf(stderr, "ENDFLUSH\n"); fflush(stderr);
     fprintf(driver_stream, "ENDFLUSH\n"); fflush(driver_stream);
index 6e50fe5a1b369c0fd13e550cc94bbe12500e808d..d703618732480fe33103e6fcbf38eae64a418f9a 100644 (file)
@@ -25,7 +25,7 @@
  *                        University of Maryland at College Park
  */
 /*
- * $Id: amindex.c,v 1.15.2.1 2006/11/24 18:05:05 martinea Exp $
+ * $Id: amindex.c,v 1.15 2006/05/25 01:47:19 johnfranks Exp $
  *
  * index control
  */
index 3e14b12dc8d20a1f684fa1c25b4c2f0eb2a68747..22339968651cbf79d0cc461e7882af0b15901642 100644 (file)
@@ -25,7 +25,7 @@
  *                        University of Maryland at College Park
  */
 /*
- * $Id: amindex.h,v 1.8.2.1 2006/11/24 18:05:06 martinea Exp $
+ * $Id: amindex.h,v 1.8 2006/05/25 01:47:19 johnfranks Exp $
  *
  * headers for index control
  */
index 493a8089c2c7138f641d07b28a5a5478ffa5b943..951151bfd42bd39ac716cac90fb1522d8fae0f67 100644 (file)
@@ -24,7 +24,7 @@
  * file named AUTHORS, in the root directory of this distribution.
  */
 /*
- * $Id: amindexd.c,v 1.106.2.9 2007/02/07 15:23:45 martinea Exp $
+ * $Id: amindexd.c,v 1.106 2006/07/25 18:27:57 martinea Exp $
  *
  * This is the server daemon part of the index client/server system.
  * It is assumed that this is launched from inetd instead of being
 
 #include <grp.h>
 
+#define amindexd_debug(i,x) do {       \
+       if ((i) <= debug_amindexd) {    \
+           dbprintf(x);                \
+       }                               \
+} while (0)
+
 typedef struct REMOVE_ITEM
 {
     char *filename;
@@ -68,7 +74,6 @@ typedef struct REMOVE_ITEM
 /* state */
 static int from_amandad;
 static char local_hostname[MAX_HOSTNAME_LENGTH+1];     /* me! */
-static char *remote_hostname = NULL;                   /* the client */
 static char *dump_hostname = NULL;             /* machine we are restoring */
 static char *disk_name;                                /* disk we are restoring */
 char *qdisk_name = NULL;                       /* disk we are restoring */
@@ -76,7 +81,6 @@ static char *target_date = NULL;
 static disklist_t disk_list;                   /* all disks in cur config */
 static find_result_t *output_find = NULL;
 static g_option_t *g_options = NULL;
-static int cmdfdin, cmdfdout;
 
 static int amindexd_debug = 0;
 
@@ -102,7 +106,7 @@ static void lreply(int, char *, ...)
     __attribute__ ((format (printf, 2, 3)));
 static void fast_lreply(int, char *, ...)
     __attribute__ ((format (printf, 2, 3)));
-static int is_dump_host_valid(char *);
+static am_host_t *is_dump_host_valid(char *);
 static int is_disk_valid(char *);
 static int is_config_valid(char *);
 static int build_disk_table(void);
@@ -116,6 +120,10 @@ static int are_dumps_compressed(void);
 static char *amindexd_nicedate (char *datestamp);
 static int cmp_date (const char *date1, const char *date2);
 static char *clean_backslash(char *line);
+static char *get_index_name(char *dump_hostname, char *hostname,
+                           char *diskname, char *timestamps, int level);
+static int get_index_dir(char *dump_hostname, char *hostname, char *diskname);
+
 int main(int, char **);
 
 static REMOVE_ITEM *
@@ -311,7 +319,6 @@ process_ls_dump(
     char *s;
     int ch;
     size_t len_dir_slash;
-    struct stat statbuf;
 
     if (strcmp(dir, "/") == 0) {
        dir_slash = stralloc(dir);
@@ -319,12 +326,12 @@ process_ls_dump(
        dir_slash = stralloc2(dir, "/");
     }
 
-    filename_gz = getindexfname(dump_hostname, disk_name, dump_item->date,
-                               dump_item->level);
-    if (stat(filename_gz, &statbuf) < 0 && errno == ENOENT) {
+    filename_gz = get_index_name(dump_hostname, dump_item->hostname, disk_name,
+                                dump_item->date, dump_item->level);
+    if (filename_gz == NULL) {
+       *emsg = stralloc("index file not found");
        amfree(filename_gz);
-       filename_gz = getoldindexfname(dump_hostname, disk_name,
-                                      dump_item->date, dump_item->level);
+       return -1;
     }
     if((filename = uncompress_file(filename_gz, emsg)) == NULL) {
        amfree(filename_gz);
@@ -490,49 +497,39 @@ printf_arglist_function1(static void fast_lreply, int, n, char *, fmt)
 /* also do a security check on the requested dump hostname */
 /* to restrict access to index records if required */
 /* return -1 if not okay */
-static int
+static am_host_t *
 is_dump_host_valid(
     char *     host)
 {
-    struct stat dir_stat;
-    char *fn;
-    am_host_t *ihost;
+    am_host_t   *ihost;
+    disk_t      *diskp;
 
     if (config_name == NULL) {
        reply(501, "Must set config before setting host.");
-       return -1;
-    }
-
-#if 0
-    /* only let a client restore itself for now unless it is the server */
-    if (strcasecmp(remote_hostname, local_hostname) == 0)
-       return 0;
-    if (strcasecmp(remote_hostname, host) != 0)
-    {
-       reply(501,
-             "You don't have the necessary permissions to set dump host to %s.",
-             buf1);
-       return -1;
+       return NULL;
     }
-#endif
 
     /* check that the config actually handles that host */
     ihost = lookup_host(host);
     if(ihost == NULL) {
        reply(501, "Host %s is not in your disklist.", host);
-       return -1;
+       return NULL;
     }
 
-    /* assume an index dir already */
-    fn = getindexfname(host, NULL, NULL, 0);
-    if (stat (fn, &dir_stat) != 0 || !S_ISDIR(dir_stat.st_mode)) {
-       reply(501, "No index records for host: %s. Have you enabled indexing?", host);
-       amfree(fn);
-       return -1;
+    /* check if an index dir exist */
+    if(get_index_dir(host, ihost->hostname, NULL)) {
+       return ihost;
     }
 
-    amfree(fn);
-    return 0;
+    /* check if an index dir exist for at least one DLE */
+    for(diskp = ihost->disks; diskp != NULL; diskp = diskp->hostnext) {
+       if (get_index_dir(diskp->hostname, NULL, NULL)) {
+           return ihost;
+       }
+    }
+
+    reply(501, "No index records for host: %s. Have you enabled indexing?", host);
+    return NULL;
 }
 
 
@@ -540,8 +537,6 @@ static int
 is_disk_valid(
     char *disk)
 {
-    char *fn;
-    struct stat dir_stat;
     disk_t *idisk;
     char *qdisk;
 
@@ -564,16 +559,13 @@ is_disk_valid(
     }
 
     /* assume an index dir already */
-    fn = getindexfname(dump_hostname, disk, NULL, 0);
-    if (stat (fn, &dir_stat) != 0 || !S_ISDIR(dir_stat.st_mode)) {
+    if (get_index_dir(dump_hostname, idisk->hostname, disk) == 0) {
        qdisk = quote_string(disk);
        reply(501, "No index records for disk: %s. Invalid?", qdisk);
-       amfree(fn);
        amfree(qdisk);
        return -1;
     }
 
-    amfree(fn);
     return 0;
 }
 
@@ -706,8 +698,8 @@ build_disk_table(void)
            last_level = find_output->level;
            last_partnum = partnum;
            date = amindexd_nicedate(find_output->timestamp);
-           add_dump(date, find_output->level, find_output->label, 
-                    find_output->filenum, partnum);
+           add_dump(find_output->hostname, date, find_output->level,
+                    find_output->label, find_output->filenum, partnum);
            dbprintf(("%s: - %s %d %s " OFF_T_FMT " %d\n",
                     debug_prefix_time(NULL), date, find_output->level, 
                     find_output->label,
@@ -801,7 +793,6 @@ is_dir_valid_opaque(
        reply(502, "Must set date before asking about directories");
        return -1;
     }
-
     /* scan through till we find first dump on or before date */
     for (item=first_dump(); item!=NULL; item=next_dump(item))
        if (cmp_date(item->date, target_date) <= 0)
@@ -825,8 +816,13 @@ is_dir_valid_opaque(
     do
     {
        amfree(filename);
-       filename_gz = getindexfname(dump_hostname, disk_name,
-                                   item->date, item->level);
+       filename_gz = get_index_name(dump_hostname, item->hostname, disk_name,
+                                    item->date, item->level);
+       if (filename_gz == NULL) {
+           reply(599, "index not found");
+           amfree(ldir);
+           return -1;
+       }
        if((filename = uncompress_file(filename_gz, &emsg)) == NULL) {
            reply(599, "System error %s", emsg);
            amfree(filename_gz);
@@ -1106,18 +1102,18 @@ main(
     char **    argv)
 {
     char *line = NULL, *part = NULL;
-    char *s, *fp;
+    char *s;
     int ch;
     char *cmd_undo, cmd_undo_ch;
     socklen_t socklen;
-    struct sockaddr_in his_addr;
-    struct hostent *his_name;
+    struct sockaddr_storage his_addr;
     char *arg = NULL;
     char *cmd;
     size_t len;
     int user_validated = 0;
     char *errstr = NULL;
     char *pgm = "amindexd";            /* in case argv[0] is not set */
+    char his_hostname[MAX_HOSTNAME_LENGTH];
 
     safe_fd(DATA_FD_OFFSET, 2);
     safe_cd();
@@ -1202,7 +1198,7 @@ main(
     }
     else {
        from_amandad = 0;
-       safe_fd(-1, 0);
+       safe_fd(dbfd(), 1);
     }
 
     if (argc > 0) {
@@ -1226,61 +1222,32 @@ main(
 
 
     if(from_amandad == 0) {
-       if(amindexd_debug) {
-           /*
-            * Fake the remote address as the local address enough to get
-            * through the security check.
-            */
-           his_name = gethostbyname(local_hostname);
-           if(his_name == NULL) {
-               error("gethostbyname(%s) failed\n", local_hostname);
-                /*NOTREACHED*/
-           }
-           assert((sa_family_t)his_name->h_addrtype == (sa_family_t)AF_INET);
-           his_addr.sin_family = (sa_family_t)his_name->h_addrtype;
-           his_addr.sin_port = (in_port_t)htons(0);
-           memcpy((void *)&his_addr.sin_addr.s_addr,
-                  (void *)his_name->h_addr_list[0], 
-                   (size_t)his_name->h_length);
-       } else {
+       if(!amindexd_debug) {
            /* who are we talking to? */
            socklen = sizeof (his_addr);
            if (getpeername(0, (struct sockaddr *)&his_addr, &socklen) == -1)
                error("getpeername: %s", strerror(errno));
+
+           /* Try a reverse (IP->hostname) resolution, and fail if it does
+            * not work -- this is a basic security check */
+           if (getnameinfo((struct sockaddr *)&his_addr, SS_LEN(&his_addr),
+                           his_hostname, sizeof(his_hostname),
+                           NULL, 0,
+                           0)) {
+               error(_("getnameinfo(%s): hostname lookup failed"),
+                     str_sockaddr(&his_addr));
+               /*NOTREACHED*/
+           }
        }
-       if ((his_addr.sin_family != (sa_family_t)AF_INET)
-               || (ntohs(his_addr.sin_port) == 20)) {
-           error("connection rejected from %s family %d port %d",
-                 inet_ntoa(his_addr.sin_addr), his_addr.sin_family,
-                 htons(his_addr.sin_port));
-           /*NOTREACHED*/
-       }
-       if ((his_name = gethostbyaddr((char *)&(his_addr.sin_addr),
-                                     sizeof(his_addr.sin_addr),
-                                     AF_INET)) == NULL) {
-           error("gethostbyaddr(%s): hostname lookup failed",
-                 inet_ntoa(his_addr.sin_addr));
-           /*NOTREACHED*/
-       }
-       fp = s = stralloc(his_name->h_name);
-       ch = *s++;
-       while(ch && ch != '.') ch = *s++;
-       s[-1] = '\0';
-       remote_hostname = newstralloc(remote_hostname, fp);
-       s[-1] = (char)ch;
-       amfree(fp);
+
+       /* Set up the input and output FILEs */
        cmdout = stdout;
        cmdin = stdin;
     }
     else {
-       cmdfdout  = DATA_FD_OFFSET + 0;
-       cmdfdin   = DATA_FD_OFFSET + 1;
-
        /* read the REQ packet */
        for(; (line = agets(stdin)) != NULL; free(line)) {
-#define sc "OPTIONS "
-           if(strncmp(line, sc, sizeof(sc)-1) == 0) {
-#undef sc
+           if(strncmp_const(line, "OPTIONS ") == 0) {
                g_options = parse_g_options(line+8, 1);
                if(!g_options->hostname) {
                    g_options->hostname = alloc(MAX_HOSTNAME_LENGTH+1);
@@ -1308,15 +1275,15 @@ main(
        fclose(stdin);
        fclose(stdout);
        
-       cmdout = fdopen(cmdfdout, "a");
+       cmdout = fdopen(DATA_FD_OFFSET + 0, "a");
        if (!cmdout) {
-           error("amindexd: Can't fdopen(cmdfdout): %s", strerror(errno));
+           error(_("amindexd: Can't fdopen(%d): %s"), DATA_FD_OFFSET + 0, strerror(errno));
            /*NOTREACHED*/
        }
 
-       cmdin = fdopen(cmdfdin, "r");
+       cmdin = fdopen(DATA_FD_OFFSET + 1, "r");
        if (!cmdin) {
-           error("amindexd: Can't fdopen(cmdfdin): %s", strerror(errno));
+           error(_("amindexd: Can't fdopen(%d): %s"), DATA_FD_OFFSET + 1, strerror(errno));
            /*NOTREACHED*/
        }
     }
@@ -1413,7 +1380,10 @@ main(
 
        amfree(errstr);
        if (!user_validated && strcmp(cmd, "SECURITY") == 0 && arg) {
-           user_validated = check_security(&his_addr, arg, 0, &errstr);
+           user_validated = amindexd_debug ||
+                               check_security(
+                                       (struct sockaddr_storage *)&his_addr,
+                                       arg, 0, &errstr);
            if(user_validated) {
                reply(200, "Access OK");
                amfree(line);
@@ -1432,11 +1402,12 @@ main(
            amfree(line);
            break;
        } else if (strcmp(cmd, "HOST") == 0 && arg) {
+           am_host_t *lhost;
            /* set host we are restoring */
            s[-1] = '\0';
-           if (is_dump_host_valid(arg) != -1)
+           if ((lhost = is_dump_host_valid(arg)) != NULL)
            {
-               dump_hostname = newstralloc(dump_hostname, arg);
+               dump_hostname = newstralloc(dump_hostname, lhost->hostname);
                reply(200, "Dump host set to %s.", dump_hostname);
                amfree(qdisk_name);             /* invalidate any value */
                amfree(disk_name);              /* invalidate any value */
@@ -1500,7 +1471,7 @@ main(
                       dump_hostname);
                for (disk = disk_list.head; disk!=NULL; disk = disk->next) {
 
-                   if (strcmp(disk->host->hostname, dump_hostname) == 0 &&
+                   if (strcasecmp(disk->host->hostname, dump_hostname) == 0 &&
                      ((disk->device && strcmp(disk->device, arg) == 0) ||
                      (!disk->device && strcmp(disk->name, arg) == 0))) {
                        qname = quote_string(disk->name);
@@ -1521,7 +1492,7 @@ main(
            else {
                lreply(200, " List of disk for host %s", dump_hostname);
                for (disk = disk_list.head; disk!=NULL; disk = disk->next) {
-                   if(strcmp(disk->host->hostname, dump_hostname) == 0) {
+                   if(strcasecmp(disk->host->hostname, dump_hostname) == 0) {
                        qname = quote_string(disk->name);
                        fast_lreply(201, " %s", qname);
                        amfree(qname);
@@ -1678,3 +1649,133 @@ clean_backslash(
 
     return line;
 }
+
+
+static int
+get_index_dir(
+    char *dump_hostname,
+    char *hostname,
+    char *diskname)
+{
+    struct stat  dir_stat;
+    char        *fn;
+    char        *s;
+    char        *lower_hostname;
+
+    lower_hostname = stralloc(dump_hostname);
+    for(s=lower_hostname; *s != '\0'; s++)
+       *s = tolower(*s);
+
+    fn = getindexfname(dump_hostname, diskname, NULL, 0);
+    if (stat(fn, &dir_stat) == 0 && S_ISDIR(dir_stat.st_mode)) {
+       amfree(lower_hostname);
+       amfree(fn);
+       return 1;
+    }
+    amfree(fn);
+    if (hostname != NULL) {
+       fn = getindexfname(hostname, diskname, NULL, 0);
+       if (stat(fn, &dir_stat) == 0 && S_ISDIR(dir_stat.st_mode)) {
+           amfree(lower_hostname);
+           amfree(fn);
+           return 1;
+       }
+    }
+    amfree(fn);
+    fn = getindexfname(lower_hostname, diskname, NULL, 0);
+    if (stat(fn, &dir_stat) == 0 && S_ISDIR(dir_stat.st_mode)) {
+       amfree(lower_hostname);
+       amfree(fn);
+       return 1;
+    }
+    amfree(fn);
+    if(diskname != NULL) {
+       fn = getoldindexfname(dump_hostname, diskname, NULL, 0);
+       if (stat(fn, &dir_stat) == 0 && S_ISDIR(dir_stat.st_mode)) {
+           amfree(lower_hostname);
+           amfree(fn);
+           return 1;
+       }
+       amfree(fn);
+       if (hostname != NULL) {
+           fn = getoldindexfname(hostname, diskname, NULL, 0);
+           if (stat(fn, &dir_stat) == 0 && S_ISDIR(dir_stat.st_mode)) {
+               amfree(lower_hostname);
+               amfree(fn);
+               return 1;
+           }
+       }
+       amfree(fn);
+       fn = getoldindexfname(lower_hostname, diskname, NULL, 0);
+       if (stat(fn, &dir_stat) == 0 && S_ISDIR(dir_stat.st_mode)) {
+           amfree(lower_hostname);
+           amfree(fn);
+           return 1;
+       }
+       amfree(fn);
+    }
+    amfree(lower_hostname);
+    return -1;
+}
+
+static char *
+get_index_name(
+    char *dump_hostname,
+    char *hostname,
+    char *diskname,
+    char *timestamps,
+    int   level)
+{
+    struct stat  dir_stat;
+    char        *fn;
+    char        *s;
+    char        *lower_hostname;
+
+    lower_hostname = stralloc(dump_hostname);
+    for(s=lower_hostname; *s != '\0'; s++)
+       *s = tolower(*s);
+
+    fn = getindexfname(dump_hostname, diskname, timestamps, level);
+    if (stat(fn, &dir_stat) == 0 && S_ISREG(dir_stat.st_mode)) {
+       amfree(lower_hostname);
+       return fn;
+    }
+    amfree(fn);
+    if(hostname != NULL) {
+       fn = getindexfname(hostname, diskname, timestamps, level);
+       if (stat(fn, &dir_stat) == 0 && S_ISREG(dir_stat.st_mode)) {
+           amfree(lower_hostname);
+           return fn;
+       }
+    }
+    amfree(fn);
+    fn = getindexfname(lower_hostname, diskname, timestamps, level);
+    if (stat(fn, &dir_stat) == 0 && S_ISREG(dir_stat.st_mode)) {
+       amfree(lower_hostname);
+       return fn;
+    }
+    amfree(fn);
+    if(diskname != NULL) {
+       fn = getoldindexfname(dump_hostname, diskname, timestamps, level);
+       if (stat(fn, &dir_stat) == 0 && S_ISREG(dir_stat.st_mode)) {
+           amfree(lower_hostname);
+           return fn;
+       }
+       amfree(fn);
+       if(hostname != NULL) {
+           fn = getoldindexfname(hostname, diskname, timestamps, level);
+           if (stat(fn, &dir_stat) == 0 && S_ISREG(dir_stat.st_mode)) {
+               amfree(lower_hostname);
+               return fn;
+           }
+       }
+       amfree(fn);
+       fn = getoldindexfname(lower_hostname, diskname, timestamps, level);
+       if (stat(fn, &dir_stat) == 0 && S_ISREG(dir_stat.st_mode)) {
+           amfree(lower_hostname);
+           return fn;
+       }
+    }
+    amfree(lower_hostname);
+    return NULL;
+}
index b04dcff2732460737404b2c7e831dcc6c8ec90ad..1ead3ae917d86f42a8ef2409c2728e64f80431f5 100644 (file)
@@ -24,7 +24,7 @@
  * file named AUTHORS, in the root directory of this distribution.
  */
 /*
- * $Id: amlabel.c,v 1.53.2.2 2007/02/06 14:07:44 martinea Exp $
+ * $Id: amlabel.c,v 1.53 2006/07/25 18:27:57 martinea Exp $
  *
  * write an Amanda label on a tape
  */
@@ -102,7 +102,7 @@ main(
 
     erroutput_type = ERR_INTERACTIVE;
 
-    parse_server_conf(argc, argv, &new_argc, &new_argv);
+    parse_conf(argc, argv, &new_argc, &new_argv);
 
     if(new_argc > 1 && strcmp(new_argv[1],"-f") == 0)
         force=1;
index f00c348e482f1d839027bcd931f2bd2649261f60..0132fd0aebfaec8cb46ae1b72186a8140ff20b03 100644 (file)
@@ -69,7 +69,7 @@ int main(int argc, char **argv)
        /*NOTREACHED*/
     }
 
-    parse_server_conf(argc, argv, &new_argc, &new_argv);
+    parse_conf(argc, argv, &new_argc, &new_argv);
     my_argc = new_argc;
     my_argv = new_argv;
 
@@ -156,13 +156,10 @@ void handle_start(void)
        ch = *s++;
 
        skip_whitespace(s, ch);
-#define sc "date"
-       if(ch == '\0' || strncmp(s - 1, sc, SIZEOF(sc)-1) != 0) {
+       if(ch == '\0' || strncmp_const_skip(s - 1, "date", s, ch) != 0) {
            return;                             /* ignore bogus line */
        }
-       s += SIZEOF(sc) - 1;
-       ch = s[-1];
-#undef sc
+
        skip_whitespace(s, ch);
        if(ch == '\0') {
            return;
index 07fdb975d3a4b0a251711596e02f18aad1f2e57b..a6f7bf6793220dfa4acf2eb3161e7973acf75056 100644 (file)
@@ -104,7 +104,7 @@ my $dlfh = new FileHandle "$amadmin $opt_config disklist|" or
     die "$0: error in opening `$amadmin $opt_config disklist' pipe: $!\n";
 $/ = "";
 while (<$dlfh>) {
-    ($host, $disk) = m/    host (.*?):.*    disk (.*?):/s;
+    ($host, $disk) = m/    host (.*?):.*    disk (.*?):.*strategy (STANDARD|NOFULL|NOINC|HANOI|INCRONLY).*ignore NO/s;
     next unless $host;
     $disks{$host}{$disk}++;
 }
index 7edfb1065297e8033bd0fc842cfaeb7b182cc0d2..db853d0091b7a29a98d38e77f24ce0a1f0fc4393 100644 (file)
@@ -1,4 +1,4 @@
-#!@PERL@ -w
+#!@PERL@ -Tw
 #
 
 # Run perl.
@@ -302,7 +302,7 @@ while(<AMDUMP>) {
                        $degr_level{$hostpart}=-1;
                }
        }
-       elsif(/^DUMP (\S+) (\S+) (\S+) (\S+) (\d+) (\d+) \d+:\d+:\d+:\d+:\d+:\d+ (\d+) \d+/) {
+       elsif(/^DUMP (\S+) (\S+) (\S+) (\S+) (\d+) (\d+) \d+:\d+:\d+:\d+:\d+:\d+ \d+ (\d+) \d+/) {
                if($generating_schedule == 1 ) {
                        $host=$1;
                        $features=$2;
@@ -331,7 +331,7 @@ while(<AMDUMP>) {
                        $degr_size{$hostpart}=32 if ($7 < 32);
                }
        }
-       elsif(/^DUMP (\S+) (\S+) (\S+) (\d+) (\d+) \d+:\d+:\d+:\d+:\d+:\d+ (\d+) \d+ (\d+) \d+:\d+:\d+:\d+:\d+:\d+ ([-]*\d+) \d+/) {
+       elsif(/^DUMP (\S+) (\S+) (\S+) (\d+) (\d+) \d+:\d+:\d+:\d+:\d+:\d+ \d+ (\d+) \d+ (\d+) \d+:\d+:\d+:\d+:\d+:\d+ [-]*\d+ ([-]*\d+) \d+/) {
                if($generating_schedule == 1 ) {
                        $host=$1;
                        $partition=$2;
@@ -407,7 +407,7 @@ while(<AMDUMP>) {
                $serial=$4;
                $serial{$serial}=$hostpart;
                #$chunk_started{$hostpart}=1;
-               #$chunk_time{$hostpart}=$1;
+               $chunk_time{$hostpart}=$1;
                #$chunk_finished{$hostpart}=0;
                $holding_file{$hostpart}=$5;
        }
@@ -421,7 +421,7 @@ while(<AMDUMP>) {
                $serial=$4;
                $serial{$serial}=$hostpart;
                #$chunk_started{$hostpart}=1;
-               #$chunk_time{$hostpart}=$1;
+               $chunk_time{$hostpart}=$1;
                #$chunk_finished{$hostpart}=0;
                $holding_file{$hostpart}=$5;
        }
@@ -552,9 +552,9 @@ while(<AMDUMP>) {
                $hostpart=$serial{$serial};
                $size{$hostpart}=$outputsize;
                $dump_finished{$hostpart}=1;
-               $busy_time{$2}+=($1-$dump_time{$hostpart});
+               $busy_time{$2}+=($1-$chunk_time{$hostpart});
                $running_dumper{$2} = "0";
-               $dump_time{$hostpart}=$1;
+               $chunk_time{$hostpart}=$1;
                $error{$hostpart}="";
                if ($3 eq "PARTIAL") {
                        $partial{$hostpart} = 1;
@@ -763,9 +763,9 @@ while(<AMDUMP>) {
        }
        elsif(/splitting chunk that started at \d*kb after (\d*)kb/) {
                $ntchunk{$nb_tape}++;
-               $ntsize{$nb_tape} += $1;
-               $ntesize{$nb_tape} += $1;
-               $ntchunk_size += $1;
+               $ntsize{$nb_tape} += $1 / $unitdivisor;
+               $ntesize{$nb_tape} += $1 / $unitdivisor;
+               $ntchunk_size += $1 / $unitdivisor;
        }
        elsif(/driver: FINISHED/) {
                $driver_finished = 1;
@@ -863,7 +863,7 @@ foreach $host (sort @hosts) {
                                                        (defined $opt_gestimate && $partialestimate{$hostpart} == 1)) {
                                                        printf "%8s ", $datestamp if defined $opt_date;
                                                        printf "%-${maxnamelength}s", "$host:$partition";
-                                                       printf "%2d",  $level{$hostpart};
+                                                       printf "%2d ",  $level{$hostpart};
                                                        printf "%9d$unit", $esize{$hostpart};
                                                        if($partialestimate{$hostpart} == 1) {
                                                                print " partial";
@@ -884,7 +884,7 @@ foreach $host (sort @hosts) {
                                        elsif (!defined $dump_started{$hostpart} || $dump_started{$hostpart} == 0) {
                                                if( defined $opt_failed) {
                                                        printf "%8s ", $datestamp if defined $opt_date;
-                                                       printf "%-${maxnamelength}s%2d", "$host:$partition", $level{$hostpart};
+                                                       printf "%-${maxnamelength}s%2d ", "$host:$partition", $level{$hostpart};
                                                        printf "           no estimate\n";
                                                }
                                                $exit_status |= $STATUS_FAILED;
@@ -914,7 +914,7 @@ foreach $host (sort @hosts) {
                                                        $dump_finished{$hostpart} == -1) {
                                                if(defined $opt_failed) {
                                                        printf "%8s ", $datestamp if defined $opt_date;
-                                                       printf "%-${maxnamelength}s%2d", "$host:$partition", $level{$hostpart};
+                                                       printf "%-${maxnamelength}s%2d ", "$host:$partition", $level{$hostpart};
                                                        printf "%9d$unit", $esize{$hostpart};
                                                        print " dump to tape failed: " . $error{$hostpart};
                                                        print "\n";
@@ -929,7 +929,7 @@ foreach $host (sort @hosts) {
                                                        $taper_started{$hostpart} == 1) {
                                                if( defined $opt_dumpingtape ) {
                                                        printf "%8s ", $datestamp if defined $opt_date;
-                                                       printf "%-${maxnamelength}s%2d", "$host:$partition", $level{$hostpart};
+                                                       printf "%-${maxnamelength}s%2d ", "$host:$partition", $level{$hostpart};
                                                        printf "%9d$unit", $esize{$hostpart};
                                                        print " dumping to tape";
                                                        if( defined $starttime ) {
@@ -943,7 +943,7 @@ foreach $host (sort @hosts) {
                                        elsif($taper_finished{$hostpart} == 0) {
                                                if( defined $opt_writingtape ) {
                                                        printf "%8s ", $datestamp if defined $opt_date;
-                                                       printf "%-${maxnamelength}s%2d", "$host:$partition", $level{$hostpart};
+                                                       printf "%-${maxnamelength}s%2d ", "$host:$partition", $level{$hostpart};
                                                        printf "%9d$unit", $size{$hostpart};
                                                        if($in_flush == 0) {
                                                                print " writing to tape";
@@ -987,7 +987,7 @@ foreach $host (sort @hosts) {
                                                if( defined $opt_failed  ||
                                                         (defined $opt_waittaper && ($taper_finished{$hostpart} == -1))) {
                                                        printf "%8s ", $datestamp if defined $opt_date;
-                                                       printf "%-${maxnamelength}s%2d", "$host:$partition", $level{$hostpart};
+                                                       printf "%-${maxnamelength}s%2d ", "$host:$partition", $level{$hostpart};
                                                        printf "%9d$unit", $xsize;
                                                        if($in_flush == 0) {
                                                                print " failed to tape";
@@ -1020,7 +1020,7 @@ foreach $host (sort @hosts) {
                                        elsif($taper_finished{$hostpart} == 1) {
                                                if( defined $opt_finished ) {
                                                        printf "%8s ", $datestamp if defined $opt_date;
-                                                       printf "%-${maxnamelength}s%2d", "$host:$partition", $level{$hostpart};
+                                                       printf "%-${maxnamelength}s%2d ", "$host:$partition", $level{$hostpart};
                                                        printf "%9d$unit", $size{$hostpart};
                                                        if($in_flush == 0) {
                                                                print " finished";
@@ -1048,7 +1048,7 @@ foreach $host (sort @hosts) {
                                        }
                                        else {
                                                printf "%8s ", $datestamp if defined $opt_date;
-                                               printf "%-${maxnamelength}s%2d", "$host:$partition", $level{$hostpart};
+                                               printf "%-${maxnamelength}s%2d ", "$host:$partition", $level{$hostpart};
                                                print " unknown state TAPER\n";
                                        }
                                }
@@ -1056,7 +1056,7 @@ foreach $host (sort @hosts) {
                                        if($dump_started{$hostpart} == -1) {
                                                if( defined $opt_failed ) {
                                                        printf "%8s ", $datestamp if defined $opt_date;
-                                                       printf "%-${maxnamelength}s%2d", "$host:$partition", $level{$hostpart};
+                                                       printf "%-${maxnamelength}s%2d ", "$host:$partition", $level{$hostpart};
                                                        printf " " . $error{$hostpart} . "\n";
                                                }
                                                $exit_status |= $STATUS_FAILED;
@@ -1068,7 +1068,7 @@ foreach $host (sort @hosts) {
                                                if($estimate{$hostpart} == 1) {
                                                        if( defined $opt_waitdumping ) {
                                                                printf "%8s ", $datestamp if defined $opt_date;
-                                                               printf "%-${maxnamelength}s%2d", "$host:$partition", $level{$hostpart};
+                                                               printf "%-${maxnamelength}s%2d ", "$host:$partition", $level{$hostpart};
                                                                printf "%9d$unit", $esize{$hostpart};
                                                                print " wait for dumping $error{$hostpart}\n";
                                                        }
@@ -1083,7 +1083,7 @@ foreach $host (sort @hosts) {
                                                        $dump_finished{$hostpart} == -1) {
                                                if( defined $opt_failed ) {
                                                        printf "%8s ", $datestamp if defined $opt_date;
-                                                       printf "%-${maxnamelength}s%2d", "$host:$partition", $level{$hostpart};
+                                                       printf "%-${maxnamelength}s%2d ", "$host:$partition", $level{$hostpart};
                                                        print " ", $error{$hostpart};
                                                        if( defined $starttime ) {
                                                                print " (", &showtime($dump_time{$hostpart}), ")";
@@ -1098,7 +1098,7 @@ foreach $host (sort @hosts) {
                                                        $dump_finished{$hostpart} != 1) {
                                                if( defined $opt_dumping ) {
                                                        printf "%8s ", $datestamp if defined $opt_date;
-                                                       printf "%-${maxnamelength}s%2d", "$host:$partition", $level{$hostpart};
+                                                       printf "%-${maxnamelength}s%2d ", "$host:$partition", $level{$hostpart};
                                                        printf "%9d$unit", $esize{$hostpart};
                                                        printf " dumping %8d$unit", $size{$hostpart};
                                                        if($size{$hostpart} != 0) {
@@ -1120,7 +1120,7 @@ foreach $host (sort @hosts) {
                                                        $taper_started{$hostpart} != 1) {
                                                if( defined $opt_waittaper ) {
                                                        printf "%8s ", $datestamp if defined $opt_date;
-                                                       printf "%-${maxnamelength}s%2d", "$host:$partition", $level{$hostpart};
+                                                       printf "%-${maxnamelength}s%2d ", "$host:$partition", $level{$hostpart};
                                                        printf "%9d$unit", $size{$hostpart};
                                                        print " dump done";
                                                        if( defined $starttime ) {
@@ -1142,14 +1142,14 @@ foreach $host (sort @hosts) {
                                        }
                                        else {
                                                printf "%8s ", $datestamp if defined $opt_date;
-                                               printf "%-${maxnamelength}s%2d", "$host:$partition", $level{$hostpart};
+                                               printf "%-${maxnamelength}s%2d ", "$host:$partition", $level{$hostpart};
                                                print " unknown state DUMPER\n";
                                        }
                                }
                                elsif(defined $flush{$hostpart}) {
                                        if( defined $opt_waittaper ) {
                                                printf "%8s ", $datestamp if defined $opt_date;
-                                               printf "%-${maxnamelength}s%2d", "$host:$partition", $level{$hostpart};
+                                               printf "%-${maxnamelength}s%2d ", "$host:$partition", $level{$hostpart};
                                                printf "%9d$unit", $size{$hostpart};
                                                print " waiting to flush";
                                                if(defined $partial{$hostpart} && $partial{$hostpart} == 1) {
@@ -1163,7 +1163,7 @@ foreach $host (sort @hosts) {
                                }
                                elsif(defined $level{$hostpart}) {
                                        printf "%8s ", $datestamp if defined $opt_date;
-                                       printf "%-${maxnamelength}s%2d", "$host:$partition", $level{$hostpart};
+                                       printf "%-${maxnamelength}s%2d ", "$host:$partition", $level{$hostpart};
                                        print " unknown state\n";
                                }
                        }
index 8f3cee1a4839292b229b4b8e4117f3358a99a201..4075ea44e2ef75d78c46a868e0d1cd60c7d5d506 100644 (file)
@@ -24,7 +24,7 @@
  * file named AUTHORS, in the root directory of this distribution.
  */
 /*
- * $Id: amtape.c,v 1.47.2.2 2006/10/30 12:00:19 martinea Exp $
+ * $Id: amtape.c,v 1.47 2006/07/25 18:27:57 martinea Exp $
  *
  * tape changer interface program
  */
@@ -142,7 +142,7 @@ main(
 
     erroutput_type = ERR_INTERACTIVE;
 
-    parse_server_conf(argc, argv, &new_argc, &new_argv);
+    parse_conf(argc, argv, &new_argc, &new_argv);
     if(new_argc < 3) usage();
 
     config_name = new_argv[1];
index c3e511cf3b68eac7d631bb8d902b80d2c3237849..e30a1d5968344720e5891068403c6a5529abe56d 100644 (file)
@@ -84,7 +84,7 @@ int main(int argc, char **argv)
     dbopen(DBG_SUBDIR_SERVER);
     dbprintf(("%s: version %s\n", argv[0], version()));
 
-    parse_server_conf(argc, argv, &new_argc, &new_argv);
+    parse_conf(argc, argv, &new_argc, &new_argv);
     my_argc = new_argc;
     my_argv = new_argv;
 
index 5afef3b0028714cd3b825baa6928ddc5b6213c93..691eb9e1e9d7a372d64ad15f33172c273f79d438 100644 (file)
@@ -80,7 +80,7 @@ main(
     /* Don't die when child closes pipe */
     signal(SIGPIPE, SIG_IGN);
 
-    parse_server_conf(argc, argv, &new_argc, &new_argv);
+    parse_conf(argc, argv, &new_argc, &new_argv);
     my_argc = new_argc;
     my_argv = new_argv;
 
index 451da620e326402a210325a1c8bc8021def936b8..21e111d4a7ba7441adaa3df6eb82e0465aab003b 100644 (file)
@@ -373,8 +373,15 @@ while [ $SLOT -lt $SLOTS ]; do
        fi
        report "Using device $DEVICE"
        $Echon "Waiting for device to go ready..."
-       until eval $DEVICE_READY >/dev/null 2>&1; do
+       count=1800
+       until eval $DEVICE_READY > $TEMP/ammt.out 2>&1; do
+               [ count -lt 0 ] \
+                       && report "Device not ready" \
+                       && report "`cat $TEMP/ammt.out`" \
+                       && report cat $TEMP/ammt.out >> $DEFECTS \
+                       && break;
                sleep 3
+               count=`expr $count - 3`
        done
        $Echon "Rewinding..."
        ERRORS=0
@@ -424,8 +431,15 @@ while [ $SLOT -lt $SLOTS ]; do
                if [ $Echon = echon ]; then
                        $Echon "Waiting for device to go ready..."
                fi
-               until eval $DEVICE_READY >/dev/null 2>&1; do
+               count=1800
+               until eval $DEVICE_READY > $TEMP/ammt.out 2>&1; do
+                       [ count -lt 0 ] \
+                               && report "Device not ready" \
+                               && report "`cat $TEMP/ammt.out`" \
+                               && report cat $TEMP/ammt.out >> $DEFECTS \
+                               && break;
                        sleep 3
+                       count=`expr $count - 3`
                done
                if [ $Echon = echon ]; then
                        $Echon "Reading..."
index 0e4c36d8ac2ff406c9f714c4ddfb32e7b27b8e15..84ea94296576f5bce504aff4b72bb562352e9b8b 100644 (file)
@@ -24,7 +24,7 @@
  * file named AUTHORS, in the root directory of this distribution.
  */
 /*
- * $Id: changer.c,v 1.36.2.2 2007/01/25 19:47:37 martinea Exp $
+ * $Id: changer.c,v 1.36 2006/08/24 01:57:16 paddy_s Exp $
  *
  * interface routines for tape changers
  */
index 8d89fd74d08da3e70c9735e9d13d4c5b85e80aaa..043edba80ea9b7147d2784b83190c8fca26fdc74 100644 (file)
 #include "util.h"
 #include "holding.h"
 
+#define chunker_debug(i,x) do {                \
+       if ((i) <= debug_chunker) {     \
+           dbprintf(x);                \
+       }                               \
+} while (0)
+
 #ifndef SEEK_SET
 #define SEEK_SET 0
 #endif
@@ -137,7 +143,7 @@ main(
     erroutput_type = (ERR_AMANDALOG|ERR_INTERACTIVE);
     set_logerror(logerror);
 
-    parse_server_conf(main_argc, main_argv, &new_argc, &new_argv);
+    parse_conf(main_argc, main_argv, &new_argc, &new_argv);
     my_argc = new_argc;
     my_argv = new_argv;
 
@@ -877,7 +883,7 @@ common_exit:
 
 
 /*
- * Send an Amanda dump header to the output file.
+ * Send an Amanda dump header to the output file and set file->blocksize
  */
 static ssize_t
 write_tapeheader(
diff --git a/server-src/cmdline.c b/server-src/cmdline.c
new file mode 100644 (file)
index 0000000..74c4079
--- /dev/null
@@ -0,0 +1,237 @@
+/*
+ * Copyright (c) 2005 Zmanda Inc.  All Rights Reserved.
+ * 
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * for more details.
+ * 
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ * 
+ * Contact information: Zmanda Inc, 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ *
+ * Author: Dustin J. Mitchell <dustin@zmanda.com>
+ */
+/*
+ * $Id$
+ *
+ * Utility routines for handling command lines.
+ */
+
+#include <ctype.h>
+#include "amanda.h"
+#include "cmdline.h"
+#include "holding.h"
+
+dumpspec_t *
+dumpspec_new(
+    char *host, 
+    char *disk, 
+    char *datestamp)
+{
+    dumpspec_t *rv;
+
+    rv = calloc(1, sizeof(*rv));
+    if (!rv) return NULL;
+    if (host) rv->host = stralloc(host);
+    if (disk) rv->disk = stralloc(disk);
+    if (datestamp) rv->datestamp = stralloc(datestamp);
+
+    return rv;
+}
+
+void
+dumpspec_free(
+    dumpspec_t *dumpspec)
+{
+    if (!dumpspec) return;
+    if (dumpspec->host) free(dumpspec->host);
+    if (dumpspec->disk) free(dumpspec->disk);
+    if (dumpspec->datestamp) free(dumpspec->datestamp);
+    free(dumpspec);
+}
+
+void
+dumpspec_free_list(
+    dumpspec_list_t *dumpspec_list)
+{
+    dumpspec_t *dumpspec = (dumpspec_t *)dumpspec_list;
+    dumpspec_t *next;
+
+    while (dumpspec) {
+        next = dumpspec->next;
+        dumpspec_free(dumpspec);
+        dumpspec = next;
+    }
+}
+
+dumpspec_list_t *
+cmdline_parse_dumpspecs(
+    int argc,
+    char **argv)
+{
+    dumpspec_t *dumpspec = NULL, *t;
+    char *errstr;
+    char *name;
+    int optind = 0;
+    enum { ARG_GET_HOST, ARG_GET_DISK, ARG_GET_DATE } arg_state = ARG_GET_HOST;
+
+    while (optind < argc) {
+        name = argv[optind++];
+        switch (arg_state) {
+            case ARG_GET_HOST:
+                if (name[0] != '\0'
+                    && (errstr=validate_regexp(name)) != NULL) {
+                    fprintf(stderr, _("%s: bad hostname regex \"%s\": %s\n"),
+                                   get_pname(), name, errstr);
+                    goto error;
+                }
+                t = dumpspec_new(name, NULL, NULL);
+                t->next = (dumpspec_t *)dumpspec;
+                dumpspec = t;
+                arg_state = ARG_GET_DISK;
+                break;
+
+            case ARG_GET_DISK:
+                if (name[0] != '\0'
+                    && (errstr=validate_regexp(name)) != NULL) {
+                    fprintf(stderr, _("%s: bad diskname regex \"%s\": %s\n"),
+                                   get_pname(), name, errstr);
+                    goto error;
+                }
+                dumpspec->disk = stralloc(name);
+                arg_state = ARG_GET_DATE;
+                break;
+
+            case ARG_GET_DATE:
+                if (name[0] != '\0'
+                    && (errstr=validate_regexp(name)) != NULL) {
+                    fprintf(stderr, _("%s: bad datestamp regex \"%s\": %s\n"),
+                                   get_pname(), name, errstr);
+                    goto error;
+                }
+                dumpspec->datestamp = stralloc(name);
+                arg_state = ARG_GET_HOST;
+                break;
+        }
+    }
+
+    if (dumpspec == NULL) 
+        dumpspec = dumpspec_new("", "", "");
+    return (dumpspec_list_t *)dumpspec;
+
+error:
+    dumpspec_free_list((dumpspec_list_t *)dumpspec);
+    return NULL;
+}
+
+char *
+cmdline_format_dumpspec(
+    dumpspec_t *dumpspec)
+{
+    if (!dumpspec) return NULL;
+    return cmdline_format_dumpspec_components(
+        dumpspec->host,
+        dumpspec->disk,
+        dumpspec->datestamp);
+}
+
+/* Quote str for shell interpretation, being conservative.
+ * Any non-alphanumeric charcacters other than '.' and '/'
+ * trigger surrounding single quotes, and single quotes and
+ * backslashes within those single quotes are escaped.
+ */
+static char *
+quote_dumpspec_string(char *str)
+{
+    char *rv;
+    char *p, *q;
+    int len = 0;
+    int need_single_quotes = 0;
+
+    for (p = str; *p; p++) {
+        if (!isalnum(*p) && *p != '.' && *p != '/') need_single_quotes=1;
+        if (*p == '\'' || *p == '\\') len++; /* extra byte for '\' */
+        len++;
+    }
+    if (need_single_quotes) len += 2;
+
+    q = rv = malloc(len+1);
+    if (need_single_quotes) *(q++) = '\'';
+    for (p = str; *p; p++) {
+        if (*p == '\'' || *p == '\\') *(q++) = '\\';
+        *(q++) = *p;
+    }
+    if (need_single_quotes) *(q++) = '\'';
+    *(q++) = '\0';
+
+    return rv;
+}
+
+char *
+cmdline_format_dumpspec_components(
+    char *host,
+    char *disk,
+    char *datestamp)
+{
+    char *rv = NULL;
+
+    host = host? quote_dumpspec_string(host):NULL;
+    disk = disk? quote_dumpspec_string(disk):NULL;
+    datestamp = datestamp? quote_dumpspec_string(datestamp):NULL;
+
+    if (host) {
+        rv = host;
+        if (disk) {
+            rv = newvstralloc(rv, rv, " ", disk, NULL);
+            amfree(disk);
+            if (datestamp) {
+                rv = newvstralloc(rv, rv, " ", datestamp, NULL);
+                amfree(datestamp);
+            }
+        }
+    }
+    if (disk) amfree(disk);
+    if (datestamp) amfree(datestamp);
+
+    return rv;
+}
+
+sl_t *
+cmdline_match_holding(
+    dumpspec_list_t *dumpspec_list)
+{
+    char *host;
+    char *disk;
+    char *datestamp;
+    filetype_t filetype;
+    dumpspec_t *de;
+    sl_t *holding_files;
+    sle_t *he;
+    sl_t *matching_files = new_sl();
+
+    holding_set_verbosity(0);
+    holding_files = holding_get_files(NULL, NULL, 1);
+
+    for (he = holding_files->first; he != NULL; he = he->next) {
+        filetype = holding_file_read_header(he->name, &host, &disk, NULL, &datestamp);
+        if (filetype != F_DUMPFILE) continue;
+        for (de = (dumpspec_t *)dumpspec_list; de != NULL; de = de->next) {
+            if (de->host && !match_host(de->host, host)) continue;
+            if (de->disk && !match_disk(de->disk, disk)) continue;
+            if (de->datestamp && !match_datestamp(de->datestamp, datestamp)) continue;
+            matching_files = insert_sort_sl(matching_files, he->name);
+            break;
+        }
+    }
+
+    return matching_files;
+}
diff --git a/server-src/cmdline.h b/server-src/cmdline.h
new file mode 100644 (file)
index 0000000..f3c20a3
--- /dev/null
@@ -0,0 +1,165 @@
+/*
+ * Copyright (c) 2005 Zmanda Inc.  All Rights Reserved.
+ * 
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * for more details.
+ * 
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+ * 
+ * Contact information: Zmanda Inc, 505 N Mathlida Ave, Suite 120
+ * Sunnyvale, CA 94085, USA, or: http://www.zmanda.com
+ *
+ * Author: Dustin J. Mitchell <dustin@zmanda.com>
+ */
+/*
+ * $Id$
+ *
+ * Utility routines for handling command lines.
+ */
+
+#ifndef CMDLINE_H
+#define CMDLINE_H
+
+#include "sl.h"
+
+/* TODO: use glib's linked lists instead; dumpspec_list_t provides basic
+ * type-checking to allow that to be implemented with a simple search and
+ * replace. */
+
+/* A dumpspec can specify a particular dump (combining host, disk, and 
+ * datestamp), or can be less specific by leaving out some components.
+ * In some cases (such as selecting DLEs), the datestamp is not relevant.
+ * Functions for these cases leave the datestamp NULL.
+ */
+typedef struct dumpspec_s {
+    char *host;
+    char *disk;
+    char *datestamp;
+
+    struct dumpspec_s * next;
+} dumpspec_t;
+
+/* temporary */
+typedef dumpspec_t dumpspec_list_t;
+#define dumpspec_list_first(dsl) ((dumpspec_t *)(dsl))
+
+/*
+ * Dumpspec list management
+ */
+
+/* Create a new dumpspec with the given components
+ *
+ * @param host: host name
+ * @param disk: disk name
+ * @param datestamp: datestamp
+ * @returns: dumpspec, or NULL on error
+ */
+dumpspec_t *
+dumpspec_new(
+    char *host, 
+    char *disk, 
+    char *datestamp);
+
+/* Free memory associated with a single dumpspec.  (Does not chase 
+ * next pointers)
+ *
+ * @param dumpspec: the dumpspec to free
+ */
+void
+dumpspec_free(
+    dumpspec_t *dumpspec);
+
+/* Free memory associated with a list of dumpspecs.
+ *
+ * @param dumpspec_list: the dumpspec list to free
+ */
+void
+dumpspec_free_list(
+    dumpspec_list_t *dumpspec_list);
+
+/*
+ * Parsing
+ */
+
+/* Parse a command line matching the following syntax, and return
+ * the results as a linked list.  
+ *
+ *  [ host [ disk [ datestamp [ host [ disk [ datestamp .. ] ] ] ] ] ]
+ *
+ * If no results are specified, a dumpspec with all entries set to ""
+ * is returned; the caller may treat this as a wildcard or an error, as
+ * appropriate.
+ *
+ * Prints a message to stderr and returns NULL if an error occurs.
+ *
+ * @param argc: count of command line arguments
+ * @param argv: command line arguments
+ * @returns: dumpspec list, or NULL on error
+ */
+dumpspec_list_t *
+cmdline_parse_dumpspecs(
+    int argc,
+    char **argv);
+
+/* TODO: new name for match_disklist */
+int
+cmdline_parse_disk_list_entries(
+    int argc,
+    char **argv);
+
+/*
+ * Formatting
+ */
+
+/* Format a dumpspec into a string, with shell-compatible quoting.
+ *
+ * Caller is responsible for freeing the string.
+ *
+ * @param dumpspec: the dumpspec to format
+ * @returns: newly allocated string, or NULL on error
+ */
+char *
+cmdline_format_dumpspec(
+    dumpspec_t *dumpspec);
+
+/* Like cmdline_format_dumpspec, but with components supplied 
+ * individually.  Caller is responsible for freeing the 
+ * string.
+ *
+ * @param host: host name
+ * @param disk: disk name
+ * @param datestamp: datestamp
+ * @returns: newly allocated string, or NULL on error
+ */
+char *
+cmdline_format_dumpspec_components(
+    char *host,
+    char *disk,
+    char *datestamp);
+
+/*
+ * Searching
+ */
+
+/* TODO: use glib here too */
+
+/* Find all holding files matching the dumpspec list.  
+ *
+ * @param dumpspec_list: a list of dumpspecs
+ * @returns: a list of holding disk filenames.
+ */
+sl_t *
+cmdline_match_holding(
+    dumpspec_list_t *dumpspec_list);
+
+#endif /* CMDLINE_H */
+
diff --git a/server-src/conffile.c b/server-src/conffile.c
deleted file mode 100644 (file)
index 5be24f2..0000000
+++ /dev/null
@@ -1,2529 +0,0 @@
-/*
- * Amanda, The Advanced Maryland Automatic Network Disk Archiver
- * Copyright (c) 1991-2000 University of Maryland at College Park
- * All Rights Reserved.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of U.M. not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission.  U.M. makes no representations about the
- * suitability of this software for any purpose.  It is provided "as is"
- * without express or implied warranty.
- *
- * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Author: James da Silva, Systems Design and Analysis Group
- *                        Computer Science Department
- *                        University of Maryland at College Park
- */
-/*
- * $Id: conffile.c,v 1.156.2.9 2007/01/11 13:06:10 martinea Exp $
- *
- * read configuration file
- */
-
-#include "amanda.h"
-#include "arglist.h"
-#include "util.h"
-#include "conffile.h"
-#include "diskfile.h"
-#include "driverio.h"
-#include "clock.h"
-
-#ifdef HAVE_LIMITS_H
-#include <limits.h>
-#endif
-
-#ifndef INT_MAX
-#define INT_MAX 2147483647
-#endif
-
-/* this corresponds to the normal output of amanda, but may
- * be adapted to any spacing as you like.
- */
-ColumnInfo ColumnData[] = {
-    { "HostName",   0, 12, 12, 0, "%-*.*s", "HOSTNAME" },
-    { "Disk",       1, 11, 11, 0, "%-*.*s", "DISK" },
-    { "Level",      1, 1,  1,  0, "%*.*d",  "L" },
-    { "OrigKB",     1, 7,  0,  0, "%*.*lf", "ORIG-KB" },
-    { "OutKB",      1, 7,  0,  0, "%*.*lf", "OUT-KB" },
-    { "Compress",   1, 6,  1,  0, "%*.*lf", "COMP%" },
-    { "DumpTime",   1, 7,  7,  0, "%*.*s",  "MMM:SS" },
-    { "DumpRate",   1, 6,  1,  0, "%*.*lf", "KB/s" },
-    { "TapeTime",   1, 6,  6,  0, "%*.*s",  "MMM:SS" },
-    { "TapeRate",   1, 6,  1,  0, "%*.*lf", "KB/s" },
-    { NULL,         0, 0,  0,  0, NULL,     NULL }
-};
-
-char *config_name = NULL;
-char *config_dir = NULL;
-
-/* visible holding disk variables */
-
-holdingdisk_t *holdingdisks;
-int num_holdingdisks;
-
-long int unit_divisor = 1;
-
-/* configuration parameters */
-
-val_t server_conf[CNF_CNF];
-
-command_option_t *server_options = NULL;
-
-/* other internal variables */
-static holdingdisk_t hdcur;
-
-static tapetype_t tpcur;
-
-static dumptype_t dpcur;
-
-static interface_t ifcur;
-
-static dumptype_t *dumplist = NULL;
-static tapetype_t *tapelist = NULL;
-static interface_t *interface_list = NULL;
-
-/* predeclare local functions */
-
-char *get_token_name(tok_t);
-
-
-void validate_positive0   (t_conf_var *, val_t *);
-void validate_positive1   (t_conf_var *, val_t *);
-void validate_runspercycle(t_conf_var *, val_t *);
-void validate_bumppercent (t_conf_var *, val_t *);
-void validate_bumpmult    (t_conf_var *, val_t *);
-void validate_inparallel  (t_conf_var *, val_t *);
-void validate_displayunit (t_conf_var *, val_t *);
-void validate_reserve     (t_conf_var *, val_t *);
-void validate_use         (t_conf_var *, val_t *);
-void validate_chunksize   (t_conf_var *, val_t *);
-void validate_blocksize   (t_conf_var *, val_t *);
-
-static void init_defaults(void);
-static void read_conffile_recursively(char *filename);
-
-static int read_confline(void);
-static void get_holdingdisk(void);
-static void init_holdingdisk_defaults(void);
-static void save_holdingdisk(void);
-static void get_dumptype(void);
-static void init_dumptype_defaults(void);
-static void save_dumptype(void);
-static void copy_dumptype(void);
-static void get_tapetype(void);
-static void init_tapetype_defaults(void);
-static void save_tapetype(void);
-static void copy_tapetype(void);
-static void get_interface(void);
-static void init_interface_defaults(void);
-static void save_interface(void);
-static void copy_interface(void);
-static void get_comprate(t_conf_var *, val_t *);
-static void get_compress(t_conf_var *, val_t *);
-static void get_encrypt (t_conf_var *, val_t *);
-static void get_holding (t_conf_var *, val_t *);
-static void get_priority(t_conf_var *, val_t *);
-static void get_strategy(t_conf_var *, val_t *);
-static void get_estimate(t_conf_var *, val_t *);
-static void get_exclude (t_conf_var *, val_t *);
-/*static void get_include(t_conf_var *, val_t *);*/
-static void get_taperalgo(t_conf_var *, val_t *);
-
-keytab_t server_keytab[] = {
-    { "AMANDAD_PATH", CONF_AMANDAD_PATH },
-    { "AMRECOVER_CHANGER", CONF_AMRECOVER_CHANGER },
-    { "AMRECOVER_CHECK_LABEL", CONF_AMRECOVER_CHECK_LABEL },
-    { "AMRECOVER_DO_FSF", CONF_AMRECOVER_DO_FSF },
-    { "APPEND", CONF_APPEND },
-    { "AUTH", CONF_AUTH },
-    { "AUTO", CONF_AUTO },
-    { "AUTOFLUSH", CONF_AUTOFLUSH },
-    { "BEST", CONF_BEST },
-    { "BLOCKSIZE", CONF_BLOCKSIZE },
-    { "BUMPDAYS", CONF_BUMPDAYS },
-    { "BUMPMULT", CONF_BUMPMULT },
-    { "BUMPPERCENT", CONF_BUMPPERCENT },
-    { "BUMPSIZE", CONF_BUMPSIZE },
-    { "CALCSIZE", CONF_CALCSIZE },
-    { "CHANGERDEV", CONF_CHNGRDEV },
-    { "CHANGERFILE", CONF_CHNGRFILE },
-    { "CHUNKSIZE", CONF_CHUNKSIZE },
-    { "CLIENT", CONF_CLIENT },
-    { "CLIENT_CUSTOM_COMPRESS", CONF_CLNTCOMPPROG },
-    { "CLIENT_DECRYPT_OPTION", CONF_CLNT_DECRYPT_OPT },
-    { "CLIENT_ENCRYPT", CONF_CLNT_ENCRYPT },
-    { "CLIENT_USERNAME", CONF_CLIENT_USERNAME },
-    { "COLUMNSPEC", CONF_COLUMNSPEC },
-    { "COMMENT", CONF_COMMENT },
-    { "COMPRATE", CONF_COMPRATE },
-    { "COMPRESS", CONF_COMPRESS },
-    { "CTIMEOUT", CONF_CTIMEOUT },
-    { "CUSTOM", CONF_CUSTOM },
-    { "DEFINE", CONF_DEFINE },
-    { "DIRECTORY", CONF_DIRECTORY },
-    { "DISKFILE", CONF_DISKFILE },
-    { "DISPLAYUNIT", CONF_DISPLAYUNIT },
-    { "DTIMEOUT", CONF_DTIMEOUT },
-    { "DUMPCYCLE", CONF_DUMPCYCLE },
-    { "DUMPORDER", CONF_DUMPORDER },
-    { "DUMPTYPE", CONF_DUMPTYPE },
-    { "DUMPUSER", CONF_DUMPUSER },
-    { "ENCRYPT", CONF_ENCRYPT },
-    { "ESTIMATE", CONF_ESTIMATE },
-    { "ETIMEOUT", CONF_ETIMEOUT },
-    { "EXCLUDE", CONF_EXCLUDE },
-    { "EXCLUDE-FILE", CONF_EXCLUDE_FILE },
-    { "EXCLUDE-LIST", CONF_EXCLUDE_LIST },
-    { "FALLBACK_SPLITSIZE", CONF_FALLBACK_SPLITSIZE },
-    { "FAST", CONF_FAST },
-    { "FILE", CONF_EFILE },
-    { "FILE-PAD", CONF_FILE_PAD },
-    { "FILEMARK", CONF_FILEMARK },
-    { "FIRST", CONF_FIRST },
-    { "FIRSTFIT", CONF_FIRSTFIT },
-    { "HANOI", CONF_HANOI },
-    { "HIGH", CONF_HIGH },
-    { "HOLDINGDISK", CONF_HOLDING },
-    { "IGNORE", CONF_IGNORE },
-    { "INCLUDE", CONF_INCLUDE },
-    { "INCLUDEFILE", CONF_INCLUDEFILE },
-    { "INCRONLY", CONF_INCRONLY },
-    { "INDEX", CONF_INDEX },
-    { "INDEXDIR", CONF_INDEXDIR },
-    { "INFOFILE", CONF_INFOFILE },
-    { "INPARALLEL", CONF_INPARALLEL },
-    { "INTERFACE", CONF_INTERFACE },
-    { "KENCRYPT", CONF_KENCRYPT },
-    { "KRB5KEYTAB", CONF_KRB5KEYTAB },
-    { "KRB5PRINCIPAL", CONF_KRB5PRINCIPAL },
-    { "LABELSTR", CONF_LABELSTR },
-    { "LABEL_NEW_TAPES", CONF_LABEL_NEW_TAPES },
-    { "LARGEST", CONF_LARGEST },
-    { "LARGESTFIT", CONF_LARGESTFIT },
-    { "LAST", CONF_LAST },
-    { "LBL-TEMPL", CONF_LBL_TEMPL },
-    { "LENGTH", CONF_LENGTH },
-    { "LIST", CONF_LIST },
-    { "LOGDIR", CONF_LOGDIR },
-    { "LOW", CONF_LOW },
-    { "MAILTO", CONF_MAILTO },
-    { "MAXDUMPS", CONF_MAXDUMPS },
-    { "MAXDUMPSIZE", CONF_MAXDUMPSIZE },
-    { "MAXPROMOTEDAY", CONF_MAXPROMOTEDAY },
-    { "MEDIUM", CONF_MEDIUM },
-    { "NETUSAGE", CONF_NETUSAGE },     /* XXX - historical */
-    { "NEVER", CONF_NEVER },
-    { "NOFULL", CONF_NOFULL },
-    { "NOINC", CONF_NOINC },
-    { "NONE", CONF_NONE },
-    { "OPTIONAL", CONF_OPTIONAL },
-    { "ORG", CONF_ORG },
-    { "PRINTER", CONF_PRINTER },
-    { "PRIORITY", CONF_PRIORITY },
-    { "PROGRAM", CONF_PROGRAM },
-    { "RAWTAPEDEV", CONF_RAWTAPEDEV },
-    { "RECORD", CONF_RECORD },
-    { "REQUIRED", CONF_REQUIRED },
-    { "RESERVE", CONF_RESERVE },
-    { "RUNSPERCYCLE", CONF_RUNSPERCYCLE },
-    { "RUNTAPES", CONF_RUNTAPES },
-    { "SERVER", CONF_SERVER },
-    { "SERVER_CUSTOM_COMPRESS", CONF_SRVCOMPPROG },
-    { "SERVER_DECRYPT_OPTION", CONF_SRV_DECRYPT_OPT },
-    { "SERVER_ENCRYPT", CONF_SRV_ENCRYPT },
-    { "SKIP", CONF_SKIP },
-    { "SKIP-FULL", CONF_SKIP_FULL },
-    { "SKIP-INCR", CONF_SKIP_INCR },
-    { "SMALLEST", CONF_SMALLEST },
-    { "SPEED", CONF_SPEED },
-    { "SPLIT_DISKBUFFER", CONF_SPLIT_DISKBUFFER },
-    { "SSH_KEYS", CONF_SSH_KEYS },
-    { "STANDARD", CONF_STANDARD },
-    { "STARTTIME", CONF_STARTTIME },
-    { "STRATEGY", CONF_STRATEGY },
-    { "TAPEBUFS", CONF_TAPEBUFS },
-    { "TAPECYCLE", CONF_TAPECYCLE },
-    { "TAPEDEV", CONF_TAPEDEV },
-    { "TAPELIST", CONF_TAPELIST },
-    { "TAPERALGO", CONF_TAPERALGO },
-    { "TAPETYPE", CONF_TAPETYPE },
-    { "TAPE_SPLITSIZE", CONF_TAPE_SPLITSIZE },
-    { "TPCHANGER", CONF_TPCHANGER },
-    { "USE", CONF_USE },
-    { "USETIMESTAMPS", CONF_USETIMESTAMPS },
-    { NULL, CONF_IDENT },
-    { NULL, CONF_UNKNOWN }
-};
-
-t_conf_var server_var [] = {
-   { CONF_ORG                  , CONFTYPE_STRING   , read_string  , CNF_ORG                  , NULL },
-   { CONF_MAILTO               , CONFTYPE_STRING   , read_string  , CNF_MAILTO               , NULL },
-   { CONF_DUMPUSER             , CONFTYPE_STRING   , read_string  , CNF_DUMPUSER             , NULL },
-   { CONF_PRINTER              , CONFTYPE_STRING   , read_string  , CNF_PRINTER              , NULL },
-   { CONF_TAPEDEV              , CONFTYPE_STRING   , read_string  , CNF_TAPEDEV              , NULL },
-   { CONF_TPCHANGER            , CONFTYPE_STRING   , read_string  , CNF_TPCHANGER            , NULL },
-   { CONF_CHNGRDEV             , CONFTYPE_STRING   , read_string  , CNF_CHNGRDEV             , NULL },
-   { CONF_CHNGRFILE            , CONFTYPE_STRING   , read_string  , CNF_CHNGRFILE            , NULL },
-   { CONF_LABELSTR             , CONFTYPE_STRING   , read_string  , CNF_LABELSTR             , NULL },
-   { CONF_TAPELIST             , CONFTYPE_STRING   , read_string  , CNF_TAPELIST             , NULL },
-   { CONF_DISKFILE             , CONFTYPE_STRING   , read_string  , CNF_DISKFILE             , NULL },
-   { CONF_INFOFILE             , CONFTYPE_STRING   , read_string  , CNF_INFOFILE             , NULL },
-   { CONF_LOGDIR               , CONFTYPE_STRING   , read_string  , CNF_LOGDIR               , NULL },
-   { CONF_INDEXDIR             , CONFTYPE_STRING   , read_string  , CNF_INDEXDIR             , NULL },
-   { CONF_TAPETYPE             , CONFTYPE_IDENT    , read_ident   , CNF_TAPETYPE             , NULL },
-   { CONF_DUMPCYCLE            , CONFTYPE_INT      , read_int     , CNF_DUMPCYCLE            , validate_positive0 },
-   { CONF_RUNSPERCYCLE         , CONFTYPE_INT      , read_int     , CNF_RUNSPERCYCLE         , validate_runspercycle },
-   { CONF_RUNTAPES             , CONFTYPE_INT      , read_int     , CNF_RUNTAPES             , validate_positive0 },
-   { CONF_TAPECYCLE            , CONFTYPE_INT      , read_int     , CNF_TAPECYCLE            , validate_positive1 },
-   { CONF_BUMPDAYS             , CONFTYPE_INT      , read_int     , CNF_BUMPDAYS             , validate_positive1 },
-   { CONF_BUMPSIZE             , CONFTYPE_AM64     , read_am64    , CNF_BUMPSIZE             , validate_positive1 },
-   { CONF_BUMPPERCENT          , CONFTYPE_INT      , read_int     , CNF_BUMPPERCENT          , validate_bumppercent },
-   { CONF_BUMPMULT             , CONFTYPE_REAL     , read_real    , CNF_BUMPMULT             , validate_bumpmult },
-   { CONF_NETUSAGE             , CONFTYPE_INT      , read_int     , CNF_NETUSAGE             , validate_positive1 },
-   { CONF_INPARALLEL           , CONFTYPE_INT      , read_int     , CNF_INPARALLEL           , validate_inparallel },
-   { CONF_DUMPORDER            , CONFTYPE_STRING   , read_string  , CNF_DUMPORDER            , NULL },
-   { CONF_MAXDUMPS             , CONFTYPE_INT      , read_int     , CNF_MAXDUMPS             , validate_positive1 },
-   { CONF_ETIMEOUT             , CONFTYPE_INT      , read_int     , CNF_ETIMEOUT             , NULL },
-   { CONF_DTIMEOUT             , CONFTYPE_INT      , read_int     , CNF_DTIMEOUT             , validate_positive1 },
-   { CONF_CTIMEOUT             , CONFTYPE_INT      , read_int     , CNF_CTIMEOUT             , validate_positive1 },
-   { CONF_TAPEBUFS             , CONFTYPE_INT      , read_int     , CNF_TAPEBUFS             , validate_positive1 },
-   { CONF_RAWTAPEDEV           , CONFTYPE_STRING   , read_string  , CNF_RAWTAPEDEV           , NULL },
-   { CONF_COLUMNSPEC           , CONFTYPE_STRING   , read_string  , CNF_COLUMNSPEC           , NULL },
-   { CONF_TAPERALGO            , CONFTYPE_TAPERALGO, get_taperalgo, CNF_TAPERALGO            , NULL },
-   { CONF_DISPLAYUNIT          , CONFTYPE_STRING   , read_string  , CNF_DISPLAYUNIT          , validate_displayunit },
-   { CONF_AUTOFLUSH            , CONFTYPE_BOOL     , read_bool    , CNF_AUTOFLUSH            , NULL },
-   { CONF_RESERVE              , CONFTYPE_INT      , read_int     , CNF_RESERVE              , validate_reserve },
-   { CONF_MAXDUMPSIZE          , CONFTYPE_AM64     , read_am64    , CNF_MAXDUMPSIZE          , NULL },
-   { CONF_KRB5KEYTAB           , CONFTYPE_STRING   , read_string  , CNF_KRB5KEYTAB           , NULL },
-   { CONF_KRB5PRINCIPAL        , CONFTYPE_STRING   , read_string  , CNF_KRB5PRINCIPAL        , NULL },
-   { CONF_LABEL_NEW_TAPES      , CONFTYPE_STRING   , read_string  , CNF_LABEL_NEW_TAPES      , NULL },
-   { CONF_USETIMESTAMPS        , CONFTYPE_BOOL     , read_bool    , CNF_USETIMESTAMPS        , NULL },
-   { CONF_AMRECOVER_DO_FSF     , CONFTYPE_BOOL     , read_bool    , CNF_AMRECOVER_DO_FSF     , NULL },
-   { CONF_AMRECOVER_CHANGER    , CONFTYPE_STRING   , read_string  , CNF_AMRECOVER_CHANGER    , NULL },
-   { CONF_AMRECOVER_CHECK_LABEL, CONFTYPE_BOOL     , read_bool    , CNF_AMRECOVER_CHECK_LABEL, NULL },
-   { CONF_UNKNOWN              , CONFTYPE_INT      , NULL         , CNF_CNF                  , NULL }
-};
-
-t_conf_var tapetype_var [] = {
-   { CONF_COMMENT  , CONFTYPE_STRING, read_string, TAPETYPE_COMMENT  , NULL },
-   { CONF_LBL_TEMPL, CONFTYPE_STRING, read_string, TAPETYPE_LBL_TEMPL, NULL },
-   { CONF_BLOCKSIZE, CONFTYPE_SIZE  , read_size  , TAPETYPE_BLOCKSIZE, validate_blocksize },
-   { CONF_LENGTH   , CONFTYPE_AM64  , read_am64  , TAPETYPE_LENGTH   , validate_positive0 },
-   { CONF_FILEMARK , CONFTYPE_AM64  , read_am64  , TAPETYPE_FILEMARK , NULL },
-   { CONF_SPEED    , CONFTYPE_INT   , read_int   , TAPETYPE_SPEED    , validate_positive0 },
-   { CONF_FILE_PAD , CONFTYPE_BOOL  , read_bool  , TAPETYPE_FILE_PAD , NULL },
-   { CONF_UNKNOWN  , CONFTYPE_INT   , NULL       , TAPETYPE_TAPETYPE , NULL }
-};
-
-t_conf_var dumptype_var [] = {
-   { CONF_COMMENT           , CONFTYPE_STRING   , read_string , DUMPTYPE_COMMENT           , NULL },
-   { CONF_AUTH              , CONFTYPE_STRING   , read_string , DUMPTYPE_SECURITY_DRIVER   , NULL },
-   { CONF_BUMPDAYS          , CONFTYPE_INT      , read_int    , DUMPTYPE_BUMPDAYS          , NULL },
-   { CONF_BUMPMULT          , CONFTYPE_REAL     , read_real   , DUMPTYPE_BUMPMULT          , NULL },
-   { CONF_BUMPSIZE          , CONFTYPE_AM64     , read_am64   , DUMPTYPE_BUMPSIZE          , NULL },
-   { CONF_BUMPPERCENT       , CONFTYPE_INT      , read_int    , DUMPTYPE_BUMPPERCENT       , NULL },
-   { CONF_COMPRATE          , CONFTYPE_REAL     , get_comprate, DUMPTYPE_COMPRATE          , NULL },
-   { CONF_COMPRESS          , CONFTYPE_INT      , get_compress, DUMPTYPE_COMPRESS          , NULL },
-   { CONF_ENCRYPT           , CONFTYPE_INT      , get_encrypt , DUMPTYPE_ENCRYPT           , NULL },
-   { CONF_DUMPCYCLE         , CONFTYPE_INT      , read_int    , DUMPTYPE_DUMPCYCLE         , validate_positive0 },
-   { CONF_EXCLUDE           , CONFTYPE_EXINCLUDE, get_exclude , DUMPTYPE_EXCLUDE           , NULL },
-   { CONF_INCLUDE           , CONFTYPE_EXINCLUDE, get_exclude , DUMPTYPE_INCLUDE           , NULL },
-   { CONF_IGNORE            , CONFTYPE_BOOL     , read_bool   , DUMPTYPE_IGNORE            , NULL },
-   { CONF_HOLDING           , CONFTYPE_HOLDING  , get_holding , DUMPTYPE_HOLDINGDISK       , NULL },
-   { CONF_INDEX             , CONFTYPE_BOOL     , read_bool   , DUMPTYPE_INDEX             , NULL },
-   { CONF_KENCRYPT          , CONFTYPE_BOOL     , read_bool   , DUMPTYPE_KENCRYPT          , NULL },
-   { CONF_MAXDUMPS          , CONFTYPE_INT      , read_int    , DUMPTYPE_MAXDUMPS          , validate_positive1 },
-   { CONF_MAXPROMOTEDAY     , CONFTYPE_INT      , read_int    , DUMPTYPE_MAXPROMOTEDAY     , validate_positive0 },
-   { CONF_PRIORITY          , CONFTYPE_PRIORITY , get_priority, DUMPTYPE_PRIORITY          , NULL },
-   { CONF_PROGRAM           , CONFTYPE_STRING   , read_string , DUMPTYPE_PROGRAM           , NULL },
-   { CONF_RECORD            , CONFTYPE_BOOL     , read_bool   , DUMPTYPE_RECORD            , NULL },
-   { CONF_SKIP_FULL         , CONFTYPE_BOOL     , read_bool   , DUMPTYPE_SKIP_FULL         , NULL },
-   { CONF_SKIP_INCR         , CONFTYPE_BOOL     , read_bool   , DUMPTYPE_SKIP_INCR         , NULL },
-   { CONF_STARTTIME         , CONFTYPE_TIME     , read_time   , DUMPTYPE_STARTTIME         , NULL },
-   { CONF_STRATEGY          , CONFTYPE_INT      , get_strategy, DUMPTYPE_STRATEGY          , NULL },
-   { CONF_TAPE_SPLITSIZE    , CONFTYPE_AM64     , read_am64   , DUMPTYPE_TAPE_SPLITSIZE    , validate_positive0 },
-   { CONF_SPLIT_DISKBUFFER  , CONFTYPE_STRING   , read_string , DUMPTYPE_SPLIT_DISKBUFFER  , NULL },
-   { CONF_ESTIMATE          , CONFTYPE_INT      , get_estimate, DUMPTYPE_ESTIMATE          , NULL },
-   { CONF_SRV_ENCRYPT       , CONFTYPE_STRING   , read_string , DUMPTYPE_SRV_ENCRYPT       , NULL },
-   { CONF_CLNT_ENCRYPT      , CONFTYPE_STRING   , read_string , DUMPTYPE_CLNT_ENCRYPT      , NULL },
-   { CONF_AMANDAD_PATH      , CONFTYPE_STRING   , read_string , DUMPTYPE_AMANDAD_PATH      , NULL },
-   { CONF_CLIENT_USERNAME   , CONFTYPE_STRING   , read_string , DUMPTYPE_CLIENT_USERNAME   , NULL },
-   { CONF_SSH_KEYS          , CONFTYPE_STRING   , read_string , DUMPTYPE_SSH_KEYS          , NULL },
-   { CONF_SRVCOMPPROG       , CONFTYPE_STRING   , read_string , DUMPTYPE_SRVCOMPPROG       , NULL },
-   { CONF_CLNTCOMPPROG      , CONFTYPE_STRING   , read_string , DUMPTYPE_CLNTCOMPPROG      , NULL },
-   { CONF_FALLBACK_SPLITSIZE, CONFTYPE_AM64     , read_am64   , DUMPTYPE_FALLBACK_SPLITSIZE, NULL },
-   { CONF_SRV_DECRYPT_OPT   , CONFTYPE_STRING   , read_string , DUMPTYPE_SRV_DECRYPT_OPT   , NULL },
-   { CONF_CLNT_DECRYPT_OPT  , CONFTYPE_STRING   , read_string , DUMPTYPE_CLNT_DECRYPT_OPT  , NULL },
-   { CONF_UNKNOWN           , CONFTYPE_INT      , NULL        , DUMPTYPE_DUMPTYPE          , NULL }
-};
-
-t_conf_var holding_var [] = {
-   { CONF_DIRECTORY, CONFTYPE_STRING, read_string, HOLDING_DISKDIR  , NULL },
-   { CONF_COMMENT  , CONFTYPE_STRING, read_string, HOLDING_COMMENT  , NULL },
-   { CONF_USE      , CONFTYPE_AM64  , read_am64  , HOLDING_DISKSIZE , validate_use },
-   { CONF_CHUNKSIZE, CONFTYPE_AM64  , read_am64  , HOLDING_CHUNKSIZE, validate_chunksize },
-   { CONF_UNKNOWN  , CONFTYPE_INT   , NULL       , HOLDING_HOLDING  , NULL }
-};
-
-/*
-** ------------------------
-**  External entry points
-** ------------------------
-*/
-
-int
-read_conffile(
-    char *filename)
-{
-    interface_t *ip;
-
-    init_defaults();
-
-    /* We assume that conf_confname & conf are initialized to NULL above */
-    read_conffile_recursively(filename);
-
-    /* overwrite with command line option */
-    command_overwrite(server_options, server_var, server_keytab, server_conf,
-                     "");
-
-    if(got_parserror != -1 ) {
-       if(lookup_tapetype(server_conf[CNF_TAPETYPE].v.s) == NULL) {
-           char *save_confname = conf_confname;
-
-           conf_confname = filename;
-           if(!server_conf[CNF_TAPETYPE].seen)
-               conf_parserror("default tapetype %s not defined", server_conf[CNF_TAPETYPE].v.s);
-           else {
-               conf_line_num = server_conf[CNF_TAPETYPE].seen;
-               conf_parserror("tapetype %s not defined", server_conf[CNF_TAPETYPE].v.s);
-           }
-           conf_confname = save_confname;
-       }
-    }
-
-    ip = alloc(SIZEOF(interface_t));
-    ip->name = stralloc("default");
-    ip->seen = server_conf[CNF_NETUSAGE].seen;
-    conf_init_string(&ip->value[INTER_COMMENT], "implicit from NETUSAGE");
-    conf_init_int(&ip->value[INTER_MAXUSAGE], server_conf[CNF_NETUSAGE].v.i);
-    ip->curusage = 0;
-    ip->next = interface_list;
-    interface_list = ip;
-
-    return got_parserror;
-}
-
-void
-validate_positive0(
-    struct s_conf_var *np,
-    val_t        *val)
-{
-    switch(val->type) {
-    case CONFTYPE_INT:
-       if(val->v.i < 0)
-           conf_parserror("%s must be positive", get_token_name(np->token));
-       break;
-    case CONFTYPE_LONG:
-       if(val->v.l < 0)
-           conf_parserror("%s must be positive", get_token_name(np->token));
-       break;
-    case CONFTYPE_AM64:
-       if(val->v.am64 < 0)
-           conf_parserror("%s must be positive", get_token_name(np->token));
-       break;
-    default:
-       conf_parserror("validate_positive0 invalid type %d\n", val->type);
-    }
-}
-
-void
-validate_positive1(
-    struct s_conf_var *np,
-    val_t        *val)
-{
-    switch(val->type) {
-    case CONFTYPE_INT:
-       if(val->v.i < 1)
-           conf_parserror("%s must be positive", get_token_name(np->token));
-       break;
-    case CONFTYPE_LONG:
-       if(val->v.l < 1)
-           conf_parserror("%s must be positive", get_token_name(np->token));
-       break;
-    case CONFTYPE_AM64:
-       if(val->v.am64 < 1)
-           conf_parserror("%s must be positive", get_token_name(np->token));
-       break;
-    case CONFTYPE_TIME:
-       if(val->v.t < 1)
-           conf_parserror("%s must be positive", get_token_name(np->token));
-       break;
-    default:
-       conf_parserror("validate_positive1 invalid type %d\n", val->type);
-    }
-}
-
-void
-validate_runspercycle(
-    struct s_conf_var *np,
-    val_t        *val)
-{
-    np = np;
-    if(val->v.i < -1)
-       conf_parserror("runspercycle must be >= -1");
-}
-
-void
-validate_bumppercent(
-    struct s_conf_var *np,
-    val_t        *val)
-{
-    np = np;
-    if(val->v.i < 0 || val->v.i > 100)
-       conf_parserror("bumppercent must be between 0 and 100");
-}
-
-void
-validate_inparallel(
-    struct s_conf_var *np,
-    val_t        *val)
-{
-    np = np;
-    if(val->v.i < 1 || val->v.i >MAX_DUMPERS)
-       conf_parserror("inparallel must be between 1 and MAX_DUMPERS (%d)",
-                      MAX_DUMPERS);
-}
-
-void
-validate_bumpmult(
-    struct s_conf_var *np,
-    val_t        *val)
-{
-    np = np;
-    if(val->v.r < 0.999) {
-       conf_parserror("bumpmult must be positive");
-    }
-}
-
-void
-validate_displayunit(
-    struct s_conf_var *np,
-    val_t        *val)
-{
-    np = np;
-    if(strcmp(val->v.s, "k") == 0 ||
-       strcmp(val->v.s, "K") == 0) {
-       val->v.s[0] = (char)toupper(val->v.s[0]);
-       unit_divisor=1;
-    }
-    else if(strcmp(val->v.s, "m") == 0 ||
-       strcmp(val->v.s, "M") == 0) {
-       val->v.s[0] = (char)toupper(val->v.s[0]);
-       unit_divisor=1024;
-    }
-    else if(strcmp(val->v.s, "g") == 0 ||
-       strcmp(val->v.s, "G") == 0) {
-       val->v.s[0] = (char)toupper(val->v.s[0]);
-       unit_divisor=1024*1024;
-    }
-    else if(strcmp(val->v.s, "t") == 0 ||
-       strcmp(val->v.s, "T") == 0) {
-       val->v.s[0] = (char)toupper(val->v.s[0]);
-       unit_divisor=1024*1024*1024;
-    }
-    else {
-       conf_parserror("displayunit must be k,m,g or t.");
-    }
-}
-
-void
-validate_reserve(
-    struct s_conf_var *np,
-    val_t        *val)
-{
-    np = np;
-    if(val->v.i < 0 || val->v.i > 100)
-       conf_parserror("reserve must be between 0 and 100");
-}
-
-void
-validate_use(
-    struct s_conf_var *np,
-    val_t        *val)
-{
-    np = np;
-    val->v.am64 = am_floor(val->v.am64, DISK_BLOCK_KB);
-}
-
-void
-validate_chunksize(
-    struct s_conf_var *np,
-    val_t        *val)
-{
-    np = np;
-    if(val->v.am64 == 0) {
-       val->v.am64 = ((AM64_MAX / 1024) - (2 * DISK_BLOCK_KB));
-    }
-    else if(val->v.am64 < 0) {
-       conf_parserror("Negative chunksize ("OFF_T_FMT") is no longer supported",
-                      val->v.am64);
-    }
-    val->v.am64 = am_floor(val->v.am64, (off_t)DISK_BLOCK_KB);
-    if (val->v.am64 < 2*DISK_BLOCK_KB) {
-       conf_parserror("chunksize must be at least %dkb", 2*DISK_BLOCK_KB);
-    }
-}
-
-void
-validate_blocksize(
-    struct s_conf_var *np,
-    val_t        *val)
-{
-    np = np;
-    if(val->v.l < DISK_BLOCK_KB) {
-       conf_parserror("Tape blocksize must be at least %d KBytes",
-                 DISK_BLOCK_KB);
-    } else if(val->v.l > MAX_TAPE_BLOCK_KB) {
-       conf_parserror("Tape blocksize must not be larger than %d KBytes",
-                 MAX_TAPE_BLOCK_KB);
-    }
-}
-
-char *
-getconf_byname(
-    char *str)
-{
-    static char *tmpstr;
-    t_conf_var *np;
-    keytab_t *kt;
-    char *s;
-    char ch;
-    char *first_delim;
-    char *second_delim;
-    tapetype_t *tp;
-    dumptype_t *dp;
-    interface_t *ip;
-    holdingdisk_t *hp;
-
-    tmpstr = stralloc(str);
-    s = tmpstr;
-    while((ch = *s++) != '\0') {
-       if(islower((int)ch))
-           s[-1] = (char)toupper(ch);
-    }
-
-    first_delim = strchr(tmpstr, ':');
-    if (first_delim) {
-       *first_delim = '\0';
-       first_delim++;
-       second_delim = strchr(first_delim,':');
-       if(!second_delim) {
-           amfree(tmpstr);
-           return(NULL);
-       }
-       *second_delim = '\0';
-       second_delim++;
-
-       for(kt = server_keytab; kt->token != CONF_UNKNOWN; kt++) {
-           if(kt->keyword && strcmp(kt->keyword, second_delim) == 0)
-               break;
-       }
-
-       if(kt->token == CONF_UNKNOWN)
-           return NULL;
-
-       if (strcmp(tmpstr, "TAPETYPE") == 0) {
-           tp = lookup_tapetype(first_delim);
-           if (!tp) {
-               amfree(tmpstr);
-               return(NULL);
-           }
-           for(np = tapetype_var; np->token != CONF_UNKNOWN; np++) {
-               if(np->token == kt->token)
-                  break;
-           }
-           if (np->token == CONF_UNKNOWN) return NULL;
-           tmpstr = stralloc(conf_print(&tp->value[np->parm], 0));
-       } else if (strcmp(tmpstr, "DUMPTYPE") == 0) {
-           dp = lookup_dumptype(first_delim);
-           if (!dp) {
-               amfree(tmpstr);
-               return(NULL);
-           }
-           for(np = dumptype_var; np->token != CONF_UNKNOWN; np++) {
-               if(np->token == kt->token)
-                  break;
-           }
-           if (np->token == CONF_UNKNOWN) return NULL;
-           tmpstr = stralloc(conf_print(&dp->value[np->parm], 0));
-       } else if (strcmp(tmpstr, "HOLDINGDISK") == 0) {
-           hp = lookup_holdingdisk(first_delim);
-           if (!hp) {
-               amfree(tmpstr);
-               return(NULL);
-           }
-           for(np = holding_var; np->token != CONF_UNKNOWN; np++) {
-               if(np->token == kt->token)
-                  break;
-           }
-           if (np->token == CONF_UNKNOWN) return NULL;
-           tmpstr = stralloc(conf_print(&hp->value[np->parm], 0));
-       } else if (strcmp(tmpstr, "INTERFACE") == 0) {
-           ip = lookup_interface(first_delim);
-           if (!ip) {
-               amfree(tmpstr);
-               return(NULL);
-           }
-           for(np = holding_var; np->token != CONF_UNKNOWN; np++) {
-               if(np->token == kt->token)
-                  break;
-           }
-           if (np->token == CONF_UNKNOWN) return NULL;
-           tmpstr = stralloc(conf_print(&ip->value[np->parm], 0));
-       } else {
-           amfree(tmpstr);
-           return(NULL);
-       }
-    } else {
-       for(kt = server_keytab; kt->token != CONF_UNKNOWN; kt++) {
-           if(kt->keyword && strcmp(kt->keyword, tmpstr) == 0)
-               break;
-       }
-
-       if(kt->token == CONF_UNKNOWN)
-           return NULL;
-
-       for(np = server_var; np->token != CONF_UNKNOWN; np++) {
-           if(np->token == kt->token)
-               break;
-       }
-
-       if(np->token == CONF_UNKNOWN) return NULL;
-
-       tmpstr = stralloc(conf_print(&server_conf[np->parm], 0));
-    }
-
-    return tmpstr;
-}
-
-
-char *
-getconf_list(
-    char *listname)
-{
-    char *result = NULL;
-    tapetype_t *tp;
-    dumptype_t *dp;
-    interface_t *ip;
-    holdingdisk_t *hp;
-
-    if (strcasecmp(listname,"tapetype") == 0) {
-       result = stralloc("");
-       for(tp = tapelist; tp != NULL; tp=tp->next) {
-           result = vstrextend(&result, tp->name, "\n", NULL);
-       }
-    } else if (strcasecmp(listname,"dumptype") == 0) {
-       result = stralloc("");
-       for(dp = dumplist; dp != NULL; dp=dp->next) {
-           result = vstrextend(&result, dp->name, "\n", NULL);
-       }
-    } else if (strcasecmp(listname,"holdingdisk") == 0) {
-       result = stralloc("");
-       for(hp = holdingdisks; hp != NULL; hp=hp->next) {
-           result = vstrextend(&result, hp->name, "\n", NULL);
-       }
-    } else if (strcasecmp(listname,"interface") == 0) {
-       result = stralloc("");
-       for(ip = interface_list; ip != NULL; ip=ip->next) {
-           result = vstrextend(&result, ip->name, "\n", NULL);
-       }
-    }
-    return result;
-}
-
-
-int
-getconf_seen(
-    confparm_t parm)
-{
-    t_conf_var *np;
-    np = get_np(server_var, parm);
-    return(server_conf[np->parm].seen);
-}
-
-int
-getconf_boolean(
-    confparm_t parm)
-{
-    t_conf_var *np;
-    np = get_np(server_var, parm);
-    if (np->type != CONFTYPE_BOOL) {
-       error("getconf_boolean: np is not a CONFTYPE_BOOL");
-       /*NOTREACHED*/
-    }
-    return(server_conf[np->parm].v.i != 0);
-}
-
-int
-getconf_int(
-    confparm_t parm)
-{
-    t_conf_var *np;
-    np = get_np(server_var, parm);
-    if (np->type != CONFTYPE_INT) {
-       error("getconf_int: np is not a CONFTYPE_INT");
-       /*NOTREACHED*/
-    }
-    return(server_conf[np->parm].v.i);
-}
-
-long
-getconf_long(
-    confparm_t parm)
-{
-    t_conf_var *np;
-    np = get_np(server_var, parm);
-    if (np->type != CONFTYPE_LONG) {
-       error("getconf_long: np is not a CONFTYPE_LONG");
-       /*NOTREACHED*/
-    }
-    return(server_conf[np->parm].v.l);
-}
-
-time_t
-getconf_time(
-    confparm_t parm)
-{
-    t_conf_var *np;
-    np = get_np(server_var, parm);
-    if (np->type != CONFTYPE_TIME) {
-       error("getconf_time: np is not a CONFTYPE_TIME");
-       /*NOTREACHED*/
-    }
-    return(server_conf[np->parm].v.t);
-}
-
-ssize_t
-getconf_size(
-    confparm_t parm)
-{
-    t_conf_var *np;
-    np = get_np(server_var, parm);
-    if (np->type != CONFTYPE_SIZE) {
-       error("getconf_size: np is not a CONFTYPE_SIZE");
-       /*NOTREACHED*/
-    }
-    return(server_conf[np->parm].v.size);
-}
-
-off_t
-getconf_am64(
-    confparm_t parm)
-{
-    t_conf_var *np;
-    np = get_np(server_var, parm);
-    if (np->type != CONFTYPE_AM64) {
-       error("getconf_am64: np is not a CONFTYPE_AM64");
-       /*NOTREACHED*/
-    }
-    return(server_conf[np->parm].v.am64);
-}
-
-double
-getconf_real(
-    confparm_t parm)
-{
-    t_conf_var *np;
-    np = get_np(server_var, parm);
-    if (np->type != CONFTYPE_REAL) {
-       error("getconf_real: np is not a CONFTYPE_REAL");
-       /*NOTREACHED*/
-    }
-    return(server_conf[np->parm].v.r);
-}
-
-char *
-getconf_str(
-    confparm_t parm)
-{
-    t_conf_var *np;
-    np = get_np(server_var, parm);
-    if (np->type != CONFTYPE_STRING && np->type != CONFTYPE_IDENT) {
-       error("getconf_str: np is not a CONFTYPE_STRING|CONFTYPE_IDENT: %d", parm);
-       /*NOTREACHED*/
-    }
-    return(server_conf[np->parm].v.s);
-}
-
-int
-getconf_taperalgo(
-    confparm_t parm)
-{
-    t_conf_var *np;
-    np = get_np(server_var, parm);
-    if (np->type != CONFTYPE_TAPERALGO) {
-       error("getconf_taperalgo: np is not a CONFTYPE_TAPERALGO");
-       /*NOTREACHED*/
-    }
-    return(server_conf[np->parm].v.i);
-}
-
-holdingdisk_t *
-getconf_holdingdisks(
-    void)
-{
-    return holdingdisks;
-}
-
-dumptype_t *
-lookup_dumptype(
-    char *str)
-{
-    dumptype_t *p;
-
-    for(p = dumplist; p != NULL; p = p->next) {
-       if(strcasecmp(p->name, str) == 0) return p;
-    }
-    return NULL;
-}
-
-tapetype_t *
-lookup_tapetype(
-    char *str)
-{
-    tapetype_t *p;
-
-    for(p = tapelist; p != NULL; p = p->next) {
-       if(strcasecmp(p->name, str) == 0) return p;
-    }
-    return NULL;
-}
-
-holdingdisk_t *
-lookup_holdingdisk(
-    char *str)
-{
-    holdingdisk_t *p;
-
-    for(p = holdingdisks; p != NULL; p = p->next) {
-       if(strcasecmp(p->name, str) == 0) return p;
-    }
-    return NULL;
-}
-
-interface_t *
-lookup_interface(
-    char *str)
-{
-#ifndef __lint
-    interface_t *p;
-#endif
-
-    if (str == NULL)
-       return interface_list;
-
-#ifndef __lint
-    for (p = interface_list; p != NULL; p = p->next) {
-       if (strcasecmp(p->name, str) == 0)
-           return p;
-    }
-#endif
-    return NULL;
-}
-
-
-/*
-** ------------------------
-**  Internal routines
-** ------------------------
-*/
-
-
-static void
-init_defaults(
-    void)
-{
-    char *s;
-
-    /* defaults for exported variables */
-
-#ifdef DEFAULT_CONFIG
-    s = DEFAULT_CONFIG;
-#else
-    s = "YOUR ORG";
-#endif
-    conf_init_string(&server_conf[CNF_ORG], s);
-    conf_init_string(&server_conf[CNF_MAILTO], "operators");
-    conf_init_string(&server_conf[CNF_DUMPUSER], CLIENT_LOGIN);
-#ifdef DEFAULT_TAPE_DEVICE
-    s = DEFAULT_TAPE_DEVICE;
-#else
-    s = NULL;
-#endif
-    conf_init_string(&server_conf[CNF_TAPEDEV], s);
-#ifdef DEFAULT_CHANGER_DEVICE
-    s = DEFAULT_CHANGER_DEVICE;
-#else
-    s = "/dev/null";
-#endif
-    conf_init_string(&server_conf[CNF_CHNGRDEV], s);
-    conf_init_string(&server_conf[CNF_CHNGRFILE], "/usr/adm/amanda/changer-status");
-#ifdef DEFAULT_RAW_TAPE_DEVICE
-    s = DEFAULT_RAW_TAPE_DEVICE;
-#else
-    s = "/dev/rawft0";
-#endif
-    conf_init_string   (&server_conf[CNF_LABELSTR]             , ".*");
-    conf_init_string   (&server_conf[CNF_TAPELIST]             , "tapelist");
-    conf_init_string   (&server_conf[CNF_DISKFILE]             , "disklist");
-    conf_init_string   (&server_conf[CNF_INFOFILE]             , "/usr/adm/amanda/curinfo");
-    conf_init_string   (&server_conf[CNF_LOGDIR]               , "/usr/adm/amanda");
-    conf_init_string   (&server_conf[CNF_INDEXDIR]             , "/usr/adm/amanda/index");
-    conf_init_ident    (&server_conf[CNF_TAPETYPE]             , "EXABYTE");
-    conf_init_int      (&server_conf[CNF_DUMPCYCLE]            , 10);
-    conf_init_int      (&server_conf[CNF_RUNSPERCYCLE]         , 0);
-    conf_init_int      (&server_conf[CNF_TAPECYCLE]            , 15);
-    conf_init_int      (&server_conf[CNF_NETUSAGE]             , 300);
-    conf_init_int      (&server_conf[CNF_INPARALLEL]           , 10);
-    conf_init_string   (&server_conf[CNF_DUMPORDER]            , "ttt");
-    conf_init_int      (&server_conf[CNF_BUMPPERCENT]          , 0);
-    conf_init_am64     (&server_conf[CNF_BUMPSIZE]             , (off_t)10*1024);
-    conf_init_real     (&server_conf[CNF_BUMPMULT]             , 1.5);
-    conf_init_int      (&server_conf[CNF_BUMPDAYS]             , 2);
-    conf_init_string   (&server_conf[CNF_TPCHANGER]            , "");
-    conf_init_int      (&server_conf[CNF_RUNTAPES]             , 1);
-    conf_init_int      (&server_conf[CNF_MAXDUMPS]             , 1);
-    conf_init_int      (&server_conf[CNF_ETIMEOUT]             , 300);
-    conf_init_int      (&server_conf[CNF_DTIMEOUT]             , 1800);
-    conf_init_int      (&server_conf[CNF_CTIMEOUT]             , 30);
-    conf_init_int      (&server_conf[CNF_TAPEBUFS]             , 20);
-    conf_init_string   (&server_conf[CNF_RAWTAPEDEV]           , s);
-    conf_init_string   (&server_conf[CNF_PRINTER]              , "");
-    conf_init_bool     (&server_conf[CNF_AUTOFLUSH]            , 0);
-    conf_init_int      (&server_conf[CNF_RESERVE]              , 100);
-    conf_init_am64     (&server_conf[CNF_MAXDUMPSIZE]          , (off_t)-1);
-    conf_init_string   (&server_conf[CNF_COLUMNSPEC]           , "");
-    conf_init_bool     (&server_conf[CNF_AMRECOVER_DO_FSF]     , 1);
-    conf_init_string   (&server_conf[CNF_AMRECOVER_CHANGER]    , "");
-    conf_init_bool     (&server_conf[CNF_AMRECOVER_CHECK_LABEL], 1);
-    conf_init_taperalgo(&server_conf[CNF_TAPERALGO]            , 0);
-    conf_init_string   (&server_conf[CNF_DISPLAYUNIT]          , "k");
-    conf_init_string   (&server_conf[CNF_KRB5KEYTAB]           , "/.amanda-v5-keytab");
-    conf_init_string   (&server_conf[CNF_KRB5PRINCIPAL]        , "service/amanda");
-    conf_init_string   (&server_conf[CNF_LABEL_NEW_TAPES]      , "");
-    conf_init_bool     (&server_conf[CNF_USETIMESTAMPS]        , 0);
-
-    /* defaults for internal variables */
-
-    conf_line_num = got_parserror = 0;
-    allow_overwrites = 0;
-    token_pushed = 0;
-
-    while(holdingdisks != NULL) {
-       holdingdisk_t *hp;
-
-       hp = holdingdisks;
-       holdingdisks = holdingdisks->next;
-       amfree(hp);
-    }
-    num_holdingdisks = 0;
-
-    /* free any previously declared dump, tape and interface types */
-
-    while(dumplist != NULL) {
-       dumptype_t *dp;
-
-       dp = dumplist;
-       dumplist = dumplist->next;
-       amfree(dp);
-    }
-    while(tapelist != NULL) {
-       tapetype_t *tp;
-
-       tp = tapelist;
-       tapelist = tapelist->next;
-       amfree(tp);
-    }
-    while(interface_list != NULL) {
-       interface_t *ip;
-
-       ip = interface_list;
-       interface_list = interface_list->next;
-       amfree(ip);
-    }
-
-    /* create some predefined dumptypes for backwards compatability */
-    init_dumptype_defaults();
-    dpcur.name = stralloc("NO-COMPRESS");
-    dpcur.seen = -1;
-    conf_set_compress(&dpcur.value[DUMPTYPE_COMPRESS], COMP_NONE);
-    save_dumptype();
-
-    init_dumptype_defaults();
-    dpcur.name = stralloc("COMPRESS-FAST");
-    dpcur.seen = -1;
-    conf_set_compress(&dpcur.value[DUMPTYPE_COMPRESS], COMP_FAST);
-    save_dumptype();
-
-    init_dumptype_defaults();
-    dpcur.name = stralloc("COMPRESS-BEST");
-    dpcur.seen = -1;
-    conf_set_compress(&dpcur.value[DUMPTYPE_COMPRESS], COMP_BEST);
-    save_dumptype();
-
-    init_dumptype_defaults();
-    dpcur.name = stralloc("COMPRESS-CUST");
-    dpcur.seen = -1;
-    conf_set_compress(&dpcur.value[DUMPTYPE_COMPRESS], COMP_CUST);
-    save_dumptype();
-
-    init_dumptype_defaults();
-    dpcur.name = stralloc("SRVCOMPRESS");
-    dpcur.seen = -1;
-    conf_set_compress(&dpcur.value[DUMPTYPE_COMPRESS], COMP_SERV_FAST);
-    save_dumptype();
-
-    init_dumptype_defaults();
-    dpcur.name = stralloc("BSD-AUTH");
-    dpcur.seen = -1;
-    conf_set_string(&dpcur.value[DUMPTYPE_SECURITY_DRIVER], "BSD");
-    save_dumptype();
-
-    init_dumptype_defaults();
-    dpcur.name = stralloc("KRB4-AUTH");
-    dpcur.seen = -1;
-    conf_set_string(&dpcur.value[DUMPTYPE_SECURITY_DRIVER], "KRB4");
-    save_dumptype();
-
-    init_dumptype_defaults();
-    dpcur.name = stralloc("NO-RECORD");
-    dpcur.seen = -1;
-    conf_set_bool(&dpcur.value[DUMPTYPE_RECORD], 0);
-    save_dumptype();
-
-    init_dumptype_defaults();
-    dpcur.name = stralloc("NO-HOLD");
-    dpcur.seen = -1;
-    conf_set_holding(&dpcur.value[DUMPTYPE_HOLDINGDISK], HOLD_NEVER);
-    save_dumptype();
-
-    init_dumptype_defaults();
-    dpcur.name = stralloc("NO-FULL");
-    dpcur.seen = -1;
-    conf_set_strategy(&dpcur.value[DUMPTYPE_STRATEGY], DS_NOFULL);
-    save_dumptype();
-}
-
-static void
-read_conffile_recursively(
-    char *filename)
-{
-    /* Save globals used in read_confline(), elsewhere. */
-    int  save_line_num  = conf_line_num;
-    FILE *save_conf     = conf_conf;
-    char *save_confname = conf_confname;
-    int        rc;
-
-    if (*filename == '/' || config_dir == NULL) {
-       conf_confname = stralloc(filename);
-    } else {
-       conf_confname = stralloc2(config_dir, filename);
-    }
-
-    if((conf_conf = fopen(conf_confname, "r")) == NULL) {
-       fprintf(stderr, "could not open conf file \"%s\": %s\n", conf_confname,
-               strerror(errno));
-       amfree(conf_confname);
-       got_parserror = -1;
-       return;
-    }
-
-    conf_line_num = 0;
-
-    /* read_confline() can invoke us recursively via "includefile" */
-    do {
-       rc = read_confline();
-    } while (rc != 0);
-    afclose(conf_conf);
-
-    amfree(conf_confname);
-
-    /* Restore servers */
-    conf_line_num = save_line_num;
-    conf_conf     = save_conf;
-    conf_confname = save_confname;
-}
-
-
-/* ------------------------ */
-
-
-static int
-read_confline(
-    void)
-{
-    t_conf_var *np;
-
-    keytable = server_keytab;
-
-    conf_line_num += 1;
-    get_conftoken(CONF_ANY);
-    switch(tok) {
-    case CONF_INCLUDEFILE:
-       {
-           char *fn;
-           char *cname;
-
-           get_conftoken(CONF_STRING);
-           fn = tokenval.v.s;
-           if (*fn == '/' || config_dir == NULL) {
-               cname = stralloc(fn);
-           } else {
-               cname = stralloc2(config_dir, fn);
-           }
-           if ( cname != NULL &&  (access(cname, R_OK) == 0)) {
-               read_conffile_recursively(cname);
-               amfree(cname);
-           } else {
-               conf_parserror("cannot open %s: %s\n", fn, strerror(errno));
-           }
-           amfree(cname);
-           
-       }
-       break;
-
-    case CONF_HOLDING:
-       get_holdingdisk();
-       break;
-
-    case CONF_DEFINE:
-       get_conftoken(CONF_ANY);
-       if(tok == CONF_DUMPTYPE) get_dumptype();
-       else if(tok == CONF_TAPETYPE) get_tapetype();
-       else if(tok == CONF_INTERFACE) get_interface();
-       else conf_parserror("DUMPTYPE, INTERFACE or TAPETYPE expected");
-       break;
-
-    case CONF_NL:      /* empty line */
-       break;
-
-    case CONF_END:     /* end of file */
-       return 0;
-
-    default:
-       {
-           for(np = server_var; np->token != CONF_UNKNOWN; np++) 
-               if(np->token == tok) break;
-
-           if(np->token == CONF_UNKNOWN) {
-               conf_parserror("configuration keyword expected");
-           } else {
-               np->read_function(np, &server_conf[np->parm]);
-               if(np->validate)
-                   np->validate(np, &server_conf[np->parm]);
-           }
-       }
-    }
-    if(tok != CONF_NL)
-       get_conftoken(CONF_NL);
-    return 1;
-}
-
-static void
-get_holdingdisk(
-    void)
-{
-    char *prefix;
-    int save_overwrites;
-
-    save_overwrites = allow_overwrites;
-    allow_overwrites = 1;
-
-    init_holdingdisk_defaults();
-
-    get_conftoken(CONF_IDENT);
-    hdcur.name = stralloc(tokenval.v.s);
-    hdcur.seen = conf_line_num;
-
-    prefix = vstralloc( "HOLDINGDISK:", hdcur.name, ":", NULL);
-    read_block(server_options, holding_var, server_keytab, hdcur.value, prefix,
-              "holding disk parameter expected", 1, NULL);
-    amfree(prefix);
-    get_conftoken(CONF_NL);
-
-    hdcur.disksize = holdingdisk_get_disksize(&hdcur);
-    save_holdingdisk();
-
-    allow_overwrites = save_overwrites;
-}
-
-static void
-init_holdingdisk_defaults(
-    void)
-{
-    conf_init_string(&hdcur.value[HOLDING_COMMENT]  , "");
-    conf_init_string(&hdcur.value[HOLDING_DISKDIR]  , "");
-    conf_init_am64(&hdcur.value[HOLDING_DISKSIZE] , (off_t)0);
-                    /* 1 Gb = 1M counted in 1Kb blocks */
-    conf_init_am64(&hdcur.value[HOLDING_CHUNKSIZE], (off_t)1024*1024);
-
-    hdcur.up = (void *)0;
-    hdcur.disksize = 0LL;
-}
-
-static void
-save_holdingdisk(
-    void)
-{
-    holdingdisk_t *hp;
-
-    hp = alloc(sizeof(holdingdisk_t));
-    *hp = hdcur;
-    hp->next = holdingdisks;
-    holdingdisks = hp;
-
-    num_holdingdisks++;
-}
-
-
-dumptype_t *
-read_dumptype(
-    char *name,
-    FILE *from,
-    char *fname,
-    int *linenum)
-{
-    int save_overwrites;
-    FILE *saved_conf = NULL;
-    char *saved_fname = NULL;
-    char *prefix;
-
-    if (from) {
-       saved_conf = conf_conf;
-       conf_conf = from;
-    }
-
-    if (fname) {
-       saved_fname = conf_confname;
-       conf_confname = fname;
-    }
-
-    if (linenum)
-       conf_line_num = *linenum;
-
-    save_overwrites = allow_overwrites;
-    allow_overwrites = 1;
-
-    init_dumptype_defaults();
-    if (name) {
-       dpcur.name = name;
-    } else {
-       get_conftoken(CONF_IDENT);
-       dpcur.name = stralloc(tokenval.v.s);
-    }
-    dpcur.seen = conf_line_num;
-
-    prefix = vstralloc( "DUMPTYPE:", dpcur.name, ":", NULL);
-    read_block(server_options, dumptype_var, server_keytab, dpcur.value,
-              prefix, "dumptype parameter expected",
-              (name == NULL), *copy_dumptype);
-    amfree(prefix);
-    if(!name)
-       get_conftoken(CONF_NL);
-
-    /* XXX - there was a stupidity check in here for skip-incr and
-    ** skip-full.  This check should probably be somewhere else. */
-
-    save_dumptype();
-
-    allow_overwrites = save_overwrites;
-
-    if (linenum)
-       *linenum = conf_line_num;
-
-    if (fname)
-       conf_confname = saved_fname;
-
-    if (from)
-       conf_conf = saved_conf;
-
-    return lookup_dumptype(dpcur.name);
-}
-
-static void
-get_dumptype(void)
-{
-    read_dumptype(NULL, NULL, NULL, NULL);
-}
-
-static void
-init_dumptype_defaults(void)
-{
-    dpcur.name = NULL;
-    conf_init_string   (&dpcur.value[DUMPTYPE_COMMENT]           , "");
-    conf_init_string   (&dpcur.value[DUMPTYPE_PROGRAM]           , "DUMP");
-    conf_init_string   (&dpcur.value[DUMPTYPE_SRVCOMPPROG]       , "");
-    conf_init_string   (&dpcur.value[DUMPTYPE_CLNTCOMPPROG]      , "");
-    conf_init_string   (&dpcur.value[DUMPTYPE_SRV_ENCRYPT]       , "");
-    conf_init_string   (&dpcur.value[DUMPTYPE_CLNT_ENCRYPT]      , "");
-    conf_init_string   (&dpcur.value[DUMPTYPE_AMANDAD_PATH]      , "X");
-    conf_init_string   (&dpcur.value[DUMPTYPE_CLIENT_USERNAME]   , "X");
-    conf_init_string   (&dpcur.value[DUMPTYPE_SSH_KEYS]          , "X");
-    conf_init_string   (&dpcur.value[DUMPTYPE_SECURITY_DRIVER]   , "BSD");
-    conf_init_exinclude(&dpcur.value[DUMPTYPE_EXCLUDE]);
-    conf_init_exinclude(&dpcur.value[DUMPTYPE_INCLUDE]);
-    conf_init_priority (&dpcur.value[DUMPTYPE_PRIORITY]          , 1);
-    conf_init_int      (&dpcur.value[DUMPTYPE_DUMPCYCLE]         , server_conf[CNF_DUMPCYCLE].v.i);
-    conf_init_int      (&dpcur.value[DUMPTYPE_MAXDUMPS]          , server_conf[CNF_MAXDUMPS].v.i);
-    conf_init_int      (&dpcur.value[DUMPTYPE_MAXPROMOTEDAY]     , 10000);
-    conf_init_int      (&dpcur.value[DUMPTYPE_BUMPPERCENT]       , server_conf[CNF_BUMPPERCENT].v.i);
-    conf_init_am64     (&dpcur.value[DUMPTYPE_BUMPSIZE]          , server_conf[CNF_BUMPSIZE].v.am64);
-    conf_init_int      (&dpcur.value[DUMPTYPE_BUMPDAYS]          , server_conf[CNF_BUMPDAYS].v.i);
-    conf_init_real     (&dpcur.value[DUMPTYPE_BUMPMULT]          , server_conf[CNF_BUMPMULT].v.r);
-    conf_init_time     (&dpcur.value[DUMPTYPE_STARTTIME]         , (time_t)0);
-    conf_init_strategy (&dpcur.value[DUMPTYPE_STRATEGY]          , DS_STANDARD);
-    conf_init_estimate (&dpcur.value[DUMPTYPE_ESTIMATE]          , ES_CLIENT);
-    conf_init_compress (&dpcur.value[DUMPTYPE_COMPRESS]          , COMP_FAST);
-    conf_init_encrypt  (&dpcur.value[DUMPTYPE_ENCRYPT]           , ENCRYPT_NONE);
-    conf_init_string   (&dpcur.value[DUMPTYPE_SRV_DECRYPT_OPT]   , "-d");
-    conf_init_string   (&dpcur.value[DUMPTYPE_CLNT_DECRYPT_OPT]  , "-d");
-    conf_init_rate     (&dpcur.value[DUMPTYPE_COMPRATE]          , 0.50, 0.50);
-    conf_init_am64     (&dpcur.value[DUMPTYPE_TAPE_SPLITSIZE]    , (off_t)0);
-    conf_init_am64     (&dpcur.value[DUMPTYPE_FALLBACK_SPLITSIZE], (off_t)10 * 1024);
-    conf_init_string   (&dpcur.value[DUMPTYPE_SPLIT_DISKBUFFER]  , NULL);
-    conf_init_bool     (&dpcur.value[DUMPTYPE_RECORD]            , 1);
-    conf_init_bool     (&dpcur.value[DUMPTYPE_SKIP_INCR]         , 0);
-    conf_init_bool     (&dpcur.value[DUMPTYPE_SKIP_FULL]         , 0);
-    conf_init_holding  (&dpcur.value[DUMPTYPE_HOLDINGDISK]       , HOLD_AUTO);
-    conf_init_bool     (&dpcur.value[DUMPTYPE_KENCRYPT]          , 0);
-    conf_init_bool     (&dpcur.value[DUMPTYPE_IGNORE]            , 0);
-    conf_init_bool     (&dpcur.value[DUMPTYPE_INDEX]             , 1);
-}
-
-static void
-save_dumptype(void)
-{
-    dumptype_t *dp, *dp1;;
-
-    dp = lookup_dumptype(dpcur.name);
-
-    if(dp != (dumptype_t *)0) {
-       conf_parserror("dumptype %s already defined on line %d", dp->name, dp->seen);
-       return;
-    }
-
-    dp = alloc(sizeof(dumptype_t));
-    *dp = dpcur;
-    dp->next = NULL;
-    /* add at end of list */
-    if(!dumplist)
-       dumplist = dp;
-    else {
-       dp1 = dumplist;
-       while (dp1->next != NULL) {
-            dp1 = dp1->next;
-       }
-       dp1->next = dp;
-    }
-}
-
-static void
-copy_dumptype(void)
-{
-    dumptype_t *dt;
-    int i;
-
-    dt = lookup_dumptype(tokenval.v.s);
-
-    if(dt == NULL) {
-       conf_parserror("dumptype parameter expected");
-       return;
-    }
-
-    for(i=0; i < DUMPTYPE_DUMPTYPE; i++) {
-       if(dt->value[i].seen) {
-           free_val_t(&dpcur.value[i]);
-           copy_val_t(&dpcur.value[i], &dt->value[i]);
-       }
-    }
-}
-
-static void
-get_tapetype(void)
-{
-    int save_overwrites;
-    char *prefix;
-
-    save_overwrites = allow_overwrites;
-    allow_overwrites = 1;
-
-    init_tapetype_defaults();
-
-    get_conftoken(CONF_IDENT);
-    tpcur.name = stralloc(tokenval.v.s);
-    tpcur.seen = conf_line_num;
-
-    prefix = vstralloc( "TAPETYPE:", tpcur.name, ":", NULL);
-    read_block(server_options, tapetype_var, server_keytab, tpcur.value,
-              prefix, "tapetype parameter expected", 1, &copy_tapetype);
-    amfree(prefix);
-    get_conftoken(CONF_NL);
-
-    save_tapetype();
-
-    allow_overwrites = save_overwrites;
-}
-
-static void
-init_tapetype_defaults(void)
-{
-    conf_init_string(&tpcur.value[TAPETYPE_COMMENT]  , "");
-    conf_init_string(&tpcur.value[TAPETYPE_LBL_TEMPL], "");
-    conf_init_size  (&tpcur.value[TAPETYPE_BLOCKSIZE], DISK_BLOCK_KB);
-    conf_init_am64  (&tpcur.value[TAPETYPE_LENGTH]   , (off_t)2000);
-    conf_init_am64  (&tpcur.value[TAPETYPE_FILEMARK] , (off_t)1);
-    conf_init_int   (&tpcur.value[TAPETYPE_SPEED]    , 200);
-    conf_init_bool  (&tpcur.value[TAPETYPE_FILE_PAD] , 1);
-}
-
-static void
-save_tapetype(void)
-{
-    tapetype_t *tp, *tp1;
-
-    tp = lookup_tapetype(tpcur.name);
-
-    if(tp != (tapetype_t *)0) {
-       amfree(tpcur.name);
-       conf_parserror("tapetype %s already defined on line %d", tp->name, tp->seen);
-       return;
-    }
-
-    tp = alloc(sizeof(tapetype_t));
-    *tp = tpcur;
-    /* add at end of list */
-    if(!tapelist)
-       tapelist = tp;
-    else {
-       tp1 = tapelist;
-       while (tp1->next != NULL) {
-           tp1 = tp1->next;
-       }
-       tp1->next = tp;
-    }
-}
-
-static void
-copy_tapetype(void)
-{
-    tapetype_t *tp;
-    int i;
-
-    tp = lookup_tapetype(tokenval.v.s);
-
-    if(tp == NULL) {
-       conf_parserror("tape type parameter expected");
-       return;
-    }
-
-    for(i=0; i < TAPETYPE_TAPETYPE; i++) {
-       if(tp->value[i].seen) {
-           free_val_t(&tpcur.value[i]);
-           copy_val_t(&tpcur.value[i], &tp->value[i]);
-       }
-    }
-}
-
-t_conf_var interface_var [] = {
-   { CONF_COMMENT, CONFTYPE_STRING, read_string, INTER_COMMENT , NULL },
-   { CONF_USE    , CONFTYPE_INT   , read_int   , INTER_MAXUSAGE, validate_positive1 },
-   { CONF_UNKNOWN, CONFTYPE_INT   , NULL       , INTER_INTER   , NULL }
-};
-
-static void
-get_interface(void)
-{
-    int save_overwrites;
-    char *prefix;
-
-    save_overwrites = allow_overwrites;
-    allow_overwrites = 1;
-
-    init_interface_defaults();
-
-    get_conftoken(CONF_IDENT);
-    ifcur.name = stralloc(tokenval.v.s);
-    ifcur.seen = conf_line_num;
-
-    prefix = vstralloc( "INTERFACE:", ifcur.name, ":", NULL);
-    read_block(server_options, interface_var, server_keytab, ifcur.value,
-              prefix, "interface parameter expected", 1, &copy_interface);
-    amfree(prefix);
-    get_conftoken(CONF_NL);
-
-    save_interface();
-
-    allow_overwrites = save_overwrites;
-
-    return;
-}
-
-static void
-init_interface_defaults(void)
-{
-    conf_init_string(&ifcur.value[INTER_COMMENT] , "");
-    conf_init_int   (&ifcur.value[INTER_MAXUSAGE], 300);
-
-    ifcur.curusage = 0;
-}
-
-static void
-save_interface(void)
-{
-    interface_t *ip, *ip1;
-
-    ip = lookup_interface(ifcur.name);
-
-    if(ip != (interface_t *)0) {
-       conf_parserror("interface %s already defined on line %d", ip->name,
-                      ip->seen);
-       return;
-    }
-
-    ip = alloc(sizeof(interface_t));
-    *ip = ifcur;
-    /* add at end of list */
-    if(!interface_list) {
-       interface_list = ip;
-    } else {
-       ip1 = interface_list;
-       while (ip1->next != NULL) {
-           ip1 = ip1->next;
-       }
-       ip1->next = ip;
-    }
-}
-
-static void
-copy_interface(void)
-{
-/*
-    int i;
-    t_xxx *np;
-    keytab_t *kt;
-    
-    val_t val;
-*/
-    interface_t *ip;
-    int i;
-
-    ip = lookup_interface(tokenval.v.s);
-
-    if(ip == NULL) {
-       conf_parserror("interface parameter expected");
-       return;
-    }
-
-    for(i=0; i < INTER_INTER; i++) {
-       if(ip->value[i].seen) {
-           free_val_t(&ifcur.value[i]);
-           copy_val_t(&ifcur.value[i], &ip->value[i]);
-       }
-    }
-}
-
-static void
-get_comprate(
-    t_conf_var *np,
-    val_t *val)
-{
-    np = np;
-    get_conftoken(CONF_REAL);
-    val->v.rate[0] = tokenval.v.r;
-    val->v.rate[1] = tokenval.v.r;
-    val->seen = tokenval.seen;
-    if(tokenval.v.r < 0) {
-       conf_parserror("full compression rate must be >= 0");
-    }
-
-    get_conftoken(CONF_ANY);
-    switch(tok) {
-    case CONF_NL:
-       return;
-
-    case CONF_END:
-       return;
-
-    case CONF_COMMA:
-       break;
-
-    default:
-       unget_conftoken();
-    }
-
-    get_conftoken(CONF_REAL);
-    val->v.rate[1] = tokenval.v.r;
-    if(tokenval.v.r < 0) {
-       conf_parserror("incremental compression rate must be >= 0");
-    }
-}
-
-static void
-get_compress(
-    t_conf_var *np,
-    val_t *val)
-{
-    int serv, clie, none, fast, best, custom;
-    int done;
-    comp_t comp;
-
-    np = np;
-    ckseen(&val->seen);
-
-    serv = clie = none = fast = best = custom  = 0;
-
-    done = 0;
-    do {
-       get_conftoken(CONF_ANY);
-       switch(tok) {
-       case CONF_NONE:   none = 1; break;
-       case CONF_FAST:   fast = 1; break;
-       case CONF_BEST:   best = 1; break;
-       case CONF_CLIENT: clie = 1; break;
-       case CONF_SERVER: serv = 1; break;
-       case CONF_CUSTOM: custom=1; break;
-       case CONF_NL:     done = 1; break;
-       case CONF_END:    done = 1; break;
-       default:
-           done = 1;
-           serv = clie = 1; /* force an error */
-       }
-    } while(!done);
-
-    if(serv + clie == 0) clie = 1;     /* default to client */
-    if(none + fast + best + custom  == 0) fast = 1; /* default to fast */
-
-    comp = -1;
-
-    if(!serv && clie) {
-       if(none && !fast && !best && !custom) comp = COMP_NONE;
-       if(!none && fast && !best && !custom) comp = COMP_FAST;
-       if(!none && !fast && best && !custom) comp = COMP_BEST;
-       if(!none && !fast && !best && custom) comp = COMP_CUST;
-    }
-
-    if(serv && !clie) {
-       if(none && !fast && !best && !custom) comp = COMP_NONE;
-       if(!none && fast && !best && !custom) comp = COMP_SERV_FAST;
-       if(!none && !fast && best && !custom) comp = COMP_SERV_BEST;
-       if(!none && !fast && !best && custom) comp = COMP_SERV_CUST;
-    }
-
-    if((int)comp == -1) {
-       conf_parserror("NONE, CLIENT FAST, CLIENT BEST, CLIENT CUSTOM, SERVER FAST, SERVER BEST or SERVER CUSTOM expected");
-       comp = COMP_NONE;
-    }
-
-    val->v.i = (int)comp;
-}
-
-static void
-get_encrypt(
-    t_conf_var *np,
-    val_t *val)
-{
-   encrypt_t encrypt;
-
-   np = np;
-   ckseen(&val->seen);
-
-   get_conftoken(CONF_ANY);
-   switch(tok) {
-   case CONF_NONE:  
-     encrypt = ENCRYPT_NONE; 
-     break;
-
-   case CONF_CLIENT:  
-     encrypt = ENCRYPT_CUST;
-     break;
-
-   case CONF_SERVER: 
-     encrypt = ENCRYPT_SERV_CUST;
-     break;
-
-   default:
-     conf_parserror("NONE, CLIENT or SERVER expected");
-     encrypt = ENCRYPT_NONE;
-     break;
-   }
-
-   val->v.i = (int)encrypt;
-}
-
-static void
-get_holding(
-    t_conf_var *np,
-    val_t *val)
-{
-   dump_holdingdisk_t holding;
-
-   np = np;
-   ckseen(&val->seen);
-
-   get_conftoken(CONF_ANY);
-   switch(tok) {
-   case CONF_NEVER:  
-     holding = HOLD_NEVER; 
-     break;
-
-   case CONF_AUTO:  
-     holding = HOLD_AUTO;
-     break;
-
-   case CONF_REQUIRED: 
-     holding = HOLD_REQUIRED;
-     break;
-
-   default: /* can be a BOOLEAN */
-     unget_conftoken();
-     holding =  (dump_holdingdisk_t)get_bool();
-     if (holding == 0)
-       holding = HOLD_NEVER;
-     else if (holding == 1 || holding == 2)
-       holding = HOLD_AUTO;
-     else
-       conf_parserror("NEVER, AUTO or REQUIRED expected");
-     break;
-   }
-
-   val->v.i = (int)holding;
-}
-
-static void
-get_taperalgo(
-    t_conf_var *np,
-    val_t *val)
-{
-    np = np;
-    ckseen(&val->seen);
-
-    get_conftoken(CONF_ANY);
-    switch(tok) {
-    case CONF_FIRST:      val->v.i = ALGO_FIRST;      break;
-    case CONF_FIRSTFIT:   val->v.i = ALGO_FIRSTFIT;   break;
-    case CONF_LARGEST:    val->v.i = ALGO_LARGEST;    break;
-    case CONF_LARGESTFIT: val->v.i = ALGO_LARGESTFIT; break;
-    case CONF_SMALLEST:   val->v.i = ALGO_SMALLEST;   break;
-    case CONF_LAST:       val->v.i = ALGO_LAST;       break;
-    default:
-       conf_parserror("FIRST, FIRSTFIT, LARGEST, LARGESTFIT, SMALLEST or LAST expected");
-    }
-}
-
-static void
-get_priority(
-    t_conf_var *np,
-    val_t *val)
-{
-    int pri;
-
-    np = np;
-    ckseen(&val->seen);
-
-    get_conftoken(CONF_ANY);
-    switch(tok) {
-    case CONF_LOW: pri = 0; break;
-    case CONF_MEDIUM: pri = 1; break;
-    case CONF_HIGH: pri = 2; break;
-    case CONF_INT: pri = tokenval.v.i; break;
-    default:
-       conf_parserror("LOW, MEDIUM, HIGH or integer expected");
-       pri = 0;
-    }
-    val->v.i = pri;
-}
-
-static void
-get_strategy(
-    t_conf_var *np,
-    val_t *val)
-{
-    int strat;
-
-    np = np;
-    ckseen(&val->seen);
-
-    get_conftoken(CONF_ANY);
-    switch(tok) {
-    case CONF_SKIP:
-       strat = DS_SKIP;
-       break;
-    case CONF_STANDARD:
-       strat = DS_STANDARD;
-       break;
-    case CONF_NOFULL:
-       strat = DS_NOFULL;
-       break;
-    case CONF_NOINC:
-       strat = DS_NOINC;
-       break;
-    case CONF_HANOI:
-       strat = DS_HANOI;
-       break;
-    case CONF_INCRONLY:
-       strat = DS_INCRONLY;
-       break;
-    default:
-       conf_parserror("STANDARD or NOFULL expected");
-       strat = DS_STANDARD;
-    }
-    val->v.i = strat;
-}
-
-static void
-get_estimate(
-    t_conf_var *np,
-    val_t *val)
-{
-    int estime;
-
-    np = np;
-    ckseen(&val->seen);
-
-    get_conftoken(CONF_ANY);
-    switch(tok) {
-    case CONF_CLIENT:
-       estime = ES_CLIENT;
-       break;
-    case CONF_SERVER:
-       estime = ES_SERVER;
-       break;
-    case CONF_CALCSIZE:
-       estime = ES_CALCSIZE;
-       break;
-    default:
-       conf_parserror("CLIENT, SERVER or CALCSIZE expected");
-       estime = ES_CLIENT;
-    }
-    val->v.i = estime;
-}
-
-static void
-get_exclude(
-    t_conf_var *np,
-    val_t *val)
-{
-    int file, got_one = 0;
-    sl_t *exclude;
-    int optional = 0;
-
-    np = np;
-    get_conftoken(CONF_ANY);
-    if(tok == CONF_LIST) {
-       file = 0;
-       get_conftoken(CONF_ANY);
-       exclude = val->v.exinclude.sl_list;
-    }
-    else {
-       file = 1;
-       if(tok == CONF_EFILE) get_conftoken(CONF_ANY);
-       exclude = val->v.exinclude.sl_file;
-    }
-    ckseen(&val->seen);
-
-    if(tok == CONF_OPTIONAL) {
-       get_conftoken(CONF_ANY);
-       optional = 1;
-    }
-
-    if(tok == CONF_APPEND) {
-       get_conftoken(CONF_ANY);
-    }
-    else {
-       free_sl(exclude);
-       exclude = NULL;
-    }
-
-    while(tok == CONF_STRING) {
-       exclude = append_sl(exclude, tokenval.v.s);
-       got_one = 1;
-       get_conftoken(CONF_ANY);
-    }
-    unget_conftoken();
-
-    if(got_one == 0) { free_sl(exclude); exclude = NULL; }
-
-    if (file == 0)
-       val->v.exinclude.sl_list = exclude;
-    else
-       val->v.exinclude.sl_file = exclude;
-    val->v.exinclude.optional = optional;
-}
-
-/*
-static void get_include(np, val)
-    t_conf_var *np;
-    val_t *val;
-{
-    int list, got_one = 0;
-    sl_t *include;
-    int optional = 0;
-    int append = 0;
-
-    get_conftoken(CONF_ANY);
-    if(tok == CONF_LIST) {
-       list = 1;
-       include = dpcur.value[DUMPTYPE_INCLUDE_LIST].v.sl;
-       ckseen(&dpcur.value[DUMPTYPE_INCLUDE_LIST].seen);
-       get_conftoken(CONF_ANY);
-    }
-    else {
-       list = 0;
-       include = dpcur.value[DUMPTYPE_INCLUDE_FILE].v.sl;
-       ckseen(&dpcur.value[DUMPTYPE_INCLUDE_FILE].seen);
-       if(tok == CONF_EFILE) get_conftoken(CONF_ANY);
-    }
-
-    if(tok == CONF_OPTIONAL) {
-       get_conftoken(CONF_ANY);
-       optional = 1;
-    }
-
-    if(tok == CONF_APPEND) {
-       get_conftoken(CONF_ANY);
-       append = 1;
-    }
-    else {
-       free_sl(include);
-       include = NULL;
-       append = 0;
-    }
-
-    while(tok == CONF_STRING) {
-       include = append_sl(include, tokenval.v.s);
-       got_one = 1;
-       get_conftoken(CONF_ANY);
-    }
-    unget_conftoken();
-
-    if(got_one == 0) { free_sl(include); include = NULL; }
-
-    if(list == 0)
-       dpcur.value[DUMPTYPE_INCLUDE_FILE].v.sl = include;
-    else {
-       dpcur.value[DUMPTYPE_INCLUDE_LIST].v.sl = include;
-       if(!append || optional)
-           dpcur.value[DUMPTYPE_INCLUDE_OPTIONAL].v.i = optional;
-    }
-}
-*/
-
-/* ------------------------ */
-
-int
-ColumnDataCount(void )
-{
-    return (int)(SIZEOF(ColumnData) / SIZEOF(ColumnData[0]));
-}
-
-/* conversion from string to table index
- */
-int
-StringToColumn(
-    char *s)
-{
-    int cn;
-
-    for (cn=0; ColumnData[cn].Name != NULL; cn++) {
-       if (strcasecmp(s, ColumnData[cn].Name) == 0) {
-           break;
-       }
-    }
-    return cn;
-}
-
-char
-LastChar(
-    char *s)
-{
-    return s[strlen(s)-1];
-}
-
-int
-SetColumDataFromString(
-    ColumnInfo* ci,
-    char *s,
-    char **errstr)
-{
-#ifdef TEST
-    char *myname= "SetColumDataFromString";
-#endif
-    ci = ci;
-
-    /* Convert from a Columspec string to our internal format
-     * of columspec. The purpose is to provide this string
-     * as configuration paramter in the amanda.conf file or
-     * (maybe) as environment variable.
-     * 
-     * This text should go as comment into the sample amanda.conf
-     *
-     * The format for such a ColumnSpec string s is a ',' seperated
-     * list of triples. Each triple consists of
-     *   -the name of the column (as in ColumnData.Name)
-     *   -prefix before the column
-     *   -the width of the column
-     *       if set to -1 it will be recalculated
-     *  to the maximum length of a line to print.
-     * Example:
-     *         "Disk=1:17,HostName=1:10,OutKB=1:7"
-     * or
-     *         "Disk=1:-1,HostName=1:10,OutKB=1:7"
-     * 
-     * You need only specify those colums that should be changed from
-     * the default. If nothing is specified in the configfile, the
-     * above compiled in values will be in effect, resulting in an
-     * output as it was all the time.
-     *                                                 ElB, 1999-02-24.
-     */
-
-    while (s && *s) {
-       int Space, Width;
-       int cn;
-       char *eon= strchr(s, '=');
-
-       if (eon == NULL) {
-           *errstr = stralloc2("invalid columnspec: ", s);
-#ifdef TEST
-           fprintf(stderr, "%s: %s\n", myname, *errstr);
-#endif
-           return -1;
-       }
-       *eon= '\0';
-       cn=StringToColumn(s);
-       if (ColumnData[cn].Name == NULL) {
-           *errstr = stralloc2("invalid column name: ", s);
-#ifdef TEST
-           fprintf(stderr, "%s: %s\n", myname, *errstr);
-#endif
-           return -1;
-       }
-       if (sscanf(eon+1, "%d:%d", &Space, &Width) != 2) {
-           *errstr = stralloc2("invalid format: ", eon + 1);
-#ifdef TEST
-           fprintf(stderr, "%s: %s\n", myname, *errstr);
-#endif
-           return -1;
-       }
-       ColumnData[cn].Width= Width;
-       ColumnData[cn].PrefixSpace = Space;
-       if (LastChar(ColumnData[cn].Format) == 's') {
-           if (Width < 0)
-               ColumnData[cn].MaxWidth= 1;
-           else
-               if (Width > ColumnData[cn].Precision)
-                   ColumnData[cn].Precision= Width;
-       }
-       else if (Width < ColumnData[cn].Precision)
-           ColumnData[cn].Precision = Width;
-       s= strchr(eon+1, ',');
-       if (s != NULL)
-           s++;
-    }
-    return 0;
-}
-
-
-long int
-getconf_unit_divisor(void)
-{
-    return unit_divisor;
-}
-
-/* ------------------------ */
-
-
-void
-dump_configuration(
-    char *filename)
-{
-    tapetype_t *tp;
-    dumptype_t *dp;
-    interface_t *ip;
-    holdingdisk_t *hp;
-    int i;
-    t_conf_var *np;
-    keytab_t *kt;
-    char *prefix;
-
-    printf("AMANDA CONFIGURATION FROM FILE \"%s\":\n\n", filename);
-
-    for(i=0; i < CNF_CNF; i++) {
-       for(np=server_var; np->token != CONF_UNKNOWN; np++) {
-           if(np->parm == i)
-               break;
-       }
-       if(np->token == CONF_UNKNOWN)
-           error("server bad value");
-
-       for(kt = server_keytab; kt->token != CONF_UNKNOWN; kt++)
-           if(kt->token == np->token) break;
-       if(kt->token == CONF_UNKNOWN)
-           error("server bad token");
-
-       printf("%-21s %s\n", kt->keyword, conf_print(&server_conf[i], 1));
-    }
-
-    for(hp = holdingdisks; hp != NULL; hp = hp->next) {
-       printf("\nHOLDINGDISK %s {\n", hp->name);
-       for(i=0; i < HOLDING_HOLDING; i++) {
-           for(np=holding_var; np->token != CONF_UNKNOWN; np++) {
-               if(np->parm == i)
-                       break;
-           }
-           if(np->token == CONF_UNKNOWN)
-               error("holding bad value");
-
-           for(kt = server_keytab; kt->token != CONF_UNKNOWN; kt++) {
-               if(kt->token == np->token)
-                   break;
-           }
-           if(kt->token == CONF_UNKNOWN)
-               error("holding bad token");
-
-           printf("      %-9s %s\n", kt->keyword, conf_print(&hp->value[i], 1));
-       }
-       printf("}\n");
-    }
-
-    for(tp = tapelist; tp != NULL; tp = tp->next) {
-       printf("\nDEFINE TAPETYPE %s {\n", tp->name);
-       for(i=0; i < TAPETYPE_TAPETYPE; i++) {
-           for(np=tapetype_var; np->token != CONF_UNKNOWN; np++)
-               if(np->parm == i) break;
-           if(np->token == CONF_UNKNOWN)
-               error("tapetype bad value");
-
-           for(kt = server_keytab; kt->token != CONF_UNKNOWN; kt++)
-               if(kt->token == np->token) break;
-           if(kt->token == CONF_UNKNOWN)
-               error("tapetype bad token");
-
-           printf("      %-9s %s\n", kt->keyword, conf_print(&tp->value[i], 1));
-       }
-       printf("}\n");
-    }
-
-    for(dp = dumplist; dp != NULL; dp = dp->next) {
-       if (strncmp(dp->name, "custom(", 7) != 0) {
-           if(dp->seen == -1)
-               prefix = "#";
-           else
-               prefix = "";
-           printf("\n%sDEFINE DUMPTYPE %s {\n", prefix, dp->name);
-           for(i=0; i < DUMPTYPE_DUMPTYPE; i++) {
-               for(np=dumptype_var; np->token != CONF_UNKNOWN; np++)
-                   if(np->parm == i) break;
-               if(np->token == CONF_UNKNOWN)
-                   error("dumptype bad value");
-
-               for(kt = server_keytab; kt->token != CONF_UNKNOWN; kt++)
-                   if(kt->token == np->token) break;
-               if(kt->token == CONF_UNKNOWN)
-                   error("dumptype bad token");
-
-               if (dp->value[i].type == CONFTYPE_EXINCLUDE) {
-                   printf("%s      %-19s %s\n", prefix, kt->keyword,
-                          conf_print_exinclude(&dp->value[i], 1, 0));
-                   printf("%s      %-19s %s\n", prefix, kt->keyword,
-                          conf_print_exinclude(&dp->value[i], 1, 1));
-               } else {
-                   printf("%s      %-19s %s\n", prefix, kt->keyword,
-                          conf_print(&dp->value[i], 1));
-               }
-           }
-           printf("%s}\n", prefix);
-       }
-    }
-
-    for(ip = interface_list; ip != NULL; ip = ip->next) {
-       if(strcmp(ip->name,"default") == 0)
-           prefix = "#";
-       else
-           prefix = "";
-       printf("\n%sDEFINE INTERFACE %s {\n", prefix, ip->name);
-       for(i=0; i < INTER_INTER; i++) {
-           for(np=interface_var; np->token != CONF_UNKNOWN; np++)
-               if(np->parm == i) break;
-           if(np->token == CONF_UNKNOWN)
-               error("interface bad value");
-
-           for(kt = server_keytab; kt->token != CONF_UNKNOWN; kt++)
-               if(kt->token == np->token) break;
-           if(kt->token == CONF_UNKNOWN)
-               error("interface bad token");
-
-           printf("%s      %-9s %s\n", prefix, kt->keyword, conf_print(&ip->value[i], 1));
-       }
-       printf("%s}\n",prefix);
-    }
-
-}
-
-#ifdef TEST
-
-int
-main(
-    int argc,
-    char *argv[])
-{
-  char *conffile;
-  char *diskfile;
-  disklist_t lst;
-  int result;
-  unsigned long malloc_hist_1, malloc_size_1;
-  unsigned long malloc_hist_2, malloc_size_2;
-
-  safe_fd(-1, 0);
-
-  set_pname("conffile");
-
-  /* Don't die when child closes pipe */
-  signal(SIGPIPE, SIG_IGN);
-
-  malloc_size_1 = malloc_inuse(&malloc_hist_1);
-
-  startclock();
-
-  if (argc > 1) {
-    if (argv[1][0] == '/') {
-      config_dir = stralloc(argv[1]);
-      config_name = strrchr(config_dir, '/') + 1;
-      config_name[-1] = '\0';
-      config_dir = newstralloc2(config_dir, config_dir, "/");
-    } else {
-      config_name = stralloc(argv[1]);
-      config_dir = vstralloc(CONFIG_DIR, "/", config_name, "/", NULL);
-    }
-  } else {
-    char my_cwd[STR_SIZE];
-
-    if (getcwd(my_cwd, sizeof(my_cwd)) == NULL) {
-      error("cannot determine current working directory");
-    }
-    config_dir = stralloc2(my_cwd, "/");
-    if ((config_name = strrchr(my_cwd, '/')) != NULL) {
-      config_name = stralloc(config_name + 1);
-    }
-  }
-
-  conffile = stralloc2(config_dir, CONFFILE_NAME);
-  result = read_conffile(conffile);
-  if (result == 0) {
-      diskfile = getconf_str(CNF_DISKFILE);
-      if (diskfile != NULL && access(diskfile, R_OK) == 0) {
-         result = read_diskfile(diskfile, &lst);
-      }
-  }
-  dump_configuration(CONFFILE_NAME);
-  amfree(conffile);
-
-  malloc_size_2 = malloc_inuse(&malloc_hist_2);
-
-  if(malloc_size_1 != malloc_size_2) {
-    malloc_list(fileno(stderr), malloc_hist_1, malloc_hist_2);
-  }
-
-  return result;
-}
-
-#endif /* TEST */
-
-char *
-generic_get_security_conf(
-       char *string,
-       void *arg)
-{
-       arg = arg;
-       if(!string || !*string)
-               return(NULL);
-
-       if(strcmp(string, "krb5principal")==0) {
-               return(getconf_str(CNF_KRB5PRINCIPAL));
-       } else if(strcmp(string, "krb5keytab")==0) {
-               return(getconf_str(CNF_KRB5KEYTAB));
-       }
-       return(NULL);
-}
-
-char *
-get_token_name(
-    tok_t token)
-{
-    keytab_t *kt;
-
-    for(kt = server_keytab; kt->token != CONF_UNKNOWN; kt++)
-       if(kt->token == token) break;
-
-    if(kt->token == CONF_UNKNOWN)
-       return("");
-    return(kt->keyword);
-}
-
-void
-parse_server_conf(
-    int parse_argc,
-    char **parse_argv,
-    int *new_argc,
-    char ***new_argv)
-{
-    int i;
-    char **my_argv;
-    char *myarg, *value;
-    command_option_t *server_option;
-
-    server_options = alloc((size_t)(parse_argc+1) * SIZEOF(*server_options));
-    server_option = server_options;
-    server_option->name = NULL;
-
-    my_argv = alloc((size_t)parse_argc * SIZEOF(char *));
-    *new_argv = my_argv;
-    *new_argc = 0;
-    i=0;
-    while(i<parse_argc) {
-       if(strncmp(parse_argv[i],"-o",2) == 0) {
-           if(strlen(parse_argv[i]) > 2)
-               myarg = &parse_argv[i][2];
-           else {
-               i++;
-               if(i >= parse_argc)
-                   error("expect something after -o");
-               myarg = parse_argv[i];
-           }
-           value = index(myarg,'=');
-           if (value == NULL) {
-               conf_parserror("Must specify a value for %s.\n", myarg);
-           } else {
-               *value = '\0';
-               value++;
-               server_option->used = 0;
-               server_option->name = stralloc(myarg);
-               server_option->value = stralloc(value);
-               server_option++;
-               server_option->name = NULL;
-           }
-       }
-       else {
-           my_argv[*new_argc] = stralloc(parse_argv[i]);
-           *new_argc += 1;
-       }
-       i++;
-    }
-}
-
-char **
-get_config_options(
-    int first)
-{
-    char             **config_options;
-    char            **config_option;
-    command_option_t  *command_options;
-    int                nb_server_options = 0;
-
-    for(command_options = server_options; command_options->name != NULL;
-       command_options++) {
-       nb_server_options++;
-    }
-    config_options = alloc((first+nb_server_options+1)*SIZEOF(char *));
-    for(command_options = server_options,
-        config_option = config_options + first;
-       command_options->name != NULL; command_options++) {
-       *config_option = vstralloc("-o", command_options->name, "=",
-                                  command_options->value, NULL);
-       config_option++;
-    }
-    *config_option = NULL;
-    return(config_options);
-}
-
-void
-report_bad_conf_arg(void)
-{
-    command_option_t *command_option;
-
-    for(command_option = server_options; command_option->name != NULL;
-                                                       command_option++) {
-       if(command_option->used == 0) {
-           fprintf(stderr,"argument -o%s=%s not used\n",
-                   command_option->name, command_option->value);
-       }
-    }
-}
-
-void
-free_server_config(void)
-{
-    holdingdisk_t    *hp, *hpnext;
-    dumptype_t       *dp, *dpnext;
-    tapetype_t       *tp, *tpnext;
-    interface_t      *ip, *ipnext;
-    command_option_t *server_option;
-    int               i;
-
-    for(hp=holdingdisks; hp != NULL; hp = hpnext) {
-       amfree(hp->name);
-       for(i=0; i<HOLDING_HOLDING-1; i++) {
-          free_val_t(&hp->value[i]);
-       }
-       hpnext = hp->next;
-       amfree(hp);
-    }
-
-    for(dp=dumplist; dp != NULL; dp = dpnext) {
-       amfree(dp->name);
-       for(i=0; i<DUMPTYPE_DUMPTYPE-1; i++) {
-          free_val_t(&dp->value[i]);
-       }
-       dpnext = dp->next;
-       amfree(dp);
-    }
-
-    for(tp=tapelist; tp != NULL; tp = tpnext) {
-       amfree(tp->name);
-       for(i=0; i<TAPETYPE_TAPETYPE-1; i++) {
-          free_val_t(&tp->value[i]);
-       }
-       tpnext = tp->next;
-       amfree(tp);
-    }
-
-    for(ip=interface_list; ip != NULL; ip = ipnext) {
-       amfree(ip->name);
-       for(i=0; i<INTER_INTER-1; i++) {
-          free_val_t(&ip->value[i]);
-       }
-       ipnext = ip->next;
-       amfree(ip);
-    }
-
-    if(server_options) {
-       for(server_option = server_options; server_option->name != NULL;
-                                               server_option++) {
-           amfree(server_option->name);
-           amfree(server_option->value);
-        }
-       amfree(server_options);
-    }
-
-    for(i=0; i<CNF_CNF-1; i++)
-       free_val_t(&server_conf[i]);
-}
diff --git a/server-src/conffile.h b/server-src/conffile.h
deleted file mode 100644 (file)
index 1bb3043..0000000
+++ /dev/null
@@ -1,348 +0,0 @@
-/*
- * Amanda, The Advanced Maryland Automatic Network Disk Archiver
- * Copyright (c) 1991-2000 University of Maryland at College Park
- * All Rights Reserved.
- *
- * Permission to use, copy, modify, distribute, and sell this software and its
- * documentation for any purpose is hereby granted without fee, provided that
- * the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of U.M. not be used in advertising or
- * publicity pertaining to distribution of the software without specific,
- * written prior permission.  U.M. makes no representations about the
- * suitability of this software for any purpose.  It is provided "as is"
- * without express or implied warranty.
- *
- * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
- * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * Author: James da Silva, Systems Design and Analysis Group
- *                        Computer Science Department
- *                        University of Maryland at College Park
- */
-/*
- * $Id: conffile.h,v 1.72.2.3 2006/11/09 14:35:10 martinea Exp $
- *
- * interface for config file reading code
- */
-#ifndef CONFFILE_H
-#define CONFFILE_H
-
-#include "amanda.h"
-#include "util.h"
-
-#define CONFFILE_NAME "amanda.conf"
-
-typedef enum {
-    CNF_ORG,
-    CNF_MAILTO,
-    CNF_DUMPUSER,
-    CNF_TAPEDEV,
-    CNF_CHNGRDEV,
-    CNF_CHNGRFILE,
-    CNF_LABELSTR,
-    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_TAPEBUFS,
-    CNF_RAWTAPEDEV,
-    CNF_PRINTER,
-    CNF_AUTOFLUSH,
-    CNF_RESERVE,
-    CNF_MAXDUMPSIZE,
-    CNF_COLUMNSPEC,
-    CNF_AMRECOVER_DO_FSF,
-    CNF_AMRECOVER_CHECK_LABEL,
-    CNF_AMRECOVER_CHANGER,
-    CNF_TAPERALGO,
-    CNF_DISPLAYUNIT,
-    CNF_KRB5KEYTAB,
-    CNF_KRB5PRINCIPAL,
-    CNF_LABEL_NEW_TAPES,
-    CNF_USETIMESTAMPS,
-    CNF_CNF
-} confparm_t;
-
-typedef enum tapetype_e  {
-    TAPETYPE_COMMENT,
-    TAPETYPE_LBL_TEMPL,
-    TAPETYPE_BLOCKSIZE,
-    TAPETYPE_LENGTH,
-    TAPETYPE_FILEMARK,
-    TAPETYPE_SPEED,
-    TAPETYPE_FILE_PAD,
-    TAPETYPE_TAPETYPE
-} tapetype_ee;
-
-typedef struct tapetype_s {
-    struct tapetype_s *next;
-    int seen;
-    char *name;
-
-    val_t value[TAPETYPE_TAPETYPE];
-} tapetype_t;
-
-#define tapetype_get(tapetype, field) (tapetype->field)
-#define tapetype_get_name(tapetype) tapetype->name
-#define tapetype_get_seen(tapetype) tapetype->seen
-#define tapetype_get_comment(tapetype)   get_conftype_string(&tapetype->value[TAPETYPE_COMMENT])
-#define tapetype_get_lbl_templ(tapetype) get_conftype_string(&tapetype->value[TAPETYPE_LBL_TEMPL])
-#define tapetype_get_blocksize(tapetype) get_conftype_size  (&tapetype->value[TAPETYPE_BLOCKSIZE])
-#define tapetype_get_length(tapetype)    get_conftype_am64  (&tapetype->value[TAPETYPE_LENGTH])
-#define tapetype_get_filemark(tapetype)  get_conftype_am64  (&tapetype->value[TAPETYPE_FILEMARK])
-#define tapetype_get_speed(tapetype)     get_conftype_int   (&tapetype->value[TAPETYPE_SPEED])
-#define tapetype_get_file_pad(tapetype)  get_conftype_bool  (&tapetype->value[TAPETYPE_FILE_PAD])
-
-/* Dump strategies */
-#define DS_SKIP                0       /* Don't do any dumps at all */
-#define DS_STANDARD    1       /* Standard (0 1 1 1 1 2 2 2 ...) */
-#define DS_NOFULL      2       /* No full's (1 1 1 ...) */
-#define DS_NOINC       3       /* No inc's (0 0 0 ...) */
-#define DS_4           4       /* ? (0 1 2 3 4 5 6 7 8 9 10 11 ...) */
-#define DS_5           5       /* ? (0 1 1 1 1 1 1 1 1 1 1 1 ...) */
-#define DS_HANOI       6       /* Tower of Hanoi (? ? ? ? ? ...) */
-#define DS_INCRONLY    7       /* Forced fulls (0 1 1 2 2 FORCE0 1 1 ...) */
-
-/* Estimate strategies */
-#define ES_CLIENT      0       /* client estimate */
-#define ES_SERVER      1       /* server estimate */
-#define ES_CALCSIZE    2       /* calcsize estimate */
-
-#define ALGO_FIRST     0
-#define ALGO_FIRSTFIT  1
-#define ALGO_LARGEST   2
-#define ALGO_LARGESTFIT        3
-#define ALGO_SMALLEST  4
-#define ALGO_LAST      5
-
-typedef enum dumptype_e  {
-    DUMPTYPE_COMMENT,
-    DUMPTYPE_PROGRAM,
-    DUMPTYPE_SRVCOMPPROG,
-    DUMPTYPE_CLNTCOMPPROG,
-    DUMPTYPE_SRV_ENCRYPT,
-    DUMPTYPE_CLNT_ENCRYPT,
-    DUMPTYPE_AMANDAD_PATH,
-    DUMPTYPE_CLIENT_USERNAME,
-    DUMPTYPE_SSH_KEYS,
-    DUMPTYPE_SECURITY_DRIVER,
-    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_ESTIMATE,
-    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_DUMPTYPE
-} dumptype_ee;
-
-typedef struct dumptype_s {
-    struct dumptype_s *next;
-    int seen;
-    char *name;
-
-    val_t value[DUMPTYPE_DUMPTYPE];
-} dumptype_t;
-
-#define dumptype_get_name(dumptype) dumptype->name
-#define dumptype_get_seen(dumptype) dumptype->seen
-#define dumptype_get_comment(dumptype)            get_conftype_string   (&dumptype->value[DUMPTYPE_COMMENT])
-#define dumptype_get_program(dumptype)            get_conftype_string   (&dumptype->value[DUMPTYPE_PROGRAM])
-#define dumptype_get_srvcompprog(dumptype)        get_conftype_string   (&dumptype->value[DUMPTYPE_SRVCOMPPROG])
-#define dumptype_get_clntcompprog(dumptype)       get_conftype_string   (&dumptype->value[DUMPTYPE_CLNTCOMPPROG])
-#define dumptype_get_srv_encrypt(dumptype)        get_conftype_string   (&dumptype->value[DUMPTYPE_SRV_ENCRYPT])
-#define dumptype_get_clnt_encrypt(dumptype)       get_conftype_string   (&dumptype->value[DUMPTYPE_CLNT_ENCRYPT])
-#define dumptype_get_amandad_path(dumptype)       get_conftype_string   (&dumptype->value[DUMPTYPE_AMANDAD_PATH])
-#define dumptype_get_client_username(dumptype)    get_conftype_string   (&dumptype->value[DUMPTYPE_CLIENT_USERNAME])
-#define dumptype_get_ssh_keys(dumptype)           get_conftype_string   (&dumptype->value[DUMPTYPE_SSH_KEYS])
-#define dumptype_get_security_driver(dumptype)    get_conftype_string   (&dumptype->value[DUMPTYPE_SECURITY_DRIVER])
-#define dumptype_get_exclude(dumptype)            get_conftype_exinclude(&dumptype->value[DUMPTYPE_EXCLUDE])
-#define dumptype_get_include(dumptype)            get_conftype_exinclude(&dumptype->value[DUMPTYPE_INCLUDE])
-#define dumptype_get_priority(dumptype)           get_conftype_priority (&dumptype->value[DUMPTYPE_PRIORITY])
-#define dumptype_get_dumpcycle(dumptype)          get_conftype_int      (&dumptype->value[DUMPTYPE_DUMPCYCLE])
-#define dumptype_get_maxcycle(dumptype)           get_conftype_int      (&dumptype->value[DUMPTYPE_MAXCYCLE])
-#define dumptype_get_frequency(dumptype)          get_conftype_int      (&dumptype->value[DUMPTYPE_FREQUENCY])
-#define dumptype_get_maxdumps(dumptype)           get_conftype_int      (&dumptype->value[DUMPTYPE_MAXDUMPS])
-#define dumptype_get_maxpromoteday(dumptype)      get_conftype_int      (&dumptype->value[DUMPTYPE_MAXPROMOTEDAY])
-#define dumptype_get_bumppercent(dumptype)        get_conftype_int      (&dumptype->value[DUMPTYPE_BUMPPERCENT])
-#define dumptype_get_bumpsize(dumptype)           get_conftype_am64     (&dumptype->value[DUMPTYPE_BUMPSIZE])
-#define dumptype_get_bumpdays(dumptype)           get_conftype_int      (&dumptype->value[DUMPTYPE_BUMPDAYS])
-#define dumptype_get_bumpmult(dumptype)           get_conftype_real     (&dumptype->value[DUMPTYPE_BUMPMULT])
-#define dumptype_get_starttime(dumptype)          get_conftype_time     (&dumptype->value[DUMPTYPE_STARTTIME])
-#define dumptype_get_strategy(dumptype)           get_conftype_strategy (&dumptype->value[DUMPTYPE_STRATEGY])
-#define dumptype_get_estimate(dumptype)           get_conftype_estimate (&dumptype->value[DUMPTYPE_ESTIMATE])
-#define dumptype_get_compress(dumptype)           get_conftype_compress (&dumptype->value[DUMPTYPE_COMPRESS])
-#define dumptype_get_encrypt(dumptype)            get_conftype_encrypt  (&dumptype->value[DUMPTYPE_ENCRYPT])
-#define dumptype_get_srv_decrypt_opt(dumptype)    get_conftype_string   (&dumptype->value[DUMPTYPE_SRV_DECRYPT_OPT])
-#define dumptype_get_clnt_decrypt_opt(dumptype)   get_conftype_string   (&dumptype->value[DUMPTYPE_CLNT_DECRYPT_OPT])
-#define dumptype_get_comprate(dumptype)                                   dumptype->value[DUMPTYPE_COMPRATE].v.rate
-#define dumptype_get_tape_splitsize(dumptype)     get_conftype_am64     (&dumptype->value[DUMPTYPE_TAPE_SPLITSIZE])
-#define dumptype_get_fallback_splitsize(dumptype) get_conftype_am64     (&dumptype->value[DUMPTYPE_FALLBACK_SPLITSIZE])
-#define dumptype_get_split_diskbuffer(dumptype)   get_conftype_string   (&dumptype->value[DUMPTYPE_SPLIT_DISKBUFFER])
-#define dumptype_get_record(dumptype)             get_conftype_bool     (&dumptype->value[DUMPTYPE_RECORD])
-#define dumptype_get_skip_incr(dumptype)          get_conftype_bool     (&dumptype->value[DUMPTYPE_SKIP_INCR])
-#define dumptype_get_skip_full(dumptype)          get_conftype_bool     (&dumptype->value[DUMPTYPE_SKIP_FULL])
-#define dumptype_get_to_holdingdisk(dumptype)     get_conftype_hold     (&dumptype->value[DUMPTYPE_HOLDINGDISK])
-#define dumptype_get_kencrypt(dumptype)           get_conftype_bool     (&dumptype->value[DUMPTYPE_KENCRYPT])
-#define dumptype_get_ignore(dumptype)             get_conftype_bool     (&dumptype->value[DUMPTYPE_IGNORE])
-#define dumptype_get_index(dumptype)              get_conftype_bool     (&dumptype->value[DUMPTYPE_INDEX])
-
-/* A network interface */
-typedef enum interface_e  {
-    INTER_COMMENT,
-    INTER_MAXUSAGE,
-    INTER_INTER
-} interface_ee;
-
-
-typedef struct interface_s {
-    struct interface_s *next;
-    int seen;
-    char *name;
-
-    val_t value[INTER_INTER];
-
-    unsigned long curusage;            /* current usage */
-} interface_t;
-
-#define interface_get_name(interface) interface->name
-#define interface_get_seen(interface) interface->seen
-#define interface_get_comment(interface)  get_conftype_string(&interface->value[INTER_COMMENT])
-#define interface_get_maxusage(interface) get_conftype_int   (&interface->value[INTER_MAXUSAGE])
-
-/* A holding disk */
-typedef enum holdingdisk_e  {
-    HOLDING_COMMENT,
-    HOLDING_DISKDIR,
-    HOLDING_DISKSIZE,
-    HOLDING_CHUNKSIZE,
-    HOLDING_HOLDING
-} holdingdisk_ee;
-
-typedef struct holdingdisk_s {
-    struct holdingdisk_s *next;
-    int seen;
-    char *name;
-
-    val_t value[HOLDING_HOLDING];
-
-    void *up;                  /* generic user pointer */
-    off_t disksize;
-} holdingdisk_t;
-
-#define holdingdisk_get_name(holdingdisk) (holdingdisk)->name
-#define holdingdisk_get_seen(holdingdisk) (holdingdisk)->seen
-#define holdingdisk_get_comment(holdingdisk)   get_conftype_string(&(holdingdisk)->value[HOLDING_COMMENT])
-#define holdingdisk_get_diskdir(holdingdisk)   get_conftype_string(&(holdingdisk)->value[HOLDING_DISKDIR])
-#define holdingdisk_get_disksize(holdingdisk)  get_conftype_am64  (&(holdingdisk)->value[HOLDING_DISKSIZE])
-#define holdingdisk_get_chunksize(holdingdisk) get_conftype_am64  (&(holdingdisk)->value[HOLDING_CHUNKSIZE])
-
-/* for each column we define some values on how to
- * format this column element
- */
-typedef struct {
-    char *Name;                /* column name */
-    int PrefixSpace;   /* the blank space to print before this
-                        * column. It is used to get the space
-                        * between the colums
-                        */
-    int Width;         /* the width of the column itself */
-    int Precision;     /* the precision if its a float */
-    int MaxWidth;      /* if set, Width will be recalculated
-                        * to the space needed */
-    char *Format;      /* the printf format string for this
-                        * column element
-                        */
-    char *Title;       /* the title to use for this column */
-} ColumnInfo;
-
-/* this corresponds to the normal output of amanda, but may
- * be adapted to any spacing as you like.
- */
-extern ColumnInfo ColumnData[];
-
-extern char *config_name;
-extern char *config_dir;
-
-extern holdingdisk_t *holdingdisks;
-extern int num_holdingdisks;
-
-void parse_server_conf(int parse_argc, char **parse_argv, int *new_argc,
-                      char ***new_argv);
-char **get_config_options(int);
-void report_bad_conf_arg(void);
-void free_server_config(void);
-
-int read_conffile(char *filename);
-int getconf_seen(confparm_t parameter);
-int getconf_boolean(confparm_t parameter);
-int getconf_int(confparm_t parameter);
-long getconf_long(confparm_t parameter);
-ssize_t getconf_size(confparm_t parameter);
-time_t getconf_time(confparm_t parameter);
-off_t getconf_am64(confparm_t parameter);
-double getconf_real(confparm_t parameter);
-char *getconf_str(confparm_t parameter);
-int getconf_taperalgo(confparm_t parameter);
-char *getconf_byname(char *confname);
-char *getconf_list(char *listname);
-dumptype_t *lookup_dumptype(char *identifier);
-dumptype_t *read_dumptype(char *name, FILE *from, char *fname, int *linenum);
-tapetype_t *lookup_tapetype(char *identifier);
-holdingdisk_t *lookup_holdingdisk(char *identifier);
-interface_t *lookup_interface(char *identifier);
-holdingdisk_t *getconf_holdingdisks(void);
-long int getconf_unit_divisor(void);
-void dump_configuration(char *filename);
-int ColumnDataCount(void);
-int StringToColumn(char *s);
-char LastChar(char *s);
-int SetColumDataFromString(ColumnInfo* ci, char *s, char **errstr);
-
-/* this is in securityconf.h */
-char *generic_get_security_conf(char *, void *);
-#endif /* ! CONFFILE_H */
index 1e02f74225a8a575aa62d15fdd71b6f275ed34cd..4d26969381caaa756fb2e238e9570c10ce2f9290 100644 (file)
@@ -43,6 +43,7 @@ clear_list(void)
     {
        this = item;
        item = item->next;
+       amfree(this->hostname);
        while(this->tapes != NULL) {
            tapelist_t *tapes = this->tapes;
            this->tapes = tapes->next;
@@ -59,6 +60,7 @@ clear_list(void)
 
 void
 add_dump(
+    char *      hostname,
     char *     date,
     int                level,
     char *     tape,
@@ -78,6 +80,7 @@ add_dump(
     if(partnum == -1) new->is_split = 0;
     else new->is_split = 1;
     new->tapes = NULL;
+    new->hostname = stralloc(hostname);
 
     if(new->tape[0] == '/')
        isafile = 1; /* XXX kludgey, like this whole thing */
index 71d9866fb8c26ac8e1a932b935632720b8c99c8c..2d21d88c33e19fd9347b01c5631fada31d372977 100644 (file)
@@ -40,6 +40,7 @@ typedef struct DUMP_ITEM
     char tape[256];
     tapelist_t *tapes;
     off_t  file;
+    char *hostname;
 
     struct DUMP_ITEM *next;
 }
@@ -48,6 +49,6 @@ DUMP_ITEM;
 #define next_dump(item)        ((item)->next)
 
 extern void clear_list(void);
-extern void add_dump(char *date, int level, char *tape, off_t file, int partnum);
+extern void add_dump(char *hostname, char *date, int level, char *tape, off_t file, int partnum);
 extern DUMP_ITEM *first_dump(void);
 #endif /* !DISK_HISTORY_H */
index da5dd0c1710e9ac0b6aacd59374f27635db0b0b1..e13dcbf9184c833dedb19aeac4c7e017f19be2c2 100644 (file)
@@ -25,7 +25,7 @@
  *                        University of Maryland at College Park
  */
 /*
- * $Id: diskfile.c,v 1.95.2.12 2007/01/26 14:33:24 martinea Exp $
+ * $Id: diskfile.c,v 1.95 2006/07/26 15:17:37 martinea Exp $
  *
  * read disklist file
  */
@@ -190,6 +190,7 @@ add_disk(
     disk->tape_splitsize = (off_t)0;
     disk->split_diskbuffer = NULL;
     disk->fallback_splitsize = (off_t)0;
+    disk->hostname = stralloc(hostname);
     disk->name = stralloc(diskname);
     disk->device = stralloc(diskname);
     disk->spindle = -1;
@@ -494,6 +495,7 @@ parse_diskline(
        disk = alloc(SIZEOF(disk_t));
        malloc_mark(disk);
        disk->line = line_num;
+       disk->hostname = stralloc(hostname);
        disk->name = diskname;
        disk->device = diskdevice;
        malloc_mark(disk->name);
@@ -543,8 +545,6 @@ parse_diskline(
            }
            return (-1);
        }
-       amfree(line);
-
        dtype = read_dumptype(vstralloc("custom(", hostname,
                                        ":", disk->name, ")", NULL),
                              diskf, (char*)filename, line_num_p);
@@ -562,6 +562,7 @@ parse_diskline(
            }
            return (-1);
        }
+       amfree(line);
 
        *line_p = line = agets(diskf);
        line_num = *line_num_p; /* no incr, read_dumptype did it already */
@@ -618,7 +619,7 @@ parse_diskline(
     disk->bumpsize          = dumptype_get_bumpsize(dtype);
     disk->bumpdays          = dumptype_get_bumpdays(dtype);
     disk->bumpmult          = dumptype_get_bumpmult(dtype);
-    disk->starttime         = dumptype_get_starttime(dtype);
+    disk->starttime          = dumptype_get_starttime(dtype);
     disk->start_t = 0;
     if (disk->starttime > 0) {
        st = time(NULL);
@@ -631,6 +632,7 @@ parse_diskline(
            disk->start_t += 86400;
     }
     disk->strategy          = dumptype_get_strategy(dtype);
+    disk->ignore            = dumptype_get_ignore(dtype);
     disk->estimate          = dumptype_get_estimate(dtype);
     disk->compress          = dumptype_get_compress(dtype);
     disk->srvcompprog       = dumptype_get_srvcompprog(dtype);
@@ -708,10 +710,7 @@ parse_diskline(
     }
 
     if(dumptype_get_ignore(dtype) || dumptype_get_strategy(dtype) == DS_SKIP) {
-       amfree(hostname);
-       amfree(disk->name);
-       amfree(disk);
-       return (0);
+       disk->todo = 0;
     }
 
     /* success, add disk to lists */
@@ -897,17 +896,17 @@ optionstr(
                    dp->host->hostname, qdpname);
        }
        break;
-    case COMP_SERV_FAST:
+    case COMP_SERVER_FAST:
        if(am_has_feature(their_features, fe_options_srvcomp_fast)) {
            compress_opt = "srvcomp-fast;";
        }
        break;
-    case COMP_SERV_BEST:
+    case COMP_SERVER_BEST:
        if(am_has_feature(their_features, fe_options_srvcomp_best)) {
             compress_opt = "srvcomp-best;";
        }
        break;
-    case COMP_SERV_CUST:
+    case COMP_SERVER_CUST:
         if(am_has_feature(their_features, fe_options_srvcomp_cust)) {
          compress_opt = vstralloc("srvcomp-cust=", dp->srvcompprog, ";", NULL);
          if (BSTRNCMP(compress_opt, "srvcomp-cust=;") == 0){
@@ -940,9 +939,9 @@ optionstr(
            }
            err++;
          }
-        if ( dp->compress == COMP_SERV_FAST || 
-             dp->compress == COMP_SERV_BEST ||
-             dp->compress == COMP_SERV_CUST ) {
+        if ( dp->compress == COMP_SERVER_FAST || 
+             dp->compress == COMP_SERVER_BEST ||
+             dp->compress == COMP_SERVER_CUST ) {
           if(fdout) {
              fprintf(fdout,
                      "ERROR: %s:Client encryption with server compression is not supported. See amanda.conf(5) for detail.\n", dp->host->hostname);
index 915af8783c5364226f61480704295a4ae6452a96..78a49efed844ce77dbbbacd5fec955d4ffa7a690 100644 (file)
@@ -25,7 +25,7 @@
  *                        University of Maryland at College Park
  */
 /*
- * $Id: diskfile.h,v 1.38.2.1 2006/11/01 14:45:41 martinea Exp $
+ * $Id: diskfile.h,v 1.38 2006/06/22 20:41:33 martinea Exp $
  *
  * interface for disklist file reading code
  */
@@ -55,6 +55,7 @@ typedef struct disk_s {
     am_host_t  *host;                  /* host list */
     struct disk_s *hostnext;
 
+    char        *hostname;             /* hostname */
     char       *name;                  /* label name for disk */
     char       *device;                /* device name for disk, eg "sd0g" */
     char       *dtype_name;            /* name of dump type   XXX shouldn't need this */
@@ -88,6 +89,7 @@ typedef struct disk_s {
     time_t     starttime;              /* start this dump after this time */
     time_t     start_t;                /* start this dump after this time */
     int                strategy;               /* what dump strategy to use */
+    int                ignore;                 /* ignore */
     int                estimate;               /* what estimate strategy to use */
     int                compress;               /* type of compression to use */
     int                encrypt;                /* type of encryption to use */
index 594f694ec052b660c1e0839479752537c4a57994..d5f265c0d664f084d16d3eccac23c29927acd6b6 100644 (file)
@@ -24,7 +24,7 @@
  * file named AUTHORS, in the root directory of this distribution.
  */
 /*
- * $Id: driver.c,v 1.198.2.6 2006/12/27 14:44:48 martinea Exp $
+ * $Id: driver.c,v 1.198 2006/08/24 01:57:16 paddy_s Exp $
  *
  * controlling process for the Amanda backup system
  */
@@ -34,8 +34,6 @@
  *     tape.  Probably not effective though, should do this in planner.
  */
 
-#define HOLD_DEBUG
-
 #include "amanda.h"
 #include "clock.h"
 #include "conffile.h"
 #include "driverio.h"
 #include "server_util.h"
 
+#define driver_debug(i,x) do {         \
+       if ((i) <= debug_driver) {      \
+           dbprintf(x);                \
+       }                               \
+} while (0)
+
+#define hold_debug(i,x) do {           \
+       if ((i) <= debug_holding) {     \
+           dbprintf(x);                \
+       }                               \
+} while (0)
+
 static disklist_t waitq, runq, tapeq, roomq;
 static int pending_aborts;
 static disk_t *taper_disk;
@@ -158,6 +168,7 @@ main(
     char *line;
     int    new_argc,   my_argc;
     char **new_argv, **my_argv;
+    char hostname[1025];
 
     safe_fd(-1, 0);
 
@@ -180,7 +191,7 @@ main(
 
     startclock();
 
-    parse_server_conf(main_argc, main_argv, &new_argc, &new_argv);
+    parse_conf(main_argc, main_argv, &new_argc, &new_argv);
     my_argc = new_argc;
     my_argv = new_argv;
 
@@ -240,6 +251,9 @@ main(
     amfree(line);
     log_add(L_START,"date %s", driver_timestamp);
 
+    gethostname(hostname, SIZEOF(hostname));
+    log_add(L_STATS,"hostname %s", hostname);
+
     /* check that we don't do many dump in a day and usetimestamps is off */
     if(strlen(driver_timestamp) == 8) {
        if (!nodump) {
@@ -797,7 +811,7 @@ start_some_dumps(
 
     for (dumper = dmptable; dumper < dmptable+inparallel; dumper++) {
 
-       if( dumper->busy ) {
+       if( dumper->busy || dumper->down) {
            continue;
        }
 
@@ -1398,7 +1412,7 @@ dumper_result(
        dummy += h[i]->used;
     }
 
-    size = size_holding_files(sched(dp)->destname, 0);
+    size = holding_file_size(sched(dp)->destname, 0);
     h[activehd]->used = size - dummy;
     holdalloc(h[activehd]->disk)->allocated_dumpers--;
     adjust_diskspace(dp, DONE);
@@ -1783,6 +1797,7 @@ read_flush(void)
     int ch;
     disklist_t tq;
     char *qname = NULL;
+    char *qdestname = NULL;
 
     tq.head = tq.tail = NULL;
 
@@ -1852,11 +1867,12 @@ read_flush(void)
            error("flush line %d: syntax error (no filename)", line);
            /*NOTREACHED*/
        }
-       destname = s - 1;
-       skip_non_whitespace(s, ch);
+       qdestname = s - 1;
+       skip_quoted_string(s, ch);
        s[-1] = '\0';
+       destname = unquote_string(qdestname);
 
-       get_dumpfile(destname, &file);
+       holding_file_get_dumpfile(destname, &file);
        if( file.type != F_DUMPFILE) {
            if( file.type != F_CONT_DUMPFILE )
                log_add(L_INFO, "%s: ignoring cruft file.", destname);
@@ -1888,6 +1904,12 @@ read_flush(void)
            continue;
        }
 
+       if (holding_file_size(destname,1) <= 0) {
+           log_add(L_INFO, "%s: removing file with no data.", destname);
+           holding_file_unlink(destname);
+           continue;
+       }
+
        dp1 = (disk_t *)alloc(SIZEOF(disk_t));
        *dp1 = *dp;
        dp1->next = dp1->prev = NULL;
@@ -1916,7 +1938,7 @@ read_flush(void)
        sp->priority = 0;
        sp->degr_level = -1;
        sp->attempted = 0;
-       sp->act_size = size_holding_files(destname, 0);
+       sp->act_size = holding_file_size(destname, 0);
        sp->holdp = build_diskspace(destname);
        if(sp->holdp == NULL) continue;
        sp->dumper = NULL;
@@ -2050,7 +2072,7 @@ read_schedule(
            error("schedule line %d: syntax error (bad nsize)", line);
            /*NOTREACHED*/
        }
-       nsize = nsize_;
+       nsize = (off_t)nsize_;
        skip_integer(s, ch);
 
        skip_whitespace(s, ch);                 /* find the compressed size */
@@ -2059,7 +2081,7 @@ read_schedule(
            error("schedule line %d: syntax error (bad csize)", line);
            /*NOTREACHED*/
        }
-       csize = csize_;
+       csize = (off_t)csize_;
        skip_integer(s, ch);
 
        skip_whitespace(s, ch);                 /* find the time number */
@@ -2101,7 +2123,7 @@ read_schedule(
                error("schedule line %d: syntax error (bad degr nsize)", line);
                /*NOTREACHED*/
            }
-           degr_nsize = degr_nsize_;
+           degr_nsize = (off_t)degr_nsize_;
            skip_integer(s, ch);
 
            skip_whitespace(s, ch);             /* find the degr compressed size */
@@ -2110,7 +2132,7 @@ read_schedule(
                error("schedule line %d: syntax error (bad degr csize)", line);
                /*NOTREACHED*/
            }
-           degr_csize = degr_csize_;
+           degr_csize = (off_t)degr_csize_;
            skip_integer(s, ch);
 
            skip_whitespace(s, ch);             /* find the degr time number */
@@ -2127,6 +2149,12 @@ read_schedule(
                /*NOTREACHED*/
            }
            skip_integer(s, ch);
+       } else {
+           degr_level = -1;
+           degr_nsize = (off_t)0;
+           degr_csize = (off_t)0;
+           degr_time = (time_t)0;
+           degr_kps = 0;
        }
 
        dp = lookup_disk(hostname, diskname);
@@ -2207,10 +2235,16 @@ free_kps(
            maxusage += interface_get_maxusage(p);
            curusage += p->curusage;
        }
-       res = maxusage - curusage;
+       if (maxusage >= curusage)
+           res = maxusage - curusage;
+       else
+           res = 0;
 #ifndef __lint
     } else {
-       res = interface_get_maxusage(ip) - ip->curusage;
+       if ((unsigned long)interface_get_maxusage(ip) >= ip->curusage)
+           res = interface_get_maxusage(ip) - ip->curusage;
+       else
+           res = 0;
 #endif
     }
 
@@ -2293,11 +2327,9 @@ find_diskspace(
        size = 2*DISK_BLOCK_KB;
     size = am_round(size, (off_t)DISK_BLOCK_KB);
 
-#ifdef HOLD_DEBUG
-    printf("%s: want " OFF_T_FMT " K\n", debug_prefix_time(": find_diskspace"),
-          (OFF_T_FMT_TYPE)size);
-    fflush(stdout);
-#endif
+    hold_debug(1, ("%s: want " OFF_T_FMT " K\n",
+                  debug_prefix_time(": find_diskspace"),
+                  (OFF_T_FMT_TYPE)size));
 
     for(hdp = getconf_holdingdisks(); hdp != NULL; hdp = hdp->next) {
        num_holdingdisks++;
@@ -2347,17 +2379,14 @@ find_diskspace(
        /* halloc = space to allocate, including 1 header for each chunksize */
        halloc = dalloc + (((dalloc-(off_t)1)/holdingdisk_get_chunksize(minp))+(off_t)1) * (off_t)DISK_BLOCK_KB;
 
-#ifdef HOLD_DEBUG
-       printf("%s: find diskspace: size " OFF_T_FMT " hf " OFF_T_FMT
-              " df " OFF_T_FMT " da " OFF_T_FMT " ha " OFF_T_FMT "\n",
-              debug_prefix_time(": find_diskspace"),
-              (OFF_T_FMT_TYPE)size,
-              (OFF_T_FMT_TYPE)hfree,
-              (OFF_T_FMT_TYPE)dfree,
-              (OFF_T_FMT_TYPE)dalloc,
-              (OFF_T_FMT_TYPE)halloc);
-       fflush(stdout);
-#endif
+       hold_debug(1, ("%s: find diskspace: size " OFF_T_FMT " hf " OFF_T_FMT
+                      " df " OFF_T_FMT " da " OFF_T_FMT " ha " OFF_T_FMT"\n",
+                      debug_prefix_time(": find_diskspace"),
+                      (OFF_T_FMT_TYPE)size,
+                      (OFF_T_FMT_TYPE)hfree,
+                      (OFF_T_FMT_TYPE)dfree,
+                      (OFF_T_FMT_TYPE)dalloc,
+                      (OFF_T_FMT_TYPE)halloc));
        size -= dalloc;
        result[i] = alloc(SIZEOF(assignedhd_t));
        result[i]->disk = minp;
@@ -2377,18 +2406,18 @@ find_diskspace(
        result = NULL;
     }
 
-#ifdef HOLD_DEBUG
-    for( i = 0; result && result[i]; i++ ) {
-       printf("%s: find diskspace: selected %s free " OFF_T_FMT " reserved " OFF_T_FMT " dumpers %d\n",
-               debug_prefix_time(": find_diskspace"),
-               holdingdisk_get_diskdir(result[i]->disk),
-               (OFF_T_FMT_TYPE)(result[i]->disk->disksize -
-                 holdalloc(result[i]->disk)->allocated_space),
-               (OFF_T_FMT_TYPE)result[i]->reserved,
-               holdalloc(result[i]->disk)->allocated_dumpers);
+    if (debug_holding > 1) {
+       for( i = 0; result && result[i]; i++ ) {
+           hold_debug(1, ("%s: find diskspace: selected %s free " OFF_T_FMT
+                          " reserved " OFF_T_FMT " dumpers %d\n",
+                          debug_prefix_time(": find_diskspace"),
+                          holdingdisk_get_diskdir(result[i]->disk),
+                          (OFF_T_FMT_TYPE)(result[i]->disk->disksize -
+                            holdalloc(result[i]->disk)->allocated_space),
+                          (OFF_T_FMT_TYPE)result[i]->reserved,
+                          holdalloc(result[i]->disk)->allocated_dumpers));
+       }
     }
-    fflush(stdout);
-#endif
 
     return result;
 }
@@ -2433,16 +2462,16 @@ assign_holdingdisk(
            holdalloc(holdp[0]->disk)->allocated_space += holdp[0]->reserved;
            size = (holdp[0]->reserved>size) ? (off_t)0 : size-holdp[0]->reserved;
            qname = quote_string(diskp->name);
-#ifdef HOLD_DEBUG
-           printf("%s: merging holding disk %s to disk %s:%s, add " OFF_T_FMT " for reserved " OFF_T_FMT ", left " OFF_T_FMT "\n",
-                  debug_prefix_time(": assign_holdingdisk"),
-                  holdingdisk_get_diskdir(sched(diskp)->holdp[j-1]->disk),
-                  diskp->host->hostname, qname,
-                  (OFF_T_FMT_TYPE)holdp[0]->reserved,
-                  (OFF_T_FMT_TYPE)sched(diskp)->holdp[j-1]->reserved,
-                  (OFF_T_FMT_TYPE)size);
-           fflush(stdout);
-#endif
+           hold_debug(1, ("%s: merging holding disk %s to disk %s:%s, add "
+                          OFF_T_FMT " for reserved " OFF_T_FMT ", left "
+                          OFF_T_FMT "\n",
+                          debug_prefix_time(": assign_holdingdisk"),
+                          holdingdisk_get_diskdir(
+                                              sched(diskp)->holdp[j-1]->disk),
+                          diskp->host->hostname, qname,
+                          (OFF_T_FMT_TYPE)holdp[0]->reserved,
+                          (OFF_T_FMT_TYPE)sched(diskp)->holdp[j-1]->reserved,
+                          (OFF_T_FMT_TYPE)size));
            i++;
            amfree(qname);
            amfree(holdp[0]);
@@ -2463,14 +2492,14 @@ assign_holdingdisk(
        size = (holdp[i]->reserved > size) ? (off_t)0 :
                  (size - holdp[i]->reserved);
        qname = quote_string(diskp->name);
-#ifdef HOLD_DEBUG
-       printf("%s: %d assigning holding disk %s to disk %s:%s, reserved " OFF_T_FMT ", left " OFF_T_FMT "\n",
-               debug_prefix_time(": assign_holdingdisk"),
-               i, holdingdisk_get_diskdir(holdp[i]->disk), diskp->host->hostname, qname,
-               (OFF_T_FMT_TYPE)holdp[i]->reserved,
-               (OFF_T_FMT_TYPE)size);
-       fflush(stdout);
-#endif
+       hold_debug(1,
+                  ("%s: %d assigning holding disk %s to disk %s:%s, reserved "
+                    OFF_T_FMT ", left " OFF_T_FMT "\n",
+                   debug_prefix_time(": assign_holdingdisk"),
+                   i, holdingdisk_get_diskdir(holdp[i]->disk),
+                   diskp->host->hostname, qname,
+                   (OFF_T_FMT_TYPE)holdp[i]->reserved,
+                   (OFF_T_FMT_TYPE)size));
        amfree(qname);
        holdp[i] = NULL; /* so it doesn't get free()d... */
     }
@@ -2495,12 +2524,9 @@ adjust_diskspace(
 
     qname = quote_string(diskp->name);
     qdest = quote_string(sched(diskp)->destname);
-#ifdef HOLD_DEBUG
-    printf("%s: %s:%s %s\n",
-          debug_prefix_time(": adjust_diskspace"),
-          diskp->host->hostname, qname, qdest);
-    fflush(stdout);
-#endif
+    hold_debug(1, ("%s: %s:%s %s\n",
+                  debug_prefix_time(": adjust_diskspace"),
+                  diskp->host->hostname, qname, qdest));
 
     holdp = sched(diskp)->holdp;
 
@@ -2511,30 +2537,27 @@ adjust_diskspace(
        total += holdp[i]->used;
        holdalloc(holdp[i]->disk)->allocated_space += diff;
        hqname = quote_string(holdp[i]->disk->name);
-#ifdef HOLD_DEBUG
-       printf("%s: hdisk %s done, reserved " OFF_T_FMT " used " OFF_T_FMT " diff " OFF_T_FMT " alloc " OFF_T_FMT " dumpers %d\n",
-               debug_prefix_time(": adjust_diskspace"),
-               holdp[i]->disk->name,
-               (OFF_T_FMT_TYPE)holdp[i]->reserved,
-               (OFF_T_FMT_TYPE)holdp[i]->used,
-               (OFF_T_FMT_TYPE)diff,
-               (OFF_T_FMT_TYPE)holdalloc(holdp[i]->disk)->allocated_space,
-               holdalloc(holdp[i]->disk)->allocated_dumpers );
-       fflush(stdout);
-#endif
+       hold_debug(1, ("%s: hdisk %s done, reserved " OFF_T_FMT " used "
+                      OFF_T_FMT " diff " OFF_T_FMT " alloc " OFF_T_FMT
+                      " dumpers %d\n",
+                      debug_prefix_time(": adjust_diskspace"),
+                      holdp[i]->disk->name,
+                      (OFF_T_FMT_TYPE)holdp[i]->reserved,
+                      (OFF_T_FMT_TYPE)holdp[i]->used,
+                      (OFF_T_FMT_TYPE)diff,
+                      (OFF_T_FMT_TYPE)holdalloc(holdp[i]->disk)
+                                                            ->allocated_space,
+                      holdalloc(holdp[i]->disk)->allocated_dumpers ));
        holdp[i]->reserved += diff;
        amfree(hqname);
     }
 
     sched(diskp)->act_size = total;
 
-#ifdef HOLD_DEBUG
-    printf("%s: after: disk %s:%s used " OFF_T_FMT "\n",
-          debug_prefix_time(": adjust_diskspace"),
-          diskp->host->hostname, qname,
-          (OFF_T_FMT_TYPE)sched(diskp)->act_size);
-    fflush(stdout);
-#endif
+    hold_debug(1, ("%s: after: disk %s:%s used " OFF_T_FMT "\n",
+                  debug_prefix_time(": adjust_diskspace"),
+                  diskp->host->hostname, qname,
+                  (OFF_T_FMT_TYPE)sched(diskp)->act_size));
     amfree(qdest);
     amfree(qname);
 }
@@ -2557,8 +2580,8 @@ delete_diskspace(
        holdalloc(holdp[i]->disk)->allocated_space -= holdp[i]->used;
     }
 
-    unlink_holding_files(holdp[0]->destname);  /* no need for the entire list,
-                                                * because unlink_holding_files
+    holding_file_unlink(holdp[0]->destname);   /* no need for the entire list,
+                                                * because holding_file_unlink
                                                 * will walk through all files
                                                 * using cont_filename */
     free_assignedhd(sched(diskp)->holdp);
@@ -2812,12 +2835,16 @@ dump_to_tape(
        dumpsize = (off_t)0;
        if (*result_argv[5] == '"') {
            /* String was quoted */
+           OFF_T_FMT_TYPE dumpsize_ = (OFF_T_FMT_TYPE)0;
            rc = sscanf(result_argv[5],"\"[sec %lf kb " OFF_T_FMT " ",
-                       &tapetime, (OFF_T_FMT_TYPE *)&dumpsize);
+                       &tapetime, &dumpsize_);
+           dumpsize = (off_t)dumpsize_;
        } else {
            /* String was not quoted */
+           OFF_T_FMT_TYPE dumpsize_ = (OFF_T_FMT_TYPE)0;
            rc = sscanf(result_argv[5],"[sec %lf kb " OFF_T_FMT " ",
-                       &tapetime, (OFF_T_FMT_TYPE *)&dumpsize);
+                       &tapetime, &dumpsize_);
+           dumpsize = (off_t)dumpsize_;
        }
        if (rc < 2) {
            error("error [malformed result: %d items matched in '%s']",
index 04ed8527b451044c38e936f35f0f647e00697e09..8d5e495ff43114cc89da39193131d16e7f12545c 100644 (file)
@@ -25,7 +25,7 @@
  *                        University of Maryland at College Park
  */
 /*
- * $Id: driverio.c,v 1.92.2.2 2006/12/12 14:56:39 martinea Exp $
+ * $Id: driverio.c,v 1.92 2006/08/24 01:57:16 paddy_s Exp $
  *
  * I/O-related functions for driver program
  */
index 796a53f66639f8cb5135dd9ad0619247ec6ab00d..e1725c7cc48b55a4e134d0b79ff5e43df868620d 100644 (file)
 
 #include "event.h"
 
+#include "amanda.h"
 #include "holding.h"
 #include "server_util.h"
 
-#define MAX_DUMPERS 63
-
 #ifndef GLOBAL
 #define GLOBAL extern
 #endif
index a663612fe565d73bdb4a0550ef758a7ca677eec0..49982b2ffcb9755570d7ce5af24421143efe29b4 100644 (file)
@@ -23,7 +23,7 @@
  * Authors: the Amanda Development Team.  Its members are listed in a
  * file named AUTHORS, in the root directory of this distribution.
  */
-/* $Id: dumper.c,v 1.190.2.2 2006/11/08 17:11:41 martinea Exp $
+/* $Id: dumper.c,v 1.190 2006/08/30 19:53:57 martinea Exp $
  *
  * requests remote amandad processes to dump filesystems
  */
 #include "server_util.h"
 #include "util.h"
 
+#define dumper_debug(i,x) do {         \
+       if ((i) <= debug_dumper) {      \
+           dbprintf(x);                \
+       }                               \
+} while (0)
+
 #ifndef SEEK_SET
 #define SEEK_SET 0
 #endif
@@ -169,7 +175,7 @@ check_options(
     else if ((compmode = strstr(options, "srvcomp-cust=")) != NULL) {
        compend = strchr(compmode, ';');
        if (compend ) {
-           srvcompress = COMP_SERV_CUST;
+           srvcompress = COMP_SERVER_CUST;
            *compend = '\0';
            srvcompprog = stralloc(compmode + strlen("srvcomp-cust="));
            *compend = ';';
@@ -246,6 +252,9 @@ main(
     uid_t ruid;
     int    new_argc,   my_argc;
     char **new_argv, **my_argv;
+    struct addrinfo hints;
+    int res;
+    struct addrinfo *gaires = NULL;
 
     safe_fd(-1, 0);
 
@@ -261,7 +270,7 @@ main(
     erroutput_type = (ERR_AMANDALOG|ERR_INTERACTIVE);
     set_logerror(logerror);
 
-    parse_server_conf(main_argc, main_argv, &new_argc, &new_argv);
+    parse_conf(main_argc, main_argv, &new_argc, &new_argv);
     my_argc = new_argc;
     my_argv = new_argv;
 
@@ -327,7 +336,7 @@ main(
 
     signal(SIGPIPE, SIG_IGN);
 
-    conf_dtimeout = getconf_int(CNF_DTIMEOUT);
+    conf_dtimeout = (time_t)getconf_int(CNF_DTIMEOUT);
 
     protocol_init();
 
@@ -454,9 +463,32 @@ main(
                /*NOTREACHED*/
            }
 
-           if ((gethostbyname("localhost")) == NULL) {
-               errstr = newstralloc(errstr,
-                                    "could not resolve localhost");
+           /* Double-check that 'localhost' resolves properly */
+#ifdef WORKING_IPV6
+           hints.ai_flags = AI_CANONNAME | AI_V4MAPPED | AI_ALL;
+           hints.ai_family = AF_UNSPEC;
+#else
+           hints.ai_flags = AI_CANONNAME;
+           hints.ai_family = AF_INET;
+#endif
+           hints.ai_socktype = 0;
+           hints.ai_protocol = 0;
+           hints.ai_addrlen = 0;
+           hints.ai_addr = NULL;
+           hints.ai_canonname = NULL;
+           hints.ai_next = NULL;
+           res = getaddrinfo("localhost", NULL, &hints, &gaires);
+#ifdef WORKING_IPV6
+           if (res != 0) {
+               hints.ai_flags = AI_CANONNAME;
+               hints.ai_family = AF_UNSPEC;
+               res = getaddrinfo("localhost", NULL, &hints, &gaires);
+           }
+#endif
+           if (res != 0) {
+               errstr = newvstralloc(errstr,
+                                    _("could not resolve localhost: "),
+                                    gai_strerror(res), NULL);
                q = squotef(errstr);
                putresult(FAILED, "%s %s\n", handle, q);
                log_add(L_FAIL, "%s %s %s %d [%s]", hostname, qdiskname,
@@ -464,6 +496,8 @@ main(
                amfree(q);
                break;
            }
+           if (gaires) freeaddrinfo(gaires);
+
            /* connect outf to chunker/taper port */
 
            outfd = stream_client("localhost", taper_port,
@@ -688,6 +722,7 @@ parse_info_line(
        size_t len;
     } fields[] = {
        { "BACKUP", file.program, SIZEOF(file.program) },
+       { "DUMPER", file.dumper, SIZEOF(file.dumper) },
        { "RECOVER_CMD", file.recover_cmd, SIZEOF(file.recover_cmd) },
        { "COMPRESS_SUFFIX", file.comp_suffix, SIZEOF(file.comp_suffix) },
        { "SERVER_CUSTOM_COMPRESS", file.srvcompprog, SIZEOF(file.srvcompprog) },
@@ -947,7 +982,7 @@ finish_tapeheader(
 #ifndef UNCOMPRESS_OPT
 #define        UNCOMPRESS_OPT  ""
 #endif
-       if (srvcompress == COMP_SERV_CUST) {
+       if (srvcompress == COMP_SERVER_CUST) {
            snprintf(file->uncompress_cmd, SIZEOF(file->uncompress_cmd),
                     " %s %s |", srvcompprog, "-d");
            strncpy(file->comp_suffix, "cust", SIZEOF(file->comp_suffix) - 1);
@@ -1024,13 +1059,12 @@ write_tapeheader(
 
     build_header(buffer, file, SIZEOF(buffer));
 
-    written = write(outfd, buffer, SIZEOF(buffer));
+    written = fullwrite(outfd, buffer, SIZEOF(buffer));
     if(written == (ssize_t)sizeof(buffer))
        return 0;
     if(written < 0)
        return written;
 
-    errno = ENOSPC;
     return -1;
 }
 
@@ -1300,11 +1334,6 @@ read_mesgfd(
        break;
     }
 
-    /*
-     * Reset the timeout for future reads
-     */
-    timeout(conf_dtimeout);
-
     if (ISSET(status, GOT_INFO_ENDLINE) && !ISSET(status, HEADER_DONE)) {
        SET(status, HEADER_DONE);
        /* time to do the header */
@@ -1340,6 +1369,11 @@ read_mesgfd(
        security_stream_read(streams[DATAFD].fd, read_datafd, db);
        set_datafd = 1;
     }
+
+    /*
+     * Reset the timeout for future reads
+     */
+    timeout(conf_dtimeout);
 }
 
 /*
@@ -1366,11 +1400,6 @@ read_datafd(
        return;
     }
 
-    /*
-     * Reset the timeout for future reads
-     */
-    timeout(conf_dtimeout);
-
     /* The header had better be written at this point */
     assert(ISSET(status, HEADER_DONE));
 
@@ -1403,6 +1432,12 @@ read_datafd(
        stop_dump();
        return;
     }
+
+    /*
+     * Reset the timeout for future reads
+     */
+    timeout(conf_dtimeout);
+
     security_stream_read(streams[DATAFD].fd, read_datafd, cookie);
 }
 
@@ -1564,7 +1599,7 @@ runcompress(
            /*NOTREACHED*/
        }
        safe_fd(-1, 0);
-       if (comptype != COMP_SERV_CUST) {
+       if (comptype != COMP_SERVER_CUST) {
            execlp(COMPRESS_PATH, COMPRESS_PATH, (  comptype == COMP_BEST ?
                COMPRESS_BEST_OPT : COMPRESS_FAST_OPT), (char *)NULL);
            error("error: couldn't exec %s: %s", COMPRESS_PATH, strerror(errno));
@@ -1652,8 +1687,6 @@ sendbackup_response(
     assert(response_error != NULL);
     assert(sech != NULL);
 
-    security_close_connection(sech, hostname);
-
     if (pkt == NULL) {
        errstr = newvstralloc(errstr, "[request failed: ",
            security_geterror(sech), "]", NULL);
@@ -1661,6 +1694,8 @@ sendbackup_response(
        return;
     }
 
+    security_close_connection(sech, hostname);
+
     extra = NULL;
     memset(ports, 0, SIZEOF(ports));
     if (pkt->type == P_NAK) {
@@ -1761,11 +1796,9 @@ bad_nak:
            }
 
            while((p = strchr(tok, ';')) != NULL) {
+               char ch;
                *p++ = '\0';
-#define sc "features="
-               if(strncmp(tok, sc, SIZEOF(sc) - 1) == 0) {
-                   tok += SIZEOF(sc) - 1;
-#undef sc
+               if(strncmp_const_skip(tok, "features=", tok, ch) == 0) {
                    am_release_feature_set(their_features);
                    if((their_features = am_string_to_feature(tok)) == NULL) {
                        errstr = newvstralloc(errstr,
@@ -1815,7 +1848,7 @@ bad_nak:
         * with old clients.
         * It is wrong to delve into sech, but we have no choice here.
         */
-       if (strcasecmp(sech->driver->name, "krb4") != 0 && i == INDEXFD)
+       if (strcasecmp(sech->driver->name, "krb4") == 0 && i == INDEXFD)
            continue;
 #endif
        if (security_stream_auth(streams[i].fd) < 0) {
@@ -1837,7 +1870,6 @@ bad_nak:
 
     /* everything worked */
     *response_error = 0;
-    security_close_connection(sech, hostname);
     return;
 
 parse_error:
@@ -1848,13 +1880,11 @@ parse_error:
                          NULL);
     amfree(extra);
     *response_error = 2;
-    security_close_connection(sech, hostname);
     return;
 
 connect_error:
     stop_dump();
     *response_error = 1;
-    security_close_connection(sech, hostname);
 }
 
 static char *
@@ -1899,7 +1929,7 @@ startup_dump(
     char *authopt, *endauthopt, authoptbuf[80];
     int response_error;
     const security_driver_t *secdrv;
-    char *dumper_api;
+    char *backup_api;
     int has_features;
     int has_hostname;
     int has_device;
@@ -1938,11 +1968,11 @@ startup_dump(
     }
 
     snprintf(level_string, SIZEOF(level_string), "%d", level);
-    if(strncmp(progname, "DUMP", 4) == 0
-       || strncmp(progname, "GNUTAR", 6) == 0) {
-       dumper_api = "";
+    if(strcmp(progname, "DUMP") == 0
+       || strcmp(progname, "GNUTAR") == 0) {
+       backup_api = "";
     } else {
-       dumper_api = "DUMPER ";
+       backup_api = "BACKUP ";
     }
     req = vstralloc("SERVICE sendbackup\n",
                    "OPTIONS ",
@@ -1956,7 +1986,7 @@ startup_dump(
                    has_config   ? config_name : "",
                    has_config   ? ";" : "",
                    "\n",
-                   dumper_api, progname,
+                   backup_api, progname,
                    " ", qdiskname,
                    " ", device && has_device ? device : "",
                    " ", level_string,
index 1b7715097d3c25f78835423a6590f39c8396d7d1..2e5dd1813489907296df8d3502bdc0f4b0c3a01e 100644 (file)
@@ -25,7 +25,7 @@
  *                        University of Maryland at College Park
  */
 /*
- * $Id: find.c,v 1.33.2.1 2006/09/19 19:34:27 martinea Exp $
+ * $Id: find.c,v 1.33 2006/07/06 13:13:15 martinea Exp $
  *
  * controlling process for the Amanda backup system
  */
@@ -106,7 +106,7 @@ find_dump(
            logs += search_logfile(&output_find, tp->label, tp->datestamp, logfile);
        }
        if(logs == 0 && strcmp(tp->datestamp,"0") != 0)
-           printf("Warning: no log files found for tape %s written %s\n",
+           fprintf(stderr, "Warning: no log files found for tape %s written %s\n",
                   tp->label, find_nicedate(tp->datestamp));
     }
     amfree(logfile);
@@ -189,7 +189,7 @@ find_log(void)
            }
        }
        if(logs == 0 && strcmp(tp->datestamp,"0") != 0)
-           printf("Warning: no log files found for tape %s written %s\n",
+           fprintf(stderr, "Warning: no log files found for tape %s written %s\n",
                   tp->label, find_nicedate(tp->datestamp));
     }
     amfree(logfile);
@@ -272,105 +272,53 @@ void
 search_holding_disk(
     find_result_t **output_find)
 {
-    holdingdisk_t *hdisk;
-    sl_t  *holding_list;
-    sle_t *dir;
-    char *sdirname = NULL;
-    char *destname = NULL;
-    char *hostname = NULL;
-    char *diskname = NULL;
-    DIR *workdir;
-    struct dirent *entry;
-    int level = 0;
+    sl_t  *holding_file_list;
+    sle_t *e;
+    char *holding_file;
     disk_t *dp;
-    int fd;
-    ssize_t result;
-    char buf[DISK_BLOCK_BYTES];
     dumpfile_t file;
 
-    holding_list = pick_all_datestamp(1);
+    holding_file_list = holding_get_files(NULL, NULL, 1);
 
-    for(hdisk = getconf_holdingdisks(); hdisk != NULL; hdisk = hdisk->next) {
-       for(dir = holding_list->first; dir != NULL; dir = dir->next) {
-           sdirname = newvstralloc(sdirname,
-                                   holdingdisk_get_diskdir(hdisk), "/", dir->name,
-                                   NULL);
-           if((workdir = opendir(sdirname)) == NULL) {
-               continue;
-           }
+    for(e = holding_file_list->first; e != NULL; e = e->next) {
+       holding_file = e->name;
 
-           while((entry = readdir(workdir)) != NULL) {
-               if(is_dot_or_dotdot(entry->d_name)) {
-                   continue;
-               }
-               destname = newvstralloc(destname,
-                                       sdirname, "/", entry->d_name,
-                                       NULL);
-               if(is_emptyfile(destname)) {
-                   continue;
-               }
-               amfree(hostname);
-               amfree(diskname);
-               if(get_amanda_names(destname, &hostname, &diskname, &level) != F_DUMPFILE) {
-                   continue;
-               }
-               if(level < 0 || level > 9)
-                   continue;
-               if ((fd = open(destname, O_RDONLY)) == -1) {
-                   continue;
-               }
-               if((result = read(fd, &buf, DISK_BLOCK_BYTES)) <= 0) {
-                   continue;
-               }
-               close(fd);
+       if (!holding_file_get_dumpfile(holding_file, &file))
+           continue;
 
-               parse_file_header(buf, &file, (size_t)result);
-               if (strcmp(file.name, hostname) != 0 ||
-                   strcmp(file.disk, diskname) != 0 ||
-                   file.dumplevel != level ||
-                   !match_datestamp(file.datestamp, dir->name)) {
-                   continue;
-               }
+       if (file.dumplevel < 0 || file.dumplevel > 9)
+           continue;
 
-               dp = NULL;
-               for(;;) {
-                   char *s;
-                   if((dp = lookup_disk(hostname, diskname)))
-                       break;
-                   if((s = strrchr(hostname,'.')) == NULL)
-                       break;
-                   *s = '\0';
-               }
-               if ( dp == NULL ) {
-                   continue;
-               }
+       dp = NULL;
+       for(;;) {
+           char *s;
+           if((dp = lookup_disk(file.name, file.disk)))
+               break;
+           if((s = strrchr(file.name,'.')) == NULL)
+               break;
+           *s = '\0';
+       }
+       if ( dp == NULL ) {
+           continue;
+       }
 
-               if(find_match(hostname,diskname)) {
-                   find_result_t *new_output_find =
-                       alloc(SIZEOF(find_result_t));
-                   new_output_find->next=*output_find;
-                   new_output_find->timestamp=stralloc(file.datestamp);
-                   new_output_find->hostname=hostname;
-                   hostname = NULL;
-                   new_output_find->diskname=diskname;
-                   diskname = NULL;
-                   new_output_find->level=level;
-                   new_output_find->label=stralloc(destname);
-                   new_output_find->partnum=stralloc("--");
-                   new_output_find->filenum=0;
-                   new_output_find->status=stralloc("OK");
-                   *output_find=new_output_find;
-               }
-           }
-           closedir(workdir);
-       }       
-    }
-    free_sl(holding_list);
-    holding_list = NULL;
-    amfree(destname);
-    amfree(sdirname);
-    amfree(hostname);
-    amfree(diskname);
+       if(find_match(file.name,file.disk)) {
+           find_result_t *new_output_find =
+               alloc(SIZEOF(find_result_t));
+           new_output_find->next=*output_find;
+           new_output_find->timestamp = stralloc(file.datestamp);
+           new_output_find->hostname = stralloc(file.name);
+           new_output_find->diskname = stralloc(file.disk);
+           new_output_find->level=file.dumplevel;
+           new_output_find->label=stralloc(holding_file);
+           new_output_find->partnum=stralloc("--");
+           new_output_find->filenum=0;
+           new_output_find->status=stralloc("OK");
+           *output_find=new_output_find;
+       }
+    }
+
+    free_sl(holding_file_list);
 }
 
 static int
@@ -650,13 +598,9 @@ parse_taper_datestamp_log(
     if(ch == '\0') {
        return 0;
     }
-#define sc "datestamp"
-    if(strncmp(s - 1, sc, SIZEOF(sc)-1) != 0) {
+    if(strncmp_const_skip(s - 1, "datestamp", s, ch) != 0) {
        return 0;
     }
-    s += SIZEOF(sc)-1;
-    ch = s[-1];
-#undef sc
 
     skip_whitespace(s, ch);
     if(ch == '\0') {
@@ -670,13 +614,9 @@ parse_taper_datestamp_log(
     if(ch == '\0') {
        return 0;
     }
-#define sc "label"
-    if(strncmp(s - 1, sc, SIZEOF(sc)-1) != 0) {
+    if(strncmp_const_skip(s - 1, "label", s, ch) != 0) {
        return 0;
     }
-    s += SIZEOF(sc)-1;
-    ch = s[-1];
-#undef sc
 
     skip_whitespace(s, ch);
     if(ch == '\0') {
index 4b4ebee789f8a879aef0e755c2e8f82573f1f2ab..9d8394daa72ab298d544557b083176752df4ae8a 100644 (file)
@@ -25,7 +25,7 @@
  *                        University of Maryland at College Park
  */
 /*
- * $Id: getconf.c,v 1.26.2.3 2007/01/16 12:36:47 martinea Exp $
+ * $Id: getconf.c,v 1.26 2006/07/25 19:00:56 martinea Exp $
  *
  * a little wrapper to extract config variables for shell scripts
  */
@@ -434,7 +434,7 @@ main(
 
     malloc_size_1 = malloc_inuse(&malloc_hist_1);
 
-    parse_server_conf(argc, argv, &new_argc, &new_argv);
+    parse_conf(argc, argv, &new_argc, &new_argv);
     my_argc = new_argc;
     my_argv = new_argv;
 
index bcc580ac3c9875c6b1ce0a996dab4813fbab8add..7d9ee32362c3ebf481ae1bd676b3f8eecff6ac99 100644 (file)
 #include "fileheader.h"
 #include "logfile.h"
 
-static sl_t *scan_holdingdisk(sl_t *holding_list, char *diskdir, int verbose);
-static sl_t *scan_holdingdir(sl_t *holding_list, holdingdisk_t *holdp, char *datestamp);
+/*
+ * utilities */
 
-int
+/* Is fname a directory?
+ *
+ * @param fname: filename (fully qualified)
+ * @returns: boolean
+ */
+static int is_dir(char *fname);
+
+/* sanity check that datestamp is of the form YYYYMMDD or 
+ * YYYYMMDDhhmmss
+ *
+ * @param fname: a filename (without directory)
+ * @returns: boolean
+ */
+static int is_datestr(char *fname);
+
+/*
+ * Static variables */
+static int verbose = 0;
+
+/*
+ * Static functions */
+
+static int
 is_dir(
     char *fname)
 {
@@ -49,7 +71,7 @@ is_dir(
     return (statbuf.st_mode & S_IFDIR) == S_IFDIR;
 }
 
-int
+static int
 is_emptyfile(
     char *fname)
 {
@@ -61,12 +83,7 @@ is_emptyfile(
                (statbuf.st_size == (off_t)0);
 }
 
-
-/*
- * sanity check on datestamp of the form YYYYMMDD or YYYYMMDDhhmmss
- */
-
-int
+static int
 is_datestr(
     char *fname)
 {
@@ -113,228 +130,470 @@ is_datestr(
     return 1;
 }
 
-
+/*
+ * Verbosity
+ */
 int
-non_empty(
-    char *     fname)
+holding_set_verbosity(int v)
 {
-    DIR *dir;
-    struct dirent *entry;
-    int gotentry;
-
-    if((dir = opendir(fname)) == NULL)
-       return 0;
-
-    gotentry = 0;
-    while(!gotentry && (entry = readdir(dir)) != NULL) {
-       gotentry = !is_dot_or_dotdot(entry->d_name);
-    }
-
-    closedir(dir);
-    return gotentry;
+    int old = verbose;
+    verbose = v;
+    return old;
 }
 
+/*
+ * Holding directories
+ */
 
-static sl_t *
-scan_holdingdisk(
-    sl_t *     holding_list,
-    char *     diskdir,
-    int                verbose)
+static void
+holding_get_directories_per_disk(
+    char *hdisk,
+    sl_t *date_list,
+    int fullpaths,
+    sl_t *rv)
 {
-    DIR *topdir;
+    DIR *dir;
     struct dirent *workdir;
-    char *entryname = NULL;
-
-    if((topdir = opendir(diskdir)) == NULL) {
-       if(verbose && errno != ENOENT)
-          printf("Warning: could not open holding dir %s: %s\n",
-                 diskdir, strerror(errno));
-       return holding_list;
+    char *hdir = NULL;
+    sle_t *dl;
+    int date_found;
+
+    if ((dir = opendir(hdisk)) == NULL) {
+        if (verbose && errno != ENOENT)
+           printf(_("Warning: could not open holding disk %s: %s\n"),
+                  hdisk, strerror(errno));
+        return;
     }
 
-    /* find all directories of the right format  */
-
-    if(verbose)
-       printf("Scanning %s...\n", diskdir);
-    while((workdir = readdir(topdir)) != NULL) {
-       if(is_dot_or_dotdot(workdir->d_name)) {
-           continue;
-       }
-       entryname = newvstralloc(entryname,
-                                diskdir, "/", workdir->d_name, NULL);
-       if(verbose) {
-           printf("  %s: ", workdir->d_name);
-       }
-       if(!is_dir(entryname)) {
-           if(verbose) {
-               puts("skipping cruft file, perhaps you should delete it.");
-           }
-       } else if(!is_datestr(workdir->d_name)) {
-           if(verbose && (strcmp(workdir->d_name, "lost+found")!=0) ) {
-               puts("skipping cruft directory, perhaps you should delete it.");
+    if (verbose)
+        printf(_("Scanning %s...\n"), hdisk);
+
+    while ((workdir = readdir(dir)) != NULL) {
+        if (is_dot_or_dotdot(workdir->d_name))
+            continue;
+
+        if(verbose) 
+            printf("  %s: ", workdir->d_name);
+            
+        hdir = newvstralloc(hdir,
+                     hdisk, "/", workdir->d_name,
+                     NULL);
+
+        /* filter out various undesirables */
+        if (!is_dir(hdir)) {
+            if (verbose)
+                puts(_("skipping cruft file, perhaps you should delete it."));
+        } else if (!is_datestr(workdir->d_name)) {
+            /* EXT2/3 leave these in the root of each volume */
+            if (strcmp(workdir->d_name, "lost+found")==0)
+                puts(_("skipping system directory"));
+            if (verbose)
+                puts(_("skipping cruft directory, perhaps you should delete it."));
+        } else {
+            /* found a holding directory -- keep it */
+           if (date_list) {
+               date_found = 0;
+               for (dl= date_list->first; dl != NULL; dl = dl->next) {
+                   if (strcmp(dl->name, workdir->d_name) == 0) {
+                       date_found = 1;
+                       break;
+                   }
+               }
+           } else {
+               date_found = 1;
            }
-       } else {
-           holding_list = insert_sort_sl(holding_list, workdir->d_name);
-           if(verbose) {
-               puts("found Amanda directory.");
+           if (date_found == 1) {
+               if (fullpaths)
+                    rv = insert_sort_sl(rv, hdir);
+               else
+                    rv = insert_sort_sl(rv, workdir->d_name);
+               if (verbose) {
+                    puts(_("found Amanda directory."));
+               }
            }
-       }
+        }
     }
-    closedir(topdir);
-    amfree(entryname);
-    return holding_list;
+
+    if (hdir) amfree(hdir);
 }
 
 
-static sl_t *
-scan_holdingdir(
-    sl_t *             holding_list,
-    holdingdisk_t *    holdp,
-    char *             datestamp)
+sl_t *
+holding_get_directories(
+    char *hdisk,
+    sl_t *date_list,
+    int fullpaths)
 {
-    DIR *workdir;
-    struct dirent *entry;
-    char *dirname = NULL;
-    char *destname = NULL;
-    disk_t *dp;
-    dumpfile_t file;
+    holdingdisk_t *hdisk_conf;
+    sl_t *rv;
 
-    dirname = vstralloc(holdingdisk_get_diskdir(holdp), "/", datestamp, NULL);
-    if((workdir = opendir(dirname)) == NULL) {
-       if(errno != ENOENT)
-           log_add(L_INFO, "%s: could not open dir: %s",
-                   dirname, strerror(errno));
-       amfree(dirname);
-       return holding_list;
+    rv = new_sl();
+    if (!rv) {
+        return NULL;
     }
-    if ((chdir(dirname)) == -1) {
-       log_add(L_INFO, "%s: could not chdir: %s",
-                   dirname, strerror(errno));
-       amfree(dirname);
-       return holding_list;
+
+    /* call _per_disk for the hdisk we were given, or for all
+     * hdisks if we were given NULL */
+    if (hdisk) {
+        holding_get_directories_per_disk(hdisk, date_list, fullpaths, rv);
+    } else {
+        for (hdisk_conf = getconf_holdingdisks(); 
+                    hdisk_conf != NULL;
+                    hdisk_conf = hdisk_conf->next) {
+            hdisk = holdingdisk_get_diskdir(hdisk_conf);
+            holding_get_directories_per_disk(hdisk, date_list, fullpaths, rv);
+        }
     }
 
-    while((entry = readdir(workdir)) != NULL) {
-       if(strcmp(entry->d_name, ".") == 0 || strcmp(entry->d_name, "..") == 0)
-           continue;
+    return rv;
+}
 
-       if(is_emptyfile(entry->d_name))
-           continue;
+/*
+ * Holding files
+ */
+static void
+holding_get_files_per_dir(
+    char *hdir,
+    int fullpaths,
+    sl_t *rv)
+{
+    DIR *dir;
+    struct dirent *workdir;
+    char *hfile = NULL;
+    dumpfile_t dumpf;
+    int dumpf_ok;
+
+    if ((dir = opendir(hdir)) == NULL) {
+        if (verbose && errno != ENOENT)
+           printf(_("Warning: could not open holding dir %s: %s\n"),
+                  hdir, strerror(errno));
+        return;
+    }
 
-       destname = newvstralloc(destname,
-                               dirname, "/", entry->d_name,
-                               NULL);
-       get_dumpfile(destname, &file);
-       if( file.type != F_DUMPFILE) {
-           if( file.type != F_CONT_DUMPFILE )
-               log_add(L_INFO, "%s: ignoring cruft file.", entry->d_name);
+    if (verbose)
+        printf(_("Scanning %s...\n"), hdir);
+
+    while ((workdir = readdir(dir)) != NULL) {
+        if (is_dot_or_dotdot(workdir->d_name))
+            continue;
+
+        hfile = newvstralloc(hfile,
+                     hdir, "/", workdir->d_name,
+                     NULL);
+
+        /* filter out various undesirables */
+        if (is_emptyfile(hfile))
+            continue;
+
+        if (is_dir(hfile)) {
+            if (verbose)
+                printf(_("%s: ignoring directory\n"), hfile);
+            continue;
+        }
+
+        if (!(dumpf_ok=holding_file_get_dumpfile(hfile, &dumpf)) ||
+            dumpf.type != F_DUMPFILE) {
+            if (dumpf_ok && dumpf.type == F_CONT_DUMPFILE)
+                continue; /* silently skip expected file */
+            if (verbose)
+                printf(_("%s: not a dumpfile\n"), hfile);
+            continue;
+        }
+
+       if (dumpf.dumplevel < 0 || dumpf.dumplevel > 9) {
+            if (verbose)
+                printf(_("%s: ignoring file with bogus dump level %d.\n"),
+                       hfile, dumpf.dumplevel);
            continue;
        }
 
-       dp = lookup_disk(file.name, file.disk);
+        /* found a holding file -- keep it */
+        if (fullpaths)
+            rv = insert_sort_sl(rv, hfile);
+        else
+            rv = insert_sort_sl(rv, workdir->d_name);
+    }
 
-       if (dp == NULL) {
-           log_add(L_INFO, "%s: disk %s:%s not in database, skipping it.",
-                   entry->d_name, file.name, file.disk);
-           continue;
-       }
+    if (hfile) amfree(hfile);
+}
 
-       if(file.dumplevel < 0 || file.dumplevel > 9) {
-           log_add(L_INFO, "%s: ignoring file with bogus dump level %d.",
-                   entry->d_name, file.dumplevel);
-           continue;
-       }
+sl_t *
+holding_get_files(
+    char *hdir,
+    sl_t *date_list,
+    int fullpaths)
+{
+    sl_t *hdirs;
+    sle_t *e;
+    sl_t *rv;
 
-       holding_list = append_sl(holding_list, destname);
+    rv = new_sl();
+    if (!rv) {
+        return NULL;
     }
-    closedir(workdir);
-    amfree(dirname);
-    amfree(destname);
-    return holding_list;
-}
 
+    /* call _per_dir for the hdir we were given, or for all
+     * hdir if we were given NULL */
+    if (hdir) {
+        holding_get_files_per_dir(hdir, fullpaths, rv);
+    } else {
+        hdirs = holding_get_directories(NULL, date_list, 1);
+        for (e = hdirs->first; e != NULL; e = e->next) {
+            holding_get_files_per_dir(e->name, fullpaths, rv);
+        }
+    }
 
+    return rv;
+}
 
 sl_t *
-get_flush(
+holding_get_files_for_flush(
     sl_t *dateargs,
-    char *datestamp,  /* don't do this date */
-    int amflush,
-    int verbose)
+    int interactive)
 {
-    sl_t *holding_list;
     sl_t *date_list;
+    sl_t *file_list;
+    sl_t *result_list;
     sle_t *datearg;
     sle_t *date, *next_date;
-    holdingdisk_t *hdisk;
-    char current_dir[PATH_MAX];
+    sle_t *file_elt;
+    disk_t *dp;
+    char *host;
+    char *disk;
+    char *datestamp;
+    filetype_t filetype;
+
+    /* make date_list the intersection of available holding directories and
+     * the dateargs parameter.  */
+    if (dateargs) {
+        int ok;
+
+        date_list = pick_all_datestamp(verbose);
+        for (date = date_list->first; date != NULL;) {
+            next_date = date->next;
+            ok = 0;
+            for(datearg=dateargs->first; datearg != NULL && ok==0;
+                datearg = datearg->next) {
+                ok = match_datestamp(datearg->name, date->name);
+            }
+            if(ok == 0) { /* remove dir */
+                remove_sl(date_list, date);
+            }
+            date = next_date;
+        }
+    }
+    else {
+        /* no date args were provided, so use everything */
+        if (interactive)
+            date_list = pick_datestamp(verbose);
+        else
+            date_list = pick_all_datestamp(verbose);
+    }
 
-    holding_list = new_sl();
+    result_list = new_sl();
+    if (!result_list) {
+        return NULL;
+    }
 
-    if (getcwd(current_dir, SIZEOF(current_dir)-1) == NULL) {
-       log_add(L_INFO, "get_flush: could get current working directory: %s",
-                   strerror(errno));
-       return holding_list;
+    /* loop over *all* files, checking each one */
+    file_list = holding_get_files(NULL, date_list, 1);
+    for (file_elt = file_list->first; file_elt != NULL; file_elt = file_elt->next) {
+        /* get info on that file */
+        filetype = holding_file_read_header(file_elt->name, &host, &disk, NULL, &datestamp);
+        if (filetype != F_DUMPFILE)
+            continue;
+
+        /* check that the hostname and disk are in the disklist */
+        dp = lookup_disk(host, disk);
+        if (dp == NULL) {
+            if (verbose)
+               printf(_("%s: disk %s:%s not in database, skipping it."),
+                        file_elt->name, host, disk);
+            continue;
+        }
+
+        /* passed all tests -- we'll flush this file */
+        result_list = insert_sort_sl(result_list, file_elt->name);
     }
 
-    if(dateargs) {
-       int ok;
+    if (date_list) free_sl(date_list);
+    if (file_list) free_sl(file_list);
 
-       date_list = pick_all_datestamp(verbose);
-       for(date = date_list->first; date != NULL;) {
-           next_date = date->next;
-           ok = 0;
-           for(datearg=dateargs->first; datearg != NULL && ok==0;
-               datearg = datearg->next) {
-               ok = match_datestamp(datearg->name, date->name);
-           }
-           if(ok == 0) { /* remove dir */
-               remove_sl(date_list, date);
-           }
-           date = next_date;
-       }
+    return result_list;
+}
+
+sl_t *
+holding_get_file_chunks(char *hfile)
+{
+    dumpfile_t file;
+    char *filename;
+    sl_t *rv = new_sl();
+
+    if (!rv) {
+        return NULL;
     }
-    else if (amflush) {
-       date_list = pick_datestamp(verbose);
+
+    /* Loop through all cont_filenames (subsequent chunks) */
+    filename = stralloc(hfile);
+    while (filename != NULL && filename[0] != '\0') {
+        /* get the header to look for cont_filename */
+        if (!holding_file_get_dumpfile(filename, &file)) {
+            if (verbose)
+                printf(_("holding_get_file_chunks: open of %s failed.\n"), filename);
+            amfree(filename);
+            return rv;
+        }
+
+        /* add the file to the results */
+        insert_sort_sl(rv, filename);
+
+        /* and go on to the next chunk */
+        filename = newstralloc(filename, file.cont_filename);
     }
-    else {
-       date_list = pick_all_datestamp(verbose);
+    amfree(filename);
+    return rv;
+}
+
+off_t
+holding_file_size(
+    char *hfile,
+    int strip_headers)
+{
+    dumpfile_t file;
+    char *filename;
+    off_t size = (off_t)0;
+    struct stat finfo;
+
+    /* (note: we don't use holding_get_file_chunks here because that would
+     * entail opening each file twice) */
+
+    /* Loop through all cont_filenames (subsequent chunks) */
+    filename = stralloc(hfile);
+    while (filename != NULL && filename[0] != '\0') {
+        /* stat the file for its size */
+        if (stat(filename, &finfo) == -1) {
+            if (verbose)
+                printf(_("stat %s: %s\n"), filename, strerror(errno));
+            return (off_t)-1;
+        }
+        size += (finfo.st_size+(off_t)1023)/(off_t)1024;
+        if (strip_headers)
+            size -= (off_t)(DISK_BLOCK_BYTES / 1024);
+
+        /* get the header to look for cont_filename */
+        if (!holding_file_get_dumpfile(filename, &file)) {
+            if (verbose)
+                printf(_("holding_file_size: open of %s failed.\n"), filename);
+            amfree(filename);
+            return (off_t)-1;
+        }
+
+        /* on to the next chunk */
+        filename = newstralloc(filename, file.cont_filename);
     }
+    amfree(filename);
+    return size;
+}
 
-    for(date = date_list->first; date !=NULL; date = date->next) {
-       if(!datestamp || strcmp(datestamp,date->name) != 0) {
-           for(hdisk = getconf_holdingdisks(); hdisk != NULL;
-                                               hdisk = hdisk->next) {
-               holding_list = scan_holdingdir(holding_list, hdisk, date->name);
-           }
-       }
+
+int
+holding_file_unlink(
+    char *hfile)
+{
+    sl_t *chunklist;
+    sle_t *chunk;
+
+    chunklist = holding_get_file_chunks(hfile);
+    if (!chunklist)
+        return 0;
+
+    for (chunk = chunklist->first; chunk != NULL; chunk = chunk->next) {
+        if (unlink(chunk->name)<0) {
+            if (verbose)
+                printf(_("holding_file_unlink: could not unlink %s: %s\n"),
+                    chunk->name, strerror(errno));
+            return 0;
+        }
+    }
+
+    return 1;
+}
+
+filetype_t
+holding_file_read_header( 
+    char *     fname,
+    char **    hostname,
+    char **    diskname,
+    int *      level,
+    char ** datestamp)
+{
+    dumpfile_t file;
+
+    if (hostname) *hostname = NULL;
+    if (diskname) *diskname = NULL;
+    if (datestamp) *datestamp = NULL;
+
+    if (!holding_file_get_dumpfile(fname, &file)) {
+        return F_UNKNOWN;
+    }
+
+    if(file.type != F_DUMPFILE && file.type != F_CONT_DUMPFILE) {
+        return file.type;
     }
 
-    free_sl(date_list);
-    date_list = NULL;
-    if (chdir(current_dir) == -1) {
-       log_add(L_INFO, "%s: could not chdir: %s",
-                   current_dir, strerror(errno));
+    if (hostname) *hostname = stralloc(file.name);
+    if (diskname) *diskname = stralloc(file.disk);
+    if (level) *level = file.dumplevel;
+    if (datestamp) *datestamp = stralloc(file.datestamp);
+
+    return file.type;
+}
+
+
+int
+holding_file_get_dumpfile(
+    char *     fname,
+    dumpfile_t *file)
+{
+    char buffer[DISK_BLOCK_BYTES];
+    int fd;
+
+    memset(buffer, 0, sizeof(buffer));
+
+    fh_init(file);
+    file->type = F_UNKNOWN;
+    if((fd = open(fname, O_RDONLY)) == -1)
+        return 0;
+
+    if(fullread(fd, buffer, SIZEOF(buffer)) != (ssize_t)sizeof(buffer)) {
+        aclose(fd);
+        return 0;
     }
-    return(holding_list);
+    aclose(fd);
+
+    parse_file_header(buffer, file, SIZEOF(buffer));
+    return 1;
 }
 
+/*
+ * Interactive functions 
+ */
 
 sl_t *
 pick_all_datestamp(
-    int                verbose)
+    int        v)
 {
-    sl_t *holding_list = NULL;
-    holdingdisk_t *hdisk;
+    int old_verbose = holding_set_verbosity(v);
+    sl_t *rv;
 
-    holding_list = new_sl();
-    for(hdisk = getconf_holdingdisks(); hdisk != NULL; hdisk = hdisk->next)
-       holding_list = scan_holdingdisk(holding_list, holdingdisk_get_diskdir(hdisk), verbose);
+    /* get all holding directories, without full paths -- this
+     * will be datestamps only */
+    rv = holding_get_directories(NULL, NULL, 0);
 
-    return holding_list;
+    holding_set_verbosity(old_verbose);
+    return rv;
 }
 
-
 sl_t *
 pick_datestamp(
     int                verbose)
@@ -364,14 +623,14 @@ pick_datestamp(
        }
 
        while(1) {
-           puts("\nMultiple Amanda directories, please pick one by letter:");
+           puts(_("\nMultiple Amanda directories, please pick one by letter:"));
            for(dir = holding_list->first, max_char = 'A';
                dir != NULL && max_char <= 'Z';
                dir = dir->next, max_char++) {
                printf("  %c. %s\n", max_char, dir->name);
            }
            max_char--;
-           printf("Select directories to flush [A..%c]: [ALL] ", max_char);
+           printf(_("Select directories to flush [A..%c]: [ALL] "), max_char);
            fflush(stdout); fflush(stderr);
            amfree(answer);
            if ((answer = agets(stdin)) == NULL) {
@@ -414,144 +673,9 @@ pick_datestamp(
     return holding_list;
 }
 
-
-filetype_t
-get_amanda_names( char *       fname,
-    char **    hostname,
-    char **    diskname,
-    int *      level)
-{
-    dumpfile_t file;
-    char buffer[DISK_BLOCK_BYTES];
-    int fd;
-    *hostname = *diskname = NULL;
-
-    memset(buffer, 0, sizeof(buffer));
-    if((fd = open(fname, O_RDONLY)) == -1)
-       return F_UNKNOWN;
-
-    if(fullread(fd, buffer, SIZEOF(buffer)) != (ssize_t)sizeof(buffer)) {
-       aclose(fd);
-       return F_UNKNOWN;
-    }
-    aclose(fd);
-
-    parse_file_header(buffer, &file, SIZEOF(buffer));
-    if(file.type != F_DUMPFILE && file.type != F_CONT_DUMPFILE) {
-       return file.type;
-    }
-    *hostname = stralloc(file.name);
-    *diskname = stralloc(file.disk);
-    *level = file.dumplevel;
-
-    return file.type;
-}
-
-
-void
-get_dumpfile(
-    char *     fname,
-    dumpfile_t *file)
-{
-    char buffer[DISK_BLOCK_BYTES];
-    int fd;
-
-    memset(buffer, 0, sizeof(buffer));
-
-    fh_init(file);
-    file->type = F_UNKNOWN;
-    if((fd = open(fname, O_RDONLY)) == -1)
-       return;
-
-    if(fullread(fd, buffer, SIZEOF(buffer)) != (ssize_t)sizeof(buffer)) {
-       aclose(fd);
-       return;
-    }
-    aclose(fd);
-
-    parse_file_header(buffer, file, SIZEOF(buffer));
-    return;
-}
-
-
-off_t
-size_holding_files(
-    char *     holding_file,
-    int                strip_headers)
-{
-    int fd;
-    ssize_t buflen;
-    char buffer[DISK_BLOCK_BYTES];
-    dumpfile_t file;
-    char *filename;
-    off_t size = (off_t)0;
-    struct stat finfo;
-
-    memset(buffer, 0, sizeof(buffer));
-    filename = stralloc(holding_file);
-    while(filename != NULL && filename[0] != '\0') {
-       if((fd = open(filename,O_RDONLY)) == -1) {
-           fprintf(stderr,"size_holding_files: open of %s failed: %s\n",filename,strerror(errno));
-           amfree(filename);
-           return (off_t)-1;
-       }
-       if ((buflen = fullread(fd, buffer, SIZEOF(buffer))) > 0) {
-               parse_file_header(buffer, &file, (size_t)buflen);
-       }
-       close(fd);
-       if(stat(filename, &finfo) == -1) {
-           printf("stat %s: %s\n", filename, strerror(errno));
-           finfo.st_size = (off_t)0;
-       }
-       size += (finfo.st_size+(off_t)1023)/(off_t)1024;
-       if(strip_headers)
-           size -= (off_t)(DISK_BLOCK_BYTES / 1024);
-       if(buflen > 0) {
-           filename = newstralloc(filename, file.cont_filename);
-       }
-       else {
-           amfree(filename);
-       }
-    }
-    amfree(filename);
-    return size;
-}
-
-
-int
-unlink_holding_files(
-    char *     holding_file)
-{
-    int fd;
-    ssize_t buflen;
-    char buffer[DISK_BLOCK_BYTES];
-    dumpfile_t file;
-    char *filename;
-
-    memset(buffer, 0, sizeof(buffer));
-    filename = stralloc(holding_file);
-    while(filename != NULL && filename[0] != '\0') {
-       if((fd = open(filename,O_RDONLY)) == -1) {
-           fprintf(stderr,"unlink_holding_files: open of %s failed: %s\n",filename,strerror(errno));
-           amfree(filename);
-           return 0;
-       }
-       if ((buflen = fullread(fd, buffer, SIZEOF(buffer))) > 0) {
-           parse_file_header(buffer, &file, (size_t)buflen);
-       }
-       close(fd);
-       unlink(filename);
-       if(buflen > 0) {
-           filename = newstralloc(filename, file.cont_filename);
-       }
-       else {
-           amfree(filename);
-       }
-    }
-    amfree(filename);
-    return 1;
-}
-
+/*
+ * Application support
+ */
 
 int
 rename_tmp_holding(
@@ -570,7 +694,7 @@ rename_tmp_holding(
     while(filename != NULL && filename[0] != '\0') {
        filename_tmp = newvstralloc(filename_tmp, filename, ".tmp", NULL);
        if((fd = open(filename_tmp,O_RDONLY)) == -1) {
-           fprintf(stderr,"rename_tmp_holding: open of %s failed: %s\n",filename_tmp,strerror(errno));
+           fprintf(stderr,_("rename_tmp_holding: open of %s failed: %s\n"),filename_tmp,strerror(errno));
            amfree(filename);
            amfree(filename_tmp);
            return 0;
@@ -580,12 +704,12 @@ rename_tmp_holding(
 
        if(rename(filename_tmp, filename) != 0) {
            fprintf(stderr,
-                   "rename_tmp_holding: could not rename \"%s\" to \"%s\": %s",
+                   _("rename_tmp_holding: could not rename \"%s\" to \"%s\": %s"),
                    filename_tmp, filename, strerror(errno));
        }
 
        if (buflen <= 0) {
-           fprintf(stderr,"rename_tmp_holding: %s: empty file?\n", filename);
+           fprintf(stderr,_("rename_tmp_holding: %s: empty file?\n"), filename);
            amfree(filename);
            amfree(filename_tmp);
            return 0;
@@ -593,7 +717,7 @@ rename_tmp_holding(
        parse_file_header(buffer, &file, (size_t)buflen);
        if(complete == 0 ) {
            if((fd = open(filename, O_RDWR)) == -1) {
-               fprintf(stderr, "rename_tmp_holdingX: open of %s failed: %s\n",
+               fprintf(stderr, _("rename_tmp_holdingX: open of %s failed: %s\n"),
                        filename, strerror(errno));
                amfree(filename);
                amfree(filename_tmp);
@@ -612,7 +736,6 @@ rename_tmp_holding(
     return 1;
 }
 
-
 void
 cleanup_holdingdisk(
     char *     diskdir,
@@ -623,7 +746,7 @@ cleanup_holdingdisk(
 
     if((topdir = opendir(diskdir)) == NULL) {
        if(verbose && errno != ENOENT)
-           printf("Warning: could not open holding dir %s: %s\n",
+           printf(_("Warning: could not open holding dir %s: %s\n"),
                   diskdir, strerror(errno));
        return;
    }
@@ -631,9 +754,9 @@ cleanup_holdingdisk(
     /* find all directories of the right format  */
 
     if(verbose)
-       printf("Scanning %s...\n", diskdir);
+       printf(_("Scanning %s...\n"), diskdir);
     if ((chdir(diskdir)) == -1) {
-       log_add(L_INFO, "%s: could not chdir: %s",
+       log_add(L_INFO, _("%s: could not chdir: %s"),
                    diskdir, strerror(errno));
     }
     while((workdir = readdir(topdir)) != NULL) {
@@ -646,15 +769,15 @@ cleanup_holdingdisk(
            printf("  %s: ", workdir->d_name);
        if(!is_dir(workdir->d_name)) {
            if(verbose)
-               puts("skipping cruft file, perhaps you should delete it.");
+               puts(_("skipping cruft file, perhaps you should delete it."));
        }
        else if(!is_datestr(workdir->d_name)) {
            if(verbose && (strcmp(workdir->d_name, "lost+found")!=0) )
-               puts("skipping cruft directory, perhaps you should delete it.");
+               puts(_("skipping cruft directory, perhaps you should delete it."));
        }
        else if(rmdir(workdir->d_name) == 0) {
            if(verbose)
-               puts("deleted empty Amanda directory.");
+               puts(_("deleted empty Amanda directory."));
        }
      }
      closedir(topdir);
@@ -669,28 +792,28 @@ mkholdingdir(
     int success = 1;
 
     if (mkpdir(diskdir, 0770, (uid_t)-1, (gid_t)-1) != 0 && errno != EEXIST) {
-       log_add(L_WARNING, "WARNING: could not create parents of %s: %s",
+       log_add(L_WARNING, _("WARNING: could not create parents of %s: %s"),
                diskdir, strerror(errno));
        success = 0;
     }
     else if (mkdir(diskdir, 0770) != 0 && errno != EEXIST) {
-       log_add(L_WARNING, "WARNING: could not create %s: %s",
+       log_add(L_WARNING, _("WARNING: could not create %s: %s"),
                diskdir, strerror(errno));
        success = 0;
     }
     else if (stat(diskdir, &stat_hdp) == -1) {
-       log_add(L_WARNING, "WARNING: could not stat %s: %s",
+       log_add(L_WARNING, _("WARNING: could not stat %s: %s"),
                diskdir, strerror(errno));
        success = 0;
     }
     else {
        if (!S_ISDIR((stat_hdp.st_mode))) {
-           log_add(L_WARNING, "WARNING: %s is not a directory",
+           log_add(L_WARNING, _("WARNING: %s is not a directory"),
                    diskdir);
            success = 0;
        }
        else if (access(diskdir,W_OK) != 0) {
-           log_add(L_WARNING, "WARNING: directory %s is not writable",
+           log_add(L_WARNING, _("WARNING: directory %s is not writable"),
                    diskdir);
            success = 0;
        }
index 063a2bfd4662ba81012b24a90c78b01916bac870..f01fb6e5d030219a4f0e66fdc2ceb9cfed193255 100644 (file)
 /*
  * $Id: holding.h,v 1.23 2006/05/25 01:47:20 johnfranks Exp $
  *
+ * Terminology:
+ *
+ * Holding disk: a top-level directory given in amanda.conf
+ * Holding directory: a subdirectory of a holding disk, named by datestamp
+ * Holding file: one or more os-level files in a holding directory, together
+ *  representing a single dump
+ * Holding file chunks: the individual os-level files (continuations) of
+ *  a holding file.
+ *
+ * Example:
+ *
+ * /data/holding                                     <-- holding disk
+ * /data/holding/200703061234                        <-- holding dir
+ * /data/holding/200703061234/videoserver._video_a   <-- holding file, 
+                                                         holding file chunk
+ * /data/holding/200703061234/videoserver._video_a.1 <-- holding file chunk
+ *
  */
 
 #ifndef HOLDING_H
 #include "fileheader.h"
 #include "sl.h"
 
-/* local functions */
-int is_dir(char *fname);
-int is_emptyfile(char *fname);
-int is_datestr(char *fname);
-int non_empty(char *fname);
-void free_holding_list( sl_t *holding_list);
-sl_t *get_flush(sl_t *dateargs, char *datestamp, int amflush, int verbose);
-sl_t *pick_datestamp(int verbose);
-sl_t *pick_all_datestamp(int verbose);
-filetype_t get_amanda_names(char *fname,
-                              char **hostname,
-                              char **diskname,
-                              int *level);
-void get_dumpfile(char *fname, dumpfile_t *file);
-off_t size_holding_files(char *holding_file, int strip_headers);
-int unlink_holding_files(char *holding_file);
-int rename_tmp_holding(char *holding_file, int complete);
-void cleanup_holdingdisk(char *diskdir, int verbose);
-int mkholdingdir(char *diskdir);
+/*
+ * Verbosity
+ */
+
+/* Set verbose flag for holding-disk functions
+ *
+ * @param verbose: if true, log verbosely to stdout
+ * @returns: old verbosity
+ */
+int
+holding_set_verbosity(int verbose);
+
+/*
+ * Holding disks
+ *
+ * Use getconf_holdingdisks() to access the list of holding disks.
+ */
+
+/*
+ * Holding directories
+ */
+
+/* Get a list of holding directories, optionally limited to a single
+ * holding disk.  Can return a list either of full pathnames or of
+ * bare directory names (datestamps).
+ *
+ * @param hdisk: holding disk to enumerate, or NULL for all
+ * @param date_list: Limit to thes timestamps.
+ * @param fullpaths: if true, return full pathnames
+ * @returns: newly allocated sl_t of matching directories
+ */
+sl_t *
+holding_get_directories(char *hdisk,
+                       sl_t *date_list,
+                        int fullpaths);
+
+/*
+ * Holding files
+ */
+
+/* Get a list of holding files, optionally limited to a single holding
+ * directory.  Can return a list either of full pathnames or of
+ * bare file names.
+ *
+ * @param hdir: holding directory to enumerate, or NULL for all
+ * @param date_list: Limit to thes timestamps.
+ * @param fullpaths: if true, return full pathnames
+ * @returns: newly allocated sl_t of matching files
+ */
+sl_t *
+holding_get_files(char *hdir,
+                 sl_t *date_list,
+                  int fullpaths);
+
+/* Get a list of holding files that should be flushed, optionally
+ * matching only certain datestamps.  This function filters out
+ * files for host/disks that are no longer in the disklist.
+ *
+ * @param dateargs: sl_t of datestamps to dump, or NULL for all
+ * @param interactive: if true, be interactive
+ * @returns: a newly allocated sl_t listing all matching holding 
+ * files
+ */
+sl_t *
+holding_get_files_for_flush(sl_t *dateargs, 
+                            int interactive);
+
+/* Get the total size of a holding file, including all holding 
+ * file chunks, in kilobytes.
+ *
+ * @param holding_file: full pathname of holding file
+ * @param strip_headers: if true, don't count the headers in the
+ * total size
+ * @returns: total size of the holding file, or -1 in an error
+ */
+off_t 
+holding_file_size(char *holding_file, 
+                  int strip_headers);
+
+/* Unlink a holding file, including all holding file chunks.
+ *
+ * @param holding_file: full pathname of holding file
+ * @returns: 1 on success, else 0
+ */
+int 
+holding_file_unlink(char *holding_file);
+
+/* Given a pathname of a holding file, extract the hostname, diskname,
+ * level, and filetype from the header.
+ *
+ * Caller is responsible for freeing memory for hostname and diskname.
+ * None of the result parameters can be NULL.
+ *
+ * @param fname: full pathname of holding file
+ * @param hostname: (result) hostname
+ * @param diskname: (result) diskname
+ * @param level: (result) level
+ * @param datestamp: (result) datestamp of the dump
+ * @returns: filetype (see common-src/fileheader.h)
+ */
+filetype_t 
+holding_file_read_header(char *fname,
+                         char **hostname,
+                         char **diskname,
+                         int *level,
+                         char **datestamp);
+
+/* Given a pathname of a holding file, read the file header.
+ * the result parameter may be altered even if an error is
+ * returned.
+ *
+ * @param fname: full pathname of holding file
+ * @param file: (result) dumpfile_t structure
+ * @returns: 1 on success, else 0
+ */
+int 
+holding_file_get_dumpfile(char *fname, 
+                          dumpfile_t *file);
+
+/*
+ * Holding file chunks
+ */
+
+/* Get a list of holding files chunks in the given holding 
+ * file.  Always returns full paths.
+ *
+ * @param hfile: holding file to enumerate
+ * @returns: newly allocated sl_t of matching holding file chunks
+ */
+sl_t *
+holding_get_file_chunks(char *hfile);
+
+/*
+ * application-specific support
+ */
+
+/* Allow the user to select a set of datestamps from those in
+ * holding disks.
+ *
+ * @param verbose: verbose logging to stdout
+ * @returns: a new sl_t listing all matching datestamps
+ */
+sl_t *
+pick_datestamp(int verbose);
+
+/* Similar to pick_datestamp, but always select all available
+ * datestamps.  Non-interactive, but outputs progress to stdout.
+ *
+ * @param verbose: verbose logging to stdout
+ * @returns: a new sl_t listing all matching datestamps
+ */
+sl_t *
+pick_all_datestamp(int verbose);
 
+/* Rename holding files from the temporary names used during
+ * creation.
+ *
+ * @param holding_file: full pathname of holding file,
+ * without '.tmp'
+ * @param complete: if 0, set 'is_partial' to 1 in each file
+ * @returns: 1 on success, else 0
+ */
+int 
+rename_tmp_holding(char *holding_file, 
+                   int complete);
+
+/* Remove any empty datestamp directories.
+ *
+ * @param diskdir: holding directory to clean
+ * @param verbose: verbose logging to stdout
+ */
+void 
+cleanup_holdingdisk(char *diskdir, 
+                    int verbose);
+
+/* Set up a holding directory and do basic permission
+ * checks on it
+ *
+ * @param diskdir: holding directory to set up
+ * @returns: 1 on success, else 0
+ */
+int 
+mkholdingdir(char *diskdir);
 
 #endif /* HOLDING_H */
index 32f86f4123c3dbd69087ee058b3de8a9f7d7d762..6ceca7ef5f39e71bb2eec71a68c2ba71f1944dc1 100644 (file)
@@ -241,10 +241,10 @@ read_txinfofile(
            amfree(line);
            return 0;                           /* normal end of record */
        }
-       else if (strncmp(line,"last_level:",11) == 0) {
+       else if (strncmp_const(line,"last_level:") == 0) {
            break;                              /* normal */
        }
-       else if (strncmp(line,"history:",8) == 0) {
+       else if (strncmp_const(line,"history:") == 0) {
            break;                              /* normal */
        }
        memset(&onestat, 0, SIZEOF(onestat));
@@ -252,13 +252,9 @@ read_txinfofile(
        s = line;
        ch = *s++;
 
-#define sc "stats:"
-       if(strncmp(line, sc, SIZEOF(sc)-1) != 0) {
+       if(strncmp_const_skip(line, "stats:", s, ch) != 0) {
            break;
        }
-       s += SIZEOF(sc)-1;
-       ch = s[-1];
-#undef sc
 
        skip_whitespace(s, ch);
        if(ch == '\0' || sscanf((s - 1), "%d", &level) != 1) {
@@ -354,14 +350,10 @@ read_txinfofile(
        s = line;
        ch = *s++;
 
-#define sc "history:"
-       if(strncmp(line, sc, SIZEOF(sc)-1) != 0) {
+       if(strncmp_const_skip(line, "history:", s, ch) != 0) {
            amfree(line);
            break;
        }
-       s += SIZEOF(sc)-1;
-       ch = s[-1];
-#undef sc
 
        skip_whitespace(s, ch);
        if(ch == '\0' || sscanf((s - 1), "%d", &onehistory.level) != 1) {
index 9741f43e9986c48ad92c3c0ea3e0b3cca3e5d337..ccddd26aaa2bfd97807f8e3cc20737d375d00017 100644 (file)
@@ -25,7 +25,7 @@
  *                        University of Maryland at College Park
  */
 /*
- * $Id: logfile.c,v 1.31.2.1 2006/09/22 11:02:13 martinea Exp $
+ * $Id: logfile.c,v 1.31 2006/06/01 14:54:39 martinea Exp $
  *
  * common log file writing routine
  */
index af97336cc83bf2755e9b5590b33960a56b031fc8..c0f7fc6bf656c993b947f5347e0942455d17d69a 100644 (file)
@@ -24,7 +24,7 @@
  * file named AUTHORS, in the root directory of this distribution.
  */
 /*
- * $Id: planner.c,v 1.206.2.6 2006/11/24 18:05:06 martinea Exp $
+ * $Id: planner.c,v 1.206 2006/08/10 23:57:27 paddy_s Exp $
  *
  * backup schedule planner for the Amanda backup system.
  */
 #include "server_util.h"
 #include "holding.h"
 
+#define planner_debug(i,x) do {                \
+       if ((i) <= debug_planner) {     \
+           dbprintf(x);                \
+       }                               \
+} while (0)
+
 #define MAX_LEVELS                 3   /* max# of estimates per filesys */
 
 #define RUNS_REDZONE               5   /* should be in conf file? */
@@ -178,7 +184,7 @@ int main(int argc, char **argv)
 
     setvbuf(stderr, (char *)NULL, (int)_IOLBF, 0);
 
-    parse_server_conf(argc, argv, &new_argc, &new_argv);
+    parse_conf(argc, argv, &new_argc, &new_argv);
     my_argc = new_argc;
     my_argv = new_argv;
 
@@ -338,7 +344,7 @@ int main(int argc, char **argv)
     conf_dumpcycle = getconf_int(CNF_DUMPCYCLE);
     conf_runspercycle = getconf_int(CNF_RUNSPERCYCLE);
     conf_tapecycle = getconf_int(CNF_TAPECYCLE);
-    conf_etimeout = getconf_int(CNF_ETIMEOUT);
+    conf_etimeout = (time_t)getconf_int(CNF_ETIMEOUT);
     conf_reserve  = getconf_int(CNF_RESERVE);
     conf_autoflush = getconf_boolean(CNF_AUTOFLUSH);
     conf_usetimestamps = getconf_boolean(CNF_USETIMESTAMPS);
@@ -407,26 +413,38 @@ int main(int argc, char **argv)
        dumpfile_t file;
        sl_t *holding_list;
        sle_t *holding_file;
-       holding_list = get_flush(NULL, NULL, 0, 0);
+       char *qdisk, *qhname;
+       holding_list = holding_get_files_for_flush(NULL, 0);
        for(holding_file=holding_list->first; holding_file != NULL;
                                       holding_file = holding_file->next) {
-           get_dumpfile(holding_file->name, &file);
+           holding_file_get_dumpfile(holding_file->name, &file);
+
+           if (holding_file_size(holding_file->name, 1) <= 0) {
+               log_add(L_INFO, "%s: removing file with no data.",
+                       holding_file->name);
+               holding_file_unlink(holding_file->name);
+               continue;
+           }
            
-           log_add(L_DISK, "%s %s", file.name, file.disk);
+           qdisk = quote_string(file.disk);
+           qhname = quote_string(holding_file->name);
+           log_add(L_DISK, "%s %s", file.name, qdisk);
            fprintf(stderr,
                    "FLUSH %s %s %s %d %s\n",
                    file.name,
-                   file.disk,
+                   qdisk,
                    file.datestamp,
                    file.dumplevel,
-                   holding_file->name);
+                   qhname);
            fprintf(stdout,
                    "FLUSH %s %s %s %d %s\n",
                    file.name,
-                   file.disk,
+                   qdisk,
                    file.datestamp,
                    file.dumplevel,
-                   holding_file->name);
+                   qhname);
+           amfree(qdisk);
+           amfree(qhname);
        }
        free_sl(holding_list);
        holding_list = NULL;
@@ -780,7 +798,7 @@ setup_estimate(
     /* adjust priority levels */
 
     /* warn if dump will be overwritten */
-    if(ep->last_level > -1) {
+    if (ep->last_level > -1 && strlen(info.inf[0].label) > 0) {
        overwrite_runs = when_overwrite(info.inf[0].label);
        if(overwrite_runs == 0) {
            log_add(L_WARNING, "Last full dump of %s:%s "
@@ -1301,9 +1319,10 @@ static void getsize(
     time_t     estimates, timeout;
     size_t     req_len;
     const      security_driver_t *secdrv;
-    char *     dumper;
+    char *     backup_api;
     char *     calcsize;
     char *     qname;
+    char *     qdevice;
 
     assert(hostp->disks != NULL);
 
@@ -1366,6 +1385,7 @@ static void getsize(
            }
 
            qname = quote_string(dp->name);
+           qdevice = quote_string(dp->device);
            if(dp->estimate == ES_CLIENT ||
               dp->estimate == ES_CALCSIZE) {
                nb_client++;
@@ -1437,17 +1457,17 @@ static void getsize(
                    else
                        calcsize = "CALCSIZE ";
 
-                   if(strncmp(dp->program,"DUMP",4) == 0 || 
-                      strncmp(dp->program,"GNUTAR",6) == 0) {
-                       dumper = "";
+                   if(strcmp(dp->program,"DUMP") == 0 || 
+                      strcmp(dp->program,"GNUTAR") == 0) {
+                       backup_api = "";
                    } else {
-                       dumper = "DUMPER ";
+                       backup_api = "BACKUP ";
                    }
                    l = vstralloc(calcsize,
-                                 dumper,
+                                 backup_api,
                                  dp->program,
                                  " ", qname,
-                                 " ", dp->device ? dp->device : "",
+                                 " ", dp->device ? qdevice : "",
                                  " ", level,
                                  " ", est(dp)->dumpdate[i],
                                  " ", spindle,
@@ -1576,6 +1596,7 @@ static void getsize(
                enqueue_disk(&estq, dp);
            }
            amfree(qname);
+           amfree(qdevice);
        }
 
        if(estimates == 0) {
@@ -1599,7 +1620,7 @@ static void getsize(
         * We use ctimeout for the "noop" request because it should be
         * very fast and etimeout has other side effects.
         */
-       timeout = getconf_int(CNF_CTIMEOUT);
+       timeout = (time_t)getconf_int(CNF_CTIMEOUT);
     }
 
     secdrv = security_getdriver(hostp->disks->security_driver);
@@ -1647,7 +1668,7 @@ static void handle_result(
     off_t size;
     disk_t *dp;
     am_host_t *hostp;
-    char *msgdisk=NULL, *msgdisk_undo=NULL, msgdisk_undo_ch = '\0';
+    char *msg, msg_undo;
     char *remoterr, *errbuf = NULL;
     char *s;
     char *t;
@@ -1668,11 +1689,9 @@ static void handle_result(
        goto error_return;
     }
     if (pkt->type == P_NAK) {
-#define sc "ERROR "
-       if(strncmp(pkt->body, sc, SIZEOF(sc)-1) == 0) {
-           s = pkt->body + SIZEOF(sc)-1;
+       s = pkt->body;
+       if(strncmp_const_skip(s, "ERROR ", s, ch) == 0) {
            ch = *s++;
-#undef sc
        } else {
            goto NAK_parse_failed;
        }
@@ -1691,21 +1710,15 @@ static void handle_result(
        }
     }
 
-    msgdisk_undo = NULL;
     s = pkt->body;
     ch = *s++;
     while(ch) {
        line = s - 1;
 
-#define sc "OPTIONS "
-       if(strncmp(line, sc, SIZEOF(sc)-1) == 0) {
-#undef sc
-
-#define sc "features="
-           t = strstr(line, sc);
+       if(strncmp_const(line, "OPTIONS ") == 0) {
+           t = strstr(line, "features=");
            if(t != NULL && (isspace((int)t[-1]) || t[-1] == ';')) {
-               t += SIZEOF(sc)-1;
-#undef sc
+               t += SIZEOF("features=")-1;
                am_release_feature_set(hostp->features);
                if((hostp->features = am_string_to_feature(t)) == NULL) {
                    errbuf = vstralloc(hostp->hostname,
@@ -1720,12 +1733,8 @@ static void handle_result(
            continue;
        }
 
-#define sc "ERROR "
-       if(strncmp(line, sc, SIZEOF(sc) - 1) == 0) {
-           t = line + SIZEOF(sc) - 1;
-           tch = t[-1];
-#undef sc
-
+       t = line;
+       if(strncmp_const_skip(t, "ERROR ", t, tch) == 0) {
            fp = t - 1;
            skip_whitespace(t, tch);
            if (tch == '\n') {
@@ -1752,32 +1761,54 @@ static void handle_result(
            goto error_return;
        }
 
-       msgdisk = t = line;
+       msg = t = line;
        tch = *(t++);
        skip_quoted_string(t, tch);
-       msgdisk_undo = t - 1;
-       msgdisk_undo_ch = *msgdisk_undo;
-       *msgdisk_undo = '\0';
-       disk = unquote_string(msgdisk);
+       t[-1] = '\0';
+       disk = unquote_string(msg);
+
        skip_whitespace(t, tch);
-       s = t;
-       ch = tch;
 
-       size_ = (OFF_T_FMT_TYPE)0;
-       if (sscanf(t - 1, "%d SIZE " OFF_T_FMT , &level, &size_) != 2) {
+       if (sscanf(t - 1, "%d", &level) != 1) {
            goto bad_msg;
        }
-       size = size_;
-       dp = lookup_hostdisk(hostp, disk);
-       amfree(disk);
 
-       *msgdisk_undo = msgdisk_undo_ch;        /* for error message */
-       msgdisk_undo = NULL;
+       skip_integer(t, tch);
+       skip_whitespace(t, tch);
 
+       dp = lookup_hostdisk(hostp, disk);
+       dp = lookup_hostdisk(hostp, disk);
        if(dp == NULL) {
            log_add(L_ERROR, "%s: invalid reply from sendsize: `%s'\n",
                    hostp->hostname, line);
+           goto bad_msg;
+       }
+
+       size = (off_t)-1;
+       if (strncmp_const(t-1,"SIZE ") == 0) {
+           if (sscanf(t - 1, "SIZE " OFF_T_FMT ,
+                      (OFF_T_FMT_TYPE *)&size_) != 1) {
+               goto bad_msg;
+           }
+           size = size_;
+       } else if (strncmp_const(t-1,"ERROR ") == 0) {
+           skip_non_whitespace(t, tch);
+           skip_whitespace(t, tch);
+           msg = t-1;
+           skip_quoted_string(t,tch);
+           msg_undo = t[-1];
+           t[-1] = '\0';
+           if (pkt->type == P_REP) {
+               est(dp)->errstr = unquote_string(msg);
+           }
+           t[-1] = msg_undo;
        } else {
+           goto bad_msg;
+       }
+
+       amfree(disk);
+
+       if (size > (off_t)-1) {
            for(i = 0; i < MAX_LEVELS; i++) {
                if(est(dp)->level[i] == level) {
                    est(dp)->est_size[i] = size;
@@ -1789,6 +1820,8 @@ static void handle_result(
            }
            est(dp)->got_estimate++;
        }
+       s = t;
+       ch = tch;
        skip_quoted_line(s, ch);
     }
 
@@ -1880,12 +1913,15 @@ static void handle_result(
                                                ", all estimate failed", NULL);
                }
                else {
-                   fprintf(stderr, "error result for host %s disk %s: missing estimate\n",
-                           dp->host->hostname, qname);
-                   est(dp)->errstr = vstralloc("missing result for ", qname,
-                                               " in ", dp->host->hostname,
-                                               " response",
-                                               NULL);
+                   fprintf(stderr,
+                        "error result for host %s disk %s: missing estimate\n",
+                        dp->host->hostname, qname);
+                   if (est(dp)->errstr == NULL) {
+                       est(dp)->errstr = vstralloc("missing result for ",
+                                                   qname, " in ",
+                                                   dp->host->hostname,
+                                                   " response", NULL);
+                   }
                }
            }
        }
@@ -1896,21 +1932,12 @@ static void handle_result(
 
  NAK_parse_failed:
 
-    /* msgdisk_undo is always NULL */
-    /* if(msgdisk_undo) { */
-    /*         *msgdisk_undo = msgdisk_undo_ch; */
-    /* msgdisk_undo = NULL; */
-    /* } */
     errbuf = stralloc2(hostp->hostname, " NAK: [NAK parse failed]");
     fprintf(stderr, "got strange nak from %s:\n----\n%s----\n\n",
            hostp->hostname, pkt->body);
     goto error_return;
 
  bad_msg:
-    if(msgdisk_undo) {
-       *msgdisk_undo = msgdisk_undo_ch;
-       msgdisk_undo = NULL;
-    }
     fprintf(stderr,"got a bad message, stopped at:\n");
     /*@ignore@*/
     fprintf(stderr,"----\n%s----\n\n", line);
@@ -2110,6 +2137,7 @@ static void handle_failed(
 
     errstr = est(dp)->errstr? est(dp)->errstr : "hmm, no error indicator!";
 
+fprintf(stderr,"errstr:%s:\n", errstr);
     fprintf(stderr, "%s: FAILED %s %s %s 0 [%s]\n",
        get_pname(), dp->host->hostname, qname, planner_timestamp, errstr);
 
index c0889ff9cf884439a0b0467eaa4782e2f22b0073..21c171c057227705cb4b43c048108ae2fdc49dc5 100644 (file)
@@ -25,7 +25,7 @@
  *                        University of Maryland at College Park
  */
 /*
- * $Id: reporter.c,v 1.132.2.1 2007/01/26 13:12:43 martinea Exp $
+ * $Id: reporter.c,v 1.132 2006/08/28 17:02:48 martinea Exp $
  *
  * nightly Amanda Report generator
  */
@@ -127,6 +127,7 @@ static int degraded_mode = 0; /* defined in driverio too */
 static int normal_run = 0;
 static int amflush_run = 0;
 static int got_finish = 0;
+static char *ghostname = NULL;
 
 static char *tapestart_error = NULL;
 
@@ -360,7 +361,7 @@ main(
        /*NOTREACHED*/
     }
 
-    parse_server_conf(argc, argv, &new_argc, &new_argv);
+    parse_conf(argc, argv, &new_argc, &new_argv);
     my_argc = new_argc;
     my_argv = new_argv;
 
@@ -703,6 +704,15 @@ main(
 
        if(!got_finish) fputs("*** THE DUMPS DID NOT FINISH PROPERLY!\n\n", mailf);
 
+       if (ghostname) {
+           fprintf(mailf, "Hostname: %s\n", ghostname);
+           fprintf(mailf, "Org     : %s\n", getconf_str(CNF_ORG));
+           fprintf(mailf, "Config  : %s\n", config_name);
+           fprintf(mailf, "Date    : %s\n",
+                   nicedate(run_datestamp ? run_datestamp : "0"));
+           fprintf(mailf,"\n");
+       }
+
        output_tapeinfo();
 
        if(first_strange || errsum) {
@@ -1210,13 +1220,17 @@ CalcMaxWidth(void)
     disk_t *dp;
     double f;
     repdata_t *repdata;
+    char *qdevname;
+
     for(dp = sortq.head; dp != NULL; dp = dp->next) {
       if(dp->todo) {
        for(repdata = data(dp); repdata != NULL; repdata = repdata->next) {
            char TimeRateBuffer[40];
 
            CheckStringMax(&ColumnData[HostName], dp->host->hostname);
-           CheckStringMax(&ColumnData[Disk], dp->name);
+           qdevname = quote_string(dp->name);
+           CheckStringMax(&ColumnData[Disk], qdevname);
+           amfree(qdevname);
            if (repdata->dumper.result == L_BOGUS && 
                repdata->taper.result == L_BOGUS)
                continue;
@@ -1355,6 +1369,7 @@ output_summary(void)
        char TimeRateBuffer[40];
        for(repdata = data(dp); repdata != NULL; repdata = repdata->next) {
            char *devname;
+           char *qdevname;
            size_t devlen;
 
            cd= &ColumnData[HostName];
@@ -1364,15 +1379,17 @@ output_summary(void)
            cd= &ColumnData[Disk];
            fprintf(mailf, "%*s", cd->PrefixSpace, "");
            devname = sanitize_string(dp->name);
-           devlen = strlen(devname);
+           qdevname = quote_string(devname);
+           devlen = strlen(qdevname);
            if (devlen > (size_t)cd->Width) {
                fputc('-', mailf); 
                fprintf(mailf, cd->Format, cd->Width-1, cd->Precision-1,
-                 devname+devlen - (cd->Width-1) );
+                       qdevname+devlen - (cd->Width-1) );
            }
            else
-               fprintf(mailf, cd->Format, cd->Width, cd->Width, devname);
+               fprintf(mailf, cd->Format, cd->Width, cd->Width, qdevname);
            amfree(devname);
+           amfree(qdevname);
            cd= &ColumnData[Level];
            if (repdata->dumper.result == L_BOGUS &&
                repdata->taper.result  == L_BOGUS) {
@@ -1414,13 +1431,14 @@ output_summary(void)
                origsize = repdata->chunker.origsize;
 
            if(repdata->taper.result == L_SUCCESS ||
-              repdata->taper.result == L_PARTIAL ||
               repdata->taper.result == L_CHUNKSUCCESS)
                outsize  = repdata->taper.outsize;
            else if(repdata->chunker.result == L_SUCCESS ||
                    repdata->chunker.result == L_PARTIAL ||
                    repdata->chunker.result == L_CHUNKSUCCESS)
                outsize  = repdata->chunker.outsize;
+           else if (repdata->taper.result == L_PARTIAL)
+               outsize  = repdata->taper.outsize;
            else
                outsize  = repdata->dumper.outsize;
 
@@ -1495,10 +1513,11 @@ output_summary(void)
            else
                fprintf(mailf, "%*s", cd->Width, "N/A ");
 
-           if(repdata->chunker.result == L_PARTIAL ||
-              repdata->taper.result == L_PARTIAL) {
+           if (repdata->chunker.result == L_PARTIAL)
                fprintf(mailf, " PARTIAL");
-           }
+           else if(repdata->taper.result == L_PARTIAL)
+               fprintf(mailf, " TAPE-PARTIAL");
+
            fputc('\n', mailf);
        }
       }
@@ -1561,14 +1580,11 @@ handle_start(void)
        ch = *s++;
 
        skip_whitespace(s, ch);
-#define sc "datestamp"
-       if(ch == '\0' || strncmp(s - 1, sc, SIZEOF(sc)-1) != 0) {
+       if(ch == '\0' || strncmp_const_skip(s - 1, "datestamp", s, ch) != 0) {
            bogus_line(s - 1);
            return;
        }
-       s += SIZEOF(sc)-1;
-       ch = s[-1];
-#undef sc
+
        skip_whitespace(s, ch);
        if(ch == '\0') {
            bogus_line(s - 1);
@@ -1581,14 +1597,11 @@ handle_start(void)
        s[-1] = (char)ch;
 
        skip_whitespace(s, ch);
-#define sc "label"
-       if(ch == '\0' || strncmp(s - 1, sc, SIZEOF(sc)-1) != 0) {
+       if(ch == '\0' || strncmp_const_skip(s - 1, "label", s, ch) != 0) {
            bogus_line(s - 1);
            return;
        }
-       s += SIZEOF(sc)-1;
-       ch = s[-1];
-#undef sc
+
        skip_whitespace(s, ch);
        if(ch == '\0') {
            bogus_line(s - 1);
@@ -1645,13 +1658,10 @@ handle_start(void)
        ch = *s++;
 
        skip_whitespace(s, ch);
-#define sc "date"
-       if(ch == '\0' || strncmp(s - 1, sc, SIZEOF(sc)-1) != 0) {
+       if(ch == '\0' || strncmp_const_skip(s - 1, "date", s, ch) != 0) {
            return;                             /* ignore bogus line */
        }
-       s += SIZEOF(sc)-1;
-       ch = s[-1];
-#undef sc
+
        skip_whitespace(s, ch);
        if(ch == '\0') {
            bogus_line(s - 1);
@@ -1685,14 +1695,10 @@ handle_finish(void)
        ch = *s++;
 
        skip_whitespace(s, ch);
-#define sc "date"
-       if(ch == '\0' || strncmp(s - 1, sc, SIZEOF(sc)-1) != 0) {
+       if(ch == '\0' || strncmp_const_skip(s - 1, "date", s, ch) != 0) {
            bogus_line(s - 1);
            return;
        }
-       s += SIZEOF(sc)-1;
-       ch = s[-1];
-#undef sc
 
        skip_whitespace(s, ch);
        if(ch == '\0') {
@@ -1702,16 +1708,12 @@ handle_finish(void)
        skip_non_whitespace(s, ch);     /* ignore the date string */
 
        skip_whitespace(s, ch);
-#define sc "time"
-       if(ch == '\0' || strncmp(s - 1, sc, SIZEOF(sc)-1) != 0) {
+       if(ch == '\0' || strncmp_const_skip(s - 1, "time", s, ch) != 0) {
            /* older planner doesn't write time */
            if(curprog == P_PLANNER) return;
            bogus_line(s - 1);
            return;
        }
-       s += SIZEOF(sc)-1;
-       ch = s[-1];
-#undef sc
 
        skip_whitespace(s, ch);
        if(ch == '\0') {
@@ -1748,12 +1750,7 @@ handle_stats(void)
        ch = *s++;
 
        skip_whitespace(s, ch);
-#define sc "startup time"
-       if(ch != '\0' && strncmp(s - 1, sc, sizeof(sc)-1) == 0) {
-           s += sizeof(sc)-1;
-           ch = s[-1];
-#undef sc
-
+       if(ch != '\0' && strncmp_const_skip(s - 1, "startup time", s, ch) == 0) {
            skip_whitespace(s, ch);
            if(ch == '\0') {
                bogus_line(s - 1);
@@ -1765,12 +1762,15 @@ handle_stats(void)
            }
            planner_time = startup_time;
        }
-#define sc "estimate"
-       else if(ch != '\0' && strncmp(s - 1, sc, sizeof(sc)-1) == 0) {
-           s += sizeof(sc)-1;
-           ch = s[-1];
-#undef sc
-
+       else if(ch != '\0' && strncmp_const_skip(s - 1, "hostname", s, ch) == 0) {
+           skip_whitespace(s, ch);
+           if(ch == '\0') {
+               bogus_line(s - 1);
+               return;
+           }
+           ghostname = stralloc(s-1);
+       }
+       else if(ch != '\0' && strncmp_const_skip(s - 1, "estimate", s, ch) == 0) {
            skip_whitespace(s, ch);
            if(ch == '\0') {
                bogus_line(s - 1);
@@ -1888,12 +1888,7 @@ handle_error(void)
        ch = *s++;
 
        skip_whitespace(s, ch);
-#define sc "no-tape"
-       if(ch != '\0' && strncmp(s - 1, sc, SIZEOF(sc)-1) == 0) {
-           s += SIZEOF(sc)-1;
-           ch = s[-1];
-#undef sc
-
+       if(ch != '\0' && strncmp_const_skip(s - 1, "no-tape", s, ch) == 0) {
            skip_whitespace(s, ch);
            if(ch != '\0') {
                if((nl = strchr(s - 1, '\n')) != NULL) {
@@ -2392,10 +2387,11 @@ handle_strange(void)
     amfree(str);
 
     while(contline_next()) {
+       char *s, ch;
        get_logline(logfile);
-#define sc "sendbackup: warning "
-       if(strncmp(curstr, sc, SIZEOF(sc)-1) == 0) {
-           strangestr = newstralloc(strangestr, curstr+SIZEOF(sc)-1);
+       s = curstr;
+       if(strncmp_const_skip(curstr, "sendbackup: warning ", s, ch) == 0) {
+           strangestr = newstralloc(strangestr, s);
        }
        addline(&errdet, curstr);
     }
@@ -2555,13 +2551,14 @@ generate_bad_estimate(void)
            for(repdata = data(dp); repdata != NULL; repdata = repdata->next) {
                if(repdata->est_csize >= 0.1) {
                    if(repdata->taper.result == L_SUCCESS ||
-                      repdata->taper.result == L_PARTIAL ||
                       repdata->taper.result == L_CHUNKSUCCESS)
                        outsize  = repdata->taper.outsize;
                    else if(repdata->chunker.result == L_SUCCESS ||
                            repdata->chunker.result == L_PARTIAL ||
                            repdata->chunker.result == L_CHUNKSUCCESS)
                        outsize  = repdata->chunker.outsize;
+                   else if(repdata->taper.result == L_PARTIAL)
+                       outsize  = repdata->taper.outsize;
                    else
                        outsize  = repdata->dumper.outsize;
 
@@ -2810,6 +2807,9 @@ do_postscript_output(void)
 
        copy_template_file(tapetype_get_lbl_templ(tp));
 
+       if (postscript == NULL)
+           return;
+
        /* generate a few elements */
        fprintf(postscript,"(%s) DrawDate\n\n",
                    nicedate(run_datestamp ? run_datestamp : "0"));
index b238f1217a6f8bb64d389cf6c5be26cf0dd033f2..95e57b3cf024a61d61887b91a85dfbb844977ff5 100644 (file)
@@ -24,7 +24,7 @@
  * file named AUTHORS, in the root directory of this distribution.
  */
 /*
- * $Id: server_util.c,v 1.17.2.1 2006/11/24 18:05:07 martinea Exp $
+ * $Id: server_util.c,v 1.17 2006/05/25 01:47:20 johnfranks Exp $
  *
  */
 
index 601525ff54d5e28e5605da2e36d3c29ca109ff1b..92beadea4a0389196718bde61268cfa47fd1e74b 100644 (file)
@@ -24,7 +24,7 @@
  * file named AUTHORS, in the root directory of this distribution.
  */
 /*
- * $Id: server_util.h,v 1.11.2.1 2006/11/24 18:05:07 martinea Exp $
+ * $Id: server_util.h,v 1.11 2006/05/25 01:47:20 johnfranks Exp $
  *
  */
 #ifndef SERVER_UTIL_H
index 1b2e7c6e1323d2194452009c1954cd4a0ded03b9..157d65381bae3c67c7d198a0cc6177f80636ef8e 100644 (file)
@@ -362,14 +362,10 @@ parse_tapeline(
 
     skip_whitespace(s, ch);
     tp->reuse = 1;
-#define sc "reuse"
-    if(strncmp(s - 1, sc, SIZEOF(sc)-1) == 0)
+    if(strncmp_const(s - 1, "reuse") == 0)
        tp->reuse = 1;
-#undef sc
-#define sc "no-reuse"
-    if(strncmp(s - 1, sc, SIZEOF(sc)-1) == 0)
+    if(strncmp_const(s - 1, "no-reuse") == 0)
        tp->reuse = 0;
-#undef sc
 
     return tp;
 }
index 647dba277870d32cb189caedd10842b2200f0ccd..3a10efe8e5367e224e55aa48576c450a4c83652a 100644 (file)
@@ -23,7 +23,7 @@
  * Authors: the Amanda Development Team.  Its members are listed in a
  * file named AUTHORS, in the root directory of this distribution.
  */
-/* $Id: taper.c,v 1.144.2.7 2007/01/18 12:57:16 martinea Exp $
+/* $Id: taper.c,v 1.144 2006/08/24 11:23:32 martinea Exp $
  *
  * moves files from holding disk to tape, or from a socket to tape
  */
 #include <sys/mman.h>
 #endif
 
+#define taper_debug(i,x) do {          \
+       if ((i) <= debug_taper) {       \
+           dbprintf(x);                \
+       }                               \
+} while (0)
+
 #ifdef HAVE_LIBVTBLC
 #include <vtblc.h>
 #include <strings.h>
 #include <math.h>
 
-
 static int vtbl_no   = -1;
 static int len       =  0;
 static int offset    =  0;
@@ -71,6 +76,7 @@ typedef struct vtbl_lbls {
 } vtbl_lbls;
 static vtbl_lbls vtbl_entry[MAX_VOLUMES];
 #endif /* HAVE_LIBVTBLC */
+
 /*
  * XXX update stat collection/printing
  * XXX advance to next tape first in next_tape
@@ -173,11 +179,6 @@ static void cleanup(void);
 int interactive;
 pid_t writerpid;
 times_t total_wait;
-#ifdef TAPER_DEBUG
-int bufdebug = 1;
-#else
-int bufdebug = 0;
-#endif
 
 char *buffers = NULL;
 buffer_t *buftable = NULL;
@@ -248,7 +249,7 @@ main(
 
     malloc_size_1 = malloc_inuse(&malloc_hist_1);
 
-    parse_server_conf(main_argc, main_argv, &new_argc, &new_argv);
+    parse_conf(main_argc, main_argv, &new_argc, &new_argv);
     my_argc = new_argc;
     my_argv = new_argv;
 
@@ -316,6 +317,8 @@ main(
     }
 
     tapedev    = getconf_str(CNF_TAPEDEV);
+    if (tapedev != NULL)
+       tapedev = stralloc(tapedev);
     tapetype    = getconf_str(CNF_TAPETYPE);
     tt         = lookup_tapetype(tapetype);
 #ifdef HAVE_LIBVTBLC
@@ -377,7 +380,7 @@ main(
        if ((buffers = attach_buffers(size)) != NULL) {
            break;
        }
-       log_add(L_INFO, "attach_buffers: (%d tapebuf%s: %zu bytes) %s",
+       log_add(L_INFO, "attach_buffers: (%d tapebuf%s: " SIZE_T_FMT " bytes) %s",
                        conf_tapebufs,
                        (conf_tapebufs == 1) ? "" : "s",
                        size,
@@ -861,6 +864,9 @@ file_reader_side(
                /*NOTREACHED*/
            }
            splitsize = OFF_T_ATOI(cmdargs.argv[a++]);
+           if (SIZEOF_OFF_T == 4 && splitsize > 1048576) { /* 1G in 32 bits */
+               splitsize = 1048576;
+           }
 
            if (a >= cmdargs.argc) {
                error("error [taper PORT-WRITE: not enough args: split_diskbuffer]");
@@ -874,6 +880,9 @@ file_reader_side(
            }
            /* Must fit in memory... */
            fallback_splitsize = (size_t)atoi(cmdargs.argv[a++]);
+           if (SIZEOF_OFF_T == 4 && fallback_splitsize > 1048576) { /* 1G */
+               fallback_splitsize = 1048576;
+           }
 
            if (a != cmdargs.argc) {
                error("error [taper file_reader_side PORT-WRITE: too many args: %d != %d]",
@@ -1057,7 +1066,6 @@ file_reader_side(
            free_split_buffer();
            amfree(datestamp);
            clear_tapelist();
-           free_server_config();
            amfree(taper_timestamp);
            amfree(label);
            amfree(errstr);
@@ -1325,17 +1333,14 @@ read_file(
        memcpy(&cur_holdfile, save_holdfile, SIZEOF(dumpfile_t));
     }
 
-    if (bufdebug) {
-       fprintf(stderr, "taper: r: start file\n");
-       fflush(stderr);
-    }
+    taper_debug(1, ("taper: r: start file\n"));
 
     for (bp = buftable; bp < buftable + conf_tapebufs; bp++) {
        bp->status = EMPTY;
     }
 
     bp = buftable;
-    if (interactive || bufdebug)
+    if (interactive || debug_taper >= 1)
        dumpstatus(bp);
 
     if ((cur_span_chunkstart >= (off_t)0) && (splitsize > (off_t)0)) {
@@ -1440,10 +1445,7 @@ read_file(
            break;
            
        case 'R':
-           if (bufdebug) {
-               fprintf(stderr, "taper: r: got R%d\n", bufnum);
-               fflush(stderr);
-           }
+           taper_debug(1, ("taper: r: got R%d\n", bufnum));
            
            if (need_closing) {
                if (syncpipe_put('C', 0) == -1) {
@@ -1507,7 +1509,7 @@ read_file(
 
            bp->status = FILLING;
            buflen = header_read ? (size_t)tt_blocksize : DISK_BLOCK_BYTES;
-           if (interactive || bufdebug)
+           if (interactive || debug_taper >= 1)
                dumpstatus(bp);
            if (header_written == 0 &&
                        (header_read == 1 || cur_span_chunkstart > (off_t)0)) {
@@ -1529,7 +1531,7 @@ read_file(
                        }
                memcpy(&cur_holdfile, &file, SIZEOF(dumpfile_t));
   
-               if (interactive || bufdebug)
+               if (interactive || debug_taper >= 1)
                    dumpstatus(bp);
                bp->size = (ssize_t)tt_blocksize;
                rc = (ssize_t)tt_blocksize;
@@ -1596,7 +1598,7 @@ read_file(
                        /* add CONT_FILENAME back to in-memory header */
                        strncpy(file.cont_filename, cont_filename, 
                                SIZEOF(file.cont_filename));
-                       if (interactive || bufdebug)
+                       if (interactive || debug_taper >= 1)
                            dumpstatus(bp);
                        bp->size = (ssize_t)tt_blocksize; /* output a full tape block */
                        /* save the header, we'll need it if we jump tapes */
@@ -1608,10 +1610,8 @@ read_file(
                        filesize = kbytesread;
                    }
 
-                   if (bufdebug) {
-                       fprintf(stderr,"taper: r: put W%d\n",(int)(bp-buftable));
-                       fflush(stderr);
-                   }
+                   taper_debug(1, ("taper: r: put W%d\n",
+                                   (int)(bp-buftable)));
                    if (syncpipe_put('W', (int)(bp-buftable)) == -1) {
                        put_syncpipe_fault_result(handle);
                        return (-1);
@@ -2048,8 +2048,8 @@ predict_splits(
        return(0);
 
     if (adj_splitsize <= (off_t)0) {
-      error("Split size must be > " OFF_T_FMT "k",
-       (OFF_T_FMT_TYPE)(DISK_BLOCK_BYTES/1024));
+       error("Split size must be > " OFF_T_FMT "k",
+             (OFF_T_FMT_TYPE)(DISK_BLOCK_BYTES/1024));
       /*NOTREACHED*/
     }
 
@@ -2057,14 +2057,15 @@ predict_splits(
     if (expected_splits != 0)
        return(expected_splits);
 
-    total_kb = size_holding_files(filename, 1);
+    total_kb = holding_file_size(filename, 1);
     
     if (total_kb <= (off_t)0) {
-      fprintf(stderr, "taper: r: " OFF_T_FMT
-               " kb holding file makes no sense, not precalculating splits\n",
+       fprintf(stderr, "taper: r: " OFF_T_FMT
+               " kb holding file makes no sense, setting splitsize to 0\n",
                (OFF_T_FMT_TYPE)total_kb);
-      fflush(stderr);
-      return(0);
+       fflush(stderr);
+       splitsize = 0;  /* disabling split */
+       return(0);
     }
 
     fprintf(stderr, "taper: r: Total dump size should be " OFF_T_FMT
@@ -2242,7 +2243,6 @@ tape_writer_side(
        case 'Q':
            end_tape(0);        /* XXX check results of end tape ?? */
            clear_tapelist();
-           free_server_config();
            amfree(taper_timestamp);
            amfree(label);
            amfree(errstr);
@@ -2283,10 +2283,7 @@ write_file(void)
     full_buffers = 0;
     tok = '?';
 
-    if (bufdebug) {
-       fprintf(stderr, "taper: w: start file\n");
-       fflush(stderr);
-    }
+    taper_debug(1, ("taper: w: start file\n"));
 
     /*
      * Tell the reader that the tape is open, and give it all the buffers.
@@ -2296,10 +2293,7 @@ write_file(void)
        /*NOTREACHED*/
     }
     for (i = 0; i < conf_tapebufs; i++) {
-       if (bufdebug) {
-           fprintf(stderr, "taper: w: put R%d\n", i);
-           fflush(stderr);
-       }
+       taper_debug(1, ("taper: w: put R%d\n", i));
        if (syncpipe_put('R', i) == -1) {
            error("writer: Syncpipe failure readying write buffers");
            /*NOTREACHED*/
@@ -2341,10 +2335,7 @@ write_file(void)
            }
            if (tok != 'W')
                break;
-           if (bufdebug) {
-               fprintf(stderr,"taper: w: got W%d\n",bufnum);
-               fflush(stderr);
-           }
+           taper_debug(1, ("taper: w: got W%d\n",bufnum));
            full_buffers++;
        }
        rdwait = timesadd(rdwait, stopclock());
@@ -2389,10 +2380,7 @@ write_file(void)
            }
 
            if (tok == 'W') {
-               if (bufdebug) {
-                   fprintf(stderr,"taper: w: got W%d\n",bufnum);
-                   fflush(stderr);
-               }
+               taper_debug(1, ("taper: w: got W%d\n",bufnum));
                if(bufnum != (int)(bp - buftable)) {
                    fprintf(stderr,
                            "taper: tape-writer: my buf %d reader buf %d\n",
@@ -2474,6 +2462,8 @@ write_file(void)
     return;
 
  tape_error:
+    if (errstr) 
+       dbprintf(("tape_error: %s\n", errstr));
     /* got tape error */
     if (next_tape(1)) {
        if (syncpipe_put('T', 0) == -1) {   /* next tape in place, try again */
@@ -2543,15 +2533,12 @@ write_buffer(
        total_writes += 1;
        total_tape_used += (off_t)rc;
        bp->status = EMPTY;
-       if (interactive || bufdebug)
+       if (interactive || debug_taper >= 1)
            dumpstatus(bp);
        if (interactive)
            fputs("W", stderr);
 
-       if (bufdebug) {
-           fprintf(stderr, "taper: w: put R%d\n", (int)(bp-buftable));
-           fflush(stderr);
-       }
+       taper_debug(1, ("taper: w: put R%d\n", (int)(bp-buftable)));
        if (syncpipe_put('R', (int)(bp-buftable)) == -1) {
            error("writer: Syncpipe failure during advancing write bufffer");
            /*NOTREACHED*/
@@ -2862,9 +2849,8 @@ syncpipe_get(
        return (-1);
     }
 
-    if (bufdebug && *buf != 'R' && *buf != 'W') {
-       fprintf(stderr,"taper: %c: getc %c\n", *procname, *buf);
-       fflush(stderr);
+    if (debug_taper >= 1 && *buf != 'R' && *buf != 'W') {
+       taper_debug(1, ("taper: %c: getc %c\n", *procname, *buf));
     }
 
     memcpy(intp, &buf[1], SIZEOF(int));
@@ -2923,9 +2909,8 @@ syncpipe_put(
 
     buf[0] = (char)chi;
     memcpy(&buf[1], &intval, SIZEOF(int));
-    if (bufdebug && buf[0] != 'R' && buf[0] != 'W') {
-       fprintf(stderr,"taper: %c: putc %c\n",*procname,buf[0]);
-       fflush(stderr);
+    if (debug_taper >= 1 && buf[0] != 'R' && buf[0] != 'W') {
+       taper_debug(1, ("taper: %c: putc %c\n",*procname,buf[0]));
     }
 
     rc = fullwrite(putpipe, buf, SIZEOF(buf));
@@ -2992,10 +2977,11 @@ label_tape(void)
     char *error_msg = NULL;
     char *s, *r;
     int slot = -1;
+    int scan_result;
 
     amfree(label);
     amfree(tapedev);
-    if (taper_scan(NULL, &label, &timestamp, &tapedev, CHAR_taperscan_output_callback, &error_msg) < 0) {
+    if ((scan_result = taper_scan(NULL, &label, &timestamp, &tapedev, CHAR_taperscan_output_callback, &error_msg)) < 0) {
        fprintf(stderr, "%s\n", error_msg);
        errstr = error_msg;
        error_msg = NULL;
@@ -3003,6 +2989,7 @@ label_tape(void)
        return 0;
     }
     amfree(timestamp);
+
     if(error_msg) {
        s = error_msg; r = NULL;
        while((s=strstr(s,"slot "))) { s += 5; r=s; };
@@ -3032,13 +3019,16 @@ label_tape(void)
        return 0;
     }
 
-    if(slot > -1) {
-       fprintf(stderr, "taper: slot: %d wrote label `%s' date `%s'\n", slot,
-               label, taper_timestamp);
-    }
-    else {
-       fprintf(stderr, "taper: wrote label `%s' date `%s'\n", label,
-               taper_timestamp);
+    /* Output a description of what we just did. A result of '3' from taper_scan
+     * means that a new tape was found and will be labeled. */
+    if (slot > -1) {
+       fprintf(stderr, _("taper: slot: %d wrote label `%s' date `%s'\n"), slot, label, taper_timestamp);
+       if (scan_result == 3)
+           log_add(L_INFO, _("Wrote new label `%s' to new (non-amanda) tape in slot %d"), label, slot);
+    } else {
+       fprintf(stderr, _("taper: wrote label `%s' date `%s'\n"), label, taper_timestamp);
+       if (scan_result == 3)
+           log_add(L_INFO, _("Wrote new label `%s' to new (non-amanda) tape"), label);
     }
     fflush(stderr);
 
index d4a0faa66e1fa5fa80f9f56783565011143a7e71..63aa8bb807b957761397aaafd1de8c616bc08edb 100644 (file)
@@ -20,7 +20,7 @@
  */
 
 /*
- * $Id: taperscan.c,v 1.17.2.1 2006/10/03 11:35:52 martinea Exp $
+ * $Id: taperscan.c,v 1.17 2006/07/12 12:28:19 martinea Exp $
  *
  * This contains the implementation of the taper-scan algorithm, as it is
  * used by taper, amcheck, and amtape. See the header file taperscan.h for
index 2bfce44903b866fd5bc830656d1ffb3b1aabb1d0..68b48b5d587d455df9215dc26a9e0178fbb8976b 100644 (file)
@@ -1,7 +1,8 @@
 # Makefile for Amanda tape library.
 
 INCLUDES =     -I$(top_builddir)/common-src \
-               -I$(top_srcdir)/common-src
+               -I$(top_srcdir)/common-src   \
+               -I$(top_srcdir)/gnulib
 
 LINT=@AMLINT@
 LINTFLAGS=@AMLINTFLAGS@
index d8b15c22d2a1d73dc51467b9799939c3f15e9724..acdcd45246fe4d158826fdbe0d7edd2ec659adbc 100644 (file)
@@ -48,6 +48,41 @@ DIST_COMMON = $(noinst_HEADERS) $(srcdir)/Makefile.am \
        $(srcdir)/Makefile.in
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
+       $(top_srcdir)/config/gnulib/absolute-header.m4 \
+       $(top_srcdir)/config/gnulib/alloca.m4 \
+       $(top_srcdir)/config/gnulib/arpa_inet_h.m4 \
+       $(top_srcdir)/config/gnulib/eoverflow.m4 \
+       $(top_srcdir)/config/gnulib/extensions.m4 \
+       $(top_srcdir)/config/gnulib/getaddrinfo.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-cache.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-common.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-comp.m4 \
+       $(top_srcdir)/config/gnulib/gnulib-tool.m4 \
+       $(top_srcdir)/config/gnulib/inet_ntop.m4 \
+       $(top_srcdir)/config/gnulib/intmax_t.m4 \
+       $(top_srcdir)/config/gnulib/inttypes_h.m4 \
+       $(top_srcdir)/config/gnulib/lib-ld.m4 \
+       $(top_srcdir)/config/gnulib/lib-link.m4 \
+       $(top_srcdir)/config/gnulib/lib-prefix.m4 \
+       $(top_srcdir)/config/gnulib/lock.m4 \
+       $(top_srcdir)/config/gnulib/longdouble.m4 \
+       $(top_srcdir)/config/gnulib/longlong.m4 \
+       $(top_srcdir)/config/gnulib/netinet_in_h.m4 \
+       $(top_srcdir)/config/gnulib/onceonly_2_57.m4 \
+       $(top_srcdir)/config/gnulib/size_max.m4 \
+       $(top_srcdir)/config/gnulib/snprintf.m4 \
+       $(top_srcdir)/config/gnulib/socklen.m4 \
+       $(top_srcdir)/config/gnulib/sockpfaf.m4 \
+       $(top_srcdir)/config/gnulib/stdbool.m4 \
+       $(top_srcdir)/config/gnulib/stdint_h.m4 \
+       $(top_srcdir)/config/gnulib/strdup.m4 \
+       $(top_srcdir)/config/gnulib/string_h.m4 \
+       $(top_srcdir)/config/gnulib/sys_socket_h.m4 \
+       $(top_srcdir)/config/gnulib/vasnprintf.m4 \
+       $(top_srcdir)/config/gnulib/visibility.m4 \
+       $(top_srcdir)/config/gnulib/wchar_t.m4 \
+       $(top_srcdir)/config/gnulib/wint_t.m4 \
+       $(top_srcdir)/config/gnulib/xsize.m4 \
        $(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
@@ -112,8 +147,10 @@ HEADERS = $(noinst_HEADERS)
 ETAGS = etags
 CTAGS = ctags
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ABSOLUTE_STRING_H = @ABSOLUTE_STRING_H@
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
+ALLOCA_H = @ALLOCA_H@
 AMANDA_DBGDIR = @AMANDA_DBGDIR@
 AMANDA_DEBUG_DAYS = @AMANDA_DEBUG_DAYS@
 AMANDA_TMPDIR = @AMANDA_TMPDIR@
@@ -128,18 +165,17 @@ AMPLOT_COMPRESS = @AMPLOT_COMPRESS@
 AMTAR = @AMTAR@
 AM_CFLAGS = @AM_CFLAGS@
 AR = @AR@
+ARPA_INET_H = @ARPA_INET_H@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 AUTOMAKE = @AUTOMAKE@
 AWK = @AWK@
-AWK_VAR_ASSIGNMENT_OPT = @AWK_VAR_ASSIGNMENT_OPT@
 BINARY_OWNER = @BINARY_OWNER@
-BUILD_MAN_PAGES_FALSE = @BUILD_MAN_PAGES_FALSE@
-BUILD_MAN_PAGES_TRUE = @BUILD_MAN_PAGES_TRUE@
 CAT = @CAT@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
+CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
 CHIO = @CHIO@
 CHS = @CHS@
 CLIENT_LOGIN = @CLIENT_LOGIN@
@@ -172,18 +208,40 @@ ECHO_C = @ECHO_C@
 ECHO_N = @ECHO_N@
 ECHO_T = @ECHO_T@
 EGREP = @EGREP@
+ENABLE_MANPAGE_BUILD_FALSE = @ENABLE_MANPAGE_BUILD_FALSE@
+ENABLE_MANPAGE_BUILD_TRUE = @ENABLE_MANPAGE_BUILD_TRUE@
+EOVERFLOW = @EOVERFLOW@
+EXAMPLE_TAPEDEV = @EXAMPLE_TAPEDEV@
 EXEEXT = @EXEEXT@
 F77 = @F77@
 FFLAGS = @FFLAGS@
+GCC_COMPILER_FALSE = @GCC_COMPILER_FALSE@
+GCC_COMPILER_TRUE = @GCC_COMPILER_TRUE@
 GETCONF = @GETCONF@
+GL_COND_LIBTOOL_FALSE = @GL_COND_LIBTOOL_FALSE@
+GL_COND_LIBTOOL_TRUE = @GL_COND_LIBTOOL_TRUE@
 GNUPLOT = @GNUPLOT@
 GNUTAR = @GNUTAR@
 GNUTAR_LISTED_INCREMENTAL_DIR = @GNUTAR_LISTED_INCREMENTAL_DIR@
 GNUTAR_LISTED_INCREMENTAL_DIRX = @GNUTAR_LISTED_INCREMENTAL_DIRX@
 GREP = @GREP@
 GZIP = @GZIP@
-HAVE_XSLTPROC_FALSE = @HAVE_XSLTPROC_FALSE@
-HAVE_XSLTPROC_TRUE = @HAVE_XSLTPROC_TRUE@
+HAVE_DECL_MEMMEM = @HAVE_DECL_MEMMEM@
+HAVE_DECL_MEMRCHR = @HAVE_DECL_MEMRCHR@
+HAVE_DECL_STRDUP = @HAVE_DECL_STRDUP@
+HAVE_DECL_STRNCASECMP = @HAVE_DECL_STRNCASECMP@
+HAVE_DECL_STRNDUP = @HAVE_DECL_STRNDUP@
+HAVE_DECL_STRNLEN = @HAVE_DECL_STRNLEN@
+HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
+HAVE_MEMPCPY = @HAVE_MEMPCPY@
+HAVE_STPCPY = @HAVE_STPCPY@
+HAVE_STPNCPY = @HAVE_STPNCPY@
+HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRNDUP = @HAVE_STRNDUP@
+HAVE_STRPBRK = @HAVE_STRPBRK@
+HAVE_STRSEP = @HAVE_STRSEP@
+HAVE_VISIBILITY = @HAVE_VISIBILITY@
+HAVE__BOOL = @HAVE__BOOL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -192,22 +250,31 @@ LDFLAGS = @LDFLAGS@
 LEX = @LEX@
 LEXLIB = @LEXLIB@
 LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
+LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
+LIBPTH = @LIBPTH@
+LIBPTH_PREFIX = @LIBPTH_PREFIX@
 LIBS = @LIBS@
+LIBTHREAD = @LIBTHREAD@
 LIBTOOL = @LIBTOOL@
 LIBTOOL_DEPS = @LIBTOOL_DEPS@
 LL_FMT = @LL_FMT@
 LL_RFMT = @LL_RFMT@
 LN_S = @LN_S@
 LTALLOCA = @LTALLOCA@
+LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
 LTLIBOBJS = @LTLIBOBJS@
+LTLIBPTH = @LTLIBPTH@
+LTLIBTHREAD = @LTLIBTHREAD@
 MAILER = @MAILER@
 MAKEINFO = @MAKEINFO@
 MAXTAPEBLOCKSIZE = @MAXTAPEBLOCKSIZE@
 MCUTIL = @MCUTIL@
+MKDIR_P = @MKDIR_P@
 MT = @MT@
 MTX = @MTX@
 MT_FILE_FLAG = @MT_FILE_FLAG@
+NETINET_IN_H = @NETINET_IN_H@
 OBJEXT = @OBJEXT@
 PACKAGE = @PACKAGE@
 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -221,6 +288,9 @@ PERL = @PERL@
 PRINT = @PRINT@
 RANLIB = @RANLIB@
 READLINE_LIBS = @READLINE_LIBS@
+REPLACE_STRCASECMP = @REPLACE_STRCASECMP@
+REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
+REPLACE_STRSTR = @REPLACE_STRSTR@
 RESTORE = @RESTORE@
 SAMBA_CLIENT = @SAMBA_CLIENT@
 SERVICE_SUFFIX = @SERVICE_SUFFIX@
@@ -229,7 +299,10 @@ SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 SNAPSHOT_STAMP = @SNAPSHOT_STAMP@
 SORT = @SORT@
+SSH = @SSH@
+STDBOOL_H = @STDBOOL_H@
 STRIP = @STRIP@
+SYS_SOCKET_H = @SYS_SOCKET_H@
 USE_VERSION_SUFFIXES = @USE_VERSION_SUFFIXES@
 VDUMP = @VDUMP@
 VERSION = @VERSION@
@@ -268,6 +341,7 @@ WANT_TAPE_TRUE = @WANT_TAPE_TRUE@
 XFSDUMP = @XFSDUMP@
 XFSRESTORE = @XFSRESTORE@
 XSLTPROC = @XSLTPROC@
+XSLTPROC_FLAGS = @XSLTPROC_FLAGS@
 YACC = @YACC@
 ac_c = @ac_c@
 ac_ct_AR = @ac_ct_AR@
@@ -294,6 +368,8 @@ build_os = @build_os@
 build_vendor = @build_vendor@
 datadir = @datadir@
 exec_prefix = @exec_prefix@
+gl_LIBOBJS = @gl_LIBOBJS@
+gl_LTLIBOBJS = @gl_LTLIBOBJS@
 host = @host@
 host_alias = @host_alias@
 host_cpu = @host_cpu@
@@ -319,7 +395,8 @@ target_cpu = @target_cpu@
 target_os = @target_os@
 target_vendor = @target_vendor@
 INCLUDES = -I$(top_builddir)/common-src \
-               -I$(top_srcdir)/common-src
+               -I$(top_srcdir)/common-src   \
+               -I$(top_srcdir)/gnulib
 
 LINT = @AMLINT@
 LINTFLAGS = @AMLINTFLAGS@
index eaa32ca0cb7dadc9f4db2db026c5661736fe4bd7..d4e4284d80c9af6fd2620e6241b66deb36f61f41 100644 (file)
@@ -26,7 +26,7 @@
  */
 
 /*
- * $Id: output-file.c,v 1.14.2.1 2006/11/20 22:34:39 martinea Exp $
+ * $Id: output-file.c,v 1.14 2006/07/06 15:04:18 martinea Exp $
  *
  * tapeio.c virtual tape interface for a file device.
  *
@@ -362,8 +362,8 @@ file_open(
                 OFF_T_FMT_TYPE end_record_ = (OFF_T_FMT_TYPE)0;
                n = sscanf(line, OFF_T_FMT " " OFF_T_FMT " " SIZE_T_FMT,
                            &start_record_, &end_record_, &record_size);
-                start_record = start_record_;
-                end_record = end_record_;
+                start_record = (off_t)start_record_;
+                end_record = (off_t)end_record_;
 
                if (n == 3) {
                     ri_p = &fi->ri;
index a344ac31a2e0f11b7ae7b9cc6264325c58c27cee..cc8795788cbd7679a7fbb1ea5fde08100f092930 100644 (file)
@@ -80,7 +80,7 @@ tape_tapefd_fsf(
     char *buffer = NULL;
     int len = 0;
 
-    buflen = MAX_TAPE_BLOCK_BYTES;
+    buflen = getconf_readblocksize() * 1024;
     buffer = alloc(buflen);
 
     while(--count >= 0) {
index 97875701389181ad6c8b8df87d0c4a0631a0e22b..07eeb7efb275cf651721cb969c1596708d116d73 100644 (file)
@@ -32,6 +32,7 @@
  */
 
 #include "amanda.h"
+#include "conffile.h"
 #include "tapeio.h"
 #include "fileheader.h"
 
@@ -863,7 +864,7 @@ tapefd_rdlabel(
 
     amfree(*datestamp);
     amfree(*label);
-    buflen = MAX_TAPE_BLOCK_BYTES;
+    buflen = getconf_readblocksize() * 1024;
     buffer = alloc(buflen + 1);
 
     if(tapefd_getinfo_fake_label(fd)) {
index bf3673771fd209142602e9bee7f6e3be94c0ba2a..385039eef8ea8805f08ae1c8def875c7cd2c6818 100644 (file)
@@ -233,6 +233,12 @@ do_pass(
            sProgName, tapedev, strerror(errno));
     exit(1);
   }
+  if (((-1 == tapefd_close(fd)) ||
+       (-1 == (fd = tape_open(tapedev, O_RDWR))))) {
+    fprintf(stderr, "%s: could not re-open %s: %s\n",
+           sProgName, tapedev, strerror(errno));
+    exit(1);
+  }
 
   time(&start);
 
@@ -292,6 +298,15 @@ do_pass0(
     exit(1);
   }
 
+  if (dorewind &&
+      ((-1 == tapefd_close(fd)) ||
+       (-1 == (fd = tape_open(tapedev, O_RDWR))))) {
+    fprintf(stderr, "%s: could not re-open %s: %s\n",
+           sProgName, tapedev, strerror(errno));
+    exit(1);
+  }
+
+
   time(&start);
 
   blks = writeblocks(fd, size);