File-RsyncP-0.74/0000775000076500000240000000000012456605537012526 5ustar craigstaffFile-RsyncP-0.74/Changes0000444000076500000240000001247312456605534014021 0ustar craigstaffRevision history for Perl module File::RsyncP. 0.74 Sat Jan 17 16:50:43 PST 2015 - updated FileList/config.guess FileList/config.sub with more recent versions from rsync. - slight tweaks to FileList/t/exclude.t FileList/t/fileList.t. - updated LICENSE to GPL v3 and updated headers. 0.72 Sun Jan 11 13:52:23 PST 2015 - in lib/File/RsyncP.pm, added getcheck(4) to read io_error flag; fixes potential hang. Report and patch from Martin Wilck. - in FileList/flist.c, wrapped strlcpy() definition with #ifndef HAVE_STRLCPY / #endif. Report and patch by Ryan Schmidt. - Changed reset(), protocol() and add() in Digest/Digest.xs to be void. 0.70 Sun Sat Jul 10 09:54:12 PDT 2010 - Fixed adler32_checksum() in Digest/rsync_lib.c for case where native char is unsigned (eg: arm architecture). - in lib/File/RsyncP.pm, --cvs-exclude incorrectly required an argument, reported by Cameron Dale. 0.68 Sat Nov 18 18:29:31 PST 2006 - Convert exclude/include log messages to utf8. - Fixed 2nd digest returned by File::RsyncP::Digest->digest2() when protocol_version <= 26. 0.66 Sun Oct 29 10:15:15 PST 2006 - Support turning off --perms option, reported by Cameron Dale. - Applied patches from Mark Weaver to handle skipping duplicate file names. - Added FileList/snprintf.c to handle solaris configure failures. 0.64 Sun Jul 30 19:31:45 PDT 2006 - Fixed some compiler warnings and verbose declaration reported by Guillaume Filion and Rodrigo Real. - Added a couple of tweaks for file names that contain newlines, reported by Robert Waldner. 0.62 Sun Jul 9 11:18:32 PDT 2006 - Added hardlink support. - Added support for protocol version 28. - Moved daemon @RSYNCD: protocolVersion send before the getLine to work correctly with rsync on novell (suggested by Jacob Lundqvist). 0.52 Sat May 29 19:16:22 PDT 2004 - Changed the parent write file handle to be non-blocking. This should avoid a deadlock reported by several users. 0.51 Sun May 9 23:42:56 PDT 2004 - Changed newSVpv() to newSVpvn() in Digest/Digest.xs to allow empty argument to blockDigestExtract(). - csumStart() in File::RsyncP.pm now includes the $phase argument. 0.50 Sat Mar 20 18:19:50 PST 2004 - Added doPartial option to support BackupPC 2.1.0. - Added File::RsyncP::abort() for graceful cleanup mid-transfer. 0.47 Sun Mar 14 21:37:22 PST 2004 - Changed FileList/FileList.xs so that uid, gid, mode and mtime are forced to be unsigned. This fixes a problem new to 0.46 that was introduced when newSVuv was replaced with newSVnv to back port to 5.005_03. 0.46 Sun Feb 8 18:11:30 PST 2004 - Put $VERSION on a new line in lib/File/Rsync.pm and lib/File/RsyncP/FileIO.pm so CPAN can correctly extract the version. No functional change from 0.45. 0.45 Sat Feb 7 15:37:51 PST 2004 - Patch from Marlin Prowell for FileList/flist.c that solves a subtle file list corruption problem. In particular, f->lastdir was being set too early in receive_file_entry(), potentially before it returned to fetch more data and restart. - Patches from Lars Thegler to back port to perl 5.005_03. - Added Getopt::Long => 2.24 to PREREQ_PM in Makefile.PL, since the OO interface to Getopt::Long that we use was added in this version. 0.44 Wed Jul 23 21:31:18 PDT 2003 - Fixes to FileList for large file support. 0.43 Sun Jul 20 00:03:40 PDT 2003 - Changed file length, dev and inode to double. - Added File::RsyncP::Digest->protocol, including support for protocol version >= 27 (after MD4 fixes). - Added File::RsyncP::Digest->digest2 that returns the old (buggy) and new styles of the MD4 digest. 0.42 Sat Jul 12 09:53:40 PDT 2003 - Replaced regexp with split() due to 5.8.0 regexp performance problem. - Replace $rs->getChunk with rs->getData in final handshake. 0.41 Sat May 10 20:39:33 PDT 2003 - Fixed VERSION settings - Removed inline function in flist.h 0.40 Sat May 10 11:51:58 PDT 2003 - add pidHandler() callback to caller knows the children's pids. - replaced seek() with sysseek() in File::RsyncP::FileIO. 0.31 Sun Feb 23 15:17:05 PST 2003 - Added new stat remoteErrCnt, which counts the number of error messages returned by the remote side. - Couple of minor documentation changes. 0.30 Sun Feb 9 23:06:42 PST 2003 - Added timeout parameter to File::RsyncP->new. - Fixed File::RsyncP::FileIO to handle a received file whose size changed from the file list. 0.20 Fri Jan 17 22:24:11 PST 2003 - Added rsyncCmdType argument to File::RsyncP->new. - Allowed rsyncCmd to be a code reference. - Added logHandler to File::RsyncP::FileIO->new, allowing a callback style log function rather than logMsg. - Added logHandlerSet to File::RsyncP::FileIO. - Added optional needMD4 argument to File::RsyncP::FileIO->csumStart. - Renamed sub mkpath to makePath. - Renamed sub mkspecial to makeSpecial. - Replaced unlink() calls with CORE::unlink(). - Added handling of special files to File::RsyncP::FileIO->fileListEltSend - Added File::RsyncP::FileIO->ignoreAttrOnFile. - Sending file deltas now sends deltas if the files are identical, rather than the whole file. - Changed t/rsyncLoad.t to use File::RsyncP instead of File::RsyncP::Digest. 0.10 Wed Dec 25 17:25:21 PST 2002 - Initial version File-RsyncP-0.74/Digest/0000755000076500000240000000000012456604100013724 5ustar craigstaffFile-RsyncP-0.74/Digest/Changes0000444000076500000240000000342112456604077015232 0ustar craigstaffRevision history for Perl module File::RsyncP::Digest 0.74 Sat Jan 17 16:50:43 PST 2015 - Updated license in headers. 0.72 Sun Jan 11 13:52:23 PST 2015 - Changed reset(), protocol() and add() in Digest.xs to be void. 0.70 Sun Sat Jul 10 09:54:12 PDT 2010 - Fixed adler32_checksum() in Digest/rsync_lib.c for case where native char is unsigned (eg: arm architecture). - Changed print format for error message in blockDigestUpdate(). 0.68 Sat Nov 18 18:29:31 PST 2006 - Fixed 2nd digest returned by File::RsyncP::Digest->digest2() when protocol_version <= 26. 0.64 Sun Jul 30 19:31:45 PDT 2006 - Fixed some compiler warnings and verbose declaration reported by Guillaume Filion and Rodrigo Real. 0.51 Sun May 9 23:42:56 PDT 2004 - Changed newSVpv() to newSVpvn() in Digest/Digest.xs to allow empty argument to blockDigestExtract(). 0.50 Sat Mar 20 18:19:50 PST 2004 - No changes. 0.47 Sun Mar 14 21:37:22 PST 2004 - No changes. 0.46 Sun Feb 8 18:11:30 PST 2004 - No changes. 0.45 Sat Feb 7 15:37:51 PST 2004 - Patches from Lars Thegler to back port to perl 5.005_03. 0.44 Wed Jul 23 21:31:18 PDT 2003 - No changes. 0.43 Sun Jul 20 00:03:40 PDT 2003 - Added File::RsyncP::Digest->protocol, including support for protocol version >= 27 (after MD4 fixes). - Added File::RsyncP::Digest->digest2 that returns the old (buggy) and new styles of the MD4 digest. 0.42 Sat Jul 12 09:53:40 PDT 2003 - Cleanup for gcc -Wall 0.41 Sat May 10 20:39:33 PDT 2003 - No changes. 0.40 Sat May 10 11:51:58 PDT 2003 - No changes. 0.31 Sun Feb 23 15:17:05 PST 2003 - No changes 0.30 Sun Feb 9 23:06:42 PST 2003 - No changes 0.20 Fri Jan 17 22:21:40 PST 2003 - No changes 0.10 Fri Dec 20 17:25:43 PST 2002 - Initial version File-RsyncP-0.74/Digest/Digest.pm0000444000076500000240000004024212456602761015514 0ustar craigstaff#============================================================= -*-perl-*- # # File::RsyncP::Digest package # # DESCRIPTION # File::RsyncP::Digest is a perl module that implements the # various message digests that rsync uses. # # AUTHOR # Craig Barratt # # COPYRIGHT # File::RsyncP is Copyright (C) 2002-2015 Craig Barratt. # # Rsync is Copyright (C) 1996-2001 by Andrew Tridgell, 1996 by Paul # Mackerras, 2001-2002 by Martin Pool, and 2003-2009 by Wayne Davison, # and others. # # 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 3 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, see . # #======================================================================== # # Version 0.74, released 17 Jan 2015. # # See http://perlrsync.sourceforge.net. # #======================================================================== package File::RsyncP::Digest; use strict; use vars qw($VERSION @ISA @EXPORT); require Exporter; require DynaLoader; require AutoLoader; @ISA = qw(Exporter AutoLoader DynaLoader); # Items to export into callers namespace by default. Note: do not export # names by default without a very good reason. Use EXPORT_OK instead. # Do not simply export all your public functions/methods/constants. @EXPORT = qw( ); $VERSION = '0.74'; bootstrap File::RsyncP::Digest $VERSION; # Preloaded methods go here. sub addfile { no strict 'refs'; # Countermand any strct refs in force so that we # can still handle file-handle names. my ($self, $handle) = @_; my ($package, $file, $line) = caller; my ($data) = ''; if (!ref($handle)) { # Old-style passing of filehandle by name. We need to add # the calling package scope qualifier, if there is not one # supplied already. $handle = $package . '::' . $handle unless ($handle =~ /(\:\:|\')/); } while (read($handle, $data, 1024)) { $self->add($data); } return $self; } sub hexdigest { my ($self) = shift; unpack("H*", ($self->digest())); } sub hash { my ($self, $data) = @_; if (ref($self)) { # This is an instance method call so reset the current context $self->reset(); } else { # This is a static method invocation, create a temporary MD4 context $self = new File::RsyncP::Digest; } # Now do the hash $self->add($data); $self->digest(); } sub hexhash { my ($self, $data) = @_; unpack("H*", ($self->hash($data))); } # Autoload methods go after =cut, and are processed by the autosplit program. 1; __END__ =head1 NAME File::RsyncP::Digest - Perl interface to rsync message digest algorithms =head1 SYNOPSIS use File::RsyncP::Digest; $rsDigest = new File::RsyncP::Digest; # specify rsync protocol version (default is <= 26 -> buggy digests). $rsDigest->protocol(version); # file MD4 digests $rsDigest->reset(); $rsDigest->add(LIST); $rsDigest->addfile(HANDLE); $digest = $rsDigest->digest(); $string = $rsDigest->hexdigest(); # Return 32 byte pair of digests (protocol <= 26 and >= 27). $digestPair = $rsDigest->digest2(); $digest = File::RsyncP::Digest->hash(SCALAR); $string = File::RsyncP::Digest->hexhash(SCALAR); # block digests $digests = $rsDigest->blockDigest($data, $blockSize, $md4DigestLen, $checksumSeed); $digests = $rsDigest->blockDigestUpdate($state, $blockSize, $blockLastLen, $md4DigestLen, $checksumSeed); $digests2 = $rsDigest->blockDigestExtract($digests16, $md4DigestLen); =head1 DESCRIPTION The B module allows you to compute rsync digests, including the RSA Data Security Inc. MD4 Message Digest algorithm, and Adler32 checksums from within Perl programs. =head2 Rsync Digests Rsync uses two main digests (or checksums), for checking with very high probability that the underlying data is identical, without the need to exchange the underlying data. The server (remote) side of rsync generates a checksumSeed (usually unix time()) that is exchanged during the protocol startup. This seed is used in both the file and MD4 checksum calculations. This causes the block and file checksums to change every time Rsync is run. =over 4 =item File Digest This is an MD4 digest of the checksum seed, followed by the entire file's contents. This digest is 128 bits long. The file digest is sent at the end of a file's deltas to ensure that the reconstructed file is correct. This digest is also optionally computed and sent as part of the file list if the --checksum option is specified to rsync. =item Block digest Each file is divided into blocks of default length 700 bytes. The digest of each block is formed by computing the Adler32 checksum of the block, and also the MD4 digest of the block followed by the checksum seed. During phase 1, just the first two bytes of the MD4 digest are sent, meaning the total digest is 6 bytes or 48 bits (4 bytes for Adler32 and the first 2 bytes of the MD4 digest). During phase 2 (which is necessary for received files that have an incorrect file digest), the entire MD4 checksum is used (128 bits) meaning the block digest is 20 bytes or 160 bits. (Prior to rsync protocol XXX, the full 20 byte digest was sent every time and there was only a single phase.) =back This module contains routines for computing file and block digests in a manner that is identical to rsync. Incidentally, rsync contains two bugs in its implementation of MD4 (up to and including rsync protocol version 26): =over 4 =item * MD4Final() is not called when the data size (ie: file or block size plus 4 bytes for the checksum seed) is a multiple of 64. =item * MD4 is not correct for total data sizes greater than 512MB (2^32 bits). Rsync's MD4 only maintains the data size using a 32 bit counter, so it overflows for file sizes bigger than 512MB. =back The effects of these bugs are benign: the MD4 digest should not be cryptographically weakened and both sides are consistent. This module implements both versions of the MD4 digest: the buggy version for protocol versions <= 26 and the correct version for protocol versions >= 27. The default mode is the buggy version (protocol versions <= 26). You can specify the rsync protocol version to determine which MD4 version is used: # specify rsync protocol version (default is <= 26 -> buggy digests). $rsDigest->protocol(version); Also, you can get both digests in a single call. The result is returned as a single 32 byte scalar: the first 16 bytes is the buggy digest and the second 16 bytes is the correct digest: # Return 32 byte pair of digests (protocol <= 26 and >= 27). $digestPair = $rsDigest->digest2(); =head2 Usage A new rsync digest context object is created with the B operation. Multiple simultaneous digest contexts can be maintained, if desired. =head2 Computing Block Digests After a context is created, the function to compute block checksums is: $digests = $rsDigest->blockDigest($data, $blockSize, $md4DigestLen, $checksumSeed) The first argument is the data, which can contain as much raw data as you wish (ie: multiple blocks). Both the Adler32 checksum and the MD4 checksum are computed for each block in data. The partial end block (if present) is also processed. The 4 bytes of the integer checksumSeed is added at the end of each block digest calculation if it is non-zero. The blockSize is specified in the second argument (default is 700). The third argument, md4DigestLen, specifies how many bytes of the MD4 digest are included in the returned data. Rsync uses a value of 2 for the first pass (meaning 6 bytes of total digests are returned per block), and all 16 bytes for the second pass (meaning 20 bytes of total digests are returned per block). The returned number of bytes is the number of bytes in each digest (Alder32 + partial/compete MD4) times the number of blocks: (4 + md4DigestLen) * ceil(length(data) / blockSize); To allow block checksums to be cached (when checksumSeed is unknown), and then quickly updated with the known checksumSeed, the checksum data should be first computed with a digest length of -1 and a checksumSeed of 0: $state = $rsDigest->blockDigest($data, $blockSize, -1, 0); The returned $state should be saved for later retrieval, together with the length of the last partial block (eg: length($data) % $blockSize). The length of $state depends upon the number of blocks and the block size. In addition to the 16 bytes of MD4 state, up to 63 bytes of unprocessed data per block also is saved in $state. For each block, 16 + ($blockSize % 64) bytes are saved in $state, so $state is most compact when $blockSize is a multiple of 64. (The last, partial, block might have a smaller block size, requiring up to 63 bytes of state even if $blockSize is a multiple of 64.) Once the checksumSeed is known the updated checksums can then be computed using: $digests = $rsDigest->blockDigestUpdate($state, $blockSize, $blockLastLen, $md4DigestLen, $checksumSeed); The first argument is the cached checksums from blockDigest. The third argument is the length of the (partial) last block. Alternatively, I hope to add a --checksum-seed=n option to rsync that allows the checksum seed to be set to 0. This causes the checksum seed to be omitted from the MD4 calculation and it makes caching the checksums much easier. A zero checksum seed does not weaken the block digest. I'm not sure whether or not it weakens the file digest (the checksum seed is applied at the start of the file digest and end of the block digest). In this case, the full 16 byte checksums should be computed using: $digests16 = $rsDigest->blockDigest($data, $blockSize, 16, 0); and for phase 1 the 2 byte MD4 substrings can be extracted with: $digests2 = $rsDigest->blockDigestExtract($digests16, 2); The original $digests16 does not need any additional processing for phase 2. =head2 Computing File Digests In addition, functions identical to B are provided that allow rsync's MD4 file digest to be computed. The checksum seed, if non-zero, is included at the start of the data, before the file's contents are added. The context is updated with the B operation which adds the strings contained in the I parameter. Note, however, that C, C followed by C and C should all give the same result. The final MD4 message digest value is returned by the B operation as a 16-byte binary string. This operation delivers the result of B operations since the last B or B operation. Note that the B operation is effectively a destructive, read-once operation. Once it has been performed, the context must be B before being used to calculate another digest value. Several convenience functions are also provided. The B operation takes an open file-handle and reads it until end-of file in 1024 byte blocks adding the contents to the context. The file-handle can either be specified by name or passed as a type-glob reference, as shown in the examples below. The B operation calls B and returns the result as a printable string of hexdecimal digits. This is exactly the same operation as performed by the B operation in the examples below. The B operation can act as either a static member function (ie you invoke it on the MD4 class as in the synopsis above) or as a normal virtual function. In both cases it performs the complete MD4 cycle (reset, add, digest) on the supplied scalar value. This is convenient for handling small quantities of data. When invoked on the class a temporary context is created. When invoked through an already created context object, this context is used. The latter form is slightly more efficient. The B operation is analogous to B. =head1 EXAMPLES use File::RsyncP::Digest; my $rsDigest = new File::RsyncP::Digest; $rsDigest->add('foo', 'bar'); $rsDigest->add('baz'); my $digest = $rsDigest->digest(); print("Rsync MD4 Digest is " . unpack("H*", $digest) . "\n"); The above example would print out the message Rsync MD4 Digest is 6df23dc03f9b54cc38a0fc1483df6e21 To compute the rsync phase 1 block checksums (4 + 2 = 6 bytes per block) for a 2000 byte file containing 700 a's, 700 b's and 600 c's, with a checksum seed of 0x12345678: use File::RsyncP::Digest; my $rsDigest = new File::RsyncP::Digest; my $data = ("a" x 700) . ("b" x 700) . ("c" x 600); my $digest = $rsDigest->rsyncChecksum($data, 700, 2, 0x12345678); print("Rsync block checksums are " . unpack("H*", $digest) . "\n"); This will print: Rsync block checksums are 3c09a624641bf80b0ce3abd208e8645d5b49 The same result can be achieved in two steps by saving the state, and then finishing the calculation: my $state = $rsDigest->blockDigest($data, 700, -1, 0); my $digest = $rsDigest->blockDigestUpdate($state, 700, length($data) % 700, 2, 0x12345678); or by computing full-length MD4 digests, and extracting the 2 byte version: my $digest16 = $rsDigest->blockDigest($data, 700, 16, 0x12345678); my $digest = $rsDigest->blockDigestExtract($digest16, 2); =head1 LICENSE 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 3 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, see . The MD4 algorithm is defined in RFC1320. The basic C code implementing the algorithm is derived from that in the RFC and is covered by the following copyright: =over 8 MD4 is Copyright (C) 1990-2, RSA Data Security, Inc. All rights reserved. License to copy and use this software is granted provided that it is identified as the "RSA Data Security, Inc. MD4 Message-Digest Algorithm" in all material mentioning or referencing this software or this function. License is also granted to make and use derivative works provided that such works are identified as "derived from the RSA Data Security, Inc. MD4 Message-Digest Algorithm" in all material mentioning or referencing the derived work. RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided "as is" without express or implied warranty of any kind. These notices must be retained in any copies of any part of this documentation and/or software. =back This copyright does not prohibit distribution of any version of Perl containing this extension under the terms of the GNU or Artistic licences. =head1 AUTHOR File::RsyncP::Digest was written by Craig Barratt based on Digest::MD4 and the Adler32 implementation was based on rsync 2.5.5. Digest::MD4 was adapted by Mike McCauley (C), based entirely on MD5-1.7, written by Neil Winton (C). Rsync was written by Andrew Tridgell and Paul Mackerras. It is available under a GPL license. See L. =head1 SEE ALSO See L for File::RsyncP's SourceForge home page. See L, L and L. =cut File-RsyncP-0.74/Digest/Digest.xs0000444000076500000240000001467412454352054015537 0ustar craigstaff/* ** Perl Extension for the ** ** RSA Data Security Inc. MD4 Message-Digest Algorithm ** ** This module originally by Neil Winton (N.Winton@axion.bt.co.uk) ** Adapted by Mike McCauley mikem@open.com.au ** $Id: MD4.xs,v 1.3 2001/07/30 23:39:57 mikem Exp $ ** ** This extension may be distributed under the same terms ** as Perl. The MD4 code is covered by separate copyright and ** licence, but this does not prohibit distribution under the ** GNU or Artistic licences. See the file md4c.c or MD4.pm ** for more details. */ #ifdef __cplusplus extern "C" { #endif #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "global.h" #include "md4.h" typedef RsyncMD4_CTX *File__RsyncP__Digest; #ifdef __cplusplus } #endif MODULE = File::RsyncP::Digest PACKAGE = File::RsyncP::Digest PROTOTYPES: DISABLE File::RsyncP::Digest new(packname = "File::RsyncP::Digest", protocol=26) char *packname int protocol; CODE: { RETVAL = (RsyncMD4_CTX *)safemalloc(sizeof(RsyncMD4_CTX)); RsyncMD4Init(RETVAL); if ( protocol <= 26 ) { RETVAL->rsyncMD4Bug = 1; } else { RETVAL->rsyncMD4Bug = 0; } } OUTPUT: RETVAL void DESTROY(context) File::RsyncP::Digest context CODE: { safefree((char *)context); } void reset(context) File::RsyncP::Digest context CODE: { RsyncMD4Init(context); } void protocol(context, protocol=26) INPUT: File::RsyncP::Digest context unsigned int protocol CODE: { if ( protocol <= 26 ) { context->rsyncMD4Bug = 1; } else { context->rsyncMD4Bug = 0; } } void add(context, ...) File::RsyncP::Digest context CODE: { STRLEN len; unsigned char *data; int i; for (i = 1; i < items; i++) { data = (unsigned char *)(SvPV(ST(i), len)); RsyncMD4Update(context, data, len); } } SV * digest(context) File::RsyncP::Digest context CODE: { unsigned char digeststr[16]; RsyncMD4FinalRsync(digeststr, context); ST(0) = sv_2mortal(newSVpvn((char *)digeststr, 16)); } SV * digest2(context) File::RsyncP::Digest context CODE: { unsigned char digeststr[32]; RsyncMD4_CTX context2 = *context; int rsyncMD4Bug = context->rsyncMD4Bug; /* * Return 2 MD4s (32 bytes): first is rsync buggy version * (protocol <= 26) and second is correct version (>= 27). */ context2.rsyncMD4Bug = !rsyncMD4Bug; RsyncMD4FinalRsync(digeststr + 0, rsyncMD4Bug ? context : &context2); RsyncMD4FinalRsync(digeststr + 16, rsyncMD4Bug ? &context2 : context); ST(0) = sv_2mortal(newSVpvn((char *)digeststr, 32)); } SV * blockDigest(context, dataV, blockSize=700, md4DigestLen=16, seed=0) PREINIT: STRLEN len; INPUT: File::RsyncP::Digest context SV *dataV unsigned char *data = (unsigned char *)SvPV(dataV, len); size_t blockSize int md4DigestLen unsigned int seed CODE: { UINT4 digestSize; unsigned char *digest; extern void rsync_checksum(unsigned char *buf, UINT4 len, UINT4 blockSize, UINT4 seed, unsigned char *digest, int md4DigestLen); if ( blockSize == 0 ) blockSize = 700; if ( md4DigestLen < 0 ) { /* * special case: save the entire MD4 state, so it can * be cached. That's 4+16=20 bytes per block, plus the * used part of the 64 byte buffer. */ int nBlocks = (len + blockSize - 1) / blockSize; digestSize = 20 * nBlocks + (nBlocks > 1 ? (blockSize % 64) * (nBlocks - 1) : 0) + ((len % blockSize) % 64); } else { digestSize = (4 + (md4DigestLen > 16 ? 16 : md4DigestLen)) * ((len + blockSize - 1) / blockSize); } digest = safemalloc(1 + digestSize); rsync_checksum(data, len, blockSize, seed, digest, md4DigestLen); ST(0) = sv_2mortal(newSVpvn((char *)digest, digestSize)); safefree(digest); } SV * blockDigestUpdate(context, dataV, blockSize=700, blockLastLen=0, md4DigestLen=16, seed=0) PREINIT: STRLEN len; INPUT: File::RsyncP::Digest context SV *dataV unsigned char *data = (unsigned char *)SvPV(dataV, len); size_t blockSize size_t blockLastLen int md4DigestLen unsigned int seed CODE: { UINT4 digestSize, blockCnt; unsigned char *digest; extern void rsync_checksum_update(unsigned char *digestIn, UINT4 blockCnt, UINT4 blockSize, UINT4 blockLastLen, UINT4 seed, unsigned char *digestOut, int md4DigestLen); if ( blockSize == 0 ) blockSize = 700; /* * There are 20 + (blockSize % 64) bytes per block, * plus 20 + (blockLastLen % 64) bytes for the last block. */ blockCnt = 1 + (len - (20 + (blockLastLen % 64))) / (20 + (blockSize % 64)); if ( len == 0 || len != 20 * blockCnt + (blockCnt > 1 ? (blockSize % 64) * (blockCnt - 1) : 0) + (blockLastLen % 64) ) { /* TODO: provide a decent error message */ printf("len = %u is wrong\n", (unsigned int)len); blockCnt = 0; } if ( md4DigestLen > 16 || md4DigestLen < 0 ) md4DigestLen = 16; digestSize = (4 + md4DigestLen) * blockCnt; digest = safemalloc(1 + digestSize); rsync_checksum_update(data, blockCnt, blockSize, blockLastLen, seed, digest, md4DigestLen); ST(0) = sv_2mortal(newSVpvn((char *)digest, digestSize)); safefree(digest); } SV * blockDigestExtract(context, dataV, md4DigestLen=16) PREINIT: STRLEN len; INPUT: File::RsyncP::Digest context SV *dataV unsigned char *data = (unsigned char *)SvPV(dataV, len); int md4DigestLen CODE: { unsigned char *digest, *p; UINT4 blockCnt = len / 20; UINT4 digestSize; if ( md4DigestLen < 0 || md4DigestLen > 16 ) { md4DigestLen = 16; } digestSize = (4 + md4DigestLen) * blockCnt; p = digest = safemalloc(1 + digestSize); while ( blockCnt-- > 0 ) { memcpy(p, data, 4); p += 4; data += 4; memcpy(p, data, md4DigestLen); p += md4DigestLen; data += 16; } ST(0) = sv_2mortal(newSVpvn((char *)digest, digestSize)); safefree(digest); } File-RsyncP-0.74/Digest/global.h0000444000076500000240000000266511423121572015344 0ustar craigstaff/* GLOBAL.H - RSAREF types and constants */ /* PROTOTYPES should be set to one if and only if the compiler supports function argument prototyping. The following makes PROTOTYPES default to 0 if it has not already been defined with C compiler flags. */ #ifndef PROTOTYPES #define PROTOTYPES 0 #endif /* POINTER defines a generic pointer type */ typedef unsigned char *POINTER; /* UINT2 defines a two byte word */ typedef unsigned short int UINT2; /* UINT4 defines a four byte word. We use the Perl byte-order definition to discover if a long has more than 4 bytes. If so we will try to use an unsigned int. This is OK for DEC Alpha but may not work everywhere. See the TO32 definition below. */ #if (PERL_BYTEORDER <= 4321) || defined(UINT4_IS_LONG) typedef unsigned long UINT4; #else typedef unsigned int UINT4; #endif /* TO32 ensures that UINT4 values are truncated to 32 bits. A Cray has short, int and long all at 64 bits so we need to apply this macro to reduce UINT4 values to 32 bits at appropriate places. If UINT4 really does have 32 bits then this is a no-op. */ #if defined(cray) || defined(TRUNCATE_UINT4) #define TO32(x) ((x) & 0xffffffff) #else #define TO32(x) (x) #endif /* PROTO_LIST is defined depending on how PROTOTYPES is defined above. If using PROTOTYPES, then PROTO_LIST returns the list, otherwise it returns an empty list. */ #if PROTOTYPES #define PROTO_LIST(list) list #else #define PROTO_LIST(list) () #endif File-RsyncP-0.74/Digest/Makefile.PL0000444000076500000240000000100611423121572015671 0ustar craigstaffuse ExtUtils::MakeMaker; # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. WriteMakefile( 'NAME' => 'File::RsyncP::Digest', 'VERSION_FROM' => 'Digest.pm', # finds $VERSION 'LIBS' => [''], # e.g., '-lm' 'CONFIG' => ['byteorder'], # Used to determine 64-bitness 'DEFINE' => '-DPERL_BYTEORDER=$(BYTEORDER)', 'INC' => '', # e.g., '-I/usr/include/other' 'OBJECT' => q[Digest$(OBJ_EXT) md4c$(OBJ_EXT) rsync_lib$(OBJ_EXT)], ); File-RsyncP-0.74/Digest/md4.h0000444000076500000240000000402111423121572014554 0ustar craigstaff/* MD4.H - header file for MD4C.C */ /* Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All rights reserved. License to copy and use this software is granted provided that it is identified as the "RSA Data Security, Inc. MD4 Message-Digest Algorithm" in all material mentioning or referencing this software or this function. License is also granted to make and use derivative works provided that such works are identified as "derived from the RSA Data Security, Inc. MD4 Message-Digest Algorithm" in all material mentioning or referencing the derived work. RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided "as is" without express or implied warranty of any kind. These notices must be retained in any copies of any part of this documentation and/or software. */ /* MD4 context. */ typedef struct { UINT4 state[4]; /* state (ABCD) */ UINT4 count[2]; /* number of bits, modulo 2^64 (lsb first) */ unsigned char buffer[64]; /* input buffer */ /* * MD4 finalization for Rsync compatability. For protocol version <= 26 * (rsync <= 2.5.6) rsync has a bug where it doesn't append the pad when * the last fragment is empty (digest size is a multiple of 64). Rsync * also only has a 32 bit byte counter, so the number of bits overflows * for >= 512MB. Both bugs are fixed for protocol version >= 27. */ unsigned char rsyncMD4Bug; } RsyncMD4_CTX; void RsyncMD4Init PROTO_LIST ((RsyncMD4_CTX *)); void RsyncMD4Update PROTO_LIST ((RsyncMD4_CTX *, unsigned char *, unsigned int)); void RsyncMD4Final PROTO_LIST ((unsigned char [16], RsyncMD4_CTX *)); void RsyncMD4Encode PROTO_LIST ((unsigned char *, UINT4 *, unsigned int)); void RsyncMD4FinalRsync PROTO_LIST ((unsigned char [16], RsyncMD4_CTX *)); void RsyncMD4Decode PROTO_LIST ((UINT4 *, unsigned char *, unsigned int)); File-RsyncP-0.74/Digest/md4c.c0000444000076500000240000002426411423121572014725 0ustar craigstaff/* MD4C.C - RSA Data Security, Inc., MD4 message-digest algorithm */ /* Copyright (C) 1990-2, RSA Data Security, Inc. All rights reserved. License to copy and use this software is granted provided that it is identified as the "RSA Data Security, Inc. MD4 Message-Digest Algorithm" in all material mentioning or referencing this software or this function. License is also granted to make and use derivative works provided that such works are identified as "derived from the RSA Data Security, Inc. MD4 Message-Digest Algorithm" in all material mentioning or referencing the derived work. RSA Data Security, Inc. makes no representations concerning either the merchantability of this software or the suitability of this software for any particular purpose. It is provided "as is" without express or implied warranty of any kind. These notices must be retained in any copies of any part of this documentation and/or software. */ #include "global.h" #include "md4.h" /* Constants for MD4Transform routine. */ #define S11 3 #define S12 7 #define S13 11 #define S14 19 #define S21 3 #define S22 5 #define S23 9 #define S24 13 #define S31 3 #define S32 9 #define S33 11 #define S34 15 static void RsyncMD4Transform PROTO_LIST ((UINT4 [4], unsigned char [64])); void RsyncMD4Encode PROTO_LIST ((unsigned char *, UINT4 *, unsigned int)); void RsyncMD4Decode PROTO_LIST ((UINT4 *, unsigned char *, unsigned int)); static void RsyncMD4_memcpy PROTO_LIST ((POINTER, POINTER, unsigned int)); static void RsyncMD4_memset PROTO_LIST ((POINTER, int, unsigned int)); static unsigned char PADDING[64] = { 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; /* F, G and H are basic MD4 functions. */ #define F(x, y, z) (((x) & (y)) | ((~x) & (z))) #define G(x, y, z) (((x) & (y)) | ((x) & (z)) | ((y) & (z))) #define H(x, y, z) ((x) ^ (y) ^ (z)) /* ROTATE_LEFT rotates x left n bits. */ #define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32-(n)))) /* FF, GG and HH are transformations for rounds 1, 2 and 3 */ /* Rotation is separate from addition to prevent recomputation */ #define FF(a, b, c, d, x, s) { \ (a) += F ((b), (c), (d)) + (x); \ (a) = ROTATE_LEFT ((a), (s)); \ } #define GG(a, b, c, d, x, s) { \ (a) += G ((b), (c), (d)) + (x) + (UINT4)0x5a827999; \ (a) = ROTATE_LEFT ((a), (s)); \ } #define HH(a, b, c, d, x, s) { \ (a) += H ((b), (c), (d)) + (x) + (UINT4)0x6ed9eba1; \ (a) = ROTATE_LEFT ((a), (s)); \ } /* MD4 initialization. Begins an MD4 operation, writing a new context. */ void RsyncMD4Init (context) RsyncMD4_CTX *context; /* context */ { context->count[0] = context->count[1] = 0; /* Load magic initialization constants. */ context->state[0] = 0x67452301; context->state[1] = 0xefcdab89; context->state[2] = 0x98badcfe; context->state[3] = 0x10325476; context->rsyncMD4Bug = 1; } /* MD4 block update operation. Continues an MD4 message-digest operation, processing another message block, and updating the context. */ void RsyncMD4Update (context, input, inputLen) RsyncMD4_CTX *context; /* context */ unsigned char *input; /* input block */ unsigned int inputLen; /* length of input block */ { unsigned int i, index, partLen; /* Compute number of bytes mod 64 */ index = (unsigned int)((context->count[0] >> 3) & 0x3F); /* Update number of bits */ if ((context->count[0] += ((UINT4)inputLen << 3)) < ((UINT4)inputLen << 3)) context->count[1]++; context->count[1] += ((UINT4)inputLen >> 29); partLen = 64 - index; /* Transform as many times as possible. */ if (inputLen >= partLen) { RsyncMD4_memcpy ((POINTER)&context->buffer[index], (POINTER)input, partLen); RsyncMD4Transform (context->state, context->buffer); for (i = partLen; i + 63 < inputLen; i += 64) RsyncMD4Transform (context->state, &input[i]); index = 0; } else i = 0; /* Buffer remaining input */ RsyncMD4_memcpy ((POINTER)&context->buffer[index], (POINTER)&input[i], inputLen-i); } /* MD4 finalization. Ends an MD4 message-digest operation, writing the the message digest and zeroizing the context. */ void RsyncMD4Final (digest, context) unsigned char digest[16]; /* message digest */ RsyncMD4_CTX *context; /* context */ { unsigned char bits[8]; unsigned int index, padLen; /* Save number of bits */ RsyncMD4Encode (bits, context->count, 8); /* Pad out to 56 mod 64. */ index = (unsigned int)((context->count[0] >> 3) & 0x3f); padLen = (index < 56) ? (56 - index) : (120 - index); RsyncMD4Update (context, PADDING, padLen); /* Append length (before padding) */ RsyncMD4Update (context, bits, 8); /* Store state in digest */ RsyncMD4Encode (digest, context->state, 16); /* Zeroize sensitive information. */ RsyncMD4_memset ((POINTER)context, 0, sizeof (*context)); } /* * MD4 finalization for Rsync compatability. * * If context->rsyncMD4Bug is set we emulate the rsync bug for protocol * version <= 26 (rsync <= 2.5.6). Rsync has a bug where it doesn't * append the pad when the last fragment is empty (message size is a * multiple of 64). Rsync also only has a 32 bit byte counter, so * the number of bits overflows for >= 512MB. * * If context->rsyncMD4Bug is clear we correctly implement md4 (rsync * protocol >= 27). */ void RsyncMD4FinalRsync (digest, context) unsigned char digest[16]; /* message digest */ RsyncMD4_CTX *context; /* context */ { unsigned char bits[8]; unsigned int index, padLen; /* Save number of bits */ if ( context->rsyncMD4Bug ) { context->count[1] = 0; /* Rsync <= 2.5.6 bug */ } RsyncMD4Encode (bits, context->count, 8); /* Pad out to 56 mod 64. */ index = (unsigned int)((context->count[0] >> 3) & 0x3f); if ( !context->rsyncMD4Bug || index > 0 ) { /* Rsync <= 2.5.6 bug */ padLen = (index < 56) ? (56 - index) : (120 - index); RsyncMD4Update (context, PADDING, padLen); /* Append length (before padding) */ RsyncMD4Update (context, bits, 8); /* Store state in digest */ } RsyncMD4Encode (digest, context->state, 16); /* Zeroize sensitive information. */ RsyncMD4_memset ((POINTER)context, 0, sizeof (*context)); } /* MD4 basic transformation. Transforms state based on block. */ static void RsyncMD4Transform (state, block) UINT4 state[4]; unsigned char block[64]; { UINT4 a = state[0], b = state[1], c = state[2], d = state[3], x[16]; RsyncMD4Decode (x, block, 64); /* Round 1 */ FF (a, b, c, d, x[ 0], S11); /* 1 */ FF (d, a, b, c, x[ 1], S12); /* 2 */ FF (c, d, a, b, x[ 2], S13); /* 3 */ FF (b, c, d, a, x[ 3], S14); /* 4 */ FF (a, b, c, d, x[ 4], S11); /* 5 */ FF (d, a, b, c, x[ 5], S12); /* 6 */ FF (c, d, a, b, x[ 6], S13); /* 7 */ FF (b, c, d, a, x[ 7], S14); /* 8 */ FF (a, b, c, d, x[ 8], S11); /* 9 */ FF (d, a, b, c, x[ 9], S12); /* 10 */ FF (c, d, a, b, x[10], S13); /* 11 */ FF (b, c, d, a, x[11], S14); /* 12 */ FF (a, b, c, d, x[12], S11); /* 13 */ FF (d, a, b, c, x[13], S12); /* 14 */ FF (c, d, a, b, x[14], S13); /* 15 */ FF (b, c, d, a, x[15], S14); /* 16 */ /* Round 2 */ GG (a, b, c, d, x[ 0], S21); /* 17 */ GG (d, a, b, c, x[ 4], S22); /* 18 */ GG (c, d, a, b, x[ 8], S23); /* 19 */ GG (b, c, d, a, x[12], S24); /* 20 */ GG (a, b, c, d, x[ 1], S21); /* 21 */ GG (d, a, b, c, x[ 5], S22); /* 22 */ GG (c, d, a, b, x[ 9], S23); /* 23 */ GG (b, c, d, a, x[13], S24); /* 24 */ GG (a, b, c, d, x[ 2], S21); /* 25 */ GG (d, a, b, c, x[ 6], S22); /* 26 */ GG (c, d, a, b, x[10], S23); /* 27 */ GG (b, c, d, a, x[14], S24); /* 28 */ GG (a, b, c, d, x[ 3], S21); /* 29 */ GG (d, a, b, c, x[ 7], S22); /* 30 */ GG (c, d, a, b, x[11], S23); /* 31 */ GG (b, c, d, a, x[15], S24); /* 32 */ /* Round 3 */ HH (a, b, c, d, x[ 0], S31); /* 33 */ HH (d, a, b, c, x[ 8], S32); /* 34 */ HH (c, d, a, b, x[ 4], S33); /* 35 */ HH (b, c, d, a, x[12], S34); /* 36 */ HH (a, b, c, d, x[ 2], S31); /* 37 */ HH (d, a, b, c, x[10], S32); /* 38 */ HH (c, d, a, b, x[ 6], S33); /* 39 */ HH (b, c, d, a, x[14], S34); /* 40 */ HH (a, b, c, d, x[ 1], S31); /* 41 */ HH (d, a, b, c, x[ 9], S32); /* 42 */ HH (c, d, a, b, x[ 5], S33); /* 43 */ HH (b, c, d, a, x[13], S34); /* 44 */ HH (a, b, c, d, x[ 3], S31); /* 45 */ HH (d, a, b, c, x[11], S32); /* 46 */ HH (c, d, a, b, x[ 7], S33); /* 47 */ HH (b, c, d, a, x[15], S34); /* 48 */ state[0] += a; state[1] += b; state[2] += c; state[3] += d; /* Zeroize sensitive information. */ RsyncMD4_memset ((POINTER)x, 0, sizeof (x)); } /* Encodes input (UINT4) into output (unsigned char). Assumes len is a multiple of 4. */ void RsyncMD4Encode (output, input, len) unsigned char *output; UINT4 *input; unsigned int len; { unsigned int i, j; for (i = 0, j = 0; j < len; i++, j += 4) { output[j] = (unsigned char)(input[i] & 0xff); output[j+1] = (unsigned char)((input[i] >> 8) & 0xff); output[j+2] = (unsigned char)((input[i] >> 16) & 0xff); output[j+3] = (unsigned char)((input[i] >> 24) & 0xff); } } /* Decodes input (unsigned char) into output (UINT4). Assumes len is a multiple of 4. */ void RsyncMD4Decode (output, input, len) UINT4 *output; unsigned char *input; unsigned int len; { unsigned int i, j; for (i = 0, j = 0; j < len; i++, j += 4) output[i] = ((UINT4)input[j]) | (((UINT4)input[j+1]) << 8) | (((UINT4)input[j+2]) << 16) | (((UINT4)input[j+3]) << 24); } /* Note: Replace "for loop" with standard memcpy if possible. */ static void RsyncMD4_memcpy (output, input, len) POINTER output; POINTER input; unsigned int len; { unsigned int i; for (i = 0; i < len; i++) output[i] = input[i]; } /* Note: Replace "for loop" with standard memset if possible. */ static void RsyncMD4_memset (output, value, len) POINTER output; int value; unsigned int len; { unsigned int i; for (i = 0; i < len; i++) ((char *)output)[i] = (char)value; } File-RsyncP-0.74/Digest/rsync_lib.c0000444000076500000240000001277511423121572016066 0ustar craigstaff/* This code was copied form Rsync by Craig Barratt Copyright (C) Andrew Tridgell 1996 Copyright (C) Paul Mackerras 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "global.h" #include "md4.h" #include /* * CHAR_OFFSET is 0 for rsync, and 31 for librsync. */ #define CHAR_OFFSET 0 /* * a simple 32 bit checksum that can be updated from either end * (inspired by Mark Adler's Adler-32 checksum) */ UINT4 adler32_checksum(char *buf1, int len) { int i; UINT4 s1, s2; signed char *buf = (signed char*)buf1; s1 = s2 = 0; for ( i = 0 ; i < len - 4; i += 4 ) { s2 += 4 * (s1 + buf[i]) + 3 * buf[i+1] + 2 * buf[i+2] + buf[i+3] + 10 * CHAR_OFFSET; s1 += (buf[i+0] + buf[i+1] + buf[i+2] + buf[i+3] + 4 * CHAR_OFFSET); } for ( ; i < len ; i++ ) { s1 += (buf[i] + CHAR_OFFSET); s2 += s1; } return (s1 & 0xffff) + (s2 << 16); } /* * Compute both the alder32 and MD4 checksums for blockSize sized * blocks from a buffer buf of length len. Seed is the optional * Rsync seed that is appended to the data. Each block produces * 4 + min(md4DigestLen,16) bytes of output (alder32+MD4) in digest. * The number of blocks is ceil(len/blockSize). * * There are two special cases: * md4DigestLen == 0: skip MD4; output has adler32 only. * md4DigestLen > 16: output MD4 is really MD4 state, prior to * MD4FinalRsync(). */ void rsync_checksum(unsigned char *buf, UINT4 len, UINT4 blockSize, UINT4 seed, unsigned char *digest, int md4DigestLen) { unsigned char seedBytes[4]; if ( md4DigestLen > 0 && seed ) { RsyncMD4Encode(seedBytes, &seed, 1); } while ( len > 0 ) { int thisLen = len < blockSize ? len : blockSize; UINT4 adler32 = adler32_checksum((char*)buf, thisLen); RsyncMD4Encode(digest, &adler32, 1); digest += 4; if ( md4DigestLen ) { RsyncMD4_CTX md4; RsyncMD4Init(&md4); RsyncMD4Update(&md4, buf, thisLen); if ( seed ) { RsyncMD4Update(&md4, seedBytes, 4); } if ( md4DigestLen < 0 ) { /* * Done: just save the state and the partial buffer (no finish) */ RsyncMD4Encode(digest, md4.state, 16); digest += 16; memcpy(digest, md4.buffer, thisLen % 64); digest += thisLen % 64; } else if ( md4DigestLen >= 16 ) { /* * Normal finish: save all 16 bytes */ RsyncMD4FinalRsync(digest, &md4); digest += 16; } else { unsigned char md4Digest[16]; /* * Finish and truncate to md4DigestLen bytes */ RsyncMD4FinalRsync(md4Digest, &md4); memcpy(digest, md4Digest, md4DigestLen); digest += md4DigestLen; } } len -= thisLen; buf += thisLen; } } /* * Update the MD4 digest by adding the seed to the data. Since * the rsync seed changes each time we need to add the seed. * We can do this by restoring the MD4 state (16 bytes plus * the length). Each block has length blockSize, except the * last block, which is blockLastLen. * * The input data should be of length 20 * blockCnt. * The first block is blockStart (usually 0). The length * of the last block is blockLastLen. If seed == 0 then * it is skipped, and the MD4 digest is simply optionally * truncated. * * md4DigestLen is used to specify the MD4 digest length (eg: 2 or 16). * The output data size is blockCnt * (4 + md4DigestLen) bytes. */ void rsync_checksum_update(unsigned char *digestIn, UINT4 blockCnt, UINT4 blockSize, UINT4 blockLastLen, UINT4 seed, unsigned char *digestOut, int md4DigestLen) { unsigned char seedBytes[4]; if ( seed ) { RsyncMD4Encode(seedBytes, &seed, 1); } if ( md4DigestLen > 16 || md4DigestLen < 0 ) { md4DigestLen = 16; } while ( blockCnt-- ) { RsyncMD4_CTX md4; /* * Copy adler32 */ memcpy(digestOut, digestIn, 4); digestIn += 4; digestOut += 4; RsyncMD4Init(&md4); RsyncMD4Decode(md4.state, digestIn, 16); digestIn += 16; if ( blockCnt ) { md4.count[0] = blockSize << 3; md4.count[1] = blockSize >> 29; memcpy(md4.buffer, digestIn, blockSize % 64); digestIn += blockSize % 64; } else { md4.count[0] = blockLastLen << 3; md4.count[1] = blockLastLen >> 29; memcpy(md4.buffer, digestIn, blockLastLen % 64); digestIn += blockLastLen % 64; } if ( seed ) { RsyncMD4Update(&md4, seedBytes, 4); } if ( md4DigestLen == 16 ) { /* * Normal finish: save all 16 bytes */ RsyncMD4FinalRsync(digestOut, &md4); } else { unsigned char md4Digest[16]; /* * Finish and truncate to md4DigestLen bytes */ RsyncMD4FinalRsync(md4Digest, &md4); memcpy(digestOut, md4Digest, md4DigestLen); } digestOut += md4DigestLen; } } File-RsyncP-0.74/Digest/t/0000755000076500000240000000000011423121572014167 5ustar craigstaffFile-RsyncP-0.74/Digest/t/blockDigest.t0000444000076500000240000000172311423121572016607 0ustar craigstaff#!/bin/perl BEGIN {print "1..4\n";} END {print "not ok 1\n" unless $loaded;} use File::RsyncP::Digest; $loaded = 1; print "ok 1\n"; my $rsDigest = new File::RsyncP::Digest; my $data = ("a" x 700) . ("b" x 700) . ("c" x 600); my $digest = $rsDigest->blockDigest($data, 700, 2, 0x12345678); if ( unpack("H*", $digest) eq "3c09a624641bf80b0ce3abd208e8645d5b49" ) { print "ok 2\n"; } else { print "not ok 2\n"; } my $state = $rsDigest->blockDigest($data, 700, -1, 0); $digest = $rsDigest->blockDigestUpdate($state, 700, length($data) % 700, 2, 0x12345678); if ( unpack("H*", $digest) eq "3c09a624641bf80b0ce3abd208e8645d5b49" ) { print "ok 3\n"; } else { print "not ok 3\n"; } my $digest16 = $rsDigest->blockDigest($data, 700, 16, 0x12345678); $digest = $rsDigest->blockDigestExtract($digest16, 2); if ( unpack("H*", $digest) eq "3c09a624641bf80b0ce3abd208e8645d5b49" ) { print "ok 4\n"; } else { print "not ok 4\n"; } File-RsyncP-0.74/Digest/t/fileDigest.t0000444000076500000240000001275011423121572016436 0ustar craigstaff# $Id: test.pl,v 1.1 2000/08/27 23:12:24 mikem Exp $ # Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl test.pl' ######################### We start with some black magic to print on failure. # Change 1..1 below to 1..last_test_to_print . # (It may become useful if the test is moved to ./t subdirectory.) BEGIN {print "1..16\n";} END {print "not ok 1\n" unless $loaded;} use File::RsyncP::Digest; $loaded = 1; print "ok 1\n"; ######################### End of black magic. # Insert your test code below (better if it prints "ok 13" # (correspondingly "not ok 13") depending on the success of chunk 13 # of the test code): package MD4Test; # 2: Constructor print (($md4 = new File::RsyncP::Digest) ? "ok 2\n" : "not ok 2\n"); # 3: Basic test data as defined in RFC 1320 (buggy version) %data26 = ( "" => "0123456789abcdeffedcba9876543210", "a" => "bde52cb31de33e46245e05fbdbd6fb24", "abc" => "a448017aaf21d8525fc10ae87aa6729d", "message digest" => "d9130a8164549fe818874806e1c7014b", "abcdefghijklmnopqrstuvwxyz" => "d79e1c308aa5bbcdeea8ed63df412da9", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" => "043f8582f241db351ce627e153e7f0e4", "12345678901234567890123456789012345678901234567890123456789012345678901234567890" => "e33b4ddc9c38f2199c3e7b164fcc0536", # From draft-ietf-pppext-mschap-00.txt: "\x4D\x00\x79\x00\x50\x00\x77\x00" => "fc156af7edcd6c0edde3337d427f4eac", ); $failed = 0; foreach (sort(keys(%data26))) { $md4->reset; $md4->protocol(26); $md4->add($_); $digest = $md4->digest; $hex = unpack("H*", $digest); if ($hex ne $data26{$_}) { $failed++; } } print ($failed ? "not ok 3\n" : "ok 3\n"); # 4: Various flavours of file-handle to addfile open(F, "<$0"); $md4->reset; $md4->addfile(F); $hex = $md4->hexdigest; print ($hex ne '' ? "ok 4\n" : "not ok 4\n"); $orig = $hex; # 5: Fully qualified with ' operator seek(F, 0, 0); $md4->reset; $md4->addfile(MD4Test'F); $hex = $md4->hexdigest; print ($hex eq $orig ? "ok 5\n" : "not ok 5\n"); # 6: Fully qualified with :: operator seek(F, 0, 0); $md4->reset; $md4->addfile(MD4Test::F); $hex = $md4->hexdigest; print ($hex eq $orig ? "ok 6\n" : "not ok 6\n"); # 7: Type glob seek(F, 0, 0); $md4->reset; $md4->addfile(*F); $hex = $md4->hexdigest; print ($hex eq $orig ? "ok 7\n" : "not ok 7\n"); # 8: Type glob reference (the prefered mechanism) seek(F, 0, 0); $md4->reset; $md4->addfile(\*F); $hex = $md4->hexdigest; print ($hex eq $orig ? "ok 8\n" : "not ok 8\n"); # 9: File-handle passed by name (really the same as 6) seek(F, 0, 0); $md4->reset; $md4->addfile("MD4Test::F"); $hex = $md4->hexdigest; print ($hex eq $orig ? "ok 9\n" : "not ok 9\n"); # 10: Other ways of reading the data -- line at a time seek(F, 0, 0); $md4->reset; while () { $md4->add($_); } $hex = $md4->hexdigest; print ($hex eq $orig ? "ok 10\n" : "not ok 10\n"); # 11: Input lines as a list to add() seek(F, 0, 0); $md4->reset; $md4->add(); $hex = $md4->hexdigest; print ($hex eq $orig ? "ok 11\n" : "not ok 11\n"); # 12: Random chunks up to 128 bytes seek(F, 0, 0); $md4->reset; while (read(F, $hexata, (rand % 128) + 1)) { $md4->add($hexata); } $hex = $md4->hexdigest; print ($hex eq $orig ? "ok 12\n" : "not ok 12\n"); # 13: All the data at once seek(F, 0, 0); $md4->reset; undef $/; $data = ; $hex = $md4->hexhash($data); print ($hex eq $orig ? "ok 13\n" : "not ok 13\n"); close(F); # 14: Using static member function $hex = File::RsyncP::Digest->hexhash($data); print ($hex eq $orig ? "ok 14\n" : "not ok 14\n"); # 15: Basic test data as defined in RFC 1320 (non-buggy version) %data27 = ( "" => "31d6cfe0d16ae931b73c59d7e0c089c0", "a" => "bde52cb31de33e46245e05fbdbd6fb24", "abc" => "a448017aaf21d8525fc10ae87aa6729d", "message digest" => "d9130a8164549fe818874806e1c7014b", "abcdefghijklmnopqrstuvwxyz" => "d79e1c308aa5bbcdeea8ed63df412da9", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" => "043f8582f241db351ce627e153e7f0e4", "12345678901234567890123456789012345678901234567890123456789012345678901234567890" => "e33b4ddc9c38f2199c3e7b164fcc0536", # From draft-ietf-pppext-mschap-00.txt: "\x4D\x00\x79\x00\x50\x00\x77\x00" => "fc156af7edcd6c0edde3337d427f4eac", ); $failed = 0; foreach (sort(keys(%data27))) { $md4->reset; $md4->protocol(27); $md4->add($_); $digest = $md4->digest; $hex = unpack("H*", $digest); if ($hex ne $data27{$_}) { $failed++; } } print ($failed ? "not ok 15\n" : "ok 15\n"); # 16: test data using both buggy and non-buggy versions %data27 = ( "" => "31d6cfe0d16ae931b73c59d7e0c089c0", "a" => "bde52cb31de33e46245e05fbdbd6fb24", "abc" => "a448017aaf21d8525fc10ae87aa6729d", "message digest" => "d9130a8164549fe818874806e1c7014b", "abcdefghijklmnopqrstuvwxyz" => "d79e1c308aa5bbcdeea8ed63df412da9", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" => "043f8582f241db351ce627e153e7f0e4", "12345678901234567890123456789012345678901234567890123456789012345678901234567890" => "e33b4ddc9c38f2199c3e7b164fcc0536", # From draft-ietf-pppext-mschap-00.txt: "\x4D\x00\x79\x00\x50\x00\x77\x00" => "fc156af7edcd6c0edde3337d427f4eac", ); $failed = 0; foreach (sort(keys(%data27))) { $md4->reset; $md4->protocol(27); $md4->add($_); $digest = $md4->digest2; $hex = unpack("H*", $digest); if ($hex ne "$data26{$_}$data27{$_}" ) { $failed++; } } print ($failed ? "not ok 16\n" : "ok 16\n"); File-RsyncP-0.74/Digest/typemap0000444000076500000240000000004611423121572015324 0ustar craigstaffTYPEMAP File::RsyncP::Digest T_PTROBJ File-RsyncP-0.74/FileList/0000755000076500000240000000000012456605527014236 5ustar craigstaffFile-RsyncP-0.74/FileList/byteorder.h0000444000076500000240000000352311423121572016371 0ustar craigstaff/* simple byteorder handling Copyright (C) Andrew Tridgell 1992-1995 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #undef CAREFUL_ALIGNMENT /* we know that the x86 can handle misalignment and has the "right" byteorder */ #ifdef __i386__ #define CAREFUL_ALIGNMENT 0 #endif #ifndef CAREFUL_ALIGNMENT #define CAREFUL_ALIGNMENT 1 #endif #define CVAL(buf,pos) (((unsigned char *)(buf))[pos]) #define PVAL(buf,pos) ((unsigned)CVAL(buf,pos)) #define SCVAL(buf,pos,val) (CVAL(buf,pos) = (val)) #if CAREFUL_ALIGNMENT #define SVAL(buf,pos) (PVAL(buf,pos)|PVAL(buf,(pos)+1)<<8) #define IVAL(buf,pos) (SVAL(buf,pos)|SVAL(buf,(pos)+2)<<16) #define SSVALX(buf,pos,val) (CVAL(buf,pos)=(val)&0xFF,CVAL(buf,pos+1)=(val)>>8) #define SIVALX(buf,pos,val) (SSVALX(buf,pos,val&0xFFFF),SSVALX(buf,pos+2,val>>16)) #define SIVAL(buf,pos,val) SIVALX((buf),(pos),((uint32)(val))) #else /* this handles things for architectures like the 386 that can handle alignment errors */ /* WARNING: This section is dependent on the length of int32 being correct. set CAREFUL_ALIGNMENT if it is not. */ #define IVAL(buf,pos) (*(uint32 *)((char *)(buf) + (pos))) #define SIVAL(buf,pos,val) IVAL(buf,pos)=((uint32)(val)) #endif File-RsyncP-0.74/FileList/Changes0000444000076500000240000000505512456605524015531 0ustar craigstaffRevision history for Perl module File::RsyncP::FileList. 0.74 Sat Jan 17 16:50:43 PST 2015 - updated FileList/config.guess FileList/config.sub with more recent versions from rsync. - slight tweaks to FileList/t/exclude.t FileList/t/fileList.t. - Updated license in headers. 0.72 Sun Jan 11 13:52:23 PST 2015 - in FileList/flist.c, wrapped strlcpy() definition with #ifndef HAVE_STRLCPY / #endif. Report and patch by Ryan Schmidt. - in FileList/flist.c, fixed minor typecast in read_buf(). 0.70 Sat Jul 24 22:45:21 PDT 2010 - removed unused pool_stats() function - removed TYPE_SOCKLEN_T from ./configure - changed type of len in getHashString() to STRLEN 0.66 Sun Oct 29 10:15:15 PST 2006 - Applied patches from Mark Weaver to handle skipping duplicate file names. - Added snprintf.c to handle solaris configure failures. 0.64 Sun Jul 30 19:31:45 PDT 2006 - Fixed some compiler warnings and verbose declaration reported by Guillaume Filion and Rodrigo Real. 0.62 Sun Jul 9 11:18:32 PDT 2006 - Complete rewrite based on rsync 2.6.3. 0.51 Sun May 9 23:42:56 PDT 2004 - No changes. 0.50 Sat Mar 20 18:19:50 PST 2004 - Added flag set/get functions to new doPartial option. 0.47 Sun Mar 14 21:37:22 PST 2004 - Changed FileList/FileList.xs so that uid, gid, mode and mtime are forced to be unsigned. This fixes a problem new to 0.46 that was introduced when newSVuv was replaced with newSVnv to back port to 5.005_03. 0.46 Sun Feb 8 18:11:30 PST 2004 - No changes. 0.45 Sat Feb 7 15:37:51 PST 2004 - Patch from Marlin Prowell for FileList/flist.c that solves a subtle file list corruption problem. In particular, f->lastdir was being set too early in receive_file_entry(), potentially before it returned to fetch more data and restart. - Patches from Lars Thegler to back port to perl 5.005_03. 0.44 Wed Jul 23 21:31:18 PDT 2003 - Fixes to FileList for large file support. 0.43 Sun Jul 20 00:03:40 PDT 2003 - Changed file length, dev and inode to double. 0.42 Sat Jul 12 09:53:40 PDT 2003 - Cleanup for gcc -Wall and removed some unneeded declarations that caused compile errors on certain debian platforms. 0.41 Sat May 10 20:39:33 PDT 2003 - Removed inline function in flist.h 0.40 Sat May 10 11:51:58 PDT 2003 - No changes. 0.31 Sun Feb 23 15:17:05 PST 2003 - No changes. 0.30 Sun Feb 9 23:06:42 PST 2003 - No changes. 0.20 Fri Jan 17 22:21:54 PST 2003 - changed fname argument to encode() to name. 0.10 Fri Dec 20 17:25:21 PST 2002 - Initial version File-RsyncP-0.74/FileList/config.guess0000555000076500000240000012626010522250565016551 0ustar craigstaff#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. timestamp='2006-07-02' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # 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. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; x86:Interix*:[3456]*) echo i586-pc-interix${UNAME_RELEASE} exit ;; EM64T:Interix*:[3456]*) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^LIBC/{ s: ::g p }'`" test x"${LIBC}" != x && { echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit } test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: File-RsyncP-0.74/FileList/config.h.in0000444000076500000240000002602111423121572016242 0ustar craigstaff/* config.h.in. Generated from configure.in by autoheader. */ /* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP systems. This function is required for `alloca.c' support on those systems. */ #undef CRAY_STACKSEG_END /* Define to 1 if using `alloca.c'. */ #undef C_ALLOCA /* Define to the type of elements in the array set by `getgroups'. Usually this is either `int' or `gid_t'. */ #undef GETGROUPS_T /* Define to 1 if you have `alloca', as a function or macro. */ #undef HAVE_ALLOCA /* Define to 1 if you have and it should be used (not on Ultrix). */ #undef HAVE_ALLOCA_H /* Define to 1 if you have the header file. */ #undef HAVE_ARPA_INET_H /* Define to 1 if you have the header file. */ #undef HAVE_ARPA_NAMESER_H /* Define to 1 if you have the `asprintf' function. */ #undef HAVE_ASPRINTF /* */ #undef HAVE_BROKEN_READDIR /* */ #undef HAVE_C99_VSNPRINTF /* Define to 1 if you have the `chmod' function. */ #undef HAVE_CHMOD /* Define to 1 if you have the `chown' function. */ #undef HAVE_CHOWN /* Define to 1 if you have the header file. */ #undef HAVE_COMPAT_H /* */ #undef HAVE_CONNECT /* Define to 1 if you have the header file. */ #undef HAVE_CTYPE_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_DIRENT_H /* */ #undef HAVE_ERRNO_DECL /* Define to 1 if you have the `fchmod' function. */ #undef HAVE_FCHMOD /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the header file. */ #undef HAVE_FLOAT_H /* Define to 1 if you have the `fstat' function. */ #undef HAVE_FSTAT /* Define to 1 if you have the `ftruncate' function. */ #undef HAVE_FTRUNCATE /* Define if you have the `getaddrinfo' function. */ #undef HAVE_GETADDRINFO /* Define to 1 if you have the `getcwd' function. */ #undef HAVE_GETCWD /* Define to 1 if you have the `getegid' function. */ #undef HAVE_GETEGID /* Define to 1 if you have the `geteuid' function. */ #undef HAVE_GETEUID /* Define to 1 if you have the `getgroups' function. */ #undef HAVE_GETGROUPS /* Define to 1 if you have the `getnameinfo' function. */ #undef HAVE_GETNAMEINFO /* */ #undef HAVE_GETTIMEOFDAY_TZ /* Define to 1 if you have the `glob' function. */ #undef HAVE_GLOB /* Define to 1 if you have the header file. */ #undef HAVE_GLOB_H /* Define to 1 if you have the header file. */ #undef HAVE_GRP_H /* Define to 1 if you have the `inet_ntop' function. */ #undef HAVE_INET_NTOP /* Define to 1 if you have the `inet_pton' function. */ #undef HAVE_INET_PTON /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the `lchown' function. */ #undef HAVE_LCHOWN /* Define to 1 if you have the `inet' library (-linet). */ #undef HAVE_LIBINET /* Define to 1 if you have the `nsl' library (-lnsl). */ #undef HAVE_LIBNSL /* Define to 1 if you have the `nsl_s' library (-lnsl_s). */ #undef HAVE_LIBNSL_S /* Define to 1 if you have the `popt' library (-lpopt). */ #undef HAVE_LIBPOPT /* Define to 1 if you have the `resolv' library (-lresolv). */ #undef HAVE_LIBRESOLV /* Define to 1 if you have the `socket' library (-lsocket). */ #undef HAVE_LIBSOCKET /* Define to 1 if you have the `link' function. */ #undef HAVE_LINK /* */ #undef HAVE_LONGLONG /* Define to 1 if you have the `mallinfo' function. */ #undef HAVE_MALLINFO /* Define to 1 if you have the header file. */ #undef HAVE_MALLOC_H /* Define to 1 if you have the header file. */ #undef HAVE_MCHECK_H /* Define to 1 if you have the `memmove' function. */ #undef HAVE_MEMMOVE /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `mkfifo' function. */ #undef HAVE_MKFIFO /* Define to 1 if you have the `mknod' function. */ #undef HAVE_MKNOD /* Define to 1 if you have the `mkstemp64' function. */ #undef HAVE_MKSTEMP64 /* Define to 1 if you have the `mtrace' function. */ #undef HAVE_MTRACE /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_NETDB_H /* */ #undef HAVE_OFF64_T /* Define to 1 if you have the `open64' function. */ #undef HAVE_OPEN64 /* Define to 1 if you have the `readlink' function. */ #undef HAVE_READLINK /* remote shell is remsh not rsh */ #undef HAVE_REMSH /* */ #undef HAVE_SECURE_MKSTEMP /* Define to 1 if you have the `setgroups' function. */ #undef HAVE_SETGROUPS /* Define to 1 if you have the `setsid' function. */ #undef HAVE_SETSID /* */ #undef HAVE_SHORT_INO_T /* Define to 1 if you have the `snprintf' function. */ #undef HAVE_SNPRINTF /* Do we have sockaddr_in6.sin6_scope_id? */ #undef HAVE_SOCKADDR_IN6_SCOPE_ID /* Do we have sockaddr_in.sin_len? */ #undef HAVE_SOCKADDR_IN_LEN /* Do we have sockaddr.sa_len? */ #undef HAVE_SOCKADDR_LEN /* Define if you have strct sockaddr_storage. */ #undef HAVE_SOCKADDR_STORAGE /* */ #undef HAVE_SOCKETPAIR /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strcasecmp' function. */ #undef HAVE_STRCASECMP /* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR /* Define to 1 if you have the `strftime' function. */ #undef HAVE_STRFTIME /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strlcat' function. */ #undef HAVE_STRLCAT /* Define to 1 if you have the `strlcpy' function. */ #undef HAVE_STRLCPY /* Define to 1 if you have the `strpbrk' function. */ #undef HAVE_STRPBRK /* Define to 1 if you have the `strtol' function. */ #undef HAVE_STRTOL /* Define to 1 if `st_rdev' is member of `struct stat'. */ #undef HAVE_STRUCT_STAT_ST_RDEV /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_DIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_FCNTL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_FILIO_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_IOCTL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_MODE_H /* Define to 1 if you have the header file, and it defines `DIR'. */ #undef HAVE_SYS_NDIR_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SELECT_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_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_UNISTD_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_UN_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_WAIT_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* */ #undef HAVE_UNSIGNED_CHAR /* */ #undef HAVE_UTIMBUF /* Define to 1 if you have the `utime' function. */ #undef HAVE_UTIME /* Define to 1 if you have the `utimes' function. */ #undef HAVE_UTIMES /* Define to 1 if you have the header file. */ #undef HAVE_UTIME_H /* Define to 1 if `utime(file, NULL)' sets file's timestamp to the present. */ #undef HAVE_UTIME_NULL /* Define to 1 if you have the `vsnprintf' function. */ #undef HAVE_VSNPRINTF /* Define to 1 if you have the `wait4' function. */ #undef HAVE_WAIT4 /* Define to 1 if you have the `waitpid' function. */ #undef HAVE_WAITPID /* true if you have IPv6 */ #undef INET6 /* Define to 1 if `major', `minor', and `makedev' are declared in . */ #undef MAJOR_IN_MKDEV /* Define to 1 if `major', `minor', and `makedev' are declared in . */ #undef MAJOR_IN_SYSMACROS /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* */ #undef REPLACE_INET_ATON /* */ #undef REPLACE_INET_NTOA /* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE /* location of configuration file for rsync server */ #undef RSYNCD_SYSCONF /* location of rsync on remote machine */ #undef RSYNC_PATH /* default -e command */ #undef RSYNC_RSH /* rsync release version */ #undef RSYNC_VERSION /* Define if sockets need to be shutdown */ #undef SHUTDOWN_ALL_SOCKETS /* The size of a `int', as computed by sizeof. */ #undef SIZEOF_INT /* The size of a `long', as computed by sizeof. */ #undef SIZEOF_LONG /* The size of a `short', as computed by sizeof. */ #undef SIZEOF_SHORT /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ #undef STACK_DIRECTION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Define to 1 if you can safely include both and . */ #undef TIME_WITH_SYS_TIME /* Define to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel and VAX). */ #undef WORDS_BIGENDIAN /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS /* Define _GNU_SOURCE so that we get all necessary prototypes */ #undef _GNU_SOURCE /* Define for large files, on AIX-style hosts. */ #undef _LARGE_FILES /* 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 `unsigned' if does not define. */ #undef ino_t /* Define to `int' if does not define. */ #undef mode_t /* Define to `long' if does not define. */ #undef off_t /* Define to `int' if does not define. */ #undef pid_t /* Define to `unsigned' if does not define. */ #undef size_t /* type to use in place of socklen_t if not defined */ #undef socklen_t /* Define to `int' if doesn't define. */ #undef uid_t File-RsyncP-0.74/FileList/config.sub0000555000076500000240000007730010522250565016214 0ustar craigstaff#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. timestamp='2006-07-02' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # 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. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | mt \ | msp430 \ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa-* \ | ymp-* \ | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16c) basic_machine=cr16c-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: File-RsyncP-0.74/FileList/configure0000555000076500000240000112253411423121572016135 0ustar craigstaff#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.59. # # Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local ac_config_libobj_dir=. cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. # This variable seems obsolete. It should probably be removed, and # only ac_max_sed_lines should be used. : ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= # Factoring default headers for most tests. ac_includes_default="\ #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif #if HAVE_STRINGS_H # include #endif #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #if HAVE_UNISTD_H # 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 RSYNC_VERSION build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA HAVE_REMSH LIBOBJS ALLOCA OBJ_SAVE OBJ_RESTORE CC_SHOBJ_FLAG LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` case $ac_option in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute paths. for ac_var in exec_prefix prefix do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* | NONE | '' ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo $ac_var` case $ac_val in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi fi (cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 { (exit 1); exit 1; }; } srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` ac_env_build_alias_set=${build_alias+set} ac_env_build_alias_value=$build_alias ac_cv_env_build_alias_set=${build_alias+set} ac_cv_env_build_alias_value=$build_alias ac_env_host_alias_set=${host_alias+set} ac_env_host_alias_value=$host_alias ac_cv_env_host_alias_set=${host_alias+set} ac_cv_env_host_alias_value=$host_alias ac_env_target_alias_set=${target_alias+set} ac_env_target_alias_value=$target_alias ac_cv_env_target_alias_set=${target_alias+set} ac_cv_env_target_alias_value=$target_alias ac_env_CC_set=${CC+set} ac_env_CC_value=$CC ac_cv_env_CC_set=${CC+set} ac_cv_env_CC_value=$CC ac_env_CFLAGS_set=${CFLAGS+set} ac_env_CFLAGS_value=$CFLAGS ac_cv_env_CFLAGS_set=${CFLAGS+set} ac_cv_env_CFLAGS_value=$CFLAGS ac_env_LDFLAGS_set=${LDFLAGS+set} ac_env_LDFLAGS_value=$LDFLAGS ac_cv_env_LDFLAGS_set=${LDFLAGS+set} ac_cv_env_LDFLAGS_value=$LDFLAGS ac_env_CPPFLAGS_set=${CPPFLAGS+set} ac_env_CPPFLAGS_value=$CPPFLAGS ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} ac_cv_env_CPPFLAGS_value=$CPPFLAGS ac_env_CPP_set=${CPP+set} ac_env_CPP_value=$CPP ac_cv_env_CPP_set=${CPP+set} ac_cv_env_CPP_value=$CPP # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] _ACEOF cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --infodir=DIR info documentation [PREFIX/info] --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] --target=TARGET configure for building compilers for TARGET [HOST] _ACEOF fi if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-debug including debugging symbols and features (default yes) --enable-profile turn on CPU profiling (default no) --enable-maintainer-mode turn on extra debug features --disable-largefile omit support for large files --disable-ipv6 don't even try to use IPv6 Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-included-popt use bundled popt library, not from system --with-rsync-path=PATH set default --rsync-path to PATH (default: rsync) --with-rsyncd-conf=PATH set configuration file for rsync server to PATH (default: /etc/rsyncd.conf) --with-rsh=CMD set remote shell command to CMD (default: ssh) Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d $ac_dir || continue ac_builddir=. if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A "../" for each directory in $ac_dir_suffix. ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` else ac_dir_suffix= ac_top_builddir= fi case $srcdir in .) # No --srcdir option. We are building in place. ac_srcdir=. if test -z "$ac_top_builddir"; then ac_top_srcdir=. else ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ;; *) # Relative path. ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_builddir$srcdir ;; esac # Do not use `cd foo && pwd` to compute absolute paths, because # the directories may not exist. case `pwd` in .) ac_abs_builddir="$ac_dir";; *) case "$ac_dir" in .) ac_abs_builddir=`pwd`;; [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; *) ac_abs_builddir=`pwd`/"$ac_dir";; esac;; esac case $ac_abs_builddir in .) ac_abs_top_builddir=${ac_top_builddir}.;; *) case ${ac_top_builddir}. in .) ac_abs_top_builddir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; esac;; esac case $ac_abs_builddir in .) ac_abs_srcdir=$ac_srcdir;; *) case $ac_srcdir in .) ac_abs_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; esac;; esac case $ac_abs_builddir in .) ac_abs_top_srcdir=$ac_top_srcdir;; *) case $ac_top_srcdir in .) ac_abs_top_srcdir=$ac_abs_builddir;; [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; esac;; esac cd $ac_dir # Check for guested configure; otherwise get Cygnus style configure. if test -f $ac_srcdir/configure.gnu; then echo $SHELL $ac_srcdir/configure.gnu --help=recursive elif test -f $ac_srcdir/configure; then echo $SHELL $ac_srcdir/configure --help=recursive elif test -f $ac_srcdir/configure.ac || test -f $ac_srcdir/configure.in; then echo $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi cd $ac_popdir done fi test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit 0 fi exec 5>config.log cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ _ACEOF { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" # Get rid of the leading space. ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Be sure not to use single quotes in there, as some shells, # such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, { (set) 2>&1 | case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in *ac_space=\ *) sed -n \ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; *) sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------- ## ## Output files. ## ## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=$`echo $ac_var` echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 rm -f core *.core && rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo >confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:$LINENO: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in `(set) 2>&1 | sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val="\$ac_cv_env_${ac_var}_value" eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers config.h" RSYNC_VERSION=2.6.3 { echo "$as_me:$LINENO: Configuring File::RsyncP::FileList based on rsync $RSYNC_VERSION" >&5 echo "$as_me: Configuring File::RsyncP::FileList based on rsync $RSYNC_VERSION" >&6;} cat >>confdefs.h <<_ACEOF #define RSYNC_VERSION "$RSYNC_VERSION" _ACEOF LDFLAGS=${LDFLAGS-""} ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi ac_config_guess="$SHELL $ac_aux_dir/config.guess" ac_config_sub="$SHELL $ac_aux_dir/config.sub" ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Make sure we can run config.sub. $ac_config_sub sun4 >/dev/null 2>&1 || { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 echo "$as_me: error: cannot run $ac_config_sub" >&2;} { (exit 1); exit 1; }; } echo "$as_me:$LINENO: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6 if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_build_alias=$build_alias test -z "$ac_cv_build_alias" && ac_cv_build_alias=`$ac_config_guess` test -z "$ac_cv_build_alias" && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6 build=$ac_cv_build build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$as_me:$LINENO: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6 if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_host_alias=$host_alias test -z "$ac_cv_host_alias" && ac_cv_host_alias=$ac_cv_build_alias ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6 host=$ac_cv_host host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` echo "$as_me:$LINENO: checking target system type" >&5 echo $ECHO_N "checking target system type... $ECHO_C" >&6 if test "${ac_cv_target+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_target_alias=$target_alias test "x$ac_cv_target_alias" = "x" && ac_cv_target_alias=$ac_cv_host_alias ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:$LINENO: result: $ac_cv_target" >&5 echo "${ECHO_T}$ac_cv_target" >&6 target=$ac_cv_target target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` # The aliases save the names the user supplied, while $host etc. # will get canonicalized. test -n "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:$LINENO: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last # resort. # Be careful to initialize this variable, since it used to be cached. # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. ac_cv_exeext= # b.out is created by i960 compilers. for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; conftest.$ac_ext ) # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` # FIXME: I believe we export ac_cv_exeext for Libtool, # but it would be cool to find out if it's true. Does anybody # maintain Libtool? --akim. export ac_cv_exeext break;; * ) break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:$LINENO: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:$LINENO: checking for suffix of executables" >&5 echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT echo "$as_me:$LINENO: checking for suffix of object files" >&5 echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+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 () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ 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_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_prog_cc_g=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std1 is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std1. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext done rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:$LINENO: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # Some people use a C++ compiler to compile C. Since we use `exit', # in C++ we need to declare it. In case someone uses the same compiler # for both compiling C and C++ we need to have the C++ compiler decide # the declaration of exit, since it's the most demanding environment. cat >conftest.$ac_ext <<_ACEOF #ifndef __cplusplus choke me #endif _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ '' \ 'extern "C" void std::exit (int) throw (); using std::exit;' \ 'extern "C" void std::exit (int); using std::exit;' \ 'extern "C" void exit (int) throw ();' \ 'extern "C" void exit (int);' \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration #include int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 continue fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_declaration int main () { exit (42); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done rm -f conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h echo '#endif' >>confdefs.h fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu 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 # 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. */ #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 : 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_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); } >/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 : 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_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); } >/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 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 # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi done done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi echo "$as_me:$LINENO: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' cat >>confdefs.h <<\_ACEOF #define _GNU_SOURCE 1 _ACEOF if test "x$ac_cv_prog_cc_stdc" = xno then { echo "$as_me:$LINENO: WARNING: rsync requires an ANSI C compiler and you don't seem to have one" >&5 echo "$as_me: WARNING: rsync requires an ANSI C compiler and you don't seem to have one" >&2;} fi # We must decide this before testing the compiler. # Please allow this to default to yes, so that your users have more # chance of getting a useful stack trace if problems occur. echo "$as_me:$LINENO: checking whether to include debugging symbols" >&5 echo $ECHO_N "checking whether to include debugging symbols... $ECHO_C" >&6 # Check whether --enable-debug or --disable-debug was given. if test "${enable_debug+set}" = set; then enableval="$enable_debug" fi; if test x"$enable_debug" = x"no" then echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 CFLAGS=${CFLAGS-"-O"} else echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 # leave CFLAGS alone; AC_PROG_CC will try to include -g if it can fi # Check whether --enable-profile or --disable-profile was given. if test "${enable_profile+set}" = set; then enableval="$enable_profile" fi; if test x"$enable_profile" = xyes then CFLAGS="$CFLAGS -pg" fi # Specifically, this turns on panic_action handling. # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" fi; if test x"$enable_maintainer_mode" = xyes then CFLAGS="$CFLAGS -DMAINTAINER_MODE" fi # This is needed for our included version of popt. Kind of silly, but # I don't want our version too far out of sync. CFLAGS="$CFLAGS -DHAVE_CONFIG_H" # If GCC, turn on warnings. if test "x$GCC" = "xyes" then CFLAGS="$CFLAGS -Wall -W" fi # Check whether --with-included-popt or --without-included-popt was given. if test "${with_included_popt+set}" = set; then withval="$with_included_popt" fi; # Check whether --with-rsync-path or --without-rsync-path was given. if test "${with_rsync_path+set}" = set; then withval="$with_rsync_path" RSYNC_PATH="$with_rsync_path" else RSYNC_PATH="rsync" fi; cat >>confdefs.h <<_ACEOF #define RSYNC_PATH "$RSYNC_PATH" _ACEOF # Check whether --with-rsyncd-conf or --without-rsyncd-conf was given. if test "${with_rsyncd_conf+set}" = set; then withval="$with_rsyncd_conf" if test ! -z "$with_rsyncd_conf" ; then case $with_rsyncd_conf in yes|no) RSYNCD_SYSCONF="/etc/rsyncd.conf" ;; /*) RSYNCD_SYSCONF="$with_rsyncd_conf" ;; *) { { echo "$as_me:$LINENO: error: You must specify an absolute path to --with-rsyncd-conf=PATH" >&5 echo "$as_me: error: You must specify an absolute path to --with-rsyncd-conf=PATH" >&2;} { (exit 1); exit 1; }; } ;; esac else RSYNCD_SYSCONF="/etc/rsyncd.conf" fi else RSYNCD_SYSCONF="/etc/rsyncd.conf" fi; cat >>confdefs.h <<_ACEOF #define RSYNCD_SYSCONF "$RSYNCD_SYSCONF" _ACEOF # Check whether --with-rsh or --without-rsh was given. if test "${with_rsh+set}" = set; then withval="$with_rsh" fi; # Extract the first word of "remsh", so it can be a program name with args. set dummy remsh; 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_HAVE_REMSH+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$HAVE_REMSH"; then ac_cv_prog_HAVE_REMSH="$HAVE_REMSH" # 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_HAVE_REMSH="1" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done test -z "$ac_cv_prog_HAVE_REMSH" && ac_cv_prog_HAVE_REMSH="0" fi fi HAVE_REMSH=$ac_cv_prog_HAVE_REMSH if test -n "$HAVE_REMSH"; then echo "$as_me:$LINENO: result: $HAVE_REMSH" >&5 echo "${ECHO_T}$HAVE_REMSH" >&6 else echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi cat >>confdefs.h <<_ACEOF #define HAVE_REMSH $HAVE_REMSH _ACEOF if test x"$with_rsh" != x then RSYNC_RSH="$with_rsh" else RSYNC_RSH="ssh" fi cat >>confdefs.h <<_ACEOF #define RSYNC_RSH "$RSYNC_RSH" _ACEOF # arrgh. libc in the current debian stable screws up the largefile # stuff, getting byte range locking wrong echo "$as_me:$LINENO: checking for broken largefile support" >&5 echo $ECHO_N "checking for broken largefile support... $ECHO_C" >&6 if test "${rsync_cv_HAVE_BROKEN_LARGEFILE+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then rsync_cv_HAVE_BROKEN_LARGEFILE=cross else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #define _FILE_OFFSET_BITS 64 #include #include #include #include int main(void) { struct flock lock; int status; char tpl[32] = "/tmp/locktest.XXXXXX"; int fd = mkstemp(tpl); if (fd < 0) { strcpy(tpl, "conftest.dat"); fd = open(tpl, O_CREAT|O_RDWR, 0600); } lock.l_type = F_WRLCK; lock.l_whence = SEEK_SET; lock.l_start = 0; lock.l_len = 1; lock.l_pid = 0; fcntl(fd,F_SETLK,&lock); if (fork() == 0) { lock.l_start = 1; _exit(fcntl(fd,F_SETLK,&lock) == 0); } wait(&status); unlink(tpl); exit(WEXITSTATUS(status)); } _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 rsync_cv_HAVE_BROKEN_LARGEFILE=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 ) rsync_cv_HAVE_BROKEN_LARGEFILE=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: $rsync_cv_HAVE_BROKEN_LARGEFILE" >&5 echo "${ECHO_T}$rsync_cv_HAVE_BROKEN_LARGEFILE" >&6 if test x"$rsync_cv_HAVE_BROKEN_LARGEFILE" != x"yes"; then # 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 fi ipv6type=unknown ipv6lib=none ipv6trylibc=yes # Check whether --enable-ipv6 or --disable-ipv6 was given. if test "${enable_ipv6+set}" = set; then enableval="$enable_ipv6" fi; if test "x$enable_ipv6" != xno then echo "$as_me:$LINENO: checking ipv6 stack type" >&5 echo $ECHO_N "checking ipv6 stack type... $ECHO_C" >&6 for i in inria kame linux-glibc linux-inet6 toshiba v6d zeta; do case $i in inria) # http://www.kame.net/ cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifdef IPV6_INRIA_VERSION yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then ipv6type=$i; cat >>confdefs.h <<\_ACEOF #define INET6 1 _ACEOF fi rm -f conftest* ;; kame) # http://www.kame.net/ cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifdef __KAME__ yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then ipv6type=$i; cat >>confdefs.h <<\_ACEOF #define INET6 1 _ACEOF fi rm -f conftest* ;; linux-glibc) # http://www.v6.linux.or.jp/ cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #if defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then ipv6type=$i; cat >>confdefs.h <<\_ACEOF #define INET6 1 _ACEOF fi rm -f conftest* ;; linux-inet6) # http://www.v6.linux.or.jp/ if test -d /usr/inet6 -o -f /usr/inet6/lib/libinet6.a; then ipv6type=$i ipv6lib=inet6 ipv6libdir=/usr/inet6/lib ipv6trylibc=yes; cat >>confdefs.h <<\_ACEOF #define INET6 1 _ACEOF CFLAGS="-I/usr/inet6/include $CFLAGS" fi ;; toshiba) cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifdef _TOSHIBA_INET6 yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then ipv6type=$i; ipv6lib=inet6; ipv6libdir=/usr/local/v6/lib; cat >>confdefs.h <<\_ACEOF #define INET6 1 _ACEOF fi rm -f conftest* ;; v6d) cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifdef __V6D__ yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then ipv6type=$i; ipv6lib=v6; ipv6libdir=/usr/local/v6/lib; cat >>confdefs.h <<\_ACEOF #define INET6 1 _ACEOF fi rm -f conftest* ;; zeta) cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifdef _ZETA_MINAMI_INET6 yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then ipv6type=$i; ipv6lib=inet6; ipv6libdir=/usr/local/v6/lib; cat >>confdefs.h <<\_ACEOF #define INET6 1 _ACEOF fi rm -f conftest* ;; esac if test "$ipv6type" != "unknown"; then break fi done echo "$as_me:$LINENO: result: $ipv6type" >&5 echo "${ECHO_T}$ipv6type" >&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 inet6; 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 fi echo "$as_me:$LINENO: checking whether to call shutdown on all sockets" >&5 echo $ECHO_N "checking whether to call shutdown on all sockets... $ECHO_C" >&6 case $host_os in *cygwin* ) echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 cat >>confdefs.h <<\_ACEOF #define SHUTDOWN_ALL_SOCKETS 1 _ACEOF ;; * ) echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6;; esac echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 if test "${ac_cv_c_bigendian+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # See if sys/param.h defines the BYTE_ORDER macro. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN bogus endian macros #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 # It does; now see whether it defined to BIG_ENDIAN or not. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { #if BYTE_ORDER != BIG_ENDIAN not big endian #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_bigendian=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # It does not; compile a test program. if test "$cross_compiling" = yes; then # try to guess the endianness by grepping values into an object file ac_cv_c_bigendian=unknown cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } int main () { _ascii (); _ebcdic (); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then ac_cv_c_bigendian=yes fi if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else # finding both strings is unlikely to happen, but who knows? ac_cv_c_bigendian=unknown fi fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* Are we little or big endian? From Harbison&Steele. */ union { long l; char c[sizeof (long)]; } u; u.l = 1; exit (u.c[sizeof (long) - 1] == 1); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=no else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_bigendian=yes fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 echo "${ECHO_T}$ac_cv_c_bigendian" >&6 case $ac_cv_c_bigendian in yes) cat >>confdefs.h <<\_ACEOF #define WORDS_BIGENDIAN 1 _ACEOF ;; no) ;; *) { { echo "$as_me:$LINENO: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&5 echo "$as_me: error: unknown endianness presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} { (exit 1); exit 1; }; } ;; esac ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then 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 <$ac_hdr> int main () { if ((DIR *) 0) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$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_hdr" | $as_tr_cpp` 1 _ACEOF ac_header_dirent=$ac_hdr; break fi done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo "$as_me:$LINENO: checking for library containing opendir" >&5 echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 if test "${ac_cv_search_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS ac_cv_search_opendir=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir (); int main () { opendir (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_opendir="none required" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ac_cv_search_opendir" = no; then for ac_lib in dir; do LIBS="-l$ac_lib $ac_func_search_save_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir (); int main () { opendir (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_opendir="-l$ac_lib" break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done fi LIBS=$ac_func_search_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 echo "${ECHO_T}$ac_cv_search_opendir" >&6 if test "$ac_cv_search_opendir" != no; then test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" fi else echo "$as_me:$LINENO: checking for library containing opendir" >&5 echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6 if test "${ac_cv_search_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS ac_cv_search_opendir=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir (); int main () { opendir (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_opendir="none required" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test "$ac_cv_search_opendir" = no; then for ac_lib in x; do LIBS="-l$ac_lib $ac_func_search_save_LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char opendir (); int main () { opendir (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_search_opendir="-l$ac_lib" break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext done fi LIBS=$ac_func_search_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5 echo "${ECHO_T}$ac_cv_search_opendir" >&6 if test "$ac_cv_search_opendir" != no; then test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS" fi fi echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 if test "${ac_cv_header_time+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include int main () { if ((struct tm *) 0) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_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_time=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_time=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 echo "${ECHO_T}$ac_cv_header_time" >&6 if test $ac_cv_header_time = yes; then cat >>confdefs.h <<\_ACEOF #define TIME_WITH_SYS_TIME 1 _ACEOF fi echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5 echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6 if test "${ac_cv_header_sys_wait_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 #ifndef WEXITSTATUS # define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) #endif #ifndef WIFEXITED # define WIFEXITED(stat_val) (((stat_val) & 255) == 0) #endif int main () { int s; wait (&s); s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; ; 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_sys_wait_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_sys_wait_h=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 if test $ac_cv_header_sys_wait_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SYS_WAIT_H 1 _ACEOF fi echo "$as_me:$LINENO: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #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 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. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _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 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( 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 cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. 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. */ _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 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 _ACEOF fi done for ac_header in sys/fcntl.h sys/select.h fcntl.h sys/time.h sys/unistd.h \ unistd.h utime.h grp.h compat.h sys/param.h ctype.h sys/wait.h \ sys/ioctl.h sys/filio.h string.h stdlib.h sys/socket.h sys/mode.h \ sys/un.h glob.h mcheck.h arpa/inet.h arpa/nameser.h \ netdb.h malloc.h float.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 whether sys/types.h defines makedev" >&5 echo $ECHO_N "checking whether sys/types.h defines makedev... $ECHO_C" >&6 if test "${ac_cv_header_sys_types_h_makedev+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 () { return makedev(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 ac_cv_header_sys_types_h_makedev=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_sys_types_h_makedev=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_header_sys_types_h_makedev" >&5 echo "${ECHO_T}$ac_cv_header_sys_types_h_makedev" >&6 if test $ac_cv_header_sys_types_h_makedev = no; then if test "${ac_cv_header_sys_mkdev_h+set}" = set; then echo "$as_me:$LINENO: checking for sys/mkdev.h" >&5 echo $ECHO_N "checking for sys/mkdev.h... $ECHO_C" >&6 if test "${ac_cv_header_sys_mkdev_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_sys_mkdev_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_mkdev_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking sys/mkdev.h usability" >&5 echo $ECHO_N "checking sys/mkdev.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 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 sys/mkdev.h presence" >&5 echo $ECHO_N "checking sys/mkdev.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: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: sys/mkdev.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: sys/mkdev.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: sys/mkdev.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: sys/mkdev.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: sys/mkdev.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: sys/mkdev.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: sys/mkdev.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: sys/mkdev.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: sys/mkdev.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 sys/mkdev.h" >&5 echo $ECHO_N "checking for sys/mkdev.h... $ECHO_C" >&6 if test "${ac_cv_header_sys_mkdev_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_sys_mkdev_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_sys_mkdev_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_mkdev_h" >&6 fi if test $ac_cv_header_sys_mkdev_h = yes; then cat >>confdefs.h <<\_ACEOF #define MAJOR_IN_MKDEV 1 _ACEOF fi if test $ac_cv_header_sys_mkdev_h = no; then if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then echo "$as_me:$LINENO: checking for sys/sysmacros.h" >&5 echo $ECHO_N "checking for sys/sysmacros.h... $ECHO_C" >&6 if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysmacros_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_sysmacros_h" >&6 else # Is the header compilable? echo "$as_me:$LINENO: checking sys/sysmacros.h usability" >&5 echo $ECHO_N "checking sys/sysmacros.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 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 sys/sysmacros.h presence" >&5 echo $ECHO_N "checking sys/sysmacros.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: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: sys/sysmacros.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the compiler's result" >&5 echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: sys/sysmacros.h: present but cannot be compiled" >&2;} { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&5 echo "$as_me: WARNING: sys/sysmacros.h: check for missing prerequisite headers?" >&2;} { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: see the Autoconf documentation" >&5 echo "$as_me: WARNING: sys/sysmacros.h: see the Autoconf documentation" >&2;} { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: section \"Present But Cannot Be Compiled\"" >&5 echo "$as_me: WARNING: sys/sysmacros.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: sys/sysmacros.h: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: sys/sysmacros.h: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: sys/sysmacros.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 sys/sysmacros.h" >&5 echo $ECHO_N "checking for sys/sysmacros.h... $ECHO_C" >&6 if test "${ac_cv_header_sys_sysmacros_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_sys_sysmacros_h=$ac_header_preproc fi echo "$as_me:$LINENO: result: $ac_cv_header_sys_sysmacros_h" >&5 echo "${ECHO_T}$ac_cv_header_sys_sysmacros_h" >&6 fi if test $ac_cv_header_sys_sysmacros_h = yes; then cat >>confdefs.h <<\_ACEOF #define MAJOR_IN_SYSMACROS 1 _ACEOF fi fi fi echo "$as_me:$LINENO: checking for int" >&5 echo $ECHO_N "checking for int... $ECHO_C" >&6 if test "${ac_cv_type_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((int *) 0) return 0; if (sizeof (int)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_int=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_int=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_int" >&5 echo "${ECHO_T}$ac_cv_type_int" >&6 echo "$as_me:$LINENO: checking size of int" >&5 echo $ECHO_N "checking size of int... $ECHO_C" >&6 if test "${ac_cv_sizeof_int+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$ac_cv_type_int" = yes; then # The cast to unsigned long works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (int))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (int))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (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. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (int))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (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 ?*) ac_cv_sizeof_int=$ac_lo;; '') { { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (int), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } ;; esac else if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default long longval () { return (long) (sizeof (int)); } unsigned long ulongval () { return (long) (sizeof (int)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) exit (1); if (((long) (sizeof (int))) < 0) { long i = longval (); if (i != ((long) (sizeof (int)))) exit (1); fprintf (f, "%ld\n", i); } else { unsigned long i = ulongval (); if (i != ((long) (sizeof (int)))) exit (1); fprintf (f, "%lu\n", i); } exit (ferror (f) || fclose (f) != 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_int=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) { { echo "$as_me:$LINENO: error: cannot compute sizeof (int), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (int), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val else ac_cv_sizeof_int=0 fi fi echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5 echo "${ECHO_T}$ac_cv_sizeof_int" >&6 cat >>confdefs.h <<_ACEOF #define SIZEOF_INT $ac_cv_sizeof_int _ACEOF echo "$as_me:$LINENO: checking for long" >&5 echo $ECHO_N "checking for long... $ECHO_C" >&6 if test "${ac_cv_type_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((long *) 0) return 0; if (sizeof (long)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_long=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 echo "${ECHO_T}$ac_cv_type_long" >&6 echo "$as_me:$LINENO: checking size of long" >&5 echo $ECHO_N "checking size of long... $ECHO_C" >&6 if test "${ac_cv_sizeof_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$ac_cv_type_long" = yes; then # The cast to unsigned long works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_long=$ac_lo;; '') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (long), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } ;; esac else if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default long longval () { return (long) (sizeof (long)); } unsigned long ulongval () { return (long) (sizeof (long)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) exit (1); if (((long) (sizeof (long))) < 0) { long i = longval (); if (i != ((long) (sizeof (long)))) exit (1); fprintf (f, "%ld\n", i); } else { unsigned long i = ulongval (); if (i != ((long) (sizeof (long)))) exit (1); fprintf (f, "%lu\n", i); } exit (ferror (f) || fclose (f) != 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_long=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (long), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val else ac_cv_sizeof_long=0 fi fi echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 echo "${ECHO_T}$ac_cv_sizeof_long" >&6 cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF echo "$as_me:$LINENO: checking for short" >&5 echo $ECHO_N "checking for short... $ECHO_C" >&6 if test "${ac_cv_type_short+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((short *) 0) return 0; if (sizeof (short)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_short=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_short=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_short" >&5 echo "${ECHO_T}$ac_cv_type_short" >&6 echo "$as_me:$LINENO: checking size of short" >&5 echo $ECHO_N "checking size of short... $ECHO_C" >&6 if test "${ac_cv_sizeof_short+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$ac_cv_type_short" = yes; then # The cast to unsigned long works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (short))) >= 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (short))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (short))) < 0)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (short))) >= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi ac_mid=`expr 2 '*' $ac_mid` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(((long) (sizeof (short))) <= $ac_mid)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_short=$ac_lo;; '') { { echo "$as_me:$LINENO: error: cannot compute sizeof (short), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (short), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } ;; esac else if test "$cross_compiling" = yes; then { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default long longval () { return (long) (sizeof (short)); } unsigned long ulongval () { return (long) (sizeof (short)); } #include #include int main () { FILE *f = fopen ("conftest.val", "w"); if (! f) exit (1); if (((long) (sizeof (short))) < 0) { long i = longval (); if (i != ((long) (sizeof (short)))) exit (1); fprintf (f, "%ld\n", i); } else { unsigned long i = ulongval (); if (i != ((long) (sizeof (short)))) exit (1); fprintf (f, "%lu\n", i); } exit (ferror (f) || fclose (f) != 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_short=`cat conftest.val` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) { { echo "$as_me:$LINENO: error: cannot compute sizeof (short), 77 See \`config.log' for more details." >&5 echo "$as_me: error: cannot compute sizeof (short), 77 See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi rm -f conftest.val else ac_cv_sizeof_short=0 fi fi echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5 echo "${ECHO_T}$ac_cv_sizeof_short" >&6 cat >>confdefs.h <<_ACEOF #define SIZEOF_SHORT $ac_cv_sizeof_short _ACEOF 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 case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac echo "$as_me:$LINENO: checking return type of signal handlers" >&5 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6 if test "${ac_cv_type_signal+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #ifdef signal # undef signal #endif #ifdef __cplusplus extern "C" void (*signal (int, void (*)(int)))(int); #else void (*signal ()) (); #endif int main () { int i; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_signal=void else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_signal=int fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 echo "${ECHO_T}$ac_cv_type_signal" >&6 cat >>confdefs.h <<_ACEOF #define RETSIGTYPE $ac_cv_type_signal _ACEOF echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5 echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6 if test "${ac_cv_type_uid_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* 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 "uid_t" >/dev/null 2>&1; then ac_cv_type_uid_t=yes else ac_cv_type_uid_t=no fi rm -f conftest* fi echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5 echo "${ECHO_T}$ac_cv_type_uid_t" >&6 if test $ac_cv_type_uid_t = no; then cat >>confdefs.h <<\_ACEOF #define uid_t int _ACEOF cat >>confdefs.h <<\_ACEOF #define gid_t int _ACEOF fi echo "$as_me:$LINENO: checking for mode_t" >&5 echo $ECHO_N "checking for mode_t... $ECHO_C" >&6 if test "${ac_cv_type_mode_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 ((mode_t *) 0) return 0; if (sizeof (mode_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_mode_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_mode_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5 echo "${ECHO_T}$ac_cv_type_mode_t" >&6 if test $ac_cv_type_mode_t = yes; then : else cat >>confdefs.h <<_ACEOF #define mode_t int _ACEOF fi echo "$as_me:$LINENO: checking for off_t" >&5 echo $ECHO_N "checking for off_t... $ECHO_C" >&6 if test "${ac_cv_type_off_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((off_t *) 0) return 0; if (sizeof (off_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_off_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_off_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 echo "${ECHO_T}$ac_cv_type_off_t" >&6 if test $ac_cv_type_off_t = yes; then : else cat >>confdefs.h <<_ACEOF #define off_t long _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 pid_t" >&5 echo $ECHO_N "checking for pid_t... $ECHO_C" >&6 if test "${ac_cv_type_pid_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if ((pid_t *) 0) return 0; if (sizeof (pid_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest.$ac_objext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_pid_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_pid_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5 echo "${ECHO_T}$ac_cv_type_pid_t" >&6 if test $ac_cv_type_pid_t = yes; then : else cat >>confdefs.h <<_ACEOF #define pid_t int _ACEOF fi echo "$as_me:$LINENO: checking type of array argument to getgroups" >&5 echo $ECHO_N "checking type of array argument to getgroups... $ECHO_C" >&6 if test "${ac_cv_type_getgroups+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_type_getgroups=cross else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Thanks to Mike Rendell for this test. */ #include #define NGID 256 #undef MAX #define MAX(x, y) ((x) > (y) ? (x) : (y)) int main () { gid_t gidset[NGID]; int i, n; union { gid_t gval; long lval; } val; val.lval = -1; for (i = 0; i < NGID; i++) gidset[i] = val.gval; n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1, gidset); /* Exit non-zero if getgroups seems to require an array of ints. This happens when gid_t is short but getgroups modifies an array of ints. */ exit ((n > 0 && gidset[n] != val.gval) ? 1 : 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_getgroups=gid_t 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_getgroups=int fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi if test $ac_cv_type_getgroups = cross; 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 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "getgroups.*int.*gid_t" >/dev/null 2>&1; then ac_cv_type_getgroups=gid_t else ac_cv_type_getgroups=int fi rm -f conftest* fi fi echo "$as_me:$LINENO: result: $ac_cv_type_getgroups" >&5 echo "${ECHO_T}$ac_cv_type_getgroups" >&6 cat >>confdefs.h <<_ACEOF #define GETGROUPS_T $ac_cv_type_getgroups _ACEOF echo "$as_me:$LINENO: checking for struct stat.st_rdev" >&5 echo $ECHO_N "checking for struct stat.st_rdev... $ECHO_C" >&6 if test "${ac_cv_member_struct_stat_st_rdev+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 () { static struct stat ac_aggr; if (ac_aggr.st_rdev) 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_member_struct_stat_st_rdev=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static struct stat ac_aggr; if (sizeof ac_aggr.st_rdev) 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_member_struct_stat_st_rdev=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_stat_st_rdev=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_rdev" >&5 echo "${ECHO_T}$ac_cv_member_struct_stat_st_rdev" >&6 if test $ac_cv_member_struct_stat_st_rdev = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_STAT_ST_RDEV 1 _ACEOF fi echo "$as_me:$LINENO: checking for ino_t" >&5 echo $ECHO_N "checking for ino_t... $ECHO_C" >&6 if test "${ac_cv_type_ino_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 ((ino_t *) 0) return 0; if (sizeof (ino_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_ino_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_ino_t=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_type_ino_t" >&5 echo "${ECHO_T}$ac_cv_type_ino_t" >&6 if test $ac_cv_type_ino_t = yes; then : else cat >>confdefs.h <<_ACEOF #define ino_t unsigned _ACEOF fi echo "$as_me:$LINENO: checking for errno in errno.h" >&5 echo $ECHO_N "checking for errno in errno.h... $ECHO_C" >&6 if test "${rsync_cv_errno+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 () { int i = errno ; 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 rsync_cv_errno=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 rsync_cv_have_errno_decl=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $rsync_cv_errno" >&5 echo "${ECHO_T}$rsync_cv_errno" >&6 if test x"$rsync_cv_errno" = x"yes"; then cat >>confdefs.h <<\_ACEOF #define HAVE_ERRNO_DECL 1 _ACEOF fi # The following test taken from the cvs sources # If we can't find connect, try looking in -lsocket, -lnsl, and -linet. # These need checks to be before checks for any other functions that # might be in the same libraries. # The Irix 5 libc.so has connect and gethostbyname, but Irix 5 also has # libsocket.so which has a bad implementation of gethostbyname (it # only looks in /etc/hosts), so we only look for -lsocket if we need # it. for ac_func in connect do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $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 if test x"$ac_cv_func_connect" = x"no"; then case "$LIBS" in *-lnsl*) ;; *) echo "$as_me:$LINENO: checking for printf in -lnsl_s" >&5 echo $ECHO_N "checking for printf in -lnsl_s... $ECHO_C" >&6 if test "${ac_cv_lib_nsl_s_printf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl_s $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 printf (); int main () { printf (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_nsl_s_printf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nsl_s_printf=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_s_printf" >&5 echo "${ECHO_T}$ac_cv_lib_nsl_s_printf" >&6 if test $ac_cv_lib_nsl_s_printf = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBNSL_S 1 _ACEOF LIBS="-lnsl_s $LIBS" fi ;; esac case "$LIBS" in *-lnsl*) ;; *) echo "$as_me:$LINENO: checking for printf in -lnsl" >&5 echo $ECHO_N "checking for printf in -lnsl... $ECHO_C" >&6 if test "${ac_cv_lib_nsl_printf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* 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 printf (); int main () { printf (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_nsl_printf=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nsl_printf=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_printf" >&5 echo "${ECHO_T}$ac_cv_lib_nsl_printf" >&6 if test $ac_cv_lib_nsl_printf = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBNSL 1 _ACEOF LIBS="-lnsl $LIBS" fi ;; esac case "$LIBS" in *-lsocket*) ;; *) echo "$as_me:$LINENO: checking for connect in -lsocket" >&5 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6 if test "${ac_cv_lib_socket_connect+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* 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 connect (); int main () { connect (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_socket_connect=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_connect=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6 if test $ac_cv_lib_socket_connect = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBSOCKET 1 _ACEOF LIBS="-lsocket $LIBS" fi ;; esac case "$LIBS" in *-linet*) ;; *) echo "$as_me:$LINENO: checking for connect in -linet" >&5 echo $ECHO_N "checking for connect in -linet... $ECHO_C" >&6 if test "${ac_cv_lib_inet_connect+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-linet $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 connect (); int main () { connect (); ; return 0; } _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_inet_connect=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_inet_connect=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_inet_connect" >&5 echo "${ECHO_T}$ac_cv_lib_inet_connect" >&6 if test $ac_cv_lib_inet_connect = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBINET 1 _ACEOF LIBS="-linet $LIBS" fi ;; esac if test x"$ac_cv_lib_socket_connect" = x"yes" || test x"$ac_cv_lib_inet_connect" = x"yes"; then # ac_cv_func_connect=yes # don't! it would cause AC_CHECK_FUNC to succeed next time configure is run cat >>confdefs.h <<\_ACEOF #define HAVE_CONNECT 1 _ACEOF fi fi echo "$as_me:$LINENO: checking for inet_ntop in -lresolv" >&5 echo $ECHO_N "checking for inet_ntop in -lresolv... $ECHO_C" >&6 if test "${ac_cv_lib_resolv_inet_ntop+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lresolv $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* 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 inet_ntop (); int main () { inet_ntop (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_resolv_inet_ntop=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_resolv_inet_ntop=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_inet_ntop" >&5 echo "${ECHO_T}$ac_cv_lib_resolv_inet_ntop" >&6 if test $ac_cv_lib_resolv_inet_ntop = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBRESOLV 1 _ACEOF LIBS="-lresolv $LIBS" 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 case $LIBOBJS in "lib/inet_ntop.$ac_objext" | \ *" lib/inet_ntop.$ac_objext" | \ "lib/inet_ntop.$ac_objext "* | \ *" lib/inet_ntop.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS lib/inet_ntop.$ac_objext" ;; esac fi done for ac_func in inet_pton 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 "lib/inet_pton.$ac_objext" | \ *" lib/inet_pton.$ac_objext" | \ "lib/inet_pton.$ac_objext "* | \ *" lib/inet_pton.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS lib/inet_pton.$ac_objext" ;; esac fi done # Irix 6.5 has getaddrinfo but not the corresponding defines, so use # builtin getaddrinfo if one of the defines don't exist echo "$as_me:$LINENO: checking whether defines needed by getaddrinfo exist" >&5 echo $ECHO_N "checking whether defines needed by getaddrinfo exist... $ECHO_C" >&6 if test "${rsync_cv_HAVE_GETADDR_DEFINES+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 #include #ifdef AI_PASSIVE yes #endif _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "yes" >/dev/null 2>&1; then rsync_cv_HAVE_GETADDR_DEFINES=yes else rsync_cv_HAVE_GETADDR_DEFINES=no fi rm -f conftest* fi echo "$as_me:$LINENO: result: $rsync_cv_HAVE_GETADDR_DEFINES" >&5 echo "${ECHO_T}$rsync_cv_HAVE_GETADDR_DEFINES" >&6 if test x"$rsync_cv_HAVE_GETADDR_DEFINES" = x"yes"; then # Tru64 UNIX has getaddrinfo() but has it renamed in libc as # something else so we must include to get the # redefinition. 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 by including " >&5 echo $ECHO_N "checking for getaddrinfo by including ... $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 #include #include int main () { getaddrinfo(NULL, NULL, NULL, NULL); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 cat >>confdefs.h <<\_ACEOF #define HAVE_GETADDRINFO 1 _ACEOF else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 case $LIBOBJS in "lib/getaddrinfo.$ac_objext" | \ *" lib/getaddrinfo.$ac_objext" | \ "lib/getaddrinfo.$ac_objext "* | \ *" lib/getaddrinfo.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS lib/getaddrinfo.$ac_objext" ;; esac fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi done for ac_func in getnameinfo 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 "lib/getnameinfo.$ac_objext" | \ *" lib/getnameinfo.$ac_objext" | \ "lib/getnameinfo.$ac_objext "* | \ *" lib/getnameinfo.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS lib/getnameinfo.$ac_objext" ;; esac fi done else case $LIBOBJS in "lib/getaddrinfo.$ac_objext" | \ *" lib/getaddrinfo.$ac_objext" | \ "lib/getaddrinfo.$ac_objext "* | \ *" lib/getaddrinfo.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS lib/getaddrinfo.$ac_objext" ;; esac case $LIBOBJS in "lib/getnameinfo.$ac_objext" | \ *" lib/getnameinfo.$ac_objext" | \ "lib/getnameinfo.$ac_objext "* | \ *" lib/getnameinfo.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS lib/getnameinfo.$ac_objext" ;; esac fi echo "$as_me:$LINENO: checking for struct sockaddr.sa_len" >&5 echo $ECHO_N "checking for struct sockaddr.sa_len... $ECHO_C" >&6 if test "${ac_cv_member_struct_sockaddr_sa_len+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 () { static struct sockaddr ac_aggr; if (ac_aggr.sa_len) 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_member_struct_sockaddr_sa_len=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { static struct sockaddr ac_aggr; if (sizeof ac_aggr.sa_len) 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_member_struct_sockaddr_sa_len=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_sockaddr_sa_len=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_member_struct_sockaddr_sa_len" >&5 echo "${ECHO_T}$ac_cv_member_struct_sockaddr_sa_len" >&6 if test $ac_cv_member_struct_sockaddr_sa_len = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SOCKADDR_LEN 1 _ACEOF fi echo "$as_me:$LINENO: checking for struct sockaddr_in.sin_len" >&5 echo $ECHO_N "checking for struct sockaddr_in.sin_len... $ECHO_C" >&6 if test "${ac_cv_member_struct_sockaddr_in_sin_len+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 #include int main () { static struct sockaddr_in ac_aggr; if (ac_aggr.sin_len) 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_member_struct_sockaddr_in_sin_len=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include int main () { static struct sockaddr_in ac_aggr; if (sizeof ac_aggr.sin_len) 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_member_struct_sockaddr_in_sin_len=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_sockaddr_in_sin_len=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_member_struct_sockaddr_in_sin_len" >&5 echo "${ECHO_T}$ac_cv_member_struct_sockaddr_in_sin_len" >&6 if test $ac_cv_member_struct_sockaddr_in_sin_len = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SOCKADDR_IN_LEN 1 _ACEOF fi echo "$as_me:$LINENO: checking struct sockaddr_storage" >&5 echo $ECHO_N "checking struct sockaddr_storage... $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 #include int main () { struct sockaddr_storage 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 echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6 cat >>confdefs.h <<\_ACEOF #define HAVE_SOCKADDR_STORAGE 1 _ACEOF else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6 fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext echo "$as_me:$LINENO: checking for struct sockaddr_in6.sin6_scope_id" >&5 echo $ECHO_N "checking for struct sockaddr_in6.sin6_scope_id... $ECHO_C" >&6 if test "${ac_cv_member_struct_sockaddr_in6_sin6_scope_id+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 #include int main () { static struct sockaddr_in6 ac_aggr; if (ac_aggr.sin6_scope_id) 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_member_struct_sockaddr_in6_sin6_scope_id=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include int main () { static struct sockaddr_in6 ac_aggr; if (sizeof ac_aggr.sin6_scope_id) 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_member_struct_sockaddr_in6_sin6_scope_id=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_member_struct_sockaddr_in6_sin6_scope_id=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_member_struct_sockaddr_in6_sin6_scope_id" >&5 echo "${ECHO_T}$ac_cv_member_struct_sockaddr_in6_sin6_scope_id" >&6 if test $ac_cv_member_struct_sockaddr_in6_sin6_scope_id = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_SOCKADDR_IN6_SCOPE_ID 1 _ACEOF fi # if we can't find strcasecmp, look in -lresolv (for Unixware at least) # 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 fi done if test x"$ac_cv_func_strcasecmp" = x"no"; then echo "$as_me:$LINENO: checking for strcasecmp in -lresolv" >&5 echo $ECHO_N "checking for strcasecmp in -lresolv... $ECHO_C" >&6 if test "${ac_cv_lib_resolv_strcasecmp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lresolv $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* 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 strcasecmp (); int main () { strcasecmp (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && { ac_try='test -s conftest$ac_exeext' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_resolv_strcasecmp=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_resolv_strcasecmp=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:$LINENO: result: $ac_cv_lib_resolv_strcasecmp" >&5 echo "${ECHO_T}$ac_cv_lib_resolv_strcasecmp" >&6 if test $ac_cv_lib_resolv_strcasecmp = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBRESOLV 1 _ACEOF LIBS="-lresolv $LIBS" fi fi echo "$as_me:$LINENO: checking whether utime accepts a null argument" >&5 echo $ECHO_N "checking whether utime accepts a null argument... $ECHO_C" >&6 if test "${ac_cv_func_utime_null+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else rm -f conftest.data; >conftest.data # Sequent interprets utime(file, 0) to mean use start of epoch. Wrong. if test "$cross_compiling" = yes; then ac_cv_func_utime_null=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 int main () { struct stat s, t; exit (!(stat ("conftest.data", &s) == 0 && utime ("conftest.data", (long *)0) == 0 && stat ("conftest.data", &t) == 0 && t.st_mtime >= s.st_mtime && t.st_mtime - s.st_mtime < 120)); ; 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_utime_null=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_utime_null=no fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f core *.core fi echo "$as_me:$LINENO: result: $ac_cv_func_utime_null" >&5 echo "${ECHO_T}$ac_cv_func_utime_null" >&6 if test $ac_cv_func_utime_null = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_UTIME_NULL 1 _ACEOF fi rm -f conftest.data # 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 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 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 HAVE_ALLOCA_H 1 _ACEOF fi echo "$as_me:$LINENO: checking for alloca" >&5 echo $ECHO_N "checking for alloca... $ECHO_C" >&6 if test "${ac_cv_func_alloca_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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 cat >>confdefs.h <<\_ACEOF #define HAVE_ALLOCA 1 _ACEOF else # The SVR3 libPW and SVR4 libucb both contain incompatible functions # that cause trouble. Some versions do not even contain alloca or # contain a buggy version. If you still want to use their alloca, # use ar to extract alloca.o from them instead of compiling alloca.c. ALLOCA=alloca.$ac_objext cat >>confdefs.h <<\_ACEOF #define C_ALLOCA 1 _ACEOF echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5 echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6 if test "${ac_cv_os_cray+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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 _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 /* 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 CRAY_STACKSEG_END $ac_func _ACEOF break fi done fi echo "$as_me:$LINENO: checking stack direction for C alloca" >&5 echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6 if test "${ac_cv_c_stack_direction+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then ac_cv_c_stack_direction=0 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int find_stack_direction () { static char *addr = 0; auto char dummy; if (addr == 0) { addr = &dummy; return find_stack_direction (); } else return (&dummy > addr) ? 1 : -1; } int main () { 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 ( 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 STACK_DIRECTION $ac_cv_c_stack_direction _ACEOF fi for ac_func in waitpid wait4 getcwd strdup strerror chown chmod mknod mkfifo \ fchmod fstat strchr readlink link utime utimes strftime mtrace ftruncate \ memmove lchown vsnprintf snprintf asprintf setsid glob strpbrk \ strlcat strlcpy strtol mallinfo getgroups setgroups geteuid getegid \ open64 mkstemp64 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 echo "$as_me:$LINENO: checking for working socketpair" >&5 echo $ECHO_N "checking for working socketpair... $ECHO_C" >&6 if test "${rsync_cv_HAVE_SOCKETPAIR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then rsync_cv_HAVE_SOCKETPAIR=cross 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 main() { int fd[2]; exit((socketpair(AF_UNIX, SOCK_STREAM, 0, fd) != -1) ? 0 : 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 rsync_cv_HAVE_SOCKETPAIR=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 ) rsync_cv_HAVE_SOCKETPAIR=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: $rsync_cv_HAVE_SOCKETPAIR" >&5 echo "${ECHO_T}$rsync_cv_HAVE_SOCKETPAIR" >&6 if test x"$rsync_cv_HAVE_SOCKETPAIR" = x"yes"; then cat >>confdefs.h <<\_ACEOF #define HAVE_SOCKETPAIR 1 _ACEOF fi echo "$as_me:$LINENO: checking for long long" >&5 echo $ECHO_N "checking for long long... $ECHO_C" >&6 if test "${rsync_cv_HAVE_LONGLONG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then rsync_cv_HAVE_LONGLONG=cross else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include main() { long long x = 1000000; x *= x; exit(((x/1000000) == 1000000)? 0: 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 rsync_cv_HAVE_LONGLONG=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 ) rsync_cv_HAVE_LONGLONG=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: $rsync_cv_HAVE_LONGLONG" >&5 echo "${ECHO_T}$rsync_cv_HAVE_LONGLONG" >&6 if test x"$rsync_cv_HAVE_LONGLONG" = x"yes"; then cat >>confdefs.h <<\_ACEOF #define HAVE_LONGLONG 1 _ACEOF fi echo "$as_me:$LINENO: checking for off64_t" >&5 echo $ECHO_N "checking for off64_t... $ECHO_C" >&6 if test "${rsync_cv_HAVE_OFF64_T+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then rsync_cv_HAVE_OFF64_T=cross 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 main() { struct stat64 st; off64_t s; if (sizeof(off_t) == sizeof(off64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0: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 rsync_cv_HAVE_OFF64_T=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 ) rsync_cv_HAVE_OFF64_T=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: $rsync_cv_HAVE_OFF64_T" >&5 echo "${ECHO_T}$rsync_cv_HAVE_OFF64_T" >&6 if test x"$rsync_cv_HAVE_OFF64_T" = x"yes"; then cat >>confdefs.h <<\_ACEOF #define HAVE_OFF64_T 1 _ACEOF fi echo "$as_me:$LINENO: checking for short ino_t" >&5 echo $ECHO_N "checking for short ino_t... $ECHO_C" >&6 if test "${rsync_cv_HAVE_SHORT_INO_T+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then rsync_cv_HAVE_SHORT_INO_T=cross 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 #include main() { if (sizeof(ino_t) < sizeof(unsigned int)) return 0; return 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 rsync_cv_HAVE_SHORT_INO_T=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 ) rsync_cv_HAVE_SHORT_INO_T=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: $rsync_cv_HAVE_SHORT_INO_T" >&5 echo "${ECHO_T}$rsync_cv_HAVE_SHORT_INO_T" >&6 if test x"$rsync_cv_HAVE_SHORT_INO_T" = x"yes"; then cat >>confdefs.h <<\_ACEOF #define HAVE_SHORT_INO_T 1 _ACEOF fi echo "$as_me:$LINENO: checking for unsigned char" >&5 echo $ECHO_N "checking for unsigned char... $ECHO_C" >&6 if test "${rsync_cv_HAVE_UNSIGNED_CHAR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then rsync_cv_HAVE_UNSIGNED_CHAR=cross else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include main() { char c; c=250; exit((c > 0)?0: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 rsync_cv_HAVE_UNSIGNED_CHAR=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 ) rsync_cv_HAVE_UNSIGNED_CHAR=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: $rsync_cv_HAVE_UNSIGNED_CHAR" >&5 echo "${ECHO_T}$rsync_cv_HAVE_UNSIGNED_CHAR" >&6 if test x"$rsync_cv_HAVE_UNSIGNED_CHAR" = x"yes"; then cat >>confdefs.h <<\_ACEOF #define HAVE_UNSIGNED_CHAR 1 _ACEOF fi echo "$as_me:$LINENO: checking for broken readdir" >&5 echo $ECHO_N "checking for broken readdir... $ECHO_C" >&6 if test "${rsync_cv_HAVE_BROKEN_READDIR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then rsync_cv_HAVE_BROKEN_READDIR=cross 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 main() { struct dirent *di; DIR *d = opendir("."); di = readdir(d); if (di && di->d_name[-2] == '.' && di->d_name[-1] == 0 && di->d_name[0] == 0) exit(0); exit(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 rsync_cv_HAVE_BROKEN_READDIR=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 ) rsync_cv_HAVE_BROKEN_READDIR=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: $rsync_cv_HAVE_BROKEN_READDIR" >&5 echo "${ECHO_T}$rsync_cv_HAVE_BROKEN_READDIR" >&6 if test x"$rsync_cv_HAVE_BROKEN_READDIR" = x"yes"; then cat >>confdefs.h <<\_ACEOF #define HAVE_BROKEN_READDIR 1 _ACEOF fi echo "$as_me:$LINENO: checking for utimbuf" >&5 echo $ECHO_N "checking for utimbuf... $ECHO_C" >&6 if test "${rsync_cv_HAVE_UTIMBUF+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 () { struct utimbuf tbuf; tbuf.actime = 0; tbuf.modtime = 1; exit(utime("foo.c",&tbuf)); ; 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 rsync_cv_HAVE_UTIMBUF=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 rsync_cv_HAVE_UTIMBUF=no fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $rsync_cv_HAVE_UTIMBUF" >&5 echo "${ECHO_T}$rsync_cv_HAVE_UTIMBUF" >&6 if test x"$rsync_cv_HAVE_UTIMBUF" = x"yes"; then cat >>confdefs.h <<\_ACEOF #define HAVE_UTIMBUF 1 _ACEOF fi echo "$as_me:$LINENO: checking if gettimeofday takes tz argument" >&5 echo $ECHO_N "checking if gettimeofday takes tz argument... $ECHO_C" >&6 if test "${rsync_cv_HAVE_GETTIMEOFDAY_TZ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then rsync_cv_HAVE_GETTIMEOFDAY_TZ=cross 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 main() { struct timeval tv; exit(gettimeofday(&tv, NULL));} _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 rsync_cv_HAVE_GETTIMEOFDAY_TZ=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 ) rsync_cv_HAVE_GETTIMEOFDAY_TZ=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: $rsync_cv_HAVE_GETTIMEOFDAY_TZ" >&5 echo "${ECHO_T}$rsync_cv_HAVE_GETTIMEOFDAY_TZ" >&6 if test x"$rsync_cv_HAVE_GETTIMEOFDAY_TZ" = x"yes"; then cat >>confdefs.h <<\_ACEOF #define HAVE_GETTIMEOFDAY_TZ 1 _ACEOF fi echo "$as_me:$LINENO: checking for C99 vsnprintf" >&5 echo $ECHO_N "checking for C99 vsnprintf... $ECHO_C" >&6 if test "${rsync_cv_HAVE_C99_VSNPRINTF+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then rsync_cv_HAVE_C99_VSNPRINTF=cross 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 void foo(const char *format, ...) { va_list ap; int len; char buf[5]; va_start(ap, format); len = vsnprintf(0, 0, format, ap); va_end(ap); if (len != 5) exit(1); if (snprintf(buf, 3, "hello") != 5 || strcmp(buf, "he") != 0) exit(1); exit(0); } main() { foo("hello"); } _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 rsync_cv_HAVE_C99_VSNPRINTF=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 ) rsync_cv_HAVE_C99_VSNPRINTF=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: $rsync_cv_HAVE_C99_VSNPRINTF" >&5 echo "${ECHO_T}$rsync_cv_HAVE_C99_VSNPRINTF" >&6 if test x"$rsync_cv_HAVE_C99_VSNPRINTF" = x"yes"; then cat >>confdefs.h <<\_ACEOF #define HAVE_C99_VSNPRINTF 1 _ACEOF fi echo "$as_me:$LINENO: checking for secure mkstemp" >&5 echo $ECHO_N "checking for secure mkstemp... $ECHO_C" >&6 if test "${rsync_cv_HAVE_SECURE_MKSTEMP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then rsync_cv_HAVE_SECURE_MKSTEMP=cross 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 #include #include main() { struct stat st; char tpl[20]="/tmp/test.XXXXXX"; int fd = mkstemp(tpl); if (fd == -1) exit(1); unlink(tpl); if (fstat(fd, &st) != 0) exit(1); if ((st.st_mode & 0777) != 0600) exit(1); 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 rsync_cv_HAVE_SECURE_MKSTEMP=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 ) rsync_cv_HAVE_SECURE_MKSTEMP=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: $rsync_cv_HAVE_SECURE_MKSTEMP" >&5 echo "${ECHO_T}$rsync_cv_HAVE_SECURE_MKSTEMP" >&6 if test x"$rsync_cv_HAVE_SECURE_MKSTEMP" = x"yes"; then cat >>confdefs.h <<\_ACEOF #define HAVE_SECURE_MKSTEMP 1 _ACEOF fi echo "$as_me:$LINENO: checking for broken inet_ntoa" >&5 echo $ECHO_N "checking for broken inet_ntoa... $ECHO_C" >&6 if test "${rsync_cv_REPLACE_INET_NTOA+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then rsync_cv_REPLACE_INET_NTOA=cross 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 #include #include main() { struct in_addr ip; ip.s_addr = 0x12345678; if (strcmp(inet_ntoa(ip),"18.52.86.120") && strcmp(inet_ntoa(ip),"120.86.52.18")) { exit(1); } 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 rsync_cv_REPLACE_INET_NTOA=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 ) rsync_cv_REPLACE_INET_NTOA=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: $rsync_cv_REPLACE_INET_NTOA" >&5 echo "${ECHO_T}$rsync_cv_REPLACE_INET_NTOA" >&6 if test x"$rsync_cv_REPLACE_INET_NTOA" = x"yes"; then cat >>confdefs.h <<\_ACEOF #define REPLACE_INET_NTOA 1 _ACEOF fi echo "$as_me:$LINENO: checking for broken inet_aton" >&5 echo $ECHO_N "checking for broken inet_aton... $ECHO_C" >&6 if test "${rsync_cv_REPLACE_INET_ATON+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then rsync_cv_REPLACE_INET_ATON=cross 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 #include #include main() { struct in_addr ip; if (inet_aton("example", &ip) == 0) exit(0); exit(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 rsync_cv_REPLACE_INET_ATON=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 ) rsync_cv_REPLACE_INET_ATON=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: $rsync_cv_REPLACE_INET_ATON" >&5 echo "${ECHO_T}$rsync_cv_REPLACE_INET_ATON" >&6 if test x"$rsync_cv_REPLACE_INET_ATON" = x"yes"; then cat >>confdefs.h <<\_ACEOF #define REPLACE_INET_ATON 1 _ACEOF fi # # The following test was mostly taken from the tcl/tk plus patches # echo "$as_me:$LINENO: checking whether -c -o works" >&5 echo $ECHO_N "checking whether -c -o works... $ECHO_C" >&6 if test "${rsync_cv_DASHC_WORKS_WITH_DASHO+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else rm -rf conftest* cat > conftest.$ac_ext <&5 echo "${ECHO_T}$rsync_cv_DASHC_WORKS_WITH_DASHO" >&6 if test x"$rsync_cv_DASHC_WORKS_WITH_DASHO" = x"yes"; then OBJ_SAVE="#" OBJ_RESTORE="#" CC_SHOBJ_FLAG='-o $@' else OBJ_SAVE=' @b=`basename $@ .o`;rm -f $$b.o.sav;if test -f $$b.o; then mv $$b.o $$b.o.sav;fi;' OBJ_RESTORE=' @b=`basename $@ .o`;if test "$$b.o" != "$@"; then mv $$b.o $@; if test -f $$b.o.sav; then mv $$b.o.sav $$b.o; fi; fi' CC_SHOBJ_FLAG="" fi cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. { (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n \ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; esac; } | sed ' t clear : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ : end' >>confcache if diff $cache_file confcache >/dev/null 2>&1; then :; else if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_i=`echo "$ac_i" | sed 's/\$U\././;s/\.o$//;s/\.obj$//'` # 2. Add them. ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then set -o posix fi DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # Work around bugs in pre-3.0 UWIN ksh. $as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. for as_var in \ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else $as_unset $as_var fi done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)$' \| \ . : '\(.\)' 2>/dev/null || echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } /^X\/\(\/\/\)$/{ s//\1/; q; } /^X\/\(\/\).*/{ s//\1/; q; } s/.*/./; q'` # PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" || { # Find who we are. Look in the path if we contain no path at all # relative or not. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} { (exit 1); exit 1; }; } fi case $CONFIG_SHELL in '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for as_base in sh bash ksh sh5; do case $as_dir in /*) if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } CONFIG_SHELL=$as_dir/$as_base export CONFIG_SHELL exec "$CONFIG_SHELL" "$0" ${1+"$@"} fi;; esac done done ;; esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line before each line; the second 'sed' does the real # work. The second script uses 'N' to pair each line-number line # with the numbered line, and appends trailing '-' during # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) sed '=' <$as_myself | sed ' N s,$,-, : loop s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop s,-$,, s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && chmod +x $as_me.lineno || { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensible to this). . ./$as_me.lineno # Exit status is that of the last command. exit } case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C=' ' ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then # We could just check for DJGPP; but this test a) works b) is more generic # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). if test -f conf$$.exe; then # Don't use ln at all; we don't have any links as_ln_s='cp -p' else as_ln_s='ln -s' fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # IFS # We need space, tab and new line, in precisely that order. as_nl=' ' IFS=" $as_nl" # CDPATH. $as_unset CDPATH exec 6>&1 # Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. Logging --version etc. is OK. exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX } >&5 cat >&5 <<_CSEOF This file was extended by $as_me, which was generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ _CSEOF echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 echo >&5 _ACEOF # Files that config.status was made for. if test -n "$ac_config_files"; then echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS fi if test -n "$ac_config_headers"; then echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS fi if test -n "$ac_config_links"; then echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS fi if test -n "$ac_config_commands"; then echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS fi cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration headers: $config_headers Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status configured by $0, generated by GNU Autoconf 2.59, with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." srcdir=$srcdir INSTALL="$INSTALL" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; *) # This is not an option, so the user has probably given explicit # arguments. ac_option=$1 ac_need_defaults=false;; esac case $ac_option in # Handling of the options. _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:$LINENO: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; };; --help | --hel | -h ) echo "$ac_cs_usage"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Create a temporary directory, and hook for its removal unless debugging. $debug || { trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./confstat$$-$RANDOM (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF # # CONFIG_HEADER section. # # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where # NAME is the cpp macro being defined and VALUE is the value it is being given. # # ac_d sets the value in "#define NAME VALUE" lines. ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' ac_dB='[ ].*$,\1#\2' ac_dC=' ' ac_dD=',;t' # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_uB='$,\1#\2define\3' ac_uC=' ' ac_uD=',;t' for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case $ac_file in - | *:- | *:-:* ) # input from stdin cat >$tmp/stdin ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; * ) ac_file_in=$ac_file.in ;; esac test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the # src tree. ac_file_inputs=`IFS=: for f in $ac_file_in; do case $f in -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } # Do quote $f, to prevent DOS paths from being IFS'd. echo "$f";; *) # Relative if test -f "$f"; then # Build tree echo "$f" elif test -f "$srcdir/$f"; then # Source tree echo "$srcdir/$f" else # /dev/null tree { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; esac done` || { (exit 1); exit 1; } # Remove the trailing spaces. sed 's/[ ]*$//' $ac_file_inputs >$tmp/in _ACEOF # Transform confdefs.h into two sed scripts, `conftest.defines' and # `conftest.undefs', that substitutes the proper values into # config.h.in to produce config.h. The first handles `#define' # templates, and the second `#undef' templates. # And first: Protect against being on the right side of a sed subst in # config.status. Protect against being in an unquoted here document # in config.status. rm -f conftest.defines conftest.undefs # Using a here document instead of a string reduces the quoting nightmare. # Putting comments in sed scripts is not portable. # # `end' is used to avoid that the second main sed command (meant for # 0-ary CPP macros) applies to n-ary macro definitions. # See the Autoconf documentation for `clear'. cat >confdef2sed.sed <<\_ACEOF s/[\\&,]/\\&/g s,[\\$`],\\&,g t clear : clear s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp t end s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp : end _ACEOF # If some macros were called several times there might be several times # the same #defines, which is useless. Nevertheless, we may not want to # sort them, since we want the *last* AC-DEFINE to be honored. uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs rm -f confdef2sed.sed # This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. cat >>conftest.undefs <<\_ACEOF s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, _ACEOF # Break up conftest.defines because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS echo ' :' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.defines >/dev/null do # Write a limited-size here document to $tmp/defines.sed. echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#define' lines. echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/defines.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail rm -f conftest.defines mv conftest.tail conftest.defines done rm -f conftest.defines echo ' fi # grep' >>$CONFIG_STATUS echo >>$CONFIG_STATUS # Break up conftest.undefs because some shells have a limit on the size # of here documents, and old seds have small limits too (100 cmds). echo ' # Handle all the #undef templates' >>$CONFIG_STATUS rm -f conftest.tail while grep . conftest.undefs >/dev/null do # Write a limited-size here document to $tmp/undefs.sed. echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS # Speed up: don't consider the non `#undef' echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS # Work around the forget-to-reset-the-flag bug. echo 't clr' >>$CONFIG_STATUS echo ': clr' >>$CONFIG_STATUS sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS echo 'CEOF sed -f $tmp/undefs.sed $tmp/in >$tmp/out rm -f $tmp/in mv $tmp/out $tmp/in ' >>$CONFIG_STATUS sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail rm -f conftest.undefs mv conftest.tail conftest.undefs done rm -f conftest.undefs cat >>$CONFIG_STATUS <<\_ACEOF # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ if test x"$ac_file" = x-; then echo "/* Generated by configure. */" >$tmp/config.h else echo "/* $ac_file. Generated by configure. */" >$tmp/config.h fi cat $tmp/in >>$tmp/config.h rm -f $tmp/in if test x"$ac_file" != x-; then if diff $ac_file $tmp/config.h >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` { if $as_mkdir_p; then mkdir -p "$ac_dir" else as_dir="$ac_dir" as_dirs= while test ! -d "$as_dir"; do as_dirs="$as_dir $as_dirs" as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| \ . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } /^X\(\/\/\)[^/].*/{ s//\1/; q; } /^X\(\/\/\)$/{ s//\1/; q; } /^X\(\/\).*/{ s//\1/; q; } s/.*/./; q'` done test ! -n "$as_dirs" || mkdir $as_dirs fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } rm -f $ac_file mv $tmp/config.h $ac_file fi else cat $tmp/config.h rm -f $tmp/config.h fi done _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi echo "$as_me:$LINENO: result: " >&5 echo "${ECHO_T}" >&6 echo "$as_me:$LINENO: result: File::RsyncP::FileList based on rsync ${RSYNC_VERSION} configuration successful" >&5 echo "${ECHO_T} File::RsyncP::FileList based on rsync ${RSYNC_VERSION} configuration successful" >&6 echo "$as_me:$LINENO: result: " >&5 echo "${ECHO_T}" >&6 File-RsyncP-0.74/FileList/errcode.h0000444000076500000240000000473411423121572016022 0ustar craigstaff/* -*- c-file-style: "linux"; -*- Copyright (C) 1998-2000 by Andrew Tridgell 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* * error codes returned by rsync. If you change these, please also update the * string mappings in log.c and the EXIT VALUES in rsync.yo */ #define RERR_OK 0 #define RERR_SYNTAX 1 /* syntax or usage error */ #define RERR_PROTOCOL 2 /* protocol incompatibility */ #define RERR_FILESELECT 3 /* errors selecting input/output files, dirs */ #define RERR_UNSUPPORTED 4 /* requested action not supported */ #define RERR_STARTCLIENT 5 /* error starting client-server protocol */ #define RERR_SOCKETIO 10 /* error in socket IO */ #define RERR_FILEIO 11 /* error in file IO */ #define RERR_STREAMIO 12 /* error in rsync protocol data stream */ #define RERR_MESSAGEIO 13 /* errors with program diagnostics */ #define RERR_IPC 14 /* error in IPC code */ #define RERR_SIGNAL 20 /* status returned when sent SIGUSR1, SIGINT */ #define RERR_WAITCHILD 21 /* some error returned by waitpid() */ #define RERR_MALLOC 22 /* error allocating core memory buffers */ #define RERR_PARTIAL 23 /* partial transfer */ #define RERR_VANISHED 24 /* file(s) vanished on sender side */ #define RERR_TIMEOUT 30 /* timeout in data send/receive */ /* Although it doesn't seem to be specified anywhere, * ssh and the shell seem to return these values: * * 124 if the command exited with status 255 * 125 if the command is killed by a signal * 126 if the command cannot be run * 127 if the command is not found * * and we could use this to give a better explanation if the remote * command is not found. */ #define RERR_CMD_FAILED 124 #define RERR_CMD_KILLED 125 #define RERR_CMD_RUN 126 #define RERR_CMD_NOTFOUND 127 File-RsyncP-0.74/FileList/exclude.c0000444000076500000240000003320211423121572016013 0ustar craigstaff/* -*- c-file-style: "linux" -*- * * Copyright (C) 1996-2001 by Andrew Tridgell * Copyright (C) 1996 by Paul Mackerras * Copyright (C) 2002 by Martin Pool * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* a lot of this stuff was originally derived from GNU tar, although it has now changed so much that it is hard to tell :) */ /* include/exclude cluestick added by Martin Pool */ #include "rsync.h" static int verbose = 0; /** Build an exclude structure given an exclude pattern. */ static void make_exclude(struct file_list *f, struct exclude_list_struct *listp, const char *pat, unsigned int pat_len, unsigned int mflags) { struct exclude_struct *ret; const char *cp; unsigned int ex_len; ret = new(struct exclude_struct); if (!ret) out_of_memory("make_exclude"); memset(ret, 0, sizeof ret[0]); if (f->exclude_path_prefix) mflags |= MATCHFLG_ABS_PATH; if (f->exclude_path_prefix && *pat == '/') ex_len = strlen(f->exclude_path_prefix); else ex_len = 0; ret->pattern = new_array(char, ex_len + pat_len + 1); if (!ret->pattern) out_of_memory("make_exclude"); if (ex_len) memcpy(ret->pattern, f->exclude_path_prefix, ex_len); strlcpy(ret->pattern + ex_len, pat, pat_len + 1); pat_len += ex_len; if (strpbrk(ret->pattern, "*[?")) { mflags |= MATCHFLG_WILD; if ((cp = strstr(ret->pattern, "**")) != NULL) { mflags |= MATCHFLG_WILD2; /* If the pattern starts with **, note that. */ if (cp == ret->pattern) mflags |= MATCHFLG_WILD2_PREFIX; } } if (pat_len > 1 && ret->pattern[pat_len-1] == '/') { ret->pattern[pat_len-1] = 0; mflags |= MATCHFLG_DIRECTORY; } for (cp = ret->pattern; (cp = strchr(cp, '/')) != NULL; cp++) ret->slash_cnt++; ret->match_flags = mflags; if (!listp->tail) listp->head = listp->tail = ret; else { listp->tail->next = ret; listp->tail = ret; } } static void free_exclude(struct exclude_struct *ex) { free(ex->pattern); free(ex); } void clear_exclude_list(struct exclude_list_struct *listp) { struct exclude_struct *ent, *next; for (ent = listp->head; ent; ent = next) { next = ent->next; free_exclude(ent); } listp->head = listp->tail = NULL; } static int check_one_exclude(struct file_list *f, char *name, struct exclude_struct *ex, int name_is_dir) { char *p, full_name[MAXPATHLEN]; int match_start = 0; char *pattern = ex->pattern; if (!*name) return 0; /* If the pattern does not have any slashes AND it does not have * a "**" (which could match a slash), then we just match the * name portion of the path. */ if (!ex->slash_cnt && !(ex->match_flags & MATCHFLG_WILD2)) { if ((p = strrchr(name,'/')) != NULL) name = p+1; } else if (ex->match_flags & MATCHFLG_ABS_PATH && *name != '/' && f->exclude_curr_dir[1]) { pathjoin(full_name, sizeof full_name, f->exclude_curr_dir + 1, name); name = full_name; } if (ex->match_flags & MATCHFLG_DIRECTORY && !name_is_dir) return 0; if (*pattern == '/') { match_start = 1; pattern++; if (*name == '/') name++; } if (ex->match_flags & MATCHFLG_WILD) { /* A non-anchored match with an infix slash and no "**" * needs to match the last slash_cnt+1 name elements. */ if (!match_start && ex->slash_cnt && !(ex->match_flags & MATCHFLG_WILD2)) { int cnt = ex->slash_cnt + 1; for (p = name + strlen(name) - 1; p >= name; p--) { if (*p == '/' && !--cnt) break; } name = p+1; } if (wildmatch(pattern, name)) return 1; if (ex->match_flags & MATCHFLG_WILD2_PREFIX) { /* If the **-prefixed pattern has a '/' as the next * character, then try to match the rest of the * pattern at the root. */ if (pattern[2] == '/' && wildmatch(pattern+3, name)) return 1; } else if (!match_start && ex->match_flags & MATCHFLG_WILD2) { /* A non-anchored match with an infix or trailing "**" * (but not a prefixed "**") needs to try matching * after every slash. */ while ((name = strchr(name, '/')) != NULL) { name++; if (wildmatch(pattern, name)) return 1; } } } else if (match_start) { if (strcmp(name,pattern) == 0) return 1; } else { int l1 = strlen(name); int l2 = strlen(pattern); if (l2 <= l1 && strcmp(name+(l1-l2),pattern) == 0 && (l1==l2 || name[l1-(l2+1)] == '/')) { return 1; } } return 0; } static void report_exclude_result(char const *name, struct exclude_struct const *ent, int name_is_dir, const char *type) { /* If a trailing slash is present to match only directories, * then it is stripped out by make_exclude. So as a special * case we add it back in here. */ if (verbose >= 2) { printf("%scluding %s %s because of %spattern %s%s\n", ent->match_flags & MATCHFLG_INCLUDE ? "in" : "ex", name_is_dir ? "directory" : "file", name, type, ent->pattern, ent->match_flags & MATCHFLG_DIRECTORY ? "/" : ""); } } /* * Return -1 if file "name" is defined to be excluded by the specified * exclude list, 1 if it is included, and 0 if it was not matched. */ int check_exclude(struct file_list *f, char *name, int name_is_dir) { struct exclude_struct *ent; struct exclude_list_struct *listp = &f->exclude_list; for (ent = listp->head; ent; ent = ent->next) { if (check_one_exclude(f, name, ent, name_is_dir)) { report_exclude_result(name, ent, name_is_dir, listp->debug_type); return ent->match_flags & MATCHFLG_INCLUDE ? 1 : -1; } } return 0; } /* Get the next include/exclude arg from the string. The token will not * be '\0' terminated, so use the returned length to limit the string. * Also, be sure to add this length to the returned pointer before passing * it back to ask for the next token. This routine parses the +/- prefixes * and the "!" token unless xflags contains XFLG_WORDS_ONLY. The *flag_ptr * value will also be set to the MATCHFLG_* bits for the current token. */ static const char *get_exclude_tok(const char *p, unsigned int *len_ptr, unsigned int *flag_ptr, int xflags) { const unsigned char *s = (const unsigned char *)p; unsigned int len, mflags = 0; if (xflags & XFLG_WORD_SPLIT) { /* Skip over any initial whitespace. */ while (isspace(*s)) s++; /* Update for "!" check. */ p = (const char *)s; } /* Is this a '+' or '-' followed by a space (not whitespace)? */ if (!(xflags & XFLG_WORDS_ONLY) && (*s == '-' || *s == '+') && s[1] == ' ') { if (*s == '+') mflags |= MATCHFLG_INCLUDE; s += 2; } else if (xflags & XFLG_DEF_INCLUDE) mflags |= MATCHFLG_INCLUDE; if (xflags & XFLG_WORD_SPLIT) { const unsigned char *cp = s; /* Token ends at whitespace or the end of the string. */ while (!isspace(*cp) && *cp != '\0') cp++; len = cp - s; } else len = strlen((const char *)s); if (*p == '!' && len == 1 && !(xflags & XFLG_WORDS_ONLY)) mflags |= MATCHFLG_CLEAR_LIST; *len_ptr = len; *flag_ptr = mflags; return (const char *)s; } void add_exclude(struct file_list *f, const char *pattern, int xflags) { unsigned int pat_len, mflags; const char *cp; struct exclude_list_struct *listp = &f->exclude_list; if (!pattern) return; cp = pattern; pat_len = 0; while (1) { cp = get_exclude_tok(cp + pat_len, &pat_len, &mflags, xflags); if (!pat_len) break; if (mflags & MATCHFLG_CLEAR_LIST) { if (verbose > 2) { printf("Clearing %sexclude list\n", listp->debug_type); } clear_exclude_list(listp); continue; } make_exclude(f, listp, cp, pat_len, mflags); if (verbose > 2) { printf("add_exclude(%.*s, %s%sclude)\n", (int)pat_len, cp, listp->debug_type, mflags & MATCHFLG_INCLUDE ? "in" : "ex"); } } } void add_exclude_file(struct file_list *f, const char *fname, int xflags) { FILE *fp; char line[MAXPATHLEN+3]; /* Room for "x " prefix and trailing slash. */ char *eob = line + sizeof line - 1; int word_split = xflags & XFLG_WORD_SPLIT; if (!fname || !*fname) return; if (*fname != '-' || fname[1]) fp = fopen(fname, "rb"); else fp = stdin; if (!fp) { if (xflags & XFLG_FATAL_ERRORS) { printf("failed to open %s file %s", xflags & XFLG_DEF_INCLUDE ? "include" : "exclude", fname); } return; } while (1) { char *s = line; int ch, overflow = 0; while (1) { if ((ch = getc(fp)) == EOF) { if (ferror(fp) && errno == EINTR) continue; break; } if (word_split && isspace(ch)) break; if (f->eol_nulls? !ch : (ch == '\n' || ch == '\r')) break; if (s < eob) *s++ = ch; else overflow = 1; } if (overflow) { printf("discarding over-long exclude: %s...\n", line); s = line; } *s = '\0'; /* Skip an empty token and (when line parsing) comments. */ if (*line && (word_split || (*line != ';' && *line != '#'))) add_exclude(f, line, xflags); if (ch == EOF) break; } fclose(fp); } void send_exclude_list(struct file_list *f) { struct exclude_struct *ent; for (ent = f->exclude_list.head; ent; ent = ent->next) { unsigned int l; char p[MAXPATHLEN+1]; l = strlcpy(p, ent->pattern, sizeof p); if (l == 0 || l >= MAXPATHLEN) continue; if (ent->match_flags & MATCHFLG_DIRECTORY) { p[l++] = '/'; p[l] = '\0'; } if (ent->match_flags & MATCHFLG_INCLUDE) { write_int(f, l + 2); write_buf(f, "+ ", 2); } else if ((*p == '-' || *p == '+') && p[1] == ' ') { write_int(f, l + 2); write_buf(f, "- ", 2); } else write_int(f, l); write_buf(f, p, l); } write_int(f, 0); } /* * Note: this code hasn't been ported for File::RsyncP. * Currently this is implemented in perl. */ void recv_exclude_list(struct file_list *f) { char line[MAXPATHLEN+3]; /* Room for "x " prefix and trailing slash. */ unsigned int l; while ((l = read_int(f)) != 0) { if (l >= sizeof line) { printf("overflow in recv_exclude_list (l=%d)\n", l); l = sizeof(line) - 1; } read_sbuf(f, line, l); add_exclude(f, line, 0); } } static char default_cvsignore[] = /* These default ignored items come from the CVS manual. */ "RCS SCCS CVS CVS.adm RCSLOG cvslog.* tags TAGS" " .make.state .nse_depinfo *~ #* .#* ,* _$* *$" " *.old *.bak *.BAK *.orig *.rej .del-*" " *.a *.olb *.o *.obj *.so *.exe" " *.Z *.elc *.ln core" /* The rest we added to suit ourself. */ " .svn/"; void add_cvs_excludes(struct file_list *f) { char fname[MAXPATHLEN]; char *p; add_exclude(f, default_cvsignore, XFLG_WORD_SPLIT | XFLG_WORDS_ONLY); if ((p = getenv("HOME")) && pathjoin(fname, sizeof fname, p, ".cvsignore") < sizeof fname) { add_exclude_file(f, fname, XFLG_WORD_SPLIT | XFLG_WORDS_ONLY); } add_exclude(f, getenv("CVSIGNORE"), XFLG_WORD_SPLIT | XFLG_WORDS_ONLY); } /* Join strings p1 & p2 into "dest" with a guaranteed '/' between them. (If * p1 ends with a '/', no extra '/' is inserted.) Returns the length of both * strings + 1 (if '/' was inserted), regardless of whether the null-terminated * string fits into destsize. */ size_t pathjoin(char *dest, size_t destsize, const char *p1, const char *p2) { size_t len = strlcpy(dest, p1, destsize); if (len < destsize - 1) { if (!len || dest[len-1] != '/') dest[len++] = '/'; if (len < destsize - 1) len += strlcpy(dest + len, p2, destsize - len); else { dest[len] = '\0'; len += strlen(p2); } } else len += strlen(p2) + 1; /* Assume we'd insert a '/'. */ return len; } File-RsyncP-0.74/FileList/FileList.pm0000444000076500000240000002545512456603031016304 0ustar craigstaff#============================================================= -*-perl-*- # # File::RsyncP::FileList package # # DESCRIPTION # File::RsyncP::FileList is a perl module that implements the # file list encoding and decoding used by rsync. # # AUTHOR # Craig Barratt # # COPYRIGHT # File::RsyncP is Copyright (C) 2002-2015 Craig Barratt. # # Rsync is Copyright (C) 1996-2001 by Andrew Tridgell, 1996 by Paul # Mackerras, 2001-2002 by Martin Pool, and 2003-2009 by Wayne Davison, # and others. # # 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 3 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, see . # #======================================================================== # # Version 0.74, released 17 Jan 2015. # # See http://perlrsync.sourceforge.net. # #======================================================================== package File::RsyncP::FileList; use strict; require Exporter; require DynaLoader; use vars qw(@ISA %EXPORT_TAGS @EXPORT_OK @EXPORT $VERSION); @ISA = qw(Exporter AutoLoader DynaLoader); # Items to export into callers namespace by default. Note: do not export # names by default without a very good reason. Use EXPORT_OK instead. # Do not simply export all your public functions/methods/constants. # This allows declaration use File::RsyncP::FileList ':all'; # If you do not need this, moving things directly into @EXPORT or @EXPORT_OK # will save memory. %EXPORT_TAGS = ( 'all' => [ qw( ) ] ); @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); @EXPORT = qw( ); $VERSION = '0.74'; bootstrap File::RsyncP::FileList $VERSION; # Preloaded methods go here. 1; __END__ =head1 NAME File::RsyncP::FileList - Perl interface to rsync file list encoding and decoding. =head1 SYNOPSIS use File::RsyncP::FileList; $fileList = File::RsyncP::FileList->new({ preserve_uid => 1, preserve_gid => 1, preserve_links => 1, preserve_devices => 1, preserve_hard_links => 0, always_checksum => 0, remote_version => 26, }); # decoding an incoming file list while ( !$fileList->decodeDone && !$fileList->fatalError ) { $data .= readMoreDataFromRemoteRsync(); $bytesDone = $fileList->decode($data); $data = substr($data, $bytesDone) if ( $bytesDone > 0 ); } $fileList->clean; # create (encode) a file list $fileList->encode({ name => $filePath, dev => $stat[0], inode => $stat[1], mode => $stat[2], uid => $stat[4], gid => $stat[5], rdev => $stat[6], mtime => $stat[9], }); $data = $fileList->encodeData; # get file information, for file number 5: $fileInfo = $fileList->get(5); # utility functions $numberOfFiles = $fileList->count; $gotFatalError = $fileList->fatalError; =head1 DESCRIPTION The File::RsyncP::FileList module is used to encode and decode file lists in using the same format at Rsync. The sender side of Rsync creates a list of all the files the are going to be sent. This list is sent in a compact format to the receiver side. Each side then sorts the list and removes duplicate entries. From this point on, all files are referred to by their integer index into the sorted file list. A new file list object is created by calling File::RsyncP::FileList->new. An object can be used to decode or encode a file list. There is no mechanism to reset the state of a file list: you should create a new object each time you need to do a new decode or encode. The new() function takes a hashref of options, which correspond to various rsync command-line switches. These must exactly match the arguments to the remote rsync, otherwise the file list format will not be compatible and decoding will fail. $fileList = File::RsyncP::FileList->new({ preserve_uid => 1, # --owner preserve_gid => 1, # --group preserve_links => 1, # --links preserve_devices => 1, # --devices preserve_hard_links => 0, # --hard-links always_checksum => 0, # --checksum remote_version => 26, # remote protocol version }); =head2 Decoding The decoding functions take a stream of bytes from the remote rsync and convert them into an internal data structure. Rather than store the file list as a native perl list of hashes (which occupies too much memory for large file lists), the same internal data structure as rsync is used. Individual file list entries can be returned with the get() function. File list data read from the remote rsync should be passed to the decode() function. The data may be read and processed in arbitrary sized chunks. The decode() function returns how many bytes were actually processed. It is the caller's responsbility to remove that number of bytes from the input argument, preserving the remaining bytes for the next call to decode(). The decodeDone() function returns true when the file list is complete. The fatalError() function returns true if there was a non-recoverable error while decoding. The clean() function needs to be called after the file list decode is complete. The clean() function sorts the file list and removes repeated entries. Skipping this step will produce unexpected results: since files are referred to using integers, each side will refer to different files is the file lists are not sorted and purged in exactly the same manner. A typical decode loop looks like: while ( !$fileList->decodeDone && !$fileList->fatalError ) { $data .= readMoreDataFromRemoteRsync(); $bytesDone = $fileList->decode($data); $data = substr($data, $bytesDone) if ( $bytesDone > 0 ); } $fileList->clean; After clean() is called, the number of files in the file list can be found by calling count(). Files can be fetched by calling the get() function, with an index from 0 to count()-1: $fileInfo = $fileList->get(5); The get() function returns a hashref with various entries: name path name of the file (relative to rsync dir): equal to dirname/basename basename file name, without directory dirname directory where file resides sum file MD4 checksum (only present if --checksum specified) uid file user id gid file group id mode file mode mtime file modification time size file length dev device number on which file resides inode file inode link link contents if the file is a sym link rdev major/minor device number if file is char/block special Various fields will only have valid values if the corresponding options are set (eg: uid if preserve_uid is set, dev and inode if preserve_hard_links is set etc). For example, to dump out each of hash you could do this: use Data::Dumper; my $count = $fileList->count; for ( my $i = 0 ; $i < $count ; $i++ ) { print("File $i is:\n"); print Dumper($fileList->get($i)); } =head2 Encoding The encode() function is used to build a file list in preparation for encoding and sending a file list to a remote rsync. The encode() function takes a hashref argument with the parameters for one file. It should be called once for each file. The parameter names are the same as those returned by get(). In this example the matching stat() values are shown: $fileList->encode({ name => $filePath, dev => $stat[0], inode => $stat[1], mode => $stat[2], uid => $stat[4], gid => $stat[5], rdev => $stat[6], size => $stat[7], mtime => $stat[9], }); It is not necessary to specify basename and dirname; these are extracted from name. You only need to specify the parameters that match the options given to new(). You can also specify sum and link as necessary. To compute the encoded file list data the encodeData() function should be called. It can be called every time encode() is called, or once at the end of all the encode() calls. It returns the encoded data that should be sent to the remote rsync: $data = $fileList->encodeData; It is recommended that encodeData() be called frequently to avoid the need to allocate large internal buffers to hold the entire encoded file list. Since encodeData() does not know when the last file has been encoded, it is the caller's responsbility to add the final null byte (eg: pack("C", 0)) to the data to indicate the end of the file list data. After all the file list entries are processed you should call clean(): $fileList->clean; This ensures that each side (sender/receiver) has identical sorted file lists. =head2 Utility functions The count() function returns the total number of files in the internal file list (either decoded or encoded). The fatalError() function returns true if a fatal error has occured during file decoding. It should be called in the decode loop to make sure no error has occured. =head1 AUTHOR File::RsyncP::FileList was written by Craig Barratt based on rsync 2.5.5. Rsync was written by Andrew Tridgell and Paul Mackerras. It is available under a GPL license. See http://rsync.samba.org =head1 LICENSE 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 in the LICENSE file along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. =head1 SEE ALSO See L for File::RsyncP's SourceForge home page. See L and L for more precise examples of using L. Also see BackupPC's lib/BackupPC/Xfer/RsyncFileIO.pm for other examples. =cut File-RsyncP-0.74/FileList/FileList.xs0000444000076500000240000003674711423121572016326 0ustar craigstaff#include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "string.h" #include "rsync.h" #include typedef struct file_list *File__RsyncP__FileList; /* * Pick an integer setting out of the hash ref opts. If the argument * isn't a hash, or doesn't contain param, then returns def. */ static int getHashInt(SV *opts, char *param, int def) { SV **vp; if ( !opts || !SvROK(opts) || SvTYPE(SvRV(opts)) != SVt_PVHV || !(vp = hv_fetch((HV*)SvRV(opts), param, strlen(param), 0)) || !*vp ) { return def; } return SvIV(*vp); } /* * Pick an unsigned integer setting out of the hash ref opts. If the * argument isn't a hash, or doesn't contain param, then returns def. */ static unsigned int getHashUInt(SV *opts, char *param, int def) { SV **vp; if ( !opts || !SvROK(opts) || SvTYPE(SvRV(opts)) != SVt_PVHV || !(vp = hv_fetch((HV*)SvRV(opts), param, strlen(param), 0)) || !*vp ) { return def; } return SvUV(*vp); } /* * Pick a string setting out of the hash ref opts. If the argument * isn't a hash, or doesn't contain param, then returns def. */ static int getHashString(SV *opts, char *param, char *def, char *result, int maxLen) { SV **vp; char *str; STRLEN len; if ( !opts || !SvROK(opts) || SvTYPE(SvRV(opts)) != SVt_PVHV || !(vp = hv_fetch((HV*)SvRV(opts), param, strlen(param), 0)) || !*vp ) { if ( !def ) return -1; strcpy(result, def); return 0; } else { str = (char*)SvPV(*vp, len); if ( len >= maxLen ) { return -1; } memcpy(result, str, len); result[len] = '\0'; } return 0; } /* * Pick a double setting out of the hash ref opts. If the argument * isn't a hash, or doesn't contain param, then returns def. */ static double getHashDouble(SV *opts, char *param, double def) { SV **vp; if ( !opts || !SvROK(opts) || SvTYPE(SvRV(opts)) != SVt_PVHV || !(vp = hv_fetch((HV*)SvRV(opts), param, strlen(param), 0)) || !*vp ) { return def; } return SvNV(*vp); } /* * Check if a hash value defined. */ static int isHashDefined(SV *opts, char *param) { SV **vp; if ( !opts || !SvROK(opts) || SvTYPE(SvRV(opts)) != SVt_PVHV || !(vp = hv_fetch((HV*)SvRV(opts), param, strlen(param), 0)) || !*vp ) { return 0; } return 1; } MODULE = File::RsyncP::FileList PACKAGE = File::RsyncP::FileList PROTOTYPES: DISABLE File::RsyncP::FileList new(packname = "File::RsyncP::FileList", opts = NULL) char *packname SV* opts CODE: { int preserve_hard_links = getHashInt(opts, "preserve_hard_links", 0); RETVAL = flist_new(1, "FileList new", preserve_hard_links); RETVAL->preserve_links = getHashInt(opts, "preserve_links", 1); RETVAL->preserve_uid = getHashInt(opts, "preserve_uid", 1); RETVAL->preserve_gid = getHashInt(opts, "preserve_gid", 1); RETVAL->preserve_devices = getHashInt(opts, "preserve_devices", 0); RETVAL->always_checksum = getHashInt(opts, "always_checksum", 0); RETVAL->preserve_hard_links = preserve_hard_links; RETVAL->protocol_version = getHashInt(opts, "protocol_version", 26); RETVAL->eol_nulls = getHashInt(opts, "from0", 0); } OUTPUT: RETVAL void DESTROY(flist) File::RsyncP::FileList flist CODE: { flist_free(flist); } unsigned int count(flist) File::RsyncP::FileList flist CODE: { RETVAL = flist->count; } OUTPUT: RETVAL unsigned int fatalError(flist) File::RsyncP::FileList flist CODE: { RETVAL = flist->fatalError; } OUTPUT: RETVAL unsigned int decodeDone(flist) File::RsyncP::FileList flist CODE: { RETVAL = flist->decodeDone; } OUTPUT: RETVAL int decode(flist, bytesSV) PREINIT: STRLEN nBytes; INPUT: File::RsyncP::FileList flist SV *bytesSV unsigned char *bytes = (unsigned char *)SvPV(bytesSV, nBytes); CODE: { RETVAL = flistDecodeBytes(flist, bytes, nBytes); } OUTPUT: RETVAL SV* get(flist, index) INPUT: File::RsyncP::FileList flist unsigned int index CODE: { HV *rh; struct file_struct *file; if ( index >= flist->count || !flist->files[index]->basename ) { XSRETURN_UNDEF; } file = flist->files[index]; rh = (HV *)sv_2mortal((SV *)newHV()); if ( file->basename ) hv_store(rh, "basename", 8, newSVpv(file->basename, 0), 0); if ( file->dirname ) hv_store(rh, "dirname", 7, newSVpv(file->dirname, 0), 0); if ( S_ISLNK(file->mode) && file->u.link ) hv_store(rh, "link", 4, newSVpv(file->u.link, 0), 0); if ( S_ISREG(file->mode) && file->u.sum ) hv_store(rh, "sum", 3, newSVpv(file->u.sum, 0), 0); if ( IS_DEVICE(file->mode) ) { hv_store(rh, "rdev", 4, newSVnv((double)file->u.rdev), 0); hv_store(rh, "rdev_major", 10, newSVnv((double)major(file->u.rdev)), 0); hv_store(rh, "rdev_minor", 10, newSVnv((double)minor(file->u.rdev)), 0); } hv_store(rh, "name", 4, newSVpv(f_name(file), 0), 0); hv_store(rh, "uid", 3, newSVnv((double)((unsigned)file->uid)), 0); hv_store(rh, "gid", 3, newSVnv((double)((unsigned)file->gid)), 0); hv_store(rh, "mode", 4, newSVnv((double)((unsigned)file->mode)), 0); hv_store(rh, "mtime", 5, newSVnv((double)((unsigned)file->modtime)), 0); hv_store(rh, "size", 4, newSVnv(file->length), 0); if ( flist->preserve_hard_links ) { if ( flist->link_idev_data_done ) { /* * already run the hardlink linking code, so the link_u * union has the links data in place */ if ( file->link_u.links ) { /* * return the name of the file this one is linked to */ hv_store(rh, "hlink", 5, newSVpv(f_name(file->link_u.links->to), 0), 0); if ( file == file->link_u.links->to ) { /* * Add flag if this is ourselves */ hv_store(rh, "hlink_self", 10, newSVnv((double)1.0), 0); } } } else { if ( file->link_u.idev ) { hv_store(rh, "dev", 3, newSVnv(file->link_u.idev->dev), 0); hv_store(rh, "inode", 5, newSVnv(file->link_u.idev->inode), 0); } } } RETVAL = newRV((SV*)rh); } OUTPUT: RETVAL unsigned int flagGet(flist, index) INPUT: File::RsyncP::FileList flist unsigned int index CODE: { if ( index >= flist->count ) { XSRETURN_UNDEF; } RETVAL = flist->files[index]->flags & FLAG_USER_BOOL ? 1 : 0; } OUTPUT: RETVAL void flagSet(flist, index, value) INPUT: File::RsyncP::FileList flist unsigned int index unsigned int value CODE: { if ( index < flist->count ) { if ( value ) { flist->files[index]->flags |= FLAG_USER_BOOL; } else { flist->files[index]->flags &= ~FLAG_USER_BOOL; } } } void clean(flist) INPUT: File::RsyncP::FileList flist CODE: { clean_flist(flist, 0, 1); } void init_hard_links(flist) INPUT: File::RsyncP::FileList flist CODE: { init_hard_links(flist); } void encode(flist, data) INPUT: File::RsyncP::FileList flist SV* data CODE: { struct file_struct *file; char sum[SUM_LENGTH]; char thisname[MAXPATHLEN]; char linkname[MAXPATHLEN]; int alloc_len, basename_len, dirname_len, linkname_len, sum_len; char *basename, *dirname, *bp; unsigned short flags = 0; unsigned int mode = getHashUInt(data, "mode", 0); unsigned int file_struct_len; struct file_struct f_test; /* Figure out how big the file_struct is without trailing padding */ file_struct_len = offsetof(struct file_struct, flags) + sizeof f_test.flags; if (!flist || !flist->count) /* Ignore lastdir when invalid. */ flist->encode_lastdir_len = -1; if ( getHashString(data, "name", NULL, thisname, MAXPATHLEN-1) ) { printf("flist encode: empty or too long name\n"); return; } clean_fname(thisname, 0); memset(sum, 0, SUM_LENGTH); if ( S_ISLNK(mode) && getHashString(data, "link", NULL, linkname, MAXPATHLEN-1) ) { printf("flist encode: link name is too long\n"); return; } if ((basename = strrchr(thisname, '/')) != NULL) { dirname_len = ++basename - thisname; /* counts future '\0' */ if (flist->encode_lastdir_len == dirname_len - 1 && strncmp(thisname, flist->encode_lastdir, flist->encode_lastdir_len) == 0) { dirname = flist->encode_lastdir; dirname_len = 0; /* indicates no copy is needed */ } else dirname = thisname; } else { basename = thisname; dirname = NULL; dirname_len = 0; } basename_len = strlen(basename) + 1; /* count the '\0' */ linkname_len = S_ISLNK(mode) ? strlen(linkname) + 1 : 0; sum_len = flist->always_checksum && S_ISREG(mode) ? MD4_SUM_LENGTH : 0; alloc_len = file_struct_len + dirname_len + basename_len + linkname_len + sum_len; if (flist) { bp = pool_alloc(flist->file_pool, alloc_len, "receive_file_entry"); } else { if (!(bp = malloc(sizeof(char) * alloc_len))) { printf("out of memory: receive_file_entry"); return; } } file = (struct file_struct *)bp; memset(bp, 0, file_struct_len); bp += file_struct_len; file->flags = flags; file->modtime = getHashUInt(data, "mtime", 0); file->length = getHashDouble(data, "size", 0.0); file->mode = mode; file->uid = getHashUInt(data, "uid", 0); file->gid = getHashUInt(data, "gid", 0); if (flist->preserve_hard_links && flist->idev_pool) { if (flist->protocol_version < 28) { if (S_ISREG(mode)) file->link_u.idev = pool_talloc( flist->idev_pool, struct idev, 1, "inode_table"); } else { if (!S_ISDIR(mode) && isHashDefined(data, "inode")) file->link_u.idev = pool_talloc( flist->idev_pool, struct idev, 1, "inode_table"); } } if (file->link_u.idev) { file->F_DEV = getHashDouble(data, "dev", 0.0); file->F_INODE = getHashDouble(data, "inode", 0.0); } if (dirname_len) { file->dirname = flist->encode_lastdir = bp; flist->encode_lastdir_len = dirname_len - 1; memcpy(bp, dirname, dirname_len - 1); bp += dirname_len; bp[-1] = '\0'; } else if (dirname) file->dirname = dirname; file->basename = bp; memcpy(bp, basename, basename_len); bp += basename_len; if (flist->preserve_devices && IS_DEVICE(mode)) { if ( isHashDefined(data, "rdev_major") ) { file->u.rdev = makedev(getHashUInt(data, "rdev_major", 0), getHashUInt(data, "rdev_minor", 0)); } else if ( isHashDefined(data, "rdev") ) { file->u.rdev = getHashUInt(data, "rdev", 0); } else { printf("File::RsyncP::FileList::encode: missing rdev on device file %s\n", thisname); file->u.rdev = 0; } } if (linkname_len) { file->u.link = bp; memcpy(bp, linkname, linkname_len); bp += linkname_len; } if (sum_len) { file->u.sum = bp; /* TODO */ memset(bp, 0, sum_len); /*bp += sum_len;*/ } file->basedir = NULL; /* TODO */ flist_expand(flist); if (file->basename[0]) { flist->files[flist->count++] = file; send_file_entry(flist, file, 0 /* TODO base_flags */); } } SV* encodeData(flist) INPUT: File::RsyncP::FileList flist CODE: { if ( !flist->outBuf || flist->outPosn == 0 ) { ST(0) = sv_2mortal(newSVpv("", 0)); } else { ST(0) = sv_2mortal(newSVpv((char*)flist->outBuf, flist->outPosn)); flist->outPosn = 0; } } int exclude_check(flist, pathSV, isDir) PREINIT: STRLEN pathLen; INPUT: File::RsyncP::FileList flist SV *pathSV unsigned char *path = (unsigned char *)SvPV(pathSV, pathLen); unsigned int isDir CODE: { RETVAL = check_exclude(flist, (char*)path, isDir); } OUTPUT: RETVAL void exclude_add(flist, patternSV, flags) PREINIT: STRLEN patternLen; INPUT: File::RsyncP::FileList flist SV *patternSV unsigned char *pattern = (unsigned char *)SvPV(patternSV, patternLen); unsigned int flags CODE: { add_exclude(flist, (char*)pattern, flags); } void exclude_add_file(flist, fileNameSV, flags) PREINIT: STRLEN fileNameLen; INPUT: File::RsyncP::FileList flist SV *fileNameSV unsigned char *fileName = (unsigned char *)SvPV(fileNameSV, fileNameLen); unsigned int flags CODE: { add_exclude_file(flist, (char*)fileName, flags); } void exclude_cvs_add(flist) INPUT: File::RsyncP::FileList flist CODE: { add_cvs_excludes(flist); } void exclude_list_send(flist) INPUT: File::RsyncP::FileList flist CODE: { send_exclude_list(flist); } void exclude_list_receive(flist) INPUT: File::RsyncP::FileList flist CODE: { recv_exclude_list(flist); } void exclude_list_clear(flist) INPUT: File::RsyncP::FileList flist CODE: { clear_exclude_list(&flist->exclude_list); } SV * exclude_list_get(flist) INPUT: File::RsyncP::FileList flist CODE: { AV *result; struct exclude_struct *ent; result = (AV *)sv_2mortal((SV *)newAV()); for (ent = flist->exclude_list.head; ent; ent = ent->next) { HV *rh = (HV *)sv_2mortal((SV *)newHV()); hv_store(rh, "pattern", 7, newSVpvn(ent->pattern, strlen(ent->pattern)), 0); hv_store(rh, "flags", 5, newSVnv((double)ent->match_flags), 0); av_push(result, newRV((SV *)rh)); } RETVAL = newRV((SV *)result); } OUTPUT: RETVAL File-RsyncP-0.74/FileList/flist.c0000444000076500000240000010070512454352126015514 0ustar craigstaff/* Copyright (C) Andrew Tridgell 1996 Copyright (C) Paul Mackerras 1996 Copyright (C) 2001, 2002 by Martin Pool 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ /** @file flist.c * Generate and receive file lists * * @todo Get rid of the string_area optimization. Efficiently * allocating blocks is the responsibility of the system's malloc * library, not of rsync. * * @sa http://lists.samba.org/pipermail/rsync/2000-June/002351.html * **/ #include #include #include #include #include #include #include #include "rsync.h" extern struct stats stats; static char empty_sum[MD4_SUM_LENGTH]; static unsigned int file_struct_len; void init_flist(void) { struct file_struct f; /* Figure out how big the file_struct is without trailing padding */ file_struct_len = offsetof(struct file_struct, flags) + sizeof f.flags; } static int to_wire_mode(mode_t mode) { if (S_ISLNK(mode) && (_S_IFLNK != 0120000)) { return (mode & ~(_S_IFMT)) | 0120000; } return (int) mode; } static mode_t from_wire_mode(int mode) { if ((mode & (_S_IFMT)) == 0120000 && (_S_IFLNK != 0120000)) { return (mode & ~(_S_IFMT)) | _S_IFLNK; } return (mode_t) mode; } /* we need this function because of the silly way in which duplicate entries are handled in the file lists - we can't change this without breaking existing versions */ static int flist_up(struct file_list *flist, int i) { while (!flist->files[i]->basename) i++; return i; } /** * Make sure @p flist is big enough to hold at least @p flist->count * entries. **/ void flist_expand(struct file_list *flist) { struct file_struct **new_ptr; if (flist->count < flist->malloced) return; if (flist->malloced < FLIST_START) flist->malloced = FLIST_START; else if (flist->malloced >= FLIST_LINEAR) flist->malloced += FLIST_LINEAR; else flist->malloced *= 2; /* * In case count jumped or we are starting the list * with a known size just set it. */ if (flist->malloced < flist->count) flist->malloced = flist->count; new_ptr = realloc_array(flist->files, struct file_struct *, flist->malloced); flist->files = new_ptr; if (!flist->files) out_of_memory("flist_expand"); } static void readfd(struct file_list *f, unsigned char *buffer, size_t N) { if ( f->inError || f->inPosn + N > f->inLen ) { memset(buffer, 0, N); f->inError = 1; return; } memcpy(buffer, f->inBuf + f->inPosn, N); f->inPosn += N; } int32 read_int(struct file_list *f) { unsigned char b[4]; int32 ret; readfd(f,b,4); ret = b[0] | b[1] << 8 | b[2] << 16 | b[3] << 24; if (ret == (int32)0xffffffff) return -1; return ret; } int64 read_longint(struct file_list *f) { int32 ret = read_int(f); double d; if (ret != (int32)0xffffffff) { return ret; } d = (uint32)read_int(f); d += ((uint32)read_int(f)) * 65536.0 * 65536.0; return d; } void read_buf(struct file_list *f,char *buf,size_t len) { readfd(f, (unsigned char*)buf, len); } void read_sbuf(struct file_list *f,char *buf,size_t len) { read_buf(f,buf,len); buf[len] = 0; } unsigned char read_byte(struct file_list *f) { unsigned char c; read_buf (f, (char *)&c, 1); return c; } void receive_file_entry(struct file_list *f, struct file_struct **fptr, unsigned short flags) { /* * originally static variables to maintain state; now in file_list. */ time_t modtime = f->modtime; mode_t mode = f->mode; uint64 dev = f->dev; dev_t rdev = f->rdev; uint32 rdev_major = f->rdev_major; uid_t uid = f->uid; gid_t gid = f->gid; char lastname[MAXPATHLEN]; char *lastdir = f->lastdir; int lastdir_depth = f->lastdir_depth; int lastdir_len = f->lastdir_len; /* * original auto variables */ char thisname[MAXPATHLEN]; unsigned int l1 = 0, l2 = 0; int alloc_len, basename_len, dirname_len, linkname_len, sum_len; OFF_T file_length; char *basename, *dirname, *bp; struct file_struct *file; if (!fptr) { f->modtime = 0; f->mode = 0; f->dev = 0; f->rdev = makedev(0, 0); f->rdev_major = 0; f->uid = 0; f->gid = 0; *f->lastname = '\0'; f->lastdir_len = -1; return; } if (flags & XMIT_SAME_NAME) l1 = read_byte(f); if (flags & XMIT_LONG_NAME) l2 = read_int(f); else l2 = read_byte(f); if (l2 >= MAXPATHLEN - l1) { fprintf(stderr, "overflow: flags=0x%x l1=%d l2=%d, lastname=%s\n", flags, l1, l2, f->lastname); f->fatalError = 1; return; } strlcpy(thisname, f->lastname, l1 + 1); read_sbuf(f, &thisname[l1], l2); thisname[l1 + l2] = 0; strlcpy(lastname, thisname, MAXPATHLEN); clean_fname(thisname, 0); if (f->sanitize_paths) { sanitize_path(thisname, thisname, "", 0); } if ((basename = strrchr(thisname, '/')) != NULL) { dirname_len = ++basename - thisname; /* counts future '\0' */ if (lastdir_len == dirname_len - 1 && strncmp(thisname, lastdir, lastdir_len) == 0) { dirname = lastdir; dirname_len = 0; /* indicates no copy is needed */ } else dirname = thisname; } else { basename = thisname; dirname = NULL; dirname_len = 0; } basename_len = strlen(basename) + 1; /* count the '\0' */ file_length = read_longint(f); if (!(flags & XMIT_SAME_TIME)) modtime = (time_t)read_int(f); if (!(flags & XMIT_SAME_MODE)) mode = from_wire_mode(read_int(f)); if (f->preserve_uid && !(flags & XMIT_SAME_UID)) uid = (uid_t)read_int(f); if (f->preserve_gid && !(flags & XMIT_SAME_GID)) gid = (gid_t)read_int(f); if (f->preserve_devices) { if (f->protocol_version < 28) { if (IS_DEVICE(mode)) { if (!(flags & XMIT_SAME_RDEV_pre28)) rdev = (dev_t)read_int(f); } else rdev = makedev(0, 0); } else if (IS_DEVICE(mode)) { uint32 rdev_minor; if (!(flags & XMIT_SAME_RDEV_MAJOR)) rdev_major = read_int(f); if (flags & XMIT_RDEV_MINOR_IS_SMALL) rdev_minor = read_byte(f); else rdev_minor = read_int(f); rdev = makedev(rdev_major, rdev_minor); } } if (f->preserve_links && S_ISLNK(mode)) { linkname_len = read_int(f) + 1; /* count the '\0' */ if (linkname_len <= 0 || linkname_len > MAXPATHLEN) { fprintf(stderr, "overflow on symlink: linkname_len=%d\n", linkname_len - 1); f->fatalError = 1; return; } } else { linkname_len = 0; } sum_len = f->always_checksum && S_ISREG(mode) ? MD4_SUM_LENGTH : 0; alloc_len = file_struct_len + dirname_len + basename_len + linkname_len + sum_len; /* * make sure we have enough input data left to complete the file * structure. * * TODO */ bp = pool_alloc(f->file_pool, alloc_len, "receive_file_entry"); file = *fptr = (struct file_struct *)bp; memset(bp, 0, file_struct_len); bp += file_struct_len; file->flags = flags & XMIT_TOP_DIR ? FLAG_TOP_DIR : 0; file->modtime = modtime; file->length = file_length; file->mode = mode; file->uid = uid; file->gid = gid; if (dirname_len) { file->dirname = lastdir = bp; lastdir_len = dirname_len - 1; memcpy(bp, dirname, dirname_len - 1); bp += dirname_len; bp[-1] = '\0'; if (f->sanitize_paths) lastdir_depth = count_dir_elements(lastdir); } else if (dirname) { file->dirname = dirname; } file->basename = bp; memcpy(bp, basename, basename_len); bp += basename_len; if (f->preserve_devices && IS_DEVICE(mode)) file->u.rdev = rdev; if (linkname_len) { file->u.link = bp; read_sbuf(f, bp, linkname_len - 1); if (f->sanitize_paths) sanitize_path(bp, bp, "", lastdir_depth); bp += linkname_len; } if (f->preserve_hard_links && f->protocol_version < 28 && S_ISREG(mode)) flags |= XMIT_HAS_IDEV_DATA; if (flags & XMIT_HAS_IDEV_DATA) { uint64 inode; if (f->protocol_version < 26) { dev = read_int(f); inode = read_int(f); } else { if (!(flags & XMIT_SAME_DEV)) dev = read_longint(f); inode = read_longint(f); } if (f->idev_pool) { file->link_u.idev = pool_talloc(f->idev_pool, struct idev, 1, "inode_table"); file->F_INODE = inode; file->F_DEV = dev; } /* fprintf(stderr, "Got inode %d, dev %d, idev = %p, idev_pool = %p\n", (int32)inode, (int32)dev, file->link_u.idev, f->idev_pool); */ } if (f->always_checksum) { char *sum; if (sum_len) { file->u.sum = sum = bp; /*bp += sum_len;*/ } else if (f->protocol_version < 28) { /* Prior to 28, we get a useless set of nulls. */ sum = empty_sum; } else sum = NULL; if (sum) { read_buf(f, sum, f->protocol_version < 21 ? 2 : MD4_SUM_LENGTH); } } /* * It's important that we don't update anything in f before * this point. If we ran out of input bytes then we need to * resume after the caller appends more bytes. */ if ( f->inError ) { pool_free(f->file_pool, alloc_len, bp); return; } f->modtime = modtime; f->mode = mode; f->dev = dev; f->rdev = rdev; f->rdev_major = rdev_major; f->uid = uid; f->gid = gid; strlcpy(f->lastname, lastname, MAXPATHLEN); f->lastname[MAXPATHLEN - 1] = 0; if ( lastdir ) f->lastdir = lastdir; f->lastdir_depth = lastdir_depth; f->lastdir_len = lastdir_len; /* fprintf(stderr, "Got name thisname %s\n", thisname); */ } static void writefd(struct file_list *f, char *buf, size_t len) { if ( !f->outBuf ) { f->outLen = 32768 + len; f->outBuf = malloc(f->outLen); } else if ( f->outPosn + len > f->outLen ) { f->outLen = 32768 + f->outPosn + len; f->outBuf = realloc(f->outBuf, f->outLen); } memcpy(f->outBuf + f->outPosn, buf, len); f->outPosn += len; } void write_int(struct file_list *f,int32 x) { char b[4]; b[0] = x >> 0; b[1] = x >> 8; b[2] = x >> 16; b[3] = x >> 24; writefd(f,b,4); } /* * Note: int64 may actually be a 32-bit type if ./configure couldn't find any * 64-bit types on this platform. */ void write_longint(struct file_list *f, int64 x) { char b[8]; if (x <= 0x7FFFFFFF) { write_int(f, (int)x); return; } #ifdef INT64_IS_OFF_T if (sizeof (int64) < 8) { fprintf(stderr, "write_longint: Integer overflow: attempted 64-bit offset\n"); } #endif write_int(f, (int32)0xFFFFFFFF); SIVAL(b,0,(x&0xFFFFFFFF)); SIVAL(b,4,((x>>32)&0xFFFFFFFF)); writefd(f,b,8); } void write_buf(struct file_list *f,char *buf,size_t len) { writefd(f,buf,len); } /* write a string to the connection */ void write_sbuf(struct file_list *f,char *buf) { write_buf(f, buf, strlen(buf)); } void write_byte(struct file_list *f,unsigned char c) { write_buf(f,(char *)&c,1); } void send_file_entry(struct file_list *f, struct file_struct *file, unsigned short base_flags) { time_t modtime = f->modtime; mode_t mode = f->mode; uint64 dev = f->dev; dev_t rdev = f->rdev; uint32 rdev_major = f->rdev_major; uid_t uid = f->uid; gid_t gid = f->gid; char lastname[MAXPATHLEN]; unsigned short flags; char fname[MAXPATHLEN]; int l1, l2; strlcpy(lastname, f->lastname, MAXPATHLEN); if (!file) { write_byte(f, 0); f->modtime = 0; f->mode = 0; f->dev = 0; f->rdev = makedev(0, 0); f->rdev_major = 0; f->uid = 0; f->gid = 0; *f->lastname = '\0'; return; } f_name_to(file, fname); flags = base_flags; if (file->mode == mode) flags |= XMIT_SAME_MODE; else mode = file->mode; if (f->preserve_devices) { if (f->protocol_version < 28) { if (IS_DEVICE(mode)) { if (file->u.rdev == rdev) flags |= XMIT_SAME_RDEV_pre28; else rdev = file->u.rdev; } else rdev = makedev(0, 0); } else if (IS_DEVICE(mode)) { rdev = file->u.rdev; if ((uint32)major(rdev) == rdev_major) flags |= XMIT_SAME_RDEV_MAJOR; else rdev_major = major(rdev); if ((uint32)minor(rdev) <= 0xFFu) flags |= XMIT_RDEV_MINOR_IS_SMALL; } } if (file->uid == uid) flags |= XMIT_SAME_UID; else uid = file->uid; if (file->gid == gid) flags |= XMIT_SAME_GID; else gid = file->gid; if (file->modtime == modtime) flags |= XMIT_SAME_TIME; else modtime = file->modtime; if (file->link_u.idev) { if (file->F_DEV == dev) { if (f->protocol_version >= 28) flags |= XMIT_SAME_DEV; } else dev = file->F_DEV; flags |= XMIT_HAS_IDEV_DATA; } for (l1 = 0; lastname[l1] && (fname[l1] == lastname[l1]) && (l1 < 255); l1++) {} l2 = strlen(fname+l1); if (l1 > 0) flags |= XMIT_SAME_NAME; if (l2 > 255) flags |= XMIT_LONG_NAME; /* We must make sure we don't send a zero flag byte or the * other end will terminate the flist transfer. Note that * the use of XMIT_TOP_DIR on a non-dir has no meaning, so * it's harmless way to add a bit to the first flag byte. */ if (f->protocol_version >= 28) { if (!flags && !S_ISDIR(mode)) flags |= XMIT_TOP_DIR; if ((flags & 0xFF00) || !flags) { flags |= XMIT_EXTENDED_FLAGS; write_byte(f, flags); write_byte(f, flags >> 8); } else write_byte(f, flags); } else { if (!(flags & 0xFF) && !S_ISDIR(mode)) flags |= XMIT_TOP_DIR; if (!(flags & 0xFF)) flags |= XMIT_LONG_NAME; write_byte(f, flags); } if (flags & XMIT_SAME_NAME) write_byte(f, l1); if (flags & XMIT_LONG_NAME) write_int(f, l2); else write_byte(f, l2); write_buf(f, fname + l1, l2); write_longint(f, file->length); if (!(flags & XMIT_SAME_TIME)) write_int(f, modtime); if (!(flags & XMIT_SAME_MODE)) write_int(f, to_wire_mode(mode)); if (f->preserve_uid && !(flags & XMIT_SAME_UID)) { /* TODO if (!numeric_ids) add_uid(uid); */ write_int(f, uid); } if (f->preserve_gid && !(flags & XMIT_SAME_GID)) { /* TODO if (!numeric_ids) add_gid(gid); */ write_int(f, gid); } if (f->preserve_devices && IS_DEVICE(mode)) { if (f->protocol_version < 28) { if (!(flags & XMIT_SAME_RDEV_pre28)) write_int(f, (int)rdev); } else { if (!(flags & XMIT_SAME_RDEV_MAJOR)) write_int(f, major(rdev)); if (flags & XMIT_RDEV_MINOR_IS_SMALL) write_byte(f, minor(rdev)); else write_int(f, minor(rdev)); } } if (f->preserve_links && S_ISLNK(mode)) { int len = strlen(file->u.link); write_int(f, len); write_buf(f, file->u.link, len); } if (flags & XMIT_HAS_IDEV_DATA) { if (f->protocol_version < 26) { /* 32-bit dev_t and ino_t */ write_int(f, dev); write_int(f, file->F_INODE); } else { /* 64-bit dev_t and ino_t */ if (!(flags & XMIT_SAME_DEV)) write_longint(f, dev); write_longint(f, file->F_INODE); /* fprintf(stderr, "file %s sending dev 0x%x%x, inode 0x%x%x\n", fname, (unsigned int)(file->F_DEV >> 32), (unsigned int)(file->F_DEV), (unsigned int)(file->F_INODE >> 32), (unsigned int)(file->F_INODE) ); */ } } if (f->always_checksum) { char *sum; if (S_ISREG(mode)) sum = file->u.sum; else if (f->protocol_version < 28) { /* Prior to 28, we sent a useless set of nulls. */ sum = empty_sum; } else sum = NULL; if (sum) { write_buf(f, sum, f->protocol_version < 21 ? 2 : MD4_SUM_LENGTH); } } f->modtime = modtime; f->mode = mode; f->dev = dev; f->rdev = rdev; f->rdev_major = rdev_major; f->uid = uid; f->gid = gid; strlcpy(f->lastname, fname, MAXPATHLEN); } int flistDecodeBytes(struct file_list *f, unsigned char *bytes, uint32 nBytes) { unsigned short flags; f->inBuf = bytes; f->inLen = nBytes; f->inFileStart = f->inPosn = 0; f->inError = 0; f->fatalError = 0; f->decodeDone = 0; for ( flags = read_byte(f); flags; flags = read_byte(f) ) { int i = f->count; flist_expand(f); if (f->protocol_version >= 28 && (flags & XMIT_EXTENDED_FLAGS)) flags |= read_byte(f) << 8; receive_file_entry(f, &f->files[i], flags); if ( f->inError ) { /* fprintf(stderr, "Returning on input error, posn = %d\n", f->inPosn); */ break; } #if 0 if (S_ISREG(f->files[i]->mode)) stats.total_size += f->files[i]->length; #endif f->count++; f->inFileStart = f->inPosn; } if ( f->fatalError ) { return -1; } else if ( f->inError ) { return f->inFileStart; } else { f->decodeDone = 1; return f->inPosn; } } #ifndef HAVE_STRLCPY /* Like strncpy but does not 0 fill the buffer and always null * terminates. bufsize is the size of the destination buffer. * * Returns the index of the terminating byte. */ size_t strlcpy(char *d, const char *s, size_t bufsize) { size_t len = strlen(s); size_t ret = len; if (bufsize <= 0) return 0; if (len >= bufsize) len = bufsize-1; memcpy(d, s, len); d[len] = 0; return ret; } #endif /* we need to supply our own strcmp function for file list comparisons to ensure that signed/unsigned usage is consistent between machines. */ int u_strcmp(const char *cs1, const char *cs2) { const uchar *s1 = (const uchar *)cs1; const uchar *s2 = (const uchar *)cs2; while (*s1 && *s2 && (*s1 == *s2)) { s1++; s2++; } return (int)*s1 - (int)*s2; } /* * XXX: This is currently the hottest function while building the file * list, because building f_name()s every time is expensive. **/ int file_compare(struct file_struct **file1, struct file_struct **file2) { struct file_struct *f1 = *file1; struct file_struct *f2 = *file2; if (!f1->basename && !f2->basename) return 0; if (!f1->basename) return -1; if (!f2->basename) return 1; if (f1->dirname == f2->dirname) return u_strcmp(f1->basename, f2->basename); return f_name_cmp(f1, f2); } int flist_find(struct file_list *flist, struct file_struct *f) { int low = 0, high = flist->count - 1; while (high >= 0 && !flist->files[high]->basename) high--; if (high < 0) return -1; while (low != high) { int mid = (low + high) / 2; int ret = file_compare(&flist->files[flist_up(flist, mid)],&f); if (ret == 0) return flist_up(flist, mid); if (ret > 0) high = mid; else low = mid + 1; } if (file_compare(&flist->files[flist_up(flist, low)], &f) == 0) return flist_up(flist, low); return -1; } /* * Free up any resources a file_struct has allocated * and clear the file. */ void clear_file(int i, struct file_list *flist) { if (flist->idev_pool && flist->files[i]->link_u.idev) pool_free(flist->idev_pool, 0, flist->files[i]->link_u.idev); memset(flist->files[i], 0, file_struct_len); } struct file_list *flist_new(int with_hlink, char *msg, int preserve_hard_links) { struct file_list *flist; init_flist(); flist = new(struct file_list); if (!flist) out_of_memory(msg); memset(flist, 0, sizeof (struct file_list)); if (!(flist->file_pool = pool_create(FILE_EXTENT, 0, out_of_memory, POOL_INTERN))) out_of_memory(msg); if (with_hlink && preserve_hard_links) { if (!(flist->idev_pool = pool_create(HLINK_EXTENT, sizeof (struct idev), out_of_memory, POOL_INTERN))) out_of_memory(msg); } return flist; } /* * free up all elements in a flist */ void flist_free(struct file_list *flist) { pool_destroy(flist->file_pool); pool_destroy(flist->idev_pool); pool_destroy(flist->hlink_pool); free(flist->files); if ( flist->hlink_list ) free(flist->hlink_list); if ( flist->exclude_list.head ) clear_exclude_list(&flist->exclude_list); free(flist); } /* * This routine ensures we don't have any duplicate names in our file list. * duplicate names can cause corruption because of the pipelining */ void clean_flist(struct file_list *flist, int strip_root, int no_dups) { int i, prev_i = 0; if (!flist || flist->count == 0) return; qsort(flist->files, flist->count, sizeof flist->files[0], (int (*)())file_compare); for (i = no_dups? 0 : flist->count; i < flist->count; i++) { if (flist->files[i]->basename) { prev_i = i; break; } } while (++i < flist->count) { if (!flist->files[i]->basename) continue; if (f_name_cmp(flist->files[i], flist->files[prev_i]) == 0) { /* fprintf(stderr, "removing duplicate name %s from file list %d\n", f_name(flist->files[i]), i); */ /* Make sure that if we unduplicate '.', that we don't * lose track of a user-specified starting point (or * else deletions will mysteriously fail with -R). */ if (flist->files[i]->flags & FLAG_TOP_DIR) flist->files[prev_i]->flags |= FLAG_TOP_DIR; clear_file(i, flist); } else prev_i = i; } if (strip_root) { /* we need to strip off the root directory in the case of relative paths, but this must be done _after_ the sorting phase */ for (i = 0; i < flist->count; i++) { if (flist->files[i]->dirname && flist->files[i]->dirname[0] == '/') { memmove(&flist->files[i]->dirname[0], &flist->files[i]->dirname[1], strlen(flist->files[i]->dirname)); } if (flist->files[i]->dirname && !flist->files[i]->dirname[0]) { flist->files[i]->dirname = NULL; } } } } enum fnc_state { fnc_DIR, fnc_SLASH, fnc_BASE }; /* Compare the names of two file_struct entities, just like strcmp() * would do if it were operating on the joined strings. We assume * that there are no 0-length strings. */ int f_name_cmp(struct file_struct *f1, struct file_struct *f2) { int dif; const uchar *c1, *c2; enum fnc_state state1, state2; if (!f1 || !f1->basename) { if (!f2 || !f2->basename) return 0; return -1; } if (!f2 || !f2->basename) return 1; if (!(c1 = (uchar*)f1->dirname)) { state1 = fnc_BASE; c1 = (uchar*)f1->basename; } else if (!*c1) { state1 = fnc_SLASH; c1 = (uchar*)"/"; } else state1 = fnc_DIR; if (!(c2 = (uchar*)f2->dirname)) { state2 = fnc_BASE; c2 = (uchar*)f2->basename; } else if (!*c2) { state2 = fnc_SLASH; c2 = (uchar*)"/"; } else state2 = fnc_DIR; while (1) { if ((dif = (int)*c1 - (int)*c2) != 0) break; if (!*++c1) { switch (state1) { case fnc_DIR: state1 = fnc_SLASH; c1 = (uchar*)"/"; break; case fnc_SLASH: state1 = fnc_BASE; c1 = (uchar*)f1->basename; break; case fnc_BASE: break; } } if (!*++c2) { switch (state2) { case fnc_DIR: state2 = fnc_SLASH; c2 = (uchar*)"/"; break; case fnc_SLASH: state2 = fnc_BASE; c2 = (uchar*)f2->basename; break; case fnc_BASE: if (!*c1) return 0; break; } } } return dif; } /* Return a copy of the full filename of a flist entry, using the indicated * buffer. No size-checking is done because we checked the size when creating * the file_struct entry. */ char *f_name_to(struct file_struct *f, char *fbuf) { if (!f || !f->basename) return NULL; if (f->dirname) { int len = strlen(f->dirname); memcpy(fbuf, f->dirname, len); fbuf[len] = '/'; strcpy(fbuf + len + 1, f->basename); } else strcpy(fbuf, f->basename); return fbuf; } /* Like f_name_to(), but we rotate through 5 static buffers of our own. */ char *f_name(struct file_struct *f) { static char names[5][MAXPATHLEN]; static unsigned int n; n = (n + 1) % (sizeof names / sizeof names[0]); return f_name_to(f, names[n]); } /* Turns multiple adjacent slashes into a single slash, gets rid of "./" * elements (but not a trailing dot dir), removes a trailing slash, and * optionally collapses ".." elements (except for those at the start of the * string). If the resulting name would be empty, change it into a ".". */ unsigned int clean_fname(char *name, BOOL collapse_dot_dot) { char *limit = name - 1, *t = name, *f = name; int anchored; if (!name) return 0; if ((anchored = *f == '/') != 0) *t++ = *f++; while (*f) { /* discard extra slashes */ if (*f == '/') { f++; continue; } if (*f == '.') { /* discard "." dirs (but NOT a trailing '.'!) */ if (f[1] == '/') { f += 2; continue; } /* collapse ".." dirs */ if (collapse_dot_dot && f[1] == '.' && (f[2] == '/' || !f[2])) { char *s = t - 1; if (s == name && anchored) { f += 2; continue; } while (s > limit && *--s != '/') {} if (s != t - 1 && (s < name || *s == '/')) { t = s + 1; f += 2; continue; } limit = t + 2; } } while (*f && (*t++ = *f++) != '/') {} } if (t > name+anchored && t[-1] == '/') t--; if (t == name) *t++ = '.'; *t = '\0'; return t - name; } /* Make path appear as if a chroot had occurred. This handles a leading * "/" (either removing it or expanding it) and any leading or embedded * ".." components that attempt to escape past the module's top dir. * * If dest is NULL, a buffer is allocated to hold the result. It is legal * to call with the dest and the path (p) pointing to the same buffer, but * rootdir will be ignored to avoid expansion of the string. * * The rootdir string contains a value to use in place of a leading slash. * Specify NULL to get the default of lp_path(module_id). * * If depth is > 0, it is a count of how many '..'s to allow at the start * of the path. * * We also clean the path in a manner similar to clean_fname() but with a * few differences: * * Turns multiple adjacent slashes into a single slash, gets rid of "." dir * elements (INCLUDING a trailing dot dir), PRESERVES a trailing slash, and * ALWAYS collapses ".." elements (except for those at the start of the * string up to "depth" deep). If the resulting name would be empty, * change it into a ".". */ char *sanitize_path(char *dest, const char *p, const char *rootdir, int depth) { char *start, *sanp; int rlen = 0; if (dest != p) { int plen = strlen(p); if (*p == '/') { if (!rootdir) rootdir = ""; rlen = strlen(rootdir); depth = 0; p++; } if (dest) { if (rlen + plen + 1 >= MAXPATHLEN) return NULL; } else if (!(dest = new_array(char, rlen + plen + 1))) out_of_memory("sanitize_path"); if (rlen) { memcpy(dest, rootdir, rlen); if (rlen > 1) dest[rlen++] = '/'; } } start = sanp = dest + rlen; while (*p != '\0') { /* discard leading or extra slashes */ if (*p == '/') { p++; continue; } /* this loop iterates once per filename component in p. * both p (and sanp if the original had a slash) should * always be left pointing after a slash */ if (*p == '.' && (p[1] == '/' || p[1] == '\0')) { /* skip "." component */ p++; continue; } if (*p == '.' && p[1] == '.' && (p[2] == '/' || p[2] == '\0')) { /* ".." component followed by slash or end */ if (depth <= 0 || sanp != start) { p += 2; if (sanp != start) { /* back up sanp one level */ --sanp; /* now pointing at slash */ while (sanp > start && sanp[-1] != '/') { /* skip back up to slash */ sanp--; } } continue; } /* allow depth levels of .. at the beginning */ depth--; /* move the virtual beginning to leave the .. alone */ start = sanp + 3; } /* copy one component through next slash */ while (*p && (*sanp++ = *p++) != '/') {} } if (sanp == dest) { /* ended up with nothing, so put in "." component */ *sanp++ = '.'; } *sanp = '\0'; return dest; } void out_of_memory(char *str) { fprintf(stderr, "ERROR: File::RsyncP out of memory in %s\n", str); exit(1); } int count_dir_elements(const char *p) { int cnt = 0, new_component = 1; while (*p) { if (*p++ == '/') new_component = 1; else if (new_component) { new_component = 0; cnt++; } } return cnt; } #define MALLOC_MAX 0x40000000 void *_new_array(unsigned int size, unsigned long num) { if (num >= MALLOC_MAX/size) return NULL; return malloc(size * num); } void *_realloc_array(void *ptr, unsigned int size, unsigned long num) { if (num >= MALLOC_MAX/size) return NULL; /* No realloc should need this, but just in case... */ if (!ptr) return malloc(size * num); return realloc(ptr, size * num); } File-RsyncP-0.74/FileList/hlink.c0000444000076500000240000001076411423121572015477 0ustar craigstaff/* Copyright (C) Andrew Tridgell 1996 Copyright (C) Paul Mackerras 1996 Copyright (C) 2002 by Martin Pool 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "rsync.h" static int hlink_compare(struct file_struct **file1, struct file_struct **file2) { struct file_struct *f1 = *file1; struct file_struct *f2 = *file2; if (f1->F_DEV != f2->F_DEV) return (int) (f1->F_DEV > f2->F_DEV ? 1 : -1); if (f1->F_INODE != f2->F_INODE) return (int) (f1->F_INODE > f2->F_INODE ? 1 : -1); return file_compare(file1, file2); } #define LINKED(p1,p2) ((p1)->F_DEV == (p2)->F_DEV \ && (p1)->F_INODE == (p2)->F_INODE) /* Analyze the data in the hlink_list[], remove items that aren't multiply * linked, and replace the dev+inode data with the to+next linked list. */ static void link_idev_data(struct file_list *flist) { struct file_struct *head; int from, start; alloc_pool_t hlink_pool; alloc_pool_t idev_pool = flist->hlink_pool; struct file_struct **hlink_list = flist->hlink_list; unsigned int hlink_count = flist->hlink_count; hlink_pool = pool_create(128 * 1024, sizeof (struct hlink), out_of_memory, POOL_INTERN); for (from = 0; from < hlink_count;) { start = from; head = hlink_list[start]; from++; while (from < hlink_count && LINKED(head, hlink_list[from])) { pool_free(idev_pool, 0, hlink_list[from]->link_u.idev); hlink_list[from]->link_u.links = pool_talloc(hlink_pool, struct hlink, 1, "hlink_list"); /* printf("setting %p->to (%s/%s) to %p (%s/%s)\n", hlink_list[from], hlink_list[from]->dirname, hlink_list[from]->basename, head, head->dirname, head->basename); */ hlink_list[from]->link_u.links->to = head; hlink_list[from]->link_u.links->next = NULL; /* not used */ from++; } if (from > start) { /* * link to self */ pool_free(idev_pool, 0, head->link_u.idev); head->link_u.links = pool_talloc(hlink_pool, struct hlink, 1, "hlink_list"); head->link_u.links->to = head; head->link_u.links->next = NULL; /* not used */ } else { pool_free(idev_pool, 0, head->link_u.idev); head->link_u.idev = NULL; } } free(flist->hlink_list); flist->hlink_list = NULL; flist->hlink_pool = hlink_pool; flist->link_idev_data_done = 1; pool_destroy(idev_pool); } void init_hard_links(struct file_list *flist) { int i; struct file_struct **hlink_list; unsigned int hlink_count; if (flist->count < 2) return; if (flist->hlink_list) free(flist->hlink_list); if (!(flist->hlink_list = new_array(struct file_struct *, flist->count))) out_of_memory("init_hard_links"); hlink_list = flist->hlink_list; hlink_count = 0; for (i = 0; i < flist->count; i++) { if (flist->files[i]->link_u.idev) { /* printf("init_hard_links: file %d has link %p\n", i, flist->files[i]->link_u.idev->inode); printf("setting hlink_list[%d] to %p (%s/%s)\n", hlink_count, flist->files[i], flist->files[i]->dirname, flist->files[i]->basename); */ hlink_list[hlink_count++] = flist->files[i]; } } qsort(hlink_list, hlink_count, sizeof hlink_list[0], (int (*)()) hlink_compare); if (!hlink_count) { free(hlink_list); hlink_list = NULL; flist->hlink_list = hlink_list; flist->hlink_count = hlink_count; } else { flist->hlink_list = hlink_list; flist->hlink_count = hlink_count; link_idev_data(flist); } } File-RsyncP-0.74/FileList/install-sh0000555000076500000240000001124511423121572016225 0ustar craigstaff#! /bin/sh # # install - install a program, script, or datafile # This comes from X11R5. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. # # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/_inst.$$_ # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 File-RsyncP-0.74/FileList/Makefile.PL0000444000076500000240000000174711423121572016201 0ustar craigstaffuse ExtUtils::MakeMaker; # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. WriteMakefile( 'NAME' => 'File::RsyncP::FileList', 'VERSION_FROM' => 'FileList.pm', # finds $VERSION 'LIBS' => ['-lm'], # e.g., '-lm' 'DEFINE' => '-DPERL_BYTEORDER=$(BYTEORDER)', 'INC' => '', # e.g., '-I/usr/include/other' 'NORECURS' => 1, 'OBJECT' => q[FileList$(OBJ_EXT) exclude$(OBJ_EXT) flist$(OBJ_EXT) hlink$(OBJ_EXT) pool_alloc$(OBJ_EXT) snprintf$(OBJ_EXT) wildmatch$(OBJ_EXT) ], 'depend' => { 'FileList.o' => 'config.h' }, 'clean' => {FILES => "configure.in config.log config.status config.h conftest* confdefs*"}, ); sub MY::postamble { return <size = size /* round extent size to min alignment reqs */ ? (size + MINALIGN - 1) & ~(MINALIGN - 1) : POOL_DEF_EXTENT; if (pool->flags & POOL_INTERN) { pool->size -= sizeof (struct pool_extent); flags |= POOL_APPEND; } pool->quantum = quantum ? quantum : MINALIGN; pool->bomb = bomb; pool->flags = flags; return pool; } void pool_destroy(alloc_pool_t p) { struct alloc_pool *pool = (struct alloc_pool *) p; struct pool_extent *cur, *next; if (!pool) return; if (pool->live) { cur = pool->live; free(cur->start); if (!(pool->flags & POOL_APPEND)) free(cur); } for (cur = pool->free; cur; cur = next) { next = cur->next; free(cur->start); if (!(pool->flags & POOL_APPEND)) free(cur); } free(pool); } void * pool_alloc(alloc_pool_t p, size_t len, char *bomb) { struct alloc_pool *pool = (struct alloc_pool *) p; if (!pool) return NULL; if (!len) len = pool->quantum; else if (pool->quantum > 1 && len % pool->quantum) len += pool->quantum - len % pool->quantum; if (len > pool->size) goto bomb; if (!pool->live || len > pool->live->free) { void *start; size_t free; size_t bound; size_t sqew; size_t asize; if (pool->live) { pool->live->next = pool->free; pool->free = pool->live; } free = pool->size; bound = 0; asize = pool->size; if (pool->flags & POOL_APPEND) asize += sizeof (struct pool_extent); if (!(start = (void *) malloc(asize))) goto bomb; if (pool->flags & POOL_CLEAR) memset(start, 0, pool->size); if (pool->flags & POOL_APPEND) { pool->live = PTR_ADD(start, free); } else if (!(pool->live = (struct pool_extent *) malloc(sizeof (struct pool_extent)))) { goto bomb; } if (pool->flags & POOL_QALIGN && pool->quantum > 1 && (sqew = (size_t)PTR_ADD(start, free) % pool->quantum)) { bound += sqew; free -= sqew; } pool->live->start = start; pool->live->free = free; pool->live->bound = bound; pool->live->next = NULL; pool->e_created++; } pool->n_allocated++; pool->b_allocated += len; pool->live->free -= len; return PTR_ADD(pool->live->start, pool->live->free); bomb: if (pool->bomb) (*pool->bomb)(bomb); return NULL; } void pool_free(alloc_pool_t p, size_t len, void *addr) { struct alloc_pool *pool = (struct alloc_pool *) p; struct pool_extent *cur; struct pool_extent *prev; if (!pool) return; if (!len) len = pool->quantum; else if (pool->quantum > 1 && len % pool->quantum) len += pool->quantum - len % pool->quantum; if (!addr && pool->live) { pool->live->next = pool->free; pool->free = pool->live; pool->live = NULL; return; } pool->n_freed++; pool->b_freed += len; cur = pool->live; if (cur && addr >= cur->start && addr < PTR_ADD(cur->start, pool->size)) { if (addr == PTR_ADD(cur->start, cur->free)) { if (pool->flags & POOL_CLEAR) memset(addr, 0, len); pool->b_freed += len; } else { cur->bound += len; } if (cur->free + cur->bound >= pool->size) { size_t sqew; cur->free = pool->size; cur->bound = 0; if (pool->flags & POOL_QALIGN && pool->quantum > 1 && (sqew = (size_t)PTR_ADD(cur->start, cur->free) % pool->quantum)) { cur->bound += sqew; cur->free -= sqew; } } return; } for (prev = NULL, cur = pool->free; cur; prev = cur, cur = cur->next) { if (addr >= cur->start && addr < PTR_ADD(cur->start, pool->size)) break; } if (!cur) return; if (prev) { prev->next = cur->next; cur->next = pool->free; pool->free = cur; } cur->bound += len; if (cur->free + cur->bound >= pool->size) { pool->free = cur->next; free(cur->start); if (!(pool->flags & POOL_APPEND)) free(cur); pool->e_freed++; } return; } File-RsyncP-0.74/FileList/pool_alloc.h0000444000076500000240000000133511423121572016514 0ustar craigstaff#include #define POOL_CLEAR (1<<0) /* zero fill allocations */ #define POOL_QALIGN (1<<1) /* align data to quanta */ #define POOL_INTERN (1<<2) /* Allocate extent structures */ #define POOL_APPEND (1<<3) /* or appended to extent data */ typedef void *alloc_pool_t; alloc_pool_t pool_create(size_t size, size_t quantum, void (*bomb)(char *), int flags); void pool_destroy(alloc_pool_t pool); void *pool_alloc(alloc_pool_t pool, size_t size, char *bomb); void pool_free(alloc_pool_t pool, size_t size, void *addr); #define pool_talloc(pool, type, count, bomb) \ ((type *)pool_alloc(pool, sizeof(type) * count, bomb)) #define pool_tfree(pool, type, count, addr) \ (pool_free(pool, sizeof(type) * count, addr)) File-RsyncP-0.74/FileList/proto.h0000444000076500000240000002616111423121572015540 0ustar craigstaff/* This file is automatically generated with "make proto". DO NOT EDIT */ int allow_access(char *addr, char *host, char *allow_list, char *deny_list); void base64_encode(char *buf, int len, char *out); char *auth_server(int f_in, int f_out, int module, char *addr, char *leader); void auth_client(int fd, char *user, char *challenge); int make_backup(char *fname); void write_stream_flags(int fd); void read_stream_flags(int fd); void write_batch_shell_file(int argc, char *argv[], int file_arg_cnt); void show_flist(int index, struct file_struct **fptr); void show_argvs(int argc, char *argv[]); uint32 get_checksum1(char *buf1,int len); void get_checksum2(char *buf,int len,char *sum); void file_checksum(char *fname,char *sum,OFF_T size); void sum_init(int seed); void sum_update(char *p, int len); void sum_end(char *sum); void close_all(void); void _exit_cleanup(int code, const char *file, int line); void cleanup_disable(void); void cleanup_set(char *fnametmp, char *fname, struct file_struct *file, int fd_r, int fd_w); void cleanup_set_pid(pid_t pid); char *client_addr(int fd); char *client_name(int fd); int start_socket_client(char *host, char *path, int argc, char *argv[]); int start_inband_exchange(char *user, char *path, int f_in, int f_out, int argc); int start_daemon(int f_in, int f_out); int daemon_main(void); void setup_protocol(int f_out,int f_in); int claim_connection(char *fname,int max_connections); void clear_exclude_list(struct exclude_list_struct *listp); int check_exclude(struct file_list *f, char *name, int name_is_dir); void add_exclude(struct file_list *f, const char *pattern, int xflags); void add_exclude_file(struct file_list *f, const char *fname, int xflags); void send_exclude_list(struct file_list *f); void recv_exclude_list(struct file_list *f); void add_cvs_excludes(struct file_list *f); int sparse_end(int f); int flush_write_file(int f); int write_file(int f,char *buf,size_t len); struct map_struct *map_file(int fd, OFF_T len, OFF_T map_size, size_t block_size); char *map_ptr(struct map_struct *map,OFF_T offset,int len); int unmap_file(struct map_struct *map); void init_flist(void); void show_flist_stats(void); int readlink_stat(const char *path, STRUCT_STAT *buffer, char *linkbuf); int link_stat(const char *path, STRUCT_STAT *buffer, int follow_dirlinks); void flist_expand(struct file_list *flist); void send_file_entry(struct file_list *flist, struct file_struct *file, unsigned short base_flags); void receive_file_entry(struct file_list *f, struct file_struct **fptr, unsigned short flags); struct file_struct *make_file(char *fname, struct file_list *flist, int exclude_level); void send_file_name(int f, struct file_list *flist, char *fname, int recursive, unsigned short base_flags); struct file_list *send_file_list(int f, int argc, char *argv[]); struct file_list *recv_file_list(int f); int file_compare(struct file_struct **file1, struct file_struct **file2); int flist_find(struct file_list *flist, struct file_struct *f); void clear_file(int i, struct file_list *flist); struct file_list *flist_new(int with_hlink, char *msg, int preserve_hard_links); void flist_free(struct file_list *flist); int flistDecodeBytes(struct file_list *f, unsigned char *bytes, uint32 nBytes); void clean_flist(struct file_list *flist, int strip_root, int no_dups); int f_name_cmp(struct file_struct *f1, struct file_struct *f2); char *f_name_to(struct file_struct *f, char *fbuf); char *f_name(struct file_struct *f); void write_sum_head(int f, struct sum_struct *sum); void generate_files(int f_out, struct file_list *flist, char *local_name); void init_hard_links(struct file_list *flist); int hard_link_check(struct file_struct *file, int skip); void do_hard_links(void); void io_set_sock_fds(int f_in, int f_out); void set_msg_fd_in(int fd); void set_msg_fd_out(int fd); void send_msg(enum msgcode code, char *buf, int len); int msg_list_push(int flush_it_all); int get_redo_num(void); void io_set_filesfrom_fds(int f_in, int f_out); int read_filesfrom_line(int fd, char *fname); void io_start_buffering_out(void); void io_start_buffering_in(void); void io_end_buffering(void); int32 read_int(struct file_list *f); int64 read_longint(struct file_list *f); void read_buf(struct file_list *f,char *buf,size_t len); void read_sbuf(struct file_list *f,char *buf,size_t len); unsigned char read_byte(struct file_list *f); void io_flush(int flush_it_all); void write_int(struct file_list *f,int32 x); void write_int_named(struct file_list *f, int32 x, const char *phase); void write_longint(struct file_list *f, int64 x); void write_buf(struct file_list *f,char *buf,size_t len); void write_sbuf(struct file_list *f, char *buf); void write_byte(struct file_list *f,unsigned char c); int read_line(struct file_list *f, char *buf, size_t maxlen); void io_printf(int fd, const char *format, ...); void io_start_multiplex_out(void); void io_start_multiplex_in(void); int io_multiplex_write(enum msgcode code, char *buf, size_t len); void close_multiplexing_in(void); void close_multiplexing_out(void); void start_write_batch(int fd); void stop_write_batch(void); char *lp_motd_file(void); char *lp_log_file(void); char *lp_pid_file(void); char *lp_socket_options(void); int lp_syslog_facility(void); int lp_max_verbosity(void); char *lp_name(int ); char *lp_comment(int ); char *lp_path(int ); char *lp_lock_file(int ); BOOL lp_read_only(int ); BOOL lp_write_only(int ); BOOL lp_list(int ); BOOL lp_use_chroot(int ); BOOL lp_transfer_logging(int ); BOOL lp_ignore_errors(int ); BOOL lp_ignore_nonreadable(int ); char *lp_uid(int ); char *lp_gid(int ); char *lp_hosts_allow(int ); char *lp_hosts_deny(int ); char *lp_auth_users(int ); char *lp_secrets_file(int ); BOOL lp_strict_modes(int ); char *lp_exclude(int ); char *lp_exclude_from(int ); char *lp_include(int ); char *lp_include_from(int ); char *lp_log_format(int ); char *lp_refuse_options(int ); char *lp_dont_compress(int ); int lp_timeout(int ); int lp_max_connections(int ); BOOL lp_load(char *pszFname, int globals_only); int lp_numservices(void); int lp_number(char *name); void log_init(void); void log_open(void); void log_close(void); void rwrite(enum logcode code, char *buf, int len); void rprintf(enum logcode code, const char *format, ...); void rsyserr(enum logcode code, int errcode, const char *format, ...); void rflush(enum logcode code); void log_send(struct file_struct *file, struct stats *initial_stats); void log_recv(struct file_struct *file, struct stats *initial_stats); void log_exit(int code, const char *file, int line); void wait_process(pid_t pid, int *status); int child_main(int argc, char *argv[]); void start_server(int f_in, int f_out, int argc, char *argv[]); int client_run(int f_in, int f_out, pid_t pid, int argc, char *argv[]); const char *get_panic_action(void); int main(int argc,char *argv[]); void match_sums(int f, struct sum_struct *s, struct map_struct *buf, OFF_T len); void match_report(void); void usage(enum logcode F); void option_error(void); int parse_arguments(int *argc, const char ***argv, int frommain); void server_options(char **args,int *argc); char *find_colon(char *s); BOOL pm_process( char *FileName, BOOL (*sfunc)(char *), BOOL (*pfunc)(char *, char *) ); pid_t piped_child(char **command, int *f_in, int *f_out); pid_t local_child(int argc, char **argv, int *f_in, int *f_out, int (*child_main)(int, char*[])); void end_progress(OFF_T size); void show_progress(OFF_T ofs, OFF_T size); void delete_files(struct file_list *flist); int recv_files(int f_in, struct file_list *flist, char *local_name); void free_sums(struct sum_struct *s); int delete_file(char *fname); int set_perms(char *fname,struct file_struct *file,STRUCT_STAT *st, int flags); void sig_int(void); void finish_transfer(char *fname, char *fnametmp, struct file_struct *file, int ok_to_set_time); const char *who_am_i(void); void read_sum_head(int f, struct sum_struct *sum); void send_files(struct file_list *flist, int f_out, int f_in); int try_bind_local(int s, int ai_family, int ai_socktype, const char *bind_address); int open_socket_out(char *host, int port, const char *bind_address, int af_hint); int open_socket_out_wrapped(char *host, int port, const char *bind_address, int af_hint); int is_a_socket(int fd); void start_accept_loop(int port, int (*fn)(int, int)); void set_socket_options(int fd, char *options); void become_daemon(void); int sock_exec(const char *prog); int do_unlink(char *fname); int do_symlink(char *fname1, char *fname2); int do_link(char *fname1, char *fname2); int do_lchown(const char *path, uid_t owner, gid_t group); int do_mknod(char *pathname, mode_t mode, dev_t dev); int do_rmdir(char *pathname); int do_chmod(const char *path, mode_t mode); int do_rename(char *fname1, char *fname2); void trim_trailing_slashes(char *name); int do_mkdir(char *fname, mode_t mode); int do_mkstemp(char *template, mode_t perms); int do_stat(const char *fname, STRUCT_STAT *st); int do_lstat(const char *fname, STRUCT_STAT *st); int do_fstat(int fd, STRUCT_STAT *st); OFF_T do_lseek(int fd, OFF_T offset, int whence); void *do_mmap(void *start, int len, int prot, int flags, int fd, OFF_T offset); char *d_name(struct dirent *di); void set_compression(char *fname); void send_token(int f,int token,struct map_struct *buf,OFF_T offset, int n,int toklen); int recv_token(int f,char **data); void see_token(char *data, int toklen); void add_uid(uid_t uid); void add_gid(gid_t gid); void send_uid_list(int f); void recv_uid_list(int f, struct file_list *flist); void set_nonblocking(int fd); void set_blocking(int fd); int fd_pair(int fd[2]); void print_child_argv(char **cmd); void out_of_memory(char *str); void overflow(char *str); int set_modtime(char *fname, time_t modtime); int create_directory_path(char *fname, int base_umask); int copy_file(char *source, char *dest, mode_t mode); int robust_unlink(char *fname); int robust_rename(char *from, char *to, int mode); pid_t do_fork(void); void kill_all(int sig); int name_to_uid(char *name, uid_t *uid); int name_to_gid(char *name, gid_t *gid); int lock_range(int fd, int offset, int len); void glob_expand(char *base1, char ***argv_ptr, int *argc_ptr, int *maxargs_ptr); void strlower(char *s); size_t pathjoin(char *dest, size_t destsize, const char *p1, const char *p2); size_t stringjoin(char *dest, size_t destsize, ...); int count_dir_elements(const char *p); unsigned int clean_fname(char *name, BOOL collapse_dot_dot); char *sanitize_path(char *dest, const char *p, const char *rootdir, int depth); int push_dir(char *dir); int pop_dir(char *dir); const char *safe_fname(const char *fname); char *full_fname(const char *fn); char *partial_dir_fname(const char *fname); int handle_partial_dir(const char *fname, int create); int u_strcmp(const char *cs1, const char *cs2); int unsafe_symlink(const char *dest, const char *src); char *timestring(time_t t); int msleep(int t); int cmp_modtime(time_t file1, time_t file2); int _Insure_trap_error(int a1, int a2, int a3, int a4, int a5, int a6); void *_new_array(unsigned int size, unsigned long num); void *_realloc_array(void *ptr, unsigned int size, unsigned long num); int sys_gettimeofday(struct timeval *tv); File-RsyncP-0.74/FileList/rsync.h0000444000076500000240000004547211423121572015541 0ustar craigstaff/* Copyright (C) by Andrew Tridgell 1996, 2000 Copyright (C) Paul Mackerras 1996 Copyright (C) 2001, 2002 by Martin Pool 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define False 0 #define True 1 #define BLOCK_SIZE 700 #define RSYNC_RSH_ENV "RSYNC_RSH" #define RSYNC_RSH_IO_ENV "RSYNC_RSH_IO" #define RSYNC_NAME "rsync" /* RSYNCD_SYSCONF is now set in config.h */ #define RSYNCD_USERCONF "rsyncd.conf" #define DEFAULT_LOCK_FILE "/var/run/rsyncd.lock" #define URL_PREFIX "rsync://" #define BACKUP_SUFFIX "~" /* a non-zero CHAR_OFFSET makes the rolling sum stronger, but is incompatible with older versions :-( */ #define CHAR_OFFSET 0 /* These flags are only used during the flist transfer. */ #define XMIT_TOP_DIR (1<<0) #define XMIT_SAME_MODE (1<<1) #define XMIT_EXTENDED_FLAGS (1<<2) #define XMIT_SAME_RDEV_pre28 XMIT_EXTENDED_FLAGS /* Only in protocols < 28 */ #define XMIT_SAME_UID (1<<3) #define XMIT_SAME_GID (1<<4) #define XMIT_SAME_NAME (1<<5) #define XMIT_LONG_NAME (1<<6) #define XMIT_SAME_TIME (1<<7) #define XMIT_SAME_RDEV_MAJOR (1<<8) #define XMIT_HAS_IDEV_DATA (1<<9) #define XMIT_SAME_DEV (1<<10) #define XMIT_RDEV_MINOR_IS_SMALL (1<<11) /* These flags are used in the live flist data. */ #define FLAG_TOP_DIR (1<<0) #define FLAG_HLINK_EOL (1<<1) /* generator only */ #define FLAG_MOUNT_POINT (1<<2) /* sender only */ #define FLAG_USER_BOOL (1<<12) /* for File::RsyncP partials */ /* update this if you make incompatible changes */ #define PROTOCOL_VERSION 28 /* We refuse to interoperate with versions that are not in this range. * Note that we assume we'll work with later versions: the onus is on * people writing them to make sure that they don't send us anything * we won't understand. * * Interoperation with old but supported protocol versions * should cause a warning to be printed. At a future date * the old protocol will become the minimum and * compatibility code removed. * * There are two possible explanations for the limit at * MAX_PROTOCOL_VERSION: either to allow new major-rev versions that * do not interoperate with us, and (more likely) so that we can * detect an attempt to connect rsync to a non-rsync server, which is * unlikely to begin by sending a byte between MIN_PROTOCL_VERSION and * MAX_PROTOCOL_VERSION. */ #define MIN_PROTOCOL_VERSION 20 #define OLD_PROTOCOL_VERSION 25 #define MAX_PROTOCOL_VERSION 40 #define RSYNC_PORT 873 #define SPARSE_WRITE_SIZE (1024) #define WRITE_SIZE (32*1024) #define CHUNK_SIZE (32*1024) #define MAX_MAP_SIZE (256*1024) #define IO_BUFFER_SIZE (4092) #define IOERR_GENERAL (1<<0) /* For backward compatibility, this must == 1 */ #define IOERR_VANISHED (1<<1) #define MAX_ARGS 1000 #define MPLEX_BASE 7 #define NO_EXCLUDES 0 #define SERVER_EXCLUDES 1 #define ALL_EXCLUDES 2 #define XFLG_FATAL_ERRORS (1<<0) #define XFLG_DEF_INCLUDE (1<<1) #define XFLG_WORDS_ONLY (1<<2) #define XFLG_WORD_SPLIT (1<<3) #define PERMS_REPORT (1<<0) #define PERMS_SKIP_MTIME (1<<1) #define FULL_FLUSH 1 #define NORMAL_FLUSH 0 #define PDIR_CREATE 1 #define PDIR_DELETE 0 /* Log-message categories. FLOG is only used on the daemon side to * output messages to the log file. */ enum logcode { FERROR=1, FINFO=2, FLOG=3 }; /* Messages types that are sent over the message channel. The logcode * values must all be present here with identical numbers. */ enum msgcode { MSG_DONE=5, /* current phase is done */ MSG_REDO=4, /* reprocess indicated flist index */ MSG_ERROR=FERROR, MSG_INFO=FINFO, MSG_LOG=FLOG, /* remote logging */ MSG_DATA=0 /* raw data on the multiplexed stream */ }; #include "errcode.h" #include "config.h" /* The default RSYNC_RSH is always set in config.h. */ #include #ifdef HAVE_UNISTD_H #include #endif #include #include #ifdef HAVE_SYS_PARAM_H #include #endif #ifdef HAVE_STDLIB_H #include #endif #if defined(HAVE_MALLOC_H) && (defined(HAVE_MALLINFO) || !defined(HAVE_STDLIB_H)) #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_STRING_H #include #endif #ifdef TIME_WITH_SYS_TIME #include #include #else #ifdef HAVE_SYS_TIME_H #include #else #include #endif #endif #ifdef HAVE_FCNTL_H #include #else #ifdef HAVE_SYS_FCNTL_H #include #endif #endif #include #ifdef HAVE_SYS_IOCTL_H #include #endif #ifdef HAVE_SYS_FILIO_H #include #endif #include #ifdef HAVE_SYS_WAIT_H #include #endif #ifdef HAVE_CTYPE_H #include #endif #ifdef HAVE_GRP_H #include #endif #include #ifdef HAVE_UTIME_H #include #endif #ifdef HAVE_SYS_SELECT_H #include #endif #ifdef HAVE_SYS_MODE_H /* apparently AIX needs this for S_ISLNK */ #ifndef S_ISLNK #include #endif #endif #ifdef HAVE_GLOB_H #include #endif /* these are needed for the uid/gid mapping code */ #include #include #include #include #include #include #include #include #if HAVE_DIRENT_H # include #else # define dirent direct # if HAVE_SYS_NDIR_H # include # endif # if HAVE_SYS_DIR_H # include # endif # if HAVE_NDIR_H # include # endif #endif #if MAJOR_IN_MKDEV #include #elif MAJOR_IN_SYSMACROS #include #endif #ifdef HAVE_COMPAT_H #include #endif #include #include "pool_alloc.h" #define BOOL int #ifndef uchar #define uchar unsigned char #endif #if HAVE_UNSIGNED_CHAR #define schar signed char #else #define schar char #endif #ifndef int32 #if (SIZEOF_INT == 4) #define int32 int #elif (SIZEOF_LONG == 4) #define int32 long #elif (SIZEOF_SHORT == 4) #define int32 short #else /* I hope this works */ #define int32 int #define LARGE_INT32 #endif #endif #ifndef uint32 #define uint32 unsigned int32 #endif #if HAVE_OFF64_T #define OFF_T off64_t #define STRUCT_STAT struct stat64 #else #define OFF_T off_t #define STRUCT_STAT struct stat #endif #if HAVE_OFF64_T #define int64 off64_t #elif (SIZEOF_LONG == 8) #define int64 long #elif (SIZEOF_INT == 8) #define int64 int #elif HAVE_LONGLONG #define int64 long long #else /* As long as it gets... */ #define int64 off_t #define INT64_IS_OFF_T #endif #if (SIZEOF_LONG == 8) #define uint64 unsigned long #elif (SIZEOF_INT == 8) #define uint64 unsigned int #elif HAVE_LONGLONG #define uint64 unsigned long long #else /* As long as it gets... */ #define uint64 unsigned off_t #endif /* Starting from protocol version 26, we always use 64-bit * ino_t and dev_t internally, even if this platform does not * allow files to have 64-bit inums. That's because the * receiver needs to find duplicate (dev,ino) tuples to detect * hardlinks, and it might have files coming from a platform * that has 64-bit inums. * * The only exception is if we're on a platform with no 64-bit type at * all. * * Because we use read_longint() to get these off the wire, if you * transfer devices or hardlinks with dev or inum > 2**32 to a machine * with no 64-bit types then you will get an overflow error. Probably * not many people have that combination of machines, and you can * avoid it by not preserving hardlinks or not transferring device * nodes. It's not clear that any other behaviour is better. * * Note that if you transfer devices from a 64-bit-devt machine (say, * Solaris) to a 32-bit-devt machine (say, Linux-2.2/x86) then the * device numbers will be truncated. But it's a kind of silly thing * to do anyhow. * * FIXME: I don't think the code in flist.c has ever worked on a system * where dev_t is a struct. */ struct idev { uint64 inode; uint64 dev; }; #ifndef MIN #define MIN(a,b) ((a)<(b)?(a):(b)) #endif #ifndef MAX #define MAX(a,b) ((a)>(b)?(a):(b)) #endif #ifndef MAXHOSTNAMELEN #define MAXHOSTNAMELEN 256 #endif /* the length of the md4 checksum */ #define MD4_SUM_LENGTH 16 #define SUM_LENGTH 16 #define SHORT_SUM_LENGTH 2 #define BLOCKSUM_BIAS 10 #ifndef MAXPATHLEN #define MAXPATHLEN 1024 #endif #ifndef NAME_MAX #define NAME_MAX 255 #endif #ifndef INADDR_NONE #define INADDR_NONE 0xffffffff #endif #ifndef IN_LOOPBACKNET #define IN_LOOPBACKNET 127 #endif #define GID_NONE ((gid_t)-1) #define HL_CHECK_MASTER 0 #define HL_SKIP 1 struct hlink { struct file_struct *to; struct file_struct *next; }; #define F_DEV link_u.idev->dev #define F_INODE link_u.idev->inode #define F_HLINDEX link_u.links->to #define F_NEXT link_u.links->next struct file_struct { union { dev_t rdev; /* The device number, if this is a device */ char *sum; /* Only a normal file can have a checksum */ char *link; /* Points to symlink string, if a symlink */ } u; OFF_T length; char *basename; char *dirname; char *basedir; union { struct idev *idev; struct hlink *links; } link_u; time_t modtime; uid_t uid; gid_t gid; mode_t mode; uchar flags; /* this item MUST remain last */ }; struct exclude_struct { struct exclude_struct *next; char *pattern; unsigned int match_flags; int slash_cnt; }; struct exclude_list_struct { struct exclude_struct *head; struct exclude_struct *tail; char *debug_type; }; /* * Start the flist array at FLIST_START entries and grow it * by doubling until FLIST_LINEAR then grow by FLIST_LINEAR */ #define FLIST_START (32 * 1024) #define FLIST_LINEAR (FLIST_START * 512) /* * Extent size for allocation pools A minimum size of 128KB * is needed to mmap them so that freeing will release the * space to the OS. * * Larger sizes reduce leftover fragments and speed free calls * (when they happen) Smaller sizes increase the chance of * freed allocations freeing whole extents. */ #define FILE_EXTENT (256 * 1024) #define HLINK_EXTENT (128 * 1024) #define WITH_HLINK 1 #define WITHOUT_HLINK 0 struct file_list { int count; int malloced; alloc_pool_t file_pool; alloc_pool_t idev_pool; alloc_pool_t hlink_pool; struct file_struct **files; /* * Added for perl interface. */ /* * command-line options */ int always_checksum; int protocol_version; int preserve_uid; int preserve_gid; int preserve_devices; int preserve_links; int preserve_hard_links; int sanitize_paths; int eol_nulls; /* * incoming (decoded) string being processed */ unsigned char *inBuf; uint32 inLen; uint32 inPosn; uint32 inFileStart; int inError; int decodeDone; int fatalError; /* * outgoing (encoded) string being generated */ unsigned char *outBuf; uint32 outLen; uint32 outPosn; /* * state variables */ time_t modtime; mode_t mode; uint64 dev; dev_t rdev; uint32 rdev_major; uid_t uid; gid_t gid; char *lastdir; int lastdir_depth, lastdir_len; char *encode_lastdir; int encode_lastdir_len; struct file_struct **hlink_list; unsigned int hlink_count; int link_idev_data_done; /* * Exclude state variables */ char exclude_curr_dir[MAXPATHLEN]; struct exclude_list_struct exclude_list; char *exclude_path_prefix; /* * Warning: perl.h might define MAXPATHLEN differently from * flist.h, so keep this at the end of the struct... */ char lastname[MAXPATHLEN]; }; #define SUMFLG_SAME_OFFSET (1<<0) struct sum_buf { OFF_T offset; /**< offset in file of this chunk */ unsigned int len; /**< length of chunk of file */ uint32 sum1; /**< simple checksum */ short flags; /**< flag bits */ char sum2[SUM_LENGTH]; /**< checksum */ }; struct sum_struct { OFF_T flength; /**< total file length */ size_t count; /**< how many chunks */ unsigned int blength; /**< block_length */ unsigned int remainder; /**< flength % block_length */ int s2length; /**< sum2_length */ struct sum_buf *sums; /**< points to info for each chunk */ }; struct map_struct { char *p; /* Window pointer */ int fd; /* File Descriptor */ int p_size; /* Largest window size we allocated */ int p_len; /* Latest (rounded) window size */ int def_window_size; /* Default window size */ int status; /* first errno from read errors */ OFF_T file_size; /* File size (from stat) */ OFF_T p_offset; /* Window start */ OFF_T p_fd_offset; /* offset of cursor in fd ala lseek */ }; #define MATCHFLG_WILD (1<<0) /* pattern has '*', '[', and/or '?' */ #define MATCHFLG_WILD2 (1<<1) /* pattern has '**' */ #define MATCHFLG_WILD2_PREFIX (1<<2) /* pattern starts with '**' */ #define MATCHFLG_ABS_PATH (1<<3) /* path-match on absolute path */ #define MATCHFLG_INCLUDE (1<<4) /* this is an include, not an exclude */ #define MATCHFLG_DIRECTORY (1<<5) /* this matches only directories */ #define MATCHFLG_CLEAR_LIST (1<<6) /* this item is the "!" token */ struct stats { int64 total_size; int64 total_transferred_size; int64 total_written; int64 total_read; int64 literal_data; int64 matched_data; int flist_size; int num_files; int num_transferred_files; int current_file_index; }; #include "byteorder.h" #include "wildmatch.h" #include "proto.h" /* We have replacement versions of these if they're missing. */ #ifndef HAVE_ASPRINTF int asprintf(char **ptr, const char *format, ...); #endif #ifndef HAVE_VASPRINTF int vasprintf(char **ptr, const char *format, va_list ap); #endif #if !defined(HAVE_VSNPRINTF) || !defined(HAVE_C99_VSNPRINTF) #define vsnprintf rsync_vsnprintf int vsnprintf(char *str, size_t count, const char *fmt, va_list args); #endif #if !defined(HAVE_SNPRINTF) || !defined(HAVE_C99_VSNPRINTF) #define snprintf rsync_snprintf int snprintf(char *str,size_t count,const char *fmt,...); #endif #if !HAVE_STRERROR extern char *sys_errlist[]; #define strerror(i) sys_errlist[i] #endif #ifndef HAVE_STRCHR # define strchr index # define strrchr rindex #endif #ifndef HAVE_ERRNO_DECL extern int errno; #endif #define SUPPORT_LINKS HAVE_READLINK #define SUPPORT_HARD_LINKS HAVE_LINK /* This could be bad on systems which have no lchown and where chown * follows symbollic links. On such systems it might be better not to * try to chown symlinks at all. */ #ifndef HAVE_LCHOWN #define lchown chown #endif #define SIGNAL_CAST (RETSIGTYPE (*)()) #ifndef EWOULDBLOCK #define EWOULDBLOCK EAGAIN #endif #ifndef STDIN_FILENO #define STDIN_FILENO 0 #endif #ifndef STDOUT_FILENO #define STDOUT_FILENO 1 #endif #ifndef STDERR_FILENO #define STDERR_FILENO 2 #endif #ifndef S_IRUSR #define S_IRUSR 0400 #endif #ifndef S_IWUSR #define S_IWUSR 0200 #endif #ifndef ACCESSPERMS #define ACCESSPERMS 0777 #endif #ifndef S_ISVTX #define S_ISVTX 0 #endif #define CHMOD_BITS (S_ISUID | S_ISGID | S_ISVTX | ACCESSPERMS) #ifndef _S_IFMT #define _S_IFMT 0170000 #endif #ifndef _S_IFLNK #define _S_IFLNK 0120000 #endif #ifndef S_ISLNK #define S_ISLNK(mode) (((mode) & (_S_IFMT)) == (_S_IFLNK)) #endif #ifndef S_ISBLK #define S_ISBLK(mode) (((mode) & (_S_IFMT)) == (_S_IFBLK)) #endif #ifndef S_ISCHR #define S_ISCHR(mode) (((mode) & (_S_IFMT)) == (_S_IFCHR)) #endif #ifndef S_ISSOCK #ifdef _S_IFSOCK #define S_ISSOCK(mode) (((mode) & (_S_IFMT)) == (_S_IFSOCK)) #else #define S_ISSOCK(mode) (0) #endif #endif #ifndef S_ISFIFO #ifdef _S_IFIFO #define S_ISFIFO(mode) (((mode) & (_S_IFMT)) == (_S_IFIFO)) #else #define S_ISFIFO(mode) (0) #endif #endif #ifndef S_ISDIR #define S_ISDIR(mode) (((mode) & (_S_IFMT)) == (_S_IFDIR)) #endif #ifndef S_ISREG #define S_ISREG(mode) (((mode) & (_S_IFMT)) == (_S_IFREG)) #endif /* work out what fcntl flag to use for non-blocking */ #ifdef O_NONBLOCK # define NONBLOCK_FLAG O_NONBLOCK #elif defined(SYSV) # define NONBLOCK_FLAG O_NDELAY #else # define NONBLOCK_FLAG FNDELAY #endif #ifndef INADDR_LOOPBACK #define INADDR_LOOPBACK 0x7f000001 #endif #ifndef INADDR_NONE #define INADDR_NONE 0xffffffff #endif #define IS_DEVICE(mode) (S_ISCHR(mode) || S_ISBLK(mode) || S_ISSOCK(mode) || S_ISFIFO(mode)) /* Initial mask on permissions given to temporary files. Mask off setuid bits and group access because of potential race-condition security holes, and mask other access because mode 707 is bizarre */ #define INITACCESSPERMS 0700 /* handler for null strings in printf format */ #define NS(s) ((s)?(s):"") #if !defined(__GNUC__) || defined(APPLE) /* Apparently the OS X port of gcc gags on __attribute__. * * */ #define __attribute__(x) #endif /* Convenient wrappers for malloc and realloc. Use them. */ #define new(type) ((type *)malloc(sizeof(type))) #define new_array(type, num) ((type *)_new_array(sizeof(type), (num))) #define realloc_array(ptr, type, num) ((type *)_realloc_array((ptr), sizeof(type), (num))) /* use magic gcc attributes to catch format errors */ void rprintf(enum logcode , const char *, ...) __attribute__((format (printf, 2, 3))) ; /* This is just like rprintf, but it also tries to print some * representation of the error code. Normally errcode = errno. */ void rsyserr(enum logcode, int, const char *, ...) __attribute__((format (printf, 3, 4))) ; #ifdef REPLACE_INET_NTOA #define inet_ntoa rep_inet_ntoa #endif /* Make sure that the O_BINARY flag is defined. */ #ifndef O_BINARY #define O_BINARY 0 #endif #ifndef HAVE_STRLCPY size_t strlcpy(char *d, const char *s, size_t bufsize); #endif #ifndef HAVE_STRLCAT size_t strlcat(char *d, const char *s, size_t bufsize); #endif #ifndef WEXITSTATUS #define WEXITSTATUS(stat) ((int)(((stat)>>8)&0xFF)) #endif #define exit_cleanup(code) _exit_cleanup(code, __FILE__, __LINE__) #ifdef HAVE_GETEUID #define MY_UID() geteuid() #else #define MY_UID() getuid() #endif #ifdef HAVE_GETEGID #define MY_GID() getegid() #else #define MY_GID() getgid() #endif #ifndef HAVE_INET_NTOP const char * inet_ntop(int af, const void *src, char *dst, size_t size); #endif /* !HAVE_INET_NTOP */ #ifndef HAVE_INET_PTON int inet_pton(int af, const char *src, void *dst); #endif #ifdef MAINTAINER_MODE const char *get_panic_action(void); #endif #define UNUSED(x) x __attribute__((__unused__)) extern const char *io_write_phase, *io_read_phase; File-RsyncP-0.74/FileList/snprintf.c0000444000076500000240000005236411423121572016237 0ustar craigstaff/* * Copyright Patrick Powell 1995 * This code is based on code written by Patrick Powell (papowell@astart.com) * It may be used for any purpose as long as this notice remains intact * on all source code distributions */ /************************************************************** * Original: * Patrick Powell Tue Apr 11 09:48:21 PDT 1995 * A bombproof version of doprnt (dopr) included. * Sigh. This sort of thing is always nasty do deal with. Note that * the version here does not include floating point... * * snprintf() is used instead of sprintf() as it does limit checks * for string length. This covers a nasty loophole. * * The other functions are there to prevent NULL pointers from * causing nast effects. * * More Recently: * Brandon Long 9/15/96 for mutt 0.43 * This was ugly. It is still ugly. I opted out of floating point * numbers, but the formatter understands just about everything * from the normal C string format, at least as far as I can tell from * the Solaris 2.5 printf(3S) man page. * * Brandon Long 10/22/97 for mutt 0.87.1 * Ok, added some minimal floating point support, which means this * probably requires libm on most operating systems. Don't yet * support the exponent (e,E) and sigfig (g,G). Also, fmtint() * was pretty badly broken, it just wasn't being exercised in ways * which showed it, so that's been fixed. Also, formated the code * to mutt conventions, and removed dead code left over from the * original. Also, there is now a builtin-test, just compile with: * gcc -DTEST_SNPRINTF -o snprintf snprintf.c -lm * and run snprintf for results. * * Thomas Roessler 01/27/98 for mutt 0.89i * The PGP code was using unsigned hexadecimal formats. * Unfortunately, unsigned formats simply didn't work. * * Michael Elkins 03/05/98 for mutt 0.90.8 * The original code assumed that both snprintf() and vsnprintf() were * missing. Some systems only have snprintf() but not vsnprintf(), so * the code is now broken down under HAVE_SNPRINTF and HAVE_VSNPRINTF. * * Andrew Tridgell (tridge@samba.org) Oct 1998 * fixed handling of %.0f * added test for HAVE_LONG_DOUBLE * * tridge@samba.org, idra@samba.org, April 2001 * got rid of fcvt code (twas buggy and made testing harder) * added C99 semantics * * Paul Green (paulg@samba.org) April 9, 2003 * fixed handling of %f when converting fractions with leading zeros. * (e.g., 0.025). **************************************************************/ #ifndef NO_CONFIG_H /* for some tests */ #include "config.h" #endif #ifdef HAVE_STRING_H #include #endif #ifdef HAVE_STRINGS_H #include #endif #ifdef HAVE_CTYPE_H #include #endif #include #include #ifdef HAVE_STDLIB_H #include #endif #if defined(HAVE_SNPRINTF) && defined(HAVE_VSNPRINTF) && defined(HAVE_C99_VSNPRINTF) /* only include stdio.h if we are not re-defining snprintf or vsnprintf */ #include /* make the compiler happy with an empty file */ void dummy_snprintf(void) {} #else #ifdef HAVE_LONG_DOUBLE #define LDOUBLE long double #else #define LDOUBLE double #endif #ifdef HAVE_LONG_LONG #define LLONG long long #else #define LLONG long #endif static size_t dopr(char *buffer, size_t maxlen, const char *format, va_list args); static void fmtstr(char *buffer, size_t *currlen, size_t maxlen, char *value, int flags, int min, int max); static void fmtint(char *buffer, size_t *currlen, size_t maxlen, long value, int base, int min, int max, int flags); static void fmtfp(char *buffer, size_t *currlen, size_t maxlen, LDOUBLE fvalue, int min, int max, int flags); static void dopr_outch(char *buffer, size_t *currlen, size_t maxlen, char c); /* * dopr(): poor man's version of doprintf */ /* format read states */ #define DP_S_DEFAULT 0 #define DP_S_FLAGS 1 #define DP_S_MIN 2 #define DP_S_DOT 3 #define DP_S_MAX 4 #define DP_S_MOD 5 #define DP_S_CONV 6 #define DP_S_DONE 7 /* format flags - Bits */ #define DP_F_MINUS (1 << 0) #define DP_F_PLUS (1 << 1) #define DP_F_SPACE (1 << 2) #define DP_F_NUM (1 << 3) #define DP_F_ZERO (1 << 4) #define DP_F_UP (1 << 5) #define DP_F_UNSIGNED (1 << 6) /* Conversion Flags */ #define DP_C_SHORT 1 #define DP_C_LONG 2 #define DP_C_LDOUBLE 3 #define DP_C_LLONG 4 #define char_to_int(p) ((p)- '0') #ifndef MAX #define MAX(p,q) (((p) >= (q)) ? (p) : (q)) #endif static size_t dopr(char *buffer, size_t maxlen, const char *format, va_list args) { char ch; LLONG value; LDOUBLE fvalue; char *strvalue; int min; int max; int state; int flags; int cflags; size_t currlen; state = DP_S_DEFAULT; currlen = flags = cflags = min = 0; max = -1; ch = *format++; while (state != DP_S_DONE) { if (ch == '\0') state = DP_S_DONE; switch(state) { case DP_S_DEFAULT: if (ch == '%') state = DP_S_FLAGS; else dopr_outch (buffer, &currlen, maxlen, ch); ch = *format++; break; case DP_S_FLAGS: switch (ch) { case '-': flags |= DP_F_MINUS; ch = *format++; break; case '+': flags |= DP_F_PLUS; ch = *format++; break; case ' ': flags |= DP_F_SPACE; ch = *format++; break; case '#': flags |= DP_F_NUM; ch = *format++; break; case '0': flags |= DP_F_ZERO; ch = *format++; break; default: state = DP_S_MIN; break; } break; case DP_S_MIN: if (isdigit((unsigned char)ch)) { min = 10*min + char_to_int (ch); ch = *format++; } else if (ch == '*') { min = va_arg (args, int); ch = *format++; state = DP_S_DOT; } else { state = DP_S_DOT; } break; case DP_S_DOT: if (ch == '.') { state = DP_S_MAX; ch = *format++; } else { state = DP_S_MOD; } break; case DP_S_MAX: if (isdigit((unsigned char)ch)) { if (max < 0) max = 0; max = 10*max + char_to_int (ch); ch = *format++; } else if (ch == '*') { max = va_arg (args, int); ch = *format++; state = DP_S_MOD; } else { state = DP_S_MOD; } break; case DP_S_MOD: switch (ch) { case 'h': cflags = DP_C_SHORT; ch = *format++; break; case 'l': cflags = DP_C_LONG; ch = *format++; if (ch == 'l') { /* It's a long long */ cflags = DP_C_LLONG; ch = *format++; } break; case 'L': cflags = DP_C_LDOUBLE; ch = *format++; break; default: break; } state = DP_S_CONV; break; case DP_S_CONV: switch (ch) { case 'd': case 'i': if (cflags == DP_C_SHORT) value = va_arg (args, int); else if (cflags == DP_C_LONG) value = va_arg (args, long int); else if (cflags == DP_C_LLONG) value = va_arg (args, LLONG); else value = va_arg (args, int); fmtint (buffer, &currlen, maxlen, value, 10, min, max, flags); break; case 'o': flags |= DP_F_UNSIGNED; if (cflags == DP_C_SHORT) value = va_arg (args, unsigned int); else if (cflags == DP_C_LONG) value = (long)va_arg (args, unsigned long int); else if (cflags == DP_C_LLONG) value = (long)va_arg (args, unsigned LLONG); else value = (long)va_arg (args, unsigned int); fmtint (buffer, &currlen, maxlen, value, 8, min, max, flags); break; case 'u': flags |= DP_F_UNSIGNED; if (cflags == DP_C_SHORT) value = va_arg (args, unsigned int); else if (cflags == DP_C_LONG) value = (long)va_arg (args, unsigned long int); else if (cflags == DP_C_LLONG) value = (LLONG)va_arg (args, unsigned LLONG); else value = (long)va_arg (args, unsigned int); fmtint (buffer, &currlen, maxlen, value, 10, min, max, flags); break; case 'X': flags |= DP_F_UP; case 'x': flags |= DP_F_UNSIGNED; if (cflags == DP_C_SHORT) value = va_arg (args, unsigned int); else if (cflags == DP_C_LONG) value = (long)va_arg (args, unsigned long int); else if (cflags == DP_C_LLONG) value = (LLONG)va_arg (args, unsigned LLONG); else value = (long)va_arg (args, unsigned int); fmtint (buffer, &currlen, maxlen, value, 16, min, max, flags); break; case 'f': if (cflags == DP_C_LDOUBLE) fvalue = va_arg (args, LDOUBLE); else fvalue = va_arg (args, double); /* um, floating point? */ fmtfp (buffer, &currlen, maxlen, fvalue, min, max, flags); break; case 'E': flags |= DP_F_UP; case 'e': if (cflags == DP_C_LDOUBLE) fvalue = va_arg (args, LDOUBLE); else fvalue = va_arg (args, double); break; case 'G': flags |= DP_F_UP; case 'g': if (cflags == DP_C_LDOUBLE) fvalue = va_arg (args, LDOUBLE); else fvalue = va_arg (args, double); break; case 'c': dopr_outch (buffer, &currlen, maxlen, va_arg (args, int)); break; case 's': strvalue = va_arg (args, char *); if (max == -1) { max = strlen(strvalue); } if (min > 0 && max >= 0 && min > max) max = min; fmtstr (buffer, &currlen, maxlen, strvalue, flags, min, max); break; case 'p': strvalue = va_arg (args, void *); fmtint (buffer, &currlen, maxlen, (long) strvalue, 16, min, max, flags); break; case 'n': if (cflags == DP_C_SHORT) { short int *num; num = va_arg (args, short int *); *num = currlen; } else if (cflags == DP_C_LONG) { long int *num; num = va_arg (args, long int *); *num = (long int)currlen; } else if (cflags == DP_C_LLONG) { LLONG *num; num = va_arg (args, LLONG *); *num = (LLONG)currlen; } else { int *num; num = va_arg (args, int *); *num = currlen; } break; case '%': dopr_outch (buffer, &currlen, maxlen, ch); break; case 'w': /* not supported yet, treat as next char */ ch = *format++; break; default: /* Unknown, skip */ break; } ch = *format++; state = DP_S_DEFAULT; flags = cflags = min = 0; max = -1; break; case DP_S_DONE: break; default: /* hmm? */ break; /* some picky compilers need this */ } } if (maxlen != 0) { if (currlen < maxlen - 1) buffer[currlen] = '\0'; else if (maxlen > 0) buffer[maxlen - 1] = '\0'; } return currlen; } static void fmtstr(char *buffer, size_t *currlen, size_t maxlen, char *value, int flags, int min, int max) { int padlen, strln; /* amount to pad */ int cnt = 0; #ifdef DEBUG_SNPRINTF printf("fmtstr min=%d max=%d s=[%s]\n", min, max, value); #endif if (value == 0) { value = ""; } for (strln = 0; value[strln]; ++strln); /* strlen */ padlen = min - strln; if (padlen < 0) padlen = 0; if (flags & DP_F_MINUS) padlen = -padlen; /* Left Justify */ while ((padlen > 0) && (cnt < max)) { dopr_outch (buffer, currlen, maxlen, ' '); --padlen; ++cnt; } while (*value && (cnt < max)) { dopr_outch (buffer, currlen, maxlen, *value++); ++cnt; } while ((padlen < 0) && (cnt < max)) { dopr_outch (buffer, currlen, maxlen, ' '); ++padlen; ++cnt; } } /* Have to handle DP_F_NUM (ie 0x and 0 alternates) */ static void fmtint(char *buffer, size_t *currlen, size_t maxlen, long value, int base, int min, int max, int flags) { int signvalue = 0; unsigned long uvalue; char convert[20]; int place = 0; int spadlen = 0; /* amount to space pad */ int zpadlen = 0; /* amount to zero pad */ int caps = 0; if (max < 0) max = 0; uvalue = value; if(!(flags & DP_F_UNSIGNED)) { if( value < 0 ) { signvalue = '-'; uvalue = -value; } else { if (flags & DP_F_PLUS) /* Do a sign (+/i) */ signvalue = '+'; else if (flags & DP_F_SPACE) signvalue = ' '; } } if (flags & DP_F_UP) caps = 1; /* Should characters be upper case? */ do { convert[place++] = (caps? "0123456789ABCDEF":"0123456789abcdef") [uvalue % (unsigned)base ]; uvalue = (uvalue / (unsigned)base ); } while(uvalue && (place < 20)); if (place == 20) place--; convert[place] = 0; zpadlen = max - place; spadlen = min - MAX (max, place) - (signvalue ? 1 : 0); if (zpadlen < 0) zpadlen = 0; if (spadlen < 0) spadlen = 0; if (flags & DP_F_ZERO) { zpadlen = MAX(zpadlen, spadlen); spadlen = 0; } if (flags & DP_F_MINUS) spadlen = -spadlen; /* Left Justifty */ #ifdef DEBUG_SNPRINTF printf("zpad: %d, spad: %d, min: %d, max: %d, place: %d\n", zpadlen, spadlen, min, max, place); #endif /* Spaces */ while (spadlen > 0) { dopr_outch (buffer, currlen, maxlen, ' '); --spadlen; } /* Sign */ if (signvalue) dopr_outch (buffer, currlen, maxlen, signvalue); /* Zeros */ if (zpadlen > 0) { while (zpadlen > 0) { dopr_outch (buffer, currlen, maxlen, '0'); --zpadlen; } } /* Digits */ while (place > 0) dopr_outch (buffer, currlen, maxlen, convert[--place]); /* Left Justified spaces */ while (spadlen < 0) { dopr_outch (buffer, currlen, maxlen, ' '); ++spadlen; } } static LDOUBLE abs_val(LDOUBLE value) { LDOUBLE result = value; if (value < 0) result = -value; return result; } static LDOUBLE POW10(int exp) { LDOUBLE result = 1; while (exp) { result *= 10; exp--; } return result; } static LLONG ROUND(LDOUBLE value) { LLONG intpart; intpart = (LLONG)value; value = value - intpart; if (value >= 0.5) intpart++; return intpart; } /* a replacement for modf that doesn't need the math library. Should be portable, but slow */ static double my_modf(double x0, double *iptr) { int i; long l; double x = x0; double f = 1.0; for (i=0;i<100;i++) { l = (long)x; if (l <= (x+1) && l >= (x-1)) break; x *= 0.1; f *= 10.0; } if (i == 100) { /* yikes! the number is beyond what we can handle. What do we do? */ (*iptr) = 0; return 0; } if (i != 0) { double i2; double ret; ret = my_modf(x0-l*f, &i2); (*iptr) = l*f + i2; return ret; } (*iptr) = l; return x - (*iptr); } static void fmtfp (char *buffer, size_t *currlen, size_t maxlen, LDOUBLE fvalue, int min, int max, int flags) { int signvalue = 0; double ufvalue; char iconvert[311]; char fconvert[311]; int iplace = 0; int fplace = 0; int padlen = 0; /* amount to pad */ int zpadlen = 0; int caps = 0; int index; double intpart; double fracpart; double temp; /* * AIX manpage says the default is 0, but Solaris says the default * is 6, and sprintf on AIX defaults to 6 */ if (max < 0) max = 6; ufvalue = abs_val (fvalue); if (fvalue < 0) { signvalue = '-'; } else { if (flags & DP_F_PLUS) { /* Do a sign (+/i) */ signvalue = '+'; } else { if (flags & DP_F_SPACE) signvalue = ' '; } } #if 0 if (flags & DP_F_UP) caps = 1; /* Should characters be upper case? */ #endif #if 0 if (max == 0) ufvalue += 0.5; /* if max = 0 we must round */ #endif /* * Sorry, we only support 16 digits past the decimal because of our * conversion method */ if (max > 16) max = 16; /* We "cheat" by converting the fractional part to integer by * multiplying by a factor of 10 */ temp = ufvalue; my_modf(temp, &intpart); fracpart = ROUND((POW10(max)) * (ufvalue - intpart)); if (fracpart >= POW10(max)) { intpart++; fracpart -= POW10(max); } /* Convert integer part */ do { temp = intpart; my_modf(intpart*0.1, &intpart); temp = temp*0.1; index = (int) ((temp -intpart +0.05)* 10.0); /* index = (int) (((double)(temp*0.1) -intpart +0.05) *10.0); */ /* printf ("%llf, %f, %x\n", temp, intpart, index); */ iconvert[iplace++] = (caps? "0123456789ABCDEF":"0123456789abcdef")[index]; } while (intpart && (iplace < 311)); if (iplace == 311) iplace--; iconvert[iplace] = 0; /* Convert fractional part */ if (fracpart) { do { temp = fracpart; my_modf(fracpart*0.1, &fracpart); temp = temp*0.1; index = (int) ((temp -fracpart +0.05)* 10.0); /* index = (int) ((((temp/10) -fracpart) +0.05) *10); */ /* printf ("%lf, %lf, %ld\n", temp, fracpart, index); */ fconvert[fplace++] = (caps? "0123456789ABCDEF":"0123456789abcdef")[index]; } while(fracpart && (fplace < 311)); if (fplace == 311) fplace--; } fconvert[fplace] = 0; /* -1 for decimal point, another -1 if we are printing a sign */ padlen = min - iplace - max - 1 - ((signvalue) ? 1 : 0); zpadlen = max - fplace; if (zpadlen < 0) zpadlen = 0; if (padlen < 0) padlen = 0; if (flags & DP_F_MINUS) padlen = -padlen; /* Left Justifty */ if ((flags & DP_F_ZERO) && (padlen > 0)) { if (signvalue) { dopr_outch (buffer, currlen, maxlen, signvalue); --padlen; signvalue = 0; } while (padlen > 0) { dopr_outch (buffer, currlen, maxlen, '0'); --padlen; } } while (padlen > 0) { dopr_outch (buffer, currlen, maxlen, ' '); --padlen; } if (signvalue) dopr_outch (buffer, currlen, maxlen, signvalue); while (iplace > 0) dopr_outch (buffer, currlen, maxlen, iconvert[--iplace]); #ifdef DEBUG_SNPRINTF printf("fmtfp: fplace=%d zpadlen=%d\n", fplace, zpadlen); #endif /* * Decimal point. This should probably use locale to find the correct * char to print out. */ if (max > 0) { dopr_outch (buffer, currlen, maxlen, '.'); while (zpadlen > 0) { dopr_outch (buffer, currlen, maxlen, '0'); --zpadlen; } while (fplace > 0) dopr_outch (buffer, currlen, maxlen, fconvert[--fplace]); } while (padlen < 0) { dopr_outch (buffer, currlen, maxlen, ' '); ++padlen; } } static void dopr_outch(char *buffer, size_t *currlen, size_t maxlen, char c) { if (*currlen < maxlen) { buffer[(*currlen)] = c; } (*currlen)++; } #if !defined(HAVE_VSNPRINTF) || !defined(HAVE_C99_VSNPRINTF) #define vsnprintf rsync_vsnprintf int vsnprintf(char *str, size_t count, const char *fmt, va_list args) { return dopr(str, count, fmt, args); } #endif #if !defined(HAVE_SNPRINTF) || !defined(HAVE_C99_VSNPRINTF) #define snprintf rsync_snprintf int snprintf(char *str,size_t count,const char *fmt,...) { size_t ret; va_list ap; va_start(ap, fmt); ret = vsnprintf(str, count, fmt, ap); va_end(ap); return ret; } #endif #endif #ifndef HAVE_VASPRINTF int vasprintf(char **ptr, const char *format, va_list ap) { int ret; ret = vsnprintf(NULL, 0, format, ap); if (ret <= 0) return ret; (*ptr) = (char *)malloc(ret+1); if (!*ptr) return -1; ret = vsnprintf(*ptr, ret+1, format, ap); return ret; } #endif #ifndef HAVE_ASPRINTF int asprintf(char **ptr, const char *format, ...) { va_list ap; int ret; va_start(ap, format); ret = vasprintf(ptr, format, ap); va_end(ap); return ret; } #endif #ifdef TEST_SNPRINTF int sprintf(char *str,const char *fmt,...); int main (void) { char buf1[1024]; char buf2[1024]; char *fp_fmt[] = { "%1.1f", "%-1.5f", "%1.5f", "%123.9f", "%10.5f", "% 10.5f", "%+22.9f", "%+4.9f", "%01.3f", "%4f", "%3.1f", "%3.2f", "%.0f", "%f", "-16.16f", NULL }; double fp_nums[] = { 6442452944.1234, -1.5, 134.21, 91340.2, 341.1234, 0203.9, 0.96, 0.996, 0.9996, 1.996, 4.136, 0}; char *int_fmt[] = { "%-1.5d", "%1.5d", "%123.9d", "%5.5d", "%10.5d", "% 10.5d", "%+22.33d", "%01.3d", "%4d", "%d", NULL }; long int_nums[] = { -1, 134, 91340, 341, 0203, 0}; char *str_fmt[] = { "10.5s", "5.10s", "10.1s", "0.10s", "10.0s", "1.10s", "%s", "%.1s", "%.10s", "%10s", NULL }; char *str_vals[] = {"hello", "a", "", "a longer string", NULL}; int x, y; int fail = 0; int num = 0; printf ("Testing snprintf format codes against system sprintf...\n"); for (x = 0; fp_fmt[x] ; x++) { for (y = 0; fp_nums[y] != 0 ; y++) { int l1 = snprintf(NULL, 0, fp_fmt[x], fp_nums[y]); int l2 = snprintf(buf1, sizeof(buf1), fp_fmt[x], fp_nums[y]); sprintf (buf2, fp_fmt[x], fp_nums[y]); if (strcmp (buf1, buf2)) { printf("snprintf doesn't match Format: %s\n\tsnprintf = [%s]\n\t sprintf = [%s]\n", fp_fmt[x], buf1, buf2); fail++; } if (l1 != l2) { printf("snprintf l1 != l2 (%d %d) %s\n", l1, l2, fp_fmt[x]); fail++; } num++; } } for (x = 0; int_fmt[x] ; x++) { for (y = 0; int_nums[y] != 0 ; y++) { int l1 = snprintf(NULL, 0, int_fmt[x], int_nums[y]); int l2 = snprintf(buf1, sizeof(buf1), int_fmt[x], int_nums[y]); sprintf (buf2, int_fmt[x], int_nums[y]); if (strcmp (buf1, buf2)) { printf("snprintf doesn't match Format: %s\n\tsnprintf = [%s]\n\t sprintf = [%s]\n", int_fmt[x], buf1, buf2); fail++; } if (l1 != l2) { printf("snprintf l1 != l2 (%d %d) %s\n", l1, l2, int_fmt[x]); fail++; } num++; } } for (x = 0; str_fmt[x] ; x++) { for (y = 0; str_vals[y] != 0 ; y++) { int l1 = snprintf(NULL, 0, str_fmt[x], str_vals[y]); int l2 = snprintf(buf1, sizeof(buf1), str_fmt[x], str_vals[y]); sprintf (buf2, str_fmt[x], str_vals[y]); if (strcmp (buf1, buf2)) { printf("snprintf doesn't match Format: %s\n\tsnprintf = [%s]\n\t sprintf = [%s]\n", str_fmt[x], buf1, buf2); fail++; } if (l1 != l2) { printf("snprintf l1 != l2 (%d %d) %s\n", l1, l2, str_fmt[x]); fail++; } num++; } } printf ("%d tests failed out of %d.\n", fail, num); printf("seeing how many digits we support\n"); { double v0 = 0.12345678901234567890123456789012345678901; for (x=0; x<100; x++) { snprintf(buf1, sizeof(buf1), "%1.1f", v0*pow(10, x)); sprintf(buf2, "%1.1f", v0*pow(10, x)); if (strcmp(buf1, buf2)) { printf("we seem to support %d digits\n", x-1); break; } } } return 0; } #endif /* SNPRINTF_TEST */ File-RsyncP-0.74/FileList/t/0000755000076500000240000000000012456605211014467 5ustar craigstaffFile-RsyncP-0.74/FileList/t/exclude.t0000444000076500000240000001036212456605201016304 0ustar craigstaff#!/bin/perl use File::RsyncP; use Data::Dumper; my $f = File::RsyncP::FileList->new({ protocol_version => 28, }); my @Tests = ( # # Test 1: basic excludes with wildcards # { excludes => [ {exclude => "*.doc"}, {exclude => "*.xls"}, ], tests => [ {file => "other/bar.doc", result => -1}, {file => "other/bar.xls", result => -1}, {file => "other/bar.doc2", result => 0}, {file => "other/bar.xls2", result => 0}, ], data => "050000002a2e646f63050000002a2e786c7300000000", }, # # Test 2: basic excludes and includes with wildcards # { excludes => [ {exclude => "*.doc"}, {include => "*.doc2"}, {exclude => "*.xls"}, {include => "*.xls2"}, ], tests => [ {file => "other/bar.doc", result => -1}, {file => "other/bar.xls", result => -1}, {file => "other/bar.doc2", result => 1}, {file => "other/bar.xls2", result => 1}, ], data => "050000002a2e646f63080000002b202a2e646f6332050000002a2e786c73080000002b202a2e786c733200000000", }, # # Test 2: top-level patterns # { excludes => [ {exclude => "/*/*.doc"}, {exclude => "/*/*/*.xls"}, {include => "*.xls2"}, ], tests => [ {file => "other/bar.doc", result => -1}, {file => "other/bar.xls", result => 0}, {file => "other/bar.doc2", result => 0}, {file => "other/bar.xls2", result => 1}, ], data => "080000002f2a2f2a2e646f630a0000002f2a2f2a2f2a2e786c73080000002b202a2e786c733200000000", }, ); my $numTests = @Tests; print "1..$numTests\n"; my $testNum = 1; foreach my $t ( @Tests ) { my $ok = 1; # # Add excludes # $f->exclude_list_clear(); foreach my $e ( @{$t->{excludes}} ) { if ( defined($e->{exclude}) ) { $f->exclude_add($e->{exclude}, 0); } elsif ( defined($e->{include}) ) { $f->exclude_add($e->{include}, 2); } } # # Check list # my $exc = $f->exclude_list_get(); #print STDERR Dumper $exc; if ( @$exc != @{$t->{excludes}} ) { printf(STDERR "Exclude list count mismatch: %d vs %d\n", scalar(@$exc), scalar(@{$t->{excludes}})); $ok = 0; } foreach my $e ( @{$t->{excludes}} ) { if ( defined($e->{exclude}) ) { if ( $e->{exclude} ne $exc->[0]{pattern} ) { printf(STDERR "Exclude list pattern mismatch: %s vs %s\n", $e->{exclude}, $exc->[0]{pattern}); $ok = 0; } if ( $exc->[0]{flags} & (1 << 4) ) { printf(STDERR "Exclude %s has wrong flag %d\n", $e->{exclude}, $exc->[0]{flags}); $ok = 0; } } if ( defined($e->{include}) ) { if ( $e->{include} ne $exc->[0]{pattern} ) { printf(STDERR "Exclude list pattern mismatch: %s vs %s\n", $e->{include}, $exc->[0]{pattern}); $ok = 0; } if ( !($exc->[0]{flags} & (1 << 4)) ) { printf(STDERR "Exclude %s has wrong flag %d\n", $e->{include}, $exc->[0]{flags}); $ok = 0; } } shift(@$exc); } # # Check files # foreach my $file ( @{$t->{tests}} ) { if ( $f->exclude_check($file->{file}, 0) != $file->{result} ) { $ok = 0; printf(STDERR "Exclude check on %s returns %d vs %d\n", $file->{file}, $f->exclude_check($file->{file}, 0), $file->{result}); } } # # Check encoding # $f->exclude_list_send(); my $data = $f->encodeData(); if ( defined($t->{data}) && $t->{data} ne unpack("H*", $data) ) { print(STDERR "Botch encoded data: ", unpack("H*", $data), " vs $t->{data}\n"); $ok = 0; } # # Print result # if ( $ok ) { print("ok $testNum\n"); } else { print("not ok $testNum\n"); } $testNum++; } File-RsyncP-0.74/FileList/t/fileList.t0000444000076500000240000001432712456605207016441 0ustar craigstaff#!/bin/perl BEGIN {print "1..21\n";} END {print "not ok 1\n" unless $loaded;} use File::RsyncP; $loaded = 1; print "ok 1\n"; my @TestFiles = ( { name => "xxx/yyy/aaa1", mode => 0100755, uid => 987, gid => 654, size => 654321, mtime => time, }, { name => "xxx/yyy/aaa2", mode => 0060755, uid => 987, gid => 654, rdev_major => 0x23, rdev_minor => 0x46, size => 654321, mtime => time, }, { name => "xxx/zzz/bbb1", mode => 0060666, uid => 9876, gid => 6543, rdev_major => 0x23, rdev_minor => 0x45, size => 65432, mtime => time + 1, }, { name => "xxx/yyy/aaa3", dev => 9123, inode => 9123456, mode => 0100666, uid => 9876, gid => 6543, size => 65432, mtime => time + 1, }, { name => "xxx/zzz/bbb2", dev => 9123, inode => 9123458, mode => 0100666, uid => 9876, gid => 6543, size => 65432, mtime => time + 1, }, { name => "xxx/zzz/bbb3", dev => (1 << 31) * 123 + (5432 << 18), inode => (1 << 31) * 12 + (6543 << 17), mode => 0100666, uid => 9876, gid => 6543, size => (1 << 31) * 3 + (1 << 29), mtime => time + 1, }, { name => "xxx/zzz/bbb4", dev => (1 << 31) * 123 + (5432 << 18), inode => (1 << 31) * 12 + (6543 << 17) + 1, mode => 0100666, uid => 9876, gid => 6543, size => (1 << 31) * 3 + (1 << 29), mtime => time + 1, }, { name => "xxx/zzz/bbb5", dev => (1 << 31) * 123 + (5432 << 18), inode => (1 << 31) * 12 + (6543 << 17) + 2, mode => 0100666, uid => 9876, gid => 6543, size => (1 << 31) * 3 + (1 << 29), mtime => time + 1, }, { name => "xxx/zzz/bbb6", dev => (1 << 31) * 123 + (5432 << 18), inode => (1 << 31) * 12 + (6543 << 17) + 3, mode => 0100666, uid => 9876, gid => 6543, size => (1 << 31) * 3 + (1 << 29), mtime => time + 1, }, { name => "xxx/zzz/bbb7", mode => 0100666, uid => 9876, gid => 6543, size => (1 << 31) * 3 + (1 << 29), mtime => time + 1, }, ); my $testNum = 2; for my $protocol ( qw(26 28) ) { for my $preserve_hard_links ( qw(0 1) ) { $testNum = run_test($testNum, $protocol, $preserve_hard_links); } } sub run_test { my($testNum, $protocol, $preserve_hard_links) = @_; my $args = { preserve_uid => 1, # --owner preserve_gid => 1, # --group preserve_links => 1, # --links preserve_devices => 1, # --devices preserve_hard_links => $preserve_hard_links, # --hard-links always_checksum => 0, # --checksum protocol_version => $protocol, # protocol version }; my @testFiles; foreach my $f ( @TestFiles ) { my $f2 = { %$f }; if ( !$preserve_hard_links ) { delete($f2->{dev}); delete($f2->{inode}); } push(@testFiles, $f2); } my $fList = File::RsyncP::FileList->new($args); for ( my $i = 0 ; $i < @testFiles ; $i++ ) { $fList->encode($testFiles[$i]); } if ( $fList->count == @testFiles ) { print("ok $testNum\n"); } else { print("not ok $testNum\n"); } $testNum++; my $ok = 1; for ( my $i = 0 ; $i < @testFiles ; $i++ ) { my $f = $fList->get($i); foreach my $k ( keys(%{$testFiles[$i]}) ) { if ( !defined($f->{$k}) ) { print(STDERR "testFiles[$i]{$k} is $testFiles[$i]{$k}, but result is undef\n"); $ok = 0; next; } if ( $testFiles[$i]{$k} ne $f->{$k} ) { print(STDERR "$i.$k: $testFiles[$i]{$k} vs $f->{$k}\n"); $ok = 0; } } } if ( $ok ) { print("ok $testNum\n"); } else { print("not ok $testNum\n"); } $testNum++; my $data = $fList->encodeData . pack("C", 0); #printf(STDERR "Protocol = $protocol, hardlinks = $preserve_hard_links, dataLen = %d\n", length($data)); #print(STDERR "data = ", unpack("H*", $data), "\n"); my $fList2 = File::RsyncP::FileList->new($args); my $bytesDone = $fList2->decode($data); if ( $bytesDone == length($data) ) { print("ok $testNum\n"); } else { print("not ok $testNum\n"); } $testNum++; $ok = 1; for ( my $i = 0 ; $i < @testFiles ; $i++ ) { my $f = $fList2->get($i); foreach my $k ( keys(%{$testFiles[$i]}) ) { next if ( $k eq "rdev" ); if ( !defined($f->{$k}) ) { print(STDERR "testFiles[$i]{$k} is $testFiles[$i]{$k}, but result is undef\n"); $ok = 0; next; } if ( $testFiles[$i]{$k} ne $f->{$k} ) { print(STDERR "$i.$k: $testFiles[$i]{$k} vs $f->{$k}\n"); $ok = 0; } } } if ( $ok ) { print("ok $testNum\n"); } else { print("not ok $testNum\n"); } $testNum++; $fList->clean; $fList2->clean; $ok = 1; for ( my $i = 0 ; $i < $fList2->count ; $i++ ) { my $f2 = $fList2->get($i); my $f = $fList->get($i); foreach my $k ( keys(%$f2) ) { next if ( $k eq "rdev" ); if ( !defined($f->{$k}) ) { print(STDERR "f2{$k} is $f2->{$k}, but result is undef\n"); $ok = 0; next; } if ( $f2->{$k} ne $f->{$k} ) { print(STDERR "$i.$k: $f2->{$k} vs $f->{$k}\n"); $ok = 0; } } } if ( $ok ) { print("ok $testNum\n"); } else { print("not ok $testNum\n"); } $testNum++; return $testNum; } File-RsyncP-0.74/FileList/typemap0000444000076500000240000000005411423121572015617 0ustar craigstaffTYPEMAP File::RsyncP::FileList T_PTROBJ File-RsyncP-0.74/FileList/wildmatch.c0000444000076500000240000001304711423121572016343 0ustar craigstaff/* ** Do shell-style pattern matching for ?, \, [], and * characters. ** It is 8bit clean. ** ** Written by Rich $alz, mirror!rs, Wed Nov 26 19:03:17 EST 1986. ** Rich $alz is now . ** ** Modified by Wayne Davison to special-case '/' matching, to make '**' ** work differently than '*', and to fix the character-class code. */ #include "rsync.h" /* What character marks an inverted character class? */ #define NEGATE_CLASS '!' #define NEGATE_CLASS2 '^' #define FALSE 0 #define TRUE 1 #define ABORT_ALL -1 #define ABORT_TO_STARSTAR -2 #define CC_EQ(class, len, litmatch) ((len) == sizeof (litmatch)-1 \ && *(class) == *(litmatch) \ && strncmp((char*)class, litmatch, len) == 0) #if defined STDC_HEADERS || !defined isascii # define ISASCII(c) 1 #else # define ISASCII(c) isascii(c) #endif #ifdef isblank # define ISBLANK(c) (ISASCII(c) && isblank(c)) #else # define ISBLANK(c) ((c) == ' ' || (c) == '\t') #endif #ifdef isgraph # define ISGRAPH(c) (ISASCII(c) && isgraph(c)) #else # define ISGRAPH(c) (ISASCII(c) && isprint(c) && !isspace(c)) #endif #define ISPRINT(c) (ISASCII(c) && isprint(c)) #define ISDIGIT(c) (ISASCII(c) && isdigit(c)) #define ISALNUM(c) (ISASCII(c) && isalnum(c)) #define ISALPHA(c) (ISASCII(c) && isalpha(c)) #define ISCNTRL(c) (ISASCII(c) && iscntrl(c)) #define ISLOWER(c) (ISASCII(c) && islower(c)) #define ISPUNCT(c) (ISASCII(c) && ispunct(c)) #define ISSPACE(c) (ISASCII(c) && isspace(c)) #define ISUPPER(c) (ISASCII(c) && isupper(c)) #define ISXDIGIT(c) (ISASCII(c) && isxdigit(c)) #ifdef WILD_TEST_ITERATIONS int wildmatch_iteration_count; #endif static int domatch(const unsigned char *p, const unsigned char *text) { int matched, special; unsigned char ch, prev; #ifdef WILD_TEST_ITERATIONS wildmatch_iteration_count++; #endif for ( ; (ch = *p) != '\0'; text++, p++) { if (*text == '\0' && ch != '*') return FALSE; switch (ch) { case '\\': /* Literal match with following character. Note that the test * in "default" handles the p[1] == '\0' failure case. */ ch = *++p; /* FALLTHROUGH */ default: if (*text != ch) return FALSE; continue; case '?': /* Match anything but '/'. */ if (*text == '/') return FALSE; continue; case '*': if (*++p == '*') { while (*++p == '*') {} special = TRUE; } else special = FALSE; if (*p == '\0') { /* Trailing "**" matches everything. Trailing "*" matches * only if there are no more slash characters. */ return special? TRUE : strchr((char*)text, '/') == NULL; } for ( ; *text; text++) { if ((matched = domatch(p, text)) != FALSE) { if (!special || matched != ABORT_TO_STARSTAR) return matched; } else if (!special && *text == '/') return ABORT_TO_STARSTAR; } return ABORT_ALL; case '[': ch = *++p; #ifdef NEGATE_CLASS2 if (ch == NEGATE_CLASS2) ch = NEGATE_CLASS; #endif /* Assign literal TRUE/FALSE because of "matched" comparison. */ special = ch == NEGATE_CLASS? TRUE : FALSE; if (special) { /* Inverted character class. */ ch = *++p; } prev = 0; matched = FALSE; do { if (!ch) return ABORT_ALL; if (ch == '\\') { ch = *++p; if (!ch) return ABORT_ALL; if (*text == ch) matched = TRUE; } else if (ch == '-' && prev && p[1] && p[1] != ']') { ch = *++p; if (ch == '\\') { ch = *++p; if (!ch) return ABORT_ALL; } if (*text <= ch && *text >= prev) matched = TRUE; ch = 0; /* This makes "prev" get set to 0. */ } else if (ch == '[' && p[1] == ':') { const unsigned char *s = p += 2; int i; while ((ch = *p) && ch != ']') p++; if (!ch) return ABORT_ALL; i = p - s - 1; if (i < 0 || p[-1] != ':') { /* Didn't find ":]", so treat like a normal set. */ p = s - 2; ch = '['; if (*text == ch) matched = TRUE; continue; } if (CC_EQ(s,i, "alnum")) { if (ISALNUM(*text)) matched = TRUE; } else if (CC_EQ(s,i, "alpha")) { if (ISALPHA(*text)) matched = TRUE; } else if (CC_EQ(s,i, "blank")) { if (ISBLANK(*text)) matched = TRUE; } else if (CC_EQ(s,i, "cntrl")) { if (ISCNTRL(*text)) matched = TRUE; } else if (CC_EQ(s,i, "digit")) { if (ISDIGIT(*text)) matched = TRUE; } else if (CC_EQ(s,i, "graph")) { if (ISGRAPH(*text)) matched = TRUE; } else if (CC_EQ(s,i, "lower")) { if (ISLOWER(*text)) matched = TRUE; } else if (CC_EQ(s,i, "print")) { if (ISPRINT(*text)) matched = TRUE; } else if (CC_EQ(s,i, "punct")) { if (ISPUNCT(*text)) matched = TRUE; } else if (CC_EQ(s,i, "space")) { if (ISSPACE(*text)) matched = TRUE; } else if (CC_EQ(s,i, "upper")) { if (ISUPPER(*text)) matched = TRUE; } else if (CC_EQ(s,i, "xdigit")) { if (ISXDIGIT(*text)) matched = TRUE; } else /* malformed [:class:] string */ return ABORT_ALL; ch = 0; /* This makes "prev" get set to 0. */ } else if (*text == ch) matched = TRUE; } while (prev = ch, (ch = *++p) != ']'); if (matched == special || *text == '/') return FALSE; continue; } } return *text == '\0'; } /* Find the pattern (p) in the text string (t). */ int wildmatch(const char *p, const char *t) { #ifdef WILD_TEST_ITERATIONS wildmatch_iteration_count = 0; #endif return domatch((const unsigned char*)p, (const unsigned char*)t) == TRUE; } File-RsyncP-0.74/FileList/wildmatch.h0000444000076500000240000000010311423121572016335 0ustar craigstaff/* wildmatch.h */ int wildmatch(const char *p, const char *text); File-RsyncP-0.74/lib/0000755000076500000240000000000011423121572013253 5ustar craigstaffFile-RsyncP-0.74/lib/File/0000755000076500000240000000000012456603060014136 5ustar craigstaffFile-RsyncP-0.74/lib/File/RsyncP/0000755000076500000240000000000012456603044015356 5ustar craigstaffFile-RsyncP-0.74/lib/File/RsyncP/FileIO.pm0000444000076500000240000007100412456603044017023 0ustar craigstaff#============================================================= -*-perl-*- # # File::RsyncP::FileIO package # # DESCRIPTION # Provide file system IO for File::RsyncP. # # AUTHOR # Craig Barratt # # COPYRIGHT # File::RsyncP is Copyright (C) 2002 Craig Barratt. # # Rsync is Copyright (C) 1996-2001 by Andrew Tridgell, 1996 by Paul # Mackerras, and 2001, 2002 by Martin Pool. # # 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 3 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, see . # #======================================================================== # # Version 0.74, released 17 Jan 2015. # # See http://perlrsync.sourceforge.net. # #======================================================================== package File::RsyncP::FileIO; use strict; use File::RsyncP::Digest; use File::Path; use File::Find; use vars qw($VERSION); $VERSION = '0.74'; use constant S_IFMT => 0170000; # type of file use constant S_IFDIR => 0040000; # directory use constant S_IFCHR => 0020000; # character special use constant S_IFBLK => 0060000; # block special use constant S_IFREG => 0100000; # regular use constant S_IFLNK => 0120000; # symbolic link use constant S_IFSOCK => 0140000; # socket use constant S_IFIFO => 0010000; # fifo sub new { my($class, $options) = @_; $options ||= {}; my $self = bless { blockSize => 700, logLevel => 0, digest => File::RsyncP::Digest->new($options->{protocol_version}), checksumSeed => 0, logHandler => \&logHandler, %$options, }, $class; return $self; } sub blockSize { my($fio, $value) = @_; $fio->{blockSize} = $value if ( defined($value) ); return $fio->{blockSize}; } # # We publish our version to File::RsyncP. This is so File::RsyncP # can provide backward compatibility to older FileIO code. # # Versions: # # undef or 1: protocol version 26, no hardlinks # 2: protocol version 28, supports hardlinks # sub version { return 2; } sub preserve_hard_links { my($fio, $value) = @_; $fio->{preserve_hard_links} = $value if ( defined($value) ); return $fio->{preserve_hard_links}; } sub protocol_version { my($fio, $value) = @_; if ( defined($value) ) { $fio->{protocol_version} = $value; $fio->{digest}->protocol($fio->{protocol_version}); } return $fio->{protocol_version}; } sub logHandlerSet { my($fio, $sub) = @_; $fio->{logHandler} = $sub; } # # Given a remote name, return the local name # sub localName { my($fio, $name) = @_; return $name if ( !defined($fio->{localDir}) && !defined($fio->{remoteDir}) ); if ( substr($name, 0, length($fio->{remoteDir})) eq $fio->{remoteDir} ) { substr($name, 0, length($fio->{remoteDir})) = $fio->{localDir}; } return $name; } # # Setup rsync checksum computation for the given file. # sub csumStart { my($fio, $f, $needMD4) = @_; local(*F); my $localName = $fio->localName($f->{name}); $fio->{file} = $f; $fio->csumEnd if ( defined($fio->{fh}) ); return if ( !-f $localName || -l $localName ); if ( !open(F, $localName) ) { $fio->log("Can't open $localName"); return -1; } if ( $needMD4) { $fio->{csumDigest} = File::RsyncP::Digest->new($fio->{protocol_version}); $fio->{csumDigest}->add(pack("V", $fio->{checksumSeed})); } else { delete($fio->{csumDigest}); } $fio->{fh} = *F; } sub csumGet { my($fio, $num, $csumLen, $blockSize) = @_; my($fileData); $num ||= 100; $csumLen ||= 16; return if ( !defined($fio->{fh}) ); if ( sysread($fio->{fh}, $fileData, $blockSize * $num) <= 0 ) { return; } $fio->{csumDigest}->add($fileData) if ( defined($fio->{csumDigest}) ); $fio->log(sprintf("%s: getting csum ($num,$csumLen,%d,0x%x)", $fio->{file}{name}, length($fileData), $fio->{checksumSeed})) if ( $fio->{logLevel} >= 10 ); return $fio->{digest}->blockDigest($fileData, $blockSize, $csumLen, $fio->{checksumSeed}); } sub csumEnd { my($fio) = @_; return if ( !defined($fio->{fh}) ); # # make sure we read the entire file for the file MD4 digest # if ( defined($fio->{csumDigest}) ) { while ( sysread($fio->{fh}, my $fileData, 65536) > 0 ) { $fio->{csumDigest}->add($fileData); } } close($fio->{fh}); delete($fio->{fh}); return $fio->{csumDigest}->digest if ( defined($fio->{csumDigest}) ); } sub readStart { my($fio, $f) = @_; local(*F); my $localName = $fio->localName($f->{name}); $fio->{file} = $f; $fio->readEnd if ( defined($fio->{fh}) ); return if ( !-f $localName || -l $localName ); if ( !open(F, $localName) ) { $fio->log("Can't open $localName"); return; } $fio->{fh} = *F; } sub read { my($fio, $num) = @_; my($fileData); $num ||= 32768; return if ( !defined($fio->{fh}) ); if ( sysread($fio->{fh}, $fileData, $num) <= 0 ) { return $fio->readEnd; } return \$fileData; } sub readEnd { my($fio) = @_; return if ( !defined($fio->{fh}) ); close($fio->{fh}); delete($fio->{fh}); } sub checksumSeed { my($fio, $checksumSeed) = @_; $fio->{checksumSeed} = $checksumSeed; } sub dirs { my($fio, $localDir, $remoteDir) = @_; $fio->{localDir} = $localDir; $fio->{remoteDir} = $remoteDir; } sub attribGet { my($fio, $f) = @_; my $localName = $fio->localName($f->{name}); my @s = stat($localName); return if ( !@s ); return { mode => $s[2], uid => $s[4], gid => $s[5], size => $s[7], mtime => $s[9], } } # # Set the attributes for a file. Returns non-zero on error. # sub attribSet { my($fio, $f, $placeHolder) = @_; my $ret; # # Ignore placeholder attribute sets: only do real ones. # return if ( $placeHolder ); my $lName = $fio->localName($f->{name}); my @s = stat($lName); my $a = { mode => $s[2], uid => $s[4], gid => $s[5], size => $s[7], atime => $s[8], mtime => $s[9], }; $f->{atime} = $f->{mtime} if ( !defined($f->{atime}) ); if ( ($f->{mode} & ~S_IFMT) != ($a->{mode} & ~S_IFMT) && !chmod($f->{mode} & ~S_IFMT, $lName) ) { $fio->log(sprintf("Can't chmod(%s, 0%o)", $lName, $f->{mode})); $ret = -1; } if ( ($f->{uid} != $a->{uid} || $f->{gid} != $a->{gid}) && !chown($f->{uid}, $f->{gid}, $lName) ) { $fio->log("Can't chown($f->{uid}, $f->{gid}, $lName)"); $ret = -1; } if ( ($f->{mtime} != $a->{mtime} || $f->{atime} != $a->{atime}) && !utime($f->{atime}, $f->{mtime}, $lName) ) { $fio->log("Can't mtime($f->{atime}, $f->{mtime}, $lName)"); $ret = -1; } return $ret; } sub statsGet { my($fio) = @_; return {}; } # # Make a given directory. Returns non-zero on error. # sub makePath { my($fio, $f) = @_; my $localDir = $fio->localName($f->{name}); return $fio->attribSet($f) if ( -d $localDir ); File::Path::mkpath($localDir, 0, $f->{mode}); return $fio->attribSet($f) if ( -d $localDir ); $fio->log("Can't create directory $localDir"); return -1; } # # Make a special file. Returns non-zero on error. # sub makeSpecial { my($fio, $f) = @_; my $localPath = $fio->localName($f->{name}); # # TODO: check if the special file is the same, then do nothing. # Should also create as a new unique name, then rename/unlink. # $fio->unlink($f->{name}); if ( ($f->{mode} & S_IFMT) == S_IFCHR ) { my($major, $minor); $major = $f->{rdev} >> 8; $minor = $f->{rdev} & 0xff; return system("mknod $localPath c $major $minor"); } elsif ( ($f->{mode} & S_IFMT) == S_IFBLK ) { my($major, $minor); $major = $f->{rdev} >> 8; $minor = $f->{rdev} & 0xff; return system("mknod $localPath b $major $minor"); } elsif ( ($f->{mode} & S_IFMT) == S_IFLNK ) { if ( !symlink($f->{link}, $localPath) ) { # error } } elsif ( ($f->{mode} & S_IFMT) == S_IFIFO ) { if ( system("mknod $localPath p") ) { # error } } return $fio->attribSet($f); } # # Make a hardlink. Returns non-zero on error. # This actually gets called twice for each hardlink. # Once as the file list is processed, and again at # the end. This subroutine should decide whether it # should do the hardlinks during the transer or at # the end. Normally they would be done at the end # since the target might not exist until them. # BackupPC does them as it goes (since it is just saving the # hardlink info and not actually making hardlinks). # sub makeHardLink { my($fio, $f, $end) = @_; # # In this case, only do hardlinks at the end. # return if ( !$end ); my $localPath = $fio->localName($f->{name}); my $destLink = $fio->localName($f->{hlink}); $fio->unlink($localPath) if ( -e $localPath ); return !link($destLink, $localPath); } sub unlink { my($fio, $path) = @_; my $localPath = $fio->localName($path); return if ( !-e $localPath && !-l $localPath ); if ( -d _ ) { rmtree($localPath); } else { CORE::unlink($localPath); } } sub ignoreAttrOnFile { return undef; } # # Start receive of file deltas for a particular file. # sub fileDeltaRxStart { my($fio, $f, $cnt, $size, $remainder) = @_; $fio->{rxFile} = $f; # file attributes $fio->{rxBlkCnt} = $cnt; # how many blocks we will receive $fio->{rxBlkSize} = $size; # block size $fio->{rxRemainder} = $remainder; # size of the last block $fio->{rxMatchBlk} = 0; # current start of match $fio->{rxMatchNext} = 0; # current next block of match $fio->{rxSize} = 0; # size of received file if ( $fio->{rxFile}{size} != ($cnt > 0 ? ($cnt - 1) * $size + $remainder : 0) ) { $fio->{rxMatchBlk} = undef; # size different, so no file match $fio->log("$fio->{rxFile}{name}: size doesn't match" . " ($fio->{rxFile}{size})") if ( $fio->{logLevel} >= 5 ); } delete($fio->{rxInFd}); delete($fio->{rxOutFd}); delete($fio->{rxDigest}); $fio->{rxFile}{localName} = $fio->localName($fio->{rxFile}{name}); } # # Process the next file delta for the current file. Returns 0 if ok, # -1 if not. Must be called with either a block number, $blk, or new data, # $newData, (not both) defined. # sub fileDeltaRxNext { my($fio, $blk, $newData) = @_; if ( defined($blk) ) { if ( defined($fio->{rxMatchBlk}) && $fio->{rxMatchNext} == $blk ) { # # got the next block in order; just keep track. # $fio->{rxMatchNext}++; return; } } my $newDataLen = length($newData); $fio->log("$fio->{rxFile}{name}: blk=$blk, newData=$newDataLen," . " rxMatchBlk=$fio->{rxMatchBlk}, rxMatchNext=$fio->{rxMatchNext}") if ( $fio->{logLevel} >= 8 ); if ( !defined($fio->{rxOutFd}) ) { # # maybe the file has no changes # if ( $fio->{rxMatchNext} == $fio->{rxBlkCnt} && !defined($blk) && !defined($newData) ) { #$fio->log("$fio->{rxFile}{name}: file is unchanged"); # if ( $fio->{logLevel} >= 8 ); return; } # # need to open a temporary output file where we will build the # new version. # local(*F); my $rxTmpFile; for ( my $i = 0 ; ; $i++ ) { $rxTmpFile = "$fio->{rxFile}{localName}__tmp__$$.$i"; last if ( !-e $rxTmpFile ); } if ( !open(F, ">$rxTmpFile") ) { $fio->log("Can't open/create $rxTmpFile"); return -1; } $fio->log("$fio->{rxFile}{name}: opening tmp output file $rxTmpFile") if ( $fio->{logLevel} >= 10 ); $fio->{rxOutFd} = *F; $fio->{rxTmpFile} = $rxTmpFile; $fio->{rxDigest} = File::RsyncP::Digest->new($fio->{protocol_version}); $fio->{rxDigest}->add(pack("V", $fio->{checksumSeed})); } if ( defined($fio->{rxMatchBlk}) && $fio->{rxMatchBlk} != $fio->{rxMatchNext} ) { # # need to copy the sequence of blocks that matched # if ( !defined($fio->{rxInFd}) ) { if ( open(F, "$fio->{rxFile}{localName}") ) { $fio->{rxInFd} = *F; } else { $fio->log("Unable to open $fio->{rxFile}{localName}"); return -1; } } my $lastBlk = $fio->{rxMatchNext} - 1; $fio->log("$fio->{rxFile}{name}: writing blocks $fio->{rxMatchBlk}.." . "$lastBlk") if ( $fio->{logLevel} >= 10 ); my $seekPosn = $fio->{rxMatchBlk} * $fio->{rxBlkSize}; if ( !sysseek($fio->{rxInFd}, $seekPosn, 0) ) { $fio->log("Unable to seek $fio->{rxFile}{localName} to $seekPosn"); return -1; } my $cnt = $fio->{rxMatchNext} - $fio->{rxMatchBlk}; my($thisCnt, $len, $data); for ( my $i = 0 ; $i < $cnt ; $i += $thisCnt ) { $thisCnt = $cnt - $i; $thisCnt = 512 if ( $thisCnt > 512 ); if ( $fio->{rxMatchBlk} + $i + $thisCnt == $fio->{rxBlkCnt} ) { $len = ($thisCnt - 1) * $fio->{rxBlkSize} + $fio->{rxRemainder}; } else { $len = $thisCnt * $fio->{rxBlkSize}; } if ( sysread($fio->{rxInFd}, $data, $len) != $len ) { $fio->log("Unable to read $len bytes from" . " $fio->{rxFile}{localName} ($i,$thisCnt,$fio->{rxBlkCnt})"); return -1; } if ( syswrite($fio->{rxOutFd}, $data) != $len ) { $fio->log("Unable to write $len bytes to" . " $fio->{rxTmpFile}"); } $fio->{rxDigest}->add($data); $fio->{rxSize} += length($data); } $fio->{rxMatchBlk} = undef; } if ( defined($blk) ) { # # Remember the new block number # $fio->{rxMatchBlk} = $blk; $fio->{rxMatchNext} = $blk + 1; } if ( defined($newData) ) { # # Write the new chunk # my $len = length($newData); $fio->log("$fio->{rxFile}{name}: writing $len bytes new data") if ( $fio->{logLevel} >= 10 ); if ( syswrite($fio->{rxOutFd}, $newData) != $len ) { $fio->log("Unable to write $len bytes to $fio->{rxTmpFile}"); return -1; } $fio->{rxDigest}->add($newData); $fio->{rxSize} += length($newData); } return; } # # Finish up the current receive file. Returns undef if ok, -1 if not. # Returns 1 if the md4 digest doesn't match. # sub fileDeltaRxDone { my($fio, $md4) = @_; if ( !defined($fio->{rxDigest}) ) { local(*F); # # File was exact match, but we still need to verify the # MD4 checksum. Therefore open and read the file. # $fio->{rxDigest} = File::RsyncP::Digest->new($fio->{protocol_version}); $fio->{rxDigest}->add(pack("V", $fio->{checksumSeed})); if ( open(F, $fio->{rxFile}{localName}) ) { $fio->{rxInFd} = *F; while ( sysread($fio->{rxInFd}, my $data, 4 * 65536) > 0 ) { $fio->{rxDigest}->add($data); $fio->{rxSize} += length($data); } } else { # error } $fio->log("$fio->{rxFile}{name}: got exact match") if ( $fio->{logLevel} >= 5 ); } close($fio->{rxInFd}) if ( defined($fio->{rxInFd}) ); close($fio->{rxOutFd}) if ( defined($fio->{rxOutFd}) ); my $newDigest = $fio->{rxDigest}->digest; if ( $fio->{logLevel} >= 3 ) { my $md4Str = unpack("H*", $md4); my $newStr = unpack("H*", $newDigest); $fio->log("$fio->{rxFile}{name}: got digests $md4Str vs $newStr") } if ( $md4 eq $newDigest ) { # # Nothing to do if there is no output file # if ( !defined($fio->{rxOutFd}) ) { $fio->log("$fio->{rxFile}{name}: nothing to do") if ( $fio->{logLevel} >= 5 ); return $fio->attribSet($fio->{rxFile}); } # # First rename the original file (in case the rename below fails) # to a unique temporary name. # my $oldFile; if ( -e $fio->{rxFile}{localName} ) { for ( my $i = 0 ; ; $i++ ) { $oldFile = "$fio->{rxFile}{localName}__old__$$.$i"; last if ( !-e $oldFile ); } $fio->log("$fio->{rxFile}{name}: unlinking/renaming") if ( $fio->{logLevel} >= 5 ); if ( !rename($fio->{rxFile}{localName}, $oldFile) ) { $fio->log("Can't rename $fio->{rxFile}{localName}" . " to $oldFile"); CORE::unlink($fio->{rxTmpFile}); return -1; } } if ( !rename($fio->{rxTmpFile}, $fio->{rxFile}{localName}) ) { # # Restore old file # if ( !rename($oldFile, $fio->{rxFile}{localName}) ) { $fio->log("Can't retore original file $oldFile after rename" . " of $fio->{rxTmpFile} failed"); } else { $fio->log("Can't rename $fio->{rxTmpFile} to" . " $fio->{rxFile}{localName}"); } return -1; } if ( defined($oldFile) && CORE::unlink($oldFile) != 1 ) { $fio->log("Can't unlink old file $oldFile"); return -1; } } else { $fio->log("$fio->{rxFile}{name}: md4 doesn't match") if ( $fio->{logLevel} >= 1 ); CORE::unlink($fio->{rxTmpFile}) if ( defined($fio->{rxTmpFile}) ); return 1; } delete($fio->{rxDigest}); $fio->{rxFile}{size} = $fio->{rxSize}; return $fio->attribSet($fio->{rxFile}); } sub fileListEltSend { my($fio, $name, $fList, $outputFunc) = @_; my @s; my $extra = {}; (my $n = $name) =~ s/^\Q$fio->{localDir}/$fio->{remoteDir}/; if ( -l $name ) { @s = lstat($name); $extra = { %$extra, link => readlink($name), }; } else { @s = stat($name); } if ( $fio->{preserve_hard_links} && ($s[2] & S_IFMT) == S_IFREG && ($fio->{protocol_version} < 27 || $s[3] > 1) ) { $extra = { %$extra, dev => $s[0], inode => $s[1], }; } $fio->log("fileList send $name (remote=$n)") if ( $fio->{logLevel} >= 3 ); $fList->encode({ name => $n, mode => $s[2], uid => $s[4], gid => $s[5], rdev => $s[6], size => $s[7], mtime => $s[9], %$extra, }); &$outputFunc($fList->encodeData); } sub fileListSend { my($fio, $flist, $outputFunc) = @_; find({wanted => sub { $fio->fileListEltSend($File::Find::name, $flist, $outputFunc); }, no_chdir => 1 }, $fio->{localDir}); } sub finish { my($fio, $isChild) = @_; return; } # # Default log handler # sub logHandler { my($str) = @_; print(STDERR $str, "\n"); } # # Handle one or more log messages # sub log { my($fio, @logStr) = @_; foreach my $str ( @logStr ) { next if ( $str eq "" ); $fio->{logHandler}->($str); } } 1; __END__ =head1 NAME File::RsyncP::FileIO - Perl Rsync client file system IO =head1 SYNOPSIS use File::RsyncP::FileIO; my $rs = File::RsyncP->new({ logLevel => 1, rsyncCmd => ["/bin/rsh", $host, "-l", $user, "/bin/rsync"], rsyncArgs => [qw( --numeric-ids --perms --owner --group --devices --links --ignore-times --block-size=700 --relative --recursive -v )], logHandler => sub { my($str) = @_; print MyHandler "log: $str\n"; }; fio => File::RsyncP::FileIO->new({ logLevel => 1, }); }); =head1 DESCRIPTION File::RsyncP::FileIO contains all of the file system access functions needed by File::RsyncP. This functionality is relegated to this module so it can be subclassed or replaced by different code for applications where an rsync interface is provided for non-file system data (eg: databases). File::RsyncP::FileIO provides the following functions. =head2 Setup and utility functions =over 4 =item new({ options... }) Creates a new File::RsyncP::FileIO object. The single argument is a hashref of options: =over 4 =item blockSize Defaults to 700. Can be set later using the blockSize function. =item logLevel Defaults to 0. Controls the verbosity of FileIO operations. =item digest Defaults to File::RsyncP::Digest->new. No need to override. =item checksumSeed The checksum seed used in digest calculations. Defaults to 0. The server-side Rsync generates a checksum seed and sends it to the client. This value is usually set later, after the checksum seed is received from the remote rsync, via the checksumSeed function. =item logHandler A subroutine reference to a function that handles all the log messages. The default is a subroutine that prints the messages to STDERR. =back =item blockSize($value) Set the block size to the new value, in case it wasn't set via the blockSize option to new(). =item checksumSeed($seed) Set the checksum seed used in digest calculations to the new value. Usually this value isn't known when new() is called, so it is necessary to set it later via this function. =item logHandlerSet Set the log handler callback function. Usually this value is specified via new(), but it can be changed later via this function. =item dirs($localDir, $remoteDir) Specify the local and remote directories. =item log(@msg) Save one (or more) messages for logging purposes. =item statsGet Return an optional hashref of statistics compiled by the FileIO object. These values are opaquely passed up to File::RsyncP. =item finish($isChild) Do any necessary finish-up processing. The $isChild argument is true if this is the child process (remember the receiving side has two processes: the child receives the file deltas while the parent generates the block digests). =back =head2 Checksum computation functions =over 4 =item csumStart($f, $needMD4) Get ready to generate block checksums for the given file. The argument is a hashref typically returned by File::RsyncP::FileList->get. Typically this opens the underlying file and creates a File::RsyncP::Digest object. If $needMD4 is non-zero, then csumEnd() will return the file MD4 digest. =item csumGet($num, $csumLen, $blockSize) Return $num bkocks work of checksums with the MD4 checksum length of $csumLen (typically 2 or 16), with a block size of $blockSize. Typically this reads the file and calls File::RsyncP::Digest->blockDigest. =item csumEnd() Finish up the checksum calculation. Typically closes the underlying file. Note that csumStart, csumGet, csumEnd are called in strict order so they don't need to be reentrant (ie: there is only one csum done at a time). If csumStart() was called with $needMD4 then csumEnd() will return the file MD4 digest. =back =head2 File reading functions There are used for sending files (currently sending files doesn't implement deltas; it behaves as though --whole-file was specified): =over 4 =item readStart($f) Get ready to read the given file. The argument is a hashref typically returned by File::RsyncP::FileList->get. Typically this opens the underlying file. =item read($num) Read $num bytes from the file. =item readEnd() Finish up the read operation. Typically closes the underlying file. Note that readStart, readGet, readEnd are called in strict order so they don't need to be reentrant (ie: there is only one read done at a time). =back =head2 File operations =over 4 =item attribGet($f) Return the attributes for the given file as a hashref. The argument is a hashref typically returned by File::RsyncP::FileList->get. =item attribSet($f, $placeHolder) Set the attributes for the given file. The argument is a hashref typically returned by File::RsyncP::FileList->get. If $placeHolder is true then don't do anything. Returns undef on success. =item makePath($f) Create the directory specified by $f. The argument is a hashref typically returned by File::RsyncP::FileList->get. Returns undef on success. =item makeSpecial($f) Create the special file specified by $f. The argument is a hashref typically returned by File::RsyncP::FileList->get. Returns undef on success. =item unlink($remotePath) Unlink the file or directory corresponding to the given remote path. =item ignoreAttrOnFile($f) Normally should return undef, meaning use the default setting of ignore-times. Otherwise, if this function returns zero or non-zero, the returned value overrides the setting of ignore-times for this file. The argument is a hashref typically returned by File::RsyncP::FileList->get. See the doPartial option in File::RsyncP->new(). =back =head2 File delta receiving functions These functions are only called when we are receiving files. They are called by the child process. =over 4 =item fileDeltaRxStart($f, $cnt, $size, $remainder) Start the receiving of file deltas for file $f, a hashref typically returned by File::RsyncP::FileList->get. The remaining arguments are the number of blocks, size of blocks, and size of the last (partial) block as generated by the parent on the receiving side (they are not the values the new file on the sending side). Returns undef on success. =item fileDeltaRxNext($blk, $newData) This function is called repeatedly as the file is constructed. Exactly one of $blk and $newData are defined. If $blk is defined it is an integer that specifies which block of the original file should be written at this point. If $newData is defined, it is literal data (that didn't match any blocks) that should be written at this point. =item fileDeltaRxDone($md4) Finish processing of the file deltas for this file. $md4 is the MD4 digest of the sent file. It should be compared against the MD4 digest of the reconstructed file. Returns undef on success, 1 if the file's MD4 didn't agree (meaning it should be repeated for phase 2), and negative on error. =back =head2 File list sending function =over 4 =item fileListSend($fileList, $outputFunc) Generate the file list (by calling $fileList->encode for every file to be sent) and call the output function $outputFunc with the output data by calling &$outputFunc($fileList->encodeData); =back =head1 AUTHOR File::RsyncP::FileList was written by Craig Barratt based on rsync 2.5.5. Rsync was written by Andrew Tridgell and Paul Mackerras. It is available under a GPL license. See http://rsync.samba.org =head1 LICENSE 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 in the LICENSE file along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. =head1 SEE ALSO See L for File::RsyncP's SourceForge home page. See L, L, and L. Also see BackupPC's lib/BackupPC/Xfer/RsyncFileIO.pm for an example of another implementation of File::RsyncP::FileIO, in fact one that is more tested than the default File::RsyncP::FileIO.pm. =cut File-RsyncP-0.74/lib/File/RsyncP.pm0000444000076500000240000017435012456603057015730 0ustar craigstaff#============================================================= -*-perl-*- # # File::RsyncP package # # DESCRIPTION # File::RsyncP is a perl module that implements a subset of the # Rsync protocol, sufficient for implementing a client that can # talk to a native rsync server or rsyncd daemon. # # AUTHOR # Craig Barratt # # COPYRIGHT # File::RsyncP is Copyright (C) 2002-2015 Craig Barratt. # # Rsync is Copyright (C) 1996-2001 by Andrew Tridgell, 1996 by Paul # Mackerras, 2001-2002 by Martin Pool, and 2003-2009 by Wayne Davison, # and others. # # 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 3 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, see . # #======================================================================== # # Version 0.74, released 17 Jan 2015. # # See http://perlrsync.sourceforge.net. # #======================================================================== package File::RsyncP; use strict; use Socket; use File::RsyncP::Digest; use File::RsyncP::FileIO; use File::RsyncP::FileList; use Getopt::Long; use Data::Dumper; use Config; use Encode qw/from_to/; use Fcntl; use vars qw($VERSION); $VERSION = '0.74'; use constant S_IFMT => 0170000; # type of file use constant S_IFDIR => 0040000; # directory use constant S_IFCHR => 0020000; # character special use constant S_IFBLK => 0060000; # block special use constant S_IFREG => 0100000; # regular use constant S_IFLNK => 0120000; # symbolic link use constant S_IFSOCK => 0140000; # socket use constant S_IFIFO => 0010000; # fifo sub new { my($class, $options) = @_; $options ||= {}; my $rs = bless { protocol_version => 28, logHandler => \&logHandler, abort => 0, %$options, }, $class; # # In recent versions of rsync (eg: 2.6.8) --devices is no # longer identical to -D. Now -D means --devices --specials. # File::RsyncP assumes --devices behaves the same as -D, # and doesn't currently handle --specials. # # To make sure we don't lie to the remote rsync, we must # send -D instead of --devices. Therefore, we manually # replace --devices with -D in $rs->{rsyncArgs}. # for ( my $i = 0 ; $i < @{$rs->{rsyncArgs}} ; $i++ ) { $rs->{rsyncArgs}[$i] = "-D" if ( $rs->{rsyncArgs}[$i] eq "--devices" ); } # # process rsync options # local(@ARGV); $rs->{rsyncOpts} = {}; @ARGV = @{$rs->{rsyncArgs}}; my $p = new Getopt::Long::Parser( config => ["bundling", "pass_through"], ); # # First extract all the exclude related options for processing later # return if ( !$p->getoptions( "exclude=s", sub { optExclude($rs, @_); }, "exclude-from=s", sub { optExclude($rs, @_); }, "include=s", sub { optExclude($rs, @_); }, "include-from=s", sub { optExclude($rs, @_); }, "cvs-exclude|C", sub { optExclude($rs, @_); }, ) ); # # Since the exclude arguments are no longer needed (they are # passed via the socket, not the command-line args), update # $rs->{rsyncOpts} # @{$rs->{rsyncArgs}} = @ARGV; # # Now process the rest of the arguments we care about # return if ( !$p->getoptions($rs->{rsyncOpts}, "block-size=i", "devices|D", "from0|0", "group|g", "hard-links|H", "ignore-times|I", "links|l", "numeric-ids", "owner|o", "perms|p", "protocol=i", "recursive|r", "relative|R", "timeout", "verbose|v+", ) ); $rs->{blockSize} = $rs->{rsyncOpts}{"block-size"}; $rs->{timeout} ||= $rs->{rsyncOpts}{timeout}; $rs->{protocol_version} = $rs->{rsyncOpts}{protocol} if ( defined($rs->{rsyncOpts}{protocol}) ); $rs->{fio_version} = 1; if ( !defined($rs->{fio}) ) { $rs->{fio} = File::RsyncP::FileIO->new({ blockSize => $rs->{blockSize}, logLevel => $rs->{logLevel}, protocol_version => $rs->{protocol_version}, preserve_hard_links => $rs->{rsyncOpts}{"hard-links"}, clientCharset => $rs->{clientCharset}, }); eval { $rs->{fio_version} = $rs->{fio}->version; }; } else { # # Tell the existing FileIO module various parameters that # depend upon the parsed rsync args # eval { $rs->{fio_version} = $rs->{fio}->version; }; $rs->{fio}->blockSize($rs->{blockSize}); if ( $rs->{fio_version} >= 2 ) { $rs->{fio}->protocol_version($rs->{protocol_version}); $rs->{fio}->preserve_hard_links($rs->{rsyncOpts}{"hard-links"}); } else { # # old version of FileIO: only supports version 26 # $rs->{protocol_version} = 26 if ( $rs->{protocol_version} > 26 ); } } # # build signal list in case we do an abort # my $i = 0; foreach my $name ( split(' ', $Config{sig_name}) ) { $rs->{sigName2Num}{$name} = $i; $i++; } return $rs; } sub optExclude { my($rs, $argName, $argValue) = @_; push(@{$rs->{excludeArgs}}, {name => $argName, value => $argValue}); } # # Strip the exclude and include arguments from the given argument list # sub excludeStrip { my($rs, $args) = @_; local(@ARGV); my $p = new Getopt::Long::Parser( config => ["bundling", "pass_through"], ); @ARGV = @$args; # # Extract all the exclude related options # $p->getoptions( "exclude=s", sub { }, "exclude-from=s", sub { }, "include=s", sub { }, "include-from=s", sub { }, "cvs-exclude|C", sub { }, ); return \@ARGV; } sub serverConnect { my($rs, $host, $port) = @_; #local(*FH); $port ||= 873; my $proto = getprotobyname('tcp'); my $iaddr = inet_aton($host) || return "unknown host $host"; my $paddr = sockaddr_in($port, $iaddr); alarm($rs->{timeout}) if ( $rs->{timeout} ); socket(FH, PF_INET, SOCK_STREAM, $proto) || return "inet socket: $!"; connect(FH, $paddr) || return "inet connect: $!"; $rs->{fh} = *FH; $rs->writeData("\@RSYNCD: $rs->{protocol_version}\n", 1); my $line = $rs->getLine; alarm(0) if ( $rs->{timeout} ); if ( $line !~ /\@RSYNCD:\s*(\d+)/ ) { return "unexpected response $line\n"; } $rs->{remote_protocol} = $1; if ( $rs->{remote_protocol} < 20 || $rs->{remote_protocol} > 40 ) { return "Bad protocol version: $rs->{remote_protocol}\n"; } $rs->log("Connected to $host:$port, remote version $rs->{remote_protocol}") if ( $rs->{logLevel} >= 1 ); $rs->{protocol_version} = $rs->{remote_protocol} if ( $rs->{protocol_version} > $rs->{remote_protocol} ); $rs->{fio}->protocol_version($rs->{protocol_version}) if ( $rs->{fio_version} >= 2 ); $rs->log("Negotiated protocol version $rs->{protocol_version}") if ( $rs->{logLevel} >= 1 ); return; } sub serverList { my($rs) = @_; my(@service); return "not connected" if ( !defined($rs->{fh}) ); $rs->writeData("#list\n", 1); while ( 1 ) { my $line = $rs->getLine; $rs->log("Got `$line'") if ( $rs->{logLevel} >= 2 ); last if ( $line eq "\@RSYNCD: EXIT" ); push(@service, $line); } return @service; } sub serverService { my($rs, $service, $user, $passwd, $authRequired) = @_; my($line); return "not connected" if ( !defined($rs->{fh}) ); $rs->writeData("$service\n", 1); $line = $rs->getLine; return $1 if ( $line =~ /\@ERROR: (.*)/ ); if ( $line =~ /\@RSYNCD: AUTHREQD (.{22})/ ) { my $challenge = $1; my $md4 = File::RsyncP::Digest->new($rs->{protocol_version}); $md4->add(pack("V", 0)); $md4->add($passwd); $md4->add($challenge); my $response = $md4->digest; $rs->log("Got response: " . unpack("H*", $response)) if ( $rs->{logLevel} >= 2 ); my $response1 = $rs->encode_base64($response); $rs->log("in mime: " . $response1) if ( $rs->{logLevel} >= 5 ); $rs->writeData("$user $response1\n", 1); $rs->log("Auth: got challenge: $challenge, reply: $user $response1") if ( $rs->{logLevel} >= 2 ); $line = $rs->getLine; } elsif ( $authRequired ) { return "auth required, but service $service is open/insecure"; } return $1 if ( $line =~ /\@ERROR: (.*)/ ); if ( $line ne "\@RSYNCD: OK" ) { return "unexpected response: '$line'"; } $rs->log("Connected to module $service") if ( $rs->{logLevel} >= 1 ); return; } sub serverStart { my($rs, $remoteSend, $remoteDir) = @_; my @args = @{$rs->{rsyncArgs}}; unshift(@args, "--sender") if ( $remoteSend ); unshift(@args, "--server"); push(@args, ".", $remoteDir); $rs->{remoteSend} = $remoteSend; $rs->writeData(join("\n", @args) . "\n\n", 1); $rs->log("Sending args: " . join(" ", @args)) if ( $rs->{logLevel} >= 1 ); } sub encode_base64 { my($rs, $str) = @_; my $s2 = pack('u', $str); $s2 =~ tr|` -_|AA-Za-z0-9+/|; return substr($s2, 1, int(1.0 - 1e-10 + length($str) * 8 / 6)); } sub remoteStart { my($rs, $remoteSend, $remoteDir) = @_; local(*RSYNC); my($pid, $cmd); socketpair(RSYNC, FH, AF_UNIX, SOCK_STREAM, PF_UNSPEC) or die "socketpair: $!"; $rs->{remoteSend} = $remoteSend; $rs->{remoteDir} = $remoteDir; $rs->{rsyncCmd} = [split(" ", $rs->{rsyncCmd})] if ( ref($rs->{rsyncCmd}) ne 'ARRAY' && ref($rs->{rsyncCmd}) ne 'CODE' ); if ( $rs->{rsyncCmdType} eq "full" || ref($rs->{rsyncCmd}) ne 'ARRAY' ) { $cmd = $rs->{rsyncCmd}; } else { $cmd = $rs->{rsyncArgs}; unshift(@$cmd, "--sender") if ( $remoteSend ); unshift(@$cmd, "--server"); if ( $rs->{rsyncCmdType} eq "shell" ) { # # Do shell escaping of rsync arguments # for ( my $i = 0 ; $i < @$cmd ; $i++ ) { $cmd->[$i] = $rs->shellEscape($cmd->[$i]); } $remoteDir = $rs->shellEscape($remoteDir); } $cmd = [@{$rs->{rsyncCmd}}, @$cmd]; if ( $remoteSend ) { push(@$cmd, ".", $remoteDir); } else { push(@$cmd, "."); } } $rs->log("Running: " . join(" ", @$cmd)) if ( ref($cmd) eq 'ARRAY' && $rs->{logLevel} >= 1 ); if ( !($pid = fork()) ) { # # The child execs rsync. # close(FH); close(STDIN); close(STDOUT); close(STDERR); open(STDIN, "<&RSYNC"); open(STDOUT, ">&RSYNC"); open(STDERR, ">&RSYNC"); if ( ref($cmd) eq 'CODE' ) { &$cmd(); } else { exec(@$cmd); } # not reached # $rs->log("Failed to exec rsync command $cmd[0]"); # exit(0); } close(RSYNC); $rs->{fh} = *FH; $rs->{rsyncPID} = $pid; $rs->{pidHandler}->($rs->{rsyncPID}, $rs->{childPID}) if ( defined($rs->{pidHandler}) ); # # Write our version and get the remote version # $rs->writeData(pack("V", $rs->{protocol_version}), 1); $rs->log("Rsync command pid is $pid") if ( $rs->{logLevel} >= 3 ); $rs->log("Fetching remote protocol") if ( $rs->{logLevel} >= 5 ); return -1 if ( $rs->getData(4) < 0 ); my $data = $rs->{readData}; my $version = unpack("V", $rs->{readData}); $rs->{readData} = substr($rs->{readData}, 4); $rs->{remote_protocol} = $version; $rs->log("Got remote protocol $version") if ( $rs->{logLevel} >= 1 ); $rs->{protocol_version} = $rs->{remote_protocol} if ( $rs->{protocol_version} > $rs->{remote_protocol} ); $rs->{fio}->protocol_version($rs->{protocol_version}) if ( $rs->{fio_version} >= 2 ); if ( $version < 20 || $version > 40 ) { $rs->log("Fatal error (bad version): $data"); return -1; } $rs->log("Negotiated protocol version $rs->{protocol_version}") if ( $rs->{logLevel} >= 1 ); return; } sub serverClose { my($rs) = @_; return if ( !defined($rs->{fh}) ); close($rs->{fh}); $rs->{fh} = undef; } sub go { my($rs, $localDir) = @_; my $remoteDir = $rs->{remoteDir}; return $rs->{fatalErrorMsg} if ( $rs->getData(4) < 0 ); $rs->{checksumSeed} = unpack("V", $rs->{readData}); $rs->{readData} = substr($rs->{readData}, 4); $rs->{fio}->checksumSeed($rs->{checksumSeed}); $rs->{fio}->dirs($localDir, $remoteDir); $rs->log(sprintf("Got checksumSeed 0x%x", $rs->{checksumSeed})) if ( $rs->{logLevel} >= 2 ); if ( $rs->{remoteSend} ) { # # Get the file list from the remote sender # if ( $rs->fileListReceive() < 0 ) { $rs->log("fileListReceive() failed"); return "fileListReceive failed"; } # # Sort and match inode data if hardlinks are enabled # if ( $rs->{rsyncOpts}{"hard-links"} ) { $rs->{fileList}->init_hard_links(); ##my $cnt = $rs->{fileList}->count; ##for ( my $n = 0 ; $n < $cnt ; $n++ ) { ## my $f = $rs->{fileList}->get($n); ## print Dumper($f); ##} } if ( $rs->{logLevel} >= 2 ) { my $cnt = $rs->{fileList}->count; $rs->log("Got file list: $cnt entries"); } # # At this point the uid/gid list would be received, # but with numeric-ids nothing is sent. We currently # only support the numeric-ids case. # # # Read and skip a word: this is the io_error flag. # return "can't read io_error flag" if ( $rs->getChunk(4) < 0 ); $rs->{chunkData} = substr($rs->{chunkData}, 4); # # If this is a partial, then check which files we are # going to skip # $rs->partialFileListPopulate() if ( $rs->{doPartial} ); # # Dup the $rs->{fh} socket file handle into two pieces: read-only # and write-only. The child gets the read-only handle and # we keep the write-only one. We make the write-only handle # non-blocking. # my $pid; local(*RH, *WH, *FHWr, *FHRd); socketpair(RH, WH, AF_UNIX, SOCK_STREAM, PF_UNSPEC); shutdown(RH, 1); shutdown(WH, 0); open(FHWr, ">&$rs->{fh}"); open(FHRd, "<&$rs->{fh}"); close($rs->{fh}); if ( !($pid = fork()) ) { # # The child receives the file deltas in two passes. # If a file needs to be repeated in phase 2 we send # the file into the the parent via the pipe. # # First the log handler for both us and fio has to forward # to the parent, so redefine them. # $rs->{logHandler} = sub { my($str) = @_; $str =~ s/\n/\\n/g; $str =~ s/\r/\\r/g; print WH "log $str\n"; }; $rs->{fio}->logHandlerSet(sub { my($str) = @_; $str =~ s/\n/\\n/g; $str =~ s/\r/\\r/g; print WH "log $str\n"; }); close(RH); close(FHWr); $rs->{fh} = *FHRd; setsockopt($rs->{fh}, SOL_SOCKET, SO_RCVBUF, 8 * 65536); setsockopt(WH, SOL_SOCKET, SO_SNDBUF, 8 * 65536); my $oldFH = select(WH); $| = 1; select($oldFH); $rs->fileDeltaGet(*WH, 0); $rs->log("Child is sending done") if ( $rs->{logLevel} >= 5 ); print(WH "done\n"); $rs->fileDeltaGet(*WH, 1) if ( !$rs->{abort} ); # # Get stats # $rs->statsGet(*WH); # # Final signoff # $rs->writeData(pack("V", 0xffffffff), 1); $rs->{fio}->finish(1); $rs->log("Child is aborting") if ( $rs->{abort} ); print(WH "exit\n"); exit(0); } close(WH); close(FHRd); $rs->{fh} = *FHWr; # # Make our write handle non-blocking # my $flags = ''; if ( fcntl($rs->{fh}, F_GETFL, $flags) ) { $flags |= O_NONBLOCK; if ( !fcntl($rs->{fh}, F_SETFL, $flags) ) { $rs->log("Parent fcntl(F_SETFL) failed; non-block set failed"); } } else { $rs->log("Parent fcntl(F_GETFL) failed; non-block failed"); } $rs->{childFh} = *RH; $rs->{childPID} = $pid; $rs->log("Child PID is $pid") if ( $rs->{logLevel} >= 2 ); $rs->{pidHandler}->($rs->{rsyncPID}, $rs->{childPID}) if ( defined($rs->{pidHandler}) ); setsockopt($rs->{fh}, SOL_SOCKET, SO_SNDBUF, 8 * 65536); setsockopt($rs->{childFh}, SOL_SOCKET, SO_RCVBUF, 8 * 65536); # # The parent generates the file checksums and waits for # the child to finish. The child tells us if any files # need to be repeated for phase 2. # # Phase 1: csum length is 2 (or >= 2 for protocol_version >= 27) # $rs->fileCsumSend(0); # # Phase 2: csum length is 16 # $rs->fileCsumSend(1); if ( $rs->{abort} ) { # # If we are aborting, give the child a few seconds # to finish up. # for ( my $i = 0 ; $i < 10 ; $i++ ) { last if ( $rs->{childDone} >= 3 || $rs->pollChild(1) < 0 ); } $rs->{fatalErrorMsg} = $rs->{abortReason} if ( !defined($rs->{fatalErrorMsg}) ); } # # Done # $rs->{fio}->finish(0); close(RH); return $rs->{fatalErrorMsg} if ( defined($rs->{fatalErrorMsg}) ); return; } else { #syswrite($rs->{fh}, pack("V", time)); # # Send the file list to the remote server # $rs->fileListSend(); return $rs->{fatalErrorMsg} if ( $rs->{fatalError} ); # # Phase 1: csum length is 2 # $rs->fileCsumReceive(0); return $rs->{fatalErrorMsg} if ( $rs->{fatalError} ); # # Phase 2: csum length is 3 # $rs->fileCsumReceive(1); return $rs->{fatalErrorMsg} if ( $rs->{fatalError} ); # # Get final int handshake, and wait for EOF # $rs->getData(4); return -1 if ( $rs->{abort} ); sysread($rs->{fh}, my $data, 1); return; } } # # When a partial rsync is done (meaning selective per-file ignore-attr) # we pass through the file list and remember which files we should # skip. This allows the child to callback the user on each skipped # file. # sub partialFileListPopulate { my($rs) = @_; my $cnt = $rs->{fileList}->count; for ( my $n = 0 ; $n < $cnt ; $n++ ) { my $f = $rs->{fileList}->get($n); next if ( !defined($f) ); from_to($f->{name}, $rs->{clientCharset}, "utf8") if ( $rs->{clientCharset} ne "" ); my $attr = $rs->{fio}->attribGet($f); my $thisIgnoreAttr = $rs->{fio}->ignoreAttrOnFile($f); # # check if we should skip this file: same type, size, mtime etc # if ( !$thisIgnoreAttr && $f->{size} == $attr->{size} && $f->{mtime} == $attr->{mtime} && (!$rs->{rsyncOpts}{perms} || $f->{mode} == $attr->{mode}) && (!$rs->{rsyncOpts}{group} || $f->{gid} == $attr->{gid}) && (!$rs->{rsyncOpts}{owner} || $f->{uid} == $attr->{uid}) && (!$rs->{rsyncOpts}{"hard-links"} || $f->{hlink_self} == $attr->{hlink_self}) ) { $rs->{fileList}->flagSet($n, 1); } } } sub fileListReceive { my($rs) = @_; my($flags, $l1, $l2, $namel1, $name, $length, $mode, $mtime, $uid, $gid, $rdev); my($data, $flData); $rs->{fileList} = File::RsyncP::FileList->new({ preserve_uid => $rs->{rsyncOpts}{owner}, preserve_gid => $rs->{rsyncOpts}{group}, preserve_links => $rs->{rsyncOpts}{links}, preserve_devices => $rs->{rsyncOpts}{devices}, preserve_hard_links => $rs->{rsyncOpts}{"hard-links"}, always_checksum => $rs->{rsyncOpts}{checksum}, protocol_version => $rs->{protocol_version}, }); # # Process the exclude/include arguments and send the # exclude/include file list # foreach my $arg ( @{$rs->{excludeArgs}} ) { if ( $arg->{name} eq "exclude" ) { $rs->{fileList}->exclude_add($arg->{value}, 0); } elsif ( $arg->{name} eq "include" ) { $rs->{fileList}->exclude_add($arg->{value}, 2); } elsif ( $arg->{name} eq "exclude-from" ) { $rs->{fileList}->exclude_add_file($arg->{value}, 1); } elsif ( $arg->{name} eq "include-from" ) { $rs->{fileList}->exclude_add_file($arg->{value}, 3); } elsif ( $arg->{name} eq "cvs-exclude" ) { $rs->{fileList}->exclude_cvs_add(); } else { $rs->log("Error: Don't recognize exclude argument $arg->{name}" . " ($arg->{value})"); } } $rs->{fileList}->exclude_list_send(); $rs->writeData($rs->{fileList}->encodeData(), 1); if ( $rs->{logLevel} >= 1 ) { foreach my $exc ( @{$rs->{fileList}->exclude_list_get()} ) { from_to($exc->{pattern}, $rs->{clientCharset}, "utf8") if ( $rs->{clientCharset} ne "" ); if ( $exc->{flags} & (1 << 4) ) { $rs->log("Sent include: $exc->{pattern}"); } else { $rs->log("Sent exclude: $exc->{pattern}"); } } } # # Now receive the file list # my $curr = 0; while ( !$rs->{fileList}->decodeDone ) { return -1 if ( $rs->{chunkData} eq "" && $rs->getChunk(1) < 0 ); my $cnt = $rs->{fileList}->decode($rs->{chunkData}); return -1 if ( $rs->{fileList}->fatalError ); if ( $rs->{logLevel} >= 4 ) { my $end = $rs->{fileList}->count; while ( $curr < $end ) { my $f = $rs->{fileList}->get($curr); next if ( !defined($f) ); from_to($f->{name}, $rs->{clientCharset}, "utf8") if ( $rs->{clientCharset} ne "" ); $rs->log("Got file ($curr of $end): $f->{name}"); $curr++; } } if ( $cnt > 0 ) { $rs->{chunkData} = substr($rs->{chunkData}, $cnt); return -1 if ( !$rs->{fileList}->decodeDone && $rs->getChunk(length($rs->{chunkData}) + 1) < 0 ); } } # # Sort and clean the file list # $rs->{fileList}->clean; } # # Called by the child process to create directories, special files, # and optionally to set attributes on normal files. # sub fileSpecialCreate { my($rs, $start, $end) = @_; $end = $rs->{fileList}->count if ( !defined($end) ); for ( my $n = $start ; $n < $end ; $n++ ) { my $f = $rs->{fileList}->get($n); next if ( !defined($f) ); from_to($f->{name}, $rs->{clientCharset}, "utf8") if ( $rs->{clientCharset} ne "" ); my $attr = $rs->{fio}->attribGet($f); if ( $rs->{doPartial} && $rs->{fileList}->flagGet($n) ) { $rs->{fio}->attrSkippedFile($f, $attr); next; } $rs->{fio}->attribSet($f, 1); if ( ($f->{mode} & S_IFMT) != S_IFREG ) { # # A special file # if ( ($f->{mode} & S_IFMT) == S_IFDIR ) { if ( $rs->{fio}->makePath($f) ) { # error $rs->log("Error: makePath($f->{name}) failed"); } } else { if ( $rs->{fio}->makeSpecial($f) ) { # error $rs->log("Error: makeSpecial($f->{name}) failed"); } } } elsif ( defined($f->{hlink}) && !$f->{hlink_self} ) { if ( $rs->{fio}->makeHardLink($f, 0) ) { $rs->log("Error: makeHardlink($f->{name} -> $f->{hlink}) failed"); } } } } sub fileCsumSend { my($rs, $phase) = @_; my $csumLen = $phase == 0 ? 2 : 16; my $ignoreAttr = $rs->{rsyncOpts}{"ignore-times"}; $rs->{phase} = $phase; my $cnt = $rs->{fileList}->count; $rs->{doList} = [0..($cnt-1)] if ( $phase == 0 ); $rs->{redoList} = []; if ( $rs->{logLevel} >= 2 ) { my $cnt = @{$rs->{doList}}; $rs->log("Sending csums, cnt = $cnt, phase = $phase"); } while ( @{$rs->{doList}} || $phase == 1 && $rs->{childDone} < 3 ) { if ( @{$rs->{doList}} ) { my $n = shift(@{$rs->{doList}}); my $f = $rs->{fileList}->get($n); next if ( !defined($f) ); from_to($f->{name}, $rs->{clientCharset}, "utf8") if ( $rs->{clientCharset} ne "" ); if ( $rs->{doPartial} && $rs->{fileList}->flagGet($n) ) { $rs->log("Skipping $f->{name} (same attr on partial)") if ( $rs->{logLevel} >= 3 && ($f->{mode} & S_IFMT) == S_IFREG ); next; } # # check if we should skip this file: same type, size, mtime etc # my $attr = $rs->{fio}->attribGet($f); if ( !$ignoreAttr && $phase == 0 && $f->{size} == $attr->{size} && $f->{mtime} == $attr->{mtime} && (!$rs->{rsyncOpts}{perms} || $f->{mode} == $attr->{mode}) && (!$rs->{rsyncOpts}{group} || $f->{gid} == $attr->{gid}) && (!$rs->{rsyncOpts}{owner} || $f->{uid} == $attr->{uid}) && (!$rs->{rsyncOpts}{"hard-links"} || $f->{hlink_self} == $attr->{hlink_self}) ) { $rs->log("Skipping $f->{name} (same attr)") if ( $rs->{logLevel} >= 3 && ($f->{mode} & S_IFMT) == S_IFREG ); next; } my $blkSize; if ( ($f->{mode} & S_IFMT) != S_IFREG ) { # # Remote file is special: no checksum needed. # next; } elsif ( $rs->{rsyncOpts}{"hard-links"} && defined($f->{hlink}) && !$f->{hlink_self} ) { # # Skip any hardlinks; the child will create them later # next; } elsif ( !defined($attr->{mode}) || ($attr->{mode} & S_IFMT) != S_IFREG ) { # # Local file isn't a regular file but remote is. # So delete the local file and send an empty # checksum. # $rs->{fio}->unlink($f->{name}) if ( defined($attr->{mode}) ); $rs->log("Sending empty csums for $f->{name}") if ( $rs->{logLevel} >= 5 ); $rs->write_sum_head($n, 0, $rs->{blockSize}, $csumLen, 0); } elsif ( ($blkSize = $rs->{fio}->csumStart($f, 0, $rs->{blockSize}, $phase)) < 0 ) { # # Can't open the file, so send an empty checksum # $rs->log("Sending empty csums for $f->{name}") if ( $rs->{logLevel} >= 5 ); $rs->write_sum_head($n, 0, $rs->{blockSize}, $csumLen, 0); } else { # # The local file is a regular file, so generate and # send the checksums. # # # Compute adaptive block size, from $rs->{blockSize} # to 16384 based on file size. # if ( $blkSize <= 0 ) { $blkSize = int($attr->{size} / 10000); $blkSize = $rs->{blockSize} if ( $blkSize < $rs->{blockSize} ); $blkSize = 16384 if ( $blkSize > 16384 ); } my $blkCnt = int(($attr->{size} + $blkSize - 1) / $blkSize); $rs->log("Sending csums for $f->{name} (size=$attr->{size})") if ( $rs->{logLevel} >= 5 ); $rs->write_sum_head($n, $blkCnt, $blkSize, $csumLen, $blkCnt > 0 ? $attr->{size} - ($blkCnt - 1) * $blkSize : $attr->{size}); my $nWrite = ($csumLen + 4) * $blkCnt; while ( $blkCnt > 0 && $nWrite > 0 ) { my $thisCnt = $blkCnt > 256 ? 256 : $blkCnt; my $csum = $rs->{fio}->csumGet($thisCnt, $csumLen, $blkSize); $rs->writeData($csum); $nWrite -= length($csum); $blkCnt -= $thisCnt; return if ( $rs->{abort} ); } # # In case the reported file size was wrong, we need to # send enough checksum data. It's not clear that sending # zeros is right, but this shouldn't happen in any case. # if ( $nWrite > 0 && !$rs->{abort} ) { $rs->writeData(pack("c", 0) x $nWrite); } $rs->{fio}->csumEnd; } } if ( !@{$rs->{doList}} && $phase == 1 && $rs->{childDone} == 1 ) { # # end of phase 1 # $rs->writeData(pack("V", 0xffffffff), 1); $rs->{childDone} = 2; } # # Now poll the pipe from the child to see if there are any # files we need to redo on the second phase # # If there are no more files but we haven't seen "exit" # from the child then block forever. # return if ( $rs->{abort} ); $rs->pollChild(($phase == 1 && !@{$rs->{doList}}) ? undef : 0); } if ( $phase == 0 ) { # # end of phase 0 # $rs->writeData(pack("V", 0xffffffff), 1); $rs->{doList} = $rs->{redoList}; } } # # See if there are any messges from the local child over the pipe. # These could be logging messages or requests to repeat files. # sub pollChild { my($rs, $timeout) = @_; my($FDread); return -1 if ( !defined($rs->{childFh}) ); $rs->log("pollChild($timeout)") if ( $rs->{logLevel} >= 12 ); vec($FDread, fileno($rs->{childFh}), 1) = 1; my $ein = $FDread; #$rs->log("pollChild: select(timeout=$timeout)"); select(my $rout = $FDread, undef, $ein, $timeout); return if ( !vec($rout, fileno($rs->{childFh}), 1) ); #$rs->log("pollChild: reading from child"); my $nbytes = sysread($rs->{childFh}, my $mesg, 65536); #$rs->log("pollChild: done reading from child"); $rs->{childMesg} .= $mesg if ( $nbytes > 0 ); if ( $nbytes <= 0 ) { close($rs->{childFh}); delete($rs->{childFh}); $rs->log("Parent read EOF from child: fatal error!") if ( $rs->{logLevel} >= 1 ); $rs->{abort} = 1; $rs->{fatalError} = 1; $rs->{fatalErrorMsg} = "Child exited prematurely"; return -1; } # # Process any complete lines of output from the child. # # Because some regexps are very slow in 5.8.0, this old code: # # while ( $rs->{childMesg} =~ /(.*?)[\n\r]+(.*)/s ) { # $mesg = $1; # $rs->{childMesg} = $2; # # was replaced with the split() below. # while ( $rs->{childMesg} =~ /[\n\r]/ ) { ($mesg, $rs->{childMesg}) = split(/[\n\r]+/, $rs->{childMesg}, 2); $rs->log("Parent read: $mesg") if ( $rs->{logLevel} >= 20 ); if ( $mesg =~ /^done$/ ) { $rs->log("Got done from child") if ( $rs->{logLevel} >= 4 ); $rs->{childDone} = 1; } elsif ( $mesg =~ /^stats (\d+) (\d+) (\d+) (\d+) (.*)/ ) { $rs->{stats}{totalRead} = $1; $rs->{stats}{totalWritten} = $2; $rs->{stats}{totalSize} = $3; $rs->{stats}{remoteErrCnt} += $4; my %childStats = eval($5); $rs->log("Got stats: $1 $2 $3 $4 $5") if ( $rs->{logLevel} >= 4 ); $rs->{stats}{childStats} = \%childStats; $rs->{stats}{parentStats} = $rs->{fio}->statsGet; } elsif ( $mesg =~ /^exit/ ) { $rs->log("Got exit from child") if ( $rs->{logLevel} >= 4 ); $rs->{childDone} = 3; } elsif ( $mesg =~ /^redo (\d+)/ ) { if ( $rs->{phase} == 1 ) { push(@{$rs->{doList}}, $1); } else { push(@{$rs->{redoList}}, $1); } $rs->log("Got redo $1") if ( $rs->{logLevel} >= 4 ); } elsif ( $mesg =~ /^log (.*)/ ) { $rs->log($1); } else { $rs->log("Don't understand '$mesg' from child"); } } } sub fileCsumReceive { my($rs, $phase) = @_; my($fileNum, $blkCnt, $blkSize, $remainder); my $csumLen = $phase == 0 ? 2 : 16; # # delete list -> disabled by argv # # $rs->writeData(pack("V", 1)); # while ( 1 ) { return -1 if ( $rs->getChunk(4) < 0 ); $fileNum = unpack("V", $rs->{chunkData}); $rs->{chunkData} = substr($rs->{chunkData}, 4); if ( $fileNum == 0xffffffff ) { $rs->log("Finished csumReceive") if ( $rs->{logLevel} >= 2 ); last; } my $f = $rs->{fileList}->get($fileNum); next if ( !defined($f) ); from_to($f->{name}, $rs->{clientCharset}, "utf8") if ( $rs->{clientCharset} ne "" ); if ( $rs->{protocol_version} >= 27 ) { return -1 if ( $rs->getChunk(16) < 0 ); my $thisCsumLen; ($blkCnt, $blkSize, $thisCsumLen, $remainder) = unpack("V4", $rs->{chunkData}); $rs->{chunkData} = substr($rs->{chunkData}, 16); } else { return -1 if ( $rs->getChunk(12) < 0 ); ($blkCnt, $blkSize, $remainder) = unpack("V3", $rs->{chunkData}); $rs->{chunkData} = substr($rs->{chunkData}, 12); } $rs->log("Got #$fileNum ($f->{name}), blkCnt=$blkCnt," . " blkSize=$blkSize, rem=$remainder") if ( $rs->{logLevel} >= 5 ); # # For now we just check if the file is identical or not. # We don't do clever differential restores; we effectively # do --whole-file for sending to the remote machine. # # All this code needs to be replaced with proper file delta # generation... # next if ( ($f->{mode} & S_IFMT) != S_IFREG ); $rs->{fio}->csumStart($f, 1, $blkSize, $phase); my $attr = $rs->{fio}->attribGet($f); my $fileSame = $attr->{size} == ($blkCnt > 0 ? ($blkCnt - 1) * $blkSize + $remainder : 0); my $cnt = $blkCnt; while ( $cnt > 0 ) { my $thisCnt = $cnt > 256 ? 256 : $cnt; my $len = $thisCnt * ($csumLen + 4); my $csum = $rs->{fio}->csumGet($thisCnt, $csumLen, $blkSize) if ( $fileSame ); $rs->getChunk($len); my $csumRem = unpack("a$len", $rs->{chunkData}); $rs->{chunkData} = substr($rs->{chunkData}, $len); $fileSame = 0 if ( $csum ne $csumRem ); $rs->log(sprintf(" got same=%d, local=%s, remote=%s", $fileSame, unpack("H*", $csum), unpack("H*", $csumRem))) if ( $rs->{logLevel} >= 8 ); $cnt -= $thisCnt; } my $md4 = $rs->{fio}->csumEnd; # # Send the file number, numBlocks, blkSize and remainder # (based on the old file size) # ##$blkCnt = int(($attr->{size} + $blkSize - 1) / $blkSize); ##$remainder = $attr->{size} - ($blkCnt - 1) * $blkSize; $rs->write_sum_head($fileNum, $blkCnt, $blkSize, $csumLen, $remainder); if ( $fileSame ) { $rs->log("$f->{name}: unchanged") if ( $rs->{logLevel} >= 3 ); # # The file is the same, so just send a bunch of block numbers # for ( my $blk = 1 ; $blk <= $blkCnt ; $blk++ ) { $rs->writeData(pack("V", -$blk)); } } else { # # File doesn't match: send the file # $rs->{fio}->readStart($f); while ( 1 ) { my $dataR = $rs->{fio}->read(4 * 65536); last if ( !defined($dataR) || length($$dataR) == 0 ); $rs->writeData(pack("V a*", length($$dataR), $$dataR)); } $rs->{fio}->readEnd($f); } # # Send a final 0 and the MD4 file digest # $rs->writeData(pack("V a16", 0, $md4)); } # # Indicate end of this phase # $rs->writeData(pack("V", 0xffffffff), 1); } sub fileDeltaGet { my($rs, $fh, $phase) = @_; my($fileNum, $blkCnt, $blkSize, $remainder, $len, $d, $token); my $fileStart = 0; while ( 1 ) { return -1 if ( $rs->getChunk(4) < 0 ); $fileNum = unpack("V", $rs->{chunkData}); $rs->{chunkData} = substr($rs->{chunkData}, 4); last if ( $fileNum == 0xffffffff ); # # Make any intermediate dirs or special files # $rs->fileSpecialCreate($fileStart, $fileNum) if ( $phase == 0 ); $fileStart = $fileNum + 1; my $f = $rs->{fileList}->get($fileNum); next if ( !defined($f) ); from_to($f->{name}, $rs->{clientCharset}, "utf8") if ( $rs->{clientCharset} ne "" ); if ( $rs->{protocol_version} >= 27 ) { return -1 if ( $rs->getChunk(16) < 0 ); my $thisCsumLen; ($blkCnt, $blkSize, $thisCsumLen, $remainder) = unpack("V4", $rs->{chunkData}); $rs->{chunkData} = substr($rs->{chunkData}, 16); } else { return -1 if ( $rs->getChunk(12) < 0 ); ($blkCnt, $blkSize, $remainder) = unpack("V3", $rs->{chunkData}); $rs->{chunkData} = substr($rs->{chunkData}, 12); } $rs->log("Starting file $fileNum ($f->{name})," . " blkCnt=$blkCnt, blkSize=$blkSize, remainder=$remainder") if ( $rs->{logLevel} >= 5 ); $rs->{fio}->fileDeltaRxStart($f, $blkCnt, $blkSize, $remainder); while ( 1 ) { return -1 if ( $rs->getChunk(4) < 0 ); $len = unpack("V", $rs->{chunkData}); $rs->{chunkData} = substr($rs->{chunkData}, 4); if ( $len == 0 ) { return -1 if ( $rs->getChunk(16) < 0 ); my $md4digest = unpack("a16", $rs->{chunkData}); $rs->{chunkData} = substr($rs->{chunkData}, 16); my $ret = $rs->{fio}->fileDeltaRxNext(undef, undef) || $rs->{fio}->fileDeltaRxDone($md4digest, $phase); if ( $ret == 1 ) { if ( $phase == 1 ) { $rs->log("MD4 does't agree: fatal error on #$fileNum ($f->{name})"); last; } $rs->log("Must redo $fileNum ($f->{name})\n") if ( $rs->{logLevel} >= 2 ); print($fh "redo $fileNum\n"); } last; } elsif ( $len > 0x80000000 ) { $len = 0xffffffff - $len; my $ret = $rs->{fio}->fileDeltaRxNext($len, undef); } else { return -1 if ( $rs->getChunk($len) < 0 ); $d = unpack("a$len", $rs->{chunkData}); $rs->{chunkData} = substr($rs->{chunkData}, $len); my $ret = $rs->{fio}->fileDeltaRxNext(undef, $d); } } # # If this is 2nd phase, then set the attributes just for this file # $rs->{fio}->attribSet($f, 1) if ( $phase == 1 ); } # # Make any remaining dirs or special files # $rs->fileSpecialCreate($fileStart, undef) if ( $phase == 0 ); $rs->log("Finished deltaGet phase $phase") if ( $rs->{logLevel} >= 2 ); # # Finish up hardlinks at the very end # if ( $phase == 1 && $rs->{rsyncOpts}{"hard-links"} ) { my $cnt = $rs->{fileList}->count; for ( my $n = 0 ; $n < $cnt ; $n++ ) { my $f = $rs->{fileList}->get($n); next if ( !defined($f) ); next if ( !defined($f->{hlink}) || $f->{hlink_self} ); if ( $rs->{clientCharset} ne "" ) { from_to($f->{name}, $rs->{clientCharset}, "utf8"); from_to($f->{hlink}, $rs->{clientCharset}, "utf8"); } if ( $rs->{fio}->makeHardLink($f, 1) ) { $rs->log("Error: makeHardlink($f->{name} -> $f->{hlink}) failed"); } } } } sub fileListSend { my($rs) = @_; $rs->{fileList} = File::RsyncP::FileList->new({ preserve_uid => $rs->{rsyncOpts}{owner}, preserve_gid => $rs->{rsyncOpts}{group}, preserve_links => $rs->{rsyncOpts}{links}, preserve_devices => $rs->{rsyncOpts}{devices}, preserve_hard_links => $rs->{rsyncOpts}{"hard-links"}, always_checksum => $rs->{rsyncOpts}{checksum}, protocol_version => $rs->{protocol_version}, }); if ( $rs->{rsyncOpts}{"hard-links"} ) { $rs->{fileList}->init_hard_links(); } $rs->{fio}->fileListSend($rs->{fileList}, sub { $rs->writeData($_[0]); }); # # Send trailing null byte to indicate end of file list # $rs->writeData(pack("C", 0)); # # Send io_error flag # $rs->writeData(pack("V", 0), 1); # # At this point io buffering should be switched off # # Sort and clean the file list # $rs->{fileList}->clean; # # Print out the sorted file list # if ( $rs->{logLevel} >= 4 ) { my $cnt = $rs->{fileList}->count; $rs->log("Sorted file list has $cnt entries"); for ( my $n = 0 ; $n < $cnt ; $n++ ) { my $f = $rs->{fileList}->get($n); next if ( !defined($f) ); from_to($f->{name}, $rs->{clientCharset}, "utf8") if ( $rs->{clientCharset} ne "" ); $rs->log("PostSortFile $n: $f->{name}"); } } } sub write_sum_head { my($rs, $fileNum, $blkCnt, $blkSize, $csumLen, $remainder) = @_; if ( $rs->{protocol_version} >= 27 ) { # # For protocols >= 27 we also send the csum length # for this file. # $rs->writeData(pack("V5", $fileNum, $blkCnt, $blkSize, $csumLen, $remainder), 0); } else { $rs->writeData(pack("V4", $fileNum, $blkCnt, $blkSize, $remainder), 0); } } sub abort { my($rs, $reason, $timeout) = @_; $rs->{abort} = 1; $rs->{timeout} = $timeout if ( defined($timeout) ); $rs->{abortReason} = $reason || "aborted by user request"; kill($rs->{sigName2Num}{ALRM}, $rs->{childPID}) if ( defined($rs->{childPID}) ); alarm($rs->{timeout}) if ( $rs->{timeout} ); } sub statsGet { my($rs, $fh) = @_; my($totalWritten, $totalRead, $totalSize) = (0, 0, 0); if ( $rs->getChunk(12) >= 0 ) { ($totalWritten, $totalRead, $totalSize) = unpack("V3", $rs->{chunkData}); } if ( defined($fh) ) { my $fioStats = $rs->{fio}->statsGet; my $dump = Data::Dumper->new([$fioStats], [qw(*fioStats)]); $dump->Terse(1); $dump->Indent(0); my $remoteErrCnt = 0 + $rs->{stats}{remoteErrCnt}; print($fh "stats $totalWritten $totalRead $totalSize $remoteErrCnt ", $dump->Dump, "\n"); } else { $rs->{stats}{totalRead} = $totalRead; $rs->{stats}{totalWritten} = $totalWritten; $rs->{stats}{totalSize} = $totalSize; $rs->{stats}{fioStats} = $rs->{fio}->statsGet; } } sub getData { my($rs, $len) = @_; my($data); return -1 if ( $rs->{abort} ); alarm($rs->{timeout}) if ( $rs->{timeout} ); while ( length($rs->{readData}) < $len ) { return -1 if ( $rs->{abort} ); my $ein; vec($ein, fileno($rs->{fh}), 1) = 1; select(my $rout = $ein, undef, $ein, undef); return -1 if ( $rs->{abort} ); sysread($rs->{fh}, $data, 65536); if ( length($data) == 0 ) { $rs->log("Read EOF: $!") if ( $rs->{logLevel} >= 1 ); return -1 if ( $rs->{abort} ); sysread($rs->{fh}, $data, 65536); $rs->log(sprintf("Tried again: got %d bytes", length($data))) if ( $rs->{logLevel} >= 1 ); $rs->{abort} = 1; $rs->{fatalError} = 1; $rs->{fatalErrorMsg} = "Unable to read $len bytes"; return -1; } if ( $rs->{logLevel} >= 10 ) { $rs->log("Receiving: " . unpack("H*", $data)); } $rs->{readData} .= $data; } } sub getChunk { my($rs, $len) = @_; $len ||= 1; while ( length($rs->{chunkData}) < $len ) { return -1 if ( $rs->getData(4) < 0 ); my $d = unpack("V", $rs->{readData}); $rs->{readData} = substr($rs->{readData}, 4); my $code = ($d >> 24) - 7; my $len = $d & 0xffffff; return -1 if ( $rs->getData($len) < 0 ); $d = substr($rs->{readData}, 0, $len); $rs->{readData} = substr($rs->{readData}, $len); if ( $code == 0 ) { $rs->{chunkData} .= $d; } else { $d =~ s/[\n\r]+$//; from_to($d, $rs->{clientCharset}, "utf8") if ( $rs->{clientCharset} ne "" ); $rs->log("Remote[$code]: $d"); if ( $code == 1 || $d =~ /^file has vanished: / ) { $rs->{stats}{remoteErrCnt}++ } } } } sub getLine { my($rs) = @_; while ( 1 ) { if ( $rs->{readData} =~ /(.*?)[\n\r]+(.*)/s ) { $rs->{readData} = $2; return $1; } return if ( $rs->getData(length($rs->{readData}) + 1) < 0 ); } } sub writeData { my($rs, $data, $flush) = @_; $rs->{writeBuf} .= $data; $rs->writeFlush() if ( $flush || length($rs->{writeBuf}) > 32768 ); } sub statsFinal { my($rs) = @_; $rs->{stats}{parentStats} = $rs->{fio}->statsGet if ( !defined($rs->{stats}{parentStats}) ); return $rs->{stats}; } sub writeFlush { my($rs) = @_; my($FDread, $FDwrite); return if ( $rs->{abort} ); alarm($rs->{timeout}) if ( $rs->{timeout} ); while ( $rs->{writeBuf} ne "" ) { #(my $chunk, $rs->{writeBuf}) = unpack("a4092 a*", $rs->{writeBuf}); #$chunk = pack("V", (7 << 24) | length($chunk)) . $chunk; vec($FDread, fileno($rs->{childFh}), 1) = 1 if ( defined($rs->{childFh}) ); vec($FDwrite, fileno($rs->{fh}), 1) = 1; my $ein = $FDread; vec($ein, fileno($rs->{fh}), 1) = 1; select(my $rout = $FDread, my $rwrite = $FDwrite, $ein, undef); if ( defined($rs->{childFh}) && vec($rout, fileno($rs->{childFh}), 1) ) { $rs->pollChild(0); } return if ( $rs->{abort} ); if ( vec($rwrite, fileno($rs->{fh}), 1) ) { my $n = syswrite($rs->{fh}, $rs->{writeBuf}); if ( $n <= 0 ) { return $rs->log(sprintf("Can't write %d bytes to socket", length($rs->{writeBuf}))); } if ( $rs->{logLevel} >= 10 ) { my $chunk = substr($rs->{writeBuf}, 0, $n); $rs->log("Sending: " . unpack("H*", $chunk)); } $rs->{writeBuf} = substr($rs->{writeBuf}, $n); } } } # # Default log handler # sub logHandler { my($str) = @_; print(STDERR $str, "\n"); } sub log { my($rs, @logStr) = @_; foreach my $str ( @logStr ) { next if ( $str eq "" ); $rs->{logHandler}->($str); } } # # Escape shell meta-characters with backslashes. # This should be applied to each argument seperately, not an # entire shell command. # sub shellEscape { my($self, $cmd) = @_; $cmd =~ s/([][;&()<>{}|^\n\r\t *\$\\'"`?])/\\$1/g; return $cmd; } 1; __END__ =head1 NAME File::RsyncP - Perl Rsync client =head1 SYNOPSIS use File::RsyncP; my $rs = File::RsyncP->new({ logLevel => 1, rsyncCmd => "/bin/rsync", rsyncArgs => [ "--numeric-ids", "--perms", "--owner", "--group", "--devices", "--links", "--ignore-times", "--block-size=700", "--relative", "--recursive", "-v", ], }); # # Receive files from remote srcDirectory to local destDirectory # by running rsyncCmd with rsyncArgs. # $rs->remoteStart(1, srcDirectory); $rs->go(destDirectory); $rs->serverClose; # # Send files to remote destDirectory from local srcDirectory # by running rsyncCmd with rsyncArgs. # $rs->remoteStart(0, destDirectory); $rs->go(srcDirectory); $rs->serverClose; # # Receive files from a remote module to local destDirectory by # connecting to an rsyncd server. ($module is the name from # /etc/rsyncd.conf.) # my $port = 873; $rs->serverConnect($host, $port); $rs->serverService($module, $authUser, $authPasswd, 0); $rs->serverStart(1, "."); $rs->go(destDirectory); $rs->serverClose; # # Get finals stats. This is a hashref containing elements # totalRead, totalWritten, totalSize, plus whatever the FileIO # module might add. # my $stats = $rs->statsFinal; =head1 DESCRIPTION File::RsyncP is a perl implementation of an Rsync client. It is compatible with Rsync 2.5.5 - 2.6.3 (protocol versions 26-28). It can send or receive files, either by running rsync on the remote machine, or connecting to an rsyncd deamon on the remote machine. What use is File::RsyncP? The main purpose is that File::RsyncP separates all file system I/O into a separate module, which can be replaced by any module of your own design. This allows rsync interfaces to non-filesystem data types (eg: databases) to be developed with relative ease. File::RsyncP was initially written to provide an Rsync interface for BackupPC, L. See BackupPC for programming examples. File::RsyncP does not yet provide a command-line interface that mimics native Rsync. Instead it provides an API that makes it possible to write simple scripts that talk to rsync or rsyncd. The File::RsyncP::FileIO module contains the default file system access functions. File::RsyncP::FileIO may be subclassed or replaced by a custom module to provide access to non-filesystem data types. =head2 Getting Started First some background. When you run rsync is parses its command-line arguments, then it either connects to a remote rsyncd daemon, or runs an rsync on the remote machine via ssh or rsh. At this point there are two rsync processes: the one you invoked and the one on the remote machine. The one on the local machine is called the client, and the one on the remote machine is the server. One side (either the client or server) will send files and the other will receive files. The sending rsync generates a file list and sends it to the receiving side. The receiving rsync will fork a child process. File::RsyncP does not (yet) have a command-line script that mimics rsync's startup processing. Think of File::RsyncP as one level below the command-line rsync. File::RsyncP implements the client side of the connection, and File::RsyncP knows how to run the remote side (eg, via rsh or ssh) or to connect to a remote rsyncd daemon. File::RsyncP automatically adds the internal --server and --sender options (if necessary) to the options passed to the remote rsync. To initiate any rsync session the File::RsyncP->new function should be called. It takes a hashref of parameters: =over 4 =item logLevel An integer level of verbosity. Zero means be quiet, 1 will give some general information, 2 will some output per file, higher values give more output. 10 will include byte dumps of all data read/written, which will make the log output huge. =item rsyncCmd The command to run the remote peer of rsync. By default the rsyncArgs are appended to the rsyncCmd to create the complete command before it is run. This behavior is affected by rsyncCmdType. rsyncCmd can either be a single string giving the path of the rsync command to run (eg: /bin/rsync) or a list containing the command and arguments, eg: rsyncCmd => [qw( /bin/ssh -l user host /bin/rsync )], or: rsyncCmd => ["/bin/ssh", "-l", $user, $host, "/bin/rsync"], Also, rsyncCmd can also be set to a code reference (ie: a perl sub). In this case the code is called without arguments or other processing. It is up to the perl code you supply to exec() the remote rsync. This option is ignored if you are connecting to an rsyncd daemon. =item rsyncCmdType By default the complete remote rsync command is created by taking rsyncCmd and appending rsyncArgs. This beavhior can be modified by specifying certain values for rsyncCmdType: =over 4 =item 'full' rsyncCmd is taken to be the complete command, including all rsync arguments. It is the caller's responsibility to build the correct remote rsync command, togheter will all the rsync arguments. You still need to specify rsyncArgs, so the local File::RsyncP knows how to behave. =item 'shell' rsyncArgs are shell escaped before appending to rsyncCmd. =back This option is ignored if you are connecting to an rsyncd daemon. =item rsyncArgs A list of rsync arguments. The full remote rsync command that is run will be rsyncCmd appended with --server (and optionally --sender if the remote is a sender) and finally all of rsyncArgs. =item protocol_version What we advertize our protocol version to be. Default is 28. =item logHandler A subroutine reference to a function that handles all the log messages. The default is a subroutine that prints the messages to STDERR. =item pidHandler An optional subroutine reference to a function that expects two integers: the pid of the rsync process (ie: the pid on the local machine that is likely ssh) and the child pid when we are receiving files. If defined, this function is called once when the rsync process is forked, and again when the child is forked during receive. =item fio The file IO object that will handle all the file system IO. The default is File::RsyncP::FileIO->new. This can be replaced with a new module of your choice, or you can subclass File::RsyncP::FileIO. =item timeout Timeout in seconds for IO. Default is 0, meaning no timeout. Uses alarm() and it is the caller's responsbility to catch the alarm signal. =item doPartial If set, a partial rsync is done. This is to support resuming full backups in BackupPC. When doPartial is set, the --ignore-times option can be set on a per-file basis. On each file in the file list, File::RsyncP::FileIO->ignoreAttrOnFile() is called on each file, and this returns whether or not attributes should be ignored on that file. If ignoreAttrOnFile() returns 1 then it's as though --ignore-times was set for that file. =back An example of calling File::RsyncP->new is: my $rs = File::RsyncP->new({ logLevel => 1, rsyncCmd => ["/bin/rsh", $host, "-l", $user, "/bin/rsync"], rsyncArgs => [ "--numeric-ids", "--perms", "--owner", "--group", "--devices", "--links", "--ignore-times", "--block-size=700", "--relative", "--recursive", "-v", ], }); A fuller example showing most of the parameters and qw() for the rsyncArgs is: my $rs = File::RsyncP->new({ logLevel => 1, rsyncCmd => ["/bin/rsh", $host, "-l", $user, "/bin/rsync"], rsyncArgs => [qw( --numeric-ids --perms --owner --group --devices --links --ignore-times --block-size=700 --relative --recursive -v )], logHandler => sub { my($str) = @_; print MyHandler "log: $str\n"; }; fio => File::RsyncP::FileIO->new({ logLevel => 1, }); }); =head2 Talking to a remote Rsync File::RsyncP can talk to a remote rsync using this sequence of functions: =over 4 =item remoteStart(remoteSend, remoteDir) Starts the remote server by executing the command specified in the rsyncCmd parameter to File::RsyncP->new, together with the rsyncArgs. If the client is receiving files from the server then remoteSend should be non-zero and remoteDir is the source directory on the remote machine. If the client is sending files to the remote server then remoteSend should be zero and remoteDir is the destination directory on the remote machine. Returns undef on success and non-zero on error. =item go(localDir) Run the client rsync. localDir is the source directory on the local machine if the client is sending files, or it is the destination directory on the local machine if the client is receiving files. Returns undef on success. =item serverClose() Call this after go() to finish up. Returns undef on success. =item statsFinal() This can be optionally called to pickup the transfer stats. It returns a hashref containing elements totalRead, totalWritten, totalSize, plus whatever the FileIO module might add. =item abort() Call this function to abort the transfer. =back An example of sending files to a remote rsync is: # # Send files to remote destDirectory from local srcDirectory # by running rsyncCmd with rsyncArgs. # $rs->remoteStart(0, destDirectory); $rs->go(srcDirectory); $rs->serverClose; An example of receiving files from a remote rsync is: # # Receive files from remote srcDirectory to local destDirectory # by running rsyncCmd with rsyncArgs. # $rs->remoteStart(1, srcDirectory); $rs->go(destDirectory); $rs->serverClose; =head2 Talking to a remote Rsync daemon File::RsyncP can connect to a remote Rsync daemon using this sequence of functions: =over 4 =item serverConnect(host, port) Connect to the Rsync daemon on the given string host and integer port. The port argument is optional and it defaults to 873. On error serverConnect returns a string error message. On success it returns undef. =item serverService(module, authUser, authPasswd, authRequired) Specify which module to use (a "module" is the symbolic name that appears inside "[...]" /etc/rsyncd.conf), the user's credentials (authUser and authPasswd) and whether authorization is mandatory (authRequired). If set to a non-zero value, authRequired ensures that the remote Rsync daemon requires authentication. If necessary, this is to ensure that you don't connect to an insecure Rsync daemon. The auth arguments are optional if the selected rsyncd module doesn't require authentication. See the rsyncd.conf manual page for more information. For example, if a host called navajo had a /etc/rsyncd.conf contains these lines: [test] path = /data/test comment = test module auth users = craig, celia secrets file = /etc/rsyncd.secrets and /etc/rsyncd.secrets contained: craig:xxx then you could connect to this rsyncd using: $rs->serverConnect("navajo", 873); $rs->serverService("test", "craig", "xxx", 0); The value of the authRequired argument doesn't matter in this case. On error serverService returns a string error message. On success it returns undef. =item serverStart(remoteSend, remoteDir) Starts the remote server. If the client is receiving files from the server then remoteSend should be non-zero. If the client is sending files to the remote server then remoteSend should be zero. The remoteDir typically starts with the module name, followed by any directory below the module. Or remoteDir can be just "." to refer to the top-level module directory. Returns undef on success. =item go(localDir) Run the client rsync. localDir is the source directory on the local machine if the client is sending files, or it is the destination directory on the local machine if the client is receiving files. Returns undef on success. =item serverClose() Call this after go() to finish up. Returns undef on success. =item abort() Call this function to abort the transfer. =back An example of sending files to a remote rsyncd daemon is: # # Send files to a remote module from a local srcDirectory by # connecting to an rsyncd server. ($module is the name from # /etc/rsyncd.conf.) # my $port = 873; $rs->serverConnect($host, $port); $rs->serverService($module, $authUser, $authPasswd); $rs->serverStart(0, "."); $rs->go(srcDirectory); $rs->serverClose; An example of receiving files from a remote rsyncd daemon is: # # Receive files from a remote module to local destDirectory by # connecting to an rsyncd server. ($module is the name from # /etc/rsyncd.conf.) # my $port = 873; $rs->serverConnect($host, $port); $rs->serverService($module, $authUser, $authPasswd); $rs->serverStart(1, "."); $rs->go(destDirectory); $rs->serverClose; =head1 LIMITATIONS The initial version of File::RsyncP (0.10) has a number of limitations: =over 4 =item * File::RsyncP only implements a modest subset of Rsync options and features. In particular, as of 0.10 only these options are supported: --numeric-ids --perms|-p --owner|-o --group|-g --devices|D --links|-l --ignore-times|I --block-size=i --verbose|-v --recursive|-r --relative|-R Hardlinks are currently not supported. Other options that only affect the remote side will work correctly since they are passed to the remote Rsync unchanged. =item * Also, --relative semantics are not implemented to match rsync, and the trailing "/" behavior of rsync (meaning directory contents, not the directory itself) are not implemented in File::RsyncP. =item * File::RsyncP does not yet provide a command-line interface that mimics native Rsync. =item * File::RsyncP might work with slightly earlier versions of Rsync but has not been tested. It certainly will not work with antique versions of Rsync. =item * File::RsyncP does not compute file deltas (ie: it behaves as though --whole-file is specified) or implement exclude or include options when sending files. File::RsyncP does handle file deltas and exclude and include options when receiving files. =item * File::RsyncP does not yet implement server functionality (acting like the remote end of a connection or a daemon). Since the protocol is relatively symmetric this is not difficult to add, so it should appear in a future version. =back =head1 AUTHOR File::RsyncP::FileList was written by Craig Barratt based on rsync 2.5.5. Rsync was written by Andrew Tridgell and Paul Mackerras. It is available under a GPL license. See http://rsync.samba.org. =head1 LICENSE 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 in the LICENSE file along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. =head1 SEE ALSO See L for File::RsyncP's SourceForge home page. See L, L, and L. Also see BackupPC's lib/BackupPC/Xfer/Rsync.pm for other examples. =cut File-RsyncP-0.74/LICENSE0000444000076500000240000010451312157244242013521 0ustar craigstaff GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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 3 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, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . File-RsyncP-0.74/Makefile.PL0000444000076500000240000000132011423121572014451 0ustar craigstaffuse ExtUtils::MakeMaker; # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. WriteMakefile( 'NAME' => 'File::RsyncP', 'VERSION_FROM' => 'lib/File/RsyncP.pm', # finds $VERSION 'PREREQ_PM' => { Getopt::Long => 2.24, # need OO interface }, 'PMLIBDIRS' => ['lib'], 'DIR' => ['Digest', 'FileList'], ($] >= 5.005 ? ## Add these new keywords supported since 5.005 (ABSTRACT_FROM => 'lib/File/RsyncP.pm', # retrieve abstract from module AUTHOR => 'Craig Barratt ') : ()), ); File-RsyncP-0.74/MANIFEST0000444000076500000240000000140011423121572013627 0ustar craigstaffREADME LICENSE MANIFEST Changes Makefile.PL t/rsyncLoad.t Digest/rsync_lib.c Digest/md4.h Digest/md4c.c Digest/Changes Digest/Makefile.PL Digest/t/blockDigest.t Digest/t/fileDigest.t Digest/Digest.xs Digest/typemap Digest/global.h Digest/Digest.pm lib/File/RsyncP.pm lib/File/RsyncP/FileIO.pm FileList/byteorder.h FileList/config.guess FileList/rsync.h FileList/FileList.xs FileList/pool_alloc.c FileList/pool_alloc.h FileList/config.sub FileList/config.h.in FileList/Changes FileList/hlink.c FileList/configure FileList/Makefile.PL FileList/t/fileList.t FileList/t/exclude.t FileList/exclude.c FileList/wildmatch.h FileList/errcode.h FileList/install-sh FileList/flist.c FileList/typemap FileList/proto.h FileList/snprintf.c FileList/wildmatch.c FileList/FileList.pm File-RsyncP-0.74/README0000444000076500000240000000431112456603116013370 0ustar craigstaffFile::RsyncP ============ Version 0.74, released 17 Jan 2015. File::RsyncP is a perl implementation of an Rsync client. It is compatible with Rsync 2.x (protocol versions up to 28). It can send or receive files, either by running rsync on the remote machine, or connecting to an rsyncd deamon on the remote machine. What use is File::RsyncP? The main purpose is that File::RsyncP seperates all file system I/O into a seperate module, which can be replaced by any module of your own design. This allows rsync interfaces to non-filesystem data types (eg: databases) to be developed with relative ease. File::RsyncP was initially written to provide an Rsync interface for BackupPC, L. See BackupPC for programming examples. File::RsyncP does not yet provide a command-line interface that mimics native Rsync. Instead it provides an API that makes it possible to write simple scripts that talk to rsync or rsyncd. The File::RsyncP::FileIO module contains the default file system access functions. File::RsyncP::FileIO may be subclassed or replaced by a custom module to provide access to non-filesystem data types. INSTALLATION To install this module type the following: perl Makefile.PL make make test make install COPYRIGHT AND LICENCE Non-rsync code is copyright (C) 2002-2015 Craig Barratt Rsync is Copyright (C) 1996-2001 by Andrew Tridgell, 1996 by Paul Mackerras, 2001-2002 by Martin Pool, and 2003-2009 by Wayne Davison, and others. MD4 Message-Digest Algorithm is Copyright (C) 1990-2, RSA Data Security, Inc. All rights reserved. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 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, see . File-RsyncP-0.74/t/0000755000076500000240000000000011423121572012750 5ustar craigstaffFile-RsyncP-0.74/t/rsyncLoad.t0000444000076500000240000000047411423121572015076 0ustar craigstaff#!/bin/perl # # No decent tests for File::RsyncP until the server-side code is # written and it can talk to itself. I guess we could have some # tests that run if can find a real rsync somewhere... # BEGIN {print "1..1\n";} END {print "not ok 1\n" unless $loaded;} use File::RsyncP; $loaded = 1; print "ok 1\n";