diff options
author | lukem <lukem@pkgsrc.org> | 2007-08-07 02:06:54 +0000 |
---|---|---|
committer | lukem <lukem@pkgsrc.org> | 2007-08-07 02:06:54 +0000 |
commit | 477c6bbbca3d72e5b716a85e8208a50beed9cd83 (patch) | |
tree | b1125df7fa1cd4d2bdfef2e6f4e6325475f3c389 /net/tnftp | |
parent | b31f071ae6c714de4afd0e6afa3b0a62495f8712 (diff) | |
download | pkgsrc-477c6bbbca3d72e5b716a85e8208a50beed9cd83.tar.gz |
Merge tnftp 20070806.
Diffstat (limited to 'net/tnftp')
95 files changed, 12249 insertions, 5908 deletions
diff --git a/net/tnftp/files/COPYING b/net/tnftp/files/COPYING index 5f20d102895..602738b7327 100644 --- a/net/tnftp/files/COPYING +++ b/net/tnftp/files/COPYING @@ -1,6 +1,6 @@ -NetBSD: COPYING,v 1.5 2005/05/28 13:15:14 lukem Exp +$NetBSD: COPYING,v 1.5 2007/08/07 02:06:54 lukem Exp $ -Copyright (c) 2001-2005 The NetBSD Foundation, Inc. +Copyright (c) 2001-2007 The NetBSD Foundation, Inc. All rights reserved. This code is derived from software contributed to The NetBSD Foundation diff --git a/net/tnftp/files/ChangeLog b/net/tnftp/files/ChangeLog index 80243f5b87c..608092ffb91 100644 --- a/net/tnftp/files/ChangeLog +++ b/net/tnftp/files/ChangeLog @@ -1,4 +1,183 @@ -NetBSD: ChangeLog,v 1.30 2005/06/25 06:27:32 lukem Exp +$NetBSD: ChangeLog,v 1.7 2007/08/07 02:06:54 lukem Exp $ + +Mon Aug 6 04:55:19 UTC 2007 lukem + + * Release as "tnftp 20070806" + + * Add a NEWS file. + + * Reduce differences between NetBSD-ftp and local copy. + + * Merge NetBSD ftp from 20070605 to 20070722. + Changes: + - Document about:ftp and about:version. + + * Add autoconf check for (Dante) SOCKS5. + (Needs run-time testing and more portability testing.) + +Mon Jul 23 11:44:42 UTC 2007 lukem + + * Don't use non-standard: u_char u_short u_int. + Use uint32_t instead of u_int32_t. + + * Consistently use AS_CASE() and AS_IF() in configure.ac. + + * Don't use defined() with HAVE_DECL_xxx. + Use `LL' instead of `L' suffix for fallback + defines of LLONG_MIN and LLONG_MAX. + +Sun Jul 22 12:00:17 UTC 2007 lukem + + * Include <arpa/nameser.h> if available, and provide fallback #defines. + + * Sync with lib/libc/inet/inet_pton.c 1.3: + * Sync to bind 9.3.x version + * Update ISC copyright + * Fix some lint + + * Sync with lib/libc/inet/inet_ntop.c 1.3: + * Sync to bind 9.3.x version + * Update ISC copyright + * Use socklen_t instead of size_t + * Use snprintf() instead of SPRINTF() + * Improve detection of various boundary conditions + + * Sync to NetBSD glob.h 1.21, glob.c 1.16: + * Standards compliance fix + * De-lint + * Don't overflow when DEBUG is defined. + + * Sync fgetln.c to tools/compat/fgetln.c 1.7: + * Clause 3 removal. + + * Sync to config.guess 2007-07-22, config.sub 2007-06-28. + + * Consistency tweaks in configure help strings. + + * Add check for struct sockaddr.sa_len. + Change tests for HAVE_foo to defined(HAVE_foo). + Replace HAVE_SOCKADDR_SA_LEN with HAVE_STRUCT_SOCKADDR_SA_LEN. + + * Remove pretence of supporting SOCKS for now; + no test system is available, and the old + autoconf 2.13 support wasn't upgraded to 2.61. + + * configure.ac style consistency tweaks. + Move autoconf aux files from ./ to build-aux/ + + * Remove duplicate HAVE_STRERROR replacement in tnftp.h. + +Thu Jun 7 04:47:47 UTC 2007 lukem + + * Merge NetBSD ftp from 20070510 to 20070605. Changes: + - Enforce restriction that (http) proxied URL fetchs don't + support being restarted at this time. + Addresses NetBSD Problem Report 28697. + - Display times in RFC2822 form rather than using ctime(3), + since the former is more explicit about the timezone offset. + - main: call tzset() to ensure TZ is setup for other <time.h> + functions. + - remotemodtime(): use strptime() to parse the reply. + - fetch_url(): ensure struct tm is zeroed before calling + strptime(). + - Modify parse_url() to consistently strip the leading `/' + off ftp URLs. + Fixes NetBSD Problem Report 17617. + - Use 'RFCnnnn' (with leading 0) instead of 'RFC nnnn', to be + consistent with the style in the RFC index. + - Refer to RFC3916 instead of 1738 or 2732. + - Expand the list of supported RFCs in ftp(1) to contain the + document name as well. + +Fri May 11 04:39:55 UTC 2007 lukem + + * Update INSTALL and COPYING. + + * Rename HAVE_QUAD_SUPPORT to HAVE_PRINTF_LONG_LONG, and only + require support for 'long long' in that check rather than + needing sizeof(off_t)>=8, as some systems have a separate + off64_t when Large File Support is enabled. + + * config.guess: treat 'i86xen:SunOS:5.*' as 'i86pc:SunOS:5.*' + +Thu May 10 15:23:33 UTC 2007 lukem + + * Remove checks for util.h and libutil.h, and replacement for + fparseln(), since fparseln() isn't used any more. + + * Merge NetBSD ftp from 20070418 to 20070510. Changes: + - Switch from fparseln() to the internal getline() when + parsing HTTP headers. Makes ftp a bit more portable + (not needing fparseln()) at the expense of not supporting + arbitrary long header lines, which I'm not concerned about + because we don't support header line continuation either... + - Replace references from draft-ietf-ftpext-mlst-NN to RFC 3659. + - Fix misplaced const. + - Implement copy_bytes() to copy bytes from one fd to another + via the provided buffer, with optional rate-limiting and + hash-mark printing, using one loop and handle short writes. + Refactor sendrequest() and recvrequest() to use copy_data(). + Addresses NetBSD Problem Report 15943. + +Wed May 9 05:24:55 UTC 2007 lukem + + * Fix typo in poll()-based implementation of usleep() replacement. + +Wed May 9 04:58:50 UTC 2007 lukem + + * Rename configure.in to configure.ac, as the latter is the + preferred name in autoconf 2.61. + + * Convert from autoconf 2.13 to 2.61: + * Use a consistent quoting mechanism. + * Use modern autoconf macros, #define names, etc. + * Search for more header files, and only #include if found. + * Remove old-style config.h.in generation. + This may fix various tests on platforms such as FreeBSD and OS X. + + * Add -Wl,-search_paths_first to LDFLAGS on OS X (Darwin) if the + linker supports it. This is needed so we use our libedit + rather than the system one. + + XXX: SOCKS support is currently disabled until I update the + autoconf support. + +Mon Apr 23 06:04:26 UTC 2007 lukem + + * Merge NetBSD ftp from 20050610 to 20070418. Changes: + - Add '-s srcaddr'. + - Use IEC 60027-2 2^N based "KiB", "MiB" (etc) instead of + 10^n "KB", "MB", ... + - Recognize 307 redirect code. + - Suppress printing non-COMPLETE reply strings when EPSV/EPRT + fails and we fall-back to PASV/PORT. Should fix a problem + with the emacs ftp wrapper. + - Fix display of 'Continue with <cmd>' messages. + - Prevent segfaults in .netrc parsing. + - Flush stdout before each command; ftp as slave process on + a pipe should work. + - getpass() can return NULL in some implementations; cope. + - Support '-q quittime' when waiting for server replies. + - Various spelling & grammatical fixes in the manual. + - Plug some memory leaks. + - If a file upload (via -u) fails, return an non-zero exit + value based on the index of the file that caused the + problem (a la auto-fetch retrieval). + - Coverity fixes for CIDs: 873 874 875 1447 1448 2194 2195 3610 + - Don't remove trailing character during auth_url() + - Fix progressbar display on narrow terminals (<43 columns) + +Fri Mar 16 06:00:14 UTC 2007 lukem + + * Change the return value of the replacement gai_strerror() + from "char *" to "const char *", to match the current + standards. + Problem noted by Thomas Klausner. + +Thu Oct 26 07:24:22 UTC 2006 lukem + + * Correctly parse "AM" and "PM" in the replacement strptime(). + Problem noted by Kathryn Hogg. Sat Jun 25 06:27:00 UTC 2005 lukem diff --git a/net/tnftp/files/Makefile.in b/net/tnftp/files/Makefile.in index 4098824edb0..47e59685e91 100644 --- a/net/tnftp/files/Makefile.in +++ b/net/tnftp/files/Makefile.in @@ -1,4 +1,4 @@ -# NetBSD: Makefile.in,v 1.3 2005/05/11 03:03:42 lukem Exp +# $NetBSD: Makefile.in,v 1.3 2007/08/07 02:06:54 lukem Exp $ # srcdir = @srcdir@ diff --git a/net/tnftp/files/README b/net/tnftp/files/README index 910c3a4cf53..fbff2264d6e 100644 --- a/net/tnftp/files/README +++ b/net/tnftp/files/README @@ -11,26 +11,29 @@ The enhancements over the standard ftp client in 4.4BSD (and derivatives) include: * command-line editing within ftp * command-line fetching of URLS, including support for: - - http proxies (c.f: $http_proxy, $ftp_proxy) + - http proxies (see $http_proxy, $ftp_proxy) - authentication * configurable prompt * context sensitive command and filename completion * dynamic progress bar * feature negotiation extensions from RFC 2389 - (c.f: `feat' and `remopts') + (see `feat' and `remopts') * extensions to ftp from the IETF ftpext working group - (c.f: `mlsd' and `mlst') + (see `mlsd' and `mlst') * IPv6 support (from the WIDE project) * modification time preservation * paging of local and remote files, and of directory listings - (c.f: `lpage', `page', `pdir') + (see `lpage', `page', `pdir') * passive mode support, with fallback to active mode - * retrieval of filenames listed in a given file (c.f: `fget') + * retrieval of filenames listed in a given file (see `fget') * `set option' override of ftp environment variables - * socks4/socks5 support - * TIS Firewall Toolkit gate ftp proxy support (c.f: `gate') - * transfer-rate throttling (c.f: `-T', `rate') - * uploading of files on the command line (c.f: `-u') + * TIS Firewall Toolkit gate ftp proxy support (see `gate') + * transfer-rate throttling (see `-T', `rate') + * uploading of files on the command line (see `-u') + * (Dante) SOCKS5 support + +Previous features, currently disabled until a test system is available: + * SOCKS4 support INSTALLATION @@ -62,4 +65,4 @@ The primary ftp site for tnftp is: DOCUMENT REFERENCE ------------------ -NetBSD: README,v 1.6 2005/05/11 03:05:52 lukem Exp +$NetBSD: README,v 1.4 2007/08/07 02:06:54 lukem Exp $ diff --git a/net/tnftp/files/acconfig.h b/net/tnftp/files/acconfig.h deleted file mode 100644 index 42fda506e93..00000000000 --- a/net/tnftp/files/acconfig.h +++ /dev/null @@ -1,105 +0,0 @@ -/* NetBSD: acconfig.h,v 1.8 2005/06/25 06:14:08 lukem Exp */ - -@TOP@ -@BOTTOM@ - -/* Define if your compiler supports `long long' */ -#undef HAVE_LONG_LONG - -/* Define if *printf() uses %qd to print `long long' (otherwise uses %lld) */ -#undef HAVE_PRINTF_QD - -/* Define if in_port_t exists */ -#undef HAVE_IN_PORT_T - -/* Define if sa_family_t exists in <sys/socket.h> */ -#undef HAVE_SA_FAMILY_T - -/* Define if struct sockaddr.sa_len exists (implies sockaddr_in.sin_len, etc) */ -#undef HAVE_SOCKADDR_SA_LEN - -/* Define if socklen_t exists */ -#undef HAVE_SOCKLEN_T - -/* Define if AF_INET6 exists in <sys/socket.h> */ -#undef HAVE_AF_INET6 - -/* Define if `struct sockaddr_in6' exists in <netinet/in.h> */ -#undef HAVE_SOCKADDR_IN6 - -/* Define if `struct addrinfo' exists in <netdb.h> */ -#undef HAVE_ADDRINFO - -/* Define if NS_IN6ADDRSZ exists in <arpa/nameser.h> */ -#undef HAVE_NS_IN6ADDRSZ - -/* - * Define if <netdb.h> contains AI_NUMERICHOST et al. - * Systems which only implement RFC2133 will need this. - */ -#undef HAVE_RFC2553_NETDB - -/* Define if `struct direct' has a d_namlen element */ -#undef HAVE_D_NAMLEN - -/* Define if h_errno exists in <netdb.h> */ -#undef HAVE_H_ERRNO_D - -/* Define if dirname() is declared in <libgen.h> */ -#undef HAVE_DIRNAME_D - -/* Define if fclose() is declared in <stdio.h> */ -#undef HAVE_FCLOSE_D - -/* Define if getpass() is declared in <stdlib.h> or <unistd.h> */ -#undef HAVE_GETPASS_D - -/* Define if optarg is declared in <stdlib.h> or <unistd.h> */ -#undef HAVE_OPTARG_D - -/* Define if optind is declared in <stdlib.h> or <unistd.h> */ -#undef HAVE_OPTIND_D - -/* Define if pclose() is declared in <stdio.h> */ -#undef HAVE_PCLOSE_D - -/* Define if `long long' is supported and sizeof(off_t) >= 8 */ -#undef HAVE_QUAD_SUPPORT - -/* Define if strptime() is declared in <time.h> */ -#undef HAVE_STRPTIME_D - -/* Define if we have poll() and it is not emulated */ -#undef HAVE_POLL - -/* Define if we have struct pollfd in <poll.h> or <sys/poll.h> */ -#undef HAVE_STRUCT_POLLFD - -/* - * Define this if compiling with SOCKS (the firewall traversal library). - * Also, you must define connect, getsockname, bind, accept, listen, and - * select to their SOCKS-versions. - */ -#undef SOCKS -#undef SOCKS4 -#undef SOCKS5 -#undef connect -#undef getsockname -#undef getpeername -#undef bind -#undef accept -#undef listen -#undef select -#undef recvfrom -#undef sendto -#undef recv -#undef send -#undef read -#undef write -#undef rresvport -#undef shutdown -#undef close -#undef dup -#undef dup2 -#undef fclose -#undef gethostbyname diff --git a/net/tnftp/files/aclocal.m4 b/net/tnftp/files/aclocal.m4 deleted file mode 100644 index 3a49654212f..00000000000 --- a/net/tnftp/files/aclocal.m4 +++ /dev/null @@ -1,257 +0,0 @@ -dnl NetBSD: aclocal.m4,v 1.4 2005/06/13 09:20:21 lukem Exp -dnl - -dnl -dnl AC_MSG_TRY_COMPILE -dnl -dnl Written by Luke Mewburn <lukem@NetBSD.org> -dnl -dnl Usage: -dnl AC_MSG_TRY_COMPILE(Message, CacheVar, Includes, Code, -dnl ActionPass [,ActionFail] ) -dnl -dnl effectively does: -dnl AC_CACHE_CHECK(Message, CacheVar, -dnl AC_TRY_COMPILE(Includes, Code, CacheVar = yes, CacheVar = no) -dnl if CacheVar == yes -dnl AC_MESSAGE_RESULT(yes) -dnl ActionPass -dnl else -dnl AC_MESSAGE_RESULT(no) -dnl ActionFail -dnl ) -dnl -AC_DEFUN(AC_MSG_TRY_COMPILE, [ - AC_CACHE_CHECK($1, $2, [ - AC_TRY_COMPILE([ $3 ], [ $4; ], [ $2=yes ], [ $2=no ]) - ]) - if test "x[$]$2" = "xyes"; then - $5 - else - $6 - : - fi -]) - -dnl -dnl AC_MSG_TRY_LINK -dnl -dnl Usage: -dnl AC_MSG_TRY_LINK(Message, CacheVar, Includes, Code, -dnl ActionPass [,ActionFail] ) -dnl -dnl as AC_MSG_TRY_COMPILE, but uses AC_TRY_LINK instead of AC_TRY_COMPILE -dnl -AC_DEFUN(AC_MSG_TRY_LINK, [ - AC_CACHE_CHECK($1, $2, [ - AC_TRY_LINK([ $3 ], [ $4; ], [ $2=yes ], [ $2=no ]) - ]) - if test "x[$]$2" = "xyes"; then - $5 - else - $6 - : - fi -]) - - -dnl -dnl AC_LIBRARY_NET: #Id: net.m4,v 1.5 1997/11/09 21:36:54 jhawk Exp # -dnl -dnl Written by John Hawkinson <jhawk@mit.edu>. This code is in the Public -dnl Domain. -dnl -dnl This test is for network applications that need socket() and -dnl gethostbyname() -ish functions. Under Solaris, those applications need to -dnl link with "-lsocket -lnsl". Under IRIX, they should *not* link with -dnl "-lsocket" because libsocket.a breaks a number of things (for instance: -dnl gethostbyname() under IRIX 5.2, and snoop sockets under most versions of -dnl IRIX). -dnl -dnl Unfortunately, many application developers are not aware of this, and -dnl mistakenly write tests that cause -lsocket to be used under IRIX. It is -dnl also easy to write tests that cause -lnsl to be used under operating -dnl systems where neither are necessary (or useful), such as SunOS 4.1.4, which -dnl uses -lnsl for TLI. -dnl -dnl This test exists so that every application developer does not test this in -dnl a different, and subtly broken fashion. -dnl -dnl It has been argued that this test should be broken up into two seperate -dnl tests, one for the resolver libraries, and one for the libraries necessary -dnl for using Sockets API. Unfortunately, the two are carefully intertwined and -dnl allowing the autoconf user to use them independantly potentially results in -dnl unfortunate ordering dependancies -- as such, such component macros would -dnl have to carefully use indirection and be aware if the other components were -dnl executed. Since other autoconf macros do not go to this trouble, and almost -dnl no applications use sockets without the resolver, this complexity has not -dnl been implemented. -dnl -dnl The check for libresolv is in case you are attempting to link statically -dnl and happen to have a libresolv.a lying around (and no libnsl.a). -dnl -AC_DEFUN(AC_LIBRARY_NET, [ - # Most operating systems have gethostbyname() in the default searched - # libraries (i.e. libc): - AC_CHECK_FUNC(gethostbyname, , - # Some OSes (eg. Solaris) place it in libnsl: - AC_CHECK_LIB(nsl, gethostbyname, , - # Some strange OSes (SINIX) have it in libsocket: - AC_CHECK_LIB(socket, gethostbyname, , - # Unfortunately libsocket sometimes depends on libnsl. - # AC_CHECK_LIB's API is essentially broken so the following - # ugliness is necessary: - AC_CHECK_LIB(socket, gethostbyname, - LIBS="-lsocket -lnsl $LIBS", - AC_CHECK_LIB(resolv, gethostbyname), - -lnsl) - ) - ) - ) - AC_CHECK_FUNC(socket, , AC_CHECK_LIB(socket, socket, , - AC_CHECK_LIB(socket, socket, LIBS="-lsocket -lnsl $LIBS", , -lnsl))) - ]) - - -dnl Checks for SOCKS firewall support. -dnl -dnl Written by Matthew R. Green <mrg@eterna.com.au> -dnl -AC_DEFUN(AC_LIBRARY_SOCKS, [ - AC_MSG_CHECKING(whether to support SOCKS) - AC_ARG_WITH(socks, - [ --with-socks Compile with SOCKS firewall traversal support.], - [ - case "$withval" in - no) - AC_MSG_RESULT(no) - ;; - yes) - AC_MSG_RESULT(yes) - AC_CHECK_LIB(socks5, SOCKSconnect, [ - socks=5 - LIBS="-lsocks5 $LIBS"], [ - AC_CHECK_LIB(socks, Rconnect, [ - socks=4 - LIBS="-lsocks $LIBS"], [ - AC_MSG_ERROR(Could not find socks library. You must first install socks.) ] ) ] ) - ;; - esac - ], - AC_MSG_RESULT(no) - ) - - if test "x$socks" = "x"; then - AC_MSG_CHECKING(whether to support SOCKS5) - AC_ARG_WITH(socks5, - [ --with-socks5[=PATH] Compile with SOCKS5 firewall traversal support.], - [ - case "$withval" in - no) - AC_MSG_RESULT(no) - ;; - *) - AC_MSG_RESULT(yes) - socks=5 - if test "x$withval" = "xyes"; then - withval="-lsocks5" - else - if test -d "$withval"; then - if test -d "$withval/include"; then - CFLAGS="$CFLAGS -I$withval/include" - else - CFLAGS="$CFLAGS -I$withval" - fi - if test -d "$withval/lib"; then - withval="-L$withval/lib -lsocks5" - else - withval="-L$withval -lsocks5" - fi - fi - fi - LIBS="$withval $LIBS" - # If Socks was compiled with Kerberos support, we will need - # to link against kerberos libraries. Temporarily append - # to LIBS. This is harmless if there is no kerberos support. - TMPLIBS="$LIBS" - LIBS="$LIBS $KERBEROS_LIBS" - AC_TRY_LINK([], - [ SOCKSconnect(); ], - [], - [ AC_MSG_ERROR(Could not find the $withval library. You must first install socks5.) ]) - LIBS="$TMPLIBS" - ;; - esac - ], - AC_MSG_RESULT(no) - ) - fi - - if test "x$socks" = "x"; then - AC_MSG_CHECKING(whether to support SOCKS4) - AC_ARG_WITH(socks4, - [ --with-socks4[=PATH] Compile with SOCKS4 firewall traversal support.], - [ - case "$withval" in - no) - AC_MSG_RESULT(no) - ;; - *) - AC_MSG_RESULT(yes) - socks=4 - if test "x$withval" = "xyes"; then - withval="-lsocks" - else - if test -d "$withval"; then - withval="-L$withval -lsocks" - fi - fi - LIBS="$withval $LIBS" - AC_TRY_LINK([], - [ Rconnect(); ], - [], - [ AC_MSG_ERROR(Could not find the $withval library. You must first install socks.) ]) - ;; - esac - ], - AC_MSG_RESULT(no) - ) - fi - - if test "x$socks" = "x4"; then - AC_DEFINE(SOCKS) - AC_DEFINE(SOCKS4) - AC_DEFINE(connect, Rconnect) - AC_DEFINE(getsockname, Rgetsockname) - AC_DEFINE(getpeername, Rgetpeername) - AC_DEFINE(bind, Rbind) - AC_DEFINE(accept, Raccept) - AC_DEFINE(listen, Rlisten) - AC_DEFINE(select, Rselect) - fi - - if test "x$socks" = "x5"; then - AC_DEFINE(SOCKS) - AC_DEFINE(SOCKS5) - AC_DEFINE(connect,SOCKSconnect) - AC_DEFINE(getsockname,SOCKSgetsockname) - AC_DEFINE(getpeername,SOCKSgetpeername) - AC_DEFINE(bind,SOCKSbind) - AC_DEFINE(accept,SOCKSaccept) - AC_DEFINE(listen,SOCKSlisten) - AC_DEFINE(select,SOCKSselect) - AC_DEFINE(recvfrom,SOCKSrecvfrom) - AC_DEFINE(sendto,SOCKSsendto) - AC_DEFINE(recv,SOCKSrecv) - AC_DEFINE(send,SOCKSsend) - AC_DEFINE(read,SOCKSread) - AC_DEFINE(write,SOCKSwrite) - AC_DEFINE(rresvport,SOCKSrresvport) - AC_DEFINE(shutdown,SOCKSshutdown) - AC_DEFINE(close,SOCKSclose) - AC_DEFINE(dup,SOCKSdup) - AC_DEFINE(dup2,SOCKSdup2) - AC_DEFINE(fclose,SOCKSfclose) - AC_DEFINE(gethostbyname,SOCKSgethostbyname) - fi -]) diff --git a/net/tnftp/files/config.h.in b/net/tnftp/files/config.h.in index 2957899433d..f9f61c74d40 100644 --- a/net/tnftp/files/config.h.in +++ b/net/tnftp/files/config.h.in @@ -1,291 +1,493 @@ -/* config.h.in. Generated automatically from configure.in by autoheader. */ -/* NetBSD: config.h.in,v 1.12 2005/06/25 06:14:57 lukem Exp */ +/* config.h.in. Generated from configure.ac by autoheader. */ +/* Define to 1 if the `closedir' function returns void instead of `int'. */ +#undef CLOSEDIR_VOID -/* Define if on AIX 3. - System headers sometimes define this. - We just want to avoid a redefinition error message. */ -#ifndef _ALL_SOURCE -#undef _ALL_SOURCE -#endif +/* 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 if the closedir function returns void instead of int. */ -#undef CLOSEDIR_VOID +/* Define to 1 if using `alloca.c'. */ +#undef C_ALLOCA -/* Define if the `getpgrp' function takes no argument. */ +/* Define to 1 if the `getpgrp' function requires zero arguments. */ #undef GETPGRP_VOID -/* Define if your C compiler doesn't accept -c and -o together. */ -#undef NO_MINUS_C_MINUS_O +/* Define to 1 if `TIOCGWINSZ' requires <sys/ioctl.h>. */ +#undef GWINSZ_IN_SYS_IOCTL -/* Define if your Fortran 77 compiler doesn't accept -c and -o together. */ -#undef F77_NO_MINUS_C_MINUS_O +/* Define to 1 if you have `alloca', as a function or macro. */ +#undef HAVE_ALLOCA -/* Define to `long' if <sys/types.h> doesn't define. */ -#undef off_t +/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix). + */ +#undef HAVE_ALLOCA_H + +/* Define to 1 if you have the <arpa/ftp.h> header file. */ +#undef HAVE_ARPA_FTP_H -/* Define to the type of arg1 for select(). */ -#undef SELECT_TYPE_ARG1 +/* Define to 1 if you have the <arpa/inet.h> header file. */ +#undef HAVE_ARPA_INET_H -/* Define to the type of args 2, 3 and 4 for select(). */ -#undef SELECT_TYPE_ARG234 +/* Define to 1 if you have the <arpa/nameser.h> header file. */ +#undef HAVE_ARPA_NAMESER_H -/* Define to the type of arg5 for select(). */ -#undef SELECT_TYPE_ARG5 +/* Define to 1 if you have the declaration of `AF_INET6', and to 0 if you + don't. */ +#undef HAVE_DECL_AF_INET6 -/* Define if you have the ANSI C header files. */ -#undef STDC_HEADERS +/* Define to 1 if you have the declaration of `AI_NUMERICHOST', and to 0 if + you don't. */ +#undef HAVE_DECL_AI_NUMERICHOST -/* Define if you can safely include both <sys/time.h> and <time.h>. */ -#undef TIME_WITH_SYS_TIME +/* Define to 1 if you have the declaration of `dirname', and to 0 if you + don't. */ +#undef HAVE_DECL_DIRNAME + +/* Define to 1 if you have the declaration of `fclose', and to 0 if you don't. + */ +#undef HAVE_DECL_FCLOSE -/* Define if the closedir function returns void instead of int. */ -#undef VOID_CLOSEDIR +/* Define to 1 if you have the declaration of `getpass', and to 0 if you + don't. */ +#undef HAVE_DECL_GETPASS -/* The number of bytes in a off_t. */ -#undef SIZEOF_OFF_T +/* Define to 1 if you have the declaration of `h_errno', and to 0 if you + don't. */ +#undef HAVE_DECL_H_ERRNO -/* Define if you have the dirname function. */ +/* Define to 1 if you have the declaration of `NS_IN6ADDRSZ', and to 0 if you + don't. */ +#undef HAVE_DECL_NS_IN6ADDRSZ + +/* Define to 1 if you have the declaration of `optarg', and to 0 if you don't. + */ +#undef HAVE_DECL_OPTARG + +/* Define to 1 if you have the declaration of `optind', and to 0 if you don't. + */ +#undef HAVE_DECL_OPTIND + +/* Define to 1 if you have the declaration of `pclose', and to 0 if you don't. + */ +#undef HAVE_DECL_PCLOSE + +/* Define to 1 if you have the declaration of `strptime', and to 0 if you + don't. */ +#undef HAVE_DECL_STRPTIME + +/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'. + */ +#undef HAVE_DIRENT_H + +/* Define to 1 if you have the `dirname' function. */ #undef HAVE_DIRNAME -/* Define if you have the err function. */ +/* Define to 1 if you have the `err' function. */ #undef HAVE_ERR -/* Define if you have the fgetln function. */ +/* Define to 1 if you have the <err.h> header file. */ +#undef HAVE_ERR_H + +/* Define to 1 if you have the <fcntl.h> header file. */ +#undef HAVE_FCNTL_H + +/* Define to 1 if you have the `fgetln' function. */ #undef HAVE_FGETLN -/* Define if you have the fparseln function. */ -#undef HAVE_FPARSELN +/* Define to 1 if you have the `fork' function. */ +#undef HAVE_FORK -/* Define if you have the fseeko function. */ +/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ #undef HAVE_FSEEKO -/* Define if you have the getaddrinfo function. */ +/* Define to 1 if you have the `getaddrinfo' function. */ #undef HAVE_GETADDRINFO -/* Define if you have the gethostbyname2 function. */ +/* Define to 1 if you have the `getcwd' function. */ +#undef HAVE_GETCWD + +/* Define to 1 if you have the `gethostbyaddr' function. */ +#undef HAVE_GETHOSTBYADDR + +/* Define to 1 if you have the `gethostbyname' function. */ +#undef HAVE_GETHOSTBYNAME + +/* Define to 1 if you have the `gethostbyname2' function. */ #undef HAVE_GETHOSTBYNAME2 -/* Define if you have the getnameinfo function. */ +/* Define to 1 if you have the `gethostname' function. */ +#undef HAVE_GETHOSTNAME + +/* Define to 1 if you have the `getnameinfo' function. */ #undef HAVE_GETNAMEINFO -/* Define if you have the getpassphrase function. */ +/* Define to 1 if you have the `getpass' function. */ +#undef HAVE_GETPASS + +/* Define to 1 if you have the `getpassphrase' function. */ #undef HAVE_GETPASSPHRASE -/* Define if you have the getpgrp function. */ +/* Define to 1 if you have the `getpgrp' function. */ #undef HAVE_GETPGRP -/* Define if you have the inet_ntop function. */ +/* Define to 1 if you have the `gettimeofday' function. */ +#undef HAVE_GETTIMEOFDAY + +/* Define to 1 if you have the `inet_ntop' function. */ #undef HAVE_INET_NTOP -/* Define if you have the inet_pton function. */ +/* Define to 1 if you have the `inet_pton' function. */ #undef HAVE_INET_PTON -/* Define if you have the memmove function. */ +/* Define to 1 if you have the <inttypes.h> header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if the system has the type `in_port_t'. */ +#undef HAVE_IN_PORT_T + +/* Define to 1 if you have the `isascii' function. */ +#undef HAVE_ISASCII + +/* Define to 1 if you have the <libgen.h> header file. */ +#undef HAVE_LIBGEN_H + +/* Define to 1 if you have the <limits.h> header file. */ +#undef HAVE_LIMITS_H + +/* Define to 1 if the system has the type `long double'. */ +#undef HAVE_LONG_DOUBLE + +/* Define to 1 if the system has the type `long long int'. */ +#undef HAVE_LONG_LONG_INT + +/* Define to 1 if you have the <malloc.h> header file. */ +#undef HAVE_MALLOC_H + +/* Define to 1 if you have the `memchr' function. */ +#undef HAVE_MEMCHR + +/* Define to 1 if you have the `memmove' function. */ #undef HAVE_MEMMOVE -/* Define if you have the mkstemp function. */ +/* Define to 1 if you have the <memory.h> header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the `memset' function. */ +#undef HAVE_MEMSET + +/* Define to 1 if you have the `mkstemp' function. */ #undef HAVE_MKSTEMP -/* Define if you have the select function. */ +/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */ +#undef HAVE_NDIR_H + +/* Define to 1 if you have the <netdb.h> header file. */ +#undef HAVE_NETDB_H + +/* Define to 1 if you have the <netinet/in.h> header file. */ +#undef HAVE_NETINET_IN_H + +/* Define to 1 if you have the <netinet/in_systm.h> header file. */ +#undef HAVE_NETINET_IN_SYSTM_H + +/* Define to 1 if you have the <netinet/ip.h> header file. */ +#undef HAVE_NETINET_IP_H + +/* Define to 1 if you have the <paths.h> header file. */ +#undef HAVE_PATHS_H + +/* Define if we have poll() and it is not emulated. */ +#undef HAVE_POLL + +/* Define to 1 if you have the <poll.h> header file. */ +#undef HAVE_POLL_H + +/* Define if `long long' is supported and *printf() supports %lld or %qd to + print them. */ +#undef HAVE_PRINTF_LONG_LONG + +/* Define if *printf() uses %qd to print `long long' (otherwise uses %lld). */ +#undef HAVE_PRINTF_QD + +/* Define to 1 if you have the <pwd.h> header file. */ +#undef HAVE_PWD_H + +/* Define to 1 if you have the `realpath' function. */ +#undef HAVE_REALPATH + +/* Define to 1 if you have the `regcomp' function. */ +#undef HAVE_REGCOMP + +/* Define to 1 if you have the <regex.h> header file. */ +#undef HAVE_REGEX_H + +/* Define to 1 if you have the <resolv.h> header file. */ +#undef HAVE_RESOLV_H + +/* Define to 1 if the system has the type `sa_family_t'. */ +#undef HAVE_SA_FAMILY_T + +/* Define to 1 if you have the `select' function. */ #undef HAVE_SELECT -/* Define if you have the setprogname function. */ +/* Define to 1 if you have the <setjmp.h> header file. */ +#undef HAVE_SETJMP_H + +/* Define to 1 if you have the `setlocale' function. */ +#undef HAVE_SETLOCALE + +/* Define to 1 if you have the `setprogname' function. */ #undef HAVE_SETPROGNAME -/* Define if you have the sl_init function. */ +/* Define to 1 if you have the <signal.h> header file. */ +#undef HAVE_SIGNAL_H + +/* Define to 1 if you have the `sl_init' function. */ #undef HAVE_SL_INIT -/* Define if you have the snprintf function. */ +/* Define to 1 if you have the `snprintf' function. */ #undef HAVE_SNPRINTF -/* Define if you have the strdup function. */ +/* Define to 1 if you have the `socket' function. */ +#undef HAVE_SOCKET + +/* Define to 1 if the system has the type `socklen_t'. */ +#undef HAVE_SOCKLEN_T + +/* Define to 1 if you have the <stddef.h> header file. */ +#undef HAVE_STDDEF_H + +/* Define to 1 if you have the <stdint.h> header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the <stdlib.h> 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 `strcoll' function and it is properly defined. + */ +#undef HAVE_STRCOLL + +/* Define to 1 if you have the `strcspn' function. */ +#undef HAVE_STRCSPN + +/* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP -/* Define if you have the strerror function. */ +/* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR -/* Define if you have the strlcat function. */ +/* Define to 1 if you have the <strings.h> header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the <string.h> header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the `strlcat' function. */ #undef HAVE_STRLCAT -/* Define if you have the strlcpy function. */ +/* Define to 1 if you have the `strlcpy' function. */ #undef HAVE_STRLCPY -/* Define if you have the strptime function. */ -#undef HAVE_STRPTIME +/* Define to 1 if you have the `strncasecmp' function. */ +#undef HAVE_STRNCASECMP -/* Define if you have the strsep function. */ -#undef HAVE_STRSEP +/* Define to 1 if you have the `strpbrk' function. */ +#undef HAVE_STRPBRK -/* Define if you have the strtoll function. */ -#undef HAVE_STRTOLL +/* Define to 1 if you have the `strptime' function. */ +#undef HAVE_STRPTIME -/* Define if you have the strunvis function. */ -#undef HAVE_STRUNVIS +/* Define to 1 if you have the `strrchr' function. */ +#undef HAVE_STRRCHR -/* Define if you have the strvis function. */ -#undef HAVE_STRVIS +/* Define to 1 if you have the `strsep' function. */ +#undef HAVE_STRSEP -/* Define if you have the timegm function. */ -#undef HAVE_TIMEGM +/* Define to 1 if you have the `strstr' function. */ +#undef HAVE_STRSTR -/* Define if you have the usleep function. */ -#undef HAVE_USLEEP +/* Define to 1 if you have the `strtol' function. */ +#undef HAVE_STRTOL -/* Define if you have the utimes function. */ -#undef HAVE_UTIMES +/* Define to 1 if you have the `strtoll' function. */ +#undef HAVE_STRTOLL -/* Define if you have the <arpa/nameser.h> header file. */ -#undef HAVE_ARPA_NAMESER_H +/* Define to 1 if you have the `strtoul' function. */ +#undef HAVE_STRTOUL -/* Define if you have the <dirent.h> header file. */ -#undef HAVE_DIRENT_H +/* Define to 1 if the system has the type `struct addrinfo'. */ +#undef HAVE_STRUCT_ADDRINFO -/* Define if you have the <err.h> header file. */ -#undef HAVE_ERR_H +/* Define to 1 if `d_namlen' is member of `struct dirent'. */ +#undef HAVE_STRUCT_DIRENT_D_NAMLEN -/* Define if you have the <libgen.h> header file. */ -#undef HAVE_LIBGEN_H +/* Define to 1 if the system has the type `struct pollfd'. */ +#undef HAVE_STRUCT_POLLFD -/* Define if you have the <libutil.h> header file. */ -#undef HAVE_LIBUTIL_H +/* Define to 1 if the system has the type `struct sockaddr_in6'. */ +#undef HAVE_STRUCT_SOCKADDR_IN6 -/* Define if you have the <ndir.h> header file. */ -#undef HAVE_NDIR_H +/* Define to 1 if `sin_len' is member of `struct sockaddr_in'. */ +#undef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN -/* Define if you have the <paths.h> header file. */ -#undef HAVE_PATHS_H +/* Define to 1 if `sa_len' is member of `struct sockaddr'. */ +#undef HAVE_STRUCT_SOCKADDR_SA_LEN -/* Define if you have the <poll.h> header file. */ -#undef HAVE_POLL_H +/* Define to 1 if you have the `strunvis' function. */ +#undef HAVE_STRUNVIS -/* Define if you have the <regex.h> header file. */ -#undef HAVE_REGEX_H +/* Define to 1 if you have the `strvis' function. */ +#undef HAVE_STRVIS -/* Define if you have the <sys/dir.h> header file. */ +/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'. + */ #undef HAVE_SYS_DIR_H -/* Define if you have the <sys/ndir.h> header file. */ +/* Define to 1 if you have the <sys/ioctl.h> header file. */ +#undef HAVE_SYS_IOCTL_H + +/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'. + */ #undef HAVE_SYS_NDIR_H -/* Define if you have the <sys/poll.h> header file. */ +/* Define to 1 if you have the <sys/param.h> header file. */ +#undef HAVE_SYS_PARAM_H + +/* Define to 1 if you have the <sys/poll.h> header file. */ #undef HAVE_SYS_POLL_H -/* Define if you have the <sys/syslimits.h> header file. */ +/* Define to 1 if you have the <sys/socket.h> header file. */ +#undef HAVE_SYS_SOCKET_H + +/* Define to 1 if you have the <sys/stat.h> header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the <sys/syslimits.h> header file. */ #undef HAVE_SYS_SYSLIMITS_H -/* Define if you have the <termcap.h> header file. */ +/* Define to 1 if you have the <sys/time.h> header file. */ +#undef HAVE_SYS_TIME_H + +/* Define to 1 if you have the <sys/types.h> header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the <sys/wait.h> header file. */ +#undef HAVE_SYS_WAIT_H + +/* Define to 1 if you have the <termcap.h> header file. */ #undef HAVE_TERMCAP_H -/* Define if you have the <util.h> header file. */ -#undef HAVE_UTIL_H +/* Define to 1 if you have the <termios.h> header file. */ +#undef HAVE_TERMIOS_H -/* Define if you have the <vis.h> header file. */ -#undef HAVE_VIS_H +/* Define to 1 if you have the `timegm' function. */ +#undef HAVE_TIMEGM -/* Define if you have the nsl library (-lnsl). */ -#undef HAVE_LIBNSL +/* Define to 1 if you have the <unistd.h> header file. */ +#undef HAVE_UNISTD_H -/* Define if you have the socket library (-lsocket). */ -#undef HAVE_LIBSOCKET +/* Define to 1 if you have the `usleep' function. */ +#undef HAVE_USLEEP -/* Define if your compiler supports `long long' */ -#undef HAVE_LONG_LONG +/* Define to 1 if you have the `utime' function. */ +#undef HAVE_UTIME -/* Define if *printf() uses %qd to print `long long' (otherwise uses %lld) */ -#undef HAVE_PRINTF_QD +/* Define to 1 if you have the `utimes' function. */ +#undef HAVE_UTIMES -/* Define if in_port_t exists */ -#undef HAVE_IN_PORT_T +/* Define to 1 if you have the <utime.h> header file. */ +#undef HAVE_UTIME_H -/* Define if sa_family_t exists in <sys/socket.h> */ -#undef HAVE_SA_FAMILY_T +/* Define to 1 if you have the `vfork' function. */ +#undef HAVE_VFORK -/* Define if struct sockaddr.sa_len exists (implies sockaddr_in.sin_len, etc) */ -#undef HAVE_SOCKADDR_SA_LEN +/* Define to 1 if you have the <vfork.h> header file. */ +#undef HAVE_VFORK_H -/* Define if socklen_t exists */ -#undef HAVE_SOCKLEN_T +/* Define to 1 if you have the <vis.h> header file. */ +#undef HAVE_VIS_H -/* Define if AF_INET6 exists in <sys/socket.h> */ -#undef HAVE_AF_INET6 +/* Define to 1 if `fork' works. */ +#undef HAVE_WORKING_FORK -/* Define if `struct sockaddr_in6' exists in <netinet/in.h> */ -#undef HAVE_SOCKADDR_IN6 +/* Define to 1 if `vfork' works. */ +#undef HAVE_WORKING_VFORK -/* Define if `struct addrinfo' exists in <netdb.h> */ -#undef HAVE_ADDRINFO +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT -/* Define if NS_IN6ADDRSZ exists in <arpa/nameser.h> */ -#undef HAVE_NS_IN6ADDRSZ +/* Define to the full name of this package. */ +#undef PACKAGE_NAME -/* - * Define if <netdb.h> contains AI_NUMERICHOST et al. - * Systems which only implement RFC2133 will need this. - */ -#undef HAVE_RFC2553_NETDB +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING -/* Define if `struct direct' has a d_namlen element */ -#undef HAVE_D_NAMLEN +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME -/* Define if h_errno exists in <netdb.h> */ -#undef HAVE_H_ERRNO_D +/* Define to the version of this package. */ +#undef PACKAGE_VERSION -/* Define if dirname() is declared in <libgen.h> */ -#undef HAVE_DIRNAME_D +/* Define as the return type of signal handlers (`int' or `void'). */ +#undef RETSIGTYPE -/* Define if fclose() is declared in <stdio.h> */ -#undef HAVE_FCLOSE_D +/* 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 runtime. + 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 if getpass() is declared in <stdlib.h> or <unistd.h> */ -#undef HAVE_GETPASS_D +/* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */ +#undef STAT_MACROS_BROKEN -/* Define if optarg is declared in <stdlib.h> or <unistd.h> */ -#undef HAVE_OPTARG_D +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS -/* Define if optind is declared in <stdlib.h> or <unistd.h> */ -#undef HAVE_OPTIND_D +/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */ +#undef TIME_WITH_SYS_TIME -/* Define if pclose() is declared in <stdio.h> */ -#undef HAVE_PCLOSE_D +/* Define to 1 if your <sys/time.h> declares `struct tm'. */ +#undef TM_IN_SYS_TIME -/* Define if `long long' is supported and sizeof(off_t) >= 8 */ -#undef HAVE_QUAD_SUPPORT +/* Define if using (Dante) SOCKS5 proxy. */ +#undef USE_SOCKS -/* Define if strptime() is declared in <time.h> */ -#undef HAVE_STRPTIME_D +/* Number of bits in a file offset, on hosts where this is settable. */ +#undef _FILE_OFFSET_BITS -/* Define if we have poll() and it is not emulated */ -#undef HAVE_POLL +/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */ +#undef _LARGEFILE_SOURCE -/* Define if we have struct pollfd in <poll.h> or <sys/poll.h> */ -#undef HAVE_STRUCT_POLLFD +/* Define for large files, on AIX-style hosts. */ +#undef _LARGE_FILES + +/* Define for Solaris 2.5.1 so the uint32_t typedef from <sys/synch.h>, + <pthread.h>, or <semaphore.h> is not used. If the typedef was allowed, the + #define below would cause a syntax error. */ +#undef _UINT32_T + +/* Define to `long int' if <sys/types.h> does not define. */ +#undef off_t + +/* Define to `int' if <sys/types.h> does not define. */ +#undef pid_t + +/* Define to `unsigned int' if <sys/types.h> does not define. */ +#undef size_t + +/* Define to the type of an unsigned integer type of width exactly 32 bits if + such a type exists and the standard includes do not define it. */ +#undef uint32_t -/* - * Define this if compiling with SOCKS (the firewall traversal library). - * Also, you must define connect, getsockname, bind, accept, listen, and - * select to their SOCKS-versions. - */ -#undef SOCKS -#undef SOCKS4 -#undef SOCKS5 -#undef connect -#undef getsockname -#undef getpeername -#undef bind -#undef accept -#undef listen -#undef select -#undef recvfrom -#undef sendto -#undef recv -#undef send -#undef read -#undef write -#undef rresvport -#undef shutdown -#undef close -#undef dup -#undef dup2 -#undef fclose -#undef gethostbyname +/* Define as `fork' if `vfork' does not work. */ +#undef vfork diff --git a/net/tnftp/files/configure b/net/tnftp/files/configure index 85477e0a61b..781c8e128b5 100755 --- a/net/tnftp/files/configure +++ b/net/tnftp/files/configure @@ -1,53 +1,714 @@ #! /bin/sh +# From configure.ac Revision: 1.11 . +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.61 for tnftp 20070806. +# +# Report bugs to <lukem@NetBSD.org>. +# +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006 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. ## +## --------------------- ## -# From configure.in Revision: 1.17 +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +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+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac +fi +# PATH needs CR +# 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 +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +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 +IFS=$as_save_IFS + + ;; +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_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +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) >/dev/null 2>&1 && $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; 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'` + +# CDPATH. +$as_unset CDPATH + + +if test "x$CONFIG_SHELL" = x; then + if (eval ":") 2>/dev/null; then + as_have_required=yes +else + as_have_required=no +fi + + if test $as_have_required = yes && (eval ": +(as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=\$LINENO + as_lineno_2=\$LINENO + test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && + test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } +") 2> /dev/null; then + : +else + as_candidate_shells= + 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=. + case $as_dir in + /*) + for as_base in sh bash ksh sh5; do + as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + done;; + esac +done +IFS=$as_save_IFS + + + for as_shell in $as_candidate_shells $SHELL; do + # Try only shells that exist, to save several forks. + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { ("$as_shell") 2> /dev/null <<\_ASEOF +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+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +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+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +(as_func_return () { + (exit $1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = "$1" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test $exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } + +_ASEOF +}; then + break +fi + +fi + + done + + if test "x$CONFIG_SHELL" != x; then + for as_var in BASH_ENV ENV + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + + if test $as_have_required = no; then + echo This script requires a shell more modern than all the + echo shells that I found on your system. Please install a + echo modern shell, or manually run the script under such a + echo shell if you do have one. + { (exit 1); exit 1; } +fi + + +fi + +fi + -# Guess values for system-dependent variables and create Makefiles. -# Generated automatically using autoconf version 2.13 -# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. -# -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. -# Defaults: -ac_help= +(eval "as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0") || { + echo No shell found that supports shell functions. + echo Please tell autoconf@gnu.org about your system, + echo including any error possibly output before this + echo message +} + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # 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 after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, 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 + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\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 sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; +esac + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' +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$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# 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'" + + + +exec 7<&0 </dev/null 6>&1 + +# 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` + +# +# Initializations. +# ac_default_prefix=/usr/local -# Any additions from configure.in: -ac_help="$ac_help -\ - --enable-editcomplete Turn on command line editing and completion. - --disable-editcomplete Turn off command line editing and completion - [default: enabled]." -ac_help="$ac_help -\ - --enable-ipv6 Enable IPv6 support (if your OS supports it). - --disable-ipv6 Disable IPv6 support (even if your OS supports it) - [default: enabled]." -ac_help="$ac_help - --with-socks Compile with SOCKS firewall traversal support." -ac_help="$ac_help - --with-socks5[=PATH] Compile with SOCKS5 firewall traversal support." -ac_help="$ac_help - --with-socks4[=PATH] Compile with SOCKS4 firewall traversal support." +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Identity of this package. +PACKAGE_NAME='tnftp' +PACKAGE_TARNAME='tnftp' +PACKAGE_VERSION='20070806' +PACKAGE_STRING='tnftp 20070806' +PACKAGE_BUGREPORT='lukem@NetBSD.org' + +ac_unique_file="tnftp.h" +# Factoring default headers for most tests. +ac_includes_default="\ +#include <stdio.h> +#ifdef HAVE_SYS_TYPES_H +# include <sys/types.h> +#endif +#ifdef HAVE_SYS_STAT_H +# include <sys/stat.h> +#endif +#ifdef STDC_HEADERS +# include <stdlib.h> +# include <stddef.h> +#else +# ifdef HAVE_STDLIB_H +# include <stdlib.h> +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include <memory.h> +# endif +# include <string.h> +#endif +#ifdef HAVE_STRINGS_H +# include <strings.h> +#endif +#ifdef HAVE_INTTYPES_H +# include <inttypes.h> +#endif +#ifdef HAVE_STDINT_H +# include <stdint.h> +#endif +#ifdef HAVE_UNISTD_H +# include <unistd.h> +#endif" + +ac_subst_vars='SHELL +PATH_SEPARATOR +PACKAGE_NAME +PACKAGE_TARNAME +PACKAGE_VERSION +PACKAGE_STRING +PACKAGE_BUGREPORT +exec_prefix +prefix +program_transform_name +bindir +sbindir +libexecdir +datarootdir +datadir +sysconfdir +sharedstatedir +localstatedir +includedir +oldincludedir +docdir +infodir +htmldir +dvidir +pdfdir +psdir +libdir +localedir +mandir +DEFS +ECHO_C +ECHO_N +ECHO_T +LIBS +build_alias +host_alias +target_alias +build +build_cpu +build_vendor +build_os +host +host_cpu +host_vendor +host_os +target +target_cpu +target_vendor +target_os +SET_MAKE +CC +CFLAGS +LDFLAGS +CPPFLAGS +ac_ct_CC +EXEEXT +OBJEXT +AWK +INSTALL_PROGRAM +INSTALL_SCRIPT +INSTALL_DATA +AR +RANLIB +CPP +GREP +EGREP +ALLOCA +LIBOBJS +INCLUDES +LIBEDIT +LIBNETBSD +LIBDEPENDS +LTLIBOBJS' +ac_subst_files='' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + # 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. -build=NONE -cache_file=./config.cache +cache_file=/dev/null exec_prefix=NONE -host=NONE no_create= -nonopt=NONE no_recursion= prefix=NONE program_prefix=NONE @@ -56,94 +717,117 @@ program_transform_name=s,x,x, silent= site= srcdir= -target=NONE 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. +# (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' +datarootdir='${prefix}/share' +datadir='${datarootdir}' 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' - -# Initialize some other variables. -subdirs= -MFLAGS= MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -ac_max_here_lines=12 +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' ac_prev= +ac_dashdash= for ac_option do - # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" + eval $ac_prev=\$ac_option ac_prev= continue fi - case "$ac_option" in - -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - *) ac_optarg= ;; + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. - case "$ac_option" in + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir="$ac_optarg" ;; + bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) - ac_prev=build ;; + ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build="$ac_optarg" ;; + 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" ;; + cache_file=$ac_optarg ;; - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) - datadir="$ac_optarg" ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; -disable-* | --disable-*) - ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - eval "enable_${ac_feature}=no" ;; + 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 ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; -enable-* | --enable-*) - ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } - fi - ac_feature=`echo $ac_feature| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "enable_${ac_feature}='$ac_optarg'" ;; + 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=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -152,116 +836,77 @@ do -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) - exec_prefix="$ac_optarg" ;; + exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; - -help | --help | --hel | --he) - # 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 << EOF -Usage: configure [options] [host] -Options: [defaults in brackets after descriptions] -Configuration: - --cache-file=FILE cache test results in FILE - --help print this message - --no-create do not create output files - --quiet, --silent do not print \`checking...' messages - --version print the version of autoconf that created configure -Directory and file names: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [same as prefix] - --bindir=DIR user executables in DIR [EPREFIX/bin] - --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] - --libexecdir=DIR program executables in DIR [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data in DIR - [PREFIX/share] - --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data in DIR - [PREFIX/com] - --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] - --libdir=DIR object code libraries in DIR [EPREFIX/lib] - --includedir=DIR C header files in DIR [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] - --infodir=DIR info documentation in DIR [PREFIX/info] - --mandir=DIR man documentation in DIR [PREFIX/man] - --srcdir=DIR find the sources in DIR [configure dir or ..] - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM - run sed PROGRAM on installed program names -EOF - cat << EOF -Host type: - --build=BUILD configure for building on BUILD [BUILD=HOST] - --host=HOST configure for HOST [guessed] - --target=TARGET configure for TARGET [TARGET=HOST] -Features and packages: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --x-includes=DIR X include files are in DIR - --x-libraries=DIR X library files are in DIR -EOF - if test -n "$ac_help"; then - echo "--enable and --with options recognized:$ac_help" - fi - exit 0 ;; + -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 ;; + ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) - host="$ac_optarg" ;; + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$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" ;; + includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir="$ac_optarg" ;; + infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir="$ac_optarg" ;; + 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" ;; + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) + | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) - localstatedir="$ac_optarg" ;; + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir="$ac_optarg" ;; + 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) + | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ @@ -275,26 +920,26 @@ EOF -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir="$ac_optarg" ;; + oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix="$ac_optarg" ;; + 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_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_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ @@ -311,7 +956,17 @@ EOF | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name="$ac_optarg" ;; + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) @@ -321,7 +976,7 @@ EOF ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) - sbindir="$ac_optarg" ;; + sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ @@ -332,58 +987,53 @@ EOF | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) - sharedstatedir="$ac_optarg" ;; + sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) - site="$ac_optarg" ;; + site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir="$ac_optarg" ;; + 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" ;; + sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target ;; + ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target="$ac_optarg" ;; + target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; - -version | --version | --versio | --versi | --vers) - echo "configure generated by autoconf version 2.13" - exit 0 ;; + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; -with-* | --with-*) - ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - case "$ac_option" in - *=*) ;; - *) ac_optarg=yes ;; - esac - eval "with_${ac_package}='$ac_optarg'" ;; + 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=\$ac_optarg ;; -without-* | --without-*) - ac_package=`echo $ac_option|sed -e 's/-*without-//'` + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then - { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } - fi - ac_package=`echo $ac_package| sed 's/-/_/g'` - eval "with_${ac_package}=no" ;; + 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. @@ -394,432 +1044,1871 @@ EOF 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_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" ;; + x_libraries=$ac_optarg ;; - -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + -*) { 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; }; } + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + *) - if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then - echo "configure: warning: $ac_option: invalid host type" 1>&2 - fi - if test "x$nonopt" != xNONE; then - { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } - fi - nonopt="$ac_option" + # 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 - { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } fi -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 +# Be sure to have absolute directory names. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; } +done -# File descriptor usage: -# 0 standard input -# 1 file creation -# 2 errors and warnings -# 3 some systems may open it to /dev/tty -# 4 used on the Kubota Titan -# 6 checking for... messages and results -# 5 compiler messages saved in config.log -if test "$silent" = yes; then - exec 6>/dev/null -else - exec 6>&1 +# 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 -exec 5>./config.log -echo "\ -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. -" 1>&5 +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- -# Strip out --no-create and --no-recursion so they do not pile up. -# Also quote any args containing shell metacharacters. -ac_configure_args= -for ac_arg -do - case "$ac_arg" in - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c) ;; - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) - ac_configure_args="$ac_configure_args '$ac_arg'" ;; - *) ac_configure_args="$ac_configure_args $ac_arg" ;; - esac -done +test "$silent" = yes && exec 6>/dev/null -# NLS nuisances. -# Only set these to C if already set. These must not be set unconditionally -# because not all systems understand e.g. LANG=C (notably SCO). -# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! -# Non-C LC_CTYPE values break the ctype check. -if test "${LANG+set}" = set; then LANG=C; export LANG; fi -if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi -if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi -if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi -# 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 +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + { echo "$as_me: error: Working directory cannot be determined" >&2 + { (exit 1); exit 1; }; } +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + { echo "$as_me: error: pwd does not report name of working directory" >&2 + { (exit 1); exit 1; }; } -# A filename unique to this package, relative to the directory that -# configure is in, which we can look for to find out if srcdir is correct. -ac_unique_file=tnftp.h # 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_prog=$0 - ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` - test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$0" || +$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 + 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 "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } - else - { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } - fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 + { (exit 1); exit 1; }; } + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# 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 tnftp 20070806 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 \`..'] + +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] + --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] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/tnftp] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +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 + case $ac_init_help in + short | recursive ) echo "Configuration of tnftp 20070806:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-editcomplete turn on command line editing and completion. + (default: enabled) + --enable-ipv6 enable IPv6 support (if your OS supports it). + (default: enabled) + --disable-largefile omit support for large files + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-socks enable support for (Dante) SOCKS5 proxy + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a + nonstandard directory <lib dir> + LIBS libraries to pass to the linker, e.g. -l<library> + CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if + you have headers in a nonstandard directory <include dir> + 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. + +Report bugs to <lukem@NetBSD.org>. +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested 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 + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +tnftp configure 20070806 +generated by GNU Autoconf 2.61 + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006 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 fi -srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by tnftp $as_me 20070806, which was +generated by GNU Autoconf 2.61. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +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` +/usr/bin/hostinfo = `(/usr/bin/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 +IFS=$as_save_IFS + +} >&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_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_arg'" + ;; + 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: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +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, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------------- ## +## File substitutions. ## +## ------------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r 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 -f -r conftest* 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 +if test -n "$CONFIG_SITE"; then + set x "$CONFIG_SITE" +elif test "x$prefix" != xNONE; then + set x "$prefix/share/config.site" "$prefix/etc/config.site" +else + set x "$ac_default_prefix/share/config.site" \ + "$ac_default_prefix/etc/config.site" fi -for ac_site_file in $CONFIG_SITE; do +shift +for ac_site_file +do if test -r "$ac_site_file"; then - echo "loading site script $ac_site_file" + { 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 - echo "loading cache $cache_file" - . $cache_file + # 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 "creating cache $cache_file" - > $cache_file + { 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 $ac_precious_vars; 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 -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -ac_exeext= -ac_objext=o -if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then - # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. - if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then - ac_n= ac_c=' -' ac_t=' ' +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 + + + + + +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +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+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# 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 - ac_n=-n ac_c= ac_t= + PATH_SEPARATOR=: fi + rm -f conf$$.sh +fi + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset else - ac_n= ac_c='\c' ac_t= + as_unset=false fi +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" -if test "$program_transform_name" = s,x,x,; then - program_transform_name= +# Find who we are. Look in the path if we contain no directory separator. +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 +IFS=$as_save_IFS + + ;; +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_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +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) >/dev/null 2>&1 && $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; 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 - # Double any \ or $. echo might interpret backslashes. - cat <<\EOF_SED > conftestsed -s,\\,\\\\,g; s,\$,$$,g -EOF_SED - program_transform_name="`echo $program_transform_name|sed -f conftestsed`" - rm -f conftestsed + 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'` + +# CDPATH. +$as_unset CDPATH + + + +ac_aux_dir= +for ac_dir in build-aux "$srcdir"/build-aux; 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 build-aux \"$srcdir\"/build-aux" >&5 +echo "$as_me: error: cannot find install-sh or install.sh in build-aux \"$srcdir\"/build-aux" >&2;} + { (exit 1); exit 1; }; } +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +ac_config_headers="$ac_config_headers config.h" + + +# +# Arguments for which features are included. +# +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 +echo "$as_me: error: cannot run $SHELL $ac_aux_dir/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_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + { { 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=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_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; } +case $ac_cv_build in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 +echo "$as_me: error: invalid value of canonical build" >&2;} + { (exit 1); exit 1; }; };; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ 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 + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} + { (exit 1); exit 1; }; } +fi + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 +echo "$as_me: error: invalid value of canonical host" >&2;} + { (exit 1); exit 1; }; };; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +{ 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 + if test "x$target_alias" = x; then + ac_cv_target=$ac_cv_host +else + ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} + { (exit 1); exit 1; }; } +fi + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_target" >&5 +echo "${ECHO_T}$ac_cv_target" >&6; } +case $ac_cv_target in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 +echo "$as_me: error: invalid value of canonical target" >&2;} + { (exit 1); exit 1; }; };; +esac +target=$ac_cv_target +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_target +shift +target_cpu=$1 +target_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +target_os=$* +IFS=$ac_save_IFS +case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac + + +# 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}- test "$program_prefix" != NONE && - program_transform_name="s,^,${program_prefix},; $program_transform_name" + program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && - program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" - -# sed with no file args requires a program. -test "$program_transform_name" = "" && program_transform_name="s,x,x," - -# Check whether --enable-editcomplete or --disable-editcomplete was given. + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. echo might interpret backslashes. +# By default was `s,x,x', remove it if useless. +cat <<\_ACEOF >conftest.sed +s/[\\$]/&&/g;s/;s,x,x,$// +_ACEOF +program_transform_name=`echo $program_transform_name | sed -f conftest.sed` +rm -f conftest.sed + +# Check whether --enable-editcomplete was given. if test "${enable_editcomplete+set}" = set; then - enableval="$enable_editcomplete" - opt_editcomplete=$enableval + enableval=$enable_editcomplete; opt_editcomplete=$enableval else opt_editcomplete=yes fi -# Check whether --enable-ipv6 or --disable-ipv6 was given. +# Check whether --enable-ipv6 was given. if test "${enable_ipv6+set}" = set; then - enableval="$enable_ipv6" - opt_ipv6=$enableval + enableval=$enable_ipv6; opt_ipv6=$enableval else opt_ipv6=yes fi -echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:590: checking whether ${MAKE-make} sets \${MAKE}" >&5 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +# Check whether --with-socks was given. +if test "${with_socks+set}" = set; then + withval=$with_socks; else - cat > conftestmake <<\EOF + with_socks=check +fi + + +# +# Autoheader templates symbols. +# + + + + + + + + + +# +# Checks for programs. +# +{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } +set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh all: - @echo 'ac_maketemp="${MAKE}"' -EOF + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes -else - eval ac_cv_prog_make_${ac_make}_set=no -fi -rm -f conftestmake +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$ac_t""yes" 1>&6 +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } SET_MAKE= else - echo "$ac_t""no" 1>&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi -# Extract the first word of "gcc", so it can be a program name with args. +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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$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 +IFS=$as_save_IFS + +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 $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:619: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +{ 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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_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 + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +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 - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="gcc" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + fi fi -CC="$ac_cv_prog_CC" +CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$ac_t""no" 1>&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + + 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 $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:649: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +{ 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 - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_prog_rejected=no - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + 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 +IFS=$as_save_IFS + 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 $# -gt 0; then + 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 - set dummy "$ac_dir/$ac_word" "$@" - shift - ac_cv_prog_CC="$@" + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi -CC="$ac_cv_prog_CC" +CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$ac_t""no" 1>&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - if test -z "$CC"; then - case "`uname -s`" in - *win32* | *WIN32*) - # Extract the first word of "cl", so it can be a program name with args. -set dummy cl; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:700: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + 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 - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_CC="cl" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + fi fi -CC="$ac_cv_prog_CC" +CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$ac_t""$CC" 1>&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$ac_t""no" 1>&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - ;; - esac + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +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 { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 fi - test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +done +done +IFS=$as_save_IFS + +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 -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:732: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross - -cat > conftest.$ac_ext << EOF - -#line 743 "configure" -#include "confdefs.h" - -main(){return(0);} -EOF -if { (eval echo configure:748: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - ac_cv_prog_cc_works=yes - # If we can't run a trivial program, we are probably using a cross compiler. - if (./conftest; exit) 2>/dev/null; then - ac_cv_prog_cc_cross=no + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" else - ac_cv_prog_cc_cross=yes + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC fi -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_prog_cc_works=no fi -rm -fr conftest* -ac_ext=c -# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -ac_cpp='$CPP $CPPFLAGS' -ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' -ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' -cross_compiling=$ac_cv_prog_cc_cross -echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 -if test $ac_cv_prog_cc_works = no; then - { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi -echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:774: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 -echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 -cross_compiling=$ac_cv_prog_cc_cross -echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:779: checking whether we are using GNU C" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + +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` +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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[^ ]*//'` +# +# List of possible output files, starting from the most likely. +# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) +# only as a last resort. b.out is created by i960 compilers. +ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' +# +# The IRIX 6 linker writes into existing files which may not be +# executable, retaining their permissions. Remove them first so a +# subsequent execution test works. +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { (ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi + +{ echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6; } +if test -z "$ac_file"; then + 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 + +# Check that 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' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 that 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 { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 | *.map | *.inf | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done else - cat > conftest.c <<EOF -#ifdef __GNUC__ - yes; -#endif -EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:788: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then - ac_cv_prog_gcc=yes + { { 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 { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done else - ac_cv_prog_gcc=no + 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 -echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_compiler_gnu=no +fi + +rm -f core 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 +{ 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 + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ -if test $ac_cv_prog_gcc = yes; then - GCC=yes + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes else - GCC= -fi + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + CFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ -ac_test_CFLAGS="${CFLAGS+set}" -ac_save_CFLAGS="$CFLAGS" -CFLAGS= -echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:807: checking whether ${CC-cc} accepts -g" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : else - echo 'void f(){}' > conftest.c -if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + 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 { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else - ac_cv_prog_cc_g=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest* +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +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" + CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" @@ -833,59 +2922,168 @@ else CFLAGS= fi fi +{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_c89=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 <stdarg.h> +#include <stdio.h> +#include <sys/types.h> +#include <sys/stat.h> +/* 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; +} -for ac_prog in mawk gawk nawk awk +/* 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 -std 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 -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 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 +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do -# Extract the first word of "$ac_prog", so it can be a program name with args. + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_c89=$ac_arg +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; + xno) + { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; +esac + + +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 + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:843: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_AWK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_AWK="$ac_prog" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AWK="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + fi fi -AWK="$ac_cv_prog_AWK" +AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - echo "$ac_t""$AWK" 1>&6 + { echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6; } else - echo "$ac_t""no" 1>&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -test -n "$AWK" && break -done -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 - fi + test -n "$AWK" && break done -if test -z "$ac_aux_dir"; then - { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } -fi -ac_config_guess=$ac_aux_dir/config.guess -ac_config_sub=$ac_aux_dir/config.sub -ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -894,1261 +3092,1822 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # 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 $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:903: checking for a BSD compatible install" >&5 +{ 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 eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" - for ac_dir in $PATH; do - # Account for people who put trailing slashes in PATH elements. - case "$ac_dir/" in - /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/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 - if test -f $ac_dir/$ac_prog; 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 { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && - grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then + 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="$ac_dir/$ac_prog -c" - break 2 + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 fi fi done - ;; - esac - done - IFS="$ac_save_IFS" + done + ;; +esac +done +IFS=$as_save_IFS + fi if test "${ac_cv_path_install+set}" = set; then - INSTALL="$ac_cv_path_install" + 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 + # As a last resort, use the slow shell script. Don't cache a + # value 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" + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh fi fi -echo "$ac_t""$INSTALL" 1>&6 +{ 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_PROGRAM}' +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -# Extract the first word of "ranlib", so it can be a program name with args. -set dummy ranlib; ac_word=$2 -echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:958: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -n "$RANLIB"; then - ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_RANLIB="ranlib" - break - fi - done - IFS="$ac_save_ifs" - test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AR="${ac_tool_prefix}ar" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + fi fi -RANLIB="$ac_cv_prog_RANLIB" -if test -n "$RANLIB"; then - echo "$ac_t""$RANLIB" 1>&6 +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6; } else - echo "$ac_t""no" 1>&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -for ac_prog in ar -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 $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:990: checking for $ac_word" >&5 -if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +{ 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_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" - ac_dummy="$PATH" - for ac_dir in $ac_dummy; do - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/$ac_word; then - ac_cv_prog_AR="$ac_prog" - break - fi - done - IFS="$ac_save_ifs" +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_AR="ar" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + fi fi -AR="$ac_cv_prog_AR" -if test -n "$AR"; then - echo "$ac_t""$AR" 1>&6 +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + { echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 +echo "${ECHO_T}$ac_ct_AR" >&6; } else - echo "$ac_t""no" 1>&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -test -n "$AR" && break -done - -echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1020: checking how to run the C preprocessor" >&5 -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then -if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + if test "x$ac_ct_AR" = x; then + AR=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + AR=$ac_ct_AR + fi else - # This must be in double quotes, not single quotes, because CPP may get - # substituted into the Makefile and "${CC-cc}" will confuse make. - CPP="${CC-cc} -E" - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. - cat > conftest.$ac_ext <<EOF -#line 1035 "configure" -#include "confdefs.h" -#include <assert.h> -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1041: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : + AR="$ac_cv_prog_AR" +fi + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP="${CC-cc} -E -traditional-cpp" - cat > conftest.$ac_ext <<EOF -#line 1052 "configure" -#include "confdefs.h" -#include <assert.h> -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1058: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP="${CC-cc} -nologo -E" - cat > conftest.$ac_ext <<EOF -#line 1069 "configure" -#include "confdefs.h" -#include <assert.h> -Syntax Error -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1075: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - : +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6; } else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - CPP=/lib/cpp + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -rm -f conftest* + + fi -rm -f conftest* +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + fi -rm -f conftest* - ac_cv_prog_CPP="$CPP" fi - CPP="$ac_cv_prog_CPP" +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6; } else - ac_cv_prog_CPP="$CPP" + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -echo "$ac_t""$CPP" 1>&6 - -echo $ac_n "checking for AIX""... $ac_c" 1>&6 -echo "configure:1100: checking for AIX" >&5 -cat > conftest.$ac_ext <<EOF -#line 1102 "configure" -#include "confdefs.h" -#ifdef _AIX - yes -#endif - -EOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "yes" >/dev/null 2>&1; then - rm -rf conftest* - echo "$ac_t""yes" 1>&6; cat >> confdefs.h <<\EOF -#define _ALL_SOURCE 1 -EOF + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi else - rm -rf conftest* - echo "$ac_t""no" 1>&6 + RANLIB="$ac_cv_prog_RANLIB" fi -rm -f conftest* +# +# Checks for tool features. +# +case $target_os in + darwin*) # Mac OS X linker needs -search_paths_first so our private libraries + # are used before system libraries. + # + old_LDFLAGS=$LDFLAGS + LDFLAGS="$LDFLAGS -Wl,-search_paths_first" + { echo "$as_me:$LINENO: checking if ld accepts -search_paths_first" >&5 +echo $ECHO_N "checking if ld accepts -search_paths_first... $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. */ + +int +main () +{ +int i; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +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; } + LDFLAGS=$old_LDFLAGS +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext ;; + *) ;; +esac -if test $opt_editcomplete = yes; then - -echo $ac_n "checking for library containing tgetent""... $ac_c" 1>&6 -echo "configure:1128: checking for library containing tgetent" >&5 -if eval "test \"`echo '$''{'ac_cv_search_tgetent'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_func_search_save_LIBS="$LIBS" -ac_cv_search_tgetent="no" -cat > conftest.$ac_ext <<EOF -#line 1135 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char tgetent(); -int main() { -tgetent() -; return 0; } -EOF -if { (eval echo configure:1146: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - ac_cv_search_tgetent="none required" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 +# +# Checks for libraries. +# +if test "$opt_editcomplete" = yes; then + { echo "$as_me:$LINENO: checking for library containing tgetent" >&5 +echo $ECHO_N "checking for library containing tgetent... $ECHO_C" >&6; } +if test "${ac_cv_search_tgetent+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char tgetent (); +int +main () +{ +return tgetent (); + ; + return 0; +} +_ACEOF +for ac_lib in '' termcap termlib curses ncurses tinfo; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_search_tgetent=$ac_res +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext + if test "${ac_cv_search_tgetent+set}" = set; then + break fi -rm -f conftest* -test "$ac_cv_search_tgetent" = "no" && for i in termcap termlib curses ncurses tinfo; do -LIBS="-l$i $ac_func_search_save_LIBS" -cat > conftest.$ac_ext <<EOF -#line 1157 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char tgetent(); - -int main() { -tgetent() -; return 0; } -EOF -if { (eval echo configure:1168: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - ac_cv_search_tgetent="-l$i" -break +done +if test "${ac_cv_search_tgetent+set}" = set; then + : else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 + ac_cv_search_tgetent=no fi -rm -f conftest* -done -LIBS="$ac_func_search_save_LIBS" -fi - -echo "$ac_t""$ac_cv_search_tgetent" 1>&6 -if test "$ac_cv_search_tgetent" != "no"; then - test "$ac_cv_search_tgetent" = "none required" || LIBS="$ac_cv_search_tgetent $LIBS" - -else : - { echo "configure: error: no relevant library found containing tgetent" 1>&2; exit 1; } -fi - -echo $ac_n "checking for library containing el_init""... $ac_c" 1>&6 -echo "configure:1190: checking for library containing el_init" >&5 -if eval "test \"`echo '$''{'ac_cv_search_el_init'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_func_search_save_LIBS="$LIBS" -ac_cv_search_el_init="no" -cat > conftest.$ac_ext <<EOF -#line 1197 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char el_init(); +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_search_tgetent" >&5 +echo "${ECHO_T}$ac_cv_search_tgetent" >&6; } +ac_res=$ac_cv_search_tgetent +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" -int main() { -el_init() -; return 0; } -EOF -if { (eval echo configure:1208: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - ac_cv_search_el_init="none required" else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 + { { echo "$as_me:$LINENO: error: no relevant library found containing tgetent" >&5 +echo "$as_me: error: no relevant library found containing tgetent" >&2;} + { (exit 1); exit 1; }; } fi -rm -f conftest* -test "$ac_cv_search_el_init" = "no" && for i in edit; do -LIBS="-l$i $ac_func_search_save_LIBS" -cat > conftest.$ac_ext <<EOF -#line 1219 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char el_init(); -int main() { -el_init() -; return 0; } -EOF -if { (eval echo configure:1230: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - ac_cv_search_el_init="-l$i" -break + { echo "$as_me:$LINENO: checking for library containing el_init" >&5 +echo $ECHO_N "checking for library containing el_init... $ECHO_C" >&6; } +if test "${ac_cv_search_el_init+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 + ac_func_search_save_LIBS=$LIBS +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char el_init (); +int +main () +{ +return el_init (); + ; + return 0; +} +_ACEOF +for ac_lib in '' edit; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_search_el_init=$ac_res +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext + if test "${ac_cv_search_el_init+set}" = set; then + break fi -rm -f conftest* done -LIBS="$ac_func_search_save_LIBS" +if test "${ac_cv_search_el_init+set}" = set; then + : +else + ac_cv_search_el_init=no fi - -echo "$ac_t""$ac_cv_search_el_init" 1>&6 -if test "$ac_cv_search_el_init" != "no"; then - test "$ac_cv_search_el_init" = "none required" || LIBS="$ac_cv_search_el_init $LIBS" +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_search_el_init" >&5 +echo "${ECHO_T}$ac_cv_search_el_init" >&6; } +ac_res=$ac_cv_search_el_init +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" have_libedit=yes -else : +else have_libedit=no fi + fi - # Most operating systems have gethostbyname() in the default searched - # libraries (i.e. libc): - echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 -echo "configure:1255: checking for gethostbyname" >&5 -if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 1260 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char gethostbyname(); below. */ -#include <assert.h> -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char gethostbyname(); -int main() { +{ echo "$as_me:$LINENO: checking for library containing gethostbyname" >&5 +echo $ECHO_N "checking for library containing gethostbyname... $ECHO_C" >&6; } +if test "${ac_cv_search_gethostbyname+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -/* 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_gethostbyname) || defined (__stub___gethostbyname) -choke me -#else -gethostbyname(); +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" #endif - -; return 0; } -EOF -if { (eval echo configure:1283: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_gethostbyname=yes" +char gethostbyname (); +int +main () +{ +return gethostbyname (); + ; + return 0; +} +_ACEOF +for ac_lib in '' nsl; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_search_gethostbyname=$ac_res +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext + if test "${ac_cv_search_gethostbyname+set}" = set; then + break +fi +done +if test "${ac_cv_search_gethostbyname+set}" = set; then + : else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_gethostbyname=no" + ac_cv_search_gethostbyname=no fi -rm -f conftest* +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS fi +{ echo "$as_me:$LINENO: result: $ac_cv_search_gethostbyname" >&5 +echo "${ECHO_T}$ac_cv_search_gethostbyname" >&6; } +ac_res=$ac_cv_search_gethostbyname +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" -if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then - echo "$ac_t""yes" 1>&6 - : +fi + +{ echo "$as_me:$LINENO: checking for library containing socket" >&5 +echo $ECHO_N "checking for library containing socket... $ECHO_C" >&6; } +if test "${ac_cv_search_socket+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "$ac_t""no" 1>&6 -# Some OSes (eg. Solaris) place it in libnsl: - echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:1302: checking for gethostbyname in -lnsl" >&5 -ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lnsl $LIBS" -cat > conftest.$ac_ext <<EOF -#line 1310 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char gethostbyname(); + ac_func_search_save_LIBS=$LIBS +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -int main() { -gethostbyname() -; return 0; } -EOF -if { (eval echo configure:1321: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char socket (); +int +main () +{ +return socket (); + ; + return 0; +} +_ACEOF +for ac_lib in '' socket; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_search_socket=$ac_res +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext + if test "${ac_cv_search_socket+set}" = set; then + break fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/^a-zA-Z0-9_/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` - cat >> confdefs.h <<EOF -#define $ac_tr_lib 1 -EOF - - LIBS="-lnsl $LIBS" - -else - echo "$ac_t""no" 1>&6 -# Some strange OSes (SINIX) have it in libsocket: - echo $ac_n "checking for gethostbyname in -lsocket""... $ac_c" 1>&6 -echo "configure:1348: checking for gethostbyname in -lsocket" >&5 -ac_lib_var=`echo socket'_'gethostbyname | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lsocket $LIBS" -cat > conftest.$ac_ext <<EOF -#line 1356 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char gethostbyname(); - -int main() { -gethostbyname() -; return 0; } -EOF -if { (eval echo configure:1367: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" +done +if test "${ac_cv_search_socket+set}" = set; then + : +else + ac_cv_search_socket=no fi -rm -f conftest* -LIBS="$ac_save_LIBS" - +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/^a-zA-Z0-9_/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` - cat >> confdefs.h <<EOF -#define $ac_tr_lib 1 -EOF - - LIBS="-lsocket $LIBS" +{ echo "$as_me:$LINENO: result: $ac_cv_search_socket" >&5 +echo "${ECHO_T}$ac_cv_search_socket" >&6; } +ac_res=$ac_cv_search_socket +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" else - echo "$ac_t""no" 1>&6 -# Unfortunately libsocket sometimes depends on libnsl. - # AC_CHECK_LIB's API is essentially broken so the following - # ugliness is necessary: - echo $ac_n "checking for gethostbyname in -lsocket""... $ac_c" 1>&6 -echo "configure:1396: checking for gethostbyname in -lsocket" >&5 -ac_lib_var=`echo socket'_'gethostbyname | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + { echo "$as_me:$LINENO: checking for socket in -lsocket" >&5 +echo $ECHO_N "checking for socket in -lsocket... $ECHO_C" >&6; } +if test "${ac_cv_lib_socket_socket+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_save_LIBS="$LIBS" + ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket -lnsl $LIBS" -cat > conftest.$ac_ext <<EOF -#line 1404 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char gethostbyname(); - -int main() { -gethostbyname() -; return 0; } -EOF -if { (eval echo configure:1415: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char socket (); +int +main () +{ +return socket (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_socket_socket=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_socket_socket=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5 +echo "${ECHO_T}$ac_cv_lib_socket_socket" >&6; } +if test $ac_cv_lib_socket_socket = yes; then LIBS="-lsocket -lnsl $LIBS" -else - echo "$ac_t""no" 1>&6 -echo $ac_n "checking for gethostbyname in -lresolv""... $ac_c" 1>&6 -echo "configure:1434: checking for gethostbyname in -lresolv" >&5 -ac_lib_var=`echo resolv'_'gethostbyname | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lresolv $LIBS" -cat > conftest.$ac_ext <<EOF -#line 1442 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char gethostbyname(); - -int main() { -gethostbyname() -; return 0; } -EOF -if { (eval echo configure:1453: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" fi -rm -f conftest* -LIBS="$ac_save_LIBS" fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo resolv | sed -e 's/^a-zA-Z0-9_/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` - cat >> confdefs.h <<EOF -#define $ac_tr_lib 1 -EOF - LIBS="-lresolv $LIBS" +# Check for (Dante) SOCKS5. +# +if test "$with_socks" != no; then + { echo "$as_me:$LINENO: checking for library containing SOCKSinit" >&5 +echo $ECHO_N "checking for library containing SOCKSinit... $ECHO_C" >&6; } +if test "${ac_cv_search_SOCKSinit+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char SOCKSinit (); +int +main () +{ +return SOCKSinit (); + ; + return 0; +} +_ACEOF +for ac_lib in '' socksd socks; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_search_SOCKSinit=$ac_res +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext + if test "${ac_cv_search_SOCKSinit+set}" = set; then + break +fi +done +if test "${ac_cv_search_SOCKSinit+set}" = set; then + : else - echo "$ac_t""no" 1>&6 + ac_cv_search_SOCKSinit=no fi - +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS fi +{ echo "$as_me:$LINENO: result: $ac_cv_search_SOCKSinit" >&5 +echo "${ECHO_T}$ac_cv_search_SOCKSinit" >&6; } +ac_res=$ac_cv_search_SOCKSinit +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + cat >>confdefs.h <<\_ACEOF +#define USE_SOCKS 1 +_ACEOF - + if test "$opt_ipv6" = yes; then + { echo "$as_me:$LINENO: WARNING: IPv6 is incompatible with socks, disabling IPv6 support" >&5 +echo "$as_me: WARNING: IPv6 is incompatible with socks, disabling IPv6 support" >&2;} + opt_ipv6=no fi - +else + if test "$with_socks" != check; then + { { echo "$as_me:$LINENO: error: --with-socks was given, but SOCKSinit() wasn't found +See \`config.log' for more details." >&5 +echo "$as_me: error: --with-socks was given, but SOCKSinit() wasn't found +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } fi - fi - echo $ac_n "checking for socket""... $ac_c" 1>&6 -echo "configure:1492: checking for socket" >&5 -if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 1497 "configure" -#include "confdefs.h" -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char socket(); below. */ -#include <assert.h> -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char socket(); +fi -int main() { -/* 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_socket) || defined (__stub___socket) -choke me +# +# Checks for header files. +# +accheck_includes=' +#include <stdio.h> +#if defined(HAVE_SYS_TYPES_H) +# include <sys/types.h> +#endif +#if defined(HAVE_SYS_STAT_H) +# include <sys/stat.h> +#endif +#if defined(STDC_HEADERS) +# include <stdarg.h> +# include <stdlib.h> +# include <string.h> +#endif +#if defined(HAVE_LIBGEN_H) +# include <libgen.h> +#endif +#if defined(HAVE_PWD_H) +# include <pwd.h> +#endif +#if defined(HAVE_UNISTD_H) +# include <unistd.h> +#endif +#if defined(HAVE_POLL_H) +# include <poll.h> +#elif defined(HAVE_SYS_POLL_H) +# include <sys/poll.h> +#endif +#if defined(HAVE_SYS_SOCKET_H) +# include <sys/socket.h> +#endif +#if defined(HAVE_NETINET_IN_H) +# include <netinet/in.h> +#endif +#if defined(HAVE_NETINET_IN_SYSTM_H) +# include <netinet/in_systm.h> +#endif +#if defined(HAVE_NETDB_H) +# include <netdb.h> +#endif +#if defined(HAVE_ARPA_INET_H) +# include <arpa/inet.h> +#endif +#if defined(HAVE_DIRENT_H) +# include <dirent.h> #else -socket(); +# define dirent direct +# if defined(HAVE_SYS_NDIR_H) +# include <sys/ndir.h> +# endif +# if defined(HAVE_SYS_DIR_H) +# include <sys/dir.h> +# endif +# if defined(HAVE_NDIR_H) +# include <ndir.h> +# endif #endif +' # accheck_includes -; return 0; } -EOF -if { (eval echo configure:1520: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_socket=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_socket=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then - echo "$ac_t""yes" 1>&6 - : -else - echo "$ac_t""no" 1>&6 -echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6 -echo "configure:1538: checking for socket in -lsocket" >&5 -ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lsocket $LIBS" -cat > conftest.$ac_ext <<EOF -#line 1546 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char socket(); -int main() { -socket() -; return 0; } -EOF -if { (eval echo configure:1557: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/^a-zA-Z0-9_/_/g' \ - -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` - cat >> confdefs.h <<EOF -#define $ac_tr_lib 1 -EOF - LIBS="-lsocket $LIBS" -else - echo "$ac_t""no" 1>&6 -echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6 -echo "configure:1583: checking for socket in -lsocket" >&5 -ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lsocket -lnsl $LIBS" -cat > conftest.$ac_ext <<EOF -#line 1591 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char socket(); -int main() { -socket() -; return 0; } -EOF -if { (eval echo configure:1602: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - LIBS="-lsocket -lnsl $LIBS" -else - echo "$ac_t""no" 1>&6 -fi -fi +for ac_header in sys/types.h sys/ioctl.h sys/param.h sys/stat.h \ + sys/socket.h sys/syslimits.h sys/time.h sys/wait.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 { as_var=$as_ac_Header; eval "test \"\${$as_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. */ +$accheck_includes + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_Header=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&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 - echo $ac_n "checking whether to support SOCKS""... $ac_c" 1>&6 -echo "configure:1629: checking whether to support SOCKS" >&5 - # Check whether --with-socks or --without-socks was given. -if test "${with_socks+set}" = set; then - withval="$with_socks" - - case "$withval" in - no) - echo "$ac_t""no" 1>&6 - ;; - yes) - echo "$ac_t""yes" 1>&6 - echo $ac_n "checking for SOCKSconnect in -lsocks5""... $ac_c" 1>&6 -echo "configure:1641: checking for SOCKSconnect in -lsocks5" >&5 -ac_lib_var=`echo socks5'_'SOCKSconnect | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lsocks5 $LIBS" -cat > conftest.$ac_ext <<EOF -#line 1649 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char SOCKSconnect(); -int main() { -SOCKSconnect() -; return 0; } -EOF -if { (eval echo configure:1660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - - socks=5 - LIBS="-lsocks5 $LIBS" -else - echo "$ac_t""no" 1>&6 - echo $ac_n "checking for Rconnect in -lsocks""... $ac_c" 1>&6 -echo "configure:1682: checking for Rconnect in -lsocks" >&5 -ac_lib_var=`echo socks'_'Rconnect | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lsocks $LIBS" -cat > conftest.$ac_ext <<EOF -#line 1690 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char Rconnect(); -int main() { -Rconnect() -; return 0; } -EOF -if { (eval echo configure:1701: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - - socks=4 - LIBS="-lsocks $LIBS" -else - echo "$ac_t""no" 1>&6 +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 { as_var=$as_ac_Header; eval "test \"\${$as_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. */ +#include <sys/types.h> +#include <$ac_hdr> - { echo "configure: error: Could not find socks library. You must first install socks." 1>&2; exit 1; } -fi - +int +main () +{ +if ((DIR *) 0) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_Header=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&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 - ;; - esac - -else - echo "$ac_t""no" 1>&6 - -fi - - - if test "x$socks" = "x"; then - echo $ac_n "checking whether to support SOCKS5""... $ac_c" 1>&6 -echo "configure:1738: checking whether to support SOCKS5" >&5 - # Check whether --with-socks5 or --without-socks5 was given. -if test "${with_socks5+set}" = set; then - withval="$with_socks5" - - case "$withval" in - no) - echo "$ac_t""no" 1>&6 - ;; - *) - echo "$ac_t""yes" 1>&6 - socks=5 - if test "x$withval" = "xyes"; then - withval="-lsocks5" - else - if test -d "$withval"; then - if test -d "$withval/include"; then - CFLAGS="$CFLAGS -I$withval/include" - else - CFLAGS="$CFLAGS -I$withval" - fi - if test -d "$withval/lib"; then - withval="-L$withval/lib -lsocks5" - else - withval="-L$withval -lsocks5" - fi - fi - fi - LIBS="$withval $LIBS" - # If Socks was compiled with Kerberos support, we will need - # to link against kerberos libraries. Temporarily append - # to LIBS. This is harmless if there is no kerberos support. - TMPLIBS="$LIBS" - LIBS="$LIBS $KERBEROS_LIBS" - cat > conftest.$ac_ext <<EOF -#line 1773 "configure" -#include "confdefs.h" - -int main() { - SOCKSconnect(); -; return 0; } -EOF -if { (eval echo configure:1780: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +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 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (); +int +main () +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' dir; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_search_opendir=$ac_res +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext + if test "${ac_cv_search_opendir+set}" = set; then + break +fi +done +if test "${ac_cv_search_opendir+set}" = set; then : else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - { echo "configure: error: Could not find the $withval library. You must first install socks5." 1>&2; exit 1; } + ac_cv_search_opendir=no fi -rm -f conftest* - LIBS="$TMPLIBS" - ;; - esac - -else - echo "$ac_t""no" 1>&6 - +rm conftest.$ac_ext +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; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - fi +fi - if test "x$socks" = "x"; then - echo $ac_n "checking whether to support SOCKS4""... $ac_c" 1>&6 -echo "configure:1802: checking whether to support SOCKS4" >&5 - # Check whether --with-socks4 or --without-socks4 was given. -if test "${with_socks4+set}" = set; then - withval="$with_socks4" - - case "$withval" in - no) - echo "$ac_t""no" 1>&6 - ;; - *) - echo "$ac_t""yes" 1>&6 - socks=4 - if test "x$withval" = "xyes"; then - withval="-lsocks" - else - if test -d "$withval"; then - withval="-L$withval -lsocks" - fi - fi - LIBS="$withval $LIBS" - cat > conftest.$ac_ext <<EOF -#line 1823 "configure" -#include "confdefs.h" +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 +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -int main() { - Rconnect(); -; return 0; } -EOF -if { (eval echo configure:1830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (); +int +main () +{ +return opendir (); + ; + return 0; +} +_ACEOF +for ac_lib in '' x; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_search_opendir=$ac_res +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext + if test "${ac_cv_search_opendir+set}" = set; then + break +fi +done +if test "${ac_cv_search_opendir+set}" = set; then : else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - { echo "configure: error: Could not find the $withval library. You must first install socks." 1>&2; exit 1; } + ac_cv_search_opendir=no fi -rm -f conftest* - ;; - esac - -else - echo "$ac_t""no" 1>&6 - +rm conftest.$ac_ext +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; } +ac_res=$ac_cv_search_opendir +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - fi +fi - if test "x$socks" = "x4"; then - cat >> confdefs.h <<\EOF -#define SOCKS 1 -EOF +fi - cat >> confdefs.h <<\EOF -#define SOCKS4 1 -EOF - cat >> confdefs.h <<\EOF -#define connect Rconnect -EOF - cat >> confdefs.h <<\EOF -#define getsockname Rgetsockname -EOF - cat >> confdefs.h <<\EOF -#define getpeername Rgetpeername -EOF - cat >> confdefs.h <<\EOF -#define bind Rbind -EOF - cat >> confdefs.h <<\EOF -#define accept Raccept -EOF +for ac_header in sys/types.h netinet/in.h arpa/nameser.h netdb.h resolv.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 { as_var=$as_ac_Header; eval "test \"\${$as_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. */ +#ifdef HAVE_SYS_TYPES_H +# include <sys/types.h> +#endif +#ifdef HAVE_NETINET_IN_H +# include <netinet/in.h> /* inet_ functions / structs */ +#endif +#ifdef HAVE_ARPA_NAMESER_H +# include <arpa/nameser.h> /* DNS HEADER struct */ +#endif +#ifdef HAVE_NETDB_H +# include <netdb.h> +#endif - cat >> confdefs.h <<\EOF -#define listen Rlisten -EOF +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_Header=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF - cat >> confdefs.h <<\EOF -#define select Rselect -EOF +fi - fi +done - if test "x$socks" = "x5"; then - cat >> confdefs.h <<\EOF -#define SOCKS 1 -EOF - cat >> confdefs.h <<\EOF -#define SOCKS5 1 -EOF +{ echo "$as_me:$LINENO: checking whether stat file-mode macros are broken" >&5 +echo $ECHO_N "checking whether stat file-mode macros are broken... $ECHO_C" >&6; } +if test "${ac_cv_header_stat_broken+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <sys/types.h> +#include <sys/stat.h> - cat >> confdefs.h <<\EOF -#define connect SOCKSconnect -EOF +#if defined S_ISBLK && defined S_IFDIR +extern char c1[S_ISBLK (S_IFDIR) ? -1 : 1]; +#endif - cat >> confdefs.h <<\EOF -#define getsockname SOCKSgetsockname -EOF +#if defined S_ISBLK && defined S_IFCHR +extern char c2[S_ISBLK (S_IFCHR) ? -1 : 1]; +#endif - cat >> confdefs.h <<\EOF -#define getpeername SOCKSgetpeername -EOF +#if defined S_ISLNK && defined S_IFREG +extern char c3[S_ISLNK (S_IFREG) ? -1 : 1]; +#endif - cat >> confdefs.h <<\EOF -#define bind SOCKSbind -EOF +#if defined S_ISSOCK && defined S_IFREG +extern char c4[S_ISSOCK (S_IFREG) ? -1 : 1]; +#endif - cat >> confdefs.h <<\EOF -#define accept SOCKSaccept -EOF +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_header_stat_broken=no +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - cat >> confdefs.h <<\EOF -#define listen SOCKSlisten -EOF + ac_cv_header_stat_broken=yes +fi - cat >> confdefs.h <<\EOF -#define select SOCKSselect -EOF +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_stat_broken" >&5 +echo "${ECHO_T}$ac_cv_header_stat_broken" >&6; } +if test $ac_cv_header_stat_broken = yes; then - cat >> confdefs.h <<\EOF -#define recvfrom SOCKSrecvfrom -EOF +cat >>confdefs.h <<\_ACEOF +#define STAT_MACROS_BROKEN 1 +_ACEOF - cat >> confdefs.h <<\EOF -#define sendto SOCKSsendto -EOF +fi - cat >> confdefs.h <<\EOF -#define recv SOCKSrecv -EOF +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 <limits.h> to <assert.h> if __STDC__ is defined, since + # <limits.h> exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + Syntax error +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + : +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 nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <ac_nonexistent.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + # 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 - cat >> confdefs.h <<\EOF -#define send SOCKSsend -EOF +rm -f conftest.err conftest.$ac_ext - cat >> confdefs.h <<\EOF -#define read SOCKSread -EOF +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 - cat >> confdefs.h <<\EOF -#define write SOCKSwrite -EOF + done + ac_cv_prog_CPP=$CPP - cat >> confdefs.h <<\EOF -#define rresvport SOCKSrresvport -EOF +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + # <limits.h> exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + Syntax error +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + : +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 nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <ac_nonexistent.h> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + # 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 - cat >> confdefs.h <<\EOF -#define shutdown SOCKSshutdown -EOF +rm -f conftest.err conftest.$ac_ext - cat >> confdefs.h <<\EOF -#define close SOCKSclose -EOF +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi - cat >> confdefs.h <<\EOF -#define dup SOCKSdup -EOF +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 grep that handles long lines and -e" >&5 +echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Extract the first word of "grep ggrep" to use in msg output +if test -z "$GREP"; then +set dummy grep ggrep; ac_prog_name=$2 +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_GREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + # Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac - cat >> confdefs.h <<\EOF -#define dup2 SOCKSdup2 -EOF - cat >> confdefs.h <<\EOF -#define fclose SOCKSfclose -EOF + $ac_path_GREP_found && break 3 + done +done - cat >> confdefs.h <<\EOF -#define gethostbyname SOCKSgethostbyname -EOF +done +IFS=$as_save_IFS - fi -if test -n "$socks"; then - if test $opt_ipv6 = yes; then - echo "IPv6 is incompatible with socks, disabling IPv6 support" - opt_ipv6=no - fi fi - - -ac_header_dirent=no -for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:1993: checking for $ac_hdr that defines DIR" >&5 -if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 1998 "configure" -#include "confdefs.h" -#include <sys/types.h> -#include <$ac_hdr> -int main() { -DIR *dirp = 0; -; return 0; } -EOF -if { (eval echo configure:2006: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - eval "ac_cv_header_dirent_$ac_safe=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_dirent_$ac_safe=no" -fi -rm -f conftest* +GREP="$ac_cv_path_GREP" +if test -z "$GREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } fi -if eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <<EOF -#define $ac_tr_hdr 1 -EOF - ac_header_dirent=$ac_hdr; break + else - echo "$ac_t""no" 1>&6 + ac_cv_path_GREP=$GREP 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 $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:2031: checking for opendir in -ldir" >&5 -ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-ldir $LIBS" -cat > conftest.$ac_ext <<EOF -#line 2039 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* 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; } -EOF -if { (eval echo configure:2050: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - LIBS="$LIBS -ldir" -else - echo "$ac_t""no" 1>&6 -fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +echo "${ECHO_T}$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + +{ echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else -echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:2072: checking for opendir in -lx" >&5 -ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + # Extract the first word of "egrep" to use in msg output +if test -z "$EGREP"; then +set dummy egrep; ac_prog_name=$2 +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_save_LIBS="$LIBS" -LIBS="-lx $LIBS" -cat > conftest.$ac_ext <<EOF -#line 2080 "configure" -#include "confdefs.h" -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char opendir(); + ac_path_EGREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + # Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_EGREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + -int main() { -opendir() -; return 0; } -EOF -if { (eval echo configure:2091: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" fi -rm -f conftest* -LIBS="$ac_save_LIBS" +EGREP="$ac_cv_path_EGREP" +if test -z "$EGREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - LIBS="$LIBS -lx" + else - echo "$ac_t""no" 1>&6 + ac_cv_path_EGREP=$EGREP fi + + fi fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + -echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2114: checking for ANSI C header files" >&5 -if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +{ 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 <<EOF -#line 2119 "configure" -#include "confdefs.h" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <stdlib.h> #include <stdarg.h> #include <string.h> #include <float.h> -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2127: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_header_stdc=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_header_stdc=no fi -rm -f conftest* + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. -cat > conftest.$ac_ext <<EOF -#line 2144 "configure" -#include "confdefs.h" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <string.h> -EOF + +_ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "memchr" >/dev/null 2>&1; then + $EGREP "memchr" >/dev/null 2>&1; then : else - rm -rf conftest* ac_cv_header_stdc=no fi rm -f conftest* @@ -2157,16 +4916,19 @@ 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 <<EOF -#line 2162 "configure" -#include "confdefs.h" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <stdlib.h> -EOF + +_ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "free" >/dev/null 2>&1; then + $EGREP "free" >/dev/null 2>&1; then : else - rm -rf conftest* ac_cv_header_stdc=no fi rm -f conftest* @@ -2175,2092 +4937,5903 @@ 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 + if test "$cross_compiling" = yes; then : else - cat > conftest.$ac_ext <<EOF -#line 2183 "configure" -#include "confdefs.h" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <ctype.h> -#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#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); } +#include <stdlib.h> +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif -EOF -if { (eval echo configure:2194: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then : else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_header_stdc=no -fi -rm -fr conftest* -fi + 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 core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -echo "$ac_t""$ac_cv_header_stdc" 1>&6 -if test $ac_cv_header_stdc = yes; then - cat >> confdefs.h <<\EOF -#define STDC_HEADERS 1 -EOF - -fi -for ac_hdr in arpa/nameser.h err.h libgen.h regex.h paths.h poll.h \ - sys/poll.h sys/syslimits.h termcap.h util.h libutil.h vis.h -do -ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2222: checking for $ac_hdr" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 2227 "configure" -#include "confdefs.h" -#include <$ac_hdr> -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2232: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" fi -rm -f conftest* fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` - cat >> confdefs.h <<EOF -#define $ac_tr_hdr 1 -EOF - -else - echo "$ac_t""no" 1>&6 -fi -done +{ 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 -echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:2261: checking whether time.h and sys/time.h may both be included" >&5 -if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +{ 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 <<EOF -#line 2266 "configure" -#include "confdefs.h" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <sys/types.h> #include <sys/time.h> #include <time.h> -int main() { -struct tm *tp; -; return 0; } -EOF -if { (eval echo configure:2275: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* + +int +main () +{ +if ((struct tm *) 0) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_header_time=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ac_cv_header_time=no -fi -rm -f conftest* + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_header_time=no fi -echo "$ac_t""$ac_cv_header_time" 1>&6 +rm -f core 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 <<\EOF + +cat >>confdefs.h <<\_ACEOF #define TIME_WITH_SYS_TIME 1 -EOF +_ACEOF fi -echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:2296: checking for off_t" >&5 -if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +{ echo "$as_me:$LINENO: checking whether termios.h defines TIOCGWINSZ" >&5 +echo $ECHO_N "checking whether termios.h defines TIOCGWINSZ... $ECHO_C" >&6; } +if test "${ac_cv_sys_tiocgwinsz_in_termios_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat > conftest.$ac_ext <<EOF -#line 2301 "configure" -#include "confdefs.h" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ #include <sys/types.h> -#if STDC_HEADERS -#include <stdlib.h> -#include <stddef.h> +#include <termios.h> +#ifdef TIOCGWINSZ + yes #endif -EOF + +_ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then - rm -rf conftest* - ac_cv_type_off_t=yes + $EGREP "yes" >/dev/null 2>&1; then + ac_cv_sys_tiocgwinsz_in_termios_h=yes else - rm -rf conftest* - ac_cv_type_off_t=no + ac_cv_sys_tiocgwinsz_in_termios_h=no fi rm -f conftest* fi -echo "$ac_t""$ac_cv_type_off_t" 1>&6 -if test $ac_cv_type_off_t = no; then - cat >> confdefs.h <<\EOF -#define off_t long -EOF - -fi +{ echo "$as_me:$LINENO: result: $ac_cv_sys_tiocgwinsz_in_termios_h" >&5 +echo "${ECHO_T}$ac_cv_sys_tiocgwinsz_in_termios_h" >&6; } -echo $ac_n "checking size of off_t""... $ac_c" 1>&6 -echo "configure:2329: checking size of off_t" >&5 -if eval "test \"`echo '$''{'ac_cv_sizeof_off_t'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +if test $ac_cv_sys_tiocgwinsz_in_termios_h != yes; then + { echo "$as_me:$LINENO: checking whether sys/ioctl.h defines TIOCGWINSZ" >&5 +echo $ECHO_N "checking whether sys/ioctl.h defines TIOCGWINSZ... $ECHO_C" >&6; } +if test "${ac_cv_sys_tiocgwinsz_in_sys_ioctl_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$cross_compiling" = yes; then - ac_cv_sizeof_off_t=0 + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <sys/types.h> +#include <sys/ioctl.h> +#ifdef TIOCGWINSZ + yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then + ac_cv_sys_tiocgwinsz_in_sys_ioctl_h=yes else - cat > conftest.$ac_ext <<EOF -#line 2337 "configure" -#include "confdefs.h" -#include <stdio.h> -main() + ac_cv_sys_tiocgwinsz_in_sys_ioctl_h=no +fi +rm -f conftest* + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_sys_tiocgwinsz_in_sys_ioctl_h" >&5 +echo "${ECHO_T}$ac_cv_sys_tiocgwinsz_in_sys_ioctl_h" >&6; } + + if test $ac_cv_sys_tiocgwinsz_in_sys_ioctl_h = yes; then + +cat >>confdefs.h <<\_ACEOF +#define GWINSZ_IN_SYS_IOCTL 1 +_ACEOF + + fi +fi + + + + + + + + + + + + + + + + + + + + + + + + + +for ac_header in arpa/ftp.h arpa/inet.h arpa/nameser.h err.h \ + fcntl.h libgen.h limits.h malloc.h \ + netinet/in.h netinet/in_systm.h netinet/ip.h \ + paths.h poll.h pwd.h sys/poll.h regex.h \ + setjmp.h signal.h stddef.h termcap.h termios.h \ + unistd.h utime.h vis.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 { as_var=$as_ac_Header; eval "test \"\${$as_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. */ +$accheck_includes + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_Header=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&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 + + +# +# Checks for typedefs, structures, and compiler characteristics. +# +{ echo "$as_me:$LINENO: checking whether AI_NUMERICHOST is declared" >&5 +echo $ECHO_N "checking whether AI_NUMERICHOST is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_AI_NUMERICHOST+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. */ +$accheck_includes + +int +main () { - FILE *f=fopen("conftestval", "w"); - if (!f) exit(1); - fprintf(f, "%d\n", sizeof(off_t)); - exit(0); +#ifndef AI_NUMERICHOST + (void) AI_NUMERICHOST; +#endif + + ; + return 0; } -EOF -if { (eval echo configure:2348: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - ac_cv_sizeof_off_t=`cat conftestval` +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_AI_NUMERICHOST=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_sizeof_off_t=0 -fi -rm -fr conftest* + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_AI_NUMERICHOST=no fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$ac_t""$ac_cv_sizeof_off_t" 1>&6 -cat >> confdefs.h <<EOF -#define SIZEOF_OFF_T $ac_cv_sizeof_off_t -EOF +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_AI_NUMERICHOST" >&5 +echo "${ECHO_T}$ac_cv_have_decl_AI_NUMERICHOST" >&6; } +if test $ac_cv_have_decl_AI_NUMERICHOST = yes; then +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_AI_NUMERICHOST 1 +_ACEOF - echo $ac_n "checking for long long""... $ac_c" 1>&6 -echo "configure:2369: checking for long long" >&5 -if eval "test \"`echo '$''{'ftp_cv_HAVE_LONG_LONG'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 else - - cat > conftest.$ac_ext <<EOF -#line 2375 "configure" -#include "confdefs.h" - -#include <sys/types.h> - -int main() { - - long long X = 2, Y = 1, Z; - Z = X / Y; - ; -; return 0; } -EOF -if { (eval echo configure:2387: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - ftp_cv_HAVE_LONG_LONG=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ftp_cv_HAVE_LONG_LONG=no + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_AI_NUMERICHOST 0 +_ACEOF + + fi -rm -f conftest* - +{ echo "$as_me:$LINENO: checking whether dirname is declared" >&5 +echo $ECHO_N "checking whether dirname is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_dirname+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. */ +$accheck_includes + +int +main () +{ +#ifndef dirname + (void) dirname; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_dirname=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_dirname=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_dirname" >&5 +echo "${ECHO_T}$ac_cv_have_decl_dirname" >&6; } +if test $ac_cv_have_decl_dirname = yes; then -echo "$ac_t""$ftp_cv_HAVE_LONG_LONG" 1>&6 - if test "x$ftp_cv_HAVE_LONG_LONG" = "xyes"; then - - cat >> confdefs.h <<\EOF -#define HAVE_LONG_LONG 1 -EOF +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_DIRNAME 1 +_ACEOF - have_long_long=yes - - else - have_long_long=no - : - fi +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_DIRNAME 0 +_ACEOF - echo $ac_n "checking for in_port_t""... $ac_c" 1>&6 -echo "configure:2417: checking for in_port_t" >&5 -if eval "test \"`echo '$''{'ftp_cv_HAVE_IN_PORT_T'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +fi +{ echo "$as_me:$LINENO: checking whether fclose is declared" >&5 +echo $ECHO_N "checking whether fclose is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_fclose+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - - cat > conftest.$ac_ext <<EOF -#line 2423 "configure" -#include "confdefs.h" - -#include <sys/types.h> -#include <netinet/in.h> - -int main() { - in_port_t X ; -; return 0; } -EOF -if { (eval echo configure:2433: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ftp_cv_HAVE_IN_PORT_T=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ftp_cv_HAVE_IN_PORT_T=no + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$accheck_includes + +int +main () +{ +#ifndef fclose + (void) fclose; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_fclose=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_fclose=no fi -rm -f conftest* - + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_fclose" >&5 +echo "${ECHO_T}$ac_cv_have_decl_fclose" >&6; } +if test $ac_cv_have_decl_fclose = yes; then -echo "$ac_t""$ftp_cv_HAVE_IN_PORT_T" 1>&6 - if test "x$ftp_cv_HAVE_IN_PORT_T" = "xyes"; then - cat >> confdefs.h <<\EOF -#define HAVE_IN_PORT_T 1 -EOF +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FCLOSE 1 +_ACEOF - else - - : - fi + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_FCLOSE 0 +_ACEOF +fi +{ echo "$as_me:$LINENO: checking whether getpass is declared" >&5 +echo $ECHO_N "checking whether getpass is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_getpass+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. */ +$accheck_includes + +int +main () +{ +#ifndef getpass + (void) getpass; +#endif - echo $ac_n "checking for sa_family_t""... $ac_c" 1>&6 -echo "configure:2460: checking for sa_family_t" >&5 -if eval "test \"`echo '$''{'ftp_cv_HAVE_SA_FAMILY_T'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_getpass=yes else - - cat > conftest.$ac_ext <<EOF -#line 2466 "configure" -#include "confdefs.h" - -#include <sys/types.h> -#include <sys/socket.h> - -int main() { - sa_family_t X ; -; return 0; } -EOF -if { (eval echo configure:2476: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ftp_cv_HAVE_SA_FAMILY_T=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ftp_cv_HAVE_SA_FAMILY_T=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_getpass=no fi -rm -f conftest* - + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_getpass" >&5 +echo "${ECHO_T}$ac_cv_have_decl_getpass" >&6; } +if test $ac_cv_have_decl_getpass = yes; then -echo "$ac_t""$ftp_cv_HAVE_SA_FAMILY_T" 1>&6 - if test "x$ftp_cv_HAVE_SA_FAMILY_T" = "xyes"; then - cat >> confdefs.h <<\EOF -#define HAVE_SA_FAMILY_T 1 -EOF +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETPASS 1 +_ACEOF - else - - : - fi +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_GETPASS 0 +_ACEOF - echo $ac_n "checking for sockaddr_in.sin_len""... $ac_c" 1>&6 -echo "configure:2503: checking for sockaddr_in.sin_len" >&5 -if eval "test \"`echo '$''{'ftp_cv_HAVE_SOCKADDR_SA_LEN'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +fi +{ echo "$as_me:$LINENO: checking whether h_errno is declared" >&5 +echo $ECHO_N "checking whether h_errno is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_h_errno+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - - cat > conftest.$ac_ext <<EOF -#line 2509 "configure" -#include "confdefs.h" - -#include <sys/types.h> -#include <sys/socket.h> -#include <netinet/in.h> - -int main() { - - struct sockaddr_in sin; - int X = sin.sin_len - ; -; return 0; } -EOF -if { (eval echo configure:2523: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ftp_cv_HAVE_SOCKADDR_SA_LEN=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ftp_cv_HAVE_SOCKADDR_SA_LEN=no + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$accheck_includes + +int +main () +{ +#ifndef h_errno + (void) h_errno; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_h_errno=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_h_errno=no fi -rm -f conftest* - + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_h_errno" >&5 +echo "${ECHO_T}$ac_cv_have_decl_h_errno" >&6; } +if test $ac_cv_have_decl_h_errno = yes; then -echo "$ac_t""$ftp_cv_HAVE_SOCKADDR_SA_LEN" 1>&6 - if test "x$ftp_cv_HAVE_SOCKADDR_SA_LEN" = "xyes"; then - cat >> confdefs.h <<\EOF -#define HAVE_SOCKADDR_SA_LEN 1 -EOF +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_H_ERRNO 1 +_ACEOF - else - - : - fi +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_H_ERRNO 0 +_ACEOF - echo $ac_n "checking for socklen_t""... $ac_c" 1>&6 -echo "configure:2550: checking for socklen_t" >&5 -if eval "test \"`echo '$''{'ftp_cv_HAVE_SOCKLEN_T'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +fi +{ echo "$as_me:$LINENO: checking whether pclose is declared" >&5 +echo $ECHO_N "checking whether pclose is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_pclose+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - - cat > conftest.$ac_ext <<EOF -#line 2556 "configure" -#include "confdefs.h" - -#include <sys/types.h> -#include <sys/socket.h> - -int main() { - socklen_t X ; -; return 0; } -EOF -if { (eval echo configure:2566: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ftp_cv_HAVE_SOCKLEN_T=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ftp_cv_HAVE_SOCKLEN_T=no + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$accheck_includes + +int +main () +{ +#ifndef pclose + (void) pclose; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_pclose=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_pclose=no fi -rm -f conftest* - + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_pclose" >&5 +echo "${ECHO_T}$ac_cv_have_decl_pclose" >&6; } +if test $ac_cv_have_decl_pclose = yes; then -echo "$ac_t""$ftp_cv_HAVE_SOCKLEN_T" 1>&6 - if test "x$ftp_cv_HAVE_SOCKLEN_T" = "xyes"; then - cat >> confdefs.h <<\EOF -#define HAVE_SOCKLEN_T 1 -EOF +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_PCLOSE 1 +_ACEOF - else - - : - fi +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_PCLOSE 0 +_ACEOF -if test $opt_ipv6 = yes; then - - echo $ac_n "checking for AF_INET6""... $ac_c" 1>&6 -echo "configure:2595: checking for AF_INET6" >&5 -if eval "test \"`echo '$''{'ftp_cv_HAVE_AF_INET6'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - - cat > conftest.$ac_ext <<EOF -#line 2601 "configure" -#include "confdefs.h" - -#include <sys/types.h> -#include <sys/socket.h> - -int main() { - int X = AF_INET6 ; -; return 0; } -EOF -if { (eval echo configure:2611: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ftp_cv_HAVE_AF_INET6=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ftp_cv_HAVE_AF_INET6=no fi -rm -f conftest* - +{ echo "$as_me:$LINENO: checking whether optarg is declared" >&5 +echo $ECHO_N "checking whether optarg is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_optarg+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. */ +$accheck_includes + +int +main () +{ +#ifndef optarg + (void) optarg; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_optarg=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_optarg=no fi -echo "$ac_t""$ftp_cv_HAVE_AF_INET6" 1>&6 - if test "x$ftp_cv_HAVE_AF_INET6" = "xyes"; then - cat >> confdefs.h <<\EOF -#define HAVE_AF_INET6 1 -EOF +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_optarg" >&5 +echo "${ECHO_T}$ac_cv_have_decl_optarg" >&6; } +if test $ac_cv_have_decl_optarg = yes; then - else - - : - fi +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_OPTARG 1 +_ACEOF - - echo $ac_n "checking for struct sockaddr_in6""... $ac_c" 1>&6 -echo "configure:2638: checking for struct sockaddr_in6" >&5 -if eval "test \"`echo '$''{'ftp_cv_HAVE_SOCKADDR_IN6'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 else - - cat > conftest.$ac_ext <<EOF -#line 2644 "configure" -#include "confdefs.h" - -#include <sys/types.h> -#include <netinet/in.h> - -int main() { - - struct sockaddr_in6 X; - int Y = X.sin6_scope_id - ; -; return 0; } -EOF -if { (eval echo configure:2657: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ftp_cv_HAVE_SOCKADDR_IN6=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ftp_cv_HAVE_SOCKADDR_IN6=no + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_OPTARG 0 +_ACEOF + + fi -rm -f conftest* - +{ echo "$as_me:$LINENO: checking whether optind is declared" >&5 +echo $ECHO_N "checking whether optind is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_optind+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. */ +$accheck_includes + +int +main () +{ +#ifndef optind + (void) optind; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_optind=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_optind=no fi -echo "$ac_t""$ftp_cv_HAVE_SOCKADDR_IN6" 1>&6 - if test "x$ftp_cv_HAVE_SOCKADDR_IN6" = "xyes"; then - cat >> confdefs.h <<\EOF -#define HAVE_SOCKADDR_IN6 1 -EOF +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_optind" >&5 +echo "${ECHO_T}$ac_cv_have_decl_optind" >&6; } +if test $ac_cv_have_decl_optind = yes; then - else - - : - fi +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_OPTIND 1 +_ACEOF - if test $ac_cv_header_arpa_nameser_h = yes; then - - echo $ac_n "checking for NS_IN6ADDRSZ in arpa/nameser.h""... $ac_c" 1>&6 -echo "configure:2685: checking for NS_IN6ADDRSZ in arpa/nameser.h" >&5 -if eval "test \"`echo '$''{'ftp_cv_HAVE_NS_IN6ADDRSZ'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 else - - cat > conftest.$ac_ext <<EOF -#line 2691 "configure" -#include "confdefs.h" - -#include <sys/types.h> -#include <arpa/nameser.h> - -int main() { - int X = NS_IN6ADDRSZ ; -; return 0; } -EOF -if { (eval echo configure:2701: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ftp_cv_HAVE_NS_IN6ADDRSZ=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ftp_cv_HAVE_NS_IN6ADDRSZ=no + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_OPTIND 0 +_ACEOF + + fi -rm -f conftest* - -fi - -echo "$ac_t""$ftp_cv_HAVE_NS_IN6ADDRSZ" 1>&6 - if test "x$ftp_cv_HAVE_NS_IN6ADDRSZ" = "xyes"; then - cat >> confdefs.h <<\EOF -#define HAVE_NS_IN6ADDRSZ 1 -EOF - - else - - : - fi - fi + + { echo "$as_me:$LINENO: checking for long double" >&5 +echo $ECHO_N "checking for long double... $ECHO_C" >&6; } +if test "${ac_cv_type_long_double+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$GCC" = yes; then + ac_cv_type_long_double=yes + else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* The Stardent Vistra knows sizeof (long double), but does + not support it. */ + long double foo = 0.0L; +int +main () +{ +static int test_array [1 - 2 * !(/* On Ultrix 4.3 cc, long double is 4 and double is 8. */ + sizeof (double) <= sizeof (long double))]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_long_double=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_long_double=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_long_double" >&5 +echo "${ECHO_T}$ac_cv_type_long_double" >&6; } + if test $ac_cv_type_long_double = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_LONG_DOUBLE 1 +_ACEOF + + fi + + + { echo "$as_me:$LINENO: checking for long long int" >&5 +echo $ECHO_N "checking for long long int... $ECHO_C" >&6; } +if test "${ac_cv_type_long_long_int+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +long long int ll = 9223372036854775807ll; + long long int nll = -9223372036854775807LL; + typedef int a[((-9223372036854775807LL < 0 + && 0 < 9223372036854775807ll) + ? 1 : -1)]; + int i = 63; +int +main () +{ +long long int llmax = 9223372036854775807ll; + return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) + | (llmax / ll) | (llmax % ll)); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + if test "$cross_compiling" = yes; then + ac_cv_type_long_long_int=yes +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <limits.h> + #ifndef LLONG_MAX + # define HALF \ + (1LL << (sizeof (long long int) * CHAR_BIT - 2)) + # define LLONG_MAX (HALF - 1 + HALF) + #endif +int +main () +{ +long long int n = 1; + int i; + for (i = 0; ; i++) + { + long long int m = n << i; + if (m >> i != n) + return 1; + if (LLONG_MAX / 2 < m) + break; + } + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_long_long_int=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_type_long_long_int=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - echo $ac_n "checking for struct addrinfo""... $ac_c" 1>&6 -echo "configure:2731: checking for struct addrinfo" >&5 -if eval "test \"`echo '$''{'ftp_cv_HAVE_ADDRINFO'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 else - - cat > conftest.$ac_ext <<EOF -#line 2737 "configure" -#include "confdefs.h" - -#include <sys/types.h> -#include <sys/socket.h> -#include <netdb.h> - -int main() { - struct addrinfo X ; -; return 0; } -EOF -if { (eval echo configure:2748: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ftp_cv_HAVE_ADDRINFO=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ftp_cv_HAVE_ADDRINFO=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_long_long_int=no fi -rm -f conftest* - + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_long_long_int" >&5 +echo "${ECHO_T}$ac_cv_type_long_long_int" >&6; } + if test $ac_cv_type_long_long_int = yes; then -echo "$ac_t""$ftp_cv_HAVE_ADDRINFO" 1>&6 - if test "x$ftp_cv_HAVE_ADDRINFO" = "xyes"; then - cat >> confdefs.h <<\EOF -#define HAVE_ADDRINFO 1 -EOF +cat >>confdefs.h <<\_ACEOF +#define HAVE_LONG_LONG_INT 1 +_ACEOF - else - - : - fi + fi +# On IRIX 5.3, sys/types and inttypes.h are conflicting. - echo $ac_n "checking for d_namlen in struct dirent""... $ac_c" 1>&6 -echo "configure:2775: checking for d_namlen in struct dirent" >&5 -if eval "test \"`echo '$''{'ftp_cv_HAVE_D_NAMLEN'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - - cat > conftest.$ac_ext <<EOF -#line 2781 "configure" -#include "confdefs.h" - -#if HAVE_DIRENT_H -# include <dirent.h> -#else -# define dirent direct -# if HAVE_SYS_NDIR_H -# include <sys/ndir.h> -# endif -# if HAVE_SYS_DIR_H -# include <sys/dir.h> -# endif -# if HAVE_NDIR_H -# include <ndir.h> -# endif -#endif - -int main() { - - struct dirent dp; - int X = dp.d_namlen; - ; -; return 0; } -EOF -if { (eval echo configure:2806: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ftp_cv_HAVE_D_NAMLEN=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ftp_cv_HAVE_D_NAMLEN=no -fi -rm -f conftest* - + + + + + + + +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 { as_var=$as_ac_Header; eval "test \"\${$as_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. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_Header=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&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 -echo "$ac_t""$ftp_cv_HAVE_D_NAMLEN" 1>&6 - if test "x$ftp_cv_HAVE_D_NAMLEN" = "xyes"; then - cat >> confdefs.h <<\EOF -#define HAVE_D_NAMLEN 1 -EOF +done - else - - : - fi + { echo "$as_me:$LINENO: checking for uint32_t" >&5 +echo $ECHO_N "checking for uint32_t... $ECHO_C" >&6; } +if test "${ac_cv_c_uint32_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_c_uint32_t=no + for ac_type in 'uint32_t' 'unsigned int' 'unsigned long int' \ + 'unsigned long long int' 'unsigned short int' 'unsigned char'; 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 * !(($ac_type) -1 >> (32 - 1) == 1)]; +test_array [0] = 0 + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + case $ac_type in + uint32_t) ac_cv_c_uint32_t=yes ;; + *) ac_cv_c_uint32_t=$ac_type ;; +esac + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test "$ac_cv_c_uint32_t" != no && break + done +fi +{ echo "$as_me:$LINENO: result: $ac_cv_c_uint32_t" >&5 +echo "${ECHO_T}$ac_cv_c_uint32_t" >&6; } + case $ac_cv_c_uint32_t in #( + no|yes) ;; #( + *) + +cat >>confdefs.h <<\_ACEOF +#define _UINT32_T 1 +_ACEOF + - echo $ac_n "checking for h_errno declaration""... $ac_c" 1>&6 -echo "configure:2833: checking for h_errno declaration" >&5 -if eval "test \"`echo '$''{'ftp_cv_HAVE_H_ERRNO_D'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +cat >>confdefs.h <<_ACEOF +#define uint32_t $ac_cv_c_uint32_t +_ACEOF +;; + esac + +{ 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 +typedef off_t ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_off_t=yes else - - cat > conftest.$ac_ext <<EOF -#line 2839 "configure" -#include "confdefs.h" - -#include <netdb.h> - -int main() { - int X = h_errno ; -; return 0; } -EOF -if { (eval echo configure:2848: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ftp_cv_HAVE_H_ERRNO_D=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ftp_cv_HAVE_H_ERRNO_D=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_off_t=no fi -rm -f conftest* - + +rm -f core 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 -echo "$ac_t""$ftp_cv_HAVE_H_ERRNO_D" 1>&6 - if test "x$ftp_cv_HAVE_H_ERRNO_D" = "xyes"; then - cat >> confdefs.h <<\EOF -#define HAVE_H_ERRNO_D 1 -EOF +cat >>confdefs.h <<_ACEOF +#define off_t long int +_ACEOF - else - - : - fi +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 +typedef pid_t ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_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 core 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 - echo $ac_n "checking for dirname() declaration""... $ac_c" 1>&6 -echo "configure:2875: checking for dirname() declaration" >&5 -if eval "test \"`echo '$''{'ftp_cv_HAVE_DIRNAME_D'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - - cat > conftest.$ac_ext <<EOF -#line 2881 "configure" -#include "confdefs.h" - -#include <libgen.h> - -int main() { - char *(*X)() = dirname ; -; return 0; } -EOF -if { (eval echo configure:2890: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ftp_cv_HAVE_DIRNAME_D=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ftp_cv_HAVE_DIRNAME_D=no -fi -rm -f conftest* - fi -echo "$ac_t""$ftp_cv_HAVE_DIRNAME_D" 1>&6 - if test "x$ftp_cv_HAVE_DIRNAME_D" = "xyes"; then - cat >> confdefs.h <<\EOF -#define HAVE_DIRNAME_D 1 -EOF +{ 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 <sys/types.h> +#include <signal.h> - else - - : - fi +int +main () +{ +return *(signal (0, 0)) (0) == 1; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_signal=int +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_signal=void +fi + +rm -f core 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 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 +typedef size_t ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_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 core 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 int +_ACEOF +fi - echo $ac_n "checking for fclose() declaration""... $ac_c" 1>&6 -echo "configure:2917: checking for fclose() declaration" >&5 -if eval "test \"`echo '$''{'ftp_cv_HAVE_FCLOSE_D'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +{ echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5 +echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6; } +if test "${ac_cv_struct_tm+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - - cat > conftest.$ac_ext <<EOF -#line 2923 "configure" -#include "confdefs.h" - -#include <stdio.h> - -int main() { - int (*X)() = fclose ; -; return 0; } -EOF -if { (eval echo configure:2932: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ftp_cv_HAVE_FCLOSE_D=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ftp_cv_HAVE_FCLOSE_D=no + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <sys/types.h> +#include <time.h> + +int +main () +{ +struct tm tm; + int *p = &tm.tm_sec; + return !p; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_struct_tm=time.h +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_struct_tm=sys/time.h +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5 +echo "${ECHO_T}$ac_cv_struct_tm" >&6; } +if test $ac_cv_struct_tm = sys/time.h; then + +cat >>confdefs.h <<\_ACEOF +#define TM_IN_SYS_TIME 1 +_ACEOF + +fi + +{ 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. */ +$accheck_includes + +int +main () +{ +static struct sockaddr ac_aggr; +if (ac_aggr.sa_len) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_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. */ +$accheck_includes + +int +main () +{ +static struct sockaddr ac_aggr; +if (sizeof ac_aggr.sa_len) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_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 core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core 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_STRUCT_SOCKADDR_SA_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. */ +$accheck_includes + +int +main () +{ +static struct sockaddr_in ac_aggr; +if (ac_aggr.sin_len) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_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. */ +$accheck_includes + +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 { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_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 core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core 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_STRUCT_SOCKADDR_IN_SIN_LEN 1 +_ACEOF + + +fi +{ echo "$as_me:$LINENO: checking for struct dirent.d_namlen" >&5 +echo $ECHO_N "checking for struct dirent.d_namlen... $ECHO_C" >&6; } +if test "${ac_cv_member_struct_dirent_d_namlen+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. */ +$accheck_includes + +int +main () +{ +static struct dirent ac_aggr; +if (ac_aggr.d_namlen) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_member_struct_dirent_d_namlen=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. */ +$accheck_includes + +int +main () +{ +static struct dirent ac_aggr; +if (sizeof ac_aggr.d_namlen) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_member_struct_dirent_d_namlen=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_member_struct_dirent_d_namlen=no fi -rm -f conftest* - + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$ac_t""$ftp_cv_HAVE_FCLOSE_D" 1>&6 - if test "x$ftp_cv_HAVE_FCLOSE_D" = "xyes"; then - cat >> confdefs.h <<\EOF -#define HAVE_FCLOSE_D 1 -EOF +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_dirent_d_namlen" >&5 +echo "${ECHO_T}$ac_cv_member_struct_dirent_d_namlen" >&6; } +if test $ac_cv_member_struct_dirent_d_namlen = yes; then - else - - : - fi +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_DIRENT_D_NAMLEN 1 +_ACEOF +fi - echo $ac_n "checking for getpass() declaration""... $ac_c" 1>&6 -echo "configure:2959: checking for getpass() declaration" >&5 -if eval "test \"`echo '$''{'ftp_cv_HAVE_GETPASS_D'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +{ echo "$as_me:$LINENO: checking for in_port_t" >&5 +echo $ECHO_N "checking for in_port_t... $ECHO_C" >&6; } +if test "${ac_cv_type_in_port_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - - cat > conftest.$ac_ext <<EOF -#line 2965 "configure" -#include "confdefs.h" - -#include <stdlib.h> -#include <unistd.h> - -int main() { - char *(*X)() = getpass ; -; return 0; } -EOF -if { (eval echo configure:2975: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ftp_cv_HAVE_GETPASS_D=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ftp_cv_HAVE_GETPASS_D=no -fi -rm -f conftest* - + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$accheck_includes + +typedef in_port_t ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_in_port_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_in_port_t=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_in_port_t" >&5 +echo "${ECHO_T}$ac_cv_type_in_port_t" >&6; } +if test $ac_cv_type_in_port_t = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_IN_PORT_T 1 +_ACEOF + + fi +{ echo "$as_me:$LINENO: checking for sa_family_t" >&5 +echo $ECHO_N "checking for sa_family_t... $ECHO_C" >&6; } +if test "${ac_cv_type_sa_family_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. */ +$accheck_includes -echo "$ac_t""$ftp_cv_HAVE_GETPASS_D" 1>&6 - if test "x$ftp_cv_HAVE_GETPASS_D" = "xyes"; then - cat >> confdefs.h <<\EOF -#define HAVE_GETPASS_D 1 -EOF +typedef sa_family_t ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_sa_family_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_sa_family_t=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_sa_family_t" >&5 +echo "${ECHO_T}$ac_cv_type_sa_family_t" >&6; } +if test $ac_cv_type_sa_family_t = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_SA_FAMILY_T 1 +_ACEOF - else - - : - fi +fi +{ echo "$as_me:$LINENO: checking for socklen_t" >&5 +echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6; } +if test "${ac_cv_type_socklen_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$accheck_includes + +typedef socklen_t ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_socklen_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_socklen_t=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5 +echo "${ECHO_T}$ac_cv_type_socklen_t" >&6; } +if test $ac_cv_type_socklen_t = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_SOCKLEN_T 1 +_ACEOF - echo $ac_n "checking for optarg declaration""... $ac_c" 1>&6 -echo "configure:3002: checking for optarg declaration" >&5 -if eval "test \"`echo '$''{'ftp_cv_HAVE_OPTARG_D'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +fi +{ echo "$as_me:$LINENO: checking for struct addrinfo" >&5 +echo $ECHO_N "checking for struct addrinfo... $ECHO_C" >&6; } +if test "${ac_cv_type_struct_addrinfo+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - - cat > conftest.$ac_ext <<EOF -#line 3008 "configure" -#include "confdefs.h" - -#include <stdlib.h> -#include <unistd.h> - -int main() { - char *X = optarg ; -; return 0; } -EOF -if { (eval echo configure:3018: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ftp_cv_HAVE_OPTARG_D=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ftp_cv_HAVE_OPTARG_D=no + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$accheck_includes + +typedef struct addrinfo ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_struct_addrinfo=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_struct_addrinfo=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_struct_addrinfo" >&5 +echo "${ECHO_T}$ac_cv_type_struct_addrinfo" >&6; } +if test $ac_cv_type_struct_addrinfo = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_ADDRINFO 1 +_ACEOF + + +fi + +# Check whether --enable-largefile was given. +if test "${enable_largefile+set}" = set; then + enableval=$enable_largefile; +fi + +if test "$enable_largefile" != no; then + + { echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 +echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6; } +if test "${ac_cv_sys_largefile_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + ac_save_CC=$CC + while :; do + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <sys/types.h> + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext + CC="$CC -n32" + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_largefile_CC=' -n32'; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core 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 + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <sys/types.h> + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_file_offset_bits=no; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#define _FILE_OFFSET_BITS 64 +#include <sys/types.h> + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_file_offset_bits=64; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_file_offset_bits=unknown + 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; } +case $ac_cv_sys_file_offset_bits in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits +_ACEOF +;; +esac rm -f conftest* - + if test $ac_cv_sys_file_offset_bits = unknown; then + { 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 + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <sys/types.h> + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_large_files=no; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#define _LARGE_FILES 1 +#include <sys/types.h> + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_large_files=1; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_large_files=unknown + break +done +fi +{ echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 +echo "${ECHO_T}$ac_cv_sys_large_files" >&6; } +case $ac_cv_sys_large_files in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _LARGE_FILES $ac_cv_sys_large_files +_ACEOF +;; +esac +rm -f conftest* + fi fi -echo "$ac_t""$ftp_cv_HAVE_OPTARG_D" 1>&6 - if test "x$ftp_cv_HAVE_OPTARG_D" = "xyes"; then - cat >> confdefs.h <<\EOF -#define HAVE_OPTARG_D 1 -EOF - else - - : - fi +# If IPv6 is enabled, check for necessary items. +# +if test "$opt_ipv6" = yes; then + { echo "$as_me:$LINENO: checking whether AF_INET6 is declared" >&5 +echo $ECHO_N "checking whether AF_INET6 is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_AF_INET6+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. */ +$accheck_includes +#if defined(HAVE_ARPA_NAMESER_H) +#include <arpa/nameser.h> +#endif + + +int +main () +{ +#ifndef AF_INET6 + (void) AF_INET6; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_AF_INET6=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_AF_INET6=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_AF_INET6" >&5 +echo "${ECHO_T}$ac_cv_have_decl_AF_INET6" >&6; } +if test $ac_cv_have_decl_AF_INET6 = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_AF_INET6 1 +_ACEOF + + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_AF_INET6 0 +_ACEOF + + +fi +{ echo "$as_me:$LINENO: checking whether NS_IN6ADDRSZ is declared" >&5 +echo $ECHO_N "checking whether NS_IN6ADDRSZ is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_NS_IN6ADDRSZ+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. */ +$accheck_includes +#if defined(HAVE_ARPA_NAMESER_H) +#include <arpa/nameser.h> +#endif +int +main () +{ +#ifndef NS_IN6ADDRSZ + (void) NS_IN6ADDRSZ; +#endif - echo $ac_n "checking for optind declaration""... $ac_c" 1>&6 -echo "configure:3045: checking for optind declaration" >&5 -if eval "test \"`echo '$''{'ftp_cv_HAVE_OPTIND_D'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_NS_IN6ADDRSZ=yes else - - cat > conftest.$ac_ext <<EOF -#line 3051 "configure" -#include "confdefs.h" - -#include <stdlib.h> -#include <unistd.h> - -int main() { - int X = optind ; -; return 0; } -EOF -if { (eval echo configure:3061: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ftp_cv_HAVE_OPTIND_D=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ftp_cv_HAVE_OPTIND_D=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_NS_IN6ADDRSZ=no fi -rm -f conftest* - + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_NS_IN6ADDRSZ" >&5 +echo "${ECHO_T}$ac_cv_have_decl_NS_IN6ADDRSZ" >&6; } +if test $ac_cv_have_decl_NS_IN6ADDRSZ = yes; then -echo "$ac_t""$ftp_cv_HAVE_OPTIND_D" 1>&6 - if test "x$ftp_cv_HAVE_OPTIND_D" = "xyes"; then - cat >> confdefs.h <<\EOF -#define HAVE_OPTIND_D 1 -EOF +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_NS_IN6ADDRSZ 1 +_ACEOF - else - - : - fi + +else + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_NS_IN6ADDRSZ 0 +_ACEOF + + +fi + { echo "$as_me:$LINENO: checking for struct sockaddr_in6" >&5 +echo $ECHO_N "checking for struct sockaddr_in6... $ECHO_C" >&6; } +if test "${ac_cv_type_struct_sockaddr_in6+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. */ +$accheck_includes - echo $ac_n "checking for pclose() declaration""... $ac_c" 1>&6 -echo "configure:3088: checking for pclose() declaration" >&5 -if eval "test \"`echo '$''{'ftp_cv_HAVE_PCLOSE_D'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +typedef struct sockaddr_in6 ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_struct_sockaddr_in6=yes else - - cat > conftest.$ac_ext <<EOF -#line 3094 "configure" -#include "confdefs.h" - -#include <stdio.h> - -int main() { - int (*X)() = pclose ; -; return 0; } -EOF -if { (eval echo configure:3103: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ftp_cv_HAVE_PCLOSE_D=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ftp_cv_HAVE_PCLOSE_D=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_struct_sockaddr_in6=no fi -rm -f conftest* - + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_struct_sockaddr_in6" >&5 +echo "${ECHO_T}$ac_cv_type_struct_sockaddr_in6" >&6; } +if test $ac_cv_type_struct_sockaddr_in6 = yes; then -echo "$ac_t""$ftp_cv_HAVE_PCLOSE_D" 1>&6 - if test "x$ftp_cv_HAVE_PCLOSE_D" = "xyes"; then - cat >> confdefs.h <<\EOF -#define HAVE_PCLOSE_D 1 -EOF +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_SOCKADDR_IN6 1 +_ACEOF - else - - : - fi +fi + +fi -for ac_func in dirname err fgetln fparseln fseeko getaddrinfo getnameinfo \ - inet_ntop inet_pton mkstemp setprogname sl_init snprintf \ - strdup strerror strlcat strlcpy strptime strsep strunvis \ - strvis timegm usleep utimes -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3135: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 3140 "configure" -#include "confdefs.h" +# +# Checks for library functions. +# +#XXX remove alloca use +# 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 <alloca.h> +int +main () +{ +char *p = (char *) alloca (2 * sizeof (int)); + if (p) return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + 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 <malloc.h> +# define alloca _alloca +# else +# ifdef HAVE_ALLOCA_H +# include <alloca.h> +# else +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca /* predefined by HP cc +Olibcalls */ +char *alloca (); +# endif +# endif +# endif +# endif +#endif + +int +main () +{ +char *p = (char *) alloca (1); + if (p) return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + 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=\${LIBOBJDIR}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 { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. + For example, HP-UX 11i <limits.h> declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include <assert.h> -/* Override any gcc2 internal prototype to avoid an error. */ -/* 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(); + which can conflict with char $ac_func (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ -int main() { +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + +#undef $ac_func +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -$ac_func(); #endif -; return 0; } -EOF -if { (eval echo configure:3163: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&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 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" + 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. */ +$ac_includes_default +int +find_stack_direction () +{ + static char *addr = 0; + auto char dummy; + if (addr == 0) + { + addr = &dummy; + return find_stack_direction (); + } + else + return (&dummy > addr) ? 1 : -1; +} + +int +main () +{ + return find_stack_direction () < 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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 conftest* +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <<EOF -#define $ac_tr_func 1 -EOF - + +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 + +{ echo "$as_me:$LINENO: checking whether closedir returns void" >&5 +echo $ECHO_N "checking whether closedir returns void... $ECHO_C" >&6; } +if test "${ac_cv_func_closedir_void+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_closedir_void=yes +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header_dirent> +#ifndef __cplusplus +int closedir (); +#endif + +int +main () +{ +return closedir (opendir (".")) != 0; + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_closedir_void=no else - echo "$ac_t""no" 1>&6 -LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}" + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_func_closedir_void=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_closedir_void" >&5 +echo "${ECHO_T}$ac_cv_func_closedir_void" >&6; } +if test $ac_cv_func_closedir_void = yes; then + +cat >>confdefs.h <<\_ACEOF +#define CLOSEDIR_VOID 1 +_ACEOF + +fi + + +for ac_header in vfork.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&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 { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ 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 { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + 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 lukem@NetBSD.org ## +## ------------------------------- ## +_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 { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + fi + done -for ac_func in gethostbyname2 getpassphrase getpgrp memmove select + +for ac_func in fork vfork do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3192: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 3197 "configure" -#include "confdefs.h" +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 { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. + For example, HP-UX 11i <limits.h> declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include <assert.h> -/* Override any gcc2 internal prototype to avoid an error. */ -/* 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(); + which can conflict with char $ac_func (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ -int main() { +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -$ac_func(); #endif -; return 0; } -EOF -if { (eval echo configure:3220: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <<EOF -#define $ac_tr_func 1 -EOF - -else - echo "$ac_t""no" 1>&6 fi done -if test $ac_cv_func_getpgrp = yes; then - echo $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>&6 -echo "configure:3246: checking whether getpgrp takes no argument" >&5 -if eval "test \"`echo '$''{'ac_cv_func_getpgrp_void'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +if test "x$ac_cv_func_fork" = xyes; then + { echo "$as_me:$LINENO: checking for working fork" >&5 +echo $ECHO_N "checking for working fork... $ECHO_C" >&6; } +if test "${ac_cv_func_fork_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then - { echo "configure: error: cannot check getpgrp if cross compiling" 1>&2; exit 1; } -else - cat > conftest.$ac_ext <<EOF -#line 3254 "configure" -#include "confdefs.h" - -/* - * If this system has a BSD-style getpgrp(), - * which takes a pid argument, exit unsuccessfully. - * - * Snarfed from Chet Ramey's bash pgrp.c test program - */ -#include <stdio.h> -#include <sys/types.h> + ac_cv_func_fork_works=cross +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 () +{ -int pid; -int pg1, pg2, pg3, pg4; -int ng, np, s, child; + /* By Ruediger Kuhlmann. */ + return fork () < 0; -main() + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_fork_works=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_fork_works=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_fork_works" >&5 +echo "${ECHO_T}$ac_cv_func_fork_works" >&6; } + +else + ac_cv_func_fork_works=$ac_cv_func_fork +fi +if test "x$ac_cv_func_fork_works" = xcross; then + case $host in + *-*-amigaos* | *-*-msdosdjgpp*) + # Override, as these systems have only a dummy fork() stub + ac_cv_func_fork_works=no + ;; + *) + ac_cv_func_fork_works=yes + ;; + esac + { echo "$as_me:$LINENO: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&5 +echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross compilation" >&2;} +fi +ac_cv_func_vfork_works=$ac_cv_func_vfork +if test "x$ac_cv_func_vfork" = xyes; then + { echo "$as_me:$LINENO: checking for working vfork" >&5 +echo $ECHO_N "checking for working vfork... $ECHO_C" >&6; } +if test "${ac_cv_func_vfork_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_vfork_works=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 Paul Eggert for this test. */ +$ac_includes_default +#include <sys/wait.h> +#ifdef HAVE_VFORK_H +# include <vfork.h> +#endif +/* On some sparc systems, changes by the child to local and incoming + argument registers are propagated back to the parent. The compiler + is told about this with #include <vfork.h>, but some compilers + (e.g. gcc -O) don't grok <vfork.h>. Test for this by using a + static variable whose address is put into a register that is + clobbered by the vfork. */ +static void +#ifdef __cplusplus +sparc_address_test (int arg) +# else +sparc_address_test (arg) int arg; +#endif { - pid = getpid(); - pg1 = getpgrp(0); - pg2 = getpgrp(); - pg3 = getpgrp(pid); - pg4 = getpgrp(1); - - /* - * If all of these values are the same, it's pretty sure that - * we're on a system that ignores getpgrp's first argument. - */ - if (pg2 == pg4 && pg1 == pg3 && pg2 == pg3) - exit(0); - - child = fork(); - if (child < 0) - exit(1); - else if (child == 0) { - np = getpid(); - /* - * If this is Sys V, this will not work; pgrp will be - * set to np because setpgrp just changes a pgrp to be - * the same as the pid. - */ - setpgrp(np, pg1); - ng = getpgrp(0); /* Same result for Sys V and BSD */ - if (ng == pg1) { - exit(1); - } else { - exit(0); - } - } else { - wait(&s); - exit(s>>8); - } + static pid_t child; + if (!child) { + child = vfork (); + if (child < 0) { + perror ("vfork"); + _exit(2); + } + if (!child) { + arg = getpid(); + write(-1, "", 0); + _exit (arg); + } + } } -EOF -if { (eval echo configure:3309: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - ac_cv_func_getpgrp_void=yes +int +main () +{ + pid_t parent = getpid (); + pid_t child; + + sparc_address_test (0); + + child = vfork (); + + if (child == 0) { + /* Here is another test for sparc vfork register problems. This + test uses lots of local variables, at least as many local + variables as main has allocated so far including compiler + temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris + 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should + reuse the register of parent for one of the local variables, + since it will think that parent can't possibly be used any more + in this routine. Assigning to the local variable will thus + munge parent in the parent process. */ + pid_t + p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), + p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); + /* Convince the compiler that p..p7 are live; otherwise, it might + use the same hardware register for all 8 local variables. */ + if (p != p1 || p != p2 || p != p3 || p != p4 + || p != p5 || p != p6 || p != p7) + _exit(1); + + /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent + from child file descriptors. If the child closes a descriptor + before it execs or exits, this munges the parent's descriptor + as well. Test for this by closing stdout in the child. */ + _exit(close(fileno(stdout)) != 0); + } else { + int status; + struct stat st; + + while (wait(&status) != child) + ; + return ( + /* Was there some problem with vforking? */ + child < 0 + + /* Did the child fail? (This shouldn't happen.) */ + || status + + /* Did the vfork/compiler bug occur? */ + || parent != getpid() + + /* Did the file descriptor bug occur? */ + || fstat(fileno(stdout), &st) != 0 + ); + } +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_vfork_works=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - ac_cv_func_getpgrp_void=no + 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_vfork_works=no fi -rm -fr conftest* +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_vfork_works" >&5 +echo "${ECHO_T}$ac_cv_func_vfork_works" >&6; } -echo "$ac_t""$ac_cv_func_getpgrp_void" 1>&6 -if test $ac_cv_func_getpgrp_void = yes; then - cat >> confdefs.h <<\EOF -#define GETPGRP_VOID 1 -EOF - +fi; +if test "x$ac_cv_func_fork_works" = xcross; then + ac_cv_func_vfork_works=$ac_cv_func_vfork + { echo "$as_me:$LINENO: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5 +echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;} fi -fi +if test "x$ac_cv_func_vfork_works" = xyes; then -LIBOBJS="$LIBOBJS glob.o" +cat >>confdefs.h <<\_ACEOF +#define HAVE_WORKING_VFORK 1 +_ACEOF -if test $ac_cv_func_strptime = yes; then - - echo $ac_n "checking for strptime() declaration""... $ac_c" 1>&6 -echo "configure:3339: checking for strptime() declaration" >&5 -if eval "test \"`echo '$''{'ftp_cv_HAVE_STRPTIME_D'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 else - - cat > conftest.$ac_ext <<EOF -#line 3345 "configure" -#include "confdefs.h" - -#include <time.h> - -int main() { - - char *X = strptime("", "", NULL) - ; -; return 0; } -EOF -if { (eval echo configure:3356: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ftp_cv_HAVE_STRPTIME_D=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ftp_cv_HAVE_STRPTIME_D=no -fi -rm -f conftest* - + +cat >>confdefs.h <<\_ACEOF +#define vfork fork +_ACEOF + fi +if test "x$ac_cv_func_fork_works" = xyes; then -echo "$ac_t""$ftp_cv_HAVE_STRPTIME_D" 1>&6 - if test "x$ftp_cv_HAVE_STRPTIME_D" = "xyes"; then - cat >> confdefs.h <<\EOF -#define HAVE_STRPTIME_D 1 -EOF +cat >>confdefs.h <<\_ACEOF +#define HAVE_WORKING_FORK 1 +_ACEOF - else - - : - fi +fi +{ echo "$as_me:$LINENO: checking for _LARGEFILE_SOURCE value needed for large files" >&5 +echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6; } +if test "${ac_cv_sys_largefile_source+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <stdio.h> +int +main () +{ +return fseeko (stdin, 0, 0) && (fseeko) (stdin, 0, 0); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_sys_largefile_source=no; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext 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 _LARGEFILE_SOURCE 1 +#include <stdio.h> +int +main () +{ +return fseeko (stdin, 0, 0) && (fseeko) (stdin, 0, 0); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_sys_largefile_source=1; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + ac_cv_sys_largefile_source=unknown + break +done fi +{ echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_source" >&5 +echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6; } +case $ac_cv_sys_largefile_source in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source +_ACEOF +;; +esac +rm -f conftest* -if test $have_long_long = yes -a $ac_cv_sizeof_off_t -ge 8; then +# We used to try defining _XOPEN_SOURCE=500 too, to work around a bug +# in glibc 2.1.3, but that breaks too many other things. +# If you want fseeko and ftello with glibc, upgrade to a fixed glibc. +if test $ac_cv_sys_largefile_source != unknown; then +cat >>confdefs.h <<\_ACEOF +#define HAVE_FSEEKO 1 +_ACEOF - echo $ac_n "checking *printf() support for %lld""... $ac_c" 1>&6 -echo "configure:3386: checking *printf() support for %lld" >&5 - can_printf_longlong=no - if test "$cross_compiling" = yes; then - : -else - cat > conftest.$ac_ext <<EOF -#line 3392 "configure" -#include "confdefs.h" +fi -#include <stdio.h> -int main() { - char buf[100]; - sprintf(buf, "%lld", 4294967300LL); - return (strcmp(buf, "4294967300")); +{ echo "$as_me:$LINENO: checking for working strcoll" >&5 +echo $ECHO_N "checking for working strcoll... $ECHO_C" >&6; } +if test "${ac_cv_func_strcoll_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_strcoll_works=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 () +{ +return (strcoll ("abc", "def") >= 0 || + strcoll ("ABC", "DEF") >= 0 || + strcoll ("123", "456") >= 0) + ; + return 0; } - -EOF -if { (eval echo configure:3403: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - - echo "$ac_t""yes" 1>&6 - can_printf_longlong=yes - +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_strcoll_works=yes else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - - echo "$ac_t""no" 1>&6 - + 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_strcoll_works=no fi -rm -fr conftest* +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - if test $can_printf_longlong != yes; then - echo $ac_n "checking *printf() support for %qd""... $ac_c" 1>&6 -echo "configure:3423: checking *printf() support for %qd" >&5 - if test "$cross_compiling" = yes; then - : -else - cat > conftest.$ac_ext <<EOF -#line 3428 "configure" -#include "confdefs.h" +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_strcoll_works" >&5 +echo "${ECHO_T}$ac_cv_func_strcoll_works" >&6; } +if test $ac_cv_func_strcoll_works = yes; then -#include <stdio.h> -int main() { - char buf[100]; - sprintf(buf, "%qd", 4294967300LL); - return (strcmp(buf, "4294967300")); -} - -EOF -if { (eval echo configure:3439: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -then - - echo "$ac_t""yes" 1>&6 - can_printf_longlong=yes - cat >> confdefs.h <<\EOF -#define HAVE_PRINTF_QD 1 -EOF +cat >>confdefs.h <<\_ACEOF +#define HAVE_STRCOLL 1 +_ACEOF - -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -fr conftest* - - echo "$ac_t""no" 1>&6 - -fi -rm -fr conftest* fi - fi - if test $can_printf_longlong = yes; then - cat >> confdefs.h <<\EOF -#define HAVE_QUAD_SUPPORT 1 -EOF - for ac_func in strtoll + + + + + + + + + + + + + + + + + + + + +for ac_func in dirname err fgetln getaddrinfo getnameinfo \ + inet_ntop inet_pton mkstemp setprogname sl_init snprintf \ + strdup strerror strlcat strlcpy strptime strsep strunvis \ + strvis timegm usleep utimes do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3470: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 3475 "configure" -#include "confdefs.h" +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 { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. + For example, HP-UX 11i <limits.h> declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func(); below. */ -#include <assert.h> -/* Override any gcc2 internal prototype to avoid an error. */ -/* 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(); + which can conflict with char $ac_func (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ -int main() { +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -$ac_func(); #endif -; return 0; } -EOF -if { (eval echo configure:3498: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +else + case " $LIBOBJS " in + *" $ac_func.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" + ;; +esac -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <<EOF -#define $ac_tr_func 1 -EOF - -else - echo "$ac_t""no" 1>&6 -LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}" fi done - fi -fi -if test $ac_cv_header_poll_h = yes || test $ac_cv_header_sys_poll_h = yes; then - echo $ac_n "checking for poll""... $ac_c" 1>&6 -echo "configure:3530: checking for poll" >&5 -if eval "test \"`echo '$''{'ac_cv_func_poll'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext <<EOF -#line 3535 "configure" -#include "confdefs.h" + + + + + + + + + + + + + + + + + + + + + + + + + + + + +for ac_func in getcwd gethostbyaddr gethostbyname gethostbyname2 gethostname \ + getpass getpassphrase getpgrp gettimeofday isascii \ + memchr memmove memset realpath regcomp \ + select setlocale socket strcasecmp strchr strcspn strdup \ + strerror strncasecmp strpbrk strrchr strstr strtol strtoul \ + utime +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 { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. + For example, HP-UX 11i <limits.h> declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char poll(); below. */ -#include <assert.h> -/* Override any gcc2 internal prototype to avoid an error. */ -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ -char poll(); + which can conflict with char $ac_func (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ -int main() { +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + +#undef $ac_func +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_poll) || defined (__stub___poll) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -poll(); #endif -; return 0; } -EOF -if { (eval echo configure:3558: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_poll=yes" +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&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 "$ac_cv_func_getpgrp" = yes; then + { echo "$as_me:$LINENO: checking whether getpgrp requires zero arguments" >&5 +echo $ECHO_N "checking whether getpgrp requires zero arguments... $ECHO_C" >&6; } +if test "${ac_cv_func_getpgrp_void+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Use it with a single arg. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +getpgrp (0); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_func_getpgrp_void=no else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_poll=no" + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_func_getpgrp_void=yes fi -rm -f conftest* + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_getpgrp_void" >&5 +echo "${ECHO_T}$ac_cv_func_getpgrp_void" >&6; } +if test $ac_cv_func_getpgrp_void = yes; then -if eval "test \"`echo '$ac_cv_func_'poll`\" = yes"; then - echo "$ac_t""yes" 1>&6 - - - echo $ac_n "checking if poll() is implemented natively""... $ac_c" 1>&6 -echo "configure:3575: checking if poll() is implemented natively" >&5 -if eval "test \"`echo '$''{'ftp_cv_POLL_NATIVE'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - - cat > conftest.$ac_ext <<EOF -#line 3581 "configure" -#include "confdefs.h" - -#if HAVE_POLL_H -#include <poll.h> -#endif -#if HAVE_SYS_POLL_H -#include <sys/poll.h> -#endif - -int main() { - -#ifdef _POLL_EMUL_H_ -#error "poll() is emulated" +cat >>confdefs.h <<\_ACEOF +#define GETPGRP_VOID 1 +_ACEOF + +fi + +fi + +if test "$ac_cv_func_strptime" = yes; then + { echo "$as_me:$LINENO: checking whether strptime is declared" >&5 +echo $ECHO_N "checking whether strptime is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_strptime+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +#ifndef strptime + (void) strptime; #endif - ; -; return 0; } -EOF -if { (eval echo configure:3599: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ftp_cv_POLL_NATIVE=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ftp_cv_POLL_NATIVE=no + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_strptime=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_strptime=no fi -rm -f conftest* - + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_strptime" >&5 +echo "${ECHO_T}$ac_cv_have_decl_strptime" >&6; } +if test $ac_cv_have_decl_strptime = yes; then -echo "$ac_t""$ftp_cv_POLL_NATIVE" 1>&6 - if test "x$ftp_cv_POLL_NATIVE" = "xyes"; then - cat >> confdefs.h <<\EOF -#define HAVE_POLL 1 -EOF +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRPTIME 1 +_ACEOF - else - : - : - fi - else - echo "$ac_t""no" 1>&6 + cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_STRPTIME 0 +_ACEOF + + fi +fi + + +# Always replace glob(); the vendor's may not be secure. +# +case " $LIBOBJS " in + *" glob.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS glob.$ac_objext" + ;; +esac + + +# We assume that if sprintf() supports %lld or %qd, +# then all of *printf() does. If not, disable long long +# support because we don't know how to display it. +# +if test "$ac_cv_type_long_long_int" = yes; then + { echo "$as_me:$LINENO: checking *printf() support for %lld" >&5 +echo $ECHO_N "checking *printf() support for %lld... $ECHO_C" >&6; } + can_printf_longlong=no + if test "$cross_compiling" = yes; then + { echo "$as_me:$LINENO: result: unknown - cross-compiling" >&5 +echo "${ECHO_T}unknown - cross-compiling" >&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 <stdio.h> +int main() { + char buf[100]; + sprintf(buf, "%lld", 4294967300LL); + return (strcmp(buf, "4294967300")); +} + +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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; } + can_printf_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 ) +{ echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + + if test "$can_printf_longlong" != yes; then + { echo "$as_me:$LINENO: checking *printf() support for %qd" >&5 +echo $ECHO_N "checking *printf() support for %qd... $ECHO_C" >&6; } + if test "$cross_compiling" = yes; then + { echo "$as_me:$LINENO: result: unknown - cross-compiling" >&5 +echo "${ECHO_T}unknown - cross-compiling" >&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 <stdio.h> +int main() { + char buf[100]; + sprintf(buf, "%qd", 4294967300LL); + return (strcmp(buf, "4294967300")); +} + +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&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; } + can_printf_longlong=yes + cat >>confdefs.h <<\_ACEOF +#define HAVE_PRINTF_QD 1 +_ACEOF - echo $ac_n "checking for struct pollfd""... $ac_c" 1>&6 -echo "configure:3631: checking for struct pollfd" >&5 -if eval "test \"`echo '$''{'ftp_cv_HAVE_STRUCT_POLLFD'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 else - - cat > conftest.$ac_ext <<EOF -#line 3637 "configure" -#include "confdefs.h" - -#if HAVE_POLL_H -#include <poll.h> + 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: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi + + { echo "$as_me:$LINENO: checking if *printf() can print long long ints" >&5 +echo $ECHO_N "checking if *printf() can print long long ints... $ECHO_C" >&6; } + if test "$can_printf_longlong" = yes; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + cat >>confdefs.h <<\_ACEOF +#define HAVE_PRINTF_LONG_LONG 1 +_ACEOF + + +for ac_func in strtoll +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 { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. + For example, HP-UX 11i <limits.h> declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> #endif -#if HAVE_SYS_POLL_H -#include <sys/poll.h> + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" #endif - -int main() { - struct pollfd X ; -; return 0; } -EOF -if { (eval echo configure:3651: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ftp_cv_HAVE_STRUCT_POLLFD=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ftp_cv_HAVE_STRUCT_POLLFD=no +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +else + case " $LIBOBJS " in + *" $ac_func.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" + ;; +esac + fi -rm -f conftest* - +done + + +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + fi -echo "$ac_t""$ftp_cv_HAVE_STRUCT_POLLFD" 1>&6 - if test "x$ftp_cv_HAVE_STRUCT_POLLFD" = "xyes"; then - cat >> confdefs.h <<\EOF + +# Handle Darwin 7 having a poll() compatibility function, +# and don't use it if it's emulated. +# Be conservative, if we don't find one of poll.h or sys/poll.h, +# don't attempt to use poll(). +# +{ echo "$as_me:$LINENO: checking for struct pollfd" >&5 +echo $ECHO_N "checking for struct pollfd... $ECHO_C" >&6; } +if test "${ac_cv_type_struct_pollfd+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. */ +$accheck_includes + +typedef struct pollfd ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_struct_pollfd=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_struct_pollfd=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_struct_pollfd" >&5 +echo "${ECHO_T}$ac_cv_type_struct_pollfd" >&6; } +if test $ac_cv_type_struct_pollfd = yes; then + +cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_POLLFD 1 -EOF +_ACEOF - else - : - : - fi fi +{ echo "$as_me:$LINENO: checking for poll" >&5 +echo $ECHO_N "checking for poll... $ECHO_C" >&6; } +if test "${ac_cv_func_poll+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 poll to an innocuous variant, in case <limits.h> declares poll. + For example, HP-UX 11i <limits.h> declares gettimeofday. */ +#define poll innocuous_poll + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char poll (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + +#undef poll + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char poll (); +/* 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_poll || defined __stub___poll +choke me +#endif + +int +main () +{ +return poll (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_func_poll=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_func_poll=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_func_poll" >&5 +echo "${ECHO_T}$ac_cv_func_poll" >&6; } +if test $ac_cv_func_poll = yes; then + { echo "$as_me:$LINENO: checking whether _POLL_EMUL_H_ is declared" >&5 +echo $ECHO_N "checking whether _POLL_EMUL_H_ is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl__POLL_EMUL_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. */ +$accheck_includes + +int +main () +{ +#ifndef _POLL_EMUL_H_ + (void) _POLL_EMUL_H_; +#endif -if test $opt_editcomplete = yes; then - if test $have_libedit = yes; then - - echo $ac_n "checking for EL_RPROMPT in libedit""... $ac_c" 1>&6 -echo "configure:3682: checking for EL_RPROMPT in libedit" >&5 -if eval "test \"`echo '$''{'ftp_cv_have_libedit'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl__POLL_EMUL_H_=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl__POLL_EMUL_H_=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl__POLL_EMUL_H_" >&5 +echo "${ECHO_T}$ac_cv_have_decl__POLL_EMUL_H_" >&6; } +if test $ac_cv_have_decl__POLL_EMUL_H_ = yes; then + : else - - cat > conftest.$ac_ext <<EOF -#line 3688 "configure" -#include "confdefs.h" - -#include <histedit.h> - -int main() { - int X = EL_RPROMPT ; -; return 0; } -EOF -if { (eval echo configure:3697: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ftp_cv_have_libedit=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ftp_cv_have_libedit=no -fi -rm -f conftest* - + cat >>confdefs.h <<\_ACEOF +#define HAVE_POLL 1 +_ACEOF + fi -echo "$ac_t""$ftp_cv_have_libedit" 1>&6 - if test "x$ftp_cv_have_libedit" = "xyes"; then - : - else - have_libedit=no - : - fi +fi - fi - have_libedit=no - - echo $ac_n "checking for up-to-date libedit""... $ac_c" 1>&6 -echo "configure:3723: checking for up-to-date libedit" >&5 - if test $have_libedit = no; then - echo "$ac_t""no - using my own" 1>&6 - INCLUDES="-I\${srcdir}/../libedit $INCLUDES" - LDFLAGS="-L../libedit $LDFLAGS" - LIBS="-ledit $LIBS" - LIBEDIT=libedit.a - LIBDEPENDS="$LIBDEPENDS ../libedit/libedit.a" - else - echo "$ac_t""yes" 1>&6 - fi +# Assume libedit is not up-to-date and force own version. +# +have_libedit=no +if test "$opt_editcomplete" = yes; then + { echo "$as_me:$LINENO: checking for up-to-date libedit" >&5 +echo $ECHO_N "checking for up-to-date libedit... $ECHO_C" >&6; } + if test "$have_libedit" = no; then + { echo "$as_me:$LINENO: result: no - using my own" >&5 +echo "${ECHO_T}no - using my own" >&6; } + INCLUDES="-I\${srcdir}/../libedit $INCLUDES" + LDFLAGS="-L../libedit $LDFLAGS" + LIBS="-ledit $LIBS" + LIBEDIT=libedit.a + LIBDEPENDS="$LIBDEPENDS ../libedit/libedit.a" else - CFLAGS="-DNO_EDITCOMPLETE $CFLAGS" + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } fi -if test $ac_cv_func_sl_init = yes; then - - echo $ac_n "checking if sl_add() returns int""... $ac_c" 1>&6 -echo "configure:3741: checking if sl_add() returns int" >&5 -if eval "test \"`echo '$''{'ftp_cv_INT_SL_ADD'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 else - - cat > conftest.$ac_ext <<EOF -#line 3747 "configure" -#include "confdefs.h" - -#include <stringlist.h> - -int main() { - - int f = sl_add((StringList *)0, "foo") - ; -; return 0; } -EOF -if { (eval echo configure:3758: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ftp_cv_INT_SL_ADD=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ftp_cv_INT_SL_ADD=no -fi -rm -f conftest* - + CFLAGS="-DNO_EDITCOMPLETE $CFLAGS" fi -echo "$ac_t""$ftp_cv_INT_SL_ADD" 1>&6 - if test "x$ftp_cv_INT_SL_ADD" = "xyes"; then - : - else - LIBOBJS="$LIBOBJS sl_init.o" - : - fi +# Replace sl_init() (et al) if it provides the older API. +# +if test "$ac_cv_func_sl_init" = yes; then + { echo "$as_me:$LINENO: checking if sl_add() returns int" >&5 +echo $ECHO_N "checking if sl_add() returns int... $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 <stringlist.h> +int +main () +{ +int f = sl_add((StringList *)0, + "foo"); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { echo "$as_me:$LINENO: result: no - using local version" >&5 +echo "${ECHO_T}no - using local version" >&6; } + case " $LIBOBJS " in + *" sl_init.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS sl_init.$ac_objext" + ;; +esac + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -have_rfc2553_netdb=no -if test $ac_cv_func_getaddrinfo = yes -a ! -n "$socks"; then - - echo $ac_n "checking for AI_NUMERICHOST""... $ac_c" 1>&6 -echo "configure:3786: checking for AI_NUMERICHOST" >&5 -if eval "test \"`echo '$''{'ftp_cv_have_ai_numerichost'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 +# Replace getaddrinfo() if missing or AI_NUMERICHOST isn't declared. +# +{ echo "$as_me:$LINENO: checking for working getaddrinfo()" >&5 +echo $ECHO_N "checking for working getaddrinfo()... $ECHO_C" >&6; } +if test "$ac_cv_have_decl_AI_NUMERICHOST" = yes; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +else + if test "$ac_cv_func_getaddrinfo" = yes; then + case " $LIBOBJS " in + *" getaddrinfo.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS getaddrinfo.$ac_objext" + ;; +esac + + { echo "$as_me:$LINENO: result: no - using local version" >&5 +echo "${ECHO_T}no - using local version" >&6; } else - - cat > conftest.$ac_ext <<EOF -#line 3792 "configure" -#include "confdefs.h" - -#include <sys/types.h> -#include <sys/socket.h> -#include <netdb.h> - -int main() { - int X = AI_NUMERICHOST ; -; return 0; } -EOF -if { (eval echo configure:3803: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ftp_cv_have_ai_numerichost=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ftp_cv_have_ai_numerichost=no + { echo "$as_me:$LINENO: result: using local version" >&5 +echo "${ECHO_T}using local version" >&6; } fi -rm -f conftest* - + fi -echo "$ac_t""$ftp_cv_have_ai_numerichost" 1>&6 - if test "x$ftp_cv_have_ai_numerichost" = "xyes"; then - have_rfc2553_netdb=yes - else - - : - fi -fi -echo $ac_n "checking for working getaddrinfo()""... $ac_c" 1>&6 -echo "configure:3826: checking for working getaddrinfo()" >&5 -if test $have_rfc2553_netdb = yes; then - cat >> confdefs.h <<\EOF -#define HAVE_RFC2553_NETDB 1 -EOF +# Check for VIS_WHITE in <vis.h> +# +if test "$ac_cv_header_vis_h" = yes; then + { echo "$as_me:$LINENO: checking whether VIS_WHITE is declared" >&5 +echo $ECHO_N "checking whether VIS_WHITE is declared... $ECHO_C" >&6; } +if test "${ac_cv_have_decl_VIS_WHITE+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 <vis.h> - echo "$ac_t""yes" 1>&6 -else - if test $ac_cv_func_getaddrinfo = yes; then - LIBOBJS="$LIBOBJS getaddrinfo.o" - echo "$ac_t""no - using local version" 1>&6 - else - echo "$ac_t""using local version" 1>&6 - fi -fi +int +main () +{ +#ifndef VIS_WHITE + (void) VIS_WHITE; +#endif -if test $ac_cv_header_vis_h = yes; then - - echo $ac_n "checking for VIS_WHITE in vis.h""... $ac_c" 1>&6 -echo "configure:3846: checking for VIS_WHITE in vis.h" >&5 -if eval "test \"`echo '$''{'ftp_cv_have_vis_white'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_have_decl_VIS_WHITE=yes else - - cat > conftest.$ac_ext <<EOF -#line 3852 "configure" -#include "confdefs.h" - -#include <sys/types.h> -#include <vis.h> - -int main() { - int X = VIS_WHITE ; -; return 0; } -EOF -if { (eval echo configure:3862: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ftp_cv_have_vis_white=yes -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - ftp_cv_have_vis_white=no -fi -rm -f conftest* - + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_have_decl_VIS_WHITE=no fi -echo "$ac_t""$ftp_cv_have_vis_white" 1>&6 - if test "x$ftp_cv_have_vis_white" = "xyes"; then - : - else - ac_cv_header_vis_h=no - : - fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_VIS_WHITE" >&5 +echo "${ECHO_T}$ac_cv_have_decl_VIS_WHITE" >&6; } fi +# Build libnetbsd if necessary. +# if test -n "$LIBOBJS"; then - INCLUDES="$INCLUDES -I\${srcdir}/../libnetbsd" - LDFLAGS="$LDFLAGS -L../libnetbsd" - LIBS="$LIBS -lnetbsd" - LIBNETBSD=libnetbsd.a - LIBDEPENDS="$LIBDEPENDS ../libnetbsd/libnetbsd.a" + INCLUDES="$INCLUDES -I\${srcdir}/../libnetbsd" + LDFLAGS="$LDFLAGS -L../libnetbsd" + LIBS="$LIBS -lnetbsd" + LIBNETBSD=libnetbsd.a + LIBDEPENDS="$LIBDEPENDS ../libnetbsd/libnetbsd.a" fi +# +# Create the Makefiles. +# + +ac_config_files="$ac_config_files Makefile libedit/Makefile libedit/makelist libnetbsd/Makefile src/Makefile" -trap '' 1 2 15 -cat > confcache <<\EOF + +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. It is not useful on other systems. -# If it contains results you don't want to keep, you may remove or edit it. +# 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. # -# By default, configure uses ./config.cache as the cache file, -# creating it if it does not exist already. You can give configure -# the --cache-file=FILE option to use a different cache file; that is -# what configure does when it calls configure scripts in -# subdirectories, so they share the cache. -# Giving --cache-file=/dev/null disables caching, for debugging configure. -# config.status only pays attention to the cache file if you give it the -# --recheck option to rerun configure. +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. # -EOF +# `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. +# So, we kill variables containing newlines. # 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 \ - -e "s/'/'\\\\''/g" \ - -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' - ;; - esac >> confcache -if cmp -s $cache_file confcache; then - : -else - if test -w $cache_file; then - echo "updating cache $cache_file" - cat confcache > $cache_file +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}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 "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + 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 "$as_me:$LINENO: updating cache $cache_file" >&5 +echo "$as_me: updating cache $cache_file" >&6;} + cat confcache >$cache_file else - echo "not updating unwritable cache $cache_file" + { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache -trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 - test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' -# Any assignment to VPATH causes Sun make to only execute -# the first set of double-colon rules, so remove it if not needed. -# If there is a colon in the path, we need to keep it. -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' -fi +DEFS=-DHAVE_CONFIG_H -trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 +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_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs -DEFS=-DHAVE_CONFIG_H +LTLIBOBJS=$ac_ltlibobjs -# Without the "./", some shells look in PATH for config.status. -: ${CONFIG_STATUS=./config.status} -echo creating $CONFIG_STATUS -rm -f $CONFIG_STATUS -cat > $CONFIG_STATUS <<EOF -#! /bin/sh -# Generated automatically by configure. + +: ${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. -# This directory was configured as follows, -# on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# -# $0 $ac_configure_args -# # Compiler output produced by configure, useful for debugging -# configure, is in ./config.log if it exists. +# configure, is in config.log if it exists. -ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" -for ac_option +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +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+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# 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 + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH do - case "\$ac_option" in - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" - exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; - -version | --version | --versio | --versi | --vers | --ver | --ve | --v) - echo "$CONFIG_STATUS generated by autoconf version 2.13" - exit 0 ;; - -help | --help | --hel | --he | --h) - echo "\$ac_cs_usage"; exit 0 ;; - *) echo "\$ac_cs_usage"; exit 1 ;; - esac + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done +IFS=$as_save_IFS -ac_given_srcdir=$srcdir -ac_given_INSTALL="$INSTALL" + ;; +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_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi -trap 'rm -fr `echo "Makefile libedit/Makefile libedit/makelist libnetbsd/Makefile \ - src/Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 -EOF -cat >> $CONFIG_STATUS <<EOF +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' -# Protect against being on the right side of a sed subst in config.status. -sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g; - s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF -$ac_vpsub -$extrasub -s%@SHELL@%$SHELL%g -s%@CFLAGS@%$CFLAGS%g -s%@CPPFLAGS@%$CPPFLAGS%g -s%@CXXFLAGS@%$CXXFLAGS%g -s%@FFLAGS@%$FFLAGS%g -s%@DEFS@%$DEFS%g -s%@LDFLAGS@%$LDFLAGS%g -s%@LIBS@%$LIBS%g -s%@exec_prefix@%$exec_prefix%g -s%@prefix@%$prefix%g -s%@program_transform_name@%$program_transform_name%g -s%@bindir@%$bindir%g -s%@sbindir@%$sbindir%g -s%@libexecdir@%$libexecdir%g -s%@datadir@%$datadir%g -s%@sysconfdir@%$sysconfdir%g -s%@sharedstatedir@%$sharedstatedir%g -s%@localstatedir@%$localstatedir%g -s%@libdir@%$libdir%g -s%@includedir@%$includedir%g -s%@oldincludedir@%$oldincludedir%g -s%@infodir@%$infodir%g -s%@mandir@%$mandir%g -s%@SET_MAKE@%$SET_MAKE%g -s%@CC@%$CC%g -s%@AWK@%$AWK%g -s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g -s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g -s%@INSTALL_DATA@%$INSTALL_DATA%g -s%@RANLIB@%$RANLIB%g -s%@AR@%$AR%g -s%@CPP@%$CPP%g -s%@LIBOBJS@%$LIBOBJS%g -s%@INCLUDES@%$INCLUDES%g -s%@LIBEDIT@%$LIBEDIT%g -s%@LIBNETBSD@%$LIBNETBSD%g -s%@LIBDEPENDS@%$LIBDEPENDS%g - -CEOF -EOF - -cat >> $CONFIG_STATUS <<\EOF - -# Split the substitutions into bite-sized pieces for seds with -# small command number limits, like on Digital OSF/1 and HP-UX. -ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. -ac_file=1 # Number of current file. -ac_beg=1 # First line for current file. -ac_end=$ac_max_sed_cmds # Line after last line for current file. -ac_more_lines=: -ac_sed_cmds="" -while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file +# 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 - sed "${ac_end}q" conftest.subs > conftest.s$ac_file + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi - if test ! -s conftest.s$ac_file; then - ac_more_lines=false - rm -f conftest.s$ac_file +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; 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'` + +# CDPATH. +$as_unset CDPATH + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # 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 after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, 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 + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\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 sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; +esac + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' +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$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L else - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f conftest.s$ac_file" - else - ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" - fi - ac_file=`expr $ac_file + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_cmds` + as_ls_L_option= fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# 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'" + + +exec 6>&1 + +# Save the log message, to keep $[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by tnftp $as_me 20070806, which was +generated by GNU Autoconf 2.61. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" + +_ACEOF + +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 and configuration settings, 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 + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Report bugs to <bug-autoconf@gnu.org>." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +tnftp config.status 20070806 +configured by $0, generated by GNU Autoconf 2.61, + with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2006 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +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 + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + echo "$ac_cs_version"; exit ;; + --debug | --debu | --deb | --de | --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;; + --he | --h) + # Conflict between --help and --header + { 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 ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { 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" + ac_need_defaults=false ;; + + esac + shift done -if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat -fi -EOF - -cat >> $CONFIG_STATUS <<EOF - -CONFIG_FILES=\${CONFIG_FILES-"Makefile libedit/Makefile libedit/makelist libnetbsd/Makefile \ - src/Makefile"} -EOF -cat >> $CONFIG_STATUS <<\EOF -for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; + +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 CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + CONFIG_SHELL=$SHELL + export CONFIG_SHELL + exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "libedit/Makefile") CONFIG_FILES="$CONFIG_FILES libedit/Makefile" ;; + "libedit/makelist") CONFIG_FILES="$CONFIG_FILES libedit/makelist" ;; + "libnetbsd/Makefile") CONFIG_FILES="$CONFIG_FILES libnetbsd/Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + + *) { { 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_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers +fi - # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" - ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" - # A "../" for each directory in $ac_dir_suffix. - ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +# +# Set up the sed scripts for CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "$CONFIG_FILES"; then + +_ACEOF + + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +SHELL!$SHELL$ac_delim +PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim +PACKAGE_NAME!$PACKAGE_NAME$ac_delim +PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim +PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim +PACKAGE_STRING!$PACKAGE_STRING$ac_delim +PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim +exec_prefix!$exec_prefix$ac_delim +prefix!$prefix$ac_delim +program_transform_name!$program_transform_name$ac_delim +bindir!$bindir$ac_delim +sbindir!$sbindir$ac_delim +libexecdir!$libexecdir$ac_delim +datarootdir!$datarootdir$ac_delim +datadir!$datadir$ac_delim +sysconfdir!$sysconfdir$ac_delim +sharedstatedir!$sharedstatedir$ac_delim +localstatedir!$localstatedir$ac_delim +includedir!$includedir$ac_delim +oldincludedir!$oldincludedir$ac_delim +docdir!$docdir$ac_delim +infodir!$infodir$ac_delim +htmldir!$htmldir$ac_delim +dvidir!$dvidir$ac_delim +pdfdir!$pdfdir$ac_delim +psdir!$psdir$ac_delim +libdir!$libdir$ac_delim +localedir!$localedir$ac_delim +mandir!$mandir$ac_delim +DEFS!$DEFS$ac_delim +ECHO_C!$ECHO_C$ac_delim +ECHO_N!$ECHO_N$ac_delim +ECHO_T!$ECHO_T$ac_delim +LIBS!$LIBS$ac_delim +build_alias!$build_alias$ac_delim +host_alias!$host_alias$ac_delim +target_alias!$target_alias$ac_delim +build!$build$ac_delim +build_cpu!$build_cpu$ac_delim +build_vendor!$build_vendor$ac_delim +build_os!$build_os$ac_delim +host!$host$ac_delim +host_cpu!$host_cpu$ac_delim +host_vendor!$host_vendor$ac_delim +host_os!$host_os$ac_delim +target!$target$ac_delim +target_cpu!$target_cpu$ac_delim +target_vendor!$target_vendor$ac_delim +target_os!$target_os$ac_delim +SET_MAKE!$SET_MAKE$ac_delim +CC!$CC$ac_delim +CFLAGS!$CFLAGS$ac_delim +LDFLAGS!$LDFLAGS$ac_delim +CPPFLAGS!$CPPFLAGS$ac_delim +ac_ct_CC!$ac_ct_CC$ac_delim +EXEEXT!$EXEEXT$ac_delim +OBJEXT!$OBJEXT$ac_delim +AWK!$AWK$ac_delim +INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim +INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim +INSTALL_DATA!$INSTALL_DATA$ac_delim +AR!$AR$ac_delim +RANLIB!$RANLIB$ac_delim +CPP!$CPP$ac_delim +GREP!$GREP$ac_delim +EGREP!$EGREP$ac_delim +ALLOCA!$ALLOCA$ac_delim +LIBOBJS!$LIBOBJS$ac_delim +INCLUDES!$INCLUDES$ac_delim +LIBEDIT!$LIBEDIT$ac_delim +LIBNETBSD!$LIBNETBSD$ac_delim +LIBDEPENDS!$LIBDEPENDS$ac_delim +LTLIBOBJS!$LTLIBOBJS$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 73; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } else - ac_dir_suffix= ac_dots= + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi +done - case "$ac_given_srcdir" in - .) srcdir=. - if test -z "$ac_dots"; then top_srcdir=. - else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; - /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; - *) # Relative path. - srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" - top_srcdir="$ac_dots$ac_given_srcdir" ;; - esac +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS <conf$$subs.sed +rm -f conf$$subs.sed +cat >>$CONFIG_STATUS <<_ACEOF +:end +s/|#_!!_#|//g +CEOF$ac_eof +_ACEOF + + +# 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 - case "$ac_given_INSTALL" in - [/$]*) INSTALL="$ac_given_INSTALL" ;; - *) INSTALL="$ac_dots$ac_given_INSTALL" ;; +cat >>$CONFIG_STATUS <<\_ACEOF +fi # test -n "$CONFIG_FILES" + + +for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 +echo "$as_me: error: Invalid tag $ac_tag." >&2;} + { (exit 1); exit 1; }; };; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; + esac + ac_file_inputs="$ac_file_inputs $ac_f" + done + + # 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. */ + configure_input="Generated from "`IFS=: + echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + fi - echo creating "$ac_file" - rm -f "$ac_file" - configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." - case "$ac_file" in - *Makefile*) ac_comsub="1i\\ -# $configure_input" ;; - *) ac_comsub= ;; + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin";; + esac + ;; esac - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - sed -e "$ac_comsub -s%@configure_input@%$configure_input%g -s%@srcdir@%$srcdir%g -s%@top_srcdir@%$top_srcdir%g -s%@INSTALL@%$INSTALL%g -" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file -fi; done -rm -f conftest.s* - -# 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='\3' -ac_dD='%g' -# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". -ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='\([ ]\)%\1#\2define\3' -ac_uC=' ' -ac_uD='\4%g' -# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_eB='$%\1#\2define\3' -ac_eC=' ' -ac_eD='%g' - -if test "${CONFIG_HEADERS+set}" != set; then -EOF -cat >> $CONFIG_STATUS <<EOF - CONFIG_HEADERS="config.h" -EOF -cat >> $CONFIG_STATUS <<\EOF -fi -for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case "$ac_file" in - *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` - ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; - *) ac_file_in="${ac_file}.in" ;; + ac_dir=`$as_dirname -- "$ac_file" || +$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'` + { as_dir="$ac_dir" + case $as_dir in #( + -*) as_dir=./$as_dir;; esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$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'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} + { (exit 1); exit 1; }; }; } + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= - echo creating $ac_file - - rm -f conftest.frag conftest.in conftest.out - ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` - cat $ac_file_inputs > conftest.in - -EOF - -# Transform confdefs.h into a sed script conftest.vals that substitutes -# the proper values into config.h.in to produce config.h. 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.vals -cat > conftest.hdr <<\EOF -s/[\\&%]/\\&/g -s%[\\$`]%\\&%g -s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp -s%ac_d%ac_u%gp -s%ac_u%ac_e%gp -EOF -sed -n -f conftest.hdr confdefs.h > conftest.vals -rm -f conftest.hdr - -# This sed command replaces #undef with comments. This is necessary, for +case `sed -n '/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p +' $ac_file_inputs` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s&@configure_input@&$configure_input&;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +$ac_datarootdir_hack +" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} + + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out"; rm -f "$tmp/out";; + *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; + esac + ;; + :H) + # + # CONFIG_HEADER + # +_ACEOF + +# Transform confdefs.h into a sed script `conftest.defines', that +# substitutes the proper values into config.h.in to produce config.h. +rm -f conftest.defines conftest.tail +# First, append a space to every undef/define line, to ease matching. +echo 's/$/ /' >conftest.defines +# Then, protect against being on the right side of a sed subst, or in +# an unquoted here document, in config.status. If some macros were +# called several times there might be several #defines for the same +# symbol, which is useless. But do not sort them, since the last +# AC_DEFINE must be honored. +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where +# NAME is the cpp macro being defined, VALUE is the value it is being given. +# PARAMS is the parameter list in the macro definition--in most cases, it's +# just an empty string. +ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' +ac_dB='\\)[ (].*,\\1define\\2' +ac_dC=' ' +ac_dD=' ,' + +uniq confdefs.h | + sed -n ' + t rset + :rset + s/^[ ]*#[ ]*define[ ][ ]*// + t ok + d + :ok + s/[\\&,]/\\&/g + s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p + s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p + ' >>conftest.defines + +# Remove the space that was appended to ease matching. +# Then replace #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.vals <<\EOF -s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% -EOF +# (The regexp can be short, since the line contains either #define or #undef.) +echo 's/ $// +s,^[ #]*u.*,/* & */,' >>conftest.defines -# Break up conftest.vals because some shells have a limit on -# the size of here documents, and old seds have small limits too. +# Break up conftest.defines: +ac_max_sed_lines=50 + +# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" +# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" +# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" +# et cetera. +ac_in='$ac_file_inputs' +ac_out='"$tmp/out1"' +ac_nxt='"$tmp/out2"' -rm -f conftest.tail while : do - ac_lines=`grep -c . conftest.vals` - # grep -c gives empty output for an empty file on some AIX systems. - if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi - # Write a limited-size here document to conftest.frag. - echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS + # Write a here document: + cat >>$CONFIG_STATUS <<_ACEOF + # First, check the format of the line: + cat >"\$tmp/defines.sed" <<\\CEOF +/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def +/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def +b +:def +_ACEOF + sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF - sed -f conftest.frag conftest.in > conftest.out - rm -f conftest.in - mv conftest.out conftest.in -' >> $CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail - rm -f conftest.vals - mv conftest.tail conftest.vals + sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS + ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in + sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail + grep . conftest.tail >/dev/null || break + rm -f conftest.defines + mv conftest.tail conftest.defines done -rm -f conftest.vals - -cat >> $CONFIG_STATUS <<\EOF - rm -f conftest.frag conftest.h - echo "/* $ac_file. Generated automatically by configure. */" > conftest.h - cat conftest.in >> conftest.h - rm -f conftest.in - if cmp -s $ac_file conftest.h 2>/dev/null; then - echo "$ac_file is unchanged" - rm -f conftest.h - else - # Remove last slash and all that follows it. Not all systems have dirname. - ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` - if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then - # The file is in a subdirectory. - test ! -d "$ac_dir" && mkdir "$ac_dir" +rm -f conftest.defines conftest.tail + +echo "ac_result=$ac_in" >>$CONFIG_STATUS +cat >>$CONFIG_STATUS <<\_ACEOF + if test x"$ac_file" != x-; then + echo "/* $configure_input */" >"$tmp/config.h" + cat "$ac_result" >>"$tmp/config.h" + 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 + rm -f $ac_file + mv "$tmp/config.h" $ac_file fi - rm -f $ac_file - mv conftest.h $ac_file + else + echo "/* $configure_input */" + cat "$ac_result" fi -fi; done + rm -f "$tmp/out12" + ;; -EOF -cat >> $CONFIG_STATUS <<EOF -EOF -cat >> $CONFIG_STATUS <<\EOF + esac -exit 0 -EOF +done # for ac_tag + + +{ (exit 0); exit 0; } +_ACEOF chmod +x $CONFIG_STATUS -rm -fr confdefs* $ac_clean_files -test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 +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 diff --git a/net/tnftp/files/configure.in b/net/tnftp/files/configure.in deleted file mode 100644 index 9028e0488cd..00000000000 --- a/net/tnftp/files/configure.in +++ /dev/null @@ -1,379 +0,0 @@ -dnl NetBSD: configure.in,v 1.17 2005/06/25 06:14:08 lukem Exp -dnl -dnl configure.in -- -dnl process this file with autoconf to produce a configure script. -dnl - -AC_REVISION([Revision: 1.17])dnl - -AC_INIT(tnftp.h) - -dnl Arguments for which features are included -dnl -AC_ARG_PROGRAM -AC_ARG_ENABLE(editcomplete, [\ - --enable-editcomplete Turn on command line editing and completion. - --disable-editcomplete Turn off command line editing and completion - [default: enabled].], - [opt_editcomplete=$enableval], - [opt_editcomplete=yes]) -AC_ARG_ENABLE(ipv6, [\ - --enable-ipv6 Enable IPv6 support (if your OS supports it). - --disable-ipv6 Disable IPv6 support (even if your OS supports it) - [default: enabled].], - [opt_ipv6=$enableval], - [opt_ipv6=yes]) - -dnl Checks for programs. -dnl -AC_PROG_MAKE_SET -AC_PROG_CC -AC_PROG_AWK -AC_PROG_INSTALL -AC_PROG_RANLIB -AC_CHECK_PROGS(AR, ar) -AC_AIX - - -dnl Checks for libraries. -dnl -if test $opt_editcomplete = yes; then - AC_SEARCH_LIBS(tgetent, [termcap termlib curses ncurses tinfo], , - AC_MSG_ERROR([no relevant library found containing tgetent])) - AC_SEARCH_LIBS(el_init, [edit], [have_libedit=yes], [have_libedit=no]) -fi -AC_LIBRARY_NET -AC_LIBRARY_SOCKS -if test -n "$socks"; then - if test $opt_ipv6 = yes; then - echo "IPv6 is incompatible with socks, disabling IPv6 support" - opt_ipv6=no - fi -fi - - -dnl Checks for header files. -dnl -AC_CONFIG_HEADER(config.h) -AC_HEADER_DIRENT -AC_HEADER_STDC -AC_CHECK_HEADERS([arpa/nameser.h err.h libgen.h regex.h paths.h poll.h \ - sys/poll.h sys/syslimits.h termcap.h util.h libutil.h vis.h]) - - -dnl Checks for typedefs, structures, and compiler characteristics. -dnl -AC_HEADER_TIME -AC_TYPE_OFF_T -AC_CHECK_SIZEOF(off_t, 0) -AC_MSG_TRY_LINK([for long long], ftp_cv_HAVE_LONG_LONG, [ -#include <sys/types.h> - ] , [ - long long X = 2, Y = 1, Z; - Z = X / Y; - ], [ - AC_DEFINE(HAVE_LONG_LONG, 1) - have_long_long=yes - ], [have_long_long=no]) - -AC_MSG_TRY_COMPILE([for in_port_t], ftp_cv_HAVE_IN_PORT_T, [ -#include <sys/types.h> -#include <netinet/in.h> - ], [ in_port_t X ], [AC_DEFINE(HAVE_IN_PORT_T, 1)]) - -AC_MSG_TRY_COMPILE([for sa_family_t], ftp_cv_HAVE_SA_FAMILY_T, [ -#include <sys/types.h> -#include <sys/socket.h> - ], [ sa_family_t X ], [AC_DEFINE(HAVE_SA_FAMILY_T, 1)]) - -AC_MSG_TRY_COMPILE([for sockaddr_in.sin_len], ftp_cv_HAVE_SOCKADDR_SA_LEN, [ -#include <sys/types.h> -#include <sys/socket.h> -#include <netinet/in.h> - ], [ - struct sockaddr_in sin; - int X = sin.sin_len - ], [AC_DEFINE(HAVE_SOCKADDR_SA_LEN, 1)]) - -AC_MSG_TRY_COMPILE([for socklen_t], ftp_cv_HAVE_SOCKLEN_T, [ -#include <sys/types.h> -#include <sys/socket.h> - ], [ socklen_t X ], [AC_DEFINE(HAVE_SOCKLEN_T, 1)]) - -if test $opt_ipv6 = yes; then - - AC_MSG_TRY_COMPILE([for AF_INET6], ftp_cv_HAVE_AF_INET6, [ -#include <sys/types.h> -#include <sys/socket.h> - ], [ int X = AF_INET6 ], [AC_DEFINE(HAVE_AF_INET6, 1)]) - - AC_MSG_TRY_COMPILE([for struct sockaddr_in6], - ftp_cv_HAVE_SOCKADDR_IN6, [ -#include <sys/types.h> -#include <netinet/in.h> - ], [ - struct sockaddr_in6 X; - int Y = X.sin6_scope_id - ], [AC_DEFINE(HAVE_SOCKADDR_IN6, 1)]) - - if test $ac_cv_header_arpa_nameser_h = yes; then - AC_MSG_TRY_COMPILE([for NS_IN6ADDRSZ in arpa/nameser.h], - ftp_cv_HAVE_NS_IN6ADDRSZ, [ -#include <sys/types.h> -#include <arpa/nameser.h> - ], - [ int X = NS_IN6ADDRSZ ], - [ AC_DEFINE(HAVE_NS_IN6ADDRSZ, 1) ]) - fi - -fi - -AC_MSG_TRY_COMPILE([for struct addrinfo], ftp_cv_HAVE_ADDRINFO, [ -#include <sys/types.h> -#include <sys/socket.h> -#include <netdb.h> - ], [ struct addrinfo X ], [AC_DEFINE(HAVE_ADDRINFO, 1)]) - -AC_MSG_TRY_COMPILE([for d_namlen in struct dirent], ftp_cv_HAVE_D_NAMLEN, [ -#if HAVE_DIRENT_H -# include <dirent.h> -#else -# define dirent direct -# if HAVE_SYS_NDIR_H -# include <sys/ndir.h> -# endif -# if HAVE_SYS_DIR_H -# include <sys/dir.h> -# endif -# if HAVE_NDIR_H -# include <ndir.h> -# endif -#endif - ], [ - struct dirent dp; - int X = dp.d_namlen; - ], [AC_DEFINE(HAVE_D_NAMLEN, 1)]) - -AC_MSG_TRY_COMPILE([for h_errno declaration], ftp_cv_HAVE_H_ERRNO_D, [ -#include <netdb.h> - ], [ int X = h_errno ], [AC_DEFINE(HAVE_H_ERRNO_D, 1)]) - -AC_MSG_TRY_COMPILE([for dirname() declaration], ftp_cv_HAVE_DIRNAME_D, [ -#include <libgen.h> - ], [ char *(*X)() = dirname ], [ AC_DEFINE(HAVE_DIRNAME_D, 1)]) - -AC_MSG_TRY_COMPILE([for fclose() declaration], ftp_cv_HAVE_FCLOSE_D, [ -#include <stdio.h> - ], [ int (*X)() = fclose ], [AC_DEFINE(HAVE_FCLOSE_D, 1)]) - -AC_MSG_TRY_COMPILE([for getpass() declaration], ftp_cv_HAVE_GETPASS_D, [ -#include <stdlib.h> -#include <unistd.h> - ], [ char *(*X)() = getpass ], [ AC_DEFINE(HAVE_GETPASS_D, 1)]) - -AC_MSG_TRY_COMPILE([for optarg declaration], ftp_cv_HAVE_OPTARG_D, [ -#include <stdlib.h> -#include <unistd.h> - ], [ char *X = optarg ], [AC_DEFINE(HAVE_OPTARG_D, 1)]) - -AC_MSG_TRY_COMPILE([for optind declaration], ftp_cv_HAVE_OPTIND_D, [ -#include <stdlib.h> -#include <unistd.h> - ], [ int X = optind ], [AC_DEFINE(HAVE_OPTIND_D, 1)]) - -AC_MSG_TRY_COMPILE([for pclose() declaration], ftp_cv_HAVE_PCLOSE_D, [ -#include <stdio.h> - ], [ int (*X)() = pclose ], [AC_DEFINE(HAVE_PCLOSE_D, 1)]) - - -dnl Checks for library functions. -dnl -AC_REPLACE_FUNCS([dirname err fgetln fparseln fseeko getaddrinfo getnameinfo \ - inet_ntop inet_pton mkstemp setprogname sl_init snprintf \ - strdup strerror strlcat strlcpy strptime strsep strunvis \ - strvis timegm usleep utimes]) -AC_CHECK_FUNCS([gethostbyname2 getpassphrase getpgrp memmove select]) -if test $ac_cv_func_getpgrp = yes; then - AC_FUNC_GETPGRP -fi - -dnl Always replace glob(3); the vendor's may not be secure. -dnl -LIBOBJS="$LIBOBJS glob.o" - -if test $ac_cv_func_strptime = yes; then - AC_MSG_TRY_COMPILE([for strptime() declaration], - ftp_cv_HAVE_STRPTIME_D, [ -#include <time.h> - ], [ - char *X = strptime("", "", NULL) - ], [AC_DEFINE(HAVE_STRPTIME_D, 1)]) -fi - -if test $have_long_long = yes -a $ac_cv_sizeof_off_t -ge 8; then - -dnl We assume that if sprintf() supports %lld or %qd, -dnl then all of *printf() does. If not, disable long long -dnl support because we don't know how to display it. - - AC_MSG_CHECKING([*printf() support for %lld]) - can_printf_longlong=no - AC_TRY_RUN([ -#include <stdio.h> -int main() { - char buf[100]; - sprintf(buf, "%lld", 4294967300LL); - return (strcmp(buf, "4294967300")); -} - ], [ - AC_MSG_RESULT(yes) - can_printf_longlong=yes - ], [ - AC_MSG_RESULT(no) - ], [ : ]) - - if test $can_printf_longlong != yes; then - AC_MSG_CHECKING([*printf() support for %qd]) - AC_TRY_RUN([ -#include <stdio.h> -int main() { - char buf[100]; - sprintf(buf, "%qd", 4294967300LL); - return (strcmp(buf, "4294967300")); -} - ], [ - AC_MSG_RESULT(yes) - can_printf_longlong=yes - AC_DEFINE(HAVE_PRINTF_QD, 1) - ], [ - AC_MSG_RESULT(no) - ], [ : ]) - fi - - if test $can_printf_longlong = yes; then - AC_DEFINE(HAVE_QUAD_SUPPORT, 1) - AC_REPLACE_FUNCS(strtoll) - fi - -fi - -dnl Handle Darwin 7 having a poll() compatibility function. -dnl Be conservative, if we don't find one of poll.h or sys/poll.h, -dnl don't attempt to use poll(). -dnl -if test $ac_cv_header_poll_h = yes || test $ac_cv_header_sys_poll_h = yes; then - AC_CHECK_FUNC(poll, [ - AC_MSG_TRY_COMPILE([if poll() is implemented natively], - ftp_cv_POLL_NATIVE, [ -#if HAVE_POLL_H -#include <poll.h> -#endif -#if HAVE_SYS_POLL_H -#include <sys/poll.h> -#endif - ], [ -#ifdef _POLL_EMUL_H_ -#error "poll() is emulated" -#endif - ], [ AC_DEFINE(HAVE_POLL, 1)], [ : ]) - ]) - -dnl Detect if struct pollfd is present. -dnl -AC_MSG_TRY_COMPILE([for struct pollfd], ftp_cv_HAVE_STRUCT_POLLFD, [ -#if HAVE_POLL_H -#include <poll.h> -#endif -#if HAVE_SYS_POLL_H -#include <sys/poll.h> -#endif - ], [ struct pollfd X ], [ AC_DEFINE(HAVE_STRUCT_POLLFD, 1)], [ : ]) -fi - - -if test $opt_editcomplete = yes; then - if test $have_libedit = yes; then - AC_MSG_TRY_COMPILE([for EL_RPROMPT in libedit], - ftp_cv_have_libedit, [ -#include <histedit.h> - ], [ int X = EL_RPROMPT ], [ : ], [ have_libedit=no ] ) - fi - -dnl For now, assume libedit is not up-to-date and force own version. -dnl - have_libedit=no - - AC_MSG_CHECKING([for up-to-date libedit]) - if test $have_libedit = no; then - AC_MSG_RESULT([no - using my own]) - INCLUDES="-I\${srcdir}/../libedit $INCLUDES" - LDFLAGS="-L../libedit $LDFLAGS" - LIBS="-ledit $LIBS" - LIBEDIT=libedit.a - LIBDEPENDS="$LIBDEPENDS ../libedit/libedit.a" - else - AC_MSG_RESULT(yes) - fi -else - CFLAGS="-DNO_EDITCOMPLETE $CFLAGS" -fi - -if test $ac_cv_func_sl_init = yes; then - AC_MSG_TRY_COMPILE([if sl_add() returns int], ftp_cv_INT_SL_ADD, [ -#include <stringlist.h> - ], [ - int f = sl_add((StringList *)0, "foo") - ], [ : ], [LIBOBJS="$LIBOBJS sl_init.o"]) -fi - - -have_rfc2553_netdb=no -if test $ac_cv_func_getaddrinfo = yes -a ! -n "$socks"; then - AC_MSG_TRY_COMPILE([for AI_NUMERICHOST], - ftp_cv_have_ai_numerichost, [ -#include <sys/types.h> -#include <sys/socket.h> -#include <netdb.h> - ], [ int X = AI_NUMERICHOST ], [ have_rfc2553_netdb=yes ]) -fi -AC_MSG_CHECKING([for working getaddrinfo()]) -if test $have_rfc2553_netdb = yes; then - AC_DEFINE(HAVE_RFC2553_NETDB, 1) - AC_MSG_RESULT(yes) -else - if test $ac_cv_func_getaddrinfo = yes; then - LIBOBJS="$LIBOBJS getaddrinfo.o" - AC_MSG_RESULT([no - using local version]) - else - AC_MSG_RESULT([using local version]) - fi -fi - - -if test $ac_cv_header_vis_h = yes; then - AC_MSG_TRY_COMPILE([for VIS_WHITE in vis.h], - ftp_cv_have_vis_white, [ -#include <sys/types.h> -#include <vis.h> - ], [ int X = VIS_WHITE ], [ : ], [ ac_cv_header_vis_h=no ] ) -fi - - -if test -n "$LIBOBJS"; then - INCLUDES="$INCLUDES -I\${srcdir}/../libnetbsd" - LDFLAGS="$LDFLAGS -L../libnetbsd" - LIBS="$LIBS -lnetbsd" - LIBNETBSD=libnetbsd.a - LIBDEPENDS="$LIBDEPENDS ../libnetbsd/libnetbsd.a" -fi - -dnl Create the Makefiles -dnl - -AC_SUBST(INCLUDES) -AC_SUBST(LIBEDIT) -AC_SUBST(LIBNETBSD) -AC_SUBST(LIBDEPENDS) - -AC_OUTPUT([Makefile libedit/Makefile libedit/makelist libnetbsd/Makefile \ - src/Makefile]) diff --git a/net/tnftp/files/install-sh b/net/tnftp/files/install-sh deleted file mode 100755 index e9de23842dc..00000000000 --- a/net/tnftp/files/install-sh +++ /dev/null @@ -1,251 +0,0 @@ -#!/bin/sh -# -# install - install a program, script, or datafile -# This comes from X11R5 (mit/util/scripts/install.sh). -# -# Copyright 1991 by the Massachusetts Institute of Technology -# -# Permission to use, copy, modify, distribute, and sell this software and its -# documentation for any purpose is hereby granted without fee, provided that -# the above copyright notice appear in all copies and that both that -# copyright notice and this permission notice appear in supporting -# documentation, and that the name of M.I.T. not be used in advertising or -# publicity pertaining to distribution of the software without specific, -# written prior permission. M.I.T. makes no representations about the -# suitability of this software for any purpose. It is provided "as is" -# without express or implied warranty. -# -# 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. It can only install one file at a time, a restriction -# shared with many OS's install programs. - - -# 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=: - chmodcmd="" - 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 diff --git a/net/tnftp/files/libedit/Makefile.in b/net/tnftp/files/libedit/Makefile.in index 8ed603d3d54..52207a4709f 100644 --- a/net/tnftp/files/libedit/Makefile.in +++ b/net/tnftp/files/libedit/Makefile.in @@ -1,4 +1,4 @@ -# NetBSD: Makefile.in,v 1.4 2005/06/10 04:36:12 lukem Exp +# $NetBSD: Makefile.in,v 1.4 2007/08/07 02:06:56 lukem Exp $ # srcdir = @srcdir@ diff --git a/net/tnftp/files/libedit/chared.c b/net/tnftp/files/libedit/chared.c index d15a53ba2f1..1d99ddfa651 100644 --- a/net/tnftp/files/libedit/chared.c +++ b/net/tnftp/files/libedit/chared.c @@ -1,4 +1,4 @@ -/* NetBSD: chared.c,v 1.6 2005/06/09 16:48:57 lukem Exp */ +/* $NetBSD: chared.c,v 1.4 2007/08/07 02:06:56 lukem Exp $ */ /* from NetBSD: chared.c,v 1.22 2004/08/13 12:10:38 mycroft Exp */ /*- diff --git a/net/tnftp/files/libedit/chared.h b/net/tnftp/files/libedit/chared.h index 963dc7a86d3..d0aca364bae 100644 --- a/net/tnftp/files/libedit/chared.h +++ b/net/tnftp/files/libedit/chared.h @@ -1,4 +1,4 @@ -/* NetBSD: chared.h,v 1.2 2005/05/11 01:17:39 lukem Exp */ +/* $NetBSD: chared.h,v 1.3 2007/08/07 02:06:56 lukem Exp $ */ /* from NetBSD: chared.h,v 1.14 2004/08/13 12:10:39 mycroft Exp */ /*- diff --git a/net/tnftp/files/libedit/common.c b/net/tnftp/files/libedit/common.c index eac356805ed..6aeaaa15b52 100644 --- a/net/tnftp/files/libedit/common.c +++ b/net/tnftp/files/libedit/common.c @@ -1,4 +1,4 @@ -/* NetBSD: common.c,v 1.5 2005/06/09 16:48:57 lukem Exp */ +/* $NetBSD: common.c,v 1.4 2007/08/07 02:06:56 lukem Exp $ */ /* from NetBSD: common.c,v 1.16 2003/08/07 16:44:30 agc Exp */ /*- diff --git a/net/tnftp/files/libedit/editline.3 b/net/tnftp/files/libedit/editline.3 index cf5ff894067..85984f5960b 100644 --- a/net/tnftp/files/libedit/editline.3 +++ b/net/tnftp/files/libedit/editline.3 @@ -1,4 +1,4 @@ -.\" NetBSD: editline.3,v 1.3 2005/05/31 02:07:02 lukem Exp +.\" $NetBSD: editline.3,v 1.4 2007/08/07 02:06:56 lukem Exp $ .\" from NetBSD: editline.3,v 1.46 2005/03/19 17:36:02 christos Exp .\" .\" Copyright (c) 1997-2003 The NetBSD Foundation, Inc. diff --git a/net/tnftp/files/libedit/editrc.5 b/net/tnftp/files/libedit/editrc.5 index 93879d6d2b7..45b2dc479d5 100644 --- a/net/tnftp/files/libedit/editrc.5 +++ b/net/tnftp/files/libedit/editrc.5 @@ -1,4 +1,4 @@ -.\" NetBSD: editrc.5,v 1.2 2005/05/11 01:17:39 lukem Exp +.\" $NetBSD: editrc.5,v 1.3 2007/08/07 02:06:56 lukem Exp $ .\" from NetBSD: editrc.5,v 1.19 2003/11/01 23:35:33 christos Exp .\" .\" Copyright (c) 1997-2000 The NetBSD Foundation, Inc. diff --git a/net/tnftp/files/libedit/el.c b/net/tnftp/files/libedit/el.c index 99084110bd1..eb5f8ec55ec 100644 --- a/net/tnftp/files/libedit/el.c +++ b/net/tnftp/files/libedit/el.c @@ -1,4 +1,4 @@ -/* NetBSD: el.c,v 1.5 2005/06/09 16:48:57 lukem Exp */ +/* $NetBSD: el.c,v 1.4 2007/08/07 02:06:56 lukem Exp $ */ /* from NetBSD: el.c,v 1.39 2004/07/08 00:51:36 christos Exp */ /*- diff --git a/net/tnftp/files/libedit/el.h b/net/tnftp/files/libedit/el.h index 6bc47e93c59..ee251112c35 100644 --- a/net/tnftp/files/libedit/el.h +++ b/net/tnftp/files/libedit/el.h @@ -1,4 +1,4 @@ -/* NetBSD: el.h,v 1.2 2005/05/11 01:17:39 lukem Exp */ +/* $NetBSD: el.h,v 1.3 2007/08/07 02:06:56 lukem Exp $ */ /* from NetBSD: el.h,v 1.16 2003/10/18 23:48:42 christos Exp */ /*- diff --git a/net/tnftp/files/libedit/emacs.c b/net/tnftp/files/libedit/emacs.c index 55d949b8322..4ca03c9d8cf 100644 --- a/net/tnftp/files/libedit/emacs.c +++ b/net/tnftp/files/libedit/emacs.c @@ -1,4 +1,4 @@ -/* NetBSD: emacs.c,v 1.5 2005/06/09 16:48:57 lukem Exp */ +/* $NetBSD: emacs.c,v 1.4 2007/08/07 02:06:56 lukem Exp $ */ /* from NetBSD: emacs.c,v 1.19 2004/10/28 21:14:52 dsl Exp */ /*- diff --git a/net/tnftp/files/libedit/hist.c b/net/tnftp/files/libedit/hist.c index 5193c8f209d..989e90d5a79 100644 --- a/net/tnftp/files/libedit/hist.c +++ b/net/tnftp/files/libedit/hist.c @@ -1,4 +1,4 @@ -/* NetBSD: hist.c,v 1.5 2005/06/09 16:48:57 lukem Exp */ +/* $NetBSD: hist.c,v 1.4 2007/08/07 02:06:56 lukem Exp $ */ /* from NetBSD: hist.c,v 1.15 2003/11/01 23:36:39 christos Exp */ /*- diff --git a/net/tnftp/files/libedit/hist.h b/net/tnftp/files/libedit/hist.h index 3799ca1fb28..c17bd9015cb 100644 --- a/net/tnftp/files/libedit/hist.h +++ b/net/tnftp/files/libedit/hist.h @@ -1,4 +1,4 @@ -/* NetBSD: hist.h,v 1.2 2005/05/11 01:17:39 lukem Exp */ +/* $NetBSD: hist.h,v 1.3 2007/08/07 02:06:56 lukem Exp $ */ /* from NetBSD: hist.h,v 1.10 2003/08/07 16:44:31 agc Exp */ /*- diff --git a/net/tnftp/files/libedit/histedit.h b/net/tnftp/files/libedit/histedit.h index 3251fe2c356..05e5777e6db 100644 --- a/net/tnftp/files/libedit/histedit.h +++ b/net/tnftp/files/libedit/histedit.h @@ -1,4 +1,4 @@ -/* NetBSD: histedit.h,v 1.3 2005/05/31 02:07:02 lukem Exp */ +/* $NetBSD: histedit.h,v 1.4 2007/08/07 02:06:56 lukem Exp $ */ /* from NetBSD: histedit.h,v 1.26 2005/05/07 16:01:25 dsl Exp */ /*- diff --git a/net/tnftp/files/libedit/history.c b/net/tnftp/files/libedit/history.c index ace82b0ff6f..974159dc556 100644 --- a/net/tnftp/files/libedit/history.c +++ b/net/tnftp/files/libedit/history.c @@ -1,4 +1,4 @@ -/* NetBSD: history.c,v 1.5 2005/06/09 16:48:58 lukem Exp */ +/* $NetBSD: history.c,v 1.4 2007/08/07 02:06:57 lukem Exp $ */ /* from NetBSD: history.c,v 1.28 2004/11/27 18:31:45 christos Exp */ /*- diff --git a/net/tnftp/files/libedit/key.c b/net/tnftp/files/libedit/key.c index 9ed2d7e1d93..1696527ed01 100644 --- a/net/tnftp/files/libedit/key.c +++ b/net/tnftp/files/libedit/key.c @@ -1,4 +1,4 @@ -/* NetBSD: key.c,v 1.5 2005/06/09 16:48:58 lukem Exp */ +/* $NetBSD: key.c,v 1.4 2007/08/07 02:06:57 lukem Exp $ */ /* from NetBSD: key.c,v 1.15 2003/10/18 23:48:42 christos Exp */ /*- diff --git a/net/tnftp/files/libedit/key.h b/net/tnftp/files/libedit/key.h index 71f84a48bf0..5ae39816b4e 100644 --- a/net/tnftp/files/libedit/key.h +++ b/net/tnftp/files/libedit/key.h @@ -1,4 +1,4 @@ -/* NetBSD: key.h,v 1.2 2005/05/11 01:17:39 lukem Exp */ +/* $NetBSD: key.h,v 1.3 2007/08/07 02:06:57 lukem Exp $ */ /* from NetBSD: key.h,v 1.8 2003/08/07 16:44:32 agc Exp */ /*- diff --git a/net/tnftp/files/libedit/makelist.in b/net/tnftp/files/libedit/makelist.in index 6c5321ae9e1..9ed4a842aa9 100644 --- a/net/tnftp/files/libedit/makelist.in +++ b/net/tnftp/files/libedit/makelist.in @@ -1,7 +1,7 @@ #!/bin/sh - # @configure_input@ # -# NetBSD: makelist.in,v 1.2 2005/01/05 04:40:05 lukem Exp +# $NetBSD: makelist.in,v 1.3 2007/08/07 02:06:57 lukem Exp $ # # Copyright (c) 1992, 1993 # The Regents of the University of California. All rights reserved. diff --git a/net/tnftp/files/libedit/map.c b/net/tnftp/files/libedit/map.c index 97ef66fb2e5..344eb226b9e 100644 --- a/net/tnftp/files/libedit/map.c +++ b/net/tnftp/files/libedit/map.c @@ -1,4 +1,4 @@ -/* NetBSD: map.c,v 1.5 2005/06/09 16:48:58 lukem Exp */ +/* $NetBSD: map.c,v 1.4 2007/08/07 02:06:57 lukem Exp $ */ /* from NetBSD: map.c,v 1.20 2004/08/13 12:10:39 mycroft Exp */ /*- diff --git a/net/tnftp/files/libedit/map.h b/net/tnftp/files/libedit/map.h index 372a11d12bc..ed281de60f6 100644 --- a/net/tnftp/files/libedit/map.h +++ b/net/tnftp/files/libedit/map.h @@ -1,4 +1,4 @@ -/* NetBSD: map.h,v 1.2 2005/05/11 01:17:39 lukem Exp */ +/* $NetBSD: map.h,v 1.3 2007/08/07 02:06:57 lukem Exp $ */ /* from NetBSD: map.h,v 1.8 2003/08/07 16:44:32 agc Exp */ /*- diff --git a/net/tnftp/files/libedit/parse.c b/net/tnftp/files/libedit/parse.c index 75f2bbbd824..962aafd108c 100644 --- a/net/tnftp/files/libedit/parse.c +++ b/net/tnftp/files/libedit/parse.c @@ -1,4 +1,4 @@ -/* NetBSD: parse.c,v 1.6 2005/06/09 16:48:58 lukem Exp */ +/* $NetBSD: parse.c,v 1.4 2007/08/07 02:06:57 lukem Exp $ */ /* from NetBSD: parse.c,v 1.22 2005/05/29 04:58:15 lukem Exp */ /*- diff --git a/net/tnftp/files/libedit/parse.h b/net/tnftp/files/libedit/parse.h index 4c1c456a82e..4d398a96b22 100644 --- a/net/tnftp/files/libedit/parse.h +++ b/net/tnftp/files/libedit/parse.h @@ -1,4 +1,4 @@ -/* NetBSD: parse.h,v 1.3 2005/05/31 02:07:02 lukem Exp */ +/* $NetBSD: parse.h,v 1.4 2007/08/07 02:06:57 lukem Exp $ */ /* from NetBSD: parse.h,v 1.6 2005/05/29 04:58:15 lukem Exp */ /*- diff --git a/net/tnftp/files/libedit/prompt.c b/net/tnftp/files/libedit/prompt.c index 20af922fd39..0d3c363c50b 100644 --- a/net/tnftp/files/libedit/prompt.c +++ b/net/tnftp/files/libedit/prompt.c @@ -1,4 +1,4 @@ -/* NetBSD: prompt.c,v 1.5 2005/06/09 16:48:58 lukem Exp */ +/* $NetBSD: prompt.c,v 1.4 2007/08/07 02:06:57 lukem Exp $ */ /* from NetBSD: prompt.c,v 1.11 2003/08/07 16:44:32 agc Exp */ /*- diff --git a/net/tnftp/files/libedit/prompt.h b/net/tnftp/files/libedit/prompt.h index 6e30674b8b9..2b37935d634 100644 --- a/net/tnftp/files/libedit/prompt.h +++ b/net/tnftp/files/libedit/prompt.h @@ -1,4 +1,4 @@ -/* NetBSD: prompt.h,v 1.2 2005/05/11 01:17:39 lukem Exp */ +/* $NetBSD: prompt.h,v 1.3 2007/08/07 02:06:57 lukem Exp $ */ /* from NetBSD: prompt.h,v 1.6 2003/08/07 16:44:32 agc Exp */ /*- diff --git a/net/tnftp/files/libedit/read.c b/net/tnftp/files/libedit/read.c index 4ae25057f6c..29a6069af82 100644 --- a/net/tnftp/files/libedit/read.c +++ b/net/tnftp/files/libedit/read.c @@ -1,4 +1,4 @@ -/* NetBSD: read.c,v 1.7 2005/06/09 16:48:58 lukem Exp */ +/* $NetBSD: read.c,v 1.4 2007/08/07 02:06:57 lukem Exp $ */ /* from NetBSD: read.c,v 1.35 2005/03/09 23:55:02 christos Exp */ /*- diff --git a/net/tnftp/files/libedit/read.h b/net/tnftp/files/libedit/read.h index dc4bcff5274..77c063248a7 100644 --- a/net/tnftp/files/libedit/read.h +++ b/net/tnftp/files/libedit/read.h @@ -1,4 +1,4 @@ -/* NetBSD: read.h,v 1.2 2005/05/11 01:17:39 lukem Exp */ +/* $NetBSD: read.h,v 1.3 2007/08/07 02:06:57 lukem Exp $ */ /* from NetBSD: read.h,v 1.4 2004/02/27 14:52:18 christos Exp */ /*- diff --git a/net/tnftp/files/libedit/readline/readline.h b/net/tnftp/files/libedit/readline/readline.h index 78606d9cf4e..de2e3f0b615 100644 --- a/net/tnftp/files/libedit/readline/readline.h +++ b/net/tnftp/files/libedit/readline/readline.h @@ -1,4 +1,4 @@ -/* NetBSD: readline.h,v 1.3 2005/05/31 02:07:02 lukem Exp */ +/* $NetBSD: readline.h,v 1.4 2007/08/07 02:06:58 lukem Exp $ */ /* from NetBSD: readline.h,v 1.14 2005/05/27 11:35:07 agc Exp */ /*- diff --git a/net/tnftp/files/libedit/refresh.c b/net/tnftp/files/libedit/refresh.c index ea44c7e1461..5d41bc2fc22 100644 --- a/net/tnftp/files/libedit/refresh.c +++ b/net/tnftp/files/libedit/refresh.c @@ -1,4 +1,4 @@ -/* NetBSD: refresh.c,v 1.5 2005/06/09 16:48:58 lukem Exp */ +/* $NetBSD: refresh.c,v 1.4 2007/08/07 02:06:57 lukem Exp $ */ /* from NetBSD: refresh.c,v 1.26 2003/08/07 16:44:33 agc Exp */ /*- diff --git a/net/tnftp/files/libedit/refresh.h b/net/tnftp/files/libedit/refresh.h index f8bfdbc9cd9..8de0d0bd81d 100644 --- a/net/tnftp/files/libedit/refresh.h +++ b/net/tnftp/files/libedit/refresh.h @@ -1,4 +1,4 @@ -/* NetBSD: refresh.h,v 1.2 2005/05/11 01:17:39 lukem Exp */ +/* $NetBSD: refresh.h,v 1.3 2007/08/07 02:06:57 lukem Exp $ */ /* from NetBSD: refresh.h,v 1.5 2003/08/07 16:44:33 agc Exp */ /*- diff --git a/net/tnftp/files/libedit/search.c b/net/tnftp/files/libedit/search.c index 27bc7e6b174..2fb7b5fdade 100644 --- a/net/tnftp/files/libedit/search.c +++ b/net/tnftp/files/libedit/search.c @@ -1,4 +1,4 @@ -/* NetBSD: search.c,v 1.5 2005/06/09 16:48:58 lukem Exp */ +/* $NetBSD: search.c,v 1.4 2007/08/07 02:06:57 lukem Exp $ */ /* from NetBSD: search.c,v 1.20 2004/11/04 01:16:03 christos Exp */ /*- diff --git a/net/tnftp/files/libedit/search.h b/net/tnftp/files/libedit/search.h index f8b90284281..5a591288e6e 100644 --- a/net/tnftp/files/libedit/search.h +++ b/net/tnftp/files/libedit/search.h @@ -1,4 +1,4 @@ -/* NetBSD: search.h,v 1.2 2005/05/11 01:17:39 lukem Exp */ +/* $NetBSD: search.h,v 1.3 2007/08/07 02:06:57 lukem Exp $ */ /* from NetBSD: search.h,v 1.8 2003/10/18 23:27:36 christos Exp */ /*- diff --git a/net/tnftp/files/libedit/sig.c b/net/tnftp/files/libedit/sig.c index a134612ef9e..40032089215 100644 --- a/net/tnftp/files/libedit/sig.c +++ b/net/tnftp/files/libedit/sig.c @@ -1,4 +1,4 @@ -/* NetBSD: sig.c,v 1.6 2005/06/09 16:48:58 lukem Exp */ +/* $NetBSD: sig.c,v 1.4 2007/08/07 02:06:58 lukem Exp $ */ /* from NetBSD: sig.c,v 1.11 2003/08/07 16:44:33 agc Exp */ /*- diff --git a/net/tnftp/files/libedit/sig.h b/net/tnftp/files/libedit/sig.h index e478d64cfbe..e000536ef25 100644 --- a/net/tnftp/files/libedit/sig.h +++ b/net/tnftp/files/libedit/sig.h @@ -1,4 +1,4 @@ -/* NetBSD: sig.h,v 1.2 2005/05/11 01:17:39 lukem Exp */ +/* $NetBSD: sig.h,v 1.3 2007/08/07 02:06:58 lukem Exp $ */ /* from NetBSD: sig.h,v 1.5 2003/08/07 16:44:33 agc Exp */ /*- diff --git a/net/tnftp/files/libedit/sys.h b/net/tnftp/files/libedit/sys.h index f5fe7c5936a..4f3a953fbd3 100644 --- a/net/tnftp/files/libedit/sys.h +++ b/net/tnftp/files/libedit/sys.h @@ -1,4 +1,4 @@ -/* NetBSD: sys.h,v 1.4 2005/05/27 04:58:05 lukem Exp */ +/* $NetBSD: sys.h,v 1.4 2007/08/07 02:06:58 lukem Exp $ */ /* from NetBSD: sys.h,v 1.9 2004/01/17 17:57:40 christos Exp */ /*- diff --git a/net/tnftp/files/libedit/term.c b/net/tnftp/files/libedit/term.c index b1a3ba2921b..636e7e15b0f 100644 --- a/net/tnftp/files/libedit/term.c +++ b/net/tnftp/files/libedit/term.c @@ -1,4 +1,4 @@ -/* NetBSD: term.c,v 1.5 2005/06/09 16:48:58 lukem Exp */ +/* $NetBSD: term.c,v 1.4 2007/08/07 02:06:58 lukem Exp $ */ /* from NetBSD: term.c,v 1.40 2004/05/22 23:21:28 christos Exp */ /*- diff --git a/net/tnftp/files/libedit/term.h b/net/tnftp/files/libedit/term.h index 49f8ec5affb..efcd61e51fb 100644 --- a/net/tnftp/files/libedit/term.h +++ b/net/tnftp/files/libedit/term.h @@ -1,4 +1,4 @@ -/* NetBSD: term.h,v 1.3 2005/05/31 02:07:02 lukem Exp */ +/* $NetBSD: term.h,v 1.4 2007/08/07 02:06:58 lukem Exp $ */ /* from NetBSD: term.h,v 1.16 2005/03/15 00:10:40 christos Exp */ /*- diff --git a/net/tnftp/files/libedit/tokenizer.c b/net/tnftp/files/libedit/tokenizer.c index 096b0e556e9..ce5bad3cdb1 100644 --- a/net/tnftp/files/libedit/tokenizer.c +++ b/net/tnftp/files/libedit/tokenizer.c @@ -1,4 +1,4 @@ -/* NetBSD: tokenizer.c,v 1.5 2005/06/09 16:48:58 lukem Exp */ +/* $NetBSD: tokenizer.c,v 1.4 2007/08/07 02:06:58 lukem Exp $ */ /* from NetBSD: tokenizer.c,v 1.14 2003/12/05 13:37:48 lukem Exp */ /*- diff --git a/net/tnftp/files/libedit/tty.c b/net/tnftp/files/libedit/tty.c index 23acd59aff0..1822ccf45df 100644 --- a/net/tnftp/files/libedit/tty.c +++ b/net/tnftp/files/libedit/tty.c @@ -1,4 +1,4 @@ -/* NetBSD: tty.c,v 1.7 2005/06/09 16:48:58 lukem Exp */ +/* $NetBSD: tty.c,v 1.4 2007/08/07 02:06:58 lukem Exp $ */ /* from NetBSD: tty.c,v 1.22 2005/05/29 03:55:37 christos Exp */ /*- diff --git a/net/tnftp/files/libedit/tty.h b/net/tnftp/files/libedit/tty.h index f3d92f8f593..1bbb572c79d 100644 --- a/net/tnftp/files/libedit/tty.h +++ b/net/tnftp/files/libedit/tty.h @@ -1,4 +1,4 @@ -/* NetBSD: tty.h,v 1.3 2005/06/01 11:42:24 lukem Exp */ +/* $NetBSD: tty.h,v 1.4 2007/08/07 02:06:58 lukem Exp $ */ /* from NetBSD: tty.h,v 1.10 2003/08/07 16:44:34 agc Exp */ /*- diff --git a/net/tnftp/files/libedit/vi.c b/net/tnftp/files/libedit/vi.c index 98e6b9309bc..e052febefeb 100644 --- a/net/tnftp/files/libedit/vi.c +++ b/net/tnftp/files/libedit/vi.c @@ -1,4 +1,4 @@ -/* NetBSD: vi.c,v 1.6 2005/06/09 16:48:58 lukem Exp */ +/* $NetBSD: vi.c,v 1.4 2007/08/07 02:06:58 lukem Exp $ */ /* from NetBSD: vi.c,v 1.21 2005/04/25 01:06:03 matt Exp */ /*- diff --git a/net/tnftp/files/libnetbsd/Makefile.in b/net/tnftp/files/libnetbsd/Makefile.in index 7cc3d64d5b2..5ea81073630 100644 --- a/net/tnftp/files/libnetbsd/Makefile.in +++ b/net/tnftp/files/libnetbsd/Makefile.in @@ -1,4 +1,4 @@ -# NetBSD: Makefile.in,v 1.5 2005/06/10 04:36:12 lukem Exp +# $NetBSD: Makefile.in,v 1.4 2007/08/07 02:06:58 lukem Exp $ # srcdir = @srcdir@ diff --git a/net/tnftp/files/libnetbsd/err.c b/net/tnftp/files/libnetbsd/err.c index 64004688c56..429c6b60f47 100644 --- a/net/tnftp/files/libnetbsd/err.c +++ b/net/tnftp/files/libnetbsd/err.c @@ -1,4 +1,4 @@ -/* NetBSD: err.c,v 1.4 2005/05/11 01:01:56 lukem Exp */ +/* $NetBSD: err.c,v 1.3 2007/08/07 02:06:58 lukem Exp $ */ /* * Copyright 1997-2000 Luke Mewburn <lukem@NetBSD.org>. diff --git a/net/tnftp/files/libnetbsd/fgetln.c b/net/tnftp/files/libnetbsd/fgetln.c index 25bfe98391c..1fa6c30b553 100644 --- a/net/tnftp/files/libnetbsd/fgetln.c +++ b/net/tnftp/files/libnetbsd/fgetln.c @@ -1,4 +1,4 @@ -/* NetBSD: fgetln.c,v 1.2 2003/02/28 10:44:46 lukem Exp */ +/* $NetBSD: fgetln.c,v 1.3 2007/08/07 02:06:58 lukem Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -15,11 +15,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the NetBSD - * Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation nor the names of its + * 3. Neither the name of The NetBSD Foundation nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * @@ -56,8 +52,8 @@ fgetln(fp, len) if (fgets(buf, bufsiz, fp) == NULL) return NULL; - *len = 0; + *len = 0; while ((ptr = strchr(&buf[*len], '\n')) == NULL) { size_t nbufsiz = bufsiz + BUFSIZ; char *nbuf = realloc(buf, nbufsiz); diff --git a/net/tnftp/files/libnetbsd/fparseln.c b/net/tnftp/files/libnetbsd/fparseln.c deleted file mode 100644 index 207b35ee064..00000000000 --- a/net/tnftp/files/libnetbsd/fparseln.c +++ /dev/null @@ -1,207 +0,0 @@ -/* NetBSD: fparseln.c,v 1.3 2005/05/11 01:01:56 lukem Exp */ -/* from NetBSD: fparseln.c,v 1.5 1997/12/01 02:58:41 lukem Exp */ - -/* - * Copyright (c) 1997 Christos Zoulas. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Christos Zoulas. - * 4. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "tnftp.h" - -static int isescaped(const char *, const char *, int); - -/* isescaped(): - * Return true if the character in *p that belongs to a string - * that starts in *sp, is escaped by the escape character esc. - */ -static int -isescaped(const char *sp, const char *p, int esc) -{ - const char *cp; - size_t ne; - - /* No escape character */ - if (esc == '\0') - return 1; - - /* Count the number of escape characters that precede ours */ - for (ne = 0, cp = p; --cp >= sp && *cp == esc; ne++) - continue; - - /* Return true if odd number of escape characters */ - return (ne & 1) != 0; -} - - -/* fparseln(): - * Read a line from a file parsing continuations ending in \ - * and eliminating trailing newlines, or comments starting with - * the comment char. - */ -char * -fparseln(FILE *fp, size_t *size, size_t *lineno, const char str[3], int flags) -{ - static const char dstr[3] = { '\\', '\\', '#' }; - - size_t s, len; - char *buf; - char *ptr, *cp; - int cnt; - char esc, con, nl, com; - - len = 0; - buf = NULL; - cnt = 1; - - if (str == NULL) - str = dstr; - - esc = str[0]; - con = str[1]; - com = str[2]; - /* - * XXX: it would be cool to be able to specify the newline character, - * but unfortunately, fgetln does not let us - */ - nl = '\n'; - - while (cnt) { - cnt = 0; - - if (lineno) - (*lineno)++; - - if ((ptr = fgetln(fp, &s)) == NULL) - break; - - if (s && com) { /* Check and eliminate comments */ - for (cp = ptr; cp < ptr + s; cp++) - if (*cp == com && !isescaped(ptr, cp, esc)) { - s = cp - ptr; - cnt = s == 0 && buf == NULL; - break; - } - } - - if (s && nl) { /* Check and eliminate newlines */ - cp = &ptr[s - 1]; - - if (*cp == nl) - s--; /* forget newline */ - } - - if (s && con) { /* Check and eliminate continuations */ - cp = &ptr[s - 1]; - - if (*cp == con && !isescaped(ptr, cp, esc)) { - s--; /* forget escape */ - cnt = 1; - } - } - - if (s == 0 && buf != NULL) - continue; - - if ((cp = realloc(buf, len + s + 1)) == NULL) { - free(buf); - return NULL; - } - buf = cp; - - (void) memcpy(buf + len, ptr, s); - len += s; - buf[len] = '\0'; - } - - if ((flags & FPARSELN_UNESCALL) != 0 && esc && buf != NULL && - strchr(buf, esc) != NULL) { - ptr = cp = buf; - while (cp[0] != '\0') { - int skipesc; - - while (cp[0] != '\0' && cp[0] != esc) - *ptr++ = *cp++; - if (cp[0] == '\0' || cp[1] == '\0') - break; - - skipesc = 0; - if (cp[1] == com) - skipesc += (flags & FPARSELN_UNESCCOMM); - if (cp[1] == con) - skipesc += (flags & FPARSELN_UNESCCONT); - if (cp[1] == esc) - skipesc += (flags & FPARSELN_UNESCESC); - if (cp[1] != com && cp[1] != con && cp[1] != esc) - skipesc = (flags & FPARSELN_UNESCREST); - - if (skipesc) - cp++; - else - *ptr++ = *cp++; - *ptr++ = *cp++; - } - *ptr = '\0'; - len = strlen(buf); - } - - if (size) - *size = len; - return buf; -} - -#ifdef TEST - -int main(int, char *[]); - -int -main(int argc, char *argv[]) -{ - char *ptr; - size_t size, line; - - line = 0; - while ((ptr = fparseln(stdin, &size, &line, NULL, - FPARSELN_UNESCALL)) != NULL) - printf("line %d (%d) |%s|\n", line, size, ptr); - return 0; -} - -/* - -# This is a test -line 1 -line 2 \ -line 3 # Comment -line 4 \# Not comment \\\\ - -# And a comment \ -line 5 \\\ -line 6 - -*/ - -#endif /* TEST */ diff --git a/net/tnftp/files/libnetbsd/fseeko.c b/net/tnftp/files/libnetbsd/fseeko.c index e6752d7469f..f4390bb2f0d 100644 --- a/net/tnftp/files/libnetbsd/fseeko.c +++ b/net/tnftp/files/libnetbsd/fseeko.c @@ -1,4 +1,4 @@ -/* NetBSD: fseeko.c,v 1.4 2005/05/11 01:01:56 lukem Exp */ +/* $NetBSD: fseeko.c,v 1.3 2007/08/07 02:06:59 lukem Exp $ */ /* * Copyright 2002 Luke Mewburn <lukem@NetBSD.org>. diff --git a/net/tnftp/files/libnetbsd/ftpglob.h b/net/tnftp/files/libnetbsd/ftpglob.h index 044dad5c22f..85e91da0813 100644 --- a/net/tnftp/files/libnetbsd/ftpglob.h +++ b/net/tnftp/files/libnetbsd/ftpglob.h @@ -1,5 +1,5 @@ -/* NetBSD: ftpglob.h,v 1.3 2005/05/16 05:45:40 lukem Exp */ -/* from NetBSD: glob.h,v 1.19 2005/02/03 04:39:32 perry Exp */ +/* $NetBSD: ftpglob.h,v 1.4 2007/08/07 02:06:59 lukem Exp $ */ +/* from NetBSD: glob.h,v 1.21 2006/03/26 18:11:22 christos Exp */ /* * Copyright (c) 1989, 1993 @@ -38,10 +38,17 @@ #ifndef _GLOB_H_ #define _GLOB_H_ +#ifndef __gl_size_t +#define __gl_size_t size_t +#endif +#ifndef __gl_stat_t +#define __gl_stat_t struct stat +#endif + typedef struct { - int gl_pathc; /* Count of total paths so far. */ - int gl_matchc; /* Count of paths matching pattern. */ - int gl_offs; /* Reserved at beginning of gl_pathv. */ + __gl_size_t gl_pathc; /* Count of total paths so far. */ + __gl_size_t gl_matchc; /* Count of paths matching pattern. */ + __gl_size_t gl_offs; /* Reserved at beginning of gl_pathv. */ int gl_flags; /* Copy of flags parameter to glob. */ char **gl_pathv; /* List of paths matching pattern. */ /* Copy of errfunc parameter to glob. */ @@ -55,8 +62,8 @@ typedef struct { void (*gl_closedir)(void *); struct dirent *(*gl_readdir)(void *); void *(*gl_opendir)(const char *); - int (*gl_lstat)(const char *, struct stat *); - int (*gl_stat)(const char *, struct stat *); + int (*gl_lstat)(const char *, __gl_stat_t *); + int (*gl_stat)(const char *, __gl_stat_t *); } glob_t; #define GLOB_APPEND 0x0001 /* Append to output from previous call. */ diff --git a/net/tnftp/files/libnetbsd/ftpvis.h b/net/tnftp/files/libnetbsd/ftpvis.h index acb1b4e3bc2..e4f10274ebb 100644 --- a/net/tnftp/files/libnetbsd/ftpvis.h +++ b/net/tnftp/files/libnetbsd/ftpvis.h @@ -1,4 +1,4 @@ -/* NetBSD: ftpvis.h,v 1.3 2005/05/16 13:25:48 lukem Exp */ +/* $NetBSD: ftpvis.h,v 1.4 2007/08/07 02:06:59 lukem Exp $ */ /* from NetBSD: vis.h,v 1.15 2005/02/03 04:39:32 perry Exp */ /*- diff --git a/net/tnftp/files/libnetbsd/getaddrinfo.c b/net/tnftp/files/libnetbsd/getaddrinfo.c index 82f8139ca90..736044fad04 100644 --- a/net/tnftp/files/libnetbsd/getaddrinfo.c +++ b/net/tnftp/files/libnetbsd/getaddrinfo.c @@ -1,4 +1,4 @@ -/* NetBSD: getaddrinfo.c,v 1.3 2005/05/11 01:01:56 lukem Exp */ +/* $NetBSD: getaddrinfo.c,v 1.3 2007/08/07 02:06:59 lukem Exp $ */ /* from ? */ /* @@ -225,7 +225,7 @@ do { \ #define MATCH(x, y, w) \ ((x) == (y) || (/*CONSTCOND*/(w) && ((x) == ANY || (y) == ANY))) -char * +const char * gai_strerror(int ecode) { if (ecode < 0 || ecode > EAI_MAX) @@ -571,14 +571,14 @@ explore_fqdn(const struct addrinfo *pai, const char *hostname, hp = getipnodebyname(hostname, pai->ai_family, pai->ai_flags & AI_ADDRCONFIG, &h_error); #else -#if HAVE_GETHOSTBYNAME2 +#if defined(HAVE_GETHOSTBYNAME2) hp = gethostbyname2(hostname, pai->ai_family); #else if (pai->ai_family != AF_INET) return 0; hp = gethostbyname(hostname); -#endif /*HAVE_GETHOSTBYNAME2*/ -#if HAVE_H_ERRNO +#endif /* defined(HAVE_GETHOSTBYNAME2) */ +#if defined(HAVE_H_ERRNO) h_error = h_errno; #else h_error = EINVAL; @@ -919,7 +919,7 @@ get_ai(const struct addrinfo *pai, const struct afd *afd, const char *addr) memcpy(ai, pai, sizeof(struct addrinfo)); ai->ai_addr = (struct sockaddr *)(void *)(ai + 1); memset(ai->ai_addr, 0, (size_t)afd->a_socklen); -#if HAVE_SOCKADDR_SA_LEN +#if defined(HAVE_STRUCT_SOCKADDR_SA_LEN) ai->ai_addr->sa_len = afd->a_socklen; #endif ai->ai_addrlen = afd->a_socklen; diff --git a/net/tnftp/files/libnetbsd/getnameinfo.c b/net/tnftp/files/libnetbsd/getnameinfo.c index 897f4ce068e..41208c024bf 100644 --- a/net/tnftp/files/libnetbsd/getnameinfo.c +++ b/net/tnftp/files/libnetbsd/getnameinfo.c @@ -1,4 +1,4 @@ -/* NetBSD: getnameinfo.c,v 1.5 2005/06/01 11:48:49 lukem Exp */ +/* $NetBSD: getnameinfo.c,v 1.4 2007/08/07 02:06:59 lukem Exp $ */ /* from ? */ /* @@ -103,7 +103,7 @@ getnameinfo(const struct sockaddr *sa, socklen_t salen, if (sa == NULL) return ENI_NOSOCKET; -#if HAVE_SOCKADDR_SA_LEN +#if defined(HAVE_STRUCT_SOCKADDR_SA_LEN) if (sa->sa_len != salen) return ENI_SALEN; #endif diff --git a/net/tnftp/files/libnetbsd/glob.c b/net/tnftp/files/libnetbsd/glob.c index c2635cb7841..ce2ef2b3256 100644 --- a/net/tnftp/files/libnetbsd/glob.c +++ b/net/tnftp/files/libnetbsd/glob.c @@ -1,5 +1,5 @@ -/* NetBSD: glob.c,v 1.5 2005/06/01 11:48:49 lukem Exp */ -/* from NetBSD: __glob13.c,v 1.25 2003/08/07 16:42:45 agc Exp */ +/* $NetBSD: glob.c,v 1.4 2007/08/07 02:06:59 lukem Exp $ */ +/* from NetBSD: glob.c,v 1.16 2006/03/26 18:11:22 christos Exp */ /* * Copyright (c) 1989, 1993 @@ -77,7 +77,7 @@ #define SLASH '/' #define COMMA ',' -#ifndef DEBUG +#ifndef USE_8BIT_CHARS #define M_QUOTE 0x8000 #define M_PROTECT 0x4000 @@ -88,10 +88,10 @@ typedef unsigned short Char; #else -#define M_QUOTE 0x80 -#define M_PROTECT 0x40 -#define M_MASK 0xff -#define M_ASCII 0x7f +#define M_QUOTE (Char)0x80 +#define M_PROTECT (Char)0x40 +#define M_MASK (Char)0xff +#define M_ASCII (Char)0x7f typedef char Char; @@ -111,10 +111,10 @@ typedef char Char; static int compare(const void *, const void *); static int g_Ctoc(const Char *, char *, size_t); -static int g_lstat(Char *, struct stat *, glob_t *); +static int g_lstat(Char *, __gl_stat_t *, glob_t *); static DIR *g_opendir(Char *, glob_t *); static Char *g_strchr(const Char *, int); -static int g_stat(Char *, struct stat *, glob_t *); +static int g_stat(Char *, __gl_stat_t *, glob_t *); static int glob0(const Char *, glob_t *); static int glob1(Char *, glob_t *, size_t *); static int glob2(Char *, Char *, Char *, Char *, glob_t *, size_t *); @@ -388,11 +388,11 @@ static int glob0(const Char *pattern, glob_t *pglob) { const Char *qpatnext; - int c, error, oldpathc; + int c, error; + __gl_size_t oldpathc; Char *bufnext, patbuf[MAXPATHLEN+1]; - size_t limit; + size_t limit = 0; - limit = 0; if ((qpatnext = globtilde(pattern, patbuf, sizeof(patbuf), pglob)) == NULL) return GLOB_ABEND; @@ -497,7 +497,9 @@ glob1(Char *pattern, glob_t *pglob, size_t *limit) * we save one character so that we can use ptr >= limit, * in the general case when we are appending non nul chars only. */ - return(glob2(pathbuf, pathbuf, pathbuf + sizeof(pathbuf) - 1, pattern, + return(glob2(pathbuf, pathbuf, + pathbuf + (sizeof(pathbuf) / sizeof(*pathbuf)) - 1, + pattern, pglob, limit)); } @@ -510,7 +512,7 @@ static int glob2(Char *pathbuf, Char *pathend, Char *pathlim, Char *pattern, glob_t *pglob, size_t *limit) { - struct stat sb; + __gl_stat_t sb; Char *p, *q; int anymeta; @@ -687,8 +689,7 @@ static int globextend(const Char *path, glob_t *pglob, size_t *limit) { char **pathv; - int i; - size_t newsize, len; + size_t i, newsize, len; char *copy; const Char *p; @@ -701,7 +702,7 @@ globextend(const Char *path, glob_t *pglob, size_t *limit) if (pglob->gl_pathv == NULL && pglob->gl_offs > 0) { /* first time around -- clear initial gl_offs items */ pathv += pglob->gl_offs; - for (i = pglob->gl_offs; --i >= 0; ) + for (i = pglob->gl_offs + 1; --i > 0; ) *--pathv = NULL; } pglob->gl_pathv = pathv; @@ -782,7 +783,7 @@ match(Char *name, Char *pat, Char *patend) void globfree(glob_t *pglob) { - int i; + size_t i; char **pp; if (pglob->gl_pathv != NULL) { @@ -815,7 +816,7 @@ g_opendir(Char *str, glob_t *pglob) } static int -g_lstat(Char *fn, struct stat *sb, glob_t *pglob) +g_lstat(Char *fn, __gl_stat_t *sb, glob_t *pglob) { char buf[MAXPATHLEN]; @@ -827,7 +828,7 @@ g_lstat(Char *fn, struct stat *sb, glob_t *pglob) } static int -g_stat(Char *fn, struct stat *sb, glob_t *pglob) +g_stat(Char *fn, __gl_stat_t *sb, glob_t *pglob) { char buf[MAXPATHLEN]; diff --git a/net/tnftp/files/libnetbsd/inet_ntop.c b/net/tnftp/files/libnetbsd/inet_ntop.c index ac2fde52109..3c22f1a2faf 100644 --- a/net/tnftp/files/libnetbsd/inet_ntop.c +++ b/net/tnftp/files/libnetbsd/inet_ntop.c @@ -1,5 +1,5 @@ -/* NetBSD: inet_ntop.c,v 1.6 2005/06/01 11:48:49 lukem Exp */ -/* from NetBSD: inet_ntop.c,v 1.2 2004/05/20 23:12:33 christos Exp */ +/* $NetBSD: inet_ntop.c,v 1.4 2007/08/07 02:06:59 lukem Exp $ */ +/* from NetBSD: inet_ntop.c,v 1.3 2006/05/10 21:53:15 mrg Exp */ /* * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") @@ -20,16 +20,17 @@ #include "tnftp.h" -#if HAVE_ARPA_NAMESER_H -#include <arpa/nameser.h> +#if defined(HAVE_ARPA_NAMESER_H) +# include <arpa/nameser.h> #endif - -#ifndef NS_IN6ADDRSZ -#define NS_IN6ADDRSZ 16 +#if !defined(NS_INADDRSZ) +# define NS_INADDRSZ 4 #endif - -#ifndef NS_INT16SZ -#define NS_INT16SZ 2 +#if !defined(NS_IN6ADDRSZ) +# define NS_IN6ADDRSZ 16 +#endif +#if !defined(NS_INT16SZ) +# define NS_INT16SZ 2 #endif /* @@ -38,7 +39,9 @@ */ static const char *inet_ntop4(const unsigned char *src, char *dst, socklen_t size); +#ifdef INET6 static const char *inet_ntop6(const unsigned char *src, char *dst, socklen_t size); +#endif /* INET6 */ /* char * * inet_ntop(af, src, dst, size) @@ -58,7 +61,7 @@ inet_ntop(int af, const void *src, char *dst, socklen_t size) #ifdef INET6 case AF_INET6: return (inet_ntop6(src, dst, size)); -#endif +#endif /* INET6 */ default: errno = EAFNOSUPPORT; return (NULL); @@ -127,6 +130,8 @@ inet_ntop6(const unsigned char *src, char *dst, socklen_t size) words[i / 2] |= (src[i] << ((1 - (i % 2)) << 3)); best.base = -1; cur.base = -1; + best.len = -1; /* XXX gcc */ + cur.len = -1; /* XXX gcc */ for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) { if (words[i] == 0) { if (cur.base == -1) @@ -203,4 +208,4 @@ inet_ntop6(const unsigned char *src, char *dst, socklen_t size) strlcpy(dst, tmp, size); return (dst); } -#endif +#endif /* INET6 */ diff --git a/net/tnftp/files/libnetbsd/inet_pton.c b/net/tnftp/files/libnetbsd/inet_pton.c index 9072c48a405..16a9f90c666 100644 --- a/net/tnftp/files/libnetbsd/inet_pton.c +++ b/net/tnftp/files/libnetbsd/inet_pton.c @@ -1,5 +1,5 @@ -/* NetBSD: inet_pton.c,v 1.5 2005/06/01 11:48:49 lukem Exp */ -/* from NetBSD: inet_pton.c,v 1.2 2004/05/20 23:12:33 christos Exp */ +/* $NetBSD: inet_pton.c,v 1.4 2007/08/07 02:06:59 lukem Exp $ */ +/* from NetBSD: inet_pton.c,v 1.3 2006/09/26 05:59:18 lukem Exp */ /* * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC") @@ -20,20 +20,17 @@ #include "tnftp.h" -#if HAVE_ARPA_NAMESER_H -#include <arpa/nameser.h> +#if defined(HAVE_ARPA_NAMESER_H) +# include <arpa/nameser.h> #endif - -#ifndef NS_INADDRSZ -#define NS_INADDRSZ 4 +#if !defined(NS_INADDRSZ) +# define NS_INADDRSZ 4 #endif - -#ifndef NS_IN6ADDRSZ -#define NS_IN6ADDRSZ 16 +#if !defined(NS_IN6ADDRSZ) +# define NS_IN6ADDRSZ 16 #endif - -#ifndef NS_INT16SZ -#define NS_INT16SZ 2 +#if !defined(NS_INT16SZ) +# define NS_INT16SZ 2 #endif /* @@ -44,7 +41,7 @@ static int inet_pton4(const char *src, unsigned char *dst, int pton); #ifdef INET6 static int inet_pton6(const char *src, unsigned char *dst); -#endif +#endif /* INET6 */ /* int * inet_pton(af, src, dst) @@ -67,7 +64,7 @@ inet_pton(int af, const char *src, void *dst) #ifdef INET6 case AF_INET6: return (inet_pton6(src, dst)); -#endif +#endif /* INET6 */ default: errno = EAFNOSUPPORT; return (-1); @@ -94,7 +91,7 @@ inet_pton4(const char *src, unsigned char *dst, int pton) int n; unsigned char c; unsigned int parts[4]; - unsigned int *pp = parts; + register unsigned int *pp = parts; c = *src; for (;;) { @@ -249,7 +246,7 @@ inet_pton6(const char *src, unsigned char *dst) continue; } else if (*src == '\0') return (0); - if (tp + INT16SZ > endp) + if (tp + NS_INT16SZ > endp) return (0); *tp++ = (unsigned char) (val >> 8) & 0xff; *tp++ = (unsigned char) val & 0xff; @@ -292,4 +289,4 @@ inet_pton6(const char *src, unsigned char *dst) memcpy(dst, tmp, NS_IN6ADDRSZ); return (1); } -#endif +#endif /* INET6 */ diff --git a/net/tnftp/files/libnetbsd/mkstemp.c b/net/tnftp/files/libnetbsd/mkstemp.c index d1b40ea42b8..043d3a939a3 100644 --- a/net/tnftp/files/libnetbsd/mkstemp.c +++ b/net/tnftp/files/libnetbsd/mkstemp.c @@ -1,4 +1,4 @@ -/* NetBSD: mkstemp.c,v 1.5 2005/06/01 11:48:49 lukem Exp */ +/* $NetBSD: mkstemp.c,v 1.4 2007/08/07 02:06:59 lukem Exp $ */ /* from NetBSD: gettemp.c,v 1.13 2003/12/05 00:57:36 uebayasi Exp */ /* diff --git a/net/tnftp/files/libnetbsd/setprogname.c b/net/tnftp/files/libnetbsd/setprogname.c index 6e60d5d22ae..b4aab45aacd 100644 --- a/net/tnftp/files/libnetbsd/setprogname.c +++ b/net/tnftp/files/libnetbsd/setprogname.c @@ -1,4 +1,4 @@ -/* NetBSD: setprogname.c,v 1.3 2005/05/11 01:01:56 lukem Exp */ +/* $NetBSD: setprogname.c,v 1.3 2007/08/07 02:07:00 lukem Exp $ */ /* from NetBSD: setprogname.c,v 1.3 2002/01/31 19:21:58 tv Exp */ /*- diff --git a/net/tnftp/files/libnetbsd/sl_init.c b/net/tnftp/files/libnetbsd/sl_init.c index f1b64ecffd2..5520492463d 100644 --- a/net/tnftp/files/libnetbsd/sl_init.c +++ b/net/tnftp/files/libnetbsd/sl_init.c @@ -1,4 +1,4 @@ -/* NetBSD: sl_init.c,v 1.4 2005/05/16 06:37:47 lukem Exp */ +/* $NetBSD: sl_init.c,v 1.4 2007/08/07 02:07:00 lukem Exp $ */ /* from NetBSD: stringlist.c,v 1.10 2000/01/25 16:24:40 enami Exp */ /*- diff --git a/net/tnftp/files/libnetbsd/snprintf.c b/net/tnftp/files/libnetbsd/snprintf.c index 4765ca8751d..476f81215bb 100644 --- a/net/tnftp/files/libnetbsd/snprintf.c +++ b/net/tnftp/files/libnetbsd/snprintf.c @@ -1,4 +1,4 @@ -/* NetBSD: snprintf.c,v 1.4 2005/05/11 01:01:56 lukem Exp */ +/* $NetBSD: snprintf.c,v 1.3 2007/08/07 02:07:00 lukem Exp $ */ /* * Copyright Patrick Powell 1995 @@ -60,13 +60,13 @@ #include "tnftp.h" -#if HAVE_LONG_DOUBLE +#if defined(HAVE_LONG_DOUBLE) #define LDOUBLE long double #else #define LDOUBLE double #endif -#if HAVE_LONG_LONG +#if defined(HAVE_LONG_LONG_INT) #define LLONG long long #else #define LLONG long @@ -731,7 +731,7 @@ main(int argc, char *argv[]) "%+22.33d", "%01.3d", "%4d", -#if HAVE_LONG_LONG +#if defined(HAVE_LONG_LONG_INT) "%12lld", #endif NULL diff --git a/net/tnftp/files/libnetbsd/strdup.c b/net/tnftp/files/libnetbsd/strdup.c index 75a4005e263..bb1b73feb12 100644 --- a/net/tnftp/files/libnetbsd/strdup.c +++ b/net/tnftp/files/libnetbsd/strdup.c @@ -1,4 +1,4 @@ -/* NetBSD: strdup.c,v 1.4 2005/05/16 06:40:04 lukem Exp */ +/* $NetBSD: strdup.c,v 1.4 2007/08/07 02:07:00 lukem Exp $ */ /* from NetBSD: strdup.c,v 1.13 2003/08/07 16:43:50 agc Exp */ /* diff --git a/net/tnftp/files/libnetbsd/strerror.c b/net/tnftp/files/libnetbsd/strerror.c index 7d610c042fa..584abaf06ca 100644 --- a/net/tnftp/files/libnetbsd/strerror.c +++ b/net/tnftp/files/libnetbsd/strerror.c @@ -1,4 +1,4 @@ -/* NetBSD: strerror.c,v 1.3 2005/05/11 01:01:56 lukem Exp */ +/* $NetBSD: strerror.c,v 1.3 2007/08/07 02:07:00 lukem Exp $ */ #include "tnftp.h" diff --git a/net/tnftp/files/libnetbsd/strlcat.c b/net/tnftp/files/libnetbsd/strlcat.c index 523a8b2506d..6847412a971 100644 --- a/net/tnftp/files/libnetbsd/strlcat.c +++ b/net/tnftp/files/libnetbsd/strlcat.c @@ -1,4 +1,4 @@ -/* NetBSD: strlcat.c,v 1.4 2005/05/16 06:55:48 lukem Exp */ +/* $NetBSD: strlcat.c,v 1.4 2007/08/07 02:07:00 lukem Exp $ */ /* from NetBSD: strlcat.c,v 1.16 2003/10/27 00:12:42 lukem Exp */ /* from OpenBSD: strlcat.c,v 1.10 2003/04/12 21:56:39 millert Exp */ diff --git a/net/tnftp/files/libnetbsd/strlcpy.c b/net/tnftp/files/libnetbsd/strlcpy.c index 7f2d4d07438..1cfd33ed5b0 100644 --- a/net/tnftp/files/libnetbsd/strlcpy.c +++ b/net/tnftp/files/libnetbsd/strlcpy.c @@ -1,4 +1,4 @@ -/* NetBSD: strlcpy.c,v 1.4 2005/05/16 06:58:06 lukem Exp */ +/* $NetBSD: strlcpy.c,v 1.4 2007/08/07 02:07:00 lukem Exp $ */ /* from NetBSD: strlcpy.c,v 1.14 2003/10/27 00:12:42 lukem Exp */ /* from OpenBSD: strlcpy.c,v 1.7 2003/04/12 21:56:39 millert Exp */ diff --git a/net/tnftp/files/libnetbsd/strptime.c b/net/tnftp/files/libnetbsd/strptime.c index 87f5b251278..a316a6cd0a0 100644 --- a/net/tnftp/files/libnetbsd/strptime.c +++ b/net/tnftp/files/libnetbsd/strptime.c @@ -1,4 +1,4 @@ -/* NetBSD: strptime.c,v 1.3 2005/05/11 01:01:56 lukem Exp */ +/* $NetBSD: strptime.c,v 1.3 2007/08/07 02:07:00 lukem Exp $ */ /* from NetBSD: strptime.c,v 1.18 1999/04/29 02:58:30 tv Exp */ /*- @@ -275,20 +275,23 @@ literal: case 'p': /* The locale's equivalent of AM/PM. */ LEGAL_ALT(0); /* AM? */ - if (strcasecmp(am_pm[0], bp) == 0) { + len = strlen(am_pm[0]); + if (strncasecmp(am_pm[0], bp, len) == 0) { if (tm->tm_hour > 11) return (0); - bp += strlen(am_pm[0]); + bp += len; break; } + /* PM? */ - else if (strcasecmp(am_pm[1], bp) == 0) { + len = strlen(am_pm[1]); + if (strncasecmp(am_pm[1], bp, len) == 0) { if (tm->tm_hour > 11) return (0); tm->tm_hour += 12; - bp += strlen(am_pm[1]); + bp += len; break; } diff --git a/net/tnftp/files/libnetbsd/strsep.c b/net/tnftp/files/libnetbsd/strsep.c index 762915452be..f7c433e9085 100644 --- a/net/tnftp/files/libnetbsd/strsep.c +++ b/net/tnftp/files/libnetbsd/strsep.c @@ -1,4 +1,4 @@ -/* NetBSD: strsep.c,v 1.4 2005/05/16 08:51:51 lukem Exp */ +/* $NetBSD: strsep.c,v 1.4 2007/08/07 02:07:01 lukem Exp $ */ /* from NetBSD: strsep.c,v 1.14 2003/08/07 16:43:52 agc Exp */ /*- diff --git a/net/tnftp/files/libnetbsd/strtoll.c b/net/tnftp/files/libnetbsd/strtoll.c index f2801d826fa..923b7cdb123 100644 --- a/net/tnftp/files/libnetbsd/strtoll.c +++ b/net/tnftp/files/libnetbsd/strtoll.c @@ -1,4 +1,4 @@ -/* NetBSD: strtoll.c,v 1.4 2005/05/16 11:27:58 lukem Exp */ +/* $NetBSD: strtoll.c,v 1.4 2007/08/07 02:07:01 lukem Exp $ */ /* from NetBSD: strtoll.c,v 1.6 2003/10/27 00:12:42 lukem Exp */ /*- diff --git a/net/tnftp/files/libnetbsd/strunvis.c b/net/tnftp/files/libnetbsd/strunvis.c index 562a5395dfd..ecb2d05e0f4 100644 --- a/net/tnftp/files/libnetbsd/strunvis.c +++ b/net/tnftp/files/libnetbsd/strunvis.c @@ -1,4 +1,4 @@ -/* NetBSD: strunvis.c,v 1.5 2005/06/01 11:48:49 lukem Exp */ +/* $NetBSD: strunvis.c,v 1.4 2007/08/07 02:07:01 lukem Exp $ */ /* from NetBSD: unvis.c,v 1.27 2005/05/16 11:42:04 lukem Exp */ /*- diff --git a/net/tnftp/files/libnetbsd/strvis.c b/net/tnftp/files/libnetbsd/strvis.c index f98d4d2a96d..69a2bc97034 100644 --- a/net/tnftp/files/libnetbsd/strvis.c +++ b/net/tnftp/files/libnetbsd/strvis.c @@ -1,4 +1,4 @@ -/* NetBSD: strvis.c,v 1.8 2005/06/01 11:48:49 lukem Exp */ +/* $NetBSD: strvis.c,v 1.4 2007/08/07 02:07:01 lukem Exp $ */ /* from NetBSD: vis.c,v 1.33 2005/05/28 13:11:14 lukem Exp */ /*- diff --git a/net/tnftp/files/libnetbsd/timegm.c b/net/tnftp/files/libnetbsd/timegm.c index 094f8d1aaee..d625b84622f 100644 --- a/net/tnftp/files/libnetbsd/timegm.c +++ b/net/tnftp/files/libnetbsd/timegm.c @@ -1,4 +1,4 @@ -/* NetBSD: timegm.c,v 1.3 2005/05/11 01:01:56 lukem Exp */ +/* $NetBSD: timegm.c,v 1.3 2007/08/07 02:07:01 lukem Exp $ */ /* from ? */ #include "tnftp.h" diff --git a/net/tnftp/files/libnetbsd/usleep.c b/net/tnftp/files/libnetbsd/usleep.c index 233485a0616..976571bb3e5 100644 --- a/net/tnftp/files/libnetbsd/usleep.c +++ b/net/tnftp/files/libnetbsd/usleep.c @@ -1,4 +1,4 @@ -/* NetBSD: usleep.c,v 1.4 2005/05/16 13:21:43 lukem Exp */ +/* $NetBSD: usleep.c,v 1.5 2007/08/07 02:07:01 lukem Exp $ */ /*- * Copyright (c) 1999,2000,2005 The NetBSD Foundation, Inc. @@ -41,9 +41,9 @@ int usleep(unsigned int usec) { -#if HAVE_POLL +#if defined(HAVE_POLL) return (poll(NULL, 0, usec / 1000)); -#elif HAVE_SELECT +#elif defined(HAVE_SELECT) struct timeval tv; tv.tv_sec = 0; diff --git a/net/tnftp/files/libnetbsd/utimes.c b/net/tnftp/files/libnetbsd/utimes.c index eedc89dbc93..b130eac5911 100644 --- a/net/tnftp/files/libnetbsd/utimes.c +++ b/net/tnftp/files/libnetbsd/utimes.c @@ -1,4 +1,4 @@ -/* NetBSD: utimes.c,v 1.3 2005/05/11 01:01:56 lukem Exp */ +/* $NetBSD: utimes.c,v 1.4 2007/08/07 02:07:01 lukem Exp $ */ /*- * Copyright (c) 2004 The NetBSD Foundation, Inc. diff --git a/net/tnftp/files/src/Makefile.in b/net/tnftp/files/src/Makefile.in index 9114bf3a8ec..ac763418e43 100644 --- a/net/tnftp/files/src/Makefile.in +++ b/net/tnftp/files/src/Makefile.in @@ -1,4 +1,4 @@ -# NetBSD: Makefile.in,v 1.5 2005/06/10 04:36:12 lukem Exp +# $NetBSD: Makefile.in,v 1.5 2007/08/07 02:07:01 lukem Exp $ # srcdir = @srcdir@ @@ -8,6 +8,7 @@ SHELL = /bin/sh prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ +datarootdir = @datarootdir@ mandir = @mandir@ transform = @program_transform_name@ diff --git a/net/tnftp/files/src/cmds.c b/net/tnftp/files/src/cmds.c index d9a99d28149..cfc3dcfdb30 100644 --- a/net/tnftp/files/src/cmds.c +++ b/net/tnftp/files/src/cmds.c @@ -1,8 +1,8 @@ -/* NetBSD: cmds.c,v 1.9 2005/06/10 04:05:01 lukem Exp */ -/* from NetBSD: cmds.c,v 1.115 2005/06/10 00:18:46 lukem Exp */ +/* $NetBSD: cmds.c,v 1.6 2007/08/07 02:07:01 lukem Exp $ */ +/* from NetBSD: cmds.c,v 1.123 2007/05/24 05:05:18 lukem Exp */ /*- - * Copyright (c) 1996-2005 The NetBSD Foundation, Inc. + * Copyright (c) 1996-2007 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation @@ -99,16 +99,46 @@ * SUCH DAMAGE. */ +#include "tnftp.h" + +#if 0 /* tnftp */ + +#include <sys/cdefs.h> +#ifndef lint +#if 0 +static char sccsid[] = "@(#)cmds.c 8.6 (Berkeley) 10/9/94"; +#else +__RCSID(" NetBSD: cmds.c,v 1.123 2007/05/24 05:05:18 lukem Exp "); +#endif +#endif /* not lint */ + /* * FTP User Program -- Command Routines. */ - -#include "tnftp.h" +#include <sys/types.h> +#include <sys/socket.h> +#include <sys/stat.h> +#include <sys/wait.h> +#include <arpa/ftp.h> + +#include <ctype.h> +#include <err.h> +#include <glob.h> +#include <limits.h> +#include <netdb.h> +#include <paths.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <time.h> +#include <unistd.h> + +#endif /* tnftp */ #include "ftp_var.h" #include "version.h" -struct types { +static struct types { char *t_name; char *t_mode; int t_type; @@ -122,30 +152,43 @@ struct types { { NULL } }; -sigjmp_buf jabort; -const char *mname; +static sigjmp_buf jabort; static int confirm(const char *, const char *); +static void mintr(int); +static void mabort(const char *); static const char *doprocess(char *, size_t, const char *, int, int, int); static const char *domap(char *, size_t, const char *); static const char *docase(char *, size_t, const char *); static const char *dotrans(char *, size_t, const char *); +/* + * Confirm if "cmd" is to be performed upon "file". + * If "file" is NULL, generate a "Continue with" prompt instead. + */ static int confirm(const char *cmd, const char *file) { const char *errormsg; char line[BUFSIZ]; + const char *promptleft, *promptright; if (!interactive || confirmrest) return (1); + if (file == NULL) { + promptleft = "Continue with"; + promptright = cmd; + } else { + promptleft = cmd; + promptright = file; + } while (1) { - fprintf(ttyout, "%s %s [anpqy?]? ", cmd, file); + fprintf(ttyout, "%s %s [anpqy?]? ", promptleft, promptright); (void)fflush(ttyout); if (getline(stdin, line, sizeof(line), &errormsg) < 0) { mflag = 0; - fprintf(ttyout, "%s; %s aborted\n", errormsg, mname); + fprintf(ttyout, "%s; %s aborted\n", errormsg, cmd); return (0); } switch (tolower((unsigned char)*line)) { @@ -160,7 +203,7 @@ confirm(const char *cmd, const char *file) break; case 'q': mflag = 0; - fprintf(ttyout, "%s aborted.\n", mname); + fprintf(ttyout, "%s aborted.\n", cmd); /* FALLTHROUGH */ case 'n': return (0); @@ -193,7 +236,7 @@ settype(int argc, char *argv[]) if (argc == 0 || argc > 2) { char *sep; - fprintf(ttyout, "usage: %s [", argv[0]); + UPRINTF("usage: %s [", argv[0]); sep = " "; for (p = types; p->t_name; p++) { fprintf(ttyout, "%s%s", sep, p->t_name); @@ -241,14 +284,13 @@ changetype(int newtype, int show) newtype = TYPE_I; if (newtype == curtype) return; - if (debug == 0 && show == 0) + if (ftp_debug == 0 && show == 0) verbose = 0; for (p = types; p->t_name; p++) if (newtype == p->t_type) break; if (p->t_name == 0) { - warnx("internal error: unknown type %d.", newtype); - return; + errx(1, "changetype: unknown type %d", newtype); } if (newtype == TYPE_L && bytename[0] != '\0') comret = command("TYPE %s %s", p->t_mode, bytename); @@ -274,7 +316,7 @@ setbinary(int argc, char *argv[]) { if (argc == 0) { - fprintf(ttyout, "usage: %s\n", argv[0]); + UPRINTF("usage: %s\n", argv[0]); code = -1; return; } @@ -291,7 +333,7 @@ setascii(int argc, char *argv[]) { if (argc == 0) { - fprintf(ttyout, "usage: %s\n", argv[0]); + UPRINTF("usage: %s\n", argv[0]); code = -1; return; } @@ -308,7 +350,7 @@ settenex(int argc, char *argv[]) { if (argc == 0) { - fprintf(ttyout, "usage: %s\n", argv[0]); + UPRINTF("usage: %s\n", argv[0]); code = -1; return; } @@ -325,7 +367,7 @@ setftmode(int argc, char *argv[]) { if (argc != 2) { - fprintf(ttyout, "usage: %s mode-name\n", argv[0]); + UPRINTF("usage: %s mode-name\n", argv[0]); code = -1; return; } @@ -342,7 +384,7 @@ setform(int argc, char *argv[]) { if (argc != 2) { - fprintf(ttyout, "usage: %s format\n", argv[0]); + UPRINTF("usage: %s format\n", argv[0]); code = -1; return; } @@ -359,7 +401,7 @@ setstruct(int argc, char *argv[]) { if (argc != 2) { - fprintf(ttyout, "usage: %s struct-mode\n", argv[0]); + UPRINTF("usage: %s struct-mode\n", argv[0]); code = -1; return; } @@ -388,8 +430,7 @@ put(int argc, char *argv[]) goto usage; if ((argc < 3 && !another(&argc, &argv, "remote-file")) || argc > 3) { usage: - fprintf(ttyout, "usage: %s local-file [remote-file]\n", - argv[0]); + UPRINTF("usage: %s local-file [remote-file]\n", argv[0]); code = -1; return; } @@ -433,15 +474,14 @@ mput(int argc, char *argv[]) const char *tp; if (argc == 0 || (argc == 1 && !another(&argc, &argv, "local-files"))) { - fprintf(ttyout, "usage: %s local-files\n", argv[0]); + UPRINTF("usage: %s local-files\n", argv[0]); code = -1; return; } - mname = argv[0]; mflag = 1; oldintr = xsignal(SIGINT, mintr); if (sigsetjmp(jabort, 1)) - mabort(); + mabort(argv[0]); if (proxy) { char *cp; @@ -459,7 +499,7 @@ mput(int argc, char *argv[]) if (!mflag && fromatty) { ointer = interactive; interactive = 1; - if (confirm("Continue with", "mput")) { + if (confirm(argv[0], NULL)) { mflag++; } interactive = ointer; @@ -483,7 +523,7 @@ mput(int argc, char *argv[]) if (!mflag && fromatty) { ointer = interactive; interactive = 1; - if (confirm("Continue with", "mput")) { + if (confirm(argv[0], NULL)) { mflag++; } interactive = ointer; @@ -495,7 +535,7 @@ mput(int argc, char *argv[]) memset(&gl, 0, sizeof(gl)); flags = GLOB_BRACE|GLOB_NOCHECK|GLOB_TILDE; if (glob(argv[i], flags, NULL, &gl) || gl.gl_pathc == 0) { - warnx("%s: not found", argv[i]); + warnx("Glob pattern `%s' not found", argv[i]); globfree(&gl); continue; } @@ -511,7 +551,7 @@ mput(int argc, char *argv[]) if (!mflag && fromatty) { ointer = interactive; interactive = 1; - if (confirm("Continue with", "mput")) { + if (confirm(argv[0], NULL)) { mflag++; } interactive = ointer; @@ -562,8 +602,7 @@ getit(int argc, char *argv[], int restartit, const char *mode) goto usage; if ((argc < 3 && !another(&argc, &argv, "local-file")) || argc > 3) { usage: - fprintf(ttyout, "usage: %s remote-file [local-file]\n", - argv[0]); + UPRINTF("usage: %s remote-file [local-file]\n", argv[0]); code = -1; return (0); } @@ -586,7 +625,7 @@ getit(int argc, char *argv[], int restartit, const char *mode) ret = stat(locfile, &stbuf); if (restartit == 1) { if (ret < 0) { - warn("local: %s", locfile); + warn("Can't stat `%s'", locfile); goto freegetit; } restart_point = stbuf.st_size; @@ -614,7 +653,7 @@ getit(int argc, char *argv[], int restartit, const char *mode) } /* ARGSUSED */ -void +static void mintr(int signo) { @@ -624,8 +663,8 @@ mintr(int signo) siglongjmp(jabort, 1); } -void -mabort(void) +static void +mabort(const char *cmd) { int ointer, oconf; @@ -634,7 +673,7 @@ mabort(void) oconf = confirmrest; interactive = 1; confirmrest = 0; - if (confirm("Continue with", mname)) { + if (confirm(cmd, NULL)) { interactive = ointer; confirmrest = oconf; return; @@ -659,11 +698,10 @@ mget(int argc, char *argv[]) if (argc == 0 || (argc == 1 && !another(&argc, &argv, "remote-files"))) { - fprintf(ttyout, "usage: %s remote-files\n", argv[0]); + UPRINTF("usage: %s remote-files\n", argv[0]); code = -1; return; } - mname = argv[0]; mflag = 1; restart_point = 0; restartit = 0; @@ -677,7 +715,7 @@ mget(int argc, char *argv[]) } oldintr = xsignal(SIGINT, mintr); if (sigsetjmp(jabort, 1)) - mabort(); + mabort(argv[0]); while ((cp = remglob(argv, proxy, NULL)) != NULL) { char buf[MAXPATHLEN]; if (*cp == '\0' || !connected) { @@ -700,7 +738,7 @@ mget(int argc, char *argv[]) if (stat(tp, &stbuf) == 0) restart_point = stbuf.st_size; else - warn("stat %s", tp); + warn("Can't stat `%s'", tp); } recvrequest("RETR", tp, cp, restart_point ? "r+" : "w", tp != cp || !interactive, 1); @@ -708,7 +746,7 @@ mget(int argc, char *argv[]) if (!mflag && fromatty) { ointer = interactive; interactive = 1; - if (confirm("Continue with", "mget")) + if (confirm(argv[0], NULL)) mflag++; interactive = ointer; } @@ -723,18 +761,19 @@ mget(int argc, char *argv[]) void fget(int argc, char *argv[]) { - char *buf, *mode; + char *mode; FILE *fp; + char buf[MAXPATHLEN]; if (argc != 2) { - fprintf(ttyout, "usage: %s localfile\n", argv[0]); + UPRINTF("usage: %s localfile\n", argv[0]); code = -1; return; } fp = fopen(argv[1], "r"); if (fp == NULL) { - fprintf(ttyout, "Cannot open source file %s\n", argv[1]); + fprintf(ttyout, "Can't open source file %s\n", argv[1]); code = -1; return; } @@ -742,9 +781,7 @@ fget(int argc, char *argv[]) argv[0] = "get"; mode = restart_point ? "r+" : "w"; - for (; - (buf = fparseln(fp, NULL, NULL, "\0\0\0", 0)) != NULL; - free(buf)) { + while (getline(fp, buf, sizeof(buf), NULL) >= 0) { if (buf[0] == '\0') continue; argv[1] = buf; @@ -769,7 +806,7 @@ status(int argc, char *argv[]) { if (argc == 0) { - fprintf(ttyout, "usage: %s\n", argv[0]); + UPRINTF("usage: %s\n", argv[0]); code = -1; return; } @@ -863,7 +900,7 @@ togglevar(int argc, char *argv[], int *var, const char *mesg) } else if (argc == 2 && strcasecmp(argv[1], "off") == 0) { *var = 0; } else { - fprintf(ttyout, "usage: %s [ on | off ]\n", argv[0]); + UPRINTF("usage: %s [ on | off ]\n", argv[0]); return (-1); } if (mesg) @@ -892,7 +929,7 @@ setedit(int argc, char *argv[]) #ifdef NO_EDITCOMPLETE if (argc == 0) { - fprintf(ttyout, "usage: %s\n", argv[0]); + UPRINTF("usage: %s\n", argv[0]); code = -1; return; } @@ -926,7 +963,7 @@ sethash(int argc, char *argv[]) if (argc == 1) hash = !hash; else if (argc != 2) { - fprintf(ttyout, "usage: %s [ on | off | bytecount ]\n", + UPRINTF("usage: %s [ on | off | bytecount ]\n", argv[0]); code = -1; return; @@ -1012,7 +1049,7 @@ setgate(int argc, char *argv[]) static char gsbuf[MAXHOSTNAMELEN]; if (argc == 0 || argc > 3) { - fprintf(ttyout, + UPRINTF( "usage: %s [ on | off | gateserver [port] ]\n", argv[0]); code = -1; return; @@ -1025,7 +1062,7 @@ setgate(int argc, char *argv[]) gatemode = 0; else { if (argc == 3) - gateport = xstrdup(argv[2]); + gateport = ftp_strdup(argv[2]); (void)strlcpy(gsbuf, argv[1], sizeof(gsbuf)); gateserver = gsbuf; gatemode = 1; @@ -1073,15 +1110,14 @@ void setdebug(int argc, char *argv[]) { if (argc == 0 || argc > 2) { - fprintf(ttyout, "usage: %s [ on | off | debuglevel ]\n", - argv[0]); + UPRINTF("usage: %s [ on | off | debuglevel ]\n", argv[0]); code = -1; return; } else if (argc == 2) { if (strcasecmp(argv[1], "on") == 0) - debug = 1; + ftp_debug = 1; else if (strcasecmp(argv[1], "off") == 0) - debug = 0; + ftp_debug = 0; else { int val; @@ -1092,16 +1128,16 @@ setdebug(int argc, char *argv[]) code = -1; return; } - debug = val; + ftp_debug = val; } } else - debug = !debug; - if (debug) + ftp_debug = !ftp_debug; + if (ftp_debug) options |= SO_DEBUG; else options &= ~SO_DEBUG; - fprintf(ttyout, "Debugging %s (debug=%d).\n", onoff(debug), debug); - code = debug > 0; + fprintf(ttyout, "Debugging %s (ftp_debug=%d).\n", onoff(ftp_debug), ftp_debug); + code = ftp_debug > 0; } /* @@ -1114,7 +1150,7 @@ cd(int argc, char *argv[]) if (argc == 0 || argc > 2 || (argc == 1 && !another(&argc, &argv, "remote-directory"))) { - fprintf(ttyout, "usage: %s remote-directory\n", argv[0]); + UPRINTF("usage: %s remote-directory\n", argv[0]); code = -1; return; } @@ -1145,13 +1181,13 @@ lcd(int argc, char *argv[]) argv[1] = localhome; } if (argc != 2) { - fprintf(ttyout, "usage: %s [local-directory]\n", argv[0]); + UPRINTF("usage: %s [local-directory]\n", argv[0]); return; } if ((locdir = globulize(argv[1])) == NULL) return; if (chdir(locdir) == -1) - warn("lcd %s", locdir); + warn("Can't chdir `%s'", locdir); else { updatelocalcwd(); if (localcwd[0]) { @@ -1173,7 +1209,7 @@ delete(int argc, char *argv[]) if (argc == 0 || argc > 2 || (argc == 1 && !another(&argc, &argv, "remote-file"))) { - fprintf(ttyout, "usage: %s remote-file\n", argv[0]); + UPRINTF("usage: %s remote-file\n", argv[0]); code = -1; return; } @@ -1193,15 +1229,14 @@ mdelete(int argc, char *argv[]) if (argc == 0 || (argc == 1 && !another(&argc, &argv, "remote-files"))) { - fprintf(ttyout, "usage: %s [remote-files]\n", argv[0]); + UPRINTF("usage: %s [remote-files]\n", argv[0]); code = -1; return; } - mname = argv[0]; mflag = 1; oldintr = xsignal(SIGINT, mintr); if (sigsetjmp(jabort, 1)) - mabort(); + mabort(argv[0]); while ((cp = remglob(argv, 0, NULL)) != NULL) { if (*cp == '\0') { mflag = 0; @@ -1213,7 +1248,7 @@ mdelete(int argc, char *argv[]) if (!mflag && fromatty) { ointer = interactive; interactive = 1; - if (confirm("Continue with", "mdelete")) { + if (confirm(argv[0], NULL)) { mflag++; } interactive = ointer; @@ -1235,7 +1270,7 @@ renamefile(int argc, char *argv[]) goto usage; if ((argc < 3 && !another(&argc, &argv, "to-name")) || argc > 3) { usage: - fprintf(ttyout, "usage: %s from-name to-name\n", argv[0]); + UPRINTF("usage: %s from-name to-name\n", argv[0]); code = -1; return; } @@ -1296,11 +1331,9 @@ ls(int argc, char *argv[]) if (argc > 3 || ((pagecmd | mlsdcmd) && argc > 2)) { usage: if (pagecmd || mlsdcmd) - fprintf(ttyout, - "usage: %s [remote-path]\n", argv[0]); + UPRINTF("usage: %s [remote-path]\n", argv[0]); else - fprintf(ttyout, - "usage: %s [remote-path [local-file]]\n", + UPRINTF("usage: %s [remote-path [local-file]]\n", argv[0]); code = -1; goto freels; @@ -1314,12 +1347,11 @@ ls(int argc, char *argv[]) if (EMPTYSTRING(p)) p = DEFAULTPAGER; len = strlen(p) + 2; - locfile = xmalloc(len); + locfile = ftp_malloc(len); locfile[0] = '|'; (void)strlcpy(locfile + 1, p, len - 1); freelocfile = 1; } else if ((strcmp(locfile, "-") != 0) && *locfile != '|') { - mname = argv[0]; if ((locfile = globulize(locfile)) == NULL || !confirm("output to local-file:", locfile)) { code = -1; @@ -1350,13 +1382,12 @@ mls(int argc, char *argv[]) goto usage; if (argc < 3 && !another(&argc, &argv, "local-file")) { usage: - fprintf(ttyout, "usage: %s remote-files local-file\n", argv[0]); + UPRINTF("usage: %s remote-files local-file\n", argv[0]); code = -1; return; } odest = dest = argv[argc - 1]; argv[argc - 1] = NULL; - mname = argv[0]; if (strcmp(dest, "-") && *dest != '|') if (((dest = globulize(dest)) == NULL) || !confirm("output to local-file:", dest)) { @@ -1367,7 +1398,7 @@ mls(int argc, char *argv[]) mflag = 1; oldintr = xsignal(SIGINT, mintr); if (sigsetjmp(jabort, 1)) - mabort(); + mabort(argv[0]); for (i = 1; mflag && i < argc-1 && connected; i++) { mode = (i == 1) ? "w" : "a"; recvrequest(dolist ? "LIST" : "NLST", dest, argv[i], mode, @@ -1375,7 +1406,7 @@ mls(int argc, char *argv[]) if (!mflag && fromatty) { ointer = interactive; interactive = 1; - if (confirm("Continue with", argv[0])) { + if (confirm(argv[0], NULL)) { mflag++; } interactive = ointer; @@ -1400,7 +1431,7 @@ shell(int argc, char *argv[]) int wait_status; if (argc == 0) { - fprintf(ttyout, "usage: %s [command [args]]\n", argv[0]); + UPRINTF("usage: %s [command [args]]\n", argv[0]); code = -1; return; } @@ -1418,7 +1449,7 @@ shell(int argc, char *argv[]) else namep++; (void)strlcpy(shellnam, namep, sizeof(shellnam)); - if (debug) { + if (ftp_debug) { fputs(shell, ttyout); putc('\n', ttyout); } @@ -1428,7 +1459,7 @@ shell(int argc, char *argv[]) else { execl(shell, shellnam, (char *)0); } - warn("%s", shell); + warn("Can't execute `%s'", shell); code = -1; exit(1); } @@ -1437,7 +1468,7 @@ shell(int argc, char *argv[]) ; (void)xsignal(SIGINT, oldintr); if (pid == -1) { - warn("Try again later"); + warn("Can't fork a subshell; try again later"); code = -1; } else code = 0; @@ -1450,6 +1481,7 @@ void user(int argc, char *argv[]) { char *password; + char emptypass[] = ""; int n, aflag = 0; if (argc == 0) @@ -1458,7 +1490,7 @@ user(int argc, char *argv[]) (void)another(&argc, &argv, "username"); if (argc < 2 || argc > 4) { usage: - fprintf(ttyout, "usage: %s username [password [account]]\n", + UPRINTF("usage: %s username [password [account]]\n", argv[0]); code = -1; return; @@ -1467,6 +1499,8 @@ user(int argc, char *argv[]) if (n == CONTINUE) { if (argc < 3) { password = getpass("Password: "); + if (password == NULL) + password = emptypass; } else { password = argv[2]; } @@ -1477,6 +1511,8 @@ user(int argc, char *argv[]) aflag++; if (argc < 4) { password = getpass("Account: "); + if (password == NULL) + password = emptypass; } else { password = argv[3]; } @@ -1506,7 +1542,7 @@ pwd(int argc, char *argv[]) code = -1; if (argc != 1) { - fprintf(ttyout, "usage: %s\n", argv[0]); + UPRINTF("usage: %s\n", argv[0]); return; } if (! remotecwd[0]) @@ -1528,7 +1564,7 @@ lpwd(int argc, char *argv[]) code = -1; if (argc != 1) { - fprintf(ttyout, "usage: %s\n", argv[0]); + UPRINTF("usage: %s\n", argv[0]); return; } if (! localcwd[0]) @@ -1551,7 +1587,7 @@ makedir(int argc, char *argv[]) if (argc == 0 || argc > 2 || (argc == 1 && !another(&argc, &argv, "directory-name"))) { - fprintf(ttyout, "usage: %s directory-name\n", argv[0]); + UPRINTF("usage: %s directory-name\n", argv[0]); code = -1; return; } @@ -1576,7 +1612,7 @@ removedir(int argc, char *argv[]) if (argc == 0 || argc > 2 || (argc == 1 && !another(&argc, &argv, "directory-name"))) { - fprintf(ttyout, "usage: %s directory-name\n", argv[0]); + UPRINTF("usage: %s directory-name\n", argv[0]); code = -1; return; } @@ -1600,7 +1636,7 @@ quote(int argc, char *argv[]) if (argc == 0 || (argc == 1 && !another(&argc, &argv, "command line to send"))) { - fprintf(ttyout, "usage: %s line-to-send\n", argv[0]); + UPRINTF("usage: %s line-to-send\n", argv[0]); code = -1; return; } @@ -1618,7 +1654,7 @@ site(int argc, char *argv[]) if (argc == 0 || (argc == 1 && !another(&argc, &argv, "arguments to SITE command"))){ - fprintf(ttyout, "usage: %s line-to-send\n", argv[0]); + UPRINTF("usage: %s line-to-send\n", argv[0]); code = -1; return; } @@ -1656,7 +1692,7 @@ do_chmod(int argc, char *argv[]) goto usage; if ((argc < 3 && !another(&argc, &argv, "remote-file")) || argc > 3) { usage: - fprintf(ttyout, "usage: %s mode remote-file\n", argv[0]); + UPRINTF("usage: %s mode remote-file\n", argv[0]); code = -1; return; } @@ -1675,7 +1711,7 @@ do_umask(int argc, char *argv[]) int oldverbose = verbose; if (argc == 0) { - fprintf(ttyout, "usage: %s [umask]\n", argv[0]); + UPRINTF("usage: %s [umask]\n", argv[0]); code = -1; return; } @@ -1690,7 +1726,7 @@ idlecmd(int argc, char *argv[]) int oldverbose = verbose; if (argc < 1 || argc > 2) { - fprintf(ttyout, "usage: %s [seconds]\n", argv[0]); + UPRINTF("usage: %s [seconds]\n", argv[0]); code = -1; return; } @@ -1708,7 +1744,7 @@ rmthelp(int argc, char *argv[]) int oldverbose = verbose; if (argc == 0) { - fprintf(ttyout, "usage: %s\n", argv[0]); + UPRINTF("usage: %s\n", argv[0]); code = -1; return; } @@ -1728,7 +1764,7 @@ quit(int argc, char *argv[]) /* this may be called with argc == 0, argv == NULL */ if (argc == 0 && argv != NULL) { - fprintf(ttyout, "usage: %s\n", argv[0]); + UPRINTF("usage: %s\n", argv[0]); code = -1; return; } @@ -1750,7 +1786,7 @@ disconnect(int argc, char *argv[]) /* this may be called with argc == 0, argv == NULL */ if (argc == 0 && argv != NULL) { - fprintf(ttyout, "usage: %s\n", argv[0]); + UPRINTF("usage: %s\n", argv[0]); code = -1; return; } @@ -1764,17 +1800,22 @@ void account(int argc, char *argv[]) { char *ap; + char emptypass[] = ""; if (argc == 0 || argc > 2) { - fprintf(ttyout, "usage: %s [password]\n", argv[0]); + UPRINTF("usage: %s [password]\n", argv[0]); code = -1; return; } else if (argc == 2) ap = argv[1]; - else + else { ap = getpass("Account:"); + if (ap == NULL) + ap = emptypass; + } (void)command("ACCT %s", ap); + memset(ap, 0, strlen(ap)); } sigjmp_buf abortprox; @@ -1806,7 +1847,7 @@ doproxy(int argc, char *argv[]) sigfunc oldintr; if (argc == 0 || (argc == 1 && !another(&argc, &argv, "command"))) { - fprintf(ttyout, "usage: %s command\n", argv[0]); + UPRINTF("usage: %s command\n", argv[0]); code = -1; return; } @@ -1898,7 +1939,7 @@ setntrans(int argc, char *argv[]) { if (argc == 0 || argc > 3) { - fprintf(ttyout, "usage: %s [inchars [outchars]]\n", argv[0]); + UPRINTF("usage: %s [inchars [outchars]]\n", argv[0]); code = -1; return; } @@ -1962,7 +2003,7 @@ setnmap(int argc, char *argv[]) } if (argc == 0 || (argc < 3 && !another(&argc, &argv, "mapout")) || argc > 3) { - fprintf(ttyout, "usage: %s [mapin mapout]\n", argv[0]); + UPRINTF("usage: %s [mapin mapout]\n", argv[0]); code = -1; return; } @@ -2162,7 +2203,7 @@ setpassive(int argc, char *argv[]) activefallback = passivemode; } else if (argc != 2) { passiveusage: - fprintf(ttyout, "usage: %s [ on | off | auto ]\n", argv[0]); + UPRINTF("usage: %s [ on | off | auto ]\n", argv[0]); code = -1; return; } else if (strcasecmp(argv[1], "on") == 0) { @@ -2213,11 +2254,11 @@ parserate(int argc, char *argv[], int cmdlineopt) if (argc > 4 || (argc < (cmdlineopt ? 3 : 2))) { usage: if (cmdlineopt) - fprintf(ttyout, + UPRINTF( "usage: %s (all|get|put),maximum-bytes[,increment-bytes]]\n", argv[0]); else - fprintf(ttyout, + UPRINTF( "usage: %s (all|get|put) [maximum-bytes [increment-bytes]]\n", argv[0]); return -1; @@ -2289,7 +2330,7 @@ cdup(int argc, char *argv[]) int r; if (argc == 0) { - fprintf(ttyout, "usage: %s\n", argv[0]); + UPRINTF("usage: %s\n", argv[0]); code = -1; return; } @@ -2314,7 +2355,7 @@ restart(int argc, char *argv[]) { if (argc == 0 || argc > 2) { - fprintf(ttyout, "usage: %s [restart-point]\n", argv[0]); + UPRINTF("usage: %s [restart-point]\n", argv[0]); code = -1; return; } @@ -2351,7 +2392,7 @@ syst(int argc, char *argv[]) int oldverbose = verbose; if (argc == 0) { - fprintf(ttyout, "usage: %s\n", argv[0]); + UPRINTF("usage: %s\n", argv[0]); code = -1; return; } @@ -2376,7 +2417,7 @@ macdef(int argc, char *argv[]) } if ((argc < 2 && !another(&argc, &argv, "macro name")) || argc > 2) { usage: - fprintf(ttyout, "usage: %s macro_name\n", argv[0]); + UPRINTF("usage: %s macro_name\n", argv[0]); code = -1; return; } @@ -2434,7 +2475,7 @@ sizecmd(int argc, char *argv[]) if (argc == 0 || argc > 2 || (argc == 1 && !another(&argc, &argv, "remote-file"))) { - fprintf(ttyout, "usage: %s remote-file\n", argv[0]); + UPRINTF("usage: %s remote-file\n", argv[0]); code = -1; return; } @@ -2455,13 +2496,14 @@ modtime(int argc, char *argv[]) if (argc == 0 || argc > 2 || (argc == 1 && !another(&argc, &argv, "remote-file"))) { - fprintf(ttyout, "usage: %s remote-file\n", argv[0]); + UPRINTF("usage: %s remote-file\n", argv[0]); code = -1; return; } mtime = remotemodtime(argv[1], 1); if (mtime != -1) - fprintf(ttyout, "%s\t%s", argv[1], asctime(localtime(&mtime))); + fprintf(ttyout, "%s\t%s", argv[1], + rfc2822time(localtime(&mtime))); code = (mtime > 0); } @@ -2473,7 +2515,7 @@ rmtstatus(int argc, char *argv[]) { if (argc == 0) { - fprintf(ttyout, "usage: %s [remote-file]\n", argv[0]); + UPRINTF("usage: %s [remote-file]\n", argv[0]); code = -1; return; } @@ -2504,7 +2546,7 @@ lpage(int argc, char *argv[]) if (argc == 0 || argc > 2 || (argc == 1 && !another(&argc, &argv, "local-file"))) { - fprintf(ttyout, "usage: %s local-file\n", argv[0]); + UPRINTF("usage: %s local-file\n", argv[0]); code = -1; return; } @@ -2516,7 +2558,7 @@ lpage(int argc, char *argv[]) if (EMPTYSTRING(p)) p = DEFAULTPAGER; len = strlen(p) + strlen(locfile) + 2; - pager = xmalloc(len); + pager = ftp_malloc(len); (void)strlcpy(pager, p, len); (void)strlcat(pager, " ", len); (void)strlcat(pager, locfile, len); @@ -2538,7 +2580,7 @@ page(int argc, char *argv[]) if (argc == 0 || argc > 2 || (argc == 1 && !another(&argc, &argv, "remote-file"))) { - fprintf(ttyout, "usage: %s remote-file\n", argv[0]); + UPRINTF("usage: %s remote-file\n", argv[0]); code = -1; return; } @@ -2546,7 +2588,7 @@ page(int argc, char *argv[]) if (EMPTYSTRING(p)) p = DEFAULTPAGER; len = strlen(p) + 2; - pager = xmalloc(len); + pager = ftp_malloc(len); pager[0] = '|'; (void)strlcpy(pager + 1, p, len - 1); @@ -2571,7 +2613,7 @@ setxferbuf(int argc, char *argv[]) if (argc != 2) { usage: - fprintf(ttyout, "usage: %s size\n", argv[0]); + UPRINTF("usage: %s size\n", argv[0]); code = -1; return; } @@ -2611,7 +2653,7 @@ setoption(int argc, char *argv[]) code = -1; if (argc == 0 || (argc != 1 && argc != 3)) { - fprintf(ttyout, "usage: %s [option value]\n", argv[0]); + UPRINTF("usage: %s [option value]\n", argv[0]); return; } @@ -2628,7 +2670,7 @@ setoption(int argc, char *argv[]) return; } FREEPTR(o->value); - o->value = xstrdup(argv[2]); + o->value = ftp_strdup(argv[2]); if (verbose) fprintf(ttyout, "Setting `%s' to `%s'.\n", o->name, o->value); @@ -2646,7 +2688,7 @@ unsetoption(int argc, char *argv[]) code = -1; if (argc == 0 || argc != 2) { - fprintf(ttyout, "usage: %s option\n", argv[0]); + UPRINTF("usage: %s option\n", argv[0]); return; } @@ -2669,7 +2711,7 @@ feat(int argc, char *argv[]) int oldverbose = verbose; if (argc == 0) { - fprintf(ttyout, "usage: %s\n", argv[0]); + UPRINTF("usage: %s\n", argv[0]); code = -1; return; } @@ -2689,7 +2731,7 @@ mlst(int argc, char *argv[]) int oldverbose = verbose; if (argc < 1 || argc > 2) { - fprintf(ttyout, "usage: %s [remote-path]\n", argv[0]); + UPRINTF("usage: %s [remote-path]\n", argv[0]); code = -1; return; } @@ -2709,7 +2751,7 @@ opts(int argc, char *argv[]) int oldverbose = verbose; if (argc < 2 || argc > 3) { - fprintf(ttyout, "usage: %s command [options]\n", argv[0]); + UPRINTF("usage: %s command [options]\n", argv[0]); code = -1; return; } diff --git a/net/tnftp/files/src/cmdtab.c b/net/tnftp/files/src/cmdtab.c index e065f5cb2b4..8d925db5045 100644 --- a/net/tnftp/files/src/cmdtab.c +++ b/net/tnftp/files/src/cmdtab.c @@ -1,5 +1,5 @@ -/* NetBSD: cmdtab.c,v 1.7 2005/06/10 04:05:01 lukem Exp */ -/* from NetBSD: cmdtab.c,v 1.45 2005/06/09 16:38:29 lukem Exp */ +/* $NetBSD: cmdtab.c,v 1.5 2007/08/07 02:07:01 lukem Exp $ */ +/* from NetBSD: cmdtab.c,v 1.47 2007/04/11 04:40:19 lukem Exp */ /*- * Copyright (c) 1996-2005 The NetBSD Foundation, Inc. @@ -68,6 +68,21 @@ #include "tnftp.h" +#if 0 /* tnftp */ + +#include <sys/cdefs.h> +#ifndef lint +#if 0 +static char sccsid[] = "@(#)cmdtab.c 8.4 (Berkeley) 10/9/94"; +#else +__RCSID(" NetBSD: cmdtab.c,v 1.47 2007/04/11 04:40:19 lukem Exp "); +#endif +#endif /* not lint */ + +#include <stdio.h> + +#endif /* tnftp */ + #include "ftp_var.h" /* diff --git a/net/tnftp/files/src/complete.c b/net/tnftp/files/src/complete.c index 5dd7ed19b8d..ea06b38b252 100644 --- a/net/tnftp/files/src/complete.c +++ b/net/tnftp/files/src/complete.c @@ -1,5 +1,5 @@ -/* NetBSD: complete.c,v 1.6 2005/06/10 04:05:01 lukem Exp */ -/* from NetBSD: complete.c,v 1.40 2005/06/09 16:38:29 lukem Exp */ +/* $NetBSD: complete.c,v 1.4 2007/08/07 02:07:02 lukem Exp $ */ +/* from NetBSD: complete.c,v 1.42 2007/04/17 05:52:03 lukem Exp */ /*- * Copyright (c) 1997-2000,2005 The NetBSD Foundation, Inc. @@ -37,11 +37,29 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include "tnftp.h" + +#if 0 /* tnftp */ + +#include <sys/cdefs.h> +#ifndef lint +__RCSID(" NetBSD: complete.c,v 1.42 2007/04/17 05:52:03 lukem Exp "); +#endif /* not lint */ + /* * FTP user program - command and file completion routines */ -#include "tnftp.h" +#include <sys/stat.h> + +#include <ctype.h> +#include <err.h> +#include <dirent.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#endif /* tnftp */ #include "ftp_var.h" @@ -132,14 +150,14 @@ complete_command(char *word, int list) size_t wordlen; unsigned char rv; - words = xsl_init(); + words = ftp_sl_init(); wordlen = strlen(word); for (c = cmdtab; c->c_name != NULL; c++) { if (wordlen > strlen(c->c_name)) continue; if (strncmp(word, c->c_name, wordlen) == 0) - xsl_add(words, c->c_name); + ftp_sl_add(words, c->c_name); } rv = complete_ambiguous(word, list, words); @@ -189,7 +207,7 @@ complete_local(char *word, int list) if ((dd = opendir(dir)) == NULL) return (CC_ERROR); - words = xsl_init(); + words = ftp_sl_init(); len = strlen(file); for (dp = readdir(dd); dp != NULL; dp = readdir(dd)) { @@ -206,8 +224,8 @@ complete_local(char *word, int list) if (strncmp(file, dp->d_name, len) == 0) { char *tcp; - tcp = xstrdup(dp->d_name); - xsl_add(words, tcp); + tcp = ftp_strdup(dp->d_name); + ftp_sl_add(words, tcp); } } closedir(dd); @@ -244,14 +262,14 @@ complete_option(char *word, int list) size_t wordlen; unsigned char rv; - words = xsl_init(); + words = ftp_sl_init(); wordlen = strlen(word); for (o = optiontab; o->name != NULL; o++) { if (wordlen > strlen(o->name)) continue; if (strncmp(word, o->name, wordlen) == 0) - xsl_add(words, o->name); + ftp_sl_add(words, o->name); } rv = complete_ambiguous(word, list, words); @@ -297,7 +315,7 @@ complete_remote(char *word, int list) if (dirlist != NULL) sl_free(dirlist, 1); - dirlist = xsl_init(); + dirlist = ftp_sl_init(); mflag = 1; emesg = NULL; @@ -315,8 +333,8 @@ complete_remote(char *word, int list) tcp++; else tcp = cp; - tcp = xstrdup(tcp); - xsl_add(dirlist, tcp); + tcp = ftp_strdup(tcp); + ftp_sl_add(dirlist, tcp); } if (emesg != NULL) { fprintf(ttyout, "\n%s\n", emesg); @@ -326,13 +344,13 @@ complete_remote(char *word, int list) dirchange = 0; } - words = xsl_init(); + words = ftp_sl_init(); for (i = 0; i < dirlist->sl_cur; i++) { cp = dirlist->sl_str[i]; if (strlen(file) > strlen(cp)) continue; if (strncmp(file, cp, strlen(file)) == 0) - xsl_add(words, cp); + ftp_sl_add(words, cp); } rv = complete_ambiguous(file, list, words); sl_free(words, 0); @@ -415,7 +433,8 @@ complete(EditLine *el, int ch) } return (complete_remote(word, dolist)); default: - errx(1, "unknown complete type `%c'", cmpltype); + errx(1, "complete: unknown complete type `%c'", + cmpltype); return (CC_ERROR); } /* NOTREACHED */ diff --git a/net/tnftp/files/src/domacro.c b/net/tnftp/files/src/domacro.c index 001df2e2a91..f72e11e1be9 100644 --- a/net/tnftp/files/src/domacro.c +++ b/net/tnftp/files/src/domacro.c @@ -1,5 +1,5 @@ -/* NetBSD: domacro.c,v 1.5 2005/06/09 16:47:50 lukem Exp */ -/* from NetBSD: domacro.c,v 1.20 2003/08/07 11:13:53 agc Exp */ +/* $NetBSD: domacro.c,v 1.5 2007/08/07 02:07:02 lukem Exp $ */ +/* from NetBSD: domacro.c,v 1.21 2005/06/29 02:31:19 christos Exp */ /* * Copyright (c) 1985, 1993, 1994 @@ -32,6 +32,23 @@ #include "tnftp.h" +#if 0 /* tnftp */ + +#include <sys/cdefs.h> +#ifndef lint +#if 0 +static char sccsid[] = "@(#)domacro.c 8.3 (Berkeley) 4/2/94"; +#else +__RCSID(" NetBSD: domacro.c,v 1.21 2005/06/29 02:31:19 christos Exp "); +#endif +#endif /* not lint */ + +#include <ctype.h> +#include <stdio.h> +#include <string.h> + +#endif /* tnftp */ + #include "ftp_var.h" void @@ -43,7 +60,7 @@ domacro(int argc, char *argv[]) if ((argc == 0 && argv != NULL) || (argc < 2 && !another(&argc, &argv, "macro name"))) { - fprintf(ttyout, "usage: %s macro_name [args]\n", argv[0]); + UPRINTF("usage: %s macro_name [args]\n", argv[0]); code = -1; return; } diff --git a/net/tnftp/files/src/extern.h b/net/tnftp/files/src/extern.h index ae12e760f3c..0603159efd1 100644 --- a/net/tnftp/files/src/extern.h +++ b/net/tnftp/files/src/extern.h @@ -1,8 +1,8 @@ -/* NetBSD: extern.h,v 1.7 2005/06/10 04:05:01 lukem Exp */ -/* from NetBSD: extern.h,v 1.69 2005/06/10 00:18:46 lukem Exp */ +/* $NetBSD: extern.h,v 1.5 2007/08/07 02:07:02 lukem Exp $ */ +/* from NetBSD: extern.h,v 1.72 2007/05/24 05:05:18 lukem Exp */ /*- - * Copyright (c) 1996-2005 The NetBSD Foundation, Inc. + * Copyright (c) 1996-2007 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation @@ -161,13 +161,11 @@ void lostpeer(int); void lpage(int, char **); void lpwd(int, char **); void ls(int, char **); -void mabort(void); void macdef(int, char **); void makeargv(void); void makedir(int, char **); void mdelete(int, char **); void mget(int, char **); -void mintr(int); void mls(int, char **); void mlst(int, char **); void modtime(int, char **); @@ -198,6 +196,7 @@ void removedir(int, char **); void renamefile(int, char **); void reset(int, char **); void restart(int, char **); +const char *rfc2822time(const struct tm *); void rmthelp(int, char **); void rmtstatus(int, char **); char *rprompt(void); @@ -249,10 +248,10 @@ void updatelocalcwd(void); void updateremotecwd(void); void usage(void); void user(int, char **); -int xconnect(int, const struct sockaddr *, socklen_t); -int xlisten(int, int); -int xpoll(struct pollfd *, int, int); -void *xmalloc(size_t); -StringList *xsl_init(void); -void xsl_add(StringList *, char *); -char *xstrdup(const char *); +int ftp_connect(int, const struct sockaddr *, socklen_t); +int ftp_listen(int, int); +int ftp_poll(struct pollfd *, int, int); +void *ftp_malloc(size_t); +StringList *ftp_sl_init(void); +void ftp_sl_add(StringList *, char *); +char *ftp_strdup(const char *); diff --git a/net/tnftp/files/src/fetch.c b/net/tnftp/files/src/fetch.c index 2a8f1fdff3e..6d693192249 100644 --- a/net/tnftp/files/src/fetch.c +++ b/net/tnftp/files/src/fetch.c @@ -1,8 +1,8 @@ -/* NetBSD: fetch.c,v 1.11 2005/06/10 04:05:01 lukem Exp */ -/* from NetBSD: fetch.c,v 1.162 2005/06/10 00:18:46 lukem Exp */ +/* $NetBSD: fetch.c,v 1.6 2007/08/07 02:07:02 lukem Exp $ */ +/* from NetBSD: fetch.c,v 1.180 2007/06/05 00:31:20 lukem Exp */ /*- - * Copyright (c) 1997-2005 The NetBSD Foundation, Inc. + * Copyright (c) 1997-2007 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation @@ -40,11 +40,42 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include "tnftp.h" + +#if 0 /* tnftp */ + +#include <sys/cdefs.h> +#ifndef lint +__RCSID(" NetBSD: fetch.c,v 1.180 2007/06/05 00:31:20 lukem Exp "); +#endif /* not lint */ + /* * FTP User Program -- Command line file retrieval */ -#include "tnftp.h" +#include <sys/types.h> +#include <sys/param.h> +#include <sys/socket.h> +#include <sys/stat.h> +#include <sys/time.h> + +#include <netinet/in.h> + +#include <arpa/ftp.h> +#include <arpa/inet.h> + +#include <ctype.h> +#include <err.h> +#include <errno.h> +#include <netdb.h> +#include <fcntl.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#include <time.h> + +#endif /* tnftp */ #include "ftp_var.h" #include "version.h" @@ -88,7 +119,7 @@ static int redirect_loop; * Determine if token is the next word in buf (case insensitive). * If so, advance buf past the token and any trailing LWS, and * return a pointer to the token (in buf). Otherwise, return NULL. - * token may be preceeded by LWS. + * token may be preceded by LWS. * token must be followed by LWS or NUL. (I.e, don't partial match). */ static const char * @@ -134,11 +165,10 @@ auth_url(const char *challenge, char **response, const char *guser, cp = challenge; scheme = "Basic"; /* only support Basic authentication */ - if (debug) - fprintf(ttyout, "auth_url: challenge `%s'\n", challenge); + DPRINTF("auth_url: challenge `%s'\n", challenge); if (! match_token(&cp, scheme)) { - warnx("Unsupported authentication challenge - `%s'", + warnx("Unsupported authentication challenge `%s'", challenge); goto cleanup_auth_url; } @@ -147,7 +177,7 @@ auth_url(const char *challenge, char **response, const char *guser, if (STRNEQUAL(cp, REALM)) cp += sizeof(REALM) - 1; else { - warnx("Unsupported authentication challenge - `%s'", + warnx("Unsupported authentication challenge `%s'", challenge); goto cleanup_auth_url; } @@ -155,10 +185,10 @@ auth_url(const char *challenge, char **response, const char *guser, if ((ep = strchr(cp, '\"')) != NULL) { size_t len = ep - cp; - realm = (char *)xmalloc(len + 1); + realm = (char *)ftp_malloc(len + 1); (void)strlcpy(realm, cp, len + 1); } else { - warnx("Unsupported authentication challenge - `%s'", + warnx("Unsupported authentication challenge `%s'", challenge); goto cleanup_auth_url; } @@ -173,15 +203,19 @@ auth_url(const char *challenge, char **response, const char *guser, warnx("%s; can't authenticate", errormsg); goto cleanup_auth_url; } - user[strlen(user) - 1] = '\0'; } if (gpass != NULL) pass = (char *)gpass; - else + else { pass = getpass("Password: "); + if (pass == NULL) { + warnx("Can't read password"); + goto cleanup_auth_url; + } + } clen = strlen(user) + strlen(pass) + 2; /* user + ":" + pass + "\0" */ - clear = (char *)xmalloc(clen); + clear = (char *)ftp_malloc(clen); (void)strlcpy(clear, user, clen); (void)strlcat(clear, ":", clen); (void)strlcat(clear, pass, clen); @@ -190,7 +224,7 @@ auth_url(const char *challenge, char **response, const char *guser, /* scheme + " " + enc + "\0" */ rlen = strlen(scheme) + 1 + (clen + 2) * 4 / 3 + 1; - *response = (char *)xmalloc(rlen); + *response = (char *)ftp_malloc(rlen); (void)strlcpy(*response, scheme, rlen); len = strlcat(*response, " ", rlen); /* use `clen - 1' to not encode the trailing NUL */ @@ -259,7 +293,7 @@ url_decode(char *url) /* - * Parse URL of form: + * Parse URL of form (per RFC3986): * <type>://[<user>[:<password>]@]<host>[:<port>][/<path>] * Returns -1 if a parse error occurred, otherwise 0. * It's the caller's responsibility to url_decode() the returned @@ -269,12 +303,9 @@ url_decode(char *url) * malloc(3)ed strings of the relevant section, and port to * the number given, or ftpport if ftp://, or httpport if http://. * - * If <host> is surrounded by `[' and ']', it's parsed as an - * IPv6 address (as per RFC 2732). - * - * XXX: this is not totally RFC 1738 compliant; <path> will have the + * XXX: this is not totally RFC3986 compliant; <path> will have the * leading `/' unless it's an ftp:// URL, as this makes things easier - * for file:// and http:// URLs. ftp:// URLs have the `/' between the + * for file:// and http:// URLs. ftp:// URLs have the `/' between the * host and the URL-path removed, but any additional leading slashes * in the URL-path are retained (because they imply that we should * later do "CWD" with a null argument). @@ -282,11 +313,14 @@ url_decode(char *url) * Examples: * input URL output path * --------- ----------- - * "ftp://host" NULL - * "http://host/" NULL + * "http://host" "/" + * "http://host/" "/" + * "http://host/path" "/path" * "file://host/dir/file" "dir/file" + * "ftp://host" "" * "ftp://host/" "" - * "ftp://host//" NULL + * "ftp://host//" "/" + * "ftp://host/dir/file" "dir/file" * "ftp://host//dir/file" "/dir/file" */ static int @@ -341,14 +375,14 @@ parse_url(const char *url, const char *desc, url_t *type, /* find [user[:pass]@]host[:port] */ ep = strchr(url, '/'); if (ep == NULL) - thost = xstrdup(url); + thost = ftp_strdup(url); else { len = ep - url; - thost = (char *)xmalloc(len + 1); + thost = (char *)ftp_malloc(len + 1); (void)strlcpy(thost, url, len + 1); if (*type == FTP_URL_T) /* skip first / for ftp URLs */ ep++; - *path = xstrdup(ep); + *path = ftp_strdup(ep); } cp = strchr(thost, '@'); /* look for user[:pass]@ in URLs */ @@ -357,11 +391,11 @@ parse_url(const char *url, const char *desc, url_t *type, anonftp = 0; /* disable anonftp */ *user = thost; *cp = '\0'; - thost = xstrdup(cp + 1); + thost = ftp_strdup(cp + 1); cp = strchr(*user, ':'); if (cp != NULL) { *cp = '\0'; - *pass = xstrdup(cp + 1); + *pass = ftp_strdup(cp + 1); } url_decode(*user); if (*pass) @@ -371,7 +405,7 @@ parse_url(const char *url, const char *desc, url_t *type, #ifdef INET6 /* * Check if thost is an encoded IPv6 address, as per - * RFC 2732: + * RFC3986: * `[' ipv6-address ']' */ if (*thost == '[') { @@ -397,8 +431,8 @@ parse_url(const char *url, const char *desc, url_t *type, cp = NULL; } else #endif /* INET6 */ - if ((cp = strchr(thost, ':')) != NULL) - *cp++ = '\0'; + if ((cp = strchr(thost, ':')) != NULL) + *cp++ = '\0'; *host = thost; /* look for [:port] */ @@ -416,17 +450,19 @@ parse_url(const char *url, const char *desc, url_t *type, } if (tport != NULL) - *port = xstrdup(tport); - if (*path == NULL) - *path = xstrdup("/"); - - if (debug) - fprintf(ttyout, - "parse_url: user `%s' pass `%s' host %s port %s(%d) " - "path `%s'\n", - *user ? *user : "<null>", *pass ? *pass : "<null>", - *host ? *host : "<null>", *port ? *port : "<null>", - *portnum ? *portnum : -1, *path ? *path : "<null>"); + *port = ftp_strdup(tport); + if (*path == NULL) { + const char *emptypath = "/"; + if (*type == FTP_URL_T) /* skip first / for ftp URLs */ + emptypath++; + *path = ftp_strdup(emptypath); + } + + DPRINTF("parse_url: user `%s' pass `%s' host %s port %s(%d) " + "path `%s'\n", + *user ? *user : "<null>", *pass ? *pass : "<null>", + *host ? *host : "<null>", *port ? *port : "<null>", + *portnum ? *portnum : -1, *path ? *path : "<null>"); return (0); } @@ -447,21 +483,32 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth) struct addrinfo hints, *res, *res0 = NULL; int error; char hbuf[NI_MAXHOST]; - volatile sigfunc oldintr, oldintp; - volatile int s; + sigfunc volatile oldintr; + sigfunc volatile oldintp; + int volatile s; struct stat sb; - int ischunked, isproxy, rval, hcode; + int volatile ischunked; + int volatile isproxy; + int volatile rval; + int volatile hcode; size_t len; static size_t bufsize; static char *xferbuf; const char *cp, *token; - char *ep, *buf, *savefile; - char *auth, *location, *message; - char *user, *pass, *host, *port, *path, *decodedpath; + char *ep; + char buf[FTPBUFLEN]; + const char *errormsg; + char *volatile savefile; + char *volatile auth; + char *volatile location; + char *volatile message; + char *user, *pass, *host, *port, *path; + char *volatile decodedpath; char *puser, *ppass, *useragent; off_t hashbytes, rangestart, rangeend, entitylen; - int (*closefunc)(FILE *); - FILE *fin, *fout; + int (*volatile closefunc)(FILE *); + FILE *volatile fin; + FILE *volatile fout; time_t mtime; url_t urltype; in_port_t portnum; @@ -470,28 +517,12 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth) closefunc = NULL; fin = fout = NULL; s = -1; - buf = savefile = NULL; + savefile = NULL; auth = location = message = NULL; ischunked = isproxy = hcode = 0; rval = 1; user = pass = host = path = decodedpath = puser = ppass = NULL; -#ifdef __GNUC__ /* shut up gcc warnings */ - (void)&closefunc; - (void)&fin; - (void)&fout; - (void)&buf; - (void)&savefile; - (void)&rval; - (void)&isproxy; - (void)&hcode; - (void)&ischunked; - (void)&message; - (void)&location; - (void)&auth; - (void)&decodedpath; -#endif - if (parse_url(url, "URL", &urltype, &user, &pass, &host, &port, &portnum, &path) == -1) goto cleanup_fetch_url; @@ -513,29 +544,28 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth) } } - decodedpath = xstrdup(path); + decodedpath = ftp_strdup(path); url_decode(decodedpath); if (outfile) - savefile = xstrdup(outfile); + savefile = ftp_strdup(outfile); else { cp = strrchr(decodedpath, '/'); /* find savefile */ if (cp != NULL) - savefile = xstrdup(cp + 1); + savefile = ftp_strdup(cp + 1); else - savefile = xstrdup(decodedpath); + savefile = ftp_strdup(decodedpath); } if (EMPTYSTRING(savefile)) { if (urltype == FTP_URL_T) { rval = fetch_ftp(url); goto cleanup_fetch_url; } - warnx("no file after directory (you must specify an " + warnx("No file after directory (you must specify an " "output file) `%s'", url); goto cleanup_fetch_url; } else { - if (debug) - fprintf(ttyout, "savefile `%s'\n", savefile); + DPRINTF("savefile `%s'\n", savefile); } restart_point = 0; @@ -551,7 +581,7 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth) direction = "copied"; fin = fopen(decodedpath, "r"); if (fin == NULL) { - warn("Cannot open file `%s'", decodedpath); + warn("Can't open `%s'", decodedpath); goto cleanup_fetch_url; } if (fstat(fileno(fin), &sb) == 0) { @@ -560,7 +590,7 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth) } if (restart_point) { if (lseek(fileno(fin), restart_point, SEEK_SET) < 0) { - warn("Can't lseek to restart `%s'", + warn("Can't seek to restart `%s'", decodedpath); goto cleanup_fetch_url; } @@ -593,13 +623,13 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth) /* check URL against list of no_proxied sites */ no_proxy = getoptionvalue("no_proxy"); if (! EMPTYSTRING(no_proxy)) { - char *np, *np_copy; + char *np, *np_copy, *np_iter; long np_port; size_t hlen, plen; - np_copy = xstrdup(no_proxy); + np_iter = np_copy = ftp_strdup(no_proxy); hlen = strlen(host); - while ((cp = strsep(&np_copy, " ,")) != NULL) { + while ((cp = strsep(&np_iter, " ,")) != NULL) { if (*cp == '\0') continue; if ((np = strrchr(cp, ':')) != NULL) { @@ -628,6 +658,11 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth) } if (isproxy) { + if (restart_point) { + warnx("Can't restart via proxy URL `%s'", + proxyenv); + goto cleanup_fetch_url; + } if (parse_url(proxyenv, "proxy URL", &purltype, &puser, &ppass, &phost, &pport, &portnum, &ppath) == -1) @@ -661,7 +696,7 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth) FREEPTR(port); port = pport; FREEPTR(path); - path = xstrdup(url); + path = ftp_strdup(url); FREEPTR(ppath); } } /* ! EMPTYSTRING(proxyenv) */ @@ -673,7 +708,9 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth) hints.ai_protocol = 0; error = getaddrinfo(host, NULL, &hints, &res0); if (error) { - warnx("%s: %s", host, gai_strerror(error)); + warnx("Can't lookup `%s': %s", host, + (error == EAI_SYSTEM) ? strerror(errno) + : gai_strerror(error)); goto cleanup_fetch_url; } if (res0->ai_canonname) @@ -681,13 +718,10 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth) s = -1; for (res = res0; res; res = res->ai_next) { - /* - * see comment in hookup() - */ ai_unmapped(res); if (getnameinfo(res->ai_addr, res->ai_addrlen, hbuf, sizeof(hbuf), NULL, 0, NI_NUMERICHOST) != 0) - strlcpy(hbuf, "invalid", sizeof(hbuf)); + strlcpy(hbuf, "?", sizeof(hbuf)); if (verbose && res0->ai_next) { fprintf(ttyout, "Trying %s...\n", hbuf); @@ -698,12 +732,13 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth) s = socket(res->ai_family, SOCK_STREAM, res->ai_protocol); if (s < 0) { - warn("Can't create socket"); + warn( + "Can't create socket for connection to `%s'", + hbuf); continue; } - if (xconnect(s, res->ai_addr, res->ai_addrlen) < 0) { - warn("Connect to address `%s'", hbuf); + if (ftp_connect(s, res->ai_addr, res->ai_addrlen) < 0) { close(s); s = -1; continue; @@ -714,7 +749,7 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth) } if (s < 0) { - warn("Can't connect to %s", host); + warnx("Can't connect to `%s'", host); goto cleanup_fetch_url; } @@ -745,7 +780,7 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth) * strip off IPv6 scope identifier, since it is * local to the node */ - h = xstrdup(host); + h = ftp_strdup(host); if (isipv6addr(h) && (p = strchr(h, '%')) != NULL) { *p = '\0'; @@ -804,14 +839,16 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth) } /* Read the response */ - if ((buf = fparseln(fin, &len, NULL, "\0\0\0", 0)) == NULL) { - warn("Receiving HTTP reply"); + len = getline(fin, buf, sizeof(buf), &errormsg); + if (len < 0) { + if (*errormsg == '\n') + errormsg++; + warnx("Receiving HTTP reply: %s", errormsg); goto cleanup_fetch_url; } while (len > 0 && (ISLWS(buf[len-1]))) buf[--len] = '\0'; - if (debug) - fprintf(ttyout, "received `%s'\n", buf); + DPRINTF("received `%s'\n", buf); /* Determine HTTP response code */ cp = strchr(buf, ' '); @@ -822,22 +859,22 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth) hcode = strtol(cp, &ep, 10); if (*ep != '\0' && !isspace((unsigned char)*ep)) goto improper; - message = xstrdup(cp); + message = ftp_strdup(cp); /* Read the rest of the header. */ while (1) { - FREEPTR(buf); - if ((buf = fparseln(fin, &len, NULL, "\0\0\0", 0)) - == NULL) { - warn("Receiving HTTP reply"); + len = getline(fin, buf, sizeof(buf), &errormsg); + if (len < 0) { + if (*errormsg == '\n') + errormsg++; + warnx("Receiving HTTP reply: %s", errormsg); goto cleanup_fetch_url; } while (len > 0 && (ISLWS(buf[len-1]))) buf[--len] = '\0'; if (len == 0) break; - if (debug) - fprintf(ttyout, "received `%s'\n", buf); + DPRINTF("received `%s'\n", buf); /* * Look for some headers @@ -849,10 +886,8 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth) filesize = STRTOLL(cp, &ep, 10); if (filesize < 0 || *ep != '\0') goto improper; - if (debug) - fprintf(ttyout, - "parsed len as: " LLF "\n", - (LLT)filesize); + DPRINTF("parsed len as: " LLF "\n", + (LLT)filesize); } else if (match_token(&cp, "Content-Range:")) { if (! match_token(&cp, "bytes")) @@ -884,7 +919,8 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth) if (*cp != '\0') goto improper; - if (debug) { +#ifndef NO_DEBUG + if (ftp_debug) { fprintf(ttyout, "parsed range as: "); if (rangestart == -1) fprintf(ttyout, "*"); @@ -894,6 +930,7 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth) (LLT)rangeend); fprintf(ttyout, "/" LLF "\n", (LLT)entitylen); } +#endif if (! restart_point) { warnx( "Received unexpected Content-Range header"); @@ -904,11 +941,12 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth) struct tm parsed; char *t; - /* RFC 1123 */ + memset(&parsed, 0, sizeof(parsed)); + /* RFC1123 */ if ((t = strptime(cp, "%a, %d %b %Y %H:%M:%S GMT", &parsed)) - /* RFC 850 */ + /* RFC0850 */ || (t = strptime(cp, "%a, %d-%b-%y %H:%M:%S GMT", &parsed)) @@ -919,55 +957,49 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth) parsed.tm_isdst = -1; if (*t == '\0') mtime = timegm(&parsed); - if (debug && mtime != -1) { +#ifndef NO_DEBUG + if (ftp_debug && mtime != -1) { fprintf(ttyout, "parsed date as: %s", - ctime(&mtime)); + rfc2822time(localtime(&mtime))); } +#endif } } else if (match_token(&cp, "Location:")) { - location = xstrdup(cp); - if (debug) - fprintf(ttyout, - "parsed location as `%s'\n", cp); + location = ftp_strdup(cp); + DPRINTF("parsed location as `%s'\n", cp); } else if (match_token(&cp, "Transfer-Encoding:")) { if (match_token(&cp, "binary")) { warnx( - "Bogus transfer encoding - `binary' (fetching anyway)"); + "Bogus transfer encoding `binary' (fetching anyway)"); continue; } if (! (token = match_token(&cp, "chunked"))) { warnx( - "Unsupported transfer encoding - `%s'", + "Unsupported transfer encoding `%s'", token); goto cleanup_fetch_url; } ischunked++; - if (debug) - fprintf(ttyout, - "using chunked encoding\n"); + DPRINTF("using chunked encoding\n"); } else if (match_token(&cp, "Proxy-Authenticate:") || match_token(&cp, "WWW-Authenticate:")) { if (! (token = match_token(&cp, "Basic"))) { - if (debug) - fprintf(ttyout, + DPRINTF( "skipping unknown auth scheme `%s'\n", token); continue; } FREEPTR(auth); - auth = xstrdup(token); - if (debug) - fprintf(ttyout, - "parsed auth as `%s'\n", cp); + auth = ftp_strdup(token); + DPRINTF("parsed auth as `%s'\n", cp); } } /* finished parsing header */ - FREEPTR(buf); switch (hcode) { case 200: @@ -983,6 +1015,7 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth) case 302: case 303: case 305: + case 307: if (EMPTYSTRING(location)) { warnx( "No redirection Location provided by server"); @@ -1054,7 +1087,7 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth) #endif default: if (message) - warnx("Error retrieving file - `%s'", message); + warnx("Error retrieving file `%s'", message); else warnx("Unknown error retrieving file"); goto cleanup_fetch_url; @@ -1068,7 +1101,7 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth) oldintp = xsignal(SIGPIPE, SIG_IGN); fout = popen(savefile + 1, "w"); if (fout == NULL) { - warn("Can't run `%s'", savefile + 1); + warn("Can't execute `%s'", savefile + 1); goto cleanup_fetch_url; } closefunc = pclose; @@ -1110,7 +1143,7 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth) if (xferbuf) (void)free(xferbuf); bufsize = rcvbuf_size; - xferbuf = xmalloc(bufsize); + xferbuf = ftp_malloc(bufsize); } bytes = 0; @@ -1142,9 +1175,7 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth) warnx("Unexpected data following chunksize"); goto cleanup_fetch_url; } - if (debug) - fprintf(ttyout, "got chunksize of " LLF "\n", - (LLT)chunksize); + DPRINTF("got chunksize of " LLF "\n", (LLT)chunksize); if (chunksize == 0) break; } @@ -1229,7 +1260,7 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth) if (utimes(savefile, tval) == -1) { fprintf(ttyout, "Can't change modification time to %s", - asctime(localtime(&mtime))); + rfc2822time(localtime(&mtime))); } } if (bytes > 0) @@ -1268,7 +1299,6 @@ fetch_url(const char *url, const char *proxyenv, char *proxyauth, char *wwwauth) if (ppass != NULL) memset(ppass, 0, strlen(ppass)); FREEPTR(ppass); - FREEPTR(buf); FREEPTR(auth); FREEPTR(location); FREEPTR(message); @@ -1344,18 +1374,18 @@ fetch_ftp(const char *url) } } else { /* classic style `[user@]host:[file]' */ urltype = CLASSIC_URL_T; - host = xstrdup(url); + host = ftp_strdup(url); cp = strchr(host, '@'); if (cp != NULL) { *cp = '\0'; user = host; anonftp = 0; /* disable anonftp */ - host = xstrdup(cp + 1); + host = ftp_strdup(cp + 1); } cp = strchr(host, ':'); if (cp != NULL) { *cp = '\0'; - path = xstrdup(cp + 1); + path = ftp_strdup(cp + 1); } } if (EMPTYSTRING(host)) @@ -1403,14 +1433,12 @@ fetch_ftp(const char *url) url_decode(file); /* but still don't url_decode(dir) */ } - if (debug) - fprintf(ttyout, - "fetch_ftp: user `%s' pass `%s' host %s port %s " - "path `%s' dir `%s' file `%s'\n", - user ? user : "<null>", pass ? pass : "<null>", - host ? host : "<null>", port ? port : "<null>", - path ? path : "<null>", - dir ? dir : "<null>", file ? file : "<null>"); + DPRINTF("fetch_ftp: user `%s' pass `%s' host %s port %s " + "path `%s' dir `%s' file `%s'\n", + user ? user : "<null>", pass ? pass : "<null>", + host ? host : "<null>", port ? port : "<null>", + path ? path : "<null>", + dir ? dir : "<null>", file ? file : "<null>"); dirhasglob = filehasglob = 0; if (doglob && urltype == CLASSIC_URL_T) { @@ -1472,12 +1500,12 @@ fetch_ftp(const char *url) * directories in one step. * * If we are dealing with an `ftp://host/path' URL - * (urltype is FTP_URL_T), then RFC 1738 says we need to + * (urltype is FTP_URL_T), then RFC3986 says we need to * send a separate CWD command for each unescaped "/" * in the path, and we have to interpret %hex escaping * *after* we find the slashes. It's possible to get * empty components here, (from multiple adjacent - * slashes in the path) and RFC 1738 says that we should + * slashes in the path) and RFC3986 says that we should * still do `CWD ' (with a null argument) in such cases. * * Many ftp servers don't support `CWD ', so if there's an @@ -1535,10 +1563,9 @@ fetch_ftp(const char *url) url_decode(dir); } else nextpart = NULL; - if (debug) - fprintf(ttyout, "dir `%s', nextpart `%s'\n", - dir ? dir : "<null>", - nextpart ? nextpart : "<null>"); + DPRINTF("dir `%s', nextpart `%s'\n", + dir ? dir : "<null>", + nextpart ? nextpart : "<null>"); if (urltype == FTP_URL_T || *dir != '\0') { xargv[0] = "cd"; xargv[1] = dir; @@ -1550,8 +1577,8 @@ fetch_ftp(const char *url) fprintf(stderr, "\n" "ftp: The `CWD ' command (without a directory), which is required by\n" -" RFC 1738 to support the empty directory in the URL pathname (`//'),\n" -" conflicts with the server's conformance to RFC 959.\n" +" RFC3986 to support the empty directory in the URL pathname (`//'),\n" +" conflicts with the server's conformance to RFC0959.\n" " Try the same URL without the `//' in the URL pathname.\n" "\n"); goto cleanup_fetch_ftp; @@ -1610,6 +1637,7 @@ fetch_ftp(const char *url) rval = 0; cleanup_fetch_ftp: + FREEPTR(port); FREEPTR(host); FREEPTR(path); FREEPTR(user); @@ -1742,11 +1770,19 @@ auto_fetch(int argc, char *argv[]) } +/* + * Upload multiple files from the command line. + * + * If an error occurs the return value will be the offset+1 in + * argv[] of the file that caused a problem (i.e, argv[x] + * returns x+1) + * Otherwise, 0 is returned if all files uploaded successfully. + */ int auto_put(int argc, char **argv, const char *uploadserver) { char *uargv[4], *path, *pathsep; - int uargc, rval; + int uargc, rval, argpos; size_t len; uargc = 0; @@ -1756,10 +1792,9 @@ auto_put(int argc, char **argv, const char *uploadserver) pathsep = NULL; rval = 1; - if (debug) - fprintf(ttyout, "auto_put: target `%s'\n", uploadserver); + DPRINTF("auto_put: target `%s'\n", uploadserver); - path = xstrdup(uploadserver); + path = ftp_strdup(uploadserver); len = strlen(path); if (path[len - 1] != '/' && path[len - 1] != ':') { /* @@ -1768,7 +1803,7 @@ auto_put(int argc, char **argv, const char *uploadserver) if (argc > 1) { /* more than one file to upload */ len = strlen(uploadserver) + 2; /* path + "/" + "\0" */ free(path); - path = (char *)xmalloc(len); + path = (char *)ftp_malloc(len); (void)strlcpy(path, uploadserver, len); (void)strlcat(path, "/", len); } else { /* single file to upload */ @@ -1781,38 +1816,44 @@ auto_put(int argc, char **argv, const char *uploadserver) goto cleanup_auto_put; } pathsep++; - uargv[2] = xstrdup(pathsep); + uargv[2] = ftp_strdup(pathsep); pathsep[0] = '/'; } else - uargv[2] = xstrdup(pathsep + 1); + uargv[2] = ftp_strdup(pathsep + 1); pathsep[1] = '\0'; uargc++; } } - if (debug) - fprintf(ttyout, "auto_put: URL `%s' argv[2] `%s'\n", - path, uargv[2] ? uargv[2] : "<null>"); + DPRINTF("auto_put: URL `%s' argv[2] `%s'\n", + path, uargv[2] ? uargv[2] : "<null>"); /* connect and cwd */ rval = auto_fetch(1, &path); - free(path); if(rval >= 0) goto cleanup_auto_put; + rval = 0; + + /* target filename provided; upload 1 file */ /* XXX : is this the best way? */ if (uargc == 3) { uargv[1] = argv[0]; put(uargc, uargv); - goto cleanup_auto_put; - } - - for(; argv[0] != NULL; argv++) { - uargv[1] = argv[0]; - mput(uargc, uargv); + if ((code / 100) != COMPLETE) + rval = 1; + } else { /* otherwise a target dir: upload all files to it */ + for(argpos = 0; argv[argpos] != NULL; argpos++) { + uargv[1] = argv[argpos]; + mput(uargc, uargv); + if ((code / 100) != COMPLETE) { + rval = argpos + 1; + break; + } + } } - rval = 0; cleanup_auto_put: + free(path); FREEPTR(uargv[2]); return (rval); } diff --git a/net/tnftp/files/src/ftp.1 b/net/tnftp/files/src/ftp.1 index eda2f1d7015..b5af2a63970 100644 --- a/net/tnftp/files/src/ftp.1 +++ b/net/tnftp/files/src/ftp.1 @@ -1,7 +1,7 @@ -.\" NetBSD: ftp.1,v 1.7 2005/05/11 02:41:28 lukem Exp -.\" from NetBSD: ftp.1,v 1.109 2005/02/20 20:54:01 wiz Exp +.\" $NetBSD: ftp.1,v 1.4 2007/08/07 02:07:02 lukem Exp $ +.\" from NetBSD: ftp.1,v 1.119 2007/07/18 06:40:01 lukem Exp .\" -.\" Copyright (c) 1996-2004 The NetBSD Foundation, Inc. +.\" Copyright (c) 1996-2007 The NetBSD Foundation, Inc. .\" All rights reserved. .\" .\" This code is derived from software contributed to The NetBSD Foundation @@ -65,7 +65,7 @@ .\" .\" @(#)ftp.1 8.3 (Berkeley) 10/9/94 .\" -.Dd January 15, 2005 +.Dd July 18, 2007 .Dt FTP 1 .Os .Sh NAME @@ -87,6 +87,7 @@ Internet file transfer program .Bk -words .Op Fl q Ar quittime .Ek +.Op Fl s Ar srcaddr .Bk -words .Op Fl r Ar retry .Ek @@ -180,7 +181,7 @@ below for more information. .Pp Options may be specified at the command line, or to the command interpreter. -.Bl -tag -width "port " +.Bl -tag -width Fl .It Fl 4 Forces .Nm @@ -273,16 +274,20 @@ if the server does not support passive connections. .It Fl P Ar port Sets the port number to .Ar port . -.It Fl r Ar wait -Retry the connection attempt if it failed, pausing for -.Ar wait -seconds. .It Fl q Ar quittime Quit if the connection has stalled for .Ar quittime seconds. +.It Fl r Ar wait +Retry the connection attempt if it failed, pausing for +.Ar wait +seconds. .It Fl R Restart all non-proxied auto-fetches. +.It Fl s Ar srcaddr +Uses +.Ar srcaddr +as the local IP address for all connections. .It Fl t Enables packet tracing. .It Xo @@ -352,8 +357,8 @@ is awaiting commands from the user the prompt is provided to the user. The following commands are recognized by -.Nm ftp : -.Bl -tag -width Fl +.Nm ftp : +.Bl -tag -width Ic .It Ic \&! Op Ar command Op Ar args Invoke an interactive shell on the local machine. If there are arguments, the first is taken to be a command to execute @@ -456,10 +461,10 @@ when an ascii type transfer is made, these linefeeds may be distinguished from a record delimiter only when .Ic \&cr is off. -.It Ic debug Op Ar debug-value +.It Ic ftp_debug Op Ar ftp_debug-value Toggle debugging mode. If an optional -.Ar debug-value +.Ar ftp_debug-value is specified it is used to set the debugging level. When debugging is on, .Nm @@ -614,8 +619,9 @@ transferring a .Xr tar 1 archive of the subtree (in binary mode). .It Ic hash Op Ar size -Toggle hash-sign (``#'') printing for each data block -transferred. +Toggle hash-sign +.Pq Sq # +printing for each data block transferred. The size of a data block defaults to 1024 bytes. This can be changed by specifying .Ar size @@ -664,24 +670,49 @@ A synonym for Define a macro. Subsequent lines are stored as the macro .Ar macro-name ; -a null line (consecutive newline characters -in a file or -carriage returns from the terminal) terminates macro input mode. +a null line (consecutive newline characters in a file or carriage +returns from the terminal) terminates macro input mode. There is a limit of 16 macros and 4096 total characters in all defined macros. -Macros remain defined until a +Macro names can be a maximum of 8 characters. +Macros are only applicable to the current session they are +defined within (or if defined outside a session, to the session +invoked with the next +.Ic open +command), and remain defined until a .Ic close command is executed. -The macro processor interprets `$' and `\e' as special characters. -A `$' followed by a number (or numbers) is replaced by the +To invoke a macro, use the +.Ic $ +command (see above). +.Pp +The macro processor interprets +.Sq $ +and +.Sq \e +as special characters. +A +.Sq $ +followed by a number (or numbers) is replaced by the corresponding argument on the macro invocation command line. -A `$' followed by an `i' signals that macro processor that the -executing macro is to be looped. -On the first pass `$i' is -replaced by the first argument on the macro invocation command line, -on the second pass it is replaced by the second argument, and so on. -A `\e' followed by any character is replaced by that character. -Use the `\e' to prevent special treatment of the `$'. +A +.Sq $ +followed by an +.Sq i +signals the macro processor that the executing macro is to be +looped. +On the first pass +.Dq $i +is replaced by the first argument on the macro invocation command +line, on the second pass it is replaced by the second argument, +and so on. +A +.Sq \e +followed by any character is replaced by that character. +Use the +.Sq \e +to prevent special treatment of the +.Sq $ . .It Ic mdelete Op Ar remote-files Delete the .Ar remote-files @@ -757,7 +788,9 @@ The default (and only supported) mode is .Dq stream . .It Ic modtime Ar remote-file -Show the last modification time of the file on the remote machine. +Show the last modification time of the file on the remote machine, in +.Li RFC2822 +format. .It Ic more Ar file A synonym for .Ic page . @@ -824,9 +857,18 @@ and .Ic case settings). Variable templating is accomplished by including the -sequences `$1', `$2', ..., `$9' in +sequences +.Dq $1 , +.Dq $2 , +\&... +.Dq $9 +in .Ar inpattern . -Use `\\' to prevent this special treatment of the `$' character. +Use +.Sq \e +to prevent this special treatment of the +.Sq $ +character. All other characters are treated literally, and are used to determine the .Ic nmap .Op Ar inpattern @@ -838,13 +880,19 @@ $1.$2 and the remote file name "mydata.data", $1 would have the value The .Ar outpattern determines the resulting mapped filename. -The sequences `$1', `$2', ...., `$9' are replaced by any value resulting -from the +The sequences +.Dq $1 , +.Dq $2 , +\&... +.Dq $9 +are replaced by any value resulting from the .Ar inpattern template. -The sequence `$0' is replace by the original filename. +The sequence +.Dq $0 +is replaced by the original filename. Additionally, the sequence -.Ql Op Ar seq1 , Ar seq2 +.Dq Op Ar seq1 , Ar seq2 is replaced by .Op Ar seq1 if @@ -863,9 +911,18 @@ the output filename "myfile.data" for input filenames "myfile.data" and "myfile.myfile" for the input filename ".myfile". Spaces may be included in .Ar outpattern , -as in the example: `nmap $1 sed "s/ *$//" \*[Gt] $1' . -Use the `\e' character to prevent special treatment -of the `$','[',']', and `,' characters. +as in the example: +.Dl nmap $1 sed "s/ *$//" \*[Gt] $1 +Use the +.Sq \e +character to prevent special treatment +of the +.Sq $ , +.Sq \&[ , +.Sq \&] , +and +.Sq \&, +characters. .It Ic ntrans Op Ar inchars Op Ar outchars Set or unset the filename character translation mechanism. If no arguments are specified, the filename character @@ -953,7 +1010,7 @@ traffic. servers are required to support the .Dv PASV command by -.Li RFC 1123 , +.Li RFC1123 , some do not.) .It Ic pdir Op Ar remote-path Perform @@ -1440,7 +1497,9 @@ A synonym for .El .Pp Command arguments which have embedded spaces may be quoted with -quote `"' marks. +quote +.Sq \&" +marks. .Pp Commands which toggle settings can take an explicit .Ic on @@ -1566,7 +1625,7 @@ ascii or binary (respectively). The default transfer type is binary. .Pp In order to be compliant with -.Li RFC 1738 , +.Li RFC3986 , .Nm interprets the .Ar path @@ -1619,7 +1678,7 @@ Any .Sq Li \&% Ns Ar XX codes (per -.Li RFC 1738 ) +.Li RFC3986 ) within the path components are decoded, with .Ar XX representing a character code in hexadecimal. @@ -1744,6 +1803,26 @@ is in the URL, use them for the first attempt to authenticate. A local URL, copied from .Pa / Ns Ar path on the local host. +.\" about: +.It Xo +.Sm off +.Li about: +.Ar topic +.Sm on +.Xc +Display information regarding +.Ar topic ; +no file is retrieved for this auto-fetched element. +Supported values include: +.Bl -tag -width "about:version" +.It Li about:ftp +Information about +.Nm ftp . +.It Li about:version +The version of +.Nm ftp . +Useful to provide when reporting problems. +.El .El .Pp Unless noted otherwise above, and @@ -1869,11 +1948,12 @@ A particularly useful example of this mechanism is: .Dq Li dir \&"\&" \&|more . .It -Failing the above checks, if ``globbing'' is enabled, -local file names are expanded -according to the rules used in the +Failing the above checks, if +.Dq globbing +is enabled, local file names are expanded according to the rules +used in the .Xr csh 1 ; -c.f. the +see the .Ic glob command. If the @@ -2039,6 +2119,20 @@ next .Pa .netrc line and continue until a blank line (consecutive new-line characters) is encountered. +Like the other tokens in the +.Pa .netrc +file, a +.Ic macdef +is applicable only to the +.Ic machine +definition preceding it. +A +.Ic macdef +entry cannot be utilized by multiple +.Ic machine +definitions; rather, it must be defined following each +.Ic machine +it is intended to be used with. If a macro named .Ic init is defined, it is automatically executed as the last step in the @@ -2249,7 +2343,7 @@ URL characters are required in the username or password or .Sq / ) , encode them with -.Li RFC 1738 +.Li RFC3986 .Sq Li \&% Ns Ar XX encoding. .Pp @@ -2292,16 +2386,27 @@ for an example of how to make this automatic. .Xr ftpd 8 .Sh STANDARDS .Nm -attempts to be compliant with -.Li RFC 959 , -.Li RFC 1123 , -.Li RFC 1738 , -.Li RFC 2068 , -.Li RFC 2389 , -.Li RFC 2428 , -.Li RFC 2732 , -and -.Cm draft-ietf-ftpext-mlst-11 . +attempts to be compliant with: +.Bl -tag -offset indent -width 8n +.It Li RFC0959 +.Em File Transfer Protocol +.It Li RFC1123 +.Em Requirements for Internet Hosts - Application and Support +.It Li RFC1635 +.Em How to Use Anonymous FTP +.It Li RFC2389 +.Em Feature negotiation mechanism for the File Transfer Protocol +.It Li RFC2428 +.Em FTP Extensions for IPv6 and NATs +.It Li RFC2616 +.Em Hypertext Transfer Protocol -- HTTP/1.1 +.It Li RFC2822 +.Em Internet Message Format +.It Li RFC3659 +.Em Extensions to FTP +.It Li RFC3986 +.Em Uniform Resource Identifier (URI) +.El .Sh HISTORY The .Nm diff --git a/net/tnftp/files/src/ftp.c b/net/tnftp/files/src/ftp.c index 770685370a7..d06a3d1ce43 100644 --- a/net/tnftp/files/src/ftp.c +++ b/net/tnftp/files/src/ftp.c @@ -1,8 +1,8 @@ -/* NetBSD: ftp.c,v 1.11 2005/06/10 04:05:01 lukem Exp */ -/* from NetBSD: ftp.c,v 1.134 2005/06/10 00:18:46 lukem Exp */ +/* $NetBSD: ftp.c,v 1.7 2007/08/07 02:07:02 lukem Exp $ */ +/* from NetBSD: ftp.c,v 1.152 2007/07/22 05:02:50 lukem Exp */ /*- - * Copyright (c) 1996-2005 The NetBSD Foundation, Inc. + * Copyright (c) 1996-2007 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation @@ -96,9 +96,45 @@ */ #include "tnftp.h" +#include <arpa/telnet.h> + +#if 0 /* tnftp */ +#include <sys/cdefs.h> +#ifndef lint +#if 0 +static char sccsid[] = "@(#)ftp.c 8.6 (Berkeley) 10/27/94"; +#else +__RCSID(" NetBSD: ftp.c,v 1.152 2007/07/22 05:02:50 lukem Exp "); +#endif +#endif /* not lint */ + +#include <sys/types.h> +#include <sys/stat.h> +#include <sys/socket.h> +#include <sys/time.h> + +#include <netinet/in.h> +#include <netinet/in_systm.h> +#include <netinet/ip.h> +#include <arpa/inet.h> +#include <arpa/ftp.h> #include <arpa/telnet.h> +#include <ctype.h> +#include <err.h> +#include <errno.h> +#include <fcntl.h> +#include <netdb.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <time.h> +#include <unistd.h> +#include <stdarg.h> + +#endif /* tnftp */ + #include "ftp_var.h" volatile sig_atomic_t abrtflag; @@ -118,12 +154,12 @@ struct sockinet { struct sockaddr_in6 su_sin6; #endif } si_su; -#if !HAVE_SOCKADDR_SA_LEN +#if !defined(HAVE_STRUCT_SOCKADDR_SA_LEN) int si_len; #endif }; -#if !HAVE_SOCKADDR_SA_LEN +#if !defined(HAVE_STRUCT_SOCKADDR_SA_LEN) # define su_len si_len #else # define su_len si_su.su_sin.sin_len @@ -140,7 +176,6 @@ hookup(char *host, char *port) struct addrinfo hints, *res, *res0; char hbuf[MAXHOSTNAMELEN]; static char hostnamebuf[MAXHOSTNAMELEN]; - char *cause = "unknown"; socklen_t len; int on = 1; @@ -154,7 +189,9 @@ hookup(char *host, char *port) hints.ai_protocol = 0; error = getaddrinfo(host, NULL, &hints, &res0); if (error) { - warnx("%s: %s", host, gai_strerror(error)); + warnx("Can't lookup `%s': %s", host, + (error == EAI_SYSTEM) ? strerror(errno) + : gai_strerror(error)); code = -1; return (0); } @@ -167,49 +204,22 @@ hookup(char *host, char *port) hostname = hostnamebuf; for (res = res0; res; res = res->ai_next) { - /* - * make sure that ai_addr is NOT an IPv4 mapped address. - * IPv4 mapped address complicates too many things in FTP - * protocol handling, as FTP protocol is defined differently - * between IPv4 and IPv6. - * - * This may not be the best way to handle this situation, - * since the semantics of IPv4 mapped address is defined in - * the kernel. There are configurations where we should use - * IPv4 mapped address as native IPv6 address, not as - * "an IPv6 address that embeds IPv4 address" (namely, SIIT). - * - * More complete solution would be to have an additional - * getsockopt to grab "real" peername/sockname. "real" - * peername/sockname will be AF_INET if IPv4 mapped address - * is used to embed IPv4 address, and will be AF_INET6 if - * we use it as native. What a mess! - */ ai_unmapped(res); + if (getnameinfo(res->ai_addr, res->ai_addrlen, + hbuf, sizeof(hbuf), NULL, 0, NI_NUMERICHOST)) + strlcpy(hbuf, "?", sizeof(hbuf)); if (verbose && res0->ai_next) { /* if we have multiple possibilities */ - if (getnameinfo(res->ai_addr, res->ai_addrlen, - hbuf, sizeof(hbuf), NULL, 0, NI_NUMERICHOST)) - strlcpy(hbuf, "?", sizeof(hbuf)); fprintf(ttyout, "Trying %s...\n", hbuf); } ((struct sockaddr_in *)res->ai_addr)->sin_port = htons(portnum); s = socket(res->ai_family, SOCK_STREAM, res->ai_protocol); if (s < 0) { - cause = "socket"; + warn("Can't create socket for connection to `%s'", + hbuf); continue; } - error = xconnect(s, res->ai_addr, res->ai_addrlen); - if (error) { - /* this "if" clause is to prevent print warning twice */ - if (res->ai_next) { - if (getnameinfo(res->ai_addr, res->ai_addrlen, - hbuf, sizeof(hbuf), NULL, 0, - NI_NUMERICHOST)) - strlcpy(hbuf, "?", sizeof(hbuf)); - warn("connect to address %s", hbuf); - } - cause = "connect"; + if (ftp_connect(s, res->ai_addr, res->ai_addrlen) < 0) { close(s); s = -1; continue; @@ -219,7 +229,7 @@ hookup(char *host, char *port) break; } if (s < 0) { - warn("%s", cause); + warnx("Can't connect to `%s'", host); code = -1; freeaddrinfo(res0); return 0; @@ -231,7 +241,7 @@ hookup(char *host, char *port) len = hisctladdr.su_len; if (getsockname(s, (struct sockaddr *)&myctladdr.si_su, &len) == -1) { - warn("getsockname"); + warn("Can't determine my address of connection to `%s'", host); code = -1; goto bad; } @@ -242,8 +252,7 @@ hookup(char *host, char *port) int tos = IPTOS_LOWDELAY; if (setsockopt(s, IPPROTO_IP, IP_TOS, (void *)&tos, sizeof(tos)) == -1) { - if (debug) - warn("setsockopt %s (ignored)", + DWARN("setsockopt %s (ignored)", "IPTOS_LOWDELAY"); } } @@ -251,7 +260,7 @@ hookup(char *host, char *port) cin = fdopen(s, "r"); cout = fdopen(s, "w"); if (cin == NULL || cout == NULL) { - warnx("fdopen failed."); + warnx("Can't fdopen socket"); if (cin) (void)fclose(cin); if (cout) @@ -272,8 +281,7 @@ hookup(char *host, char *port) if (setsockopt(s, SOL_SOCKET, SO_OOBINLINE, (void *)&on, sizeof(on)) == -1) { - if (debug) - warn("setsockopt %s (ignored)", "SO_OOBINLINE"); + DWARN("setsockopt %s (ignored)", "SO_OOBINLINE"); } return (hostname); @@ -319,7 +327,8 @@ command(const char *fmt, ...) int r; sigfunc oldsigint; - if (debug) { +#ifndef NO_DEBUG + if (ftp_debug) { fputs("---> ", ttyout); va_start(ap, fmt); if (strncmp("PASS ", fmt, 5) == 0) @@ -331,8 +340,9 @@ command(const char *fmt, ...) va_end(ap); putc('\n', ttyout); } +#endif if (cout == NULL) { - warnx("No control connection for command."); + warnx("No control connection for command"); code = -1; return (0); } @@ -354,6 +364,12 @@ command(const char *fmt, ...) return (r); } +static const char *m421[] = { + "remote server timed out. Connection closed", + "user interrupt. Connection closed", + "remote server has closed connection", +}; + int getreply(int expecteof) { @@ -374,7 +390,8 @@ getreply(int expecteof) for (line = 0 ;; line++) { dig = n = code = 0; cp = current_line; - while (alarmtimer(60),((c = getc(cin)) != '\n')) { + while (alarmtimer(quit_time ? quit_time : 60), + ((c = getc(cin)) != '\n')) { if (c == IAC) { /* handle telnet commands */ switch (c = getc(cin)) { case WILL: @@ -413,18 +430,15 @@ getreply(int expecteof) cpend = 0; lostpeer(0); if (verbose) { + size_t midx; if (reply_timeoutflag) - fputs( - "421 Service not available, remote server timed out. Connection closed\n", - ttyout); + midx = 0; else if (reply_abrtflag) - fputs( - "421 Service not available, user interrupt. Connection closed.\n", - ttyout); + midx = 1; else - fputs( - "421 Service not available, remote server has closed connection.\n", - ttyout); + midx = 2; + (void)fprintf(ttyout, + "421 Service not available, %s.\n", m421[midx]); (void)fflush(ttyout); } code = 421; @@ -473,7 +487,7 @@ getreply(int expecteof) if (verbose > 0 || ((verbose > -1 && n == '5') && (n < '5' || !retry_connect))) { (void)putc(c, ttyout); - (void)fflush (ttyout); + (void)fflush(ttyout); } if (cp[-1] == '\r') cp[-1] = '\0'; @@ -521,7 +535,7 @@ empty(FILE *cin, FILE *din, int sec) pfd[nfd++].events = POLLIN; } - if ((nr = xpoll(pfd, nfd, sec * 1000)) <= 0) + if ((nr = ftp_poll(pfd, nfd, sec * 1000)) <= 0) return nr; nr = 0; @@ -553,8 +567,7 @@ abortxfer(int notused) strlcpy(msgbuf, "\nsend", sizeof(msgbuf)); break; default: - errx(1, "abortxfer called with unknown direction `%s'", - direction); + errx(1, "abortxfer: unknown direction `%s'", direction); } len = strlcat(msgbuf, " aborted. Waiting for remote to finish abort.\n", sizeof(msgbuf)); @@ -562,30 +575,108 @@ abortxfer(int notused) siglongjmp(xferabort, 1); } +/* + * Read data from infd & write to outfd, using buf/bufsize as the temporary + * buffer, dealing with short writes. + * If rate_limit != 0, rate-limit the transfer. + * If hash_interval != 0, fputc('c', ttyout) every hash_interval bytes. + * Updates global variables: bytes. + * Returns 0 if ok, 1 if there was a read error, 2 if there was a write error. + * In the case of error, errno contains the appropriate error code. + */ +static int +copy_bytes(int infd, int outfd, char *buf, size_t bufsize, + int rate_limit, int hash_interval) +{ + volatile off_t hashc; + ssize_t inc, outc; + char *bufp; + struct timeval tvthen, tvnow, tvdiff; + off_t bufrem, bufchunk; + int serr; + + hashc = hash_interval; + if (rate_limit) + bufchunk = rate_limit; + else + bufchunk = bufsize; + + while (1) { + if (rate_limit) { + (void)gettimeofday(&tvthen, NULL); + } + errno = 0; + inc = outc = 0; + /* copy bufchunk at a time */ + bufrem = bufchunk; + while (bufrem > 0) { + inc = read(infd, buf, MIN(bufsize, bufrem)); + if (inc <= 0) + goto copy_done; + bytes += inc; + bufrem -= inc; + bufp = buf; + while (inc > 0) { + outc = write(outfd, bufp, inc); + if (outc < 0) + goto copy_done; + inc -= outc; + bufp += outc; + } + if (hash_interval) { + while (bytes >= hashc) { + (void)putc('#', ttyout); + hashc += hash_interval; + } + (void)fflush(ttyout); + } + } + if (rate_limit) { /* rate limited; wait if necessary */ + while (1) { + (void)gettimeofday(&tvnow, NULL); + timersub(&tvnow, &tvthen, &tvdiff); + if (tvdiff.tv_sec > 0) + break; + usleep(1000000 - tvdiff.tv_usec); + } + } + } + + copy_done: + serr = errno; + if (hash_interval && bytes > 0) { + if (bytes < hash_interval) + (void)putc('#', ttyout); + (void)putc('\n', ttyout); + (void)fflush(ttyout); + } + errno = serr; + if (inc == -1) + return 1; + if (outc == -1) + return 2; + + return 0; +} + void sendrequest(const char *cmd, const char *local, const char *remote, int printnames) { struct stat st; - int c, d; - FILE *fin, *dout; - int (*closefunc)(FILE *); - sigfunc oldintr, oldintp; - volatile off_t hashbytes; - char *lmode, *bufp; + int c; + FILE *volatile fin; + FILE *volatile dout; + int (*volatile closefunc)(FILE *); + sigfunc volatile oldintr; + sigfunc volatile oldintp; + off_t volatile hashbytes; + int hash_interval; + char *volatile lmode; static size_t bufsize; static char *buf; int oprogress; -#ifdef __GNUC__ /* to shut up gcc warnings */ - (void)&fin; - (void)&dout; - (void)&closefunc; - (void)&oldintr; - (void)&oldintp; - (void)&lmode; -#endif - hashbytes = mark; direction = "sent"; dout = NULL; @@ -593,7 +684,7 @@ sendrequest(const char *cmd, const char *local, const char *remote, filesize = -1; oprogress = progress; if (verbose && printnames) { - if (local && *local != '-') + if (*local != '-') fprintf(ttyout, "local: %s ", local); if (remote) fprintf(ttyout, "remote: %s\n", remote); @@ -623,7 +714,7 @@ sendrequest(const char *cmd, const char *local, const char *remote, oldintp = xsignal(SIGPIPE, SIG_IGN); fin = popen(local + 1, "r"); if (fin == NULL) { - warn("%s", local + 1); + warn("Can't execute `%s'", local + 1); code = -1; goto cleanupsend; } @@ -632,7 +723,7 @@ sendrequest(const char *cmd, const char *local, const char *remote, } else { fin = fopen(local, "r"); if (fin == NULL) { - warn("local: %s", local); + warn("Can't open `%s'", local); code = -1; goto cleanupsend; } @@ -666,7 +757,7 @@ sendrequest(const char *cmd, const char *local, const char *remote, break; } if (rc < 0) { - warn("local: %s", local); + warn("Can't seek to restart `%s'", local); goto cleanupsend; } if (command("REST " LLF, (LLT)restart_point) != CONTINUE) @@ -689,86 +780,24 @@ sendrequest(const char *cmd, const char *local, const char *remote, if (buf) (void)free(buf); bufsize = sndbuf_size; - buf = xmalloc(bufsize); + buf = ftp_malloc(bufsize); } progressmeter(-1); oldintp = xsignal(SIGPIPE, SIG_IGN); + hash_interval = (hash && (!progress || filesize < 0)) ? mark : 0; switch (curtype) { case TYPE_I: case TYPE_L: - if (rate_put) { /* rate limited */ - while (1) { - struct timeval then, now, td; - off_t bufrem; - - (void)gettimeofday(&then, NULL); - errno = c = d = 0; - bufrem = rate_put; - while (bufrem > 0) { - if ((c = read(fileno(fin), buf, - MIN(bufsize, bufrem))) <= 0) - goto senddone; - bytes += c; - bufrem -= c; - for (bufp = buf; c > 0; - c -= d, bufp += d) - if ((d = write(fileno(dout), - bufp, c)) <= 0) - break; - if (d < 0) - goto senddone; - if (hash && - (!progress || filesize < 0) ) { - while (bytes >= hashbytes) { - (void)putc('#', ttyout); - hashbytes += mark; - } - (void)fflush(ttyout); - } - } - while (1) { - (void)gettimeofday(&now, NULL); - timersub(&now, &then, &td); - if (td.tv_sec > 0) - break; - usleep(1000000 - td.tv_usec); - } - } - } else { /* simpler/faster; no rate limit */ - while (1) { - errno = c = d = 0; - if ((c = read(fileno(fin), buf, bufsize)) <= 0) - goto senddone; - bytes += c; - for (bufp = buf; c > 0; c -= d, bufp += d) - if ((d = write(fileno(dout), bufp, c)) - <= 0) - break; - if (d < 0) - goto senddone; - if (hash && (!progress || filesize < 0) ) { - while (bytes >= hashbytes) { - (void)putc('#', ttyout); - hashbytes += mark; - } - (void)fflush(ttyout); - } - } - } - senddone: - if (hash && (!progress || filesize < 0) && bytes > 0) { - if (bytes < mark) - (void)putc('#', ttyout); - (void)putc('\n', ttyout); - } - if (c < 0) - warn("local: %s", local); - if (d < 0) { + c = copy_bytes(fileno(fin), fileno(dout), buf, bufsize, + rate_put, hash_interval); + if (c == 1) { + warn("Reading `%s'", local); + } else if (c == 2) { if (errno != EPIPE) - warn("netout"); + warn("Writing to network"); bytes = -1; } break; @@ -776,8 +805,7 @@ sendrequest(const char *cmd, const char *local, const char *remote, case TYPE_A: while ((c = getc(fin)) != EOF) { if (c == '\n') { - while (hash && (!progress || filesize < 0) && - (bytes >= hashbytes)) { + while (hash_interval && bytes >= hashbytes) { (void)putc('#', ttyout); (void)fflush(ttyout); hashbytes += mark; @@ -789,23 +817,23 @@ sendrequest(const char *cmd, const char *local, const char *remote, } (void)putc(c, dout); bytes++; -#if 0 /* this violates RFC */ +#if 0 /* this violates RFC0959 */ if (c == '\r') { (void)putc('\0', dout); bytes++; } #endif } - if (hash && (!progress || filesize < 0)) { + if (hash_interval) { if (bytes < hashbytes) (void)putc('#', ttyout); (void)putc('\n', ttyout); } if (ferror(fin)) - warn("local: %s", local); + warn("Reading `%s'", local); if (ferror(dout)) { if (errno != EPIPE) - warn("netout"); + warn("Writing to network"); bytes = -1; } break; @@ -862,32 +890,28 @@ sendrequest(const char *cmd, const char *local, const char *remote, } void -recvrequest(const char *cmd, const char *local, const char *remote, +recvrequest(const char *cmd, const char *volatile local, const char *remote, const char *lmode, int printnames, int ignorespecial) { - FILE *fout, *din; - int (*closefunc)(FILE *); - sigfunc oldintr, oldintp; + FILE *volatile fout; + FILE *volatile din; + int (*volatile closefunc)(FILE *); + sigfunc volatile oldintr; + sigfunc volatile oldintp; int c, d; - volatile int is_retr, tcrflag, bare_lfs; + int volatile is_retr; + int volatile tcrflag; + int volatile bare_lfs; static size_t bufsize; static char *buf; - volatile off_t hashbytes; + off_t volatile hashbytes; + int hash_interval; struct stat st; time_t mtime; struct timeval tval[2]; int oprogress; int opreserve; -#ifdef __GNUC__ /* to shut up gcc warnings */ - (void)&local; - (void)&fout; - (void)&din; - (void)&closefunc; - (void)&oldintr; - (void)&oldintp; -#endif - fout = NULL; din = NULL; hashbytes = mark; @@ -899,7 +923,7 @@ recvrequest(const char *cmd, const char *local, const char *remote, opreserve = preserve; is_retr = (strcmp(cmd, "RETR") == 0); if (is_retr && verbose && printnames) { - if (local && (ignorespecial || *local != '-')) + if (ignorespecial || *local != '-') fprintf(ttyout, "local: %s ", local); if (remote) fprintf(ttyout, "remote: %s\n", remote); @@ -925,7 +949,7 @@ recvrequest(const char *cmd, const char *local, const char *remote, char *dir = strrchr(local, '/'); if (errno != ENOENT && errno != EACCES) { - warn("local: %s", local); + warn("Can't access `%s'", local); code = -1; goto cleanuprecv; } @@ -936,13 +960,13 @@ recvrequest(const char *cmd, const char *local, const char *remote, if (dir != NULL) *dir = '/'; if (d < 0) { - warn("local: %s", local); + warn("Can't access `%s'", local); code = -1; goto cleanuprecv; } if (!runique && errno == EACCES && chmod(local, (S_IRUSR|S_IWUSR)) < 0) { - warn("local: %s", local); + warn("Can't chmod `%s'", local); code = -1; goto cleanuprecv; } @@ -994,7 +1018,7 @@ recvrequest(const char *cmd, const char *local, const char *remote, oldintp = xsignal(SIGPIPE, SIG_IGN); fout = popen(local + 1, "w"); if (fout == NULL) { - warn("%s", local+1); + warn("Can't execute `%s'", local+1); goto abort; } progress = 0; @@ -1003,7 +1027,7 @@ recvrequest(const char *cmd, const char *local, const char *remote, } else { fout = fopen(local, lmode); if (fout == NULL) { - warn("local: %s", local); + warn("Can't open `%s'", local); goto abort; } closefunc = fclose; @@ -1017,10 +1041,11 @@ recvrequest(const char *cmd, const char *local, const char *remote, if (buf) (void)free(buf); bufsize = rcvbuf_size; - buf = xmalloc(bufsize); + buf = ftp_malloc(bufsize); } progressmeter(-1); + hash_interval = (hash && (!progress || filesize < 0)) ? mark : 0; switch (curtype) { @@ -1028,76 +1053,17 @@ recvrequest(const char *cmd, const char *local, const char *remote, case TYPE_L: if (is_retr && restart_point && lseek(fileno(fout), restart_point, SEEK_SET) < 0) { - warn("local: %s", local); + warn("Can't seek to restart `%s'", local); goto cleanuprecv; } - if (rate_get) { /* rate limiting */ - while (1) { - struct timeval then, now, td; - off_t bufrem; - - (void)gettimeofday(&then, NULL); - errno = c = d = 0; - for (bufrem = rate_get; bufrem > 0; ) { - if ((c = read(fileno(din), buf, - MIN(bufsize, bufrem))) <= 0) - goto recvdone; - bytes += c; - bufrem -=c; - if ((d = write(fileno(fout), buf, c)) - != c) - goto recvdone; - if (hash && - (!progress || filesize < 0)) { - while (bytes >= hashbytes) { - (void)putc('#', ttyout); - hashbytes += mark; - } - (void)fflush(ttyout); - } - } - /* sleep until time is up */ - while (1) { - (void)gettimeofday(&now, NULL); - timersub(&now, &then, &td); - if (td.tv_sec > 0) - break; - usleep(1000000 - td.tv_usec); - } - } - } else { /* faster code (no limiting) */ - while (1) { - errno = c = d = 0; - if ((c = read(fileno(din), buf, bufsize)) <= 0) - goto recvdone; - bytes += c; - if ((d = write(fileno(fout), buf, c)) != c) - goto recvdone; - if (hash && (!progress || filesize < 0)) { - while (bytes >= hashbytes) { - (void)putc('#', ttyout); - hashbytes += mark; - } - (void)fflush(ttyout); - } - } - } - recvdone: - if (hash && (!progress || filesize < 0) && bytes > 0) { - if (bytes < mark) - (void)putc('#', ttyout); - (void)putc('\n', ttyout); - } - if (c < 0) { + c = copy_bytes(fileno(din), fileno(fout), buf, bufsize, + rate_get, hash_interval); + if (c == 1) { if (errno != EPIPE) - warn("netin"); + warn("Reading from network"); bytes = -1; - } - if (d < c) { - if (d < 0) - warn("local: %s", local); - else - warnx("%s: short write", local); + } else if (c == 2) { + warn("Writing `%s'", local); } break; @@ -1116,7 +1082,7 @@ recvrequest(const char *cmd, const char *local, const char *remote, } if (fseeko(fout, (off_t)0, SEEK_CUR) < 0) { done: - warn("local: %s", local); + warn("Can't seek to restart `%s'", local); goto cleanuprecv; } } @@ -1124,8 +1090,7 @@ recvrequest(const char *cmd, const char *local, const char *remote, if (c == '\n') bare_lfs++; while (c == '\r') { - while (hash && (!progress || filesize < 0) && - (bytes >= hashbytes)) { + while (hash_interval && bytes >= hashbytes) { (void)putc('#', ttyout); (void)fflush(ttyout); hashbytes += mark; @@ -1148,18 +1113,18 @@ recvrequest(const char *cmd, const char *local, const char *remote, contin2: ; } break2: - if (hash && (!progress || filesize < 0)) { + if (hash_interval) { if (bytes < hashbytes) (void)putc('#', ttyout); (void)putc('\n', ttyout); } if (ferror(din)) { if (errno != EPIPE) - warn("netin"); + warn("Reading from network"); bytes = -1; } if (ferror(fout)) - warn("local: %s", local); + warn("Writing `%s'", local); break; } @@ -1189,7 +1154,8 @@ recvrequest(const char *cmd, const char *local, const char *remote, if (utimes(local, tval) == -1) { fprintf(ttyout, "Can't change modification time on %s to %s", - local, asctime(localtime(&mtime))); + local, + rfc2822time(localtime(&mtime))); } } } @@ -1198,7 +1164,7 @@ recvrequest(const char *cmd, const char *local, const char *remote, abort: /* - * abort using RFC 959 recommended IP,SYNC sequence + * abort using RFC0959 recommended IP,SYNC sequence */ if (! sigsetjmp(xferabort, 1)) { /* this is the first call */ @@ -1246,34 +1212,44 @@ initconn(void) unsigned int af, hal, pal; socklen_t len; char *pasvcmd = NULL; + int overbose; #ifdef INET6 - if (myctladdr.su_family == AF_INET6 && debug && +#ifndef NO_DEBUG + if (myctladdr.su_family == AF_INET6 && ftp_debug && (IN6_IS_ADDR_LINKLOCAL(&myctladdr.si_su.su_sin6.sin6_addr) || IN6_IS_ADDR_SITELOCAL(&myctladdr.si_su.su_sin6.sin6_addr))) { - warnx("use of scoped address can be troublesome"); + warnx("Use of scoped addresses can be troublesome"); } #endif +#endif + reinit: if (passivemode) { data_addr = myctladdr; data = socket(data_addr.su_family, SOCK_STREAM, 0); if (data < 0) { - warn("socket"); + warn("Can't create socket for data connection"); return (1); } if ((options & SO_DEBUG) && setsockopt(data, SOL_SOCKET, SO_DEBUG, (void *)&on, sizeof(on)) == -1) { - if (debug) - warn("setsockopt %s (ignored)", "SO_DEBUG"); + DWARN("setsockopt %s (ignored)", "SO_DEBUG"); } result = COMPLETE + 1; switch (data_addr.su_family) { case AF_INET: if (epsv4 && !epsv4bad) { pasvcmd = "EPSV"; + overbose = verbose; + if (ftp_debug == 0) + verbose = -1; result = command("EPSV"); + verbose = overbose; + if (verbose > 0 && + (result == COMPLETE || !connected)) + fprintf(ttyout, "%s\n", reply_string); if (!connected) return (1); /* @@ -1288,10 +1264,8 @@ initconn(void) } if (result != COMPLETE) { epsv4bad = 1; - if (debug) - fputs( - "disabling epsv4 for this connection\n", - ttyout); + DPRINTF("disabling epsv4 for this " + "connection\n"); } } if (result != COMPLETE) { @@ -1304,7 +1278,14 @@ initconn(void) #ifdef INET6 case AF_INET6: pasvcmd = "EPSV"; + overbose = verbose; + if (ftp_debug == 0) + verbose = -1; result = command("EPSV"); + verbose = overbose; + if (verbose > 0 && + (result == COMPLETE || !connected)) + fprintf(ttyout, "%s\n", reply_string); if (!connected) return (1); /* this code is to be friendly with broken BSDI ftpd */ @@ -1484,8 +1465,8 @@ initconn(void) } else goto bad; - while (xconnect(data, (struct sockaddr *)&data_addr.si_su, - data_addr.su_len) < 0) { + if (ftp_connect(data, (struct sockaddr *)&data_addr.si_su, + data_addr.su_len) < 0) { if (activefallback) { (void)close(data); data = -1; @@ -1495,7 +1476,6 @@ initconn(void) #endif goto reinit; } - warn("connect for data channel"); goto bad; } #ifdef IPTOS_THROUGHPUT @@ -1503,9 +1483,8 @@ initconn(void) on = IPTOS_THROUGHPUT; if (setsockopt(data, IPPROTO_IP, IP_TOS, (void *)&on, sizeof(on)) == -1) { - if (debug) - warn("setsockopt %s (ignored)", - "IPTOS_THROUGHPUT"); + DWARN("setsockopt %s (ignored)", + "IPTOS_THROUGHPUT"); } } #endif @@ -1520,7 +1499,7 @@ initconn(void) (void)close(data); data = socket(data_addr.su_family, SOCK_STREAM, 0); if (data < 0) { - warn("socket"); + warn("Can't create socket for data connection"); if (tmpno) sendport = 1; return (1); @@ -1528,29 +1507,28 @@ initconn(void) if (!sendport) if (setsockopt(data, SOL_SOCKET, SO_REUSEADDR, (void *)&on, sizeof(on)) == -1) { - warn("setsockopt %s", "SO_REUSEADDR"); + warn("Can't set SO_REUSEADDR on data connection"); goto bad; } if (bind(data, (struct sockaddr *)&data_addr.si_su, data_addr.su_len) < 0) { - warn("bind"); + warn("Can't bind for data connection"); goto bad; } if ((options & SO_DEBUG) && setsockopt(data, SOL_SOCKET, SO_DEBUG, (void *)&on, sizeof(on)) == -1) { - if (debug) - warn("setsockopt %s (ignored)", "SO_DEBUG"); + DWARN("setsockopt %s (ignored)", "SO_DEBUG"); } len = sizeof(data_addr.si_su); memset((char *)&data_addr, 0, sizeof (data_addr)); if (getsockname(data, (struct sockaddr *)&data_addr.si_su, &len) == -1) { - warn("getsockname"); + warn("Can't determine my address of data connection"); goto bad; } data_addr.su_len = len; - if (xlisten(data, 1) < 0) - warn("listen"); + if (ftp_listen(data, 1) < 0) + warn("Can't listen to data connection"); if (sendport) { char hname[NI_MAXHOST], sname[NI_MAXSERV]; @@ -1578,16 +1556,21 @@ initconn(void) sizeof(sname), NI_NUMERICHOST | NI_NUMERICSERV)) { result = ERROR; } else { + overbose = verbose; + if (ftp_debug == 0) + verbose = -1; result = command("EPRT |%d|%s|%s|", af, hname, sname); + verbose = overbose; + if (verbose > 0 && + (result == COMPLETE || !connected)) + fprintf(ttyout, "%s\n", reply_string); if (!connected) return (1); if (result != COMPLETE) { epsv4bad = 1; - if (debug) - fputs( - "disabling epsv4 for this connection\n", - ttyout); + DPRINTF("disabling epsv4 for this " + "connection\n"); } } break; @@ -1641,9 +1624,7 @@ initconn(void) on = IPTOS_THROUGHPUT; if (setsockopt(data, IPPROTO_IP, IP_TOS, (void *)&on, sizeof(on)) == -1) - if (debug) - warn("setsockopt %s (ignored)", - "IPTOS_THROUGHPUT"); + DWARN("setsockopt %s (ignored)", "IPTOS_THROUGHPUT"); } #endif return (0); @@ -1688,14 +1669,14 @@ dataconn(const char *lmode) timeout = td.tv_sec * 1000 + td.tv_usec/1000; if (timeout < 0) timeout = 0; - rv = xpoll(pfd, 1, timeout); + rv = ftp_poll(pfd, 1, timeout); } while (rv == -1 && errno == EINTR); /* loop until poll ! EINTR */ if (rv == -1) { - warn("poll waiting before accept"); + warn("Can't poll waiting before accept"); goto dataconn_failed; } if (rv == 0) { - warn("poll timeout waiting before accept"); + warnx("Poll timeout waiting before accept"); goto dataconn_failed; } @@ -1705,7 +1686,7 @@ dataconn(const char *lmode) s = accept(data, (struct sockaddr *) &from.si_su, &fromlen); } while (s == -1 && errno == EINTR); /* loop until accept ! EINTR */ if (s == -1) { - warn("accept"); + warn("Can't accept data connection"); goto dataconn_failed; } @@ -1719,9 +1700,7 @@ dataconn(const char *lmode) int tos = IPTOS_THROUGHPUT; if (setsockopt(s, IPPROTO_IP, IP_TOS, (void *)&tos, sizeof(tos)) == -1) { - if (debug) - warn("setsockopt %s (ignored)", - "IPTOS_THROUGHPUT"); + DWARN("setsockopt %s (ignored)", "IPTOS_THROUGHPUT"); } } #endif @@ -1848,15 +1827,10 @@ abortpt(int notused) void proxtrans(const char *cmd, const char *local, const char *remote) { - sigfunc oldintr; + sigfunc volatile oldintr; int prox_type, nfnd; - volatile int secndflag; - char *cmd2; - -#ifdef __GNUC__ /* to shut up gcc warnings */ - (void)&oldintr; - (void)&cmd2; -#endif + int volatile secndflag; + char *volatile cmd2; oldintr = NULL; secndflag = 0; @@ -1960,7 +1934,7 @@ proxtrans(const char *cmd, const char *local, const char *remote) if (cpend) { if ((nfnd = empty(cin, NULL, 10)) <= 0) { if (nfnd < 0) - warn("abort"); + warn("Error aborting proxy command"); if (ptabflg) code = -1; lostpeer(0); @@ -1982,13 +1956,13 @@ reset(int argc, char *argv[]) int nfnd = 1; if (argc == 0 && argv != NULL) { - fprintf(ttyout, "usage: %s\n", argv[0]); + UPRINTF("usage: %s\n", argv[0]); code = -1; return; } while (nfnd > 0) { if ((nfnd = empty(cin, NULL, 0)) < 0) { - warn("reset"); + warn("Error resetting connection"); code = -1; lostpeer(0); } else if (nfnd) @@ -2010,7 +1984,7 @@ gunique(const char *local) if (cp) *cp = '/'; if (d < 0) { - warn("local: %s", local); + warn("Can't access `%s'", local); return (NULL); } len = strlcpy(new, local, sizeof(new)); @@ -2070,7 +2044,7 @@ abort_remote(FILE *din) int nfnd; if (cout == NULL) { - warnx("Lost control connection for abort."); + warnx("Lost control connection for abort"); if (ptabflg) code = -1; lostpeer(0); @@ -2084,12 +2058,12 @@ abort_remote(FILE *din) buf[1] = IP; buf[2] = IAC; if (send(fileno(cout), buf, 3, MSG_OOB) != 3) - warn("abort"); + warn("Can't send abort message"); fprintf(cout, "%cABOR\r\n", DM); (void)fflush(cout); if ((nfnd = empty(cin, din, 10)) <= 0) { if (nfnd < 0) - warn("abort"); + warn("Can't send abort message"); if (ptabflg) code = -1; lostpeer(0); @@ -2105,6 +2079,24 @@ abort_remote(FILE *din) (void)getreply(0); } +/* + * Ensure that ai->ai_addr is NOT an IPv4 mapped address. + * IPv4 mapped address complicates too many things in FTP + * protocol handling, as FTP protocol is defined differently + * between IPv4 and IPv6. + * + * This may not be the best way to handle this situation, + * since the semantics of IPv4 mapped address is defined in + * the kernel. There are configurations where we should use + * IPv4 mapped address as native IPv6 address, not as + * "an IPv6 address that embeds IPv4 address" (namely, SIIT). + * + * More complete solution would be to have an additional + * getsockopt to grab "real" peername/sockname. "real" + * peername/sockname will be AF_INET if IPv4 mapped address + * is used to embed IPv4 address, and will be AF_INET6 if + * we use it as native. What a mess! + */ void ai_unmapped(struct addrinfo *ai) { @@ -2130,10 +2122,18 @@ ai_unmapped(struct addrinfo *ai) sin.sin_port = sin6->sin6_port; ai->ai_family = AF_INET; -#if HAVE_SOCKADDR_SA_LEN +#if defined(HAVE_STRUCT_SOCKADDR_SA_LEN) sin.sin_len = len; #endif memcpy(ai->ai_addr, &sin, len); ai->ai_addrlen = len; #endif } + +#ifdef NO_USAGE +void +xusage(void) +{ + fputs("Usage error\n", ttyout); +} +#endif diff --git a/net/tnftp/files/src/ftp.cat1 b/net/tnftp/files/src/ftp.cat1 index ae1d6fb32df..4ce9af518a0 100644 --- a/net/tnftp/files/src/ftp.cat1 +++ b/net/tnftp/files/src/ftp.cat1 @@ -5,7 +5,7 @@ NNAAMMEE SSYYNNOOPPSSIISS ffttpp [--4466AAaaddeeffggiinnppRRttvvVV] [--NN _n_e_t_r_c] [--oo _o_u_t_p_u_t] [--PP _p_o_r_t] [--qq _q_u_i_t_t_i_m_e] - [--rr _r_e_t_r_y] [--TT _d_i_r,_m_a_x[,_i_n_c]] [[_u_s_e_r@]_h_o_s_t [_p_o_r_t]] + [--ss _s_r_c_a_d_d_r] [--rr _r_e_t_r_y] [--TT _d_i_r,_m_a_x[,_i_n_c]] [[_u_s_e_r@]_h_o_s_t [_p_o_r_t]] [[_u_s_e_r@]_h_o_s_t:[_p_a_t_h][/]] [file:///_p_a_t_h] [ftp://[_u_s_e_r[:_p_a_s_s_w_o_r_d]@]_h_o_s_t[:_p_o_r_t]/_p_a_t_h[/][;type=_X]] [http://[_u_s_e_r[:_p_a_s_s_w_o_r_d]@]_h_o_s_t[:_p_o_r_t]/_p_a_t_h] [_._._.] @@ -23,88 +23,92 @@ DDEESSCCRRIIPPTTIIOONN Options may be specified at the command line, or to the command inter- preter. - --44 Forces ffttpp to only use IPv4 addresses. + --44 Forces ffttpp to only use IPv4 addresses. - --66 Forces ffttpp to only use IPv6 addresses. + --66 Forces ffttpp to only use IPv6 addresses. - --AA Force active mode ftp. By default, ffttpp will try to use passive - mode ftp and fall back to active mode if passive is not sup- - ported by the server. This option causes ffttpp to always use an - active connection. It is only useful for connecting to very old - servers that do not implement passive mode properly. + --AA Force active mode ftp. By default, ffttpp will try to use pas- + sive mode ftp and fall back to active mode if passive is not + supported by the server. This option causes ffttpp to always + use an active connection. It is only useful for connecting + to very old servers that do not implement passive mode prop- + erly. - --aa Causes ffttpp to bypass normal login procedure, and use an anony- - mous login instead. + --aa Causes ffttpp to bypass normal login procedure, and use an + anonymous login instead. - --dd Enables debugging. + --dd Enables debugging. - --ee Disables command line editing. This is useful for Emacs ange- - ftp mode. + --ee Disables command line editing. This is useful for Emacs + ange-ftp mode. - --ff Forces a cache reload for transfers that go through the FTP or - HTTP proxies. + --ff Forces a cache reload for transfers that go through the FTP + or HTTP proxies. - --gg Disables file name globbing. + --gg Disables file name globbing. - --ii Turns off interactive prompting during multiple file transfers. + --ii Turns off interactive prompting during multiple file trans- + fers. - --nn Restrains ffttpp from attempting ``auto-login'' upon initial con- - nection for non auto-fetch transfers. If auto-login is enabled, - ffttpp will check the _._n_e_t_r_c (see below) file in the user's home - directory for an entry describing an account on the remote - machine. If no entry exists, ffttpp will prompt for the remote - machine login name (default is the user identity on the local - machine), and, if necessary, prompt for a password and an - account with which to login. To override the auto-login for - auto-fetch transfers, specify the username (and optionally, - password) as appropriate. + --nn Restrains ffttpp from attempting ``auto-login'' upon initial + connection for non auto-fetch transfers. If auto-login is + enabled, ffttpp will check the _._n_e_t_r_c (see below) file in the + user's home directory for an entry describing an account on + the remote machine. If no entry exists, ffttpp will prompt for + the remote machine login name (default is the user identity + on the local machine), and, if necessary, prompt for a pass- + word and an account with which to login. To override the + auto-login for auto-fetch transfers, specify the username + (and optionally, password) as appropriate. - --NN _n_e_t_r_c - Use _n_e_t_r_c instead of _~_/_._n_e_t_r_c. Refer to _T_H_E _._n_e_t_r_c _F_I_L_E for - more information. + --NN _n_e_t_r_c Use _n_e_t_r_c instead of _~_/_._n_e_t_r_c. Refer to _T_H_E _._n_e_t_r_c _F_I_L_E for + more information. - --oo _o_u_t_p_u_t - When auto-fetching files, save the contents in _o_u_t_p_u_t. _o_u_t_p_u_t - is parsed according to the _F_I_L_E _N_A_M_I_N_G _C_O_N_V_E_N_T_I_O_N_S below. If - _o_u_t_p_u_t is not `-' or doesn't start with `|', then only the first - file specified will be retrieved into _o_u_t_p_u_t; all other files - will be retrieved into the basename of their remote name. + --oo _o_u_t_p_u_t When auto-fetching files, save the contents in _o_u_t_p_u_t. + _o_u_t_p_u_t is parsed according to the _F_I_L_E _N_A_M_I_N_G _C_O_N_V_E_N_T_I_O_N_S + below. If _o_u_t_p_u_t is not `-' or doesn't start with `|', then + only the first file specified will be retrieved into _o_u_t_p_u_t; + all other files will be retrieved into the basename of their + remote name. - --pp Enable passive mode operation for use behind connection filter- - ing firewalls. This option has been deprecated as ffttpp now tries - to use passive mode by default, falling back to active mode if - the server does not support passive connections. + --pp Enable passive mode operation for use behind connection fil- + tering firewalls. This option has been deprecated as ffttpp now + tries to use passive mode by default, falling back to active + mode if the server does not support passive connections. - --PP _p_o_r_t Sets the port number to _p_o_r_t. - - --rr _w_a_i_t Retry the connection attempt if it failed, pausing for _w_a_i_t sec- - onds. + --PP _p_o_r_t Sets the port number to _p_o_r_t. --qq _q_u_i_t_t_i_m_e - Quit if the connection has stalled for _q_u_i_t_t_i_m_e seconds. + Quit if the connection has stalled for _q_u_i_t_t_i_m_e seconds. + + --rr _w_a_i_t Retry the connection attempt if it failed, pausing for _w_a_i_t + seconds. - --RR Restart all non-proxied auto-fetches. + --RR Restart all non-proxied auto-fetches. - --tt Enables packet tracing. + --ss _s_r_c_a_d_d_r Uses _s_r_c_a_d_d_r as the local IP address for all connections. + + --tt Enables packet tracing. --TT _d_i_r_e_c_t_i_o_n,_m_a_x_i_m_u_m[,_i_n_c_r_e_m_e_n_t] - Set the maximum transfer rate for _d_i_r_e_c_t_i_o_n to _m_a_x_i_m_u_m - bytes/second, and if specified, the increment to _i_n_c_r_e_m_e_n_t - bytes/second. Refer to rraattee for more information. + Set the maximum transfer rate for _d_i_r_e_c_t_i_o_n to _m_a_x_i_m_u_m + bytes/second, and if specified, the increment to _i_n_c_r_e_m_e_n_t + bytes/second. Refer to rraattee for more information. --uu _U_R_L _f_i_l_e [...] - Upload files on the command line to _U_R_L where _U_R_L is one of the - ftp URL types as supported by auto-fetch (with an optional tar- - get filename for single file uploads), and _f_i_l_e is one or more - local files to be uploaded. + Upload files on the command line to _U_R_L where _U_R_L is one of + the ftp URL types as supported by auto-fetch (with an + optional target filename for single file uploads), and _f_i_l_e + is one or more local files to be uploaded. - --vv Enable vveerrbboossee and pprrooggrreessss. This is the default if output is - to a terminal (and in the case of pprrooggrreessss, ffttpp is the fore- - ground process). Forces ffttpp to show all responses from the - remote server, as well as report on data transfer statistics. + --vv Enable vveerrbboossee and pprrooggrreessss. This is the default if output + is to a terminal (and in the case of pprrooggrreessss, ffttpp is the + foreground process). Forces ffttpp to show all responses from + the remote server, as well as report on data transfer statis- + tics. - --VV Disable vveerrbboossee and pprrooggrreessss, overriding the default of enabled - when output is to a terminal. + --VV Disable vveerrbboossee and pprrooggrreessss, overriding the default of + enabled when output is to a terminal. The client host with which ffttpp is to communicate may be specified on the command line. If this is done, ffttpp will immediately attempt to establish @@ -177,11 +181,11 @@ DDEESSCCRRIIPPTTIIOONN may be distinguished from a record delimiter only when ccrr is off. - ddeebbuugg [_d_e_b_u_g_-_v_a_l_u_e] - Toggle debugging mode. If an optional _d_e_b_u_g_-_v_a_l_u_e is speci- - fied it is used to set the debugging level. When debugging - is on, ffttpp prints each command sent to the remote machine, - preceded by the string `-->' + ffttpp__ddeebbuugg [_f_t_p___d_e_b_u_g_-_v_a_l_u_e] + Toggle debugging mode. If an optional _f_t_p___d_e_b_u_g_-_v_a_l_u_e is + specified it is used to set the debugging level. When debug- + ging is on, ffttpp prints each command sent to the remote + machine, preceded by the string `-->' ddeelleettee _r_e_m_o_t_e_-_f_i_l_e Delete the file _r_e_m_o_t_e_-_f_i_l_e on the remote machine. @@ -260,7 +264,7 @@ DDEESSCCRRIIPPTTIIOONN tree (in binary mode). hhaasshh [_s_i_z_e] - Toggle hash-sign (``#'') printing for each data block trans- + Toggle hash-sign (`#') printing for each data block trans- ferred. The size of a data block defaults to 1024 bytes. This can be changed by specifying _s_i_z_e in bytes. Enabling hhaasshh disables pprrooggrreessss. @@ -297,18 +301,23 @@ DDEESSCCRRIIPPTTIIOONN _m_a_c_r_o_-_n_a_m_e; a null line (consecutive newline characters in a file or carriage returns from the terminal) terminates macro input mode. There is a limit of 16 macros and 4096 total - characters in all defined macros. Macros remain defined - until a cclloossee command is executed. The macro processor - interprets `$' and `\' as special characters. A `$' followed - by a number (or numbers) is replaced by the corresponding - argument on the macro invocation command line. A `$' fol- - lowed by an `i' signals that macro processor that the execut- - ing macro is to be looped. On the first pass `$i' is - replaced by the first argument on the macro invocation com- - mand line, on the second pass it is replaced by the second - argument, and so on. A `\' followed by any character is - replaced by that character. Use the `\' to prevent special - treatment of the `$'. + characters in all defined macros. Macro names can be a maxi- + mum of 8 characters. Macros are only applicable to the cur- + rent session they are defined within (or if defined outside a + session, to the session invoked with the next ooppeenn command), + and remain defined until a cclloossee command is executed. To + invoke a macro, use the $$ command (see above). + + The macro processor interprets `$' and `\' as special charac- + ters. A `$' followed by a number (or numbers) is replaced by + the corresponding argument on the macro invocation command + line. A `$' followed by an `i' signals the macro processor + that the executing macro is to be looped. On the first pass + ``$i'' is replaced by the first argument on the macro invoca- + tion command line, on the second pass it is replaced by the + second argument, and so on. A `\' followed by any character + is replaced by that character. Use the `\' to prevent spe- + cial treatment of the `$'. mmddeelleettee [_r_e_m_o_t_e_-_f_i_l_e_s] Delete the _r_e_m_o_t_e_-_f_i_l_e_s on the remote machine. @@ -356,7 +365,7 @@ DDEESSCCRRIIPPTTIIOONN mmooddttiimmee _r_e_m_o_t_e_-_f_i_l_e Show the last modification time of the file on the remote - machine. + machine, in RFC2822 format. mmoorree _f_i_l_e A synonym for ppaaggee. @@ -396,19 +405,19 @@ DDEESSCCRRIIPPTTIIOONN [_I_n_p_a_t_t_e_r_n] is a template for incoming filenames (which may have already been processed according to the nnttrraannss and ccaassee settings). Variable templating is accomplished by including - the sequences `$1', `$2', ..., `$9' in _i_n_p_a_t_t_e_r_n. Use `\' to - prevent this special treatment of the `$' character. All - other characters are treated literally, and are used to + the sequences ``$1'', ``$2'', ... ``$9'' in _i_n_p_a_t_t_e_r_n. Use + `\' to prevent this special treatment of the `$' character. + All other characters are treated literally, and are used to determine the nnmmaapp [_i_n_p_a_t_t_e_r_n] variable values. For example, given _i_n_p_a_t_t_e_r_n $1.$2 and the remote file name "mydata.data", $1 would have the value "mydata", and $2 would have the value "data". The _o_u_t_p_a_t_t_e_r_n determines the resulting mapped file- - name. The sequences `$1', `$2', ...., `$9' are replaced by - any value resulting from the _i_n_p_a_t_t_e_r_n template. The - sequence `$0' is replace by the original filename. Addition- - ally, the sequence `[_s_e_q_1, _s_e_q_2]' is replaced by [_s_e_q_1] if - _s_e_q_1 is not a null string; otherwise it is replaced by _s_e_q_2. - For example, the command + name. The sequences ``$1'', ``$2'', ... ``$9'' are replaced + by any value resulting from the _i_n_p_a_t_t_e_r_n template. The + sequence ``$0'' is replaced by the original filename. Addi- + tionally, the sequence ``[_s_e_q_1, _s_e_q_2]'' is replaced by [_s_e_q_1] + if _s_e_q_1 is not a null string; otherwise it is replaced by + _s_e_q_2. For example, the command nmap $1.$2.$3 [$1,$2].[$2,file] @@ -416,9 +425,10 @@ DDEESSCCRRIIPPTTIIOONN names "myfile.data" and "myfile.data.old", "myfile.file" for the input filename "myfile", and "myfile.myfile" for the input filename ".myfile". Spaces may be included in - _o_u_t_p_a_t_t_e_r_n, as in the example: `nmap $1 sed "s/ *$//" > $1' - . Use the `\' character to prevent special treatment of the - `$','[',']', and `,' characters. + _o_u_t_p_a_t_t_e_r_n, as in the example: + nmap $1 sed s/ *$// > $1 + Use the `\' character to prevent special treatment of the + `$', `[', `]', and `,' characters. nnttrraannss [_i_n_c_h_a_r_s [_o_u_t_c_h_a_r_s]] Set or unset the filename character translation mechanism. @@ -459,7 +469,7 @@ DDEESSCCRRIIPPTTIIOONN who connects back to it. Passive mode is useful when using ffttpp through a gateway router or host that controls the direc- tionality of traffic. (Note that though FTP servers are - required to support the PASV command by RFC 1123, some do + required to support the PASV command by RFC1123, some do not.) ppddiirr [_r_e_m_o_t_e_-_p_a_t_h] @@ -770,8 +780,8 @@ AAUUTTOO--FFEETTCCHHIINNGG FFIILLEESS fer type will take place as ascii or binary (respectively). The default transfer type is binary. - In order to be compliant with RFC 1738, ffttpp interprets the _p_a_t_h - part of an ``ftp://'' auto-fetch URL as follows: + In order to be compliant with RFC3986, ffttpp interprets the _p_a_t_h part + of an ``ftp://'' auto-fetch URL as follows: ++oo The `/' immediately after the _h_o_s_t[:_p_o_r_t] is interpreted as a separator before the _p_a_t_h, and not as part of the _p_a_t_h itself. @@ -786,7 +796,7 @@ AAUUTTOO--FFEETTCCHHIINNGG FFIILLEESS the equivalent of a ccdd command without a directory name. This is unlikely to be useful. - ++oo Any `%_X_X' codes (per RFC 1738) within the path components are + ++oo Any `%_X_X' codes (per RFC3986) within the path components are decoded, with _X_X representing a character code in hexadecimal. This decoding takes place after the _p_a_t_h has been split into components, but before each component is used in the equivalent @@ -839,6 +849,15 @@ AAUUTTOO--FFEETTCCHHIINNGG FFIILLEESS file:///_p_a_t_h A local URL, copied from _/_p_a_t_h on the local host. + about:_t_o_p_i_c + Display information regarding _t_o_p_i_c; no file is retrieved for this + auto-fetched element. Supported values include: + + about:ftp Information about ffttpp. + + about:version The version of ffttpp. Useful to provide when report- + ing problems. + Unless noted otherwise above, and --oo _o_u_t_p_u_t is not given, the file is stored in the current directory as the basename(1) of _p_a_t_h. Note that if a HTTP redirect is received, the fetch is retried using the new target @@ -898,7 +917,7 @@ FFIILLEE NNAAMMIINNGG CCOONNVVEENNTTIIOONNSS example of this mechanism is: ``dir "" |more''. 3. Failing the above checks, if ``globbing'' is enabled, local file - names are expanded according to the rules used in the csh(1); c.f. + names are expanded according to the rules used in the csh(1); see the gglloobb command. If the ffttpp command expects a single local file (e.g. ppuutt), only the first filename generated by the "globbing" operation is used. @@ -973,8 +992,13 @@ TTHHEE ..nneettrrcc FFIILLEE mand functions. A macro is defined with the specified name; its contents begin with the next _._n_e_t_r_c line and continue until a blank line (consecutive new-line characters) is encountered. - If a macro named iinniitt is defined, it is automatically executed - as the last step in the auto-login process. For example, + Like the other tokens in the _._n_e_t_r_c file, a mmaaccddeeff is applica- + ble only to the mmaacchhiinnee definition preceding it. A mmaaccddeeff + entry cannot be utilized by multiple mmaacchhiinnee definitions; + rather, it must be defined following each mmaacchhiinnee it is + intended to be used with. If a macro named iinniitt is defined, it + is automatically executed as the last step in the auto-login + process. For example, default macdef init @@ -1074,8 +1098,8 @@ EENNVVIIRROONNMMEENNTT used in the first attempt to authenticate to the proxy. If ``unsafe'' URL characters are required in the username - or password (for example `@' or `/'), encode them with RFC - 1738 `%_X_X' encoding. + or password (for example `@' or `/'), encode them with + RFC3986 `%_X_X' encoding. Note that the use of a username and password in ftp_proxy and http_proxy may be incompatible with other programs @@ -1104,8 +1128,26 @@ SSEEEE AALLSSOO getservbyname(3), editrc(5), services(5), ftpd(8) SSTTAANNDDAARRDDSS - ffttpp attempts to be compliant with RFC 959, RFC 1123, RFC 1738, RFC 2068, - RFC 2389, RFC 2428, RFC 2732, and ddrraafftt--iieettff--ffttppeexxtt--mmllsstt--1111. + ffttpp attempts to be compliant with: + + RFC0959 _F_i_l_e _T_r_a_n_s_f_e_r _P_r_o_t_o_c_o_l + + RFC1123 _R_e_q_u_i_r_e_m_e_n_t_s _f_o_r _I_n_t_e_r_n_e_t _H_o_s_t_s _- _A_p_p_l_i_c_a_t_i_o_n _a_n_d _S_u_p_p_o_r_t + + RFC1635 _H_o_w _t_o _U_s_e _A_n_o_n_y_m_o_u_s _F_T_P + + RFC2389 _F_e_a_t_u_r_e _n_e_g_o_t_i_a_t_i_o_n _m_e_c_h_a_n_i_s_m _f_o_r _t_h_e _F_i_l_e _T_r_a_n_s_f_e_r + _P_r_o_t_o_c_o_l + + RFC2428 _F_T_P _E_x_t_e_n_s_i_o_n_s _f_o_r _I_P_v_6 _a_n_d _N_A_T_s + + RFC2616 _H_y_p_e_r_t_e_x_t _T_r_a_n_s_f_e_r _P_r_o_t_o_c_o_l _-_- _H_T_T_P_/_1_._1 + + RFC2822 _I_n_t_e_r_n_e_t _M_e_s_s_a_g_e _F_o_r_m_a_t + + RFC3659 _E_x_t_e_n_s_i_o_n_s _t_o _F_T_P + + RFC3986 _U_n_i_f_o_r_m _R_e_s_o_u_r_c_e _I_d_e_n_t_i_f_i_e_r _(_U_R_I_) HHIISSTTOORRYY The ffttpp command appeared in 4.2BSD. @@ -1138,4 +1180,4 @@ BBUUGGSS uses a SIIT translator for IPv6-to-IPv4 translation, ffttpp is unable to support your configuration. -NetBSD 3.0_BETA January 15, 2005 NetBSD 3.0_BETA +NetBSD 3.1.1 July 18, 2007 NetBSD 3.1.1 diff --git a/net/tnftp/files/src/ftp_var.h b/net/tnftp/files/src/ftp_var.h index 3fd33788013..9e664b2300c 100644 --- a/net/tnftp/files/src/ftp_var.h +++ b/net/tnftp/files/src/ftp_var.h @@ -1,8 +1,8 @@ -/* NetBSD: ftp_var.h,v 1.5 2005/05/11 02:41:28 lukem Exp */ -/* from NetBSD: ftp_var.h,v 1.71 2005/04/11 01:49:31 lukem Exp */ +/* $NetBSD: ftp_var.h,v 1.5 2007/08/07 02:07:02 lukem Exp $ */ +/* from NetBSD: ftp_var.h,v 1.75 2007/07/22 05:02:50 lukem Exp */ /*- - * Copyright (c) 1996-2005 The NetBSD Foundation, Inc. + * Copyright (c) 1996-2007 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation @@ -108,6 +108,20 @@ #define NO_PROGRESS #endif +#if 0 /* tnftp */ + +#include <sys/param.h> + +#include <netinet/in.h> +#include <arpa/inet.h> + +#include <poll.h> + +#include <setjmp.h> +#include <stringlist.h> + +#endif /* tnftp */ + #ifndef NO_EDITCOMPLETE #include <histedit.h> #endif /* !NO_EDITCOMPLETE */ @@ -201,7 +215,7 @@ GLOBAL int sendport; /* use PORT/LPRT cmd for each data connection */ GLOBAL int connected; /* 1 = connected to server, -1 = logged in */ GLOBAL int interactive; /* interactively prompt on m* cmds */ GLOBAL int confirmrest; /* confirm rest of current m* cmd */ -GLOBAL int debug; /* debugging level */ +GLOBAL int ftp_debug; /* debugging level */ GLOBAL int bell; /* ring bell on cmd completion */ GLOBAL int doglob; /* glob local file names */ GLOBAL int autologin; /* establish user account on connection */ @@ -270,6 +284,7 @@ GLOBAL sa_family_t family; /* address family to use for connections */ GLOBAL char *ftpport; /* port number to use for FTP connections */ GLOBAL char *httpport; /* port number to use for HTTP connections */ GLOBAL char *gateport; /* port number to use for gateftp connections */ +GLOBAL struct addrinfo *bindai; /* local address to bind as */ GLOBAL char *outfile; /* filename to output URLs to */ GLOBAL int restartautofetch; /* restart auto-fetch */ @@ -318,7 +333,7 @@ extern struct option optiontab[]; #define FREEPTR(x) if ((x) != NULL) { free(x); (x) = NULL; } #ifdef BSD4_4 -# define HAVE_SOCKADDR_SA_LEN 1 +# define HAVE_STRUCT_SOCKADDR_SA_LEN 1 #endif #ifdef NO_LONG_LONG @@ -326,3 +341,18 @@ extern struct option optiontab[]; #else # define STRTOLL(x,y,z) strtoll(x,y,z) #endif + +#ifdef NO_DEBUG +#define DPRINTF(...) +#define DWARN(...) +#else +#define DPRINTF(...) if (ftp_debug) (void)fprintf(ttyout, __VA_ARGS__) +#define DWARN(...) if (ftp_debug) warn(__VA_ARGS__) +#endif + +#ifdef NO_USAGE +void xusage(void); +#define UPRINTF(...) xusage() +#else +#define UPRINTF(...) (void)fprintf(ttyout, __VA_ARGS__) +#endif diff --git a/net/tnftp/files/src/main.c b/net/tnftp/files/src/main.c index 67462769552..966b859edf7 100644 --- a/net/tnftp/files/src/main.c +++ b/net/tnftp/files/src/main.c @@ -1,5 +1,5 @@ -/* NetBSD: main.c,v 1.11 2005/06/10 04:05:01 lukem Exp */ -/* from NetBSD: main.c,v 1.97 2005/06/10 00:18:46 lukem Exp */ +/* $NetBSD: main.c,v 1.7 2007/08/07 02:07:02 lukem Exp $ */ +/* from NetBSD: main.c,v 1.105 2007/05/22 05:16:48 lukem Exp */ /*- * Copyright (c) 1996-2005 The NetBSD Foundation, Inc. @@ -95,11 +95,44 @@ * SUCH DAMAGE. */ +#include "tnftp.h" + +#if 0 /* tnftp */ + +#include <sys/cdefs.h> +#ifndef lint +__COPYRIGHT("@(#) Copyright (c) 1985, 1989, 1993, 1994\n\ + The Regents of the University of California. All rights reserved.\n"); +#endif /* not lint */ + +#ifndef lint +#if 0 +static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 10/9/94"; +#else +__RCSID(" NetBSD: main.c,v 1.105 2007/05/22 05:16:48 lukem Exp "); +#endif +#endif /* not lint */ + /* * FTP User Program -- Command Interface. */ - -#include "tnftp.h" +#include <sys/types.h> +#include <sys/socket.h> + +#include <err.h> +#include <errno.h> +#include <netdb.h> +#include <paths.h> +#include <pwd.h> +#include <signal.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <time.h> +#include <unistd.h> +#include <locale.h> + +#endif /* tnftp */ #define GLOBAL /* force GLOBAL decls in ftp_var.h to be declared */ #include "ftp_var.h" @@ -113,18 +146,19 @@ static void setupoption(char *, char *, char *); int main(int, char *[]); int -main(int argc, char *argv[]) +main(int volatile argc, char **volatile argv) { int ch, rval; struct passwd *pw; - char *cp, *ep, *anonuser, *anonpass, *upload_path; + char *cp, *ep, *anonuser, *anonpass, *upload_path, *src_addr; int dumbterm, s, isupload; size_t len; socklen_t slen; -#if 0 /* XXX */ + tzset(); +#if 0 /* tnftp */ /* XXX */ setlocale(LC_ALL, ""); -#endif +#endif /* tnftp */ setprogname(argv[0]); sigint_raised = 0; @@ -166,6 +200,7 @@ main(int argc, char *argv[]) epsv4 = 0; #endif epsv4bad = 0; + src_addr = NULL; upload_path = NULL; isupload = 0; reply_callback = NULL; @@ -184,15 +219,15 @@ main(int argc, char *argv[]) */ s = socket(AF_INET, SOCK_STREAM, 0); if (s == -1) - err(1, "can't create socket"); + err(1, "Can't create socket to determine default socket sizes"); slen = sizeof(rcvbuf_size); if (getsockopt(s, SOL_SOCKET, SO_RCVBUF, (void *)&rcvbuf_size, &slen) == -1) - err(1, "unable to get default rcvbuf size"); + err(1, "Unable to get default rcvbuf size"); slen = sizeof(sndbuf_size); if (getsockopt(s, SOL_SOCKET, SO_SNDBUF, (void *)&sndbuf_size, &slen) == -1) - err(1, "unable to get default sndbuf size"); + err(1, "Unable to get default sndbuf size"); (void)close(s); /* sanity check returned buffer sizes */ if (rcvbuf_size <= 0) @@ -205,7 +240,7 @@ main(int argc, char *argv[]) if (rcvbuf_size > 8 * 1024 * 1024) rcvbuf_size = 8 * 1024 * 1024; - marg_sl = xsl_init(); + marg_sl = ftp_sl_init(); if ((tmpdir = getenv("TMPDIR")) == NULL) tmpdir = _PATH_TMP; @@ -223,7 +258,7 @@ main(int argc, char *argv[]) passivemode = 1; activefallback = 1; } else - warnx("unknown $FTPMODE '%s'; using defaults", cp); + warnx("Unknown $FTPMODE `%s'; using defaults", cp); } if (strcmp(getprogname(), "pftp") == 0) { @@ -264,7 +299,7 @@ main(int argc, char *argv[]) } } - while ((ch = getopt(argc, argv, "46AadefginN:o:pP:q:r:RtT:u:vV")) != -1) { + while ((ch = getopt(argc, argv, "46AadefginN:o:pP:q:r:Rs:tT:u:vV")) != -1) { switch (ch) { case '4': family = AF_INET; @@ -289,7 +324,7 @@ main(int argc, char *argv[]) case 'd': options |= SO_DEBUG; - debug++; + ftp_debug++; break; case 'e': @@ -339,19 +374,23 @@ main(int argc, char *argv[]) case 'q': quit_time = strtol(optarg, &ep, 10); if (quit_time < 1 || *ep != '\0') - errx(1, "bad quit value: %s", optarg); + errx(1, "Bad quit value: %s", optarg); break; case 'r': retry_connect = strtol(optarg, &ep, 10); if (retry_connect < 1 || *ep != '\0') - errx(1, "bad retry value: %s", optarg); + errx(1, "Bad retry value: %s", optarg); break; case 'R': restartautofetch = 1; break; + case 's': + src_addr = optarg; + break; + case 't': trace = 1; break; @@ -364,11 +403,12 @@ main(int argc, char *argv[]) /* look for `dir,max[,incr]' */ targc = 0; targv[targc++] = "-T"; - oac = xstrdup(optarg); + oac = ftp_strdup(optarg); while ((cp = strsep(&oac, ",")) != NULL) { if (*cp == '\0') { - warnx("bad throttle value: %s", optarg); + warnx("Bad throttle value `%s'", + optarg); usage(); /* NOTREACHED */ } @@ -386,7 +426,7 @@ main(int argc, char *argv[]) { isupload = 1; interactive = 0; - upload_path = xstrdup(optarg); + upload_path = ftp_strdup(optarg); break; } @@ -413,6 +453,22 @@ main(int argc, char *argv[]) crflag = 1; /* strip c.r. on ascii gets */ sendport = -1; /* not using ports */ + if (src_addr != NULL) { + struct addrinfo hints; + int error; + + memset(&hints, 0, sizeof(hints)); + hints.ai_family = family; + hints.ai_socktype = SOCK_STREAM; + hints.ai_flags = AI_PASSIVE; + error = getaddrinfo(src_addr, NULL, &hints, &bindai); + if (error) { + errx(1, "Can't lookup `%s': %s", src_addr, + (error == EAI_SYSTEM) ? strerror(errno) + : gai_strerror(error)); + } + } + /* * Cache the user name and home directory. */ @@ -421,7 +477,7 @@ main(int argc, char *argv[]) anonuser = "anonymous"; cp = getenv("HOME"); if (! EMPTYSTRING(cp)) - localhome = xstrdup(cp); + localhome = ftp_strdup(cp); pw = NULL; cp = getlogin(); if (cp != NULL) @@ -430,8 +486,8 @@ main(int argc, char *argv[]) pw = getpwuid(getuid()); if (pw != NULL) { if (localhome == NULL && !EMPTYSTRING(pw->pw_dir)) - localhome = xstrdup(pw->pw_dir); - localname = xstrdup(pw->pw_name); + localhome = ftp_strdup(pw->pw_dir); + localname = ftp_strdup(pw->pw_name); anonuser = localname; } if (netrc[0] == '\0' && localhome != NULL) { @@ -443,7 +499,7 @@ main(int argc, char *argv[]) } } if (localhome == NULL) - localhome = xstrdup("/"); + localhome = ftp_strdup("/"); /* * Every anonymous FTP server I've encountered will accept the @@ -453,7 +509,7 @@ main(int argc, char *argv[]) * - thorpej@NetBSD.org */ len = strlen(anonuser) + 2; - anonpass = xmalloc(len); + anonpass = ftp_malloc(len); (void)strlcpy(anonpass, anonuser, len); (void)strlcat(anonpass, "@", len); @@ -480,11 +536,6 @@ main(int argc, char *argv[]) (void)xsignal(SIGUSR2, crankrate); (void)xsignal(SIGWINCH, setttywidth); -#ifdef __GNUC__ /* to shut up gcc warnings */ - (void)&argc; - (void)&argv; -#endif - if (argc > 0) { if (isupload) { rval = auto_put(argc, argv, upload_path); @@ -572,7 +623,7 @@ prompt(void) o = getoption("prompt"); if (o == NULL) - errx(1, "no such option `prompt'"); + errx(1, "prompt: no such option `prompt'"); prompt = &(o->value); } formatbuf(buf, sizeof(buf), *prompt ? *prompt : DEFAULTPROMPT); @@ -593,7 +644,7 @@ rprompt(void) o = getoption("rprompt"); if (o == NULL) - errx(1, "no such option `rprompt'"); + errx(1, "rprompt: no such option `rprompt'"); rprompt = &(o->value); } formatbuf(buf, sizeof(buf), *rprompt ? *rprompt : DEFAULTRPROMPT); @@ -608,7 +659,9 @@ cmdscanner(void) { struct cmd *c; char *p; +#ifndef NO_EDITCOMPLETE int ch; +#endif size_t num; for (;;) { @@ -620,8 +673,8 @@ cmdscanner(void) p = rprompt(); if (*p) fprintf(ttyout, "%s ", p); - (void)fflush(ttyout); } + (void)fflush(ttyout); num = getline(stdin, line, sizeof(line), NULL); switch (num) { case -1: /* EOF */ @@ -754,7 +807,7 @@ makeargv(void) marg_sl->sl_cur = 0; /* reset to start of marg_sl */ for (margc = 0; ; margc++) { argp = slurpstring(); - xsl_add(marg_sl, argp); + ftp_sl_add(marg_sl, argp); if (argp == NULL) break; } @@ -928,19 +981,19 @@ help(int argc, char *argv[]) cmd = argv[0]; isusage = (strcmp(cmd, "usage") == 0); if (argc == 0 || (isusage && argc == 1)) { - fprintf(ttyout, "usage: %s [command [...]]\n", cmd); + UPRINTF("usage: %s [command [...]]\n", cmd); return; } if (argc == 1) { StringList *buf; - buf = xsl_init(); + buf = ftp_sl_init(); fprintf(ttyout, "%sommands may be abbreviated. Commands are:\n\n", proxy ? "Proxy c" : "C"); for (c = cmdtab; (p = c->c_name) != NULL; c++) if (!proxy || c->c_proxy) - xsl_add(buf, p); + ftp_sl_add(buf, p); list_vertical(buf); sl_free(buf, 0); return; @@ -991,11 +1044,11 @@ getoptionvalue(const char *name) struct option *c; if (name == NULL) - errx(1, "getoptionvalue() invoked with NULL name"); + errx(1, "getoptionvalue: invoked with NULL name"); c = getoption(name); if (c != NULL) return (c->value); - errx(1, "getoptionvalue() invoked with unknown option `%s'", name); + errx(1, "getoptionvalue: invoked with unknown option `%s'", name); /* NOTREACHED */ } @@ -1021,8 +1074,9 @@ usage(void) (void)fprintf(stderr, "usage: %s [-46AadefginpRtvV] [-N netrc] [-o outfile] [-P port] [-q quittime]\n" -" [-r retry] [-T dir,max[,inc][[user@]host [port]]] [host:path[/]]\n" -" [file:///file] [ftp://[user[:pass]@]host[:port]/path[/]]\n" +" [-r retry] [-s srcaddr] [-T dir,max[,inc]]\n" +" [[user@]host [port]] [host:path[/]] [file:///file]\n" +" [ftp://[user[:pass]@]host[:port]/path[/]]\n" " [http://[user[:pass]@]host[:port]/path] [...]\n" " %s -u URL file [...]\n", progname, progname); exit(1); diff --git a/net/tnftp/files/src/progressbar.c b/net/tnftp/files/src/progressbar.c index 374efea4c5d..467c2b6ca9d 100644 --- a/net/tnftp/files/src/progressbar.c +++ b/net/tnftp/files/src/progressbar.c @@ -1,9 +1,8 @@ -/* pkgsrc $NetBSD: progressbar.c,v 1.5 2005/06/10 05:06:26 lukem Exp $ */ -/* NetBSD: progressbar.c,v 1.9 2005/06/10 04:05:01 lukem Exp */ -/* from NetBSD: progressbar.c,v 1.10 2005/06/09 16:38:29 lukem Exp */ +/* $NetBSD: progressbar.c,v 1.6 2007/08/07 02:07:02 lukem Exp $ */ +/* from NetBSD: progressbar.c,v 1.17 2007/05/05 18:09:24 martin Exp */ /*- - * Copyright (c) 1997-2005 The NetBSD Foundation, Inc. + * Copyright (c) 1997-2007 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation @@ -38,11 +37,32 @@ * POSSIBILITY OF SUCH DAMAGE. */ +#include "tnftp.h" + +#if 0 /* tnftp */ + +#include <sys/cdefs.h> +#ifndef lint +__RCSID(" NetBSD: progressbar.c,v 1.17 2007/05/05 18:09:24 martin Exp "); +#endif /* not lint */ + /* * FTP User Program -- Misc support routines */ +#include <sys/types.h> +#include <sys/param.h> -#include "tnftp.h" +#include <err.h> +#include <errno.h> +#include <signal.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <time.h> +#include <tzfile.h> +#include <unistd.h> + +#endif /* tnftp */ #include "progressbar.h" @@ -82,10 +102,23 @@ updateprogressmeter(int dummy) } /* - * List of order of magnitude prefixes. - * The last is `P', as 2^64 = 16384 Petabytes + * List of order of magnitude suffixes, per IEC 60027-2. */ -static const char prefixes[] = " KMGTP"; +static const char * const suffixes[] = { + "", /* 2^0 (byte) */ + "KiB", /* 2^10 Kibibyte */ + "MiB", /* 2^20 Mebibyte */ + "GiB", /* 2^30 Gibibyte */ + "TiB", /* 2^40 Tebibyte */ + "PiB", /* 2^50 Pebibyte */ + "EiB", /* 2^60 Exbibyte */ +#if 0 + /* The following are not necessary for signed 64-bit off_t */ + "ZiB", /* 2^70 Zebibyte */ + "YiB", /* 2^80 Yobibyte */ +#endif +}; +#define NSUFFIXES (sizeof(suffixes) / sizeof(suffixes[0])) /* * Display a transfer progress bar if progress is non-zero. @@ -112,8 +145,7 @@ progressmeter(int flag) struct timeval td; off_t abbrevsize, bytespersec; double elapsed; - int ratio, i, remaining; - size_t barlength; + int ratio, i, remaining, barlength; /* * Work variables for progress bar. @@ -127,7 +159,7 @@ progressmeter(int flag) size_t len; char buf[256]; /* workspace for progress bar */ #ifndef NO_PROGRESS -#define BAROVERHEAD 43 /* non `*' portion of progress bar */ +#define BAROVERHEAD 45 /* non `*' portion of progress bar */ /* * stars should contain at least * sizeof(buf) - BAROVERHEAD entries @@ -207,7 +239,7 @@ progressmeter(int flag) */ barlength = MIN(sizeof(buf) - 1, ttywidth) - BAROVERHEAD; if (prefix) - barlength -= strlen(prefix); + barlength -= (int)strlen(prefix); if (barlength > 0) { i = barlength * ratio / 100; len += snprintf(buf + len, BUFLEFT, @@ -216,12 +248,13 @@ progressmeter(int flag) } abbrevsize = cursize; - for (i = 0; abbrevsize >= 100000 && i < sizeof(prefixes); i++) + for (i = 0; abbrevsize >= 100000 && i < NSUFFIXES; i++) abbrevsize >>= 10; - len += snprintf(buf + len, BUFLEFT, " " LLFP("5") " %c%c ", + if (i == NSUFFIXES) + i--; + len += snprintf(buf + len, BUFLEFT, " " LLFP("5") " %-3s ", (LLT)abbrevsize, - prefixes[i], - i == 0 ? ' ' : 'B'); + suffixes[i]); timersub(&now, &start, &td); elapsed = td.tv_sec + (td.tv_usec / 1000000.0); @@ -232,13 +265,13 @@ progressmeter(int flag) if (elapsed > 0.0) bytespersec /= elapsed; } - for (i = 1; bytespersec >= 1024000 && i < sizeof(prefixes); i++) + for (i = 1; bytespersec >= 1024000 && i < NSUFFIXES; i++) bytespersec >>= 10; len += snprintf(buf + len, BUFLEFT, - " " LLFP("3") ".%02d %cB/s ", + " " LLFP("3") ".%02d %.2sB/s ", (LLT)(bytespersec / 1024), (int)((bytespersec % 1024) * 100 / 1024), - prefixes[i]); + suffixes[i]); if (filesize > 0) { if (bytes <= 0 || elapsed <= 0.0 || cursize > filesize) { @@ -324,12 +357,14 @@ ptransfer(int siginfo) len += snprintf(buf + len, BUFLEFT, "%02d:%02d ", remaining / 60, remaining % 60); - for (i = 1; bytespersec >= 1024000 && i < sizeof(prefixes); i++) + for (i = 1; bytespersec >= 1024000 && i < NSUFFIXES; i++) bytespersec >>= 10; - len += snprintf(buf + len, BUFLEFT, "(" LLF ".%02d %cB/s)", + if (i == NSUFFIXES) + i--; + len += snprintf(buf + len, BUFLEFT, "(" LLF ".%02d %.2sB/s)", (LLT)(bytespersec / 1024), (int)((bytespersec % 1024) * 100 / 1024), - prefixes[i]); + suffixes[i]); if (siginfo && bytes > 0 && elapsed > 0.0 && filesize >= 0 && bytes + restart_point <= filesize) { @@ -458,7 +493,7 @@ xsignal(int sig, sigfunc func) * This is unpleasant, but I don't know what would be better. * Right now, this "can't happen" */ - errx(1, "xsignal_restart called with signal %d", sig); + errx(1, "xsignal_restart: called with signal %d", sig); } return(xsignal_restart(sig, func, restartable)); diff --git a/net/tnftp/files/src/progressbar.h b/net/tnftp/files/src/progressbar.h index a3f80d179e9..0f096be12a9 100644 --- a/net/tnftp/files/src/progressbar.h +++ b/net/tnftp/files/src/progressbar.h @@ -1,4 +1,4 @@ -/* NetBSD: progressbar.h,v 1.5 2005/05/11 02:41:28 lukem Exp */ +/* $NetBSD: progressbar.h,v 1.4 2007/08/07 02:07:02 lukem Exp $ */ /* from NetBSD: progressbar.h,v 1.5 2005/02/10 16:00:38 jmc Exp */ /*- @@ -91,19 +91,19 @@ void ptransfer(int); # define ULLFP(x) "%" x "lu" # define ULLT unsigned long #else -#if HAVE_PRINTF_QD +#if defined(HAVE_PRINTF_QD) # define LLF "%qd" # define LLFP(x) "%" x "qd" # define LLT long long # define ULLF "%qu" # define ULLFP(x) "%" x "qu" # define ULLT unsigned long long -#else +#else /* !defined(HAVE_PRINTF_QD) */ # define LLF "%lld" # define LLFP(x) "%" x "lld" # define LLT long long # define ULLF "%llu" # define ULLFP(x) "%" x "llu" # define ULLT unsigned long long -#endif +#endif /* !defined(HAVE_PRINTF_QD) */ #endif diff --git a/net/tnftp/files/src/ruserpass.c b/net/tnftp/files/src/ruserpass.c index 491eb9565f9..f220b46f943 100644 --- a/net/tnftp/files/src/ruserpass.c +++ b/net/tnftp/files/src/ruserpass.c @@ -1,5 +1,5 @@ -/* NetBSD: ruserpass.c,v 1.6 2005/06/10 04:05:01 lukem Exp */ -/* from NetBSD: ruserpass.c,v 1.30 2005/06/10 00:18:47 lukem Exp */ +/* $NetBSD: ruserpass.c,v 1.5 2007/08/07 02:07:02 lukem Exp $ */ +/* from NetBSD: ruserpass.c,v 1.33 2007/04/17 05:52:04 lukem Exp */ /* * Copyright (c) 1985, 1993, 1994 @@ -32,6 +32,31 @@ #include "tnftp.h" +#if 0 /* tnftp */ + +#include <sys/cdefs.h> +#ifndef lint +#if 0 +static char sccsid[] = "@(#)ruserpass.c 8.4 (Berkeley) 4/27/95"; +#else +__RCSID(" NetBSD: ruserpass.c,v 1.33 2007/04/17 05:52:04 lukem Exp "); +#endif +#endif /* not lint */ + +#include <sys/types.h> +#include <sys/stat.h> + +#include <ctype.h> +#include <err.h> +#include <errno.h> +#include <netdb.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> + +#endif /* tnftp */ + #include "ftp_var.h" static int token(void); @@ -75,7 +100,7 @@ ruserpass(const char *host, char **aname, char **apass, char **aacct) cfile = fopen(netrc, "r"); if (cfile == NULL) { if (errno != ENOENT) - warn("%s", netrc); + warn("Can't read `%s'", netrc); return (0); } if (gethostname(myname, sizeof(myname)) < 0) @@ -84,7 +109,7 @@ ruserpass(const char *host, char **aname, char **apass, char **aacct) if ((mydomain = strchr(myname, '.')) == NULL) mydomain = ""; next: - while ((t = token())) switch(t) { + while ((t = token()) > 0) switch(t) { case DEFAULT: usedefault = 1; @@ -92,7 +117,9 @@ ruserpass(const char *host, char **aname, char **apass, char **aacct) case MACH: if (!usedefault) { - if (token() != ID) + if ((t = token()) == -1) + goto bad; + if (t != ID) continue; /* * Allow match either for user's input host name @@ -116,12 +143,15 @@ ruserpass(const char *host, char **aname, char **apass, char **aacct) continue; } match: - while ((t = token()) && t != MACH && t != DEFAULT) switch(t) { + while ((t = token()) > 0 && + t != MACH && t != DEFAULT) switch(t) { case LOGIN: - if (token()) { + if ((t = token()) == -1) + goto bad; + if (t) { if (*aname == NULL) - *aname = xstrdup(tokval); + *aname = ftp_strdup(tokval); else { if (strcmp(*aname, tokval)) goto next; @@ -132,22 +162,26 @@ ruserpass(const char *host, char **aname, char **apass, char **aacct) if ((*aname == NULL || strcmp(*aname, "anonymous")) && fstat(fileno(cfile), &stb) >= 0 && (stb.st_mode & 077) != 0) { - warnx("Error: .netrc file is readable by others."); - warnx("Remove password or make file unreadable by others."); + warnx("Error: .netrc file is readable by others"); + warnx("Remove password or make file unreadable by others"); goto bad; } - if (token() && *apass == NULL) - *apass = xstrdup(tokval); + if ((t = token()) == -1) + goto bad; + if (t && *apass == NULL) + *apass = ftp_strdup(tokval); break; case ACCOUNT: if (fstat(fileno(cfile), &stb) >= 0 && (stb.st_mode & 077) != 0) { - warnx("Error: .netrc file is readable by others."); - warnx("Remove account or make file unreadable by others."); + warnx("Error: .netrc file is readable by others"); + warnx("Remove account or make file unreadable by others"); goto bad; } - if (token() && *aacct == NULL) - *aacct = xstrdup(tokval); + if ((t = token()) == -1) + goto bad; + if (t && *aacct == NULL) + *aacct = ftp_strdup(tokval); break; case MACDEF: if (proxy) { @@ -207,9 +241,13 @@ ruserpass(const char *host, char **aname, char **apass, char **aacct) } *tmp = c; if (*tmp == '\n') { - if (*(tmp-1) == '\0') { - macros[macnum++].mac_end = tmp - 1; - break; + if (tmp == macros[macnum].mac_start) { + macros[macnum++].mac_end = tmp; + break; + } else if (*(tmp - 1) == '\0') { + macros[macnum++].mac_end = + tmp - 1; + break; } *tmp = '\0'; } @@ -222,12 +260,14 @@ ruserpass(const char *host, char **aname, char **apass, char **aacct) } break; default: - warnx("Unknown .netrc keyword %s", tokval); + warnx("Unknown .netrc keyword `%s'", tokval); break; } goto done; } done: + if (t == -1) + goto bad; (void)fclose(cfile); return (0); bad: @@ -253,16 +293,26 @@ token(void) if (c == '"') { while ((c = getc(cfile)) != EOF && c != '"') { if (c == '\\') - c = getc(cfile); + if ((c = getc(cfile)) == EOF) + break; *cp++ = c; + if (cp == tokval + sizeof(tokval)) { + warnx("Token in .netrc too long"); + return (-1); + } } } else { *cp++ = c; while ((c = getc(cfile)) != EOF && c != '\n' && c != '\t' && c != ' ' && c != ',') { if (c == '\\') - c = getc(cfile); + if ((c = getc(cfile)) == EOF) + break; *cp++ = c; + if (cp == tokval + sizeof(tokval)) { + warnx("Token in .netrc too long"); + return (-1); + } } } *cp = 0; diff --git a/net/tnftp/files/src/util.c b/net/tnftp/files/src/util.c index 6862fd4f316..e311066fc2c 100644 --- a/net/tnftp/files/src/util.c +++ b/net/tnftp/files/src/util.c @@ -1,8 +1,8 @@ -/* NetBSD: util.c,v 1.14 2005/06/10 04:05:01 lukem Exp */ -/* from NetBSD: util.c,v 1.129 2005/06/10 00:18:47 lukem Exp */ +/* $NetBSD: util.c,v 1.7 2007/08/07 02:07:03 lukem Exp $ */ +/* from NetBSD: util.c,v 1.143 2007/05/24 05:05:19 lukem Exp */ /*- - * Copyright (c) 1997-2005 The NetBSD Foundation, Inc. + * Copyright (c) 1997-2007 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation @@ -70,11 +70,43 @@ * SUCH DAMAGE. */ +#include "tnftp.h" + +#if 0 /* tnftp */ + +#include <sys/cdefs.h> +#ifndef lint +__RCSID(" NetBSD: util.c,v 1.143 2007/05/24 05:05:19 lukem Exp "); +#endif /* not lint */ + /* * FTP User Program -- Misc support routines */ - -#include "tnftp.h" +#include <sys/param.h> +#include <sys/socket.h> +#include <sys/ioctl.h> +#include <sys/time.h> +#include <netinet/in.h> +#include <arpa/ftp.h> + +#include <ctype.h> +#include <err.h> +#include <errno.h> +#include <fcntl.h> +#include <glob.h> +#include <signal.h> +#include <libgen.h> +#include <limits.h> +#include <netdb.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <termios.h> +#include <time.h> +#include <tzfile.h> +#include <unistd.h> + +#endif /* tnftp */ #include "ftp_var.h" @@ -99,7 +131,7 @@ setpeer(int argc, char *argv[]) (void)another(&argc, &argv, "to"); if (argc < 2 || argc > 3) { usage: - fprintf(ttyout, "usage: %s host-name [port]\n", argv[0]); + UPRINTF("usage: %s host-name [port]\n", argv[0]); code = -1; return; } @@ -112,7 +144,7 @@ setpeer(int argc, char *argv[]) if (gatemode) { if (gateserver == NULL || *gateserver == '\0') - errx(1, "gateserver not defined (shouldn't happen)"); + errx(1, "main: gateserver not defined"); host = hookup(gateserver, port); } else host = hookup(argv[1], port); @@ -150,7 +182,7 @@ parse_feat(const char *line) /* * work-around broken ProFTPd servers that can't - * even obey RFC 2389. + * even obey RFC2389. */ while (*line && isspace((int)*line)) line++; @@ -177,7 +209,7 @@ getremoteinfo(void) int overbose, i; overbose = verbose; - if (debug == 0) + if (ftp_debug == 0) verbose = -1; /* determine remote system type */ @@ -243,7 +275,8 @@ getremoteinfo(void) features[FEAT_FEAT] = 1; } else features[FEAT_FEAT] = 0; - if (debug) { +#ifndef NO_DEBUG + if (ftp_debug) { #define DEBUG_FEAT(x) fprintf(ttyout, "features[" #x "] = %d\n", features[(x)]) DEBUG_FEAT(FEAT_FEAT); DEBUG_FEAT(FEAT_MDTM); @@ -253,6 +286,7 @@ getremoteinfo(void) DEBUG_FEAT(FEAT_TVFS); #undef DEBUG_FEAT } +#endif reply_callback = NULL; verbose = overbose; @@ -352,29 +386,29 @@ ftp_login(const char *host, const char *luser, const char *lpass) { char tmp[80]; char *user, *pass, *acct, *p; + char emptypass[] = ""; const char *errormsg; int n, aflag, rval, nlen; aflag = rval = 0; user = pass = acct = NULL; if (luser) - user = xstrdup(luser); + user = ftp_strdup(luser); if (lpass) - pass = xstrdup(lpass); + pass = ftp_strdup(lpass); - if (debug) - fprintf(ttyout, "ftp_login: user `%s' pass `%s' host `%s'\n", - user ? user : "<null>", pass ? pass : "<null>", - host ? host : "<null>"); + DPRINTF("ftp_login: user `%s' pass `%s' host `%s'\n", + user ? user : "<null>", pass ? pass : "<null>", + host ? host : "<null>"); /* * Set up arguments for an anonymous FTP session, if necessary. */ if (anonftp) { FREEPTR(user); - user = xstrdup("anonymous"); /* as per RFC 1635 */ + user = ftp_strdup("anonymous"); /* as per RFC1635 */ FREEPTR(pass); - pass = xstrdup(getoptionvalue("anonpass")); + pass = ftp_strdup(getoptionvalue("anonpass")); } if (ruserpass(host, &user, &pass, &acct) < 0) { @@ -394,9 +428,9 @@ ftp_login(const char *host, const char *luser, const char *lpass) code = -1; goto cleanup_ftp_login; } else if (nlen == 0) { - user = xstrdup(localname); + user = ftp_strdup(localname); } else { - user = xstrdup(tmp); + user = ftp_strdup(tmp); } } @@ -405,7 +439,7 @@ ftp_login(const char *host, const char *luser, const char *lpass) size_t len; len = strlen(user) + 1 + strlen(host) + 1; - nuser = xmalloc(len); + nuser = ftp_malloc(len); (void)strlcpy(nuser, user, len); (void)strlcat(nuser, "@", len); (void)strlcat(nuser, host, len); @@ -417,7 +451,9 @@ ftp_login(const char *host, const char *luser, const char *lpass) if (n == CONTINUE) { if (pass == NULL) { p = getpass("Password: "); - pass = xstrdup(p); + if (p == NULL) + p = emptypass; + pass = ftp_strdup(p); memset(p, 0, strlen(p)); } n = command("PASS %s", pass); @@ -427,11 +463,13 @@ ftp_login(const char *host, const char *luser, const char *lpass) aflag++; if (acct == NULL) { p = getpass("Account: "); - acct = xstrdup(p); + if (p == NULL) + p = emptypass; + acct = ftp_strdup(p); memset(p, 0, strlen(p)); } if (acct[0] == '\0') { - warnx("Login failed."); + warnx("Login failed"); goto cleanup_ftp_login; } n = command("ACCT %s", acct); @@ -439,11 +477,11 @@ ftp_login(const char *host, const char *luser, const char *lpass) } if ((n != COMPLETE) || (!aflag && acct != NULL && command("ACCT %s", acct) != COMPLETE)) { - warnx("Login failed."); + warnx("Login failed"); goto cleanup_ftp_login; } rval = 1; - username = xstrdup(user); + username = ftp_strdup(user); if (proxy) goto cleanup_ftp_login; @@ -466,7 +504,7 @@ ftp_login(const char *host, const char *luser, const char *lpass) memset(pass, 0, strlen(pass)); FREEPTR(pass); if (acct != NULL) - memset(acct, 0, strlen(pass)); + memset(acct, 0, strlen(acct)); FREEPTR(acct); return (rval); } @@ -546,7 +584,7 @@ remglob(char *argv[], int doswitch, const char **errbuf) (void)strlcat(temp, "/", sizeof(temp)); (void)strlcat(temp, TMPFILE, sizeof(temp)); if ((fd = mkstemp(temp)) < 0) { - warn("unable to create temporary file %s", temp); + warn("Unable to create temporary file `%s'", temp); return (NULL); } close(fd); @@ -573,12 +611,10 @@ remglob(char *argv[], int doswitch, const char **errbuf) (void)unlink(temp); if (ftemp == NULL) { if (errbuf == NULL) - fputs( - "can't find list of remote files, oops.\n", - ttyout); + warnx("Can't find list of remote files"); else *errbuf = - "can't find list of remote files, oops."; + "Can't find list of remote files"; return (NULL); } } @@ -607,16 +643,16 @@ globulize(const char *pattern) char *p; if (!doglob) - return (xstrdup(pattern)); + return (ftp_strdup(pattern)); flags = GLOB_BRACE|GLOB_NOCHECK|GLOB_TILDE; memset(&gl, 0, sizeof(gl)); if (glob(pattern, flags, NULL, &gl) || gl.gl_pathc == 0) { - warnx("%s: not found", pattern); + warnx("Glob pattern `%s' not found", pattern); globfree(&gl); return (NULL); } - p = xstrdup(gl.gl_pathv[0]); + p = ftp_strdup(gl.gl_pathv[0]); globfree(&gl); return (p); } @@ -632,7 +668,7 @@ remotesize(const char *file, int noisy) overbose = verbose; size = -1; - if (debug == 0) + if (ftp_debug == 0) verbose = -1; if (! features[FEAT_SIZE]) { if (noisy) @@ -654,7 +690,7 @@ remotesize(const char *file, int noisy) } else { if (r == ERROR && code == 500 && features[FEAT_SIZE] == -1) features[FEAT_SIZE] = 0; - if (noisy && debug == 0) { + if (noisy && ftp_debug == 0) { fputs(reply_string, ttyout); putc('\n', ttyout); } @@ -676,7 +712,7 @@ remotemodtime(const char *file, int noisy) overbose = verbose; ocode = code; rtime = -1; - if (debug == 0) + if (ftp_debug == 0) verbose = -1; if (! features[FEAT_MDTM]) { if (noisy) @@ -688,7 +724,6 @@ remotemodtime(const char *file, int noisy) if (r == COMPLETE) { struct tm timebuf; char *timestr, *frac; - int yy, mo, day, hour, min, sec; /* * time-val = 14DIGIT [ "." 1*DIGIT ] @@ -720,33 +755,28 @@ remotemodtime(const char *file, int noisy) timestr[1] = '0'; fprintf(ttyout, "Converted to `%s'\n", timestr); } + memset(&timebuf, 0, sizeof(timebuf)); if (strlen(timestr) != 14 || - sscanf(timestr, "%04d%02d%02d%02d%02d%02d", - &yy, &mo, &day, &hour, &min, &sec) != 6) { + (strptime(timestr, "%Y%m%d%H%M%S", &timebuf) == NULL)) { bad_parse_time: fprintf(ttyout, "Can't parse time `%s'.\n", timestr); goto cleanup_parse_time; } - memset(&timebuf, 0, sizeof(timebuf)); - timebuf.tm_sec = sec; - timebuf.tm_min = min; - timebuf.tm_hour = hour; - timebuf.tm_mday = day; - timebuf.tm_mon = mo - 1; - timebuf.tm_year = yy - TM_YEAR_BASE; timebuf.tm_isdst = -1; rtime = timegm(&timebuf); if (rtime == -1) { - if (noisy || debug != 0) + if (noisy || ftp_debug != 0) goto bad_parse_time; else goto cleanup_parse_time; - } else if (debug) - fprintf(ttyout, "parsed date as: %s", ctime(&rtime)); + } else + DPRINTF("parsed date `%s' as " LLF ", %s", + timestr, (LLT)rtime, + rfc2822time(localtime(&rtime))); } else { if (r == ERROR && code == 500 && features[FEAT_MDTM] == -1) features[FEAT_MDTM] = 0; - if (noisy && debug == 0) { + if (noisy && ftp_debug == 0) { fputs(reply_string, ttyout); putc('\n', ttyout); } @@ -759,6 +789,21 @@ remotemodtime(const char *file, int noisy) } /* + * Format tm in an RFC2822 compatible manner, with a trailing \n. + * Returns a pointer to a static string containing the result. + */ +const char * +rfc2822time(const struct tm *tm) +{ + static char result[50]; + + if (strftime(result, sizeof(result), + "%a, %d %b %Y %H:%M:%S %z\n", tm) == 0) + errx(1, "Can't convert RFC2822 time: buffer too small"); + return result; +} + +/* * Update global `localcwd', which contains the state of the local cwd */ void @@ -767,8 +812,7 @@ updatelocalcwd(void) if (getcwd(localcwd, sizeof(localcwd)) == NULL) localcwd[0] = '\0'; - if (debug) - fprintf(ttyout, "got localcwd as `%s'\n", localcwd); + DPRINTF("got localcwd as `%s'\n", localcwd); } /* @@ -782,7 +826,7 @@ updateremotecwd(void) overbose = verbose; ocode = code; - if (debug == 0) + if (ftp_debug == 0) verbose = -1; if (command("PWD") != COMPLETE) goto badremotecwd; @@ -800,8 +844,7 @@ updateremotecwd(void) remotecwd[i] = *cp; } remotecwd[i] = '\0'; - if (debug) - fprintf(ttyout, "got remotecwd as `%s'\n", remotecwd); + DPRINTF("got remotecwd as `%s'\n", remotecwd); goto cleanupremotecwd; badremotecwd: remotecwd[0]='\0'; @@ -821,7 +864,7 @@ fileindir(const char *file, const char *dir) char realdir[PATH_MAX+1]; size_t dirlen; - /* determine parent directory of file */ + /* determine parent directory of file */ (void)strlcpy(parentdirbuf, file, sizeof(parentdirbuf)); parentdir = dirname(parentdirbuf); if (strcmp(parentdir, ".") == 0) @@ -878,10 +921,12 @@ list_vertical(StringList *sl) putc('\n', ttyout); break; } - w = strlen(p); - while (w < width) { - w = (w + 8) &~ 7; - (void)putc('\t', ttyout); + if (p) { + w = strlen(p); + while (w < width) { + w = (w + 8) &~ 7; + (void)putc('\t', ttyout); + } } } } @@ -1026,11 +1071,11 @@ setupsockbufsize(int sock) if (setsockopt(sock, SOL_SOCKET, SO_SNDBUF, (void *)&sndbuf_size, sizeof(sndbuf_size)) == -1) - warn("unable to set sndbuf size %d", sndbuf_size); + warn("Unable to set sndbuf size %d", sndbuf_size); if (setsockopt(sock, SOL_SOCKET, SO_RCVBUF, (void *)&rcvbuf_size, sizeof(rcvbuf_size)) == -1) - warn("unable to set rcvbuf size %d", rcvbuf_size); + warn("Unable to set rcvbuf size %d", rcvbuf_size); } /* @@ -1186,7 +1231,7 @@ parseport(const char *port, int defport) long nport; char *p, *ep; - p = xstrdup(port); + p = ftp_strdup(port); nport = strtol(p, &ep, 10); if (*ep != '\0' && ep == p) { struct servent *svp; @@ -1229,8 +1274,7 @@ isipv6addr(const char *addr) rv = 1; freeaddrinfo(res); } - if (debug) - fprintf(ttyout, "isipv6addr: got %d for %s\n", rv, addr); + DPRINTF("isipv6addr: got %d for %s\n", rv, addr); #endif return (rv == 1) ? 1 : 0; } @@ -1285,29 +1329,65 @@ getline(FILE *stream, char *buf, size_t buflen, const char **errormsg) return len; } - /* - * Internal version of connect(2); sets socket buffer sizes first and + * Internal version of connect(2); sets socket buffer sizes, + * binds to a specific local address (if set), and * supports a connection timeout using a non-blocking connect(2) with * a poll(2). * Socket fcntl flags are temporarily updated to include O_NONBLOCK; * these will not be reverted on connection failure. - * Returns -1 upon failure (with errno set to the problem), or 0 on success. + * Returns 0 on success, or -1 upon failure (with an appropriate + * error message displayed.) */ int -xconnect(int sock, const struct sockaddr *name, socklen_t namelen) +ftp_connect(int sock, const struct sockaddr *name, socklen_t namelen) { int flags, rv, timeout, error; socklen_t slen; struct timeval endtime, now, td; struct pollfd pfd[1]; + char hname[NI_MAXHOST]; setupsockbufsize(sock); + if (getnameinfo(name, namelen, + hname, sizeof(hname), NULL, 0, NI_NUMERICHOST) != 0) + strlcpy(hname, "?", sizeof(hname)); + + if (bindai != NULL) { /* bind to specific addr */ + struct addrinfo *ai; + + for (ai = bindai; ai != NULL; ai = ai->ai_next) { + if (ai->ai_family == name->sa_family) + break; + } + if (ai == NULL) + ai = bindai; + if (bind(sock, ai->ai_addr, ai->ai_addrlen) == -1) { + char bname[NI_MAXHOST]; + int saveerr; + + saveerr = errno; + if (getnameinfo(ai->ai_addr, ai->ai_addrlen, + bname, sizeof(bname), NULL, 0, NI_NUMERICHOST) != 0) + strlcpy(bname, "?", sizeof(bname)); + errno = saveerr; + warn("Can't bind to `%s'", bname); + return -1; + } + } - if ((flags = fcntl(sock, F_GETFL, 0)) == -1) - return -1; /* get current socket flags */ - if (fcntl(sock, F_SETFL, flags | O_NONBLOCK) == -1) - return -1; /* set non-blocking connect */ + /* save current socket flags */ + if ((flags = fcntl(sock, F_GETFL, 0)) == -1) { + warn("Can't %s socket flags for connect to `%s'", + "save", hname); + return -1; + } + /* set non-blocking connect */ + if (fcntl(sock, F_SETFL, flags | O_NONBLOCK) == -1) { + warn("Can't set socket non-blocking for connect to `%s'", + hname); + return -1; + } /* NOTE: we now must restore socket flags on successful exit */ @@ -1321,8 +1401,11 @@ xconnect(int sock, const struct sockaddr *name, socklen_t namelen) rv = connect(sock, name, namelen); /* inititate the connection */ if (rv == -1) { /* connection error */ - if (errno != EINPROGRESS) /* error isn't "please wait" */ + if (errno != EINPROGRESS) { /* error isn't "please wait" */ + connecterror: + warn("Can't connect to `%s'", hname); return -1; + } /* connect EINPROGRESS; wait */ do { @@ -1336,34 +1419,39 @@ xconnect(int sock, const struct sockaddr *name, socklen_t namelen) timeout = INFTIM; } pfd[0].revents = 0; - rv = xpoll(pfd, 1, timeout); + rv = ftp_poll(pfd, 1, timeout); /* loop until poll ! EINTR */ } while (rv == -1 && errno == EINTR); if (rv == 0) { /* poll (connect) timed out */ errno = ETIMEDOUT; - return -1; + goto connecterror; } if (rv == -1) { /* poll error */ - return -1; + goto connecterror; } else if (pfd[0].revents & (POLLIN|POLLOUT)) { slen = sizeof(error); /* OK, or pending error */ if (getsockopt(sock, SOL_SOCKET, SO_ERROR, - &error, &slen) == -1) - return -1; /* Solaris pending error */ - if (error != 0) { + &error, &slen) == -1) { + /* Solaris pending error */ + goto connecterror; + } else if (error != 0) { errno = error; /* BSD pending error */ - return -1; + goto connecterror; } } else { errno = EBADF; /* this shouldn't happen ... */ - return -1; + goto connecterror; } } - if (fcntl(sock, F_SETFL, flags) == -1) /* restore socket flags */ + if (fcntl(sock, F_SETFL, flags) == -1) { + /* restore socket flags */ + warn("Can't %s socket flags for connect to `%s'", + "restore", hname); return -1; + } return 0; } @@ -1371,7 +1459,7 @@ xconnect(int sock, const struct sockaddr *name, socklen_t namelen) * Internal version of listen(2); sets socket buffer sizes first. */ int -xlisten(int sock, int backlog) +ftp_listen(int sock, int backlog) { setupsockbufsize(sock); @@ -1383,12 +1471,13 @@ xlisten(int sock, int backlog) * on platforms without the former. */ int -xpoll(struct pollfd *fds, int nfds, int timeout) +ftp_poll(struct pollfd *fds, int nfds, int timeout) { -#if HAVE_POLL +#if defined(HAVE_POLL) return poll(fds, nfds, timeout); -#elif HAVE_SELECT /* implement poll(2) using select(2) */ +#elif defined(HAVE_SELECT) + /* implement poll(2) using select(2) */ fd_set rset, wset, xset; const int rsetflags = POLLIN | POLLRDNORM; const int wsetflags = POLLOUT | POLLWRNORM; @@ -1449,7 +1538,7 @@ xpoll(struct pollfd *fds, int nfds, int timeout) * malloc() with inbuilt error checking */ void * -xmalloc(size_t size) +ftp_malloc(size_t size) { void *p; @@ -1463,7 +1552,7 @@ xmalloc(size_t size) * sl_init() with inbuilt error checking */ StringList * -xsl_init(void) +ftp_sl_init(void) { StringList *p; @@ -1477,7 +1566,7 @@ xsl_init(void) * sl_add() with inbuilt error checking */ void -xsl_add(StringList *sl, char *i) +ftp_sl_add(StringList *sl, char *i) { if (sl_add(sl, i) == -1) @@ -1488,12 +1577,12 @@ xsl_add(StringList *sl, char *i) * strdup() with inbuilt error checking */ char * -xstrdup(const char *str) +ftp_strdup(const char *str) { char *s; if (str == NULL) - errx(1, "xstrdup() called with NULL argument"); + errx(1, "ftp_strdup: called with NULL argument"); s = strdup(str); if (s == NULL) err(1, "Unable to allocate memory for string copy"); diff --git a/net/tnftp/files/src/version.h b/net/tnftp/files/src/version.h index fe8af96f38e..3cc6369fa52 100644 --- a/net/tnftp/files/src/version.h +++ b/net/tnftp/files/src/version.h @@ -1,7 +1,7 @@ -/* NetBSD: version.h,v 1.1.1.10 2005/06/10 03:53:48 lukem Exp */ -/* from NetBSD: version.h,v 1.55 2005/06/10 00:18:47 lukem Exp */ +/* $NetBSD: version.h,v 1.6 2007/08/07 02:07:03 lukem Exp $ */ +/* from NetBSD: version.h,v 1.69 2007/08/06 03:41:14 lukem Exp */ /*- - * Copyright (c) 1999-2005 The NetBSD Foundation, Inc. + * Copyright (c) 1999-2007 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation @@ -41,5 +41,5 @@ #endif #ifndef FTP_VERSION -#define FTP_VERSION "20050610" +#define FTP_VERSION "20070722" #endif diff --git a/net/tnftp/files/tnftp.h b/net/tnftp/files/tnftp.h index 3ddcd9da7e0..cd318d760b4 100644 --- a/net/tnftp/files/tnftp.h +++ b/net/tnftp/files/tnftp.h @@ -1,78 +1,140 @@ -/* NetBSD: tnftp.h,v 1.21 2005/06/25 06:27:32 lukem Exp */ +/* $NetBSD: tnftp.h,v 1.11 2007/08/07 02:06:56 lukem Exp $ */ -#define FTP_PRODUCT "tnftp" -#define FTP_VERSION "20050625" +#define FTP_PRODUCT PACKAGE_NAME +#define FTP_VERSION PACKAGE_VERSION #include "config.h" -#include <sys/types.h> -#include <sys/param.h> -#include <sys/ioctl.h> -#include <sys/socket.h> -#include <sys/stat.h> -#include <sys/wait.h> - -#include <netinet/in.h> -#include <netinet/in_systm.h> -#include <netinet/ip.h> - -#include <arpa/ftp.h> -#include <arpa/inet.h> - +#include <stdio.h> #include <ctype.h> #include <errno.h> -#include <fcntl.h> -#include <limits.h> -#ifdef HAVE_RFC2553_NETDB -#include <netdb.h> + +#if defined(HAVE_SYS_TYPES_H) +# include <sys/types.h> +#endif +#if defined(STDC_HEADERS) +# include <stdarg.h> +# include <stdlib.h> +# include <string.h> +#endif +#if defined(HAVE_LIBGEN_H) +# include <libgen.h> +#endif +#if defined(HAVE_UNISTD_H) +# include <unistd.h> +#endif +#if defined(HAVE_POLL_H) +# include <poll.h> +#elif defined(HAVE_SYS_POLL_H) +# include <sys/poll.h> +#endif +#if defined(HAVE_SYS_SOCKET_H) +# include <sys/socket.h> +#endif +#if defined(HAVE_NETINET_IN_H) +# include <netinet/in.h> +#endif +#if defined(HAVE_NETINET_IN_SYSTM_H) +# include <netinet/in_systm.h> +#endif +#if defined(HAVE_NETINET_IP_H) +# include <netinet/ip.h> +#endif +#if defined(HAVE_NETDB_H) +# if HAVE_DECL_AI_NUMERICHOST +# include <netdb.h> +# else /* !HAVE_DECL_AI_NUMERICHOST */ +# define getaddrinfo non_rfc2553_getaddrinfo +# include <netdb.h> +# undef getaddrinfo +# endif /* !HAVE_DECL_AI_NUMERICHOST */ +#endif +#if defined(HAVE_ARPA_INET_H) +# include <arpa/inet.h> +#endif +#if defined(HAVE_DIRENT_H) +# include <dirent.h> #else -#define getaddrinfo non_rfc2553_getaddrinfo -#include <netdb.h> -#undef getaddrinfo -#endif -#include <pwd.h> -#include <setjmp.h> -#include <signal.h> -#include <stdarg.h> -#include <stddef.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <termios.h> -#include <unistd.h> +# define dirent direct +# if defined(HAVE_SYS_NDIR_H) +# include <sys/ndir.h> +# endif +# if defined(HAVE_SYS_DIR_H) +# include <sys/dir.h> +# endif +# if defined(HAVE_NDIR_H) +# include <ndir.h> +# endif +#endif + +#if defined(HAVE_SYS_IOCTL_H) +# include <sys/ioctl.h> +#endif +#if defined(HAVE_SYS_PARAM_H) +# include <sys/param.h> +#endif +#if defined(HAVE_SYS_STAT_H) +# include <sys/stat.h> +#endif +#if defined(HAVE_SYS_SYSLIMITS_H) +# include <sys/syslimits.h> +#endif +#if defined(HAVE_SYS_WAIT_H) +# include <sys/wait.h> +#endif + +#if defined(HAVE_ARPA_FTP_H) +# include <arpa/ftp.h> +#endif + +#if defined(HAVE_FCNTL_H) +# include <fcntl.h> +#endif +#if defined(HAVE_LIMITS_H) +# include <limits.h> +#endif +#if defined(HAVE_PWD_H) +# include <pwd.h> +#endif +#if defined(HAVE_SETJMP_H) +# include <setjmp.h> +#endif +#if defined(HAVE_SIGNAL_H) +# include <signal.h> +#endif +#if defined(HAVE_STDDEF_H) +# include <stddef.h> +#endif +#if defined(HAVE_TERMIOS_H) +# include <termios.h> +#endif -#if HAVE_POLL +#if defined(HAVE_POLL) /* we use poll */ -#elif HAVE_SELECT +#elif defined(HAVE_SELECT) /* we use select */ -#else /* ! HAVE_POLL && ! HAVE_SELECT */ +#else /* !defined(HAVE_POLL) && !defined(HAVE_SELECT) */ # error "no poll() or select() found" #endif - -#if HAVE_POLL_H -# include <poll.h> -#elif HAVE_SYS_POLL_H -# include <sys/poll.h> -#endif -#ifndef POLLIN +#if !defined(POLLIN) # define POLLIN 0x0001 #endif -#ifndef POLLOUT +#if !defined(POLLOUT) # define POLLOUT 0x0004 #endif -#ifndef POLLRDNORM +#if !defined(POLLRDNORM) # define POLLRDNORM 0x0040 #endif -#ifndef POLLWRNORM +#if !defined(POLLWRNORM) # define POLLWRNORM POLLOUT #endif -#ifndef POLLRDBAND +#if !defined(POLLRDBAND) # define POLLRDBAND 0x0080 #endif -#ifndef INFTIM +#if !defined(INFTIM) # define INFTIM -1 #endif -#if ! HAVE_STRUCT_POLLFD +#if !defined(HAVE_STRUCT_POLLFD) struct pollfd { int fd; short events; @@ -80,58 +142,35 @@ struct pollfd { }; #endif -#if HAVE_DIRENT_H -# include <dirent.h> -#else -# define dirent direct -# if HAVE_SYS_NDIR_H -# include <sys/ndir.h> -# endif -# if HAVE_SYS_DIR_H -# include <sys/dir.h> -# endif -# if HAVE_NDIR_H -# include <ndir.h> -# endif -#endif - -#if TIME_WITH_SYS_TIME +#if defined(TIME_WITH_SYS_TIME) # include <sys/time.h> # include <time.h> #else -# if HAVE_SYS_TIME_H +# if defined(HAVE_SYS_TIME_H) # include <sys/time.h> # else # include <time.h> # endif #endif -#if HAVE_SYS_SYSLIMITS_H -# include <sys/syslimits.h> -#endif - -#if HAVE_ERR_H +#if defined(HAVE_ERR_H) # include <err.h> #endif -#if USE_GLOB_H /* not set by configure; used by other build systems */ +#if defined(USE_GLOB_H) /* not set by configure; used by other build systems */ # include <glob.h> #else # include "ftpglob.h" #endif -#if HAVE_LIBGEN_H -# include <libgen.h> -#endif - -#if HAVE_PATHS_H +#if defined(HAVE_PATHS_H) # include <paths.h> #endif -#ifndef _PATH_BSHELL -#define _PATH_BSHELL "/bin/sh" +#if !defined(_PATH_BSHELL) +# define _PATH_BSHELL "/bin/sh" #endif -#ifndef _PATH_TMP -#define _PATH_TMP "/tmp/" +#if !defined(_PATH_TMP) +# define _PATH_TMP "/tmp/" #endif typedef struct _stringlist { @@ -145,7 +184,7 @@ int sl_add(StringList *, char *); void sl_free(StringList *, int); char *sl_find(StringList *, char *); -#if HAVE_TERMCAP_H +#if defined(HAVE_TERMCAP_H) # include <termcap.h> #else int tgetent(char *, const char *); @@ -154,15 +193,7 @@ int tgetflag(const char *); int tgetnum(const char *); char *tgoto(const char *, int, int); void tputs(const char *, int, int (*)(int)); -#endif - -#if HAVE_UTIL_H -# include <util.h> -#endif - -#if HAVE_LIBUTIL_H -# include <libutil.h> -#endif +#endif /* !HAVE_TERMCAP_H */ #if defined(HAVE_VIS_H) && defined(HAVE_STRVIS) && defined(HAVE_STRUNVIS) # include <vis.h> @@ -170,15 +201,15 @@ void tputs(const char *, int, int (*)(int)); # include "ftpvis.h" #endif -#if ! HAVE_IN_PORT_T +#if !defined(HAVE_IN_PORT_T) typedef unsigned short in_port_t; #endif -#if ! HAVE_SA_FAMILY_T +#if !defined(HAVE_SA_FAMILY_T) typedef unsigned short sa_family_t; #endif -#if ! HAVE_SOCKLEN_T +#if !defined(HAVE_SOCKLEN_T) #ifdef __sgi typedef int socklen_t; #else @@ -190,12 +221,13 @@ typedef unsigned int socklen_t; typedef unsigned UINT32_T uint32_t; #endif -#if HAVE_AF_INET6 && HAVE_SOCKADDR_IN6 && HAVE_NS_IN6ADDRSZ +#if HAVE_DECL_AF_INET6 \ + && defined(HAVE_STRUCT_SOCKADDR_IN6) \ + && HAVE_DECL_NS_IN6ADDRSZ # define INET6 #endif - -#if ! HAVE_RFC2553_NETDB +#if !HAVE_DECL_AI_NUMERICHOST /* RFC 2553 */ #undef EAI_ADDRFAMILY @@ -268,10 +300,11 @@ typedef unsigned UINT32_T uint32_t; #undef AI_V4MAPPED #define AI_V4MAPPED 0x00000800 /* accept IPv4-mapped IPv6 address */ -#endif /* ! HAVE_RFC2553_NETDB */ +#endif /* !HAVE_DECL_AI_NUMERICHOST */ -#if ! HAVE_RFC2553_NETDB && ! HAVE_ADDRINFO +#if !HAVE_DECL_AI_NUMERICHOST && !defined(HAVE_STRUCT_ADDRINFO) \ + && !defined(USE_SOCKS) struct addrinfo { int ai_flags; /* AI_PASSIVE, AI_CANONNAME, AI_NUMERICHOST */ @@ -289,156 +322,143 @@ int getaddrinfo(const char *, const char *, int getnameinfo(const struct sockaddr *, socklen_t, char *, size_t, char *, size_t, int); void freeaddrinfo(struct addrinfo *); -char *gai_strerror(int); - -#endif /* ! HAVE_RFC2553_NETDB && ! HAVE_ADDRINFO */ +const char *gai_strerror(int); +#endif /* !HAVE_DECL_AI_NUMERICHOST && !defined(HAVE_STRUCT_ADDRINFO) \ + && !defined(USE_SOCKS) */ -#if ! HAVE_D_NAMLEN +#if !defined(HAVE_STRUCT_DIRENT_D_NAMLEN) # define DIRENT_MISSING_D_NAMLEN #endif -#if ! HAVE_H_ERRNO_D +#if !HAVE_DECL_H_ERRNO extern int h_errno; #endif #define HAVE_H_ERRNO 1 /* XXX: an assumption for now... */ -#if ! HAVE_FCLOSE_D +#if !HAVE_DECL_FCLOSE int fclose(FILE *); #endif -#if ! HAVE_GETPASS_D +#if !HAVE_DECL_GETPASS char *getpass(const char *); #endif -#if ! HAVE_OPTARG_D +#if !HAVE_DECL_OPTARG extern char *optarg; #endif -#if ! HAVE_OPTIND_D +#if !HAVE_DECL_OPTIND extern int optind; #endif -#if ! HAVE_PCLOSE_D +#if !HAVE_DECL_PCLOSE int pclose(FILE *); #endif -#if ! HAVE_DIRNAME_D +#if !HAVE_DECL_DIRNAME char *dirname(char *); #endif -#if ! HAVE_ERR +#if !defined(HAVE_ERR) void err(int, const char *, ...); void errx(int, const char *, ...); void warn(const char *, ...); void warnx(const char *, ...); #endif -#if ! HAVE_FGETLN +#if !defined(HAVE_FGETLN) char *fgetln(FILE *, size_t *); #endif -#if ! HAVE_FSEEKO +#if !defined(HAVE_FSEEKO) int fseeko(FILE *, off_t, int); #endif -#if ! HAVE_FPARSELN -# define FPARSELN_UNESCESC 0x01 -# define FPARSELN_UNESCCONT 0x02 -# define FPARSELN_UNESCCOMM 0x04 -# define FPARSELN_UNESCREST 0x08 -# define FPARSELN_UNESCALL 0x0f -char *fparseln(FILE *, size_t *, size_t *, const char[3], int); -#endif - -#if ! HAVE_INET_NTOP +#if !defined(HAVE_INET_NTOP) const char *inet_ntop(int, const void *, char *, socklen_t); #endif -#if ! HAVE_INET_PTON +#if !defined(HAVE_INET_PTON) int inet_pton(int, const char *, void *); #endif -#if ! HAVE_MKSTEMP +#if !defined(HAVE_MKSTEMP) int mkstemp(char *); #endif -#if ! HAVE_SETPROGNAME +#if !defined(HAVE_SETPROGNAME) const char *getprogname(void); void setprogname(const char *); #endif -#if ! HAVE_SNPRINTF +#if !defined(HAVE_SNPRINTF) int snprintf(char *, size_t, const char *, ...); #endif -#if ! HAVE_STRDUP +#if !defined(HAVE_STRDUP) char *strdup(const char *); #endif -#if ! HAVE_STRERROR +#if !defined(HAVE_STRERROR) char *strerror(int); #endif -#if ! HAVE_STRPTIME || ! HAVE_STRPTIME_D +#if !defined(HAVE_STRPTIME) || !HAVE_DECL_STRPTIME char *strptime(const char *, const char *, struct tm *); #endif -#if HAVE_QUAD_SUPPORT -# if ! HAVE_STRTOLL && HAVE_LONG_LONG +#if defined(HAVE_PRINTF_LONG_LONG) && defined(HAVE_LONG_LONG_INT) +# if !defined(HAVE_STRTOLL) long long strtoll(const char *, char **, int); -# if ! defined(LLONG_MIN) -# define LLONG_MIN (-0x7fffffffffffffffL-1) -# endif -# if ! defined(LLONG_MAX) -# define LLONG_MAX (0x7fffffffffffffffL) -# endif # endif -#else /* ! HAVE_QUAD_SUPPORT */ +# if !defined(LLONG_MIN) +# define LLONG_MIN (-0x7fffffffffffffffLL-1) +# endif +# if !defined(LLONG_MAX) +# define LLONG_MAX (0x7fffffffffffffffLL) +# endif +#else /* !(defined(HAVE_PRINTF_LONG_LONG) && defined(HAVE_LONG_LONG_INT)) */ # define NO_LONG_LONG 1 -#endif /* ! HAVE_QUAD_SUPPORT */ +#endif /* !(defined(HAVE_PRINTF_LONG_LONG) && defined(HAVE_LONG_LONG_INT)) */ -#if ! HAVE_TIMEGM +#if !defined(HAVE_TIMEGM) time_t timegm(struct tm *); #endif -#if ! HAVE_HSTRERROR -char *strerror(int); -#endif - -#if ! HAVE_STRLCAT +#if !defined(HAVE_STRLCAT) size_t strlcat(char *, const char *, size_t); #endif -#if ! HAVE_STRLCPY +#if !defined(HAVE_STRLCPY) size_t strlcpy(char *, const char *, size_t); #endif -#if ! HAVE_STRSEP +#if !defined(HAVE_STRSEP) char *strsep(char **stringp, const char *delim); #endif -#if ! HAVE_UTIMES +#if !defined(HAVE_UTIMES) int utimes(const char *, const struct timeval *); #endif -#if ! HAVE_MEMMOVE +#if !defined(HAVE_MEMMOVE) # define memmove(a,b,c) bcopy((b),(a),(c)) /* XXX: add others #defines for borken systems? */ #endif -#if HAVE_GETPASSPHRASE +#if defined(HAVE_GETPASSPHRASE) # define getpass getpassphrase #endif -#if ! defined(MIN) +#if !defined(MIN) # define MIN(a, b) ((a) < (b) ? (a) : (b)) #endif -#if ! defined(MAX) +#if !defined(MAX) # define MAX(a, b) ((a) < (b) ? (b) : (a)) #endif -#if ! defined(timersub) +#if !defined(timersub) # define timersub(tvp, uvp, vvp) \ do { \ (vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \ @@ -450,7 +470,7 @@ int utimes(const char *, const struct timeval *); } while (0) #endif -#if ! defined(S_ISLNK) +#if !defined(S_ISLNK) # define S_ISLNK(m) ((m & S_IFMT) == S_IFLNK) #endif @@ -458,3 +478,28 @@ int utimes(const char *, const struct timeval *); #define SECSPERHOUR 3600 #define SECSPERDAY 86400 #define TM_YEAR_BASE 1900 + +#if defined(USE_SOCKS) /* (Dante) SOCKS5 */ +#define connect Rconnect +#define bind Rbind +#define getsockname Rgetsockname +#define getpeername Rgetpeername +#define accept Raccept +#define rresvport Rrresvport +#define bindresvport Rbindresvport +#define gethostbyname Rgethostbyname +#define gethostbyname2 Rgethostbyname2 +#define sendto Rsendto +#define recvfrom Rrecvfrom +#define recvfrom Rrecvfrom +#define write Rwrite +#define writev Rwritev +#define send Rsend +#define sendmsg Rsendmsg +#define read Rread +#define readv Rreadv +#define recv Rrecv +#define recvmsg Rrecvmsg +#define getaddrinfo Rgetaddrinfo +#define getipnodebyname Rgetipnodebyname +#endif /* defined(USE_SOCKS) */ diff --git a/net/tnftp/files/todo b/net/tnftp/files/todo index 71554edc087..7a9e66ce390 100644 --- a/net/tnftp/files/todo +++ b/net/tnftp/files/todo @@ -1,31 +1,21 @@ -NetBSD: todo,v 1.7 2005/05/11 03:03:42 lukem Exp +$NetBSD: todo,v 1.4 2007/08/07 02:06:56 lukem Exp $ Current Items ------------- -autoconf test for HAVE_GETADDRINFO_D (declaration) if providing -getaddrinfo() override. (required for UnixWare 7.1.1) +autoconf test for HAVE_DECL_GETADDRINFO if providing getaddrinfo() override. +(required for UnixWare 7.1.1) Interix may need hack to fix detection of getpgrp() void args. (See pkgsrc/net/tnftp/files/src/progressbar.c 1.2) -Update: INSTALL NEWS README - Old Items --------- -macosx install notes - at end of configure, show summary of options used and features found -if socks is defined, disable ipv6 and use own getaddrinfo()/getnameinfo() -(for tron) - add locale autoconf checks -AC_CHECK_SIZEOF(off_t, 0) doesn't work on FreeBSD 4.0 because the -test doesn't include <sys/types.h>. fix autoconf? - in configure, check for ansi c compiler and barf if it fails check if we need #defines for memcpy() et al |