From: Bdale Garbee Date: Tue, 20 May 2008 04:47:53 +0000 (-0600) Subject: Imported Upstream version 2.5.2p1 X-Git-Tag: upstream/2.5.2p1^0 X-Git-Url: https://git.gag.com/?p=debian%2Famanda;a=commitdiff_plain;h=d3b2175e084f88c8736ad7073eacbf4670147aec Imported Upstream version 2.5.2p1 --- diff --git a/COPYRIGHT-APACHE b/COPYRIGHT-APACHE deleted file mode 100644 index 998fb56..0000000 --- a/COPYRIGHT-APACHE +++ /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 . - * - * This code is based on, and used with the permission of, the - * SIO stdio-replacement strx_* functions by Panos Tsirigotis - * for xinetd. - */ diff --git a/COPYRIGHT-REGEX b/COPYRIGHT-REGEX deleted file mode 100644 index 33743d3..0000000 --- a/COPYRIGHT-REGEX +++ /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 diff --git a/ChangeLog b/ChangeLog index e298b3c..fbba979 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,14 +1,549 @@ +2007-06-06 Jean-Louis Martineau + * Amanda 2.5.2p1 released. + +2007-06-06 Jean-Louis Martineau + * restore-src/restore.c: accept all header with size >= DISK_BLOCK_BYTES + +2007-06-06 Jean-Louis Martineau + * NEWS: Change in 2.5.2p1. + * configure.in: AM_INIT_AUTOMAKE(amanda, 2.5.2p1). + +2007-06-06 Jean-Louis Martineau + * configure.in: Fix check backup is not from gnutar. + +2007-06-04 Jean-Louis Martineau + Original patch by franz Fischer + * tape-src/tapetype.c: close and open after a rewind. + +2007-06-04 Jean-Louis Martineau + * 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 + * server-src/amstatus.pl.in: Perl argument are '-Tw'. + +2007-06-04 Dustin J. Mitchell + * server-src/holding.c: Forgotten ==0 in strcmp(). + +2007-05-31 Jean-Louis Martineau + * configure.in: Check backup is not from gnutar. + +2007-05-31 Jean-Louis Martineau + * recover-src/set_commands.c (cd_dir): Validate regex. + +2007-05-30 Jean-Louis Martineau + * common-src/krb5-security.c: Use keytab_name. + * server-src/holding.c: Remove unused date_matches variable. + +2007-05-30 Jean-Louis Martineau + * server-src/amstatus.pl.in: Set and use chunk_time. + +2007-05-30 Jean-Louis Martineau + * common-src/util.c: Don't use -w flags for od execution. + +2007-05-29 Jean-Louis Martineau + * server-src/planner.c: Don't report overwrite if no label. + +2007-05-29 Jean-Louis Martineau + * changer-src/chg-manual.sh.in: Don't reset the slot to 0 on eject. + +2007-05-25 Jean-Louis Martineau + * server-src/amstatus.pl.in: Put all flags in one arguments. + +2007-05-23 Jean-Louis Martineau + * common-src/util.c: Fix missing NULL in vstralloc call. + +2007-05-23 Jean-Louis Martineau + * server-src/amstatus.pl.in: Use compressed size. + +2007-05-23 Jean-Louis Martineau + * 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 + * server-src/find.c: Send ouput to stderr. + +2007-05-17 Jean-Louis Martineau + * 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 + * server-src/dumper.c (read_datafd): Reset timeout after the write. + +2007-05-15 Jean-Louis Martineau + * client-src/sendsize.c: Set qlist before using it. + +2007-05-15 Jean-Louis Martineau + * 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 + * 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 + * 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 + * util.c (cmp_sockaddr): Fix compilation. + +2007-05-10 Jean-Louis Martineau + * util.c (cmp_sockaddr): un-map V4mapped address before comparison. + * common-src/security-util.c: add debugging. + +2007-05-08 Jean-Louis Martineau + * server-src/diskfile.c: Fix double free. + +2007-05-07 Jean-Louis Martineau + * common-src/alloc.c (debug_vstrallocf): Remove file and line. + * common-src/amanda.h (vstrallocf): Change define. + +2007-05-07 Jean-Louis Martineau + * 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 + * common-src/amanda.h: Define AI_V4MAPPED and AI_ALL. + +2007-05-07 Jean-Louis Martineau + * 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 + * common-src/stream.c: pass correct sockaddr size to bind() + +2007-05-07 Pieter Bowman + * common-src/file.c: reverse the order of chown/chmod to correctly + create temporary files. + +2007-05-03 Jean-Louis Martineau + * docs/*.txt: Update from xml-docs. + +2007-05-03 Jean-Louis Martineau + * man/xml-source/amrecover.8.xml: Fix space. + +2007-05-03 Jean-Louis Martineau + * Amanda 2.5.2 released. + * configure.in: AM_INIT_AUTOMAKE(amanda, 2.5.2). + +2007-05-02 Jean-Louis Martineau + * 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 + * amandad-src/amandad.c: Improve 'invalid service' message. + +2007-05-01 Jean-Louis Martineau + * 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 + * common-src/security-util.c (tcp1_stream_client): Set rh->rc->driver. + +2007-04-27 Jean-Louis Martineau + * 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 + * 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 + * server-src/amcheck.c: Fix infobad setting. + +2007-04-26 Jean-Louis Martineau + * server-src/amcheck.c: Set *bad on error. + +2007-04-26 Jean-Louis Martineau + * 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 + * configure.in common-src/ssh-security.c: allow build-time configuration of SSH options + +2007-04-23 Paddy Sreenivasan + * changer-src/scsi-solaris.c common-src/protocol.c: changes to build on Solaris + +2007-04-20 Dustin J. Mitchell + * configure.in: remove unused AMANDA_C_VOLATILE + * config/acinclude.m4: remove unused AMANDA_C_VOLATILE + +2007-04-20 Dustin J. Mitchell + * autogen: silence unnecessary warnings about GNU make, return exit status + +2007-04-20 Dustin J. Mitchell + * common-src/stream.c: retry socket creation if OS does not support IPv6 + at runtime + +2007-04-20 Jean-Louis Martineau + * 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 + * 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 + * client-src/sendbackup.c: Improve tar argument in amanda header for + extraction. + +2007-04-18 Dustin J. Mitchell + * 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 + * changer-src/chg-disk.sh.in: Send error message to stdout. + +2007-04-17 Dustin J. Mitchell + * changer-src/chg-zd-mtx.sh.in: fix more typos (thanks to + "Stefan G. Weichinger" ) + +2007-04-17 Jean-Louis Martineau + * restore-src/restore.c: Fix restoration of split and encrypted backup. + +2007-04-13 Dustin J. Mitchell + * changer-src/chg-zd-mtx.sh.in: fix typo in error message + +2007-04-13 Jean-Louis Martineau + * Amanda 2.5.2b1 released. + * configure.in: AM_INIT_AUTOMAKE(amanda, 2.5.2b1). + +2007-04-13 Jean-Louis Martineau + * 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 + * 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 + * server-src/dumper.c: use fullwrite() instead of write() + +2007-04-12 Jean-Louis Martineau + * 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 + * server-src/amcheck.c: Remove duplicate test. + * server-src/dumper.c: Use newvstralloc. + +2007-04-12 Jean-Louis Martineau + * server-src/reporter.c: Take value from chunker if it succeed and + taper fail. + +2007-04-10 Jean-Louis Martineau + * configure.in: Use krb5 shared library. + +2007-04-10 Dustin J. Mitchell + * changer-src/chg-zd-mtx.sh.in: remove configurability of mt, mtx paths + +2007-04-10 Jean-Louis Martineau + * common-src/krb5-security.c: Initialize rc->gss_context. + +2007-04-09 Dustin J. Mitchell + * changer-src/chg-zd-mtx.sh.in: fix bugs in configuration for mt, mtx paths + +2007-04-06 Dustin J. Mitchell + * 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 + * server-src/taper.c: Limit splitsize to 1G in PORT-WRITE. + +2007-04-06 Jean-Louis Martineau + * common-src/krb5-security.c: Report client hostname. + +2007-04-06 Jean-Louis Martineau + * common-src/tapelist.c (append_to_tape): Don't call dump_tapelist. + +2007-04-05 Dustin J. Mitchell + * contrib/macosx/org.amanda.amandad.bsd*.plist: updated to use username + 'amandabackup' + +2007-04-05 Dustin J. Mitchell + * 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 + * 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 + * 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 + * server-src/dumper.c server-src/chunker.c: remove assumed ENOSPC + error in static write_tapeheader functions + +2007-04-03 Jean-Louis Martineau + * common-src/security-util.c: Remove buggy &. + +2007-04-03 Jean-Louis Martineau + * 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 + * 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 + 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 + * 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 + * common-src/file.c: remove unused amanda_setup() + +2007-03-30 Jean-Louis Martineau + * common-src/amanda.h: Define a _() macro. + +2007-03-28 Dustin J. Mitchell + * 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 + * 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 + * common-src/krb5-security.c: Compile with heimdal kerberos. + +2007-03-27 Jean-Louis Martineau + 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 + Merge from zmanda EXT. + +2007-03-27 Jean-Louis Martineau + * Makefile.am (EXTRA_DIST): Remove contrib/gnulib-update-current. + +2007-03-27 Jean-Louis Martineau + * server-src/reporter.c: Ouput quoted diskname in "DUMP SUMMARY" + section. + +2007-03-23 Jean-Louis Martineau + * changer-src/chg-zd-mtx.sh.in: Exit with a message if the + configuration file doesn't exist. + +2007-03-23 Jean-Louis Martineau + * common-src/conffile.c: Fix error message. + +2007-03-23 Jean-Louis Martineau + * amandad-src/amandad.c: Fix segfault. + +2007-03-23 Jean-Louis Martineau + * common-src/security-util.c: Use SS_LEN. + * common-src/util.c: Use SS_LEN. + +2007-03-21 Jean-Louis Martineau + * 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 + 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 + * 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 + * 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 + * common-src/bsd-security.c: Always retry getaddrinfo if INET6 failed. + * common-src/bsdudp-security.c: Ditto. + +2007-02-22 Jean-Louis Martineau + * common-src/debug.c: Remove old file in current directory. + +2007-02-22 Jean-Louis Martineau + * changer-src/chg-chio.pl.in: Typo. + +2007-02-21 Jean-Louis Martineau + * recover-src/extract_list.c: Remove match for path_on_disk_slash. + +2007-02-20 Jean-Louis Martineau + * common-src/stream.c, common-src/util.c: Pass exact socklen_t to + bind and connect call. + +2007-02-20 Jean-Louis Martineau + * 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 + * amandad-src/amandad.c: Fix compilation with --without-ipv6. + +2007-02-19 Jean-Louis Martineau + * server-src/amverify.sh.in: Remove bogus fi. + +2007-02-16 Jean-Louis Martineau + * 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 + * server-src/taper.c: Don't call free_server_config. + +2007-02-15 Jean-Louis Martineau + * 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 + * common-src/security-util.c: Add "on the client" message. + +2007-02-13 Jean-Louis Martineau + * server-src/amstatus.pl.in: fix for chunk and displayunit. + +2007-02-13 Jean-Louis Martineau + * server-src/dumper.c: Fix if krb4 is compiled but another auth is + used. + +2007-02-13 Jean-Louis Martineau + * common-src/alloc.c (safe_env): Remove LANG and LC_* only if we are + priviledged process. + +2007-02-13 Jean-Louis Martineau + * dumper-src/amgtar.pl.in: Replace -t options by -T. + * dumper-src/Makefile.am: Remove perl -t options. + +2007-02-12 Jean-Louis Martineau + * common-src/Makefile.am (STANDARD_COMMON_STUFF_NOT_FILE): Add sl. + * common-src/statfs.c: Fix scale function. + +2007-02-12 Jean-Louis Martineau + * client-src/sendsize.c: Fix PARAM_HONOR_NODUMP. + +2007-02-09 Jean-Louis Martineau + * server-src/reporter.c: Fix postscript crash. + +2007-02-09 Jean-Louis Martineau + * changer-src/chg-manual.sh.in: Add tty, email, tty_email request mode. + 2007-02-07 Jean-Louis Martineau * server-src/amindexd.c: Use dbfd. 2007-02-06 Jean-Louis Martineau - * 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 - * 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 * common-src/clock.c (timesub): The result must always be positive. @@ -20,7 +555,8 @@ * server-src/amcheck.c: Add parentheses. 2007-02-02 Jean-Louis Martineau - * 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 * man/Makefile.am: Use http://docbook.sourceforge.net @@ -43,6 +579,9 @@ * server-src/amflush.c: Output a starttime line. * server-src/amstatus.pl.in: parse the starttime line. +2007-01-26 Jean-Louis Martineau + * configure.in: Fix --with-ipv6 option. + 2007-01-26 Jean-Louis Martineau * server-src/amdump.sh.in: Exit with a status. @@ -58,6 +597,9 @@ 2007-01-26 Jean-Louis Martineau * server-src/amstatus.pl.in: Detect failed dump to tape. +2007-01-25 Jean-Louis Martineau + * configure.in: Add --with-ipv6 option. + 2007-01-25 Jean-Louis Martineau * server-src/changer.c (changer_command): Send stderr to dbfd(). @@ -71,8 +613,10 @@ * changer-src/chg-zd-mtx.sh.in: Set CHANGER environment variable. 2007-01-24 Jean-Louis Martineau - * 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 + * common-src/conffile.c: Check for duplicate -o options. * recover-src/amrecover.c: Change precedence of option. 2007-01-24 Jean-Louis Martineau @@ -95,18 +639,33 @@ * server-src/amcheck.c: Check tape_access. * server-src/taper.c: Improve message. +2007-01-16 Jean-Louis Martineau + * configure.in: Define GCC_COMPILER. + * gnulib/Makefile.am: Add -Wno-error to AM_CFLAGS if GCC_COMPILER. + 2007-01-16 Jean-Louis Martineau * server-src/getconf.c: Fix segfault in parameter parsing. +2007-01-15 Jean-Louis Martineau + * 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 - * 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 + * config/gnulib/gnulib-common.m4: New file. + * config/gnulib.m4i: Load config/gnulib/gnulib-common.m4. + 2007-01-10 Jean-Louis Martineau * amandad-src/amandad.c (do_sendpkt): Send packet if handle != NULL. 2007-01-10 Jean-Louis Martineau - * 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 @@ -118,9 +677,17 @@ 2007-01-04 Jean-Louis Martineau * restore-src/restore.c: Use prompt_in. +2007-01-04 Jean-Louis Martineau + * 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 * 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. @@ -149,14 +716,11 @@ common-src/security-util.c: Use pkt_init_empty. 2006-12-18 Jean-Louis Martineau - * 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 * restore-src/restore.c: Fix filename for output file. -2006-12-12 Jean-Louis Martineau - * common-src/util.c: Fix printf format error. - 2006-12-12 Jean-Louis Martineau * common-src/amanda.h: Define __attribute__ for gcc >= 3. * common-src/packet.c (pkt_init): Accept NULL for fmt. @@ -164,9 +728,10 @@ 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. @@ -180,6 +745,11 @@ * server-src/amindexd.c: Clean the indexd file between the uncompress and sort process. +2006-12-08 Jean-Louis Martineau + * 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 * 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, @@ -190,13 +760,51 @@ * changer-src/chg-rait.sh.in: Fix typo for -reset. 2006-12-07 Jean-Louis Martineau - * 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 + * 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 + * 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 + * common-src/util.c (str_sockaddr): Use host byte order for port. + 2006-12-04 Jean-Louis Martineau * server-src/amtape.h: Remove file. +2006-12-04 Jean-Louis Martineau + 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 * client-src/sendbackup.c: Kill dump process on error. @@ -222,9 +830,39 @@ 2006-11-29 Jean-Louis Martineau * restore-src/restore.c (search_tapes): Fix prompt_out setting. -2006-11-24 Jean-Louis Martineau +2006-11-28 Jean-Louis Martineau + * 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 + * config/Makefile.am (EXTRA_DIST): Add gnulib.m4i. + +2006-11-27 Jean-Louis Martineau * common-src/util.c (copy_file): Fix compilation error. +2006-11-27 Jean-Louis Martineau + * common-src/stream.c: Fix compilation error. + +2006-11-27 Jean-Louis Martineau + * 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 + * 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 * client-src/sendbackup-dump.c, client-src/sendbackup-gnutar.c, client-src/sendsize.c, @@ -252,10 +890,33 @@ * common-src/security-util.c (tcpm_recv_token): amanda protocol packet can be larger than NETWORK_BLOCK_BYTES +2006-11-21 Jean-Louis Martineau + * common-src/stream.c: Fix compiler error. + +2006-11-21 Jean-Louis Martineau + * 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 + * 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 * client-src/sendsize.c: Open the amandates file after the /amanda-client.conf file is loaded. +2006-11-20 Jean-Louis Martineau + * client-src/sendsize.c: Fix compiler error on boris. + * server-src/driver.c: Fix compiler error on rocky. + 2006-11-20 Jean-Louis Martineau * common-src/security-util.c, server-src/amcheck.c, * server-src/driver.c, server-src/dumper.c, @@ -279,32 +940,30 @@ is set to 0. 2006-11-09 Jean-Louis Martineau - * 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 - * 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 * changer-src/chg-scsi.c: Don't remove '_' from "generic_changer". - + 2006-11-08 Jean-Louis Martineau - * 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 + * 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 * server-src/driver.c: set off_t variable to 0 before sscanf. * server-src/planner.c: set off_t variable to 0 before sscanf. @@ -317,7 +976,7 @@ * server-src/diskfile.c: Fix coverity bug 147. 2006-11-07 Jean-Louis Martineau - * 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 @@ -337,7 +996,8 @@ * server-src/diskfile.c: Don't use 0 for NULL. 2006-11-01 Jean-Louis Martineau - * 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 @@ -346,16 +1006,6 @@ * 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 * changer-src/scsi-changer-driver.c: Add Tandberg SLR100, @@ -366,9 +1016,25 @@ * common-src/amanda.h: Define dbrename if !DEBUG_CODE. * restore-src/amidxtaped.c: Declare i if !DEBUG_CODE. -2006-10-25 Jean-Louis Martineau - * server-src/amtape.c: Use parse_conf instead of parse_server_conf. +2006-10-30 Jean-Louis Martineau + * 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 + This was reported as debian bug 394796. Thanks to Damyan Ivanov + for reporting and to Bdale Garbee + 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 Patch by Jay Fenlason @@ -386,20 +1052,77 @@ 2006-10-24 Jean-Louis Martineau * server-src/taper.c: Fix allocation problem on tapedev. +2006-10-20 Jean-Louis Martineau + * 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 * server-src/taper.c (free_split_buffer): Correct free. +2006-10-20 Jean-Louis Martineau + * 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 + * 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 * man/xml-source/amanda.conf.5.xml: Fix formating. +2006-10-19 Jean-Louis Martineau + * client-src/calcsize.c, client-src/sendsize.c: Remove bogus fseek. + 2006-10-19 Jean-Louis Martineau * client-src/calcsize.c: Quote amname. +2006-10-19 Jean-Louis Martineau + * 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 * 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 + * common-src/Makefile.am (libamanda_la_LIBADD) Remove @LTLIBOBJS@. + +2006-10-11 Jean-Louis Martineau + * 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 + * 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 + * common-src/Makefile.am: Remove all reference to our regex + * common-src/match.c: #include , 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 * server-src/planner.c: Improve message for dump larger than available tape space if runtapes > 1 and splitsize == 0. @@ -416,7 +1139,7 @@ 2006-10-03 Jean-Louis Martineau * 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 * server-src/amoverview.pl.in: Fix parsing of time field from amadmin. @@ -428,7 +1151,7 @@ server-src/taperscan.c: Check for CNF_TAPEDEV == NULL. 2006-10-03 Jean-Louis Martineau - * 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 @@ -442,10 +1165,9 @@ * 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 - * 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 + * common-src/conffile.c (client_keytab): Add DEBUG_*. + * oldrecover-src/amrecover.c: Call read_clientconf. 2006-09-27 Jean-Louis Martineau * restore-src/restore.c: Improve debugging. @@ -453,14 +1175,14 @@ 2006-09-27 Jean-Louis Martineau * 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 Patch by Orion Poplawski @@ -470,6 +1192,16 @@ * 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 + * 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 Patch by William Jojo * client-src/sendsize.c: Fix #endif for AIX. @@ -482,14 +1214,6 @@ 2006-09-21 Jean-Louis Martineau * server-src/amcheck.c: Don't assert if holding use is set to 0. -2006-09-21 Jean-Louis Martineau - * common-src/util.c: Declare keytable. - * common-src/util.h: Declare keytable as extern. - -2006-09-19 Jean-Louis Martineau - * contrib/sst: Removed - * Makefile.am (EXTRA_DIST): Remove sst files. - 2006-09-19 Jean-Louis Martineau * server-src/find.c (search_logfile): Count 'PARTIAL taper line'. @@ -500,6 +1224,77 @@ 2006-09-19 Jean-Louis Martineau * common-src/dgram.c (dgram_bind): Remove unused variables. +2006-09-19 Jean-Louis Martineau + * 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 + * 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 + * 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 * common-src/dgram.c (dgram_bind): Don't set SO_REUSEADDR on socket. @@ -509,7 +1304,7 @@ 2006-09-18 Jean-Louis Martineau * 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 diff --git a/Makefile.am b/Makefile.am index b51faf4..532bcce 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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) diff --git a/Makefile.in b/Makefile.in index 598bac2..1679e3c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -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 f88b5e8..2fb1902 100644 --- 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 diff --git a/ReleaseNotes b/ReleaseNotes index 664194b..47d9399 100644 --- a/ReleaseNotes +++ b/ReleaseNotes @@ -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 diff --git a/acinclude.m4 b/acinclude.m4 index b55bdb0..0451d2a 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1,5475 +1,4328 @@ -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 , 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 <conftest.$ac_ext -#include "confdefs.h" -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_IPC_H -# include -#endif -#ifdef HAVE_SYS_SHM_H -# include -#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 <conftest.$ac_ext -#include "confdefs.h" -#ifdef HAVE_SYS_TIME_H -# include -#endif -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_SELECT_H -# include -#endif -#ifdef HAVE_SYS_SOCKET_H -# include -#endif -#ifdef HAVE_UNISTD_H -# include -#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 -#include -#ifdef TIME_WITH_SYS_TIME -# include -# include -#else -# ifdef HAVE_SYS_TIME_H -# include -# else -# include -# 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 -# include -#else -# ifdef HAVE_SYS_TIME_H -# include -# else -# include -# 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 -#if STDC_HEADERS -#include -#include -#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 -#if STDC_HEADERS -#include -#include -#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 , 'union wait', arg-type of 'wait()'. -dnl by T.E.Dickey" , Jim Spath -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 -#if HAVE_SYS_WAIT_H -# include -#else -# if HAVE_WAIT_H -# include -# 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 +AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +_LT_AC_PROG_ECHO_BACKSLASH -#if HAVE_SYS_WAIT_H -# include -#else -# if HAVE_WAIT_H -# include -# 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 " section requires the -dnl existence of an include file 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 . In other enviroments -dnl we can use the inet-types in 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 " -dnl or "#include ", 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 " to obtain the stdint-types. -dnl -dnl Remember, if the system already had a valid , 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 - -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 ],[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 " >>$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 < -#else -#include -/* .................... 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 <>$ac_stdint - cat >>$ac_stdint </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 , 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 < +#endif +#include -# _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 </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.so + # instead of lib.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 < -#endif - -#include - -#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.so - # instead of lib.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 <&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 &1 /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 <&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 &1 /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 < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <&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 , 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 < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext </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 , 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 <&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 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 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 <&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 +# #undef WIN32_LEAN_AND_MEAN +# #include +# +# #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 +# 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 <conftest.$ac_ext +#include "confdefs.h" +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_IPC_H +# include +#endif +#ifdef HAVE_SYS_SHM_H +# include +#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 <conftest.$ac_ext +#include "confdefs.h" +#ifdef HAVE_SYS_TIME_H +# include +#endif +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_SELECT_H +# include +#endif +#ifdef HAVE_SYS_SOCKET_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#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 +#include +#ifdef TIME_WITH_SYS_TIME +# include +# include +#else +# ifdef HAVE_SYS_TIME_H +# include +# else +# include +# 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 +# include +#else +# ifdef HAVE_SYS_TIME_H +# include +# else +# include +# 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 +#if STDC_HEADERS +#include +#include +#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 +#if STDC_HEADERS +#include +#include +#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 , 'union wait', arg-type of 'wait()'. +dnl by T.E.Dickey" , Jim Spath +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 - 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 +#else +# if HAVE_WAIT_H +# include +# 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 - 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 +#else +# if HAVE_WAIT_H +# include +# 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 " section requires the +dnl existence of an include file 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 . In other enviroments +dnl we can use the inet-types in 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 " +dnl or "#include ", 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 " to obtain the stdint-types. +dnl +dnl Remember, if the system already had a valid , 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 - 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 ],[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 <&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 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 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 " >>$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 </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 <&2 +#if defined HAVE_STDINT_H || defined _STDINT_HAVE_STDINT_H +#include +#else +#include -*** 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 <= 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 -# #undef WIN32_LEAN_AND_MEAN -# #include -# -# #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 -# 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 <conftest.xml + + + + +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 +# include ], + [u_int i = sizeof (struct sockaddr_storage)], + ac_cv_has_sockaddr_storage=yes, + ac_cv_has_sockaddr_storage=no)) + AC_MSG_RESULT($ac_cv_has_sockaddr_storage) + if test $ac_cv_has_sockaddr_storage = yes ; then + AC_DEFINE(HAVE_SOCKADDR_STORAGE,1,[if struct sockaddr_storage exists]) + fi]) + + diff --git a/amandad-src/Makefile.am b/amandad-src/Makefile.am index 3411292..a673cb5 100644 --- a/amandad-src/Makefile.am +++ b/amandad-src/Makefile.am @@ -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)"; \ diff --git a/amandad-src/Makefile.in b/amandad-src/Makefile.in index ed05069..9ea0a5c 100644 --- a/amandad-src/Makefile.in +++ b/amandad-src/Makefile.in @@ -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 diff --git a/amandad-src/amandad.c b/amandad-src/amandad.c index 2bc6df5..f04d4e3 100644 --- a/amandad-src/amandad.c +++ b/amandad-src/amandad.c @@ -25,15 +25,13 @@ */ /* - * $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" @@ -45,10 +43,16 @@ #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 */ diff --git a/amandad-src/amandad_util.c b/amandad-src/amandad_util.c index aef2852..9ce31fd 100644 --- a/amandad-src/amandad_util.c +++ b/amandad-src/amandad_util.c @@ -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); } diff --git a/amplot/Makefile.in b/amplot/Makefile.in index ca2b138..a0c2eda 100644 --- a/amplot/Makefile.in +++ b/amplot/Makefile.in @@ -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@ diff --git a/amplot/amplot.awk b/amplot/amplot.awk index 962c080..fa34c4b 100644 --- a/amplot/amplot.awk +++ b/amplot/amplot.awk @@ -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; diff --git a/amplot/amplot.sh.in b/amplot/amplot.sh.in index 05a6ce8..f771e74 100644 --- a/amplot/amplot.sh.in +++ b/amplot/amplot.sh.in @@ -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] " - 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] \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, for next graph" + _ "Displaying graph on the screen, 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 2da3592..e15c807 100755 --- 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 diff --git a/changer-src/Makefile.am b/changer-src/Makefile.am index 2471aa2..7632845 100644 --- a/changer-src/Makefile.am +++ b/changer-src/Makefile.am @@ -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 diff --git a/changer-src/Makefile.in b/changer-src/Makefile.in index b547a30..a161797 100644 --- a/changer-src/Makefile.in +++ b/changer-src/Makefile.in @@ -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)" diff --git a/changer-src/chg-chio.pl.in b/changer-src/chg-chio.pl.in index 79c7a39..56bb358 100644 --- a/changer-src/chg-chio.pl.in +++ b/changer-src/chg-chio.pl.in @@ -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 " 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; diff --git a/changer-src/chg-disk.sh.in b/changer-src/chg-disk.sh.in index c4f59f7..5ac3783 100644 --- a/changer-src/chg-disk.sh.in +++ b/changer-src/chg-disk.sh.in @@ -83,7 +83,7 @@ MYNAME=$0 TAPE=`amgetconf$SUF tapedev` if test X"$TAPE" == X""; then - echo " tapedev not specified in amanda.conf." 1>&2 + echo " 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 " 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 " 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 " $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 " $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 " $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 " $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 " 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 index 0000000..2df29bf --- /dev/null +++ b/changer-src/chg-lib.sh.in @@ -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 diff --git a/changer-src/chg-manual.sh.in b/changer-src/chg-manual.sh.in index 205decf..1c45651 100644 --- a/changer-src/chg-manual.sh.in +++ b/changer-src/chg-manual.sh.in @@ -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; 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 diff --git a/changer-src/chg-multi.sh.in b/changer-src/chg-multi.sh.in index 9ac098e..0eea3e9 100644 --- a/changer-src/chg-multi.sh.in +++ b/changer-src/chg-multi.sh.in @@ -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=" $myname: mt program not found" - code=1 - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit $code + answer=`_ ' %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=" $pname: $ourconf does not exist" - code=2 - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit $code + answer=`_ ' %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=" $pname: firstslot not specified in $ourconf" - code=2 - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit $code + answer=`_ ' %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=" $pname: lastslot not specified in $ourconf" - code=2 - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit $code + answer=`_ ' %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=" $pname: gravity not specified in $ourconf" - code=2 - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit $code + answer=`_ ' %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=" $pname: needeject not specified in $ourconf" - code=2 - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit $code + answer=`_ ' %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=" $pname: statefile not specified in $ourconf" - code=2 - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit $code + answer=`_ ' %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=" $pname: needeject and multieject cannot be both enabled in $ourconf" - code=2 - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit $code + answer=`_ ' %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=" $pname: bad slot name \"$slotparm\"" - code=1 - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit $code + answer=`_ ' %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=" usage: $pname {-reset | -slot [|current|next|prev|advance] | -info | -eject}" - code=2 - echo "Exit -> $answer" >> $logfile - echo "$answer" - exit $code + answer=`_ ' usage: %s {-reset | -slot [|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 diff --git a/changer-src/chg-scsi.c b/changer-src/chg-scsi.c index 1e679a1..f4b904e 100644 --- a/changer-src/chg-scsi.c +++ b/changer-src/chg-scsi.c @@ -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 $"; /* * * diff --git a/changer-src/chg-zd-mtx.sh.in b/changer-src/chg-zd-mtx.sh.in index 281112c..a36e901 100644 --- a/changer-src/chg-zd-mtx.sh.in +++ b/changer-src/chg-zd-mtx.sh.in @@ -205,6 +205,7 @@ # # initial_poll_delay=NN #### initial delay after load before polling for # #### readiness +# #### #### @@ -305,17 +306,10 @@ # 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 "" "could not determine current slot, are you sure your drive slot is $driveslot" + Exit 2 \ + `_ ''` \ + "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 \ - "" \ + `_ ''` \ "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 \ - "" \ - "cannot determine first slot" + `_ ''` \ + `_ 'cannot determine first slot'` return $? # in case we are internal elif [ $lastslot -lt 0 ]; then Exit 2 \ - "" \ - "cannot determine last slot" + `_ ''` \ + `_ '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 \ - "" \ + `_ ''` \ "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 \ - "" \ + `_ ''` \ "changerfile must be specified in amanda.conf" fi tape=`amgetconf$SUF tapedev 2>/dev/null` if [ -z "$tape" ]; then Exit 2 \ - "" \ + `_ ''` \ "tapedev may not be empty" elif [ $tape = "/dev/null" -o `expr "$tape" : 'null:'` -eq 5 ]; then Exit 2 \ - "" \ + `_ ''` \ "tapedev ($tape) may not be the null device" fi TAPE=`amgetconf$SUF changerdev 2>/dev/null` if [ -z "$TAPE" ]; then Exit 2 \ - "" \ + `_ ''` \ "changerdev may not be empty" elif [ $TAPE = "/dev/null" ]; then Exit 2 \ - "" \ + `_ ''` \ "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 \ + `_ ''` \ + "configuration file \"$configfile\" doesn't exist" +fi +if [ ! -f $configfile ]; then + Exit 2 \ + `_ ''` \ + "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 \ - "" \ - "cannot determine drive slot from $tape" + `_ ''` \ + `_ '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 \ - "" \ - "$var missing in $configfile" + `_ ''` \ + `_ '%s missing in %s' "$var" "$configfile"` fi if IsNumeric "$val" ; then : else Exit 2 \ - "" \ - "$var ($val) not numeric in $configfile" + `_ ''` \ + `_ '%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 \ - "" \ - "firstslot ($firstslot) greater than" \ - "lastslot ($lastslot) in $configfile" + `_ ''` \ + `_ 'firstslot (%s) greater than lastslot (%s) in %s' "$firstslot" "$lastslot" "$configfile"` fi if [ $autoclean -ne 0 -a $cleanslot -lt 0 ]; then Exit 2 \ - "" \ - "autoclean set but cleanslot not valid ($cleanslot)" + `_ ''` \ + `_ '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 "" "reset: should not get here" + Exit 2 `_ ''` `_ '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 "" "Missing -slot argument" + Exit 2 `_ ''` `_ '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 "" "Illegal slot: \"$whichslot\"" + Exit 2 `_ ''` `_ 'Illegal slot: "%s"' "$whichslot"` return $? # in case we are internal ;; esac @@ -1003,9 +1001,8 @@ loadslot() { done if [ $# -le 0 ]; then Exit 2 \ - "" \ - "Cannot find slot $find_slot" \ - "in slot list ($slot_list)" + `_ ''` \ + `_ '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 \ - "" \ - "Line $line malformed in $labelfile: $lbl $bc $junk" + `_ ''` \ + `_ '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 \ - "" \ - "Duplicate entries: $labelfile line $line" + `_ ''` \ + `_ '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 "" "Missing -label argument" + Exit 2 `_ ''` `_ 'Missing -label argument'` return $? # in case we are internal fi tapelabel=$1 if [ $havereader -eq 0 ]; then - Exit 2 "" "Not configured with barcode reader" + Exit 2 `_ ''` `_ 'Not configured with barcode reader'` return $? # in case we are internal fi get_loaded_info if [ $loadedslot -lt 0 ]; then - Exit 1 "" "No tape currently loaded" + Exit 1 `_ ''` `_ '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 \ - "" \ - "$tapelabel: \"$old_val\" conflicts with" \ - "new $val_type \"$new_val\"" \ - "for $lf_type \"$lf_val\"" + `_ ''` \ + `_ '%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 "" "Missing -search argument" + Exit 2 `_ ''` `_ 'Missing -search argument'` return $? # in case we are internal fi tapelabel=$1 if [ $havereader -eq 0 ]; then - Exit 2 "" "Not configured with barcode reader" + Exit 2 `_ ''` `_ '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 \ - "" \ - "$tapelabel: label \"$tapelabel\" not found in $labelfile" + `_ ''` \ + `_ '%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 \ - "" \ - "barcode \"$labelfile_barcode\"" \ - "not found in mtx status output" + `_ ''` \ + `_ '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 "" "searchtape: should not get here" + Exit 2 `_ ''` `_ 'searchtape: should not get here'` return $? # in case we are internal } @@ -1349,7 +1321,7 @@ searchtape() { ### if [ $# -lt 1 ]; then - Exit 2 "" "Usage: $myname -command args" + Exit 2 `_ ''` `_ 'Usage: %s -command args' "$myname"` fi cmd=$1 shift @@ -1376,8 +1348,8 @@ case "$cmd" in loadslot clean ;; *) - Exit 2 "" "unknown option: $cmd" + Exit 2 `_ ''` `_ 'unknown option: %s' "$cmd"` ;; esac -Exit 2 "" "$myname: should not get here" +Exit 2 `_ ''` `_ '%s: should not get here' "$myname"` diff --git a/changer-src/scsi-changer-driver.c b/changer-src/scsi-changer-driver.c index 5ce1f1e..776e184 100644 --- a/changer-src/scsi-changer-driver.c +++ b/changer-src/scsi-changer-driver.c @@ -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 * diff --git a/changer-src/scsi-linux.c b/changer-src/scsi-linux.c index d8cf55d..d0dcaeb 100644 --- a/changer-src/scsi-linux.c +++ b/changer-src/scsi-linux.c @@ -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); diff --git a/changer-src/scsi-solaris.c b/changer-src/scsi-solaris.c index eb9bd77..891420a 100644 --- a/changer-src/scsi-solaris.c +++ b/changer-src/scsi-solaris.c @@ -57,7 +57,7 @@ #include #include -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 $"; diff --git a/client-src/Makefile.am b/client-src/Makefile.am index b479e12..2aa6d47 100644 --- a/client-src/Makefile.am +++ b/client-src/Makefile.am @@ -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)"; \ diff --git a/client-src/Makefile.in b/client-src/Makefile.in index 173d5c8..b797c1b 100644 --- a/client-src/Makefile.in +++ b/client-src/Makefile.in @@ -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@ diff --git a/client-src/amandates.h b/client-src/amandates.h index 51cd23e..6335a9b 100644 --- a/client-src/amandates.h +++ b/client-src/amandates.h @@ -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 */ diff --git a/client-src/calcsize.c b/client-src/calcsize.c index c6518b9..7d8ad04 100644 --- a/client-src/calcsize.c +++ b/client-src/calcsize.c @@ -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))); diff --git a/client-src/client_util.c b/client-src/client_util.c index 71ce4b4..bba8b18 100644 --- a/client-src/client_util.c +++ b/client-src/client_util.c @@ -29,9 +29,11 @@ */ #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; +} + diff --git a/client-src/client_util.h b/client-src/client_util.h index 0745a31..e3f4d7a 100644 --- a/client-src/client_util.h +++ b/client-src/client_util.h @@ -32,9 +32,11 @@ #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 index bdb63c4..0000000 --- a/client-src/clientconf.c +++ /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 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 index d9157ac..0000000 --- a/client-src/clientconf.h +++ /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 */ diff --git a/client-src/getfsent.c b/client-src/getfsent.c index d29953b..03e68d8 100644 --- a/client-src/getfsent.c +++ b/client-src/getfsent.c @@ -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; diff --git a/client-src/killpgrp.c b/client-src/killpgrp.c index 3777d7d..e2b983d 100644 --- a/client-src/killpgrp.c +++ b/client-src/killpgrp.c @@ -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); diff --git a/client-src/rundump.c b/client-src/rundump.c index f42ed27..5a9e50f 100644 --- a/client-src/rundump.c +++ b/client-src/rundump.c @@ -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 /* { */ diff --git a/client-src/runtar.c b/client-src/runtar.c index 5d46111..f088ea1 100644 --- a/client-src/runtar.c +++ b/client-src/runtar.c @@ -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*/ } diff --git a/client-src/selfcheck.c b/client-src/selfcheck.c index 2230bc5..fe6179c 100644 --- a/client-src/selfcheck.c +++ b/client-src/selfcheck.c @@ -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 */ @@ -40,13 +40,19 @@ #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 ) { diff --git a/client-src/sendbackup-dump.c b/client-src/sendbackup-dump.c index 0e10dc7..cb87624 100644 --- a/client-src/sendbackup-dump.c +++ b/client-src/sendbackup-dump.c @@ -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, diff --git a/client-src/sendbackup-gnutar.c b/client-src/sendbackup-gnutar.c index 0ef7937..0aef9c7 100644 --- a/client-src/sendbackup-gnutar.c +++ b/client-src/sendbackup-gnutar.c @@ -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*/ diff --git a/client-src/sendbackup.c b/client-src/sendbackup.c index 737d4f8..9cfa397 100644 --- a/client-src/sendbackup.c +++ b/client-src/sendbackup.c @@ -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. */ @@ -38,7 +38,13 @@ #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;jstart_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: diff --git a/client-src/sendbackup.h b/client-src/sendbackup.h index 2a4cdb8..134e6fb 100644 --- a/client-src/sendbackup.h +++ b/client-src/sendbackup.h @@ -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; diff --git a/client-src/sendsize.c b/client-src/sendsize.c index e99071c..aec977e 100644 --- a/client-src/sendsize.c +++ b/client-src/sendsize.c @@ -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 */ @@ -38,13 +38,19 @@ #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)); diff --git a/common-src/Makefile.am b/common-src/Makefile.am index 7f25d62..672eb19 100644 --- a/common-src/Makefile.am +++ b/common-src/Makefile.am @@ -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) \ diff --git a/common-src/Makefile.in b/common-src/Makefile.in index ac25aee..e22c64b 100644 --- a/common-src/Makefile.in +++ b/common-src/Makefile.in @@ -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) diff --git a/common-src/alloc.c b/common-src/alloc.c index 81670ea..50cfc08 100644 --- a/common-src/alloc.c +++ b/common-src/alloc.c @@ -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 index c6664b7..0000000 --- a/common-src/alloca.c +++ /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 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 -#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 */ diff --git a/common-src/amanda.h b/common-src/amanda.h index 62971d5..2858516 100644 --- a/common-src/amanda.h +++ b/common-src/amanda.h @@ -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 #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 */ diff --git a/common-src/amfeatures.c b/common-src/amfeatures.c index 89a1c38..8775912 100644 --- a/common-src/amfeatures.c +++ b/common-src/amfeatures.c @@ -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; } diff --git a/common-src/amfeatures.h b/common-src/amfeatures.h index 562ca21..1398c64 100644 --- a/common-src/amfeatures.h +++ b/common-src/amfeatures.h @@ -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. */ diff --git a/common-src/amflock.c b/common-src/amflock.c index 2a00b38..cc1cd4e 100644 --- a/common-src/amflock.c +++ b/common-src/amflock.c @@ -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 index dfbc3b4..0000000 --- a/common-src/amregex.h +++ /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 -#endif - -#ifdef HAVE_STRINGS_H -#include -#endif - -#include - -#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 */ diff --git a/common-src/bsd-security.c b/common-src/bsd-security.c index 303c4d0..18102ba 100644 --- a/common-src/bsd-security.c +++ b/common-src/bsd-security.c @@ -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 */ @@ -40,14 +40,6 @@ #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 @@ -60,12 +52,6 @@ */ #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 /* } */ diff --git a/common-src/bsdtcp-security.c b/common-src/bsdtcp-security.c index 78b8ae1..485186f 100644 --- a/common-src/bsdtcp-security.c +++ b/common-src/bsdtcp-security.c @@ -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. * @@ -45,15 +45,6 @@ #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; diff --git a/common-src/bsdudp-security.c b/common-src/bsdudp-security.c index ae2325f..9a3949d 100644 --- a/common-src/bsdudp-security.c +++ b/common-src/bsdudp-security.c @@ -42,14 +42,6 @@ #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 @@ -60,12 +52,6 @@ */ #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); diff --git a/common-src/clock.c b/common-src/clock.c index 8f6d669..ff41fa6 100644 --- a/common-src/clock.c +++ b/common-src/clock.c @@ -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 index 0000000..986d9b4 --- /dev/null +++ b/common-src/conffile.c @@ -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 +#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, ©_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, ©_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 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; ivalue[i]); + } + hpnext = hp->next; + amfree(hp); + } + + for(dp=dumplist; dp != NULL; dp = dpnext) { + amfree(dp->name); + for(i=0; ivalue[i]); + } + dpnext = dp->next; + amfree(dp); + } + + for(tp=tapelist; tp != NULL; tp = tpnext) { + amfree(tp->name); + for(i=0; ivalue[i]); + } + tpnext = tp->next; + amfree(tp); + } + + for(ip=interface_list; ip != NULL; ip = ipnext) { + amfree(ip->name); + for(i=0; ivalue[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; itoken != 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; ifield) +#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 */ diff --git a/common-src/debug.c b/common-src/debug.c index b958b63..86c3be1 100644 --- a/common-src/debug.c +++ b/common-src/debug.c @@ -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; } diff --git a/common-src/dgram.c b/common-src/dgram.c index a4c4ba3..e6d267b 100644 --- a/common-src/dgram.c +++ b/common-src/dgram.c @@ -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; diff --git a/common-src/dgram.h b/common-src/dgram.h index dbacc9f..eb5fbfd 100644 --- a/common-src/dgram.h +++ b/common-src/dgram.h @@ -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))); diff --git a/common-src/event.c b/common-src/event.c index 94ae1ac..0959c72 100644 --- a/common-src/event.c +++ b/common-src/event.c @@ -24,24 +24,23 @@ * 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 */ diff --git a/common-src/file.c b/common-src/file.c index 62cf171..cadcf0a 100644 --- a/common-src/file.c +++ b/common-src/file.c @@ -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. diff --git a/common-src/fileheader.c b/common-src/fileheader.c index f6786a8..9d18d8c 100644 --- a/common-src/fileheader.c +++ b/common-src/fileheader.c @@ -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; diff --git a/common-src/fileheader.h b/common-src/fileheader.h index c6213fe..ea7bda5 100644 --- a/common-src/fileheader.h +++ b/common-src/fileheader.h @@ -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 index 74baeb9..0000000 --- a/common-src/getcwd.c +++ /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; -} diff --git a/common-src/krb4-security.c b/common-src/krb4-security.c index 6a3dad3..b4ca980 100644 --- a/common-src/krb4-security.c +++ b/common-src/krb4-security.c @@ -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) { diff --git a/common-src/krb5-security.c b/common-src/krb5-security.c index b7e6e71..5b3d76a 100644 --- a/common-src/krb5-security.c +++ b/common-src/krb5-security.c @@ -28,13 +28,13 @@ * $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" @@ -43,7 +43,13 @@ #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 #else @@ -68,22 +73,17 @@ #include #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 @@ -91,56 +91,52 @@ * * 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. @@ -148,194 +144,86 @@ * 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 diff --git a/common-src/match.c b/common-src/match.c index 5ddc1da..dba15c8 100644 --- a/common-src/match.c +++ b/common-src/match.c @@ -30,7 +30,7 @@ */ #include "amanda.h" -#include "regex.h" +#include 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 index 6cbd9dd..0000000 --- a/common-src/memmove.c +++ /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 -#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 index 5d4373d..0000000 --- a/common-src/mktime.c +++ /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); -} diff --git a/common-src/packet.c b/common-src/packet.c index 2b2fdf9..87b5f50 100644 --- a/common-src/packet.c +++ b/common-src/packet.c @@ -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 */ diff --git a/common-src/packet.h b/common-src/packet.h index 9983a49..cd40615 100644 --- a/common-src/packet.h +++ b/common-src/packet.h @@ -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 */ diff --git a/common-src/pipespawn.c b/common-src/pipespawn.c index a56a1d4..09553b6 100644 --- a/common-src/pipespawn.c +++ b/common-src/pipespawn.c @@ -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++; diff --git a/common-src/protocol.c b/common-src/protocol.c index 077e34e..4b3f54f 100644 --- a/common-src/protocol.c +++ b/common-src/protocol.c @@ -24,17 +24,22 @@ * 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 index 01a86da..0000000 --- a/common-src/regcomp.c +++ /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 index 04cd760..0000000 --- a/common-src/regerror.c +++ /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 index 27f0dd5..0000000 --- a/common-src/regexec.c +++ /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 index 06ace3b..0000000 --- a/common-src/regfree.c +++ /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" diff --git a/common-src/rsh-security.c b/common-src/rsh-security.c index 4c626ac..c98aed7 100644 --- a/common-src/rsh-security.c +++ b/common-src/rsh-security.c @@ -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. * @@ -45,14 +45,6 @@ #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) diff --git a/common-src/security-util.c b/common-src/security-util.c index a55bafb..4035cba 100644 --- a/common-src/security-util.c +++ b/common-src/security-util.c @@ -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. * @@ -43,19 +43,6 @@ #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; +} diff --git a/common-src/security-util.h b/common-src/security-util.h index b1d8faa..9b2dcc4 100644 --- a/common-src/security-util.h +++ b/common-src/security-util.h @@ -35,6 +35,26 @@ #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 +# else +# include +# endif +# include +#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 */ diff --git a/common-src/security.c b/common-src/security.c index 76cf78d..4ee8eb7 100644 --- a/common-src/security.c +++ b/common-src/security.c @@ -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); } diff --git a/common-src/security.h b/common-src/security.h index d0971b4..59b2bbf 100644 --- a/common-src/security.h +++ b/common-src/security.h @@ -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 index fa060c9..0000000 --- a/common-src/snprintf.c +++ /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 . - * - * This code is based on, and used with the permission of, the - * SIO stdio-replacement strx_* functions by Panos Tsirigotis - * 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 - -#if !(defined(HAVE_SNPRINTF) && defined(HAVE_VSNPRINTF)) - -/* -#include -#include -#include -#include -#include -#include -#include -*/ - -#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 % */ - - /* - * 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 % 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 % (like syslog). - * Note that we can't point s inside fmt because the - * unknown 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 */ diff --git a/common-src/ssh-security.c b/common-src/ssh-security.c index c0b023c..3736927 100644 --- a/common-src/ssh-security.c +++ b/common-src/ssh-security.c @@ -45,31 +45,6 @@ #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); diff --git a/common-src/statfs.c b/common-src/statfs.c index 9e1d3cd..6f3e26a 100644 --- a/common-src/statfs.c +++ b/common-src/statfs.c @@ -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 index ac5f79f..0000000 --- a/common-src/strcasecmp.c +++ /dev/null @@ -1,25 +0,0 @@ -/* Provided by Michael Schmitz ; 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 ); -} diff --git a/common-src/stream.c b/common-src/stream.c index 8ec116f..b7925e9 100644 --- a/common-src/stream.c +++ b/common-src/stream.c @@ -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 index 2ec138c..0000000 --- a/common-src/strerror.c +++ /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 index c180985..0000000 --- a/common-src/strftime.c +++ /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 - -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 index 655746b..0000000 --- a/common-src/strncasecmp.c +++ /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 index b3de11d..0000000 --- a/common-src/strstr.c +++ /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; -} diff --git a/common-src/tapelist.c b/common-src/tapelist.c index 194db84..8a47596 100644 --- a/common-src/tapelist.c +++ b/common-src/tapelist.c @@ -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); } diff --git a/common-src/util.c b/common-src/util.c index d168b6f..bb27cfa 100644 --- a/common-src/util.c +++ b/common-src/util.c @@ -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" @@ -32,19 +32,6 @@ #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, 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 */ diff --git a/common-src/version.c b/common-src/version.c index b86565a..4d6b862 100644 --- a/common-src/version.c +++ b/common-src/version.c @@ -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", diff --git a/common-src/versuff.c b/common-src/versuff.c index c120d2e..0e51292 100644 --- a/common-src/versuff.c +++ b/common-src/versuff.c @@ -33,14 +33,14 @@ 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 index ee694d4..0000000 --- a/common-src/waitpid.c +++ /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 -#include -#include -#endif - -#ifdef DEBUG -# include -# 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 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 <conftest.xml + + + + +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 +# include ], + [u_int i = sizeof (struct sockaddr_storage)], + ac_cv_has_sockaddr_storage=yes, + ac_cv_has_sockaddr_storage=no)) + AC_MSG_RESULT($ac_cv_has_sockaddr_storage) + if test $ac_cv_has_sockaddr_storage = yes ; then + AC_DEFINE(HAVE_SOCKADDR_STORAGE,1,[if struct sockaddr_storage exists]) + fi]) + + diff --git a/config/config.h.in b/config/config.h.in index 04a7ba9..0f02920 100644 --- a/config/config.h.in +++ b/config/config.h.in @@ -1,5 +1,8 @@ /* config/config.h.in. Generated from configure.in by autoheader. */ +/* Define this to an absolute name of . */ +#undef ABSOLUTE_STRING_H + /* Define on AIX. */ #undef AIX_BACKUP @@ -114,6 +117,9 @@ /* 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 @@ -252,6 +258,34 @@ /* Define to 1 if you have the 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 header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H @@ -334,12 +368,18 @@ /* 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 @@ -406,21 +446,37 @@ /* 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 or . */ +#undef HAVE_INTMAX_T + /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H +/* Define if exists, doesn't clash with , 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 defines AF_INET. */ +#undef HAVE_IPV4 + +/* Define to 1 if defines AF_INET6. */ +#undef HAVE_IPV6 + /* Define to enable IRIX tape-changer support */ #undef HAVE_IRIX_LIKE_SCSI @@ -514,6 +570,15 @@ /* 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 @@ -598,6 +663,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_NETDB_H +/* Define to 1 if you have the header file. */ +#undef HAVE_NETINET_IN_H + /* Define to 1 if you have the header file. */ #undef HAVE_NETINET_IN_SYSTM_H @@ -631,6 +699,15 @@ /* Define if printf is declared. */ #undef HAVE_PRINTF_DECL +/* Define if the 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 @@ -793,6 +870,9 @@ /* 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 @@ -823,9 +903,16 @@ /* Define to 1 if you have the 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 header file. */ #undef HAVE_STDINT_H +/* Define if exists, doesn't clash with , and declares + uintmax_t. */ +#undef HAVE_STDINT_H_WITH_UINTMAX + /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H @@ -835,6 +922,9 @@ /* 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 @@ -859,9 +949,6 @@ /* 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 @@ -874,6 +961,9 @@ /* 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 @@ -960,6 +1050,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SHM_H +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SOCKET_H + /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STATFS_H @@ -1023,12 +1116,19 @@ /* 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 @@ -1050,20 +1150,32 @@ /* Define to 1 if you have the 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 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 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 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 @@ -1137,6 +1249,9 @@ /* 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 @@ -1211,9 +1326,19 @@ /* 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 @@ -1293,16 +1418,40 @@ /* 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 @@ -1333,6 +1482,9 @@ 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 @@ -1346,12 +1498,45 @@ `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 @@ -1361,6 +1546,15 @@ /* Define to `int' if 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 and don't define. */ +#undef intmax_t + /* Directory in which internal binaries should be installed. */ #undef libexecdir @@ -1373,6 +1567,10 @@ /* Define to `int' if 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 @@ -1387,6 +1585,3 @@ /* Define to `int' if 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 index 0000000..e082db6 --- /dev/null +++ b/config/config.rpath @@ -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 , 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 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=/' <', 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 index 0000000..eb62e0e --- /dev/null +++ b/config/gnulib/alloca.m4 @@ -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 , + 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 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 index 0000000..d01d098 --- /dev/null +++ b/config/gnulib/arpa_inet_h.m4 @@ -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 index 0000000..3bffd10 --- /dev/null +++ b/config/gnulib/eoverflow.m4 @@ -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 , 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 , 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 +#ifdef EOVERFLOW +yes +#endif + ], have_eoverflow=1) + if test -n "$have_eoverflow"; then + dnl EOVERFLOW exists in . Don't need to define EOVERFLOW ourselves. + ac_cv_decl_EOVERFLOW=yes + else + AC_EGREP_CPP(yes,[ +#define _XOPEN_SOURCE_EXTENDED 1 +#include +#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 +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include +#include +]) + 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 index 0000000..143a9e5 --- /dev/null +++ b/config/gnulib/extensions.m4 @@ -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 index 0000000..db285d9 --- /dev/null +++ b/config/gnulib/getaddrinfo.m4 @@ -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 +#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 +#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 +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETDB_H +#include +#endif +#ifdef HAVE_WS2TCPIP_H +#include +#endif +]) + AC_CHECK_TYPES([struct addrinfo],,,[ +#include +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETDB_H +#include +#endif +#ifdef HAVE_WS2TCPIP_H +#include +#endif +]) +]) diff --git a/config/gnulib/gnulib-cache.m4 b/config/gnulib/gnulib-cache.m4 new file mode 100644 index 0000000..717621b --- /dev/null +++ b/config/gnulib/gnulib-cache.m4 @@ -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 index 0000000..5398010 --- /dev/null +++ b/config/gnulib/gnulib-common.m4 @@ -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 index 0000000..f26cf17 --- /dev/null +++ b/config/gnulib/gnulib-comp.m4 @@ -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 index 0000000..ef59320 --- /dev/null +++ b/config/gnulib/gnulib-tool.m4 @@ -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 index 0000000..bb02d22 --- /dev/null +++ b/config/gnulib/inet_ntop.m4 @@ -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 ]) + 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 index 0000000..17c7b0a --- /dev/null +++ b/config/gnulib/intmax_t.m4 @@ -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 or . + +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 and don't define.]) + else + AC_DEFINE(HAVE_INTMAX_T, 1, + [Define if you have the 'intmax_t' type in or .]) + 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 +#include +#if HAVE_STDINT_H_WITH_UINTMAX +#include +#endif +#if HAVE_INTTYPES_H_WITH_UINTMAX +#include +#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 or .]) + 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 and don't define.]) + fi +]) diff --git a/config/gnulib/inttypes_h.m4 b/config/gnulib/inttypes_h.m4 new file mode 100644 index 0000000..edc8ecb --- /dev/null +++ b/config/gnulib/inttypes_h.m4 @@ -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 exists, +# doesn't clash with , 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 +#include ], + [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 exists, doesn't clash with , + and declares uintmax_t. ]) + fi +]) diff --git a/config/gnulib/lib-ld.m4 b/config/gnulib/lib-ld.m4 new file mode 100644 index 0000000..96c4e2c --- /dev/null +++ b/config/gnulib/lib-ld.m4 @@ -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 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 index 0000000..f157d98 --- /dev/null +++ b/config/gnulib/lib-link.m4 @@ -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 index 0000000..a8684e1 --- /dev/null +++ b/config/gnulib/lib-prefix.m4 @@ -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 index 0000000..0224f2f --- /dev/null +++ b/config/gnulib/lock.m4 @@ -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 : + case "$host_os" in + osf*) + # On OSF/1, the compiler needs the flag -D_REENTRANT so that it + # groks . 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 . + 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 . 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_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 ]) + # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro. + AC_TRY_COMPILE([#include ], + [#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 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 +#include ], + [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_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 index 0000000..25590f4 --- /dev/null +++ b/config/gnulib/longdouble.m4 @@ -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 index 0000000..1f9e862 --- /dev/null +++ b/config/gnulib/longlong.m4 @@ -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 + @%:@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 index 0000000..d73531a --- /dev/null +++ b/config/gnulib/netinet_in_h.m4 @@ -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 index 0000000..15884b3 --- /dev/null +++ b/config/gnulib/onceonly_2_57.m4 @@ -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 index 0000000..6cb4868 --- /dev/null +++ b/config/gnulib/size_max.m4 @@ -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 +#if HAVE_STDINT_H +#include +#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 +#include ], size_t_bits_minus_1=) + AC_COMPUTE_INT([fits_in_uint], [sizeof (size_t) <= sizeof (unsigned int)], + [#include ], 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 + 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 index 0000000..432e037 --- /dev/null +++ b/config/gnulib/snprintf.m4 @@ -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 index 0000000..5e3765a --- /dev/null +++ b/config/gnulib/socklen.m4 @@ -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 + #include + + 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 + #if HAVE_SYS_SOCKET_H + # include + #elif HAVE_WS2TCPIP_H + # include + #endif])]) diff --git a/config/gnulib/sockpfaf.m4 b/config/gnulib/sockpfaf.m4 new file mode 100644 index 0000000..25d9755 --- /dev/null +++ b/config/gnulib/sockpfaf.m4 @@ -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 +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_WINSOCK2_H +#include +#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 defines AF_INET.]) + fi + + AC_MSG_CHECKING(for IPv6 sockets) + AC_CACHE_VAL(gl_cv_socket_ipv6, + [AC_TRY_COMPILE([#include +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_WINSOCK2_H +#include +#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 defines AF_INET6.]) + fi +]) diff --git a/config/gnulib/stdbool.m4 b/config/gnulib/stdbool.m4 new file mode 100644 index 0000000..2204ecd --- /dev/null +++ b/config/gnulib/stdbool.m4 @@ -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 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 + #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 index 0000000..db9a8ac --- /dev/null +++ b/config/gnulib/stdint_h.m4 @@ -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 exists, +# doesn't clash with , 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 +#include ], + [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 exists, doesn't clash with , + and declares uintmax_t. ]) + fi +]) diff --git a/config/gnulib/strdup.m4 b/config/gnulib/strdup.m4 new file mode 100644 index 0000000..8796e9e --- /dev/null +++ b/config/gnulib/strdup.m4 @@ -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 index 0000000..84db7a5 --- /dev/null +++ b/config/gnulib/string_h.m4 @@ -0,0 +1,46 @@ +# Configure a GNU-like replacement for . + +# 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 index 0000000..d3e45b4 --- /dev/null +++ b/config/gnulib/sys_socket_h.m4 @@ -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 index 0000000..72c9a13 --- /dev/null +++ b/config/gnulib/vasnprintf.m4 @@ -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 index 0000000..2ff6330 --- /dev/null +++ b/config/gnulib/visibility.m4 @@ -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 index 0000000..cde2129 --- /dev/null +++ b/config/gnulib/wchar_t.m4 @@ -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 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 + 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 index 0000000..3706c04 --- /dev/null +++ b/config/gnulib/wint_t.m4 @@ -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 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: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be included + before . */ +#include +#include +#include +#include + 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 index 0000000..85bb721 --- /dev/null +++ b/config/gnulib/xsize.m4 @@ -0,0 +1,13 @@ +# xsize.m4 serial 3 +dnl Copyright (C) 2003-2004 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +AC_DEFUN([gl_XSIZE], +[ + dnl Prerequisites of lib/xsize.h. + AC_REQUIRE([gl_SIZE_MAX]) + AC_REQUIRE([AC_C_INLINE]) + AC_CHECK_HEADERS(stdint.h) +]) diff --git a/configure b/configure index 323dcaa..08704fb 100755 --- a/configure +++ b/configure @@ -463,7 +463,8 @@ ac_includes_default="\ # include #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 to if __STDC__ is defined, since + # 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 - /* 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 +#else +# include +#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 +_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 to if __STDC__ is defined, since + # 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 - /* 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 +#else +# include +#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 - /* 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 _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 - /* 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 +#include +#include +#include + 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 - /* 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 - ; - 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 +_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 +#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 +_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 +_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 : + case "$host_os" in + osf*) + # On OSF/1, the compiler needs the flag -D_REENTRANT so that it + # groks . 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 . + 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 +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 +# define alloca _alloca +# else +# if HAVE_ALLOCA_H +# include +# 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 declares $ac_func. + For example, HP-UX 11i 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 to if __STDC__ is defined, since + exists even on freestanding compilers. */ +#ifdef __STDC__ +# include +#else +# include +#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 +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_WINSOCK2_H +#include +#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 +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_WINSOCK2_H +#include #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 &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 . 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 +_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 +_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 +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 + +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 +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 +#include +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 +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 + #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 " >&5 +echo $ECHO_N "checking absolute name of ... $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 +_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 +#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 +#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 +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include +#include + +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 +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include +#include + +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 +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include +#include + +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 +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include +#include + +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 +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include +#include + +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 +/* The following two lines are a workaround against an autoconf-2.52 bug. */ +#include +#include + +long longval () { return EOVERFLOW; } +unsigned long ulongval () { return EOVERFLOW; } +#include +#include +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 + #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 + 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: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be included + before . */ +#include +#include +#include +#include + 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 +#include +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 +#include +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 +#include +#if HAVE_STDINT_H_WITH_UINTMAX +#include +#endif +#if HAVE_INTTYPES_H_WITH_UINTMAX +#include +#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 declares $ac_func. + For example, HP-UX 11i 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 to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#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 +#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 declares $ac_func. + For example, HP-UX 11i 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 to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#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 declares $ac_func. + For example, HP-UX 11i 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 to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#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 +#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 +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETDB_H +#include +#endif +#ifdef HAVE_WS2TCPIP_H +#include +#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 +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETDB_H +#include +#endif +#ifdef HAVE_WS2TCPIP_H +#include +#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 +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETDB_H +#include +#endif +#ifdef HAVE_WS2TCPIP_H +#include +#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 +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETDB_H +#include +#endif +#ifdef HAVE_WS2TCPIP_H +#include +#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 +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETDB_H +#include +#endif +#ifdef HAVE_WS2TCPIP_H +#include +#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 declares $ac_func. + For example, HP-UX 11i 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 to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#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 + +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 +#if HAVE_STDINT_H +#include +#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 +#include +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 +#include +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 +#include +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 +#include +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 +#include +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 +#include +long longval () { return sizeof (size_t) * CHAR_BIT - 1; } +unsigned long ulongval () { return sizeof (size_t) * CHAR_BIT - 1; } +#include +#include +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 +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 +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 +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 +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 +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 +long longval () { return sizeof (size_t) <= sizeof (unsigned int); } +unsigned long ulongval () { return sizeof (size_t) <= sizeof (unsigned int); } +#include +#include +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 + 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 declares $ac_func. + For example, HP-UX 11i 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 to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#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 + #if HAVE_SYS_SOCKET_H + # include + #elif HAVE_WS2TCPIP_H + # include + #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 + #include + + 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 declares $ac_func. + For example, HP-UX 11i 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 to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#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 declares $ac_func. + For example, HP-UX 11i 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 to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#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 declares $ac_func. + For example, HP-UX 11i 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 to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#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 + /* 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 + /* 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 + /* 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 + /* 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 + /* 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 <&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 to if __STDC__ is defined, since - # 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 -#else -# include -#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 +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 to if __STDC__ is defined, since - # 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 -#else -# include -#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 + +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 -#include -#include -#include -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 + + 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 + ;; + *-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 -#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 <>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 @@ -9736,12 +17796,11 @@ fi 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. @@ -10542,6 +18601,14 @@ fi test -n "$DUMP" && break done +if test -n "$DUMP"; then + if test "`basename $DUMP`" = "backup"; then + backup_gnutar=`$DUMP --version | $GREP "GNU tar"` + if test $? -eq 0; then + DUMP= + fi + fi +fi for ac_prog in ufsrestore restore do # Extract the first word of "$ac_prog", so it can be a program name with args. @@ -11073,6 +19140,70 @@ fi +echo "$as_me:$LINENO: checking if sockaddr_storage struct exists" >&5 +echo $ECHO_N "checking if sockaddr_storage struct exists... $ECHO_C" >&6 + if test "${ac_cv_has_sockaddr_storage+set}" = set; then + 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 +# include +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 &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 < conftest.$ac_ext <&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 < conftest.$ac_ext <&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 < conftest.$ac_ext <&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 @@ -38022,345 +46084,9 @@ fi 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 declares $ac_func. - For example, HP-UX 11i 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 to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#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 declares $ac_func. - For example, HP-UX 11i 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 to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#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 declares $ac_func. - For example, HP-UX 11i 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 to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#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 declares $ac_func. - For example, HP-UX 11i 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 to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#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 declares $ac_func. + For example, HP-UX 11i 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 to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#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 @@ -41396,10 +48869,9 @@ fi 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 declares $ac_func. - For example, HP-UX 11i 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 to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#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 declares $ac_func. - For example, HP-UX 11i 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 to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#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 -# include -#else -# ifdef HAVE_SYS_TIME_H -# include -# else -# include -# 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 declares $ac_func. - For example, HP-UX 11i 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 to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#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 declares $ac_func. - For example, HP-UX 11i 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 to if __STDC__ is defined, since - exists even on freestanding compilers. */ -#ifdef __STDC__ -# include -#else -# include -#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 +# include #else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} +# ifdef HAVE_SYS_TIME_H +# include +# else +# include +# 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 -#include - -#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 -# 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 +#include -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 +# 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 <conftest.$ac_ext -#include "confdefs.h" -#ifdef HAVE_SYS_TIME_H -# include -#endif -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_SELECT_H -# include -#endif -#ifdef HAVE_SYS_SOCKET_H -# include -#endif -#ifdef HAVE_UNISTD_H -# include -#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 &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 <conftest.$ac_ext +#include "confdefs.h" +#ifdef HAVE_SYS_TIME_H +# include +#endif +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_SELECT_H +# include +#endif +#ifdef HAVE_SYS_SOCKET_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#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 &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 declares setpgid. +/* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i 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 to if __STDC__ is defined, since exists even on freestanding compilers. */ @@ -48655,7 +55843,7 @@ cat >>conftest.$ac_ext <<_ACEOF # include #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 declares setpgrp. +/* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i 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 to if __STDC__ is defined, since exists even on freestanding compilers. */ @@ -48923,7 +56050,7 @@ cat >>conftest.$ac_ext <<_ACEOF # include #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 -#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 <conftest.$ac_ext -#include "confdefs.h" -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_IPC_H -# include -#endif -#ifdef HAVE_SYS_SHM_H -# include -#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 declares setpgid. + For example, HP-UX 11i 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 to if __STDC__ is defined, since + exists even on freestanding compilers. */ +#ifdef __STDC__ +# include +#else +# include +#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 declares $ac_func. +/* Define setpgrp to an innocuous variant, in case declares setpgrp. For example, HP-UX 11i 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 to if __STDC__ is defined, since exists even on freestanding compilers. */ @@ -49759,7 +56985,7 @@ cat >>conftest.$ac_ext <<_ACEOF # include #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 +#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 <conftest.$ac_ext +#include "confdefs.h" +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_IPC_H +# include +#endif +#ifdef HAVE_SYS_SHM_H +# include +#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 declares $ac_func. - For example, HP-UX 11i 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 to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#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 declares $ac_func. - For example, HP-UX 11i 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 to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#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 @@ -54358,230 +61510,7 @@ fi 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 declares $ac_func. - For example, HP-UX 11i 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 to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#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 declares $ac_func. - For example, HP-UX 11i 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 to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#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 declares $ac_func. - For example, HP-UX 11i 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 to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#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 @@ -55710,26 +62600,259 @@ fi 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 <conftest.xml + + + + +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 <conftest.xml + + + + +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 +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_WINSOCK2_H +#include +#endif +#include +#include +#include + +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" ;; @@ -56489,9 +63636,10 @@ do "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 diff --git a/configure.in b/configure.in index 778ad2a..a15742a 100644 --- a/configure.in +++ b/configure.in @@ -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 +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_WINSOCK2_H +#include +#endif +#include +#include +#include + +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 \ diff --git a/docs/Makefile.am b/docs/Makefile.am index ac505ff..d4bbf41 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -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 \ diff --git a/docs/Makefile.in b/docs/Makefile.in index cd6e41e..a7846b1 100644 --- a/docs/Makefile.in +++ b/docs/Makefile.in @@ -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 \ diff --git a/docs/amadmin.8.txt b/docs/amadmin.8.txt index 00a9b62..5fea43a 100644 --- a/docs/amadmin.8.txt +++ b/docs/amadmin.8.txt @@ -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 diff --git a/docs/amanda-client.conf.5.txt b/docs/amanda-client.conf.5.txt index 49dcc76..50bdd40 100644 --- a/docs/amanda-client.conf.5.txt +++ b/docs/amanda-client.conf.5.txt @@ -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 diff --git a/docs/amanda.8.txt b/docs/amanda.8.txt index 8117a38..845dfee 100644 --- a/docs/amanda.8.txt +++ b/docs/amanda.8.txt @@ -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. diff --git a/docs/amanda.conf.5.txt b/docs/amanda.conf.5.txt index 7ddef20..c1ddfdd 100644 --- a/docs/amanda.conf.5.txt +++ b/docs/amanda.conf.5.txt @@ -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 diff --git a/docs/amcheck.8.txt b/docs/amcheck.8.txt index 64fb2fb..f043cf9 100644 --- a/docs/amcheck.8.txt +++ b/docs/amcheck.8.txt @@ -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. diff --git a/docs/amdump.8.txt b/docs/amdump.8.txt index 36c8636..bcfbf6e 100644 --- a/docs/amdump.8.txt +++ b/docs/amdump.8.txt @@ -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 diff --git a/docs/amfetchdump.8.txt b/docs/amfetchdump.8.txt index 34c15f5..7015e6c 100644 --- a/docs/amfetchdump.8.txt +++ b/docs/amfetchdump.8.txt @@ -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 diff --git a/docs/amflush.8.txt b/docs/amflush.8.txt index 556a4e9..df6d970 100644 --- a/docs/amflush.8.txt +++ b/docs/amflush.8.txt @@ -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 diff --git a/docs/amgetconf.8.txt b/docs/amgetconf.8.txt index a38cbc0..af20932 100644 --- a/docs/amgetconf.8.txt +++ b/docs/amgetconf.8.txt @@ -71,7 +71,7 @@ OPTIONS -o configoption - See the "CONFIGURATION OVERWRITE" section in amanda(8). + See the "CONFIGURATION OVERRIDE" section in amanda(8). EXAMPLE diff --git a/docs/amlabel.8.txt b/docs/amlabel.8.txt index 1600f29..89a0985 100644 --- a/docs/amlabel.8.txt +++ b/docs/amlabel.8.txt @@ -38,7 +38,7 @@ OPTIONS -o configoption - See the "CONFIGURATION OVERWRITE" section in amanda(8). + See the "CONFIGURATION OVERRIDE" section in amanda(8). EXAMPLE diff --git a/docs/amrecover.8.txt b/docs/amrecover.8.txt index a32faf7..b0f5373 100644 --- a/docs/amrecover.8.txt +++ b/docs/amrecover.8.txt @@ -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. diff --git a/docs/amreport.8.txt b/docs/amreport.8.txt index d7bd98e..21c0b0c 100644 --- a/docs/amreport.8.txt +++ b/docs/amreport.8.txt @@ -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 diff --git a/docs/amrestore.8.txt b/docs/amrestore.8.txt index 2b5f66d..2d8add1 100644 --- a/docs/amrestore.8.txt +++ b/docs/amrestore.8.txt @@ -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 diff --git a/docs/amtape.8.txt b/docs/amtape.8.txt index 3405b7b..fe67380 100644 --- a/docs/amtape.8.txt +++ b/docs/amtape.8.txt @@ -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 diff --git a/docs/chgscsi.txt b/docs/chgscsi.txt index f0d523b..2ce8b22 100644 --- a/docs/chgscsi.txt +++ b/docs/chgscsi.txt @@ -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 diff --git a/docs/dumperapi.txt b/docs/dumperapi.txt index 770e1d5..661fa51 100644 --- a/docs/dumperapi.txt +++ b/docs/dumperapi.txt @@ -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 diff --git a/docs/eventapi.txt b/docs/eventapi.txt index dd8e282..51c8992 100644 --- a/docs/eventapi.txt +++ b/docs/eventapi.txt @@ -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 diff --git a/docs/exclude.txt b/docs/exclude.txt index 16a9530..030c06b 100644 --- a/docs/exclude.txt +++ b/docs/exclude.txt @@ -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 diff --git a/docs/faq.txt b/docs/faq.txt index 82fb691..9e4da7b 100644 --- a/docs/faq.txt +++ b/docs/faq.txt @@ -16,11 +16,6 @@ Stefan G. Weichinger XML-conversion;Updates AMANDA Core Team - -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 diff --git a/docs/howto-afs.txt b/docs/howto-afs.txt index 4554e4f..481ac54 100644 --- a/docs/howto-afs.txt +++ b/docs/howto-afs.txt @@ -16,17 +16,17 @@ Stefan G. Weichinger XML-conversion;Updates AMANDA Core Team - -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 diff --git a/docs/howto-auth.txt b/docs/howto-auth.txt index 6e3ffc5..6098b4a 100644 --- a/docs/howto-auth.txt +++ b/docs/howto-auth.txt @@ -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 diff --git a/docs/howto-cygwin.txt b/docs/howto-cygwin.txt index 5daa0d1..6f2e403 100644 --- a/docs/howto-cygwin.txt +++ b/docs/howto-cygwin.txt @@ -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 diff --git a/docs/howto-filedriver.txt b/docs/howto-filedriver.txt index b6ba1df..0d31047 100644 --- a/docs/howto-filedriver.txt +++ b/docs/howto-filedriver.txt @@ -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 index 1c8163c..0000000 --- a/docs/howto-gpg.txt +++ /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 - -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 - diff --git a/docs/howto-wrapper.txt b/docs/howto-wrapper.txt index 15ecd96..ca8b8c8 100644 --- a/docs/howto-wrapper.txt +++ b/docs/howto-wrapper.txt @@ -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 – 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 diff --git a/docs/indexing.txt b/docs/indexing.txt index 5239e90..561abc3 100644 --- a/docs/indexing.txt +++ b/docs/indexing.txt @@ -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 diff --git a/docs/install.txt b/docs/install.txt index 5b9e2af..3bb1641 100644 --- a/docs/install.txt +++ b/docs/install.txt @@ -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 diff --git a/docs/internals.txt b/docs/internals.txt index a95442a..5516728 100644 --- a/docs/internals.txt +++ b/docs/internals.txt @@ -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 ---> <--- R Buffer empty <--- E Error ack Close tape C ---> <--- C